org.opensourcephysics.drawing2d
Class ElementArrow

java.lang.Object
  extended by org.opensourcephysics.drawing2d.Element
      extended by org.opensourcephysics.drawing2d.ElementSegment
          extended by org.opensourcephysics.drawing2d.ElementArrow
All Implemented Interfaces:
Drawable, Interactive, LogMeasurable, Measurable

public class ElementArrow
extends ElementSegment

Title: ElementArrow

Description: An arrow.

Version:
June 2008
Author:
Francisco Esquembre

Field Summary
static int ARROW
          The element has an arrow head
static int BOX
          The element has a box at its top
static int RHOMBUS
          The element looks like a double triangle with a width set by the width percentage.
static int SEGMENT
          The element looks like a segment
static int TRIANGLE
          The element looks like a triangle with a width set by the width percentage
 
Fields inherited from class org.opensourcephysics.drawing2d.Element
TARGET_POSITION, TARGET_SIZE
 
Constructor Summary
ElementArrow()
           
 
Method Summary
 void draw(DrawingPanel _panel, java.awt.Graphics _g)
          Draws the element on a given Graphics2D.
 int getArrowType()
          Returns the arrow type
 void setArrowType(int _type)
          Set the type of decoration at the head of the arrow.
 
Methods inherited from class org.opensourcephysics.drawing2d.ElementSegment
findInteractive
 
Methods inherited from class org.opensourcephysics.drawing2d.Element
addInteractionListener, getCanBeMeasured, getDataObject, getInteractionTarget, getName, getPanel, getPosition, getSize, getSizeX, getSizeY, getStyle, getTransformation, getX, getXMax, getXMaxLogscale, getXMin, getXMinLogscale, getY, getYMax, getYMaxLogscale, getYMin, getYMinLogscale, hasChanged, invokeActions, isEnabled, isMeasured, isVisible, removeInteractionListener, setCanBeMeasured, setDataObject, setElementChanged, setEnabled, setName, setNeedToProject, setPanel, setPosition, setSize, setSizeX, setSizeXY, setSizeY, setTransformation, setVisible, setX, setXY, setY, toBodyFrame, toSpaceFrame, updateHotSpot
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARROW

public static final int ARROW
The element has an arrow head

See Also:
Constant Field Values

SEGMENT

public static final int SEGMENT
The element looks like a segment

See Also:
Constant Field Values

BOX

public static final int BOX
The element has a box at its top

See Also:
Constant Field Values

TRIANGLE

public static final int TRIANGLE
The element looks like a triangle with a width set by the width percentage

See Also:
Constant Field Values

RHOMBUS

public static final int RHOMBUS
The element looks like a double triangle with a width set by the width percentage. The line and fill colors are used to color the two triangles

See Also:
Constant Field Values
Constructor Detail

ElementArrow

public ElementArrow()
Method Detail

setArrowType

public void setArrowType(int _type)
Set the type of decoration at the head of the arrow. Either ARROW, SEGMENT (none) or BOX


getArrowType

public int getArrowType()
Returns the arrow type

Returns:

draw

public void draw(DrawingPanel _panel,
                 java.awt.Graphics _g)
Description copied from class: Element
Draws the element on a given Graphics2D. Required by Drawable (in Interactive)

Specified by:
draw in interface Drawable
Overrides:
draw in class ElementSegment