|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.cabrillo.tracker.TTrack
org.opensourcephysics.cabrillo.tracker.TapeMeasure
public class TapeMeasure
A TapeMeasure measures and displays its world length and its angle relative to the positive x-axis. It is used to set the scale and angle of an ImageCoordSystem.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.opensourcephysics.cabrillo.tracker.TTrack |
|---|
TTrack.StepArray |
| Field Summary | |
|---|---|
static float[] |
BROKEN_LINE
|
protected boolean |
editing
|
protected java.awt.event.MouseListener |
editListener
|
protected boolean |
fixedLength
|
protected javax.swing.JCheckBoxMenuItem |
fixedLengthItem
|
protected boolean |
fixedPosition
|
protected javax.swing.JCheckBoxMenuItem |
fixedPositionItem
|
protected java.text.NumberFormat |
format
|
protected javax.swing.JPanel |
glassPanel
|
protected NumberField |
inputField
|
protected javax.swing.JPanel |
inputPanel
|
protected boolean |
isStepChangingScale
|
protected java.util.TreeSet<java.lang.Integer> |
lengthKeyFrames
|
protected static double |
MIN_LENGTH
|
protected boolean |
notYetShown
|
protected boolean |
readOnly
|
protected Footprint[] |
stickFootprints
|
protected boolean |
stickMode
|
protected Footprint[] |
tapeFootprints
|
| Constructor Summary | |
|---|---|
TapeMeasure()
Constructs a TapeMeasure. |
|
| Method Summary | |
|---|---|
Step |
createStep(int n,
double x,
double y)
Implements createStep but only mimics step creation since steps are created automatically by the autofill StepArray. |
Step |
createStep(int n,
double x1,
double y1,
double x2,
double y2)
Mimics step creation by setting end positions of an existing step. |
Step |
deleteStep(int n)
Overrides TTrack deleteStep method to prevent deletion. |
Interactive |
findInteractive(DrawingPanel panel,
int xpix,
int ypix)
Implements findInteractive method. |
int |
getDefaultAutoTrackerIndex()
Gets the default step point index. |
int |
getFootprintLength()
Gets the length of the footprints required by this track. |
java.lang.String |
getFormattedLength(double length)
Formats the specified length value. |
static XML.ObjectLoader |
getLoader()
Returns an ObjectLoader to save and load data for this class. |
javax.swing.JMenu |
getMenu(TrackerPanel trackerPanel)
Returns a menu with items that control this track. |
Step |
getStep(int n)
Overrides TTrack getStep method to provide fixedTape behavior. |
int |
getStepLength()
Gets the length of the steps created by this track. |
java.util.ArrayList<java.awt.Component> |
getToolbarTrackComponents(TrackerPanel trackerPanel)
Returns a list of point-related toolbar components. |
protected boolean |
isFieldsEnabled()
Determines if the input fields are enabled. |
boolean |
isFixedLength()
Gets the fixed length property. |
boolean |
isFixedPosition()
Gets the fixed position property. |
boolean |
isLocked()
Overrides TTrack isLocked method. |
boolean |
isReadOnly()
Gets the ReadOnly property. |
boolean |
isStepComplete(int n)
Returns true if the step at the specified frame number is complete. |
boolean |
isStickMode()
Gets the stickMode property. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Responds to property change events. |
protected void |
refreshStep(TapeStep step)
Refreshes a step by setting it equal to the previous keyframe step. |
protected void |
refreshWorldLengths()
Refreshes world lengths at all steps based on current ends and scale. |
void |
remark(TrackerPanel trackerPanel)
Remarks all steps on the specified panel. |
void |
setFixedLength(boolean fixed)
Sets the fixed length property. |
void |
setFixedPosition(boolean fixed)
Sets the fixed position property. |
void |
setLocked(boolean locked)
Overrides TTrack method. |
void |
setReadOnly(boolean readOnly)
Sets the readOnly property. |
void |
setStickMode(boolean stick)
Sets the stickMode property. |
protected void |
setTrackerPanel(TrackerPanel panel)
Overrides TTrack setTrackerPanel method. |
void |
setTrailVisible(boolean visible)
Overrides TTrack setTrailVisible method to keep trails hidden. |
void |
setVisible(boolean visible)
Overrides TTrack setVisible method to change notYetShown flag. |
java.lang.String |
toString()
Overrides Object toString method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final double MIN_LENGTH
public static final float[] BROKEN_LINE
protected boolean fixedPosition
protected boolean fixedLength
protected javax.swing.JCheckBoxMenuItem fixedPositionItem
protected javax.swing.JCheckBoxMenuItem fixedLengthItem
protected boolean editing
protected final NumberField inputField
protected javax.swing.JPanel inputPanel
protected javax.swing.JPanel glassPanel
protected java.text.NumberFormat format
protected java.awt.event.MouseListener editListener
protected boolean readOnly
protected boolean stickMode
protected boolean isStepChangingScale
protected boolean notYetShown
protected Footprint[] tapeFootprints
protected Footprint[] stickFootprints
protected java.util.TreeSet<java.lang.Integer> lengthKeyFrames
| Constructor Detail |
|---|
public TapeMeasure()
| Method Detail |
|---|
public void setFixedPosition(boolean fixed)
fixed - true to fix the positionpublic boolean isFixedPosition()
true if position is fixedpublic void setFixedLength(boolean fixed)
fixed - true to fix the lengthpublic boolean isFixedLength()
true if length is fixedpublic void setReadOnly(boolean readOnly)
readOnly - true to prevent editingpublic boolean isReadOnly()
true if read-onlypublic void setStickMode(boolean stick)
stick - true for stick mode, false for tape modepublic boolean isStickMode()
true if in stick modepublic boolean isStepComplete(int n)
isStepComplete in class TTrackn - the frame number
true if the step is completepublic void setLocked(boolean locked)
setLocked in class TTracklocked - true to lock thispublic void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenerpropertyChange in class TTracke - the property change eventpublic void setVisible(boolean visible)
setVisible in class TTrackvisible - true to show this trackpublic void setTrailVisible(boolean visible)
setTrailVisible in class TTrackvisible - ignoredpublic boolean isLocked()
isLocked in class TTracktrue if this is locked
public Step createStep(int n,
double x,
double y)
createStep in class TTrackn - the frame numberx - the x coordinate in image spacey - the y coordinate in image space
public Step createStep(int n,
double x1,
double y1,
double x2,
double y2)
n - the frame numberx1 - the x coordinate of end1 in image spacey1 - the y coordinate of end1 in image spacex2 - the x coordinate of end2 in image spacey2 - the y coordinate of end2 in image space
public Step deleteStep(int n)
deleteStep in class TTrackn - the frame number
public Step getStep(int n)
getStep in class TTrackn - the frame number
public int getStepLength()
getStepLength in class TTrackpublic int getDefaultAutoTrackerIndex()
getDefaultAutoTrackerIndex in class TTrackpublic int getFootprintLength()
getFootprintLength in class TTrackpublic java.lang.String getFormattedLength(double length)
length - the length value to format
public javax.swing.JMenu getMenu(TrackerPanel trackerPanel)
getMenu in class TTracktrackerPanel - the tracker panel
public java.util.ArrayList<java.awt.Component> getToolbarTrackComponents(TrackerPanel trackerPanel)
getToolbarTrackComponents in class TTracktrackerPanel - the tracker panel
public Interactive findInteractive(DrawingPanel panel,
int xpix,
int ypix)
findInteractive in interface InteractivefindInteractive in class TTrackpanel - the drawing panelxpix - the x pixel position on the panelypix - the y pixel position on the panel
public void remark(TrackerPanel trackerPanel)
remark in class TTracktrackerPanel - the tracker panelpublic java.lang.String toString()
toString in class TTrackprotected void setTrackerPanel(TrackerPanel panel)
setTrackerPanel in class TTrackpanel - the TrackerPanelprotected void refreshWorldLengths()
protected void refreshStep(TapeStep step)
step - the step to refreshprotected boolean isFieldsEnabled()
public static XML.ObjectLoader getLoader()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||