|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.cabrillo.tracker.Step
org.opensourcephysics.cabrillo.tracker.TapeStep
public class TapeStep
This is a Step for a TapeMeasure. It is used for measuring distances and angles and for setting the scale and angle of an ImageCoordSystem.
| Field Summary | |
|---|---|
protected boolean |
drawLayoutBounds
|
protected TPoint |
end1
|
protected java.util.Map<TrackerPanel,java.awt.Shape> |
end1Shapes
|
protected TPoint |
end2
|
protected java.util.Map<TrackerPanel,java.awt.Shape> |
end2Shapes
|
protected static TPoint |
endPoint1
|
protected static TPoint |
endPoint2
|
protected boolean |
endsEnabled
|
protected java.awt.Font |
font
|
protected org.opensourcephysics.cabrillo.tracker.TapeStep.Handle |
handle
|
protected java.util.Map<TrackerPanel,java.awt.Rectangle> |
layoutBounds
|
protected TPoint |
middle
|
protected java.util.Map<TrackerPanel,java.awt.Shape> |
shaftShapes
|
protected TapeMeasure |
tape
|
protected double |
tapeAngle
|
protected java.util.Map<TrackerPanel,java.awt.font.TextLayout> |
textLayouts
|
protected double |
worldLength
|
protected double |
xAxisToTapeAngle
|
| Fields inherited from class org.opensourcephysics.cabrillo.tracker.Step |
|---|
dataVisible, defaultIndex, footprint, format, frc, hitRect, marks, n, points, screenPoints, selectionShape, track, transform, valid |
| Constructor Summary | |
|---|---|
TapeStep(TapeMeasure track,
int n,
double x1,
double y1,
double x2,
double y2)
Constructs a TapeStep with specified end point coordinates in image space. |
|
| Method Summary | |
|---|---|
protected void |
adjustTipsToLength()
|
java.lang.Object |
clone()
Clones this Step. |
void |
draw(DrawingPanel panel,
java.awt.Graphics _g)
Overrides Step draw method. |
Interactive |
findInteractive(DrawingPanel panel,
int xpix,
int ypix)
Overrides Step findInteractive method. |
java.awt.Rectangle |
getBounds(TrackerPanel trackerPanel)
Overrides Step getBounds method. |
TPoint |
getDefaultPoint()
Gets the default point. |
TPoint |
getEnd1()
Gets end 1. |
TPoint |
getEnd2()
Gets end 2. |
TPoint |
getHandle()
Gets the handle. |
static int |
getLength()
Gets the step length. |
static XML.ObjectLoader |
getLoader()
Returns an ObjectLoader to save and load data for this class. |
protected Mark |
getMark(TrackerPanel trackerPanel)
Overrides Step getMark method. |
double |
getTapeAngle()
Gets the world angle of this tape. |
double |
getTapeLength(boolean fromEnds)
Gets the scaled world length of this tape, with side effect of updating angle and length fields. |
boolean |
isEndsEnabled()
Gets whether the ends are enabled. |
void |
setEndsEnabled(boolean enabled)
Enables and disables the interactivity of the ends. |
void |
setFootprint(Footprint footprint)
Overrides Step setFootprint method. |
void |
setTapeAngle(double theta)
Sets the world angle of this tape. |
void |
setTapeLength(double length)
Sets the world length of this tape and posts an undoable edit. |
java.lang.String |
toString()
Returns a String describing this. |
| Methods inherited from class org.opensourcephysics.cabrillo.tracker.Step |
|---|
erase, erase, getDefaultAutotrackIndex, getFrameNumber, getPointIndex, getPoints, getTrack, remark, remark, repaint, repaint, setDefaultPointIndex, setHitRectCenter |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static TPoint endPoint1
protected static TPoint endPoint2
protected TapeMeasure tape
protected TPoint end1
protected TPoint end2
protected TPoint middle
protected org.opensourcephysics.cabrillo.tracker.TapeStep.Handle handle
protected double worldLength
protected double xAxisToTapeAngle
protected double tapeAngle
protected boolean endsEnabled
protected boolean drawLayoutBounds
protected java.util.Map<TrackerPanel,java.awt.Shape> end1Shapes
protected java.util.Map<TrackerPanel,java.awt.Shape> end2Shapes
protected java.util.Map<TrackerPanel,java.awt.Shape> shaftShapes
protected java.util.Map<TrackerPanel,java.awt.font.TextLayout> textLayouts
protected java.util.Map<TrackerPanel,java.awt.Rectangle> layoutBounds
protected java.awt.Font font
| Constructor Detail |
|---|
public TapeStep(TapeMeasure track,
int n,
double x1,
double y1,
double x2,
double y2)
track - the trackn - the frame numberx1 - the x coordinate of end 1y1 - the y coordinate of end 1x2 - the x coordinate of end 2y2 - the y coordinate of end 2| Method Detail |
|---|
public TPoint getEnd1()
public TPoint getEnd2()
public TPoint getHandle()
public void setEndsEnabled(boolean enabled)
enabled - true to enable the endspublic boolean isEndsEnabled()
true if the ends are enabledpublic void setFootprint(Footprint footprint)
setFootprint in class Stepfootprint - the footprint
public Interactive findInteractive(DrawingPanel panel,
int xpix,
int ypix)
findInteractive in class Steppanel - the drawing panelxpix - the x pixel positionypix - the y pixel position
public void draw(DrawingPanel panel,
java.awt.Graphics _g)
draw in class Steppanel - the drawing panel requesting the drawing_g - the graphics context on which to drawpublic TPoint getDefaultPoint()
getDefaultPoint in class Stepprotected Mark getMark(TrackerPanel trackerPanel)
getMark in class SteptrackerPanel - the tracker panel
public java.awt.Rectangle getBounds(TrackerPanel trackerPanel)
getBounds in class SteptrackerPanel - the tracker panel drawing the step
public double getTapeLength(boolean fromEnds)
fromEnds - true if calculated from the current tip positions
public double getTapeAngle()
public void setTapeLength(double length)
length - the length in world unitspublic void setTapeAngle(double theta)
theta - the angle in radiansprotected void adjustTipsToLength()
public java.lang.Object clone()
clone in class Steppublic java.lang.String toString()
toString in class Steppublic static int getLength()
public static XML.ObjectLoader getLoader()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||