org.opensourcephysics.displayejs
Class InteractionTargetElementPosition

java.lang.Object
  extended by org.opensourcephysics.displayejs.InteractionTargetElementPosition
All Implemented Interfaces:
Drawable, Interactive, Measurable, InteractionTarget
Direct Known Subclasses:
InteractionTargetCursorPosition, InteractionTargetPoligonMovingPoint, InteractionTargetTracePoint

public class InteractionTargetElementPosition
extends java.lang.Object
implements InteractionTarget


Method Summary
 void draw(DrawingPanel _panel, java.awt.Graphics _g)
          Draws a representation of an object in a drawing panel.
 Interactive findInteractive(DrawingPanel _panel, int _xpix, int _ypix)
           
 Point3D getHotspot(DrawingPanel _panel)
           
 InteractionSource getSource()
           
 double getX()
           
 double getXMax()
          Gets the maximum x needed to draw this object.
 double getXMin()
          Gets the minimum x needed to draw this object.
 double getY()
           
 double getYMax()
          Gets the maximum y needed to draw this object.
 double getYMin()
          Gets the minimum y needed to draw this object.
 boolean isEnabled()
           
 boolean isMeasured()
          Determines if information is available to set min/max values.
 void setEnabled(boolean _enabled)
           
 void setX(double _x)
           
 void setXY(double _x, double _y)
           
 void setY(double _y)
           
 void updateHotspot(DrawingPanel _panel, Point3D _point)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSource

public InteractionSource getSource()
Specified by:
getSource in interface InteractionTarget

getHotspot

public Point3D getHotspot(DrawingPanel _panel)
Specified by:
getHotspot in interface InteractionTarget

updateHotspot

public void updateHotspot(DrawingPanel _panel,
                          Point3D _point)
Specified by:
updateHotspot in interface InteractionTarget

findInteractive

public Interactive findInteractive(DrawingPanel _panel,
                                   int _xpix,
                                   int _ypix)
Specified by:
findInteractive in interface Interactive

setEnabled

public void setEnabled(boolean _enabled)
Specified by:
setEnabled in interface Interactive

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface Interactive

setXY

public void setXY(double _x,
                  double _y)
Specified by:
setXY in interface Interactive

setX

public void setX(double _x)
Specified by:
setX in interface Interactive

setY

public void setY(double _y)
Specified by:
setY in interface Interactive

getX

public double getX()
Specified by:
getX in interface Interactive

getY

public double getY()
Specified by:
getY in interface Interactive

isMeasured

public boolean isMeasured()
Description copied from interface: Measurable
Determines if information is available to set min/max values. Objects that store data should return false if data is null.

Specified by:
isMeasured in interface Measurable
Returns:
true if min/max values are valid

getXMin

public double getXMin()
Description copied from interface: Measurable
Gets the minimum x needed to draw this object.

Specified by:
getXMin in interface Measurable
Returns:
minimum

getXMax

public double getXMax()
Description copied from interface: Measurable
Gets the maximum x needed to draw this object.

Specified by:
getXMax in interface Measurable
Returns:
maximum

getYMin

public double getYMin()
Description copied from interface: Measurable
Gets the minimum y needed to draw this object.

Specified by:
getYMin in interface Measurable
Returns:
minimum

getYMax

public double getYMax()
Description copied from interface: Measurable
Gets the maximum y needed to draw this object.

Specified by:
getYMax in interface Measurable
Returns:
minimum

draw

public void draw(DrawingPanel _panel,
                 java.awt.Graphics _g)
Description copied from interface: Drawable
Draws a representation of an object in a drawing panel.

Specified by:
draw in interface Drawable