Class ProtractorFootprint
java.lang.Object
org.opensourcephysics.cabrillo.tracker.ProtractorFootprint
A ProtractorFootprint returns a pair of lines that meet at a vertex
at one end and have a specified end shape at the other.
This requires a Point array of length 3.
- Author:
- Douglas Brown
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static intprotected BasicStrokeprotected Shapeprotected Colorstatic final float[]protected Shape[]protected Stringprotected intstatic final float[]protected BasicStroke -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.opensourcephysics.cabrillo.tracker.MultiShapegetArcAdjustShape(Point vertex, Point rotator) Gets an arcAdjust shape.org.opensourcephysics.cabrillo.tracker.MultiShapeGets a circle shape.getColor()Gets the color.Gets the display name of the footprint.static FootprintgetFootprint(String name) Gets a predefined Footprint.Shape[]Gets the hit shapes associated with the footprint.getIcon(int w, int h) Gets an icon representing the footprint.intGets the point array length required by this footprint.Gets the footprint mark.getName()Gets the name of the footprint.org.opensourcephysics.cabrillo.tracker.MultiShapeGets the shape of this footprint for a Point array {vertex, end1, end2}.Gets the stroke.voidsetArcVisible(boolean vis) voidSets the color.voidsetStroke(BasicStroke stroke) Sets the stroke.
-
Field Details
-
DOTTED_LINE
public static final float[] DOTTED_LINE -
STIPPLED_LINE
public static final float[] STIPPLED_LINE -
arcRadius
protected static int arcRadius -
name
-
baseStroke
-
stroke
-
color
-
hitShapes
-
circle
-
radius
protected int radius
-
-
Constructor Details
-
ProtractorFootprint
Constructs a ProtractorFootprint.- Parameters:
name- the namer- the radius
-
-
Method Details
-
getName
Description copied from interface:FootprintGets the name of the footprint. -
getDisplayName
Description copied from interface:FootprintGets the display name of the footprint.- Specified by:
getDisplayNamein interfaceFootprint- Returns:
- the name
-
getLength
public int getLength()Description copied from interface:FootprintGets the point array length required by this footprint. -
getIcon
Description copied from interface:FootprintGets an icon representing the footprint. -
getMark
Description copied from interface:FootprintGets the footprint mark. -
getHitShapes
Description copied from interface:FootprintGets the hit shapes associated with the footprint.- Specified by:
getHitShapesin interfaceFootprint- Returns:
- an array of hit shapes
-
setStroke
Description copied from interface:FootprintSets the stroke. Accepts only basic strokes. -
getStroke
Description copied from interface:FootprintGets the stroke. -
setColor
Description copied from interface:FootprintSets the color. -
getColor
Description copied from interface:FootprintGets the color. -
setArcVisible
public void setArcVisible(boolean vis) -
getCircleShape
Gets a circle shape.- Parameters:
p- the desired screen point of the circle- Returns:
- the circle shape
-
getArcAdjustShape
public org.opensourcephysics.cabrillo.tracker.MultiShape getArcAdjustShape(Point vertex, Point rotator) Gets an arcAdjust shape.- Parameters:
vertex- the screen point of the vertexrotator- the screen point of the rotator- Returns:
- the arc-adjusting shape
-
getShape
Gets the shape of this footprint for a Point array {vertex, end1, end2}. Also sets up hit shapes {vertex, end1, end2, line1, line2, rotator} -
getFootprint
Gets a predefined Footprint.- Parameters:
name- the name of the footprint- Returns:
- the footprint
-