org.opensourcephysics.displayejs
Class InteractiveCursor

java.lang.Object
  extended by org.opensourcephysics.displayejs.AbstractInteractiveElement
      extended by org.opensourcephysics.displayejs.InteractiveCursor
All Implemented Interfaces:
Drawable, Interactive, Measurable, Drawable3D, HasDataObjectInterface, InteractionSource, InteractiveElement, Measurable3D

public class InteractiveCursor
extends AbstractInteractiveElement

An InteractiveParticle is an InteractiveElement that displays a RectangularShape


Field Summary
static int CROSSHAIR
           
static int HORIZONTAL
           
static int VERTICAL
           
 
Fields inherited from class org.opensourcephysics.displayejs.AbstractInteractiveElement
SENSIBILITY
 
Fields inherited from interface org.opensourcephysics.displayejs.InteractiveElement
TARGET_POSITION, TARGET_SIZE
 
Constructor Summary
InteractiveCursor()
          Default constructor
InteractiveCursor(int _type)
          Constructor that accepts a given type.
 
Method Summary
 void copyFrom(InteractiveElement _element)
           
 void draw(DrawingPanel3D _panel, java.awt.Graphics2D _g2, int _index)
          Draws a given Object3D (indicated by its index).
 void draw(DrawingPanel _panel, java.awt.Graphics _g)
          Draws a representation of an object in a drawing panel.
 void drawQuickly(DrawingPanel3D _panel, java.awt.Graphics2D _g2)
          Sketches the drawable
 Interactive findInteractive(DrawingPanel _panel, int _xpix, int _ypix)
           
 Object3D[] getObjects3D(DrawingPanel3D _panel)
          Returns an array of Objects3D to (sort according to its distance and) draw.
 int getType()
           
 double getXMax()
          Gets the maximum x needed to draw this object.
 double getXMin()
          Gets the minimum x needed to draw this object.
 double getYMax()
          Gets the maximum y needed to draw this object.
 double getYMin()
          Gets the minimum y needed to draw this object.
 double getZMax()
          Gets the maximum z needed to draw this object.
 double getZMin()
          Gets the minimum z needed to draw this object.
 boolean isMeasured()
          Determines if information is available to set min/max values.
 void setType(int _aType)
           
 
Methods inherited from class org.opensourcephysics.displayejs.AbstractInteractiveElement
addListener, canBeMeasured, getControl, getDataObject, getGroup, getResolution, getSensitivity, getSet, getSetIndex, getSizeX, getSizeY, getSizeZ, getStyle, getX, getY, getZ, initializeMemberOfSet, invokeActions, isEnabled, isEnabled, isGroupEnabled, isGroupEnabled, isVisible, needsToProject, removeAllListeners, removeListener, setControl, setDataObject, setEnabled, setEnabled, setGroup, setGroupEnabled, setGroupEnabled, setResolution, setSensitivity, setSet, setSizeX, setSizeXY, setSizeXYZ, setSizeY, setSizeZ, setVisible, setX, setXY, setXYZ, setY, setZ, toXML
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HORIZONTAL

public static final int HORIZONTAL
See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
See Also:
Constant Field Values

CROSSHAIR

public static final int CROSSHAIR
See Also:
Constant Field Values
Constructor Detail

InteractiveCursor

public InteractiveCursor()
Default constructor


InteractiveCursor

public InteractiveCursor(int _type)
Constructor that accepts a given type. Either ELLIPSE, RECTANGLE, ROUND_RECTANGLE or NONE (a dot will be displayed)

Method Detail

copyFrom

public void copyFrom(InteractiveElement _element)
Specified by:
copyFrom in interface InteractiveElement
Overrides:
copyFrom in class AbstractInteractiveElement

setType

public void setType(int _aType)

getType

public int getType()

findInteractive

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

getObjects3D

public Object3D[] getObjects3D(DrawingPanel3D _panel)
Description copied from interface: Drawable3D
Returns an array of Objects3D to (sort according to its distance and) draw.

Specified by:
getObjects3D in interface Drawable3D
Specified by:
getObjects3D in class AbstractInteractiveElement

draw

public void draw(DrawingPanel3D _panel,
                 java.awt.Graphics2D _g2,
                 int _index)
Description copied from interface: Drawable3D
Draws a given Object3D (indicated by its index).

Specified by:
draw in interface Drawable3D
Specified by:
draw in class AbstractInteractiveElement

drawQuickly

public void drawQuickly(DrawingPanel3D _panel,
                        java.awt.Graphics2D _g2)
Description copied from interface: Drawable3D
Sketches the drawable

Specified by:
drawQuickly in interface Drawable3D
Overrides:
drawQuickly in class AbstractInteractiveElement

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
Specified by:
draw in class AbstractInteractiveElement

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
Overrides:
isMeasured in class AbstractInteractiveElement
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
Overrides:
getXMin in class AbstractInteractiveElement
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
Overrides:
getXMax in class AbstractInteractiveElement
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
Overrides:
getYMin in class AbstractInteractiveElement
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
Overrides:
getYMax in class AbstractInteractiveElement
Returns:
minimum

getZMin

public double getZMin()
Description copied from interface: Measurable3D
Gets the minimum z needed to draw this object.

Specified by:
getZMin in interface Measurable3D
Overrides:
getZMin in class AbstractInteractiveElement
Returns:
minimum

getZMax

public double getZMax()
Description copied from interface: Measurable3D
Gets the maximum z needed to draw this object.

Specified by:
getZMax in interface Measurable3D
Overrides:
getZMax in class AbstractInteractiveElement
Returns:
maximum