Class LineFootprint
java.lang.Object
org.opensourcephysics.cabrillo.tracker.LineFootprint
- Direct Known Subclasses:
ArrowFootprint
,DoubleArrowFootprint
,DoubleCrosshairFootprint
,MultiLineFootprint
,OutlineFootprint
A LineFootprint returns a line shape for a Point array of length 2.
- Author:
- Douglas Brown
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BasicStroke
protected Color
static final float[]
static final float[]
protected org.opensourcephysics.cabrillo.tracker.MultiShape
protected static Line2D
protected Shape[]
protected Line2D
protected String
protected GeneralPath
protected BasicStroke
protected BasicStroke
protected AffineTransform
static final float[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
getColor()
Gets the color.Gets the display name of the footprint.static Footprint
getFootprint
(String name) Gets a predefined LineFootprint.protected static Footprint
getFootprint
(Collection<LineFootprint> footprints, String name) org.opensourcephysics.cabrillo.tracker.MultiShape
Gets the highlight shape of this footprint.Shape[]
Gets the hit shapes.getIcon
(int w, int h) Gets the icon.int
Gets the minimum point array length required by this footprint.Gets the footprint mark.getName()
Gets the name of this footprint.org.opensourcephysics.cabrillo.tracker.MultiShape
getRotatorShape
(Point center, Point anchor, Point rotator) Gets a rotator shape.org.opensourcephysics.cabrillo.tracker.MultiShape
Gets the shape of this footprint.Gets the stroke.void
Sets the color.void
setDashArray
(float[] dashArray) Sets the dash array.void
setLineWidth
(double w) Sets the line width.void
setStroke
(BasicStroke stroke) Sets the stroke.
-
Field Details
-
hitLine
-
name
-
highlight
protected org.opensourcephysics.cabrillo.tracker.MultiShape highlight -
transform
-
baseStroke
-
stroke
-
color
-
path
-
line
-
hitShapes
-
rotatorStroke
-
DASHED_LINE
public static final float[] DASHED_LINE -
DOTTED_LINE
public static final float[] DOTTED_LINE -
WIDE_DOTTED_LINE
public static final float[] WIDE_DOTTED_LINE
-
-
Constructor Details
-
LineFootprint
Constructs a LineFootprint.- Parameters:
name
- the name
-
-
Method Details
-
getFootprint
Gets a predefined LineFootprint.- Parameters:
name
- the name of the footprint- Returns:
- the footprint
-
getFootprint
-
getName
Gets the name of this footprint. -
getDisplayName
Gets the display name of the footprint.- Specified by:
getDisplayName
in interfaceFootprint
- Returns:
- the localized display name
-
getLength
public int getLength()Gets the minimum point array length required by this footprint. -
getIcon
Gets the icon. -
getMark
Gets the footprint mark. -
getHitShapes
Gets the hit shapes. Shape[0] is for p0, Shape[1] for p1 and Shape[2] for the line- Specified by:
getHitShapes
in interfaceFootprint
- Returns:
- the hit shapes
-
setStroke
Sets the stroke. -
getStroke
Gets the stroke. -
setDashArray
public void setDashArray(float[] dashArray) Sets the dash array.- Parameters:
dashArray
- the desired dash array
-
setLineWidth
public void setLineWidth(double w) Sets the line width.- Parameters:
w
- the desired line width
-
setColor
Sets the color. -
getColor
Gets the color. -
getShape
Gets the shape of this footprint. -
getHighlightShape
public org.opensourcephysics.cabrillo.tracker.MultiShape getHighlightShape()Gets the highlight shape of this footprint. This should be called immediately following getShape() as the highlight is created there.- Returns:
- the shape
-
getRotatorShape
public org.opensourcephysics.cabrillo.tracker.MultiShape getRotatorShape(Point center, Point anchor, Point rotator) Gets a rotator shape.- Parameters:
center
- the screen point of line centeranchor
- the screen point of the anchor on the shaftrotator
- the screen point of the rotator- Returns:
- the rotator shape
-
checkStrokes
protected void checkStrokes()
-