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 int
protected BasicStroke
protected Shape
protected Color
static final float[]
protected Shape[]
protected String
protected int
static final float[]
protected BasicStroke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.opensourcephysics.cabrillo.tracker.MultiShape
getArcAdjustShape
(Point vertex, Point rotator) Gets an arcAdjust shape.org.opensourcephysics.cabrillo.tracker.MultiShape
Gets a circle shape.getColor()
Gets the color.Gets the display name of the footprint.static Footprint
getFootprint
(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.int
Gets the point array length required by this footprint.Gets the footprint mark.getName()
Gets the name of the footprint.org.opensourcephysics.cabrillo.tracker.MultiShape
Gets the shape of this footprint for a Point array {vertex, end1, end2}.Gets the stroke.void
setArcVisible
(boolean vis) void
Sets the color.void
setStroke
(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:Footprint
Gets the name of the footprint. -
getDisplayName
Description copied from interface:Footprint
Gets the display name of the footprint.- Specified by:
getDisplayName
in interfaceFootprint
- Returns:
- the name
-
getLength
public int getLength()Description copied from interface:Footprint
Gets the point array length required by this footprint. -
getIcon
Description copied from interface:Footprint
Gets an icon representing the footprint. -
getMark
Description copied from interface:Footprint
Gets the footprint mark. -
getHitShapes
Description copied from interface:Footprint
Gets the hit shapes associated with the footprint.- Specified by:
getHitShapes
in interfaceFootprint
- Returns:
- an array of hit shapes
-
setStroke
Description copied from interface:Footprint
Sets the stroke. Accepts only basic strokes. -
getStroke
Description copied from interface:Footprint
Gets the stroke. -
setColor
Description copied from interface:Footprint
Sets the color. -
getColor
Description copied from interface:Footprint
Gets 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
-