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 BasicStrokeprotected Colorstatic final float[]static final float[]protected org.opensourcephysics.cabrillo.tracker.MultiShapeprotected static Line2Dprotected Shape[]protected Line2Dprotected Stringprotected GeneralPathprotected BasicStrokeprotected BasicStrokeprotected AffineTransformstatic final float[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidgetColor()Gets the color.Gets the display name of the footprint.static FootprintgetFootprint(String name) Gets a predefined LineFootprint.protected static FootprintgetFootprint(Collection<LineFootprint> footprints, String name) org.opensourcephysics.cabrillo.tracker.MultiShapeGets the highlight shape of this footprint.Shape[]Gets the hit shapes.getIcon(int w, int h) Gets the icon.intGets the minimum point array length required by this footprint.Gets the footprint mark.getName()Gets the name of this footprint.org.opensourcephysics.cabrillo.tracker.MultiShapegetRotatorShape(Point center, Point anchor, Point rotator) Gets a rotator shape.org.opensourcephysics.cabrillo.tracker.MultiShapeGets the shape of this footprint.Gets the stroke.voidSets the color.voidsetDashArray(float[] dashArray) Sets the dash array.voidsetLineWidth(double w) Sets the line width.voidsetStroke(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:
getDisplayNamein 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:
getHitShapesin 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()
-