|
|||||||||
| 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.VectorStep
public class VectorStep
This is a Step that represents a vector. It is used when tracking vector objects (eg Force) or displaying the motion of a PointMass.
| Field Summary | |
|---|---|
protected TPoint |
attachmentPoint
|
protected boolean |
brandNew
|
protected VectorChain |
chain
|
protected int |
dx
|
protected int |
dy
|
protected boolean |
firePropertyChangeEvents
|
protected java.awt.Font |
font
|
protected org.opensourcephysics.cabrillo.tracker.VectorStep.Handle |
handle
|
protected org.opensourcephysics.cabrillo.tracker.VectorStep.Hinge |
hinge
|
protected boolean |
labelVisible
|
protected java.util.Map<TrackerPanel,java.awt.Rectangle> |
layoutBounds
|
protected TPoint |
middle
|
protected static boolean |
pointSnapEnabled
|
protected boolean |
rolloverVisible
|
protected java.util.Map<TrackerPanel,java.awt.Shape> |
shaftShapes
|
protected static double |
snapDistance
|
protected TPoint |
tail
|
protected static TPoint |
tailPoint
|
protected java.util.Map<TrackerPanel,java.awt.font.TextLayout> |
textLayouts
|
protected TPoint |
tip
|
protected boolean |
tipEnabled
|
protected static TPoint |
tipPoint
|
protected java.util.Map<TrackerPanel,java.awt.Shape> |
tipShapes
|
protected boolean |
valid
|
protected static java.util.Map<TrackerPanel,java.util.Set<VectorStep>> |
vectors
|
protected static boolean |
vectorSnapEnabled
|
| Fields inherited from class org.opensourcephysics.cabrillo.tracker.Step |
|---|
dataVisible, defaultIndex, footprint, format, frc, hitRect, marks, n, points, screenPoints, selectionShape, track, transform |
| Constructor Summary | |
|---|---|
VectorStep(TTrack track,
int n,
double x,
double y,
double xc,
double yc)
Constructs a VectorStep with specified imagespace tail coordinates and vector components. |
|
| Method Summary | |
|---|---|
void |
attach(TPoint pt)
Attaches the tail of this vector to the specified point. |
VectorStep |
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. |
TPoint |
getAttachmentPoint()
Gets the attachment point. |
java.awt.Rectangle |
getBounds(TrackerPanel trackerPanel)
Overrides Step getBounds method. |
VectorChain |
getChain()
Gets the vector chain containing this vector, if any. |
TPoint |
getHandle()
Gets the handle. |
TPoint |
getHinge()
Gets the hinge point. |
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. |
TPoint |
getTail()
Gets the tail. |
TPoint |
getTip()
Gets the tip. |
double |
getXComponent()
Gets the x component. |
double |
getYComponent()
Gets the y component. |
boolean |
isLabelVisible()
Gets the vector label visibility. |
static boolean |
isPointSnapEnabled()
Gets whether snap-to-point is enabled. |
boolean |
isRolloverVisible()
Gets the rollover visibility. |
boolean |
isTipEnabled()
Gets whether the tip is enabled. |
static boolean |
isVectorSnapEnabled()
Gets whether snap-to-vector is enabled. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Responds to property change events. |
void |
setFirePropertyChangeEvents(boolean fireEvents)
Sets firePropertyChangeEvents flag. |
void |
setFootprint(Footprint footprint)
Overrides Step setFootprint method. |
void |
setLabelVisible(boolean visible)
Sets the vector label visibility. |
static void |
setPointSnapEnabled(boolean enabled)
Enables and disables snap-to-point. |
void |
setRolloverVisible(boolean visible)
Sets the rollover visibility. |
void |
setTipEnabled(boolean enabled)
Enables and disables the interactivity of the tip. |
static void |
setVectorSnapEnabled(boolean enabled)
Enables and disables snap-to-vector. |
void |
setXComponent(double x)
Sets the x component. |
void |
setXYComponents(double x,
double y)
Sets the x and y components. |
void |
setYComponent(double y)
Sets the y component. |
void |
snap(TrackerPanel trackerPanel)
Snaps to point or vector within snapDistance of tail. |
java.lang.String |
toString()
Returns a String describing this. |
| Methods inherited from class org.opensourcephysics.cabrillo.tracker.Step |
|---|
erase, erase, getDefaultAutotrackIndex, getDefaultPoint, 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 boolean pointSnapEnabled
protected static boolean vectorSnapEnabled
protected static double snapDistance
protected static java.util.Map<TrackerPanel,java.util.Set<VectorStep>> vectors
protected static TPoint tipPoint
protected static TPoint tailPoint
protected TPoint tail
protected TPoint tip
protected TPoint middle
protected org.opensourcephysics.cabrillo.tracker.VectorStep.Handle handle
protected org.opensourcephysics.cabrillo.tracker.VectorStep.Hinge hinge
protected int dx
protected int dy
protected boolean tipEnabled
protected java.util.Map<TrackerPanel,java.awt.Shape> tipShapes
protected java.util.Map<TrackerPanel,java.awt.Shape> shaftShapes
protected TPoint attachmentPoint
protected VectorChain chain
protected boolean brandNew
protected boolean firePropertyChangeEvents
protected boolean labelVisible
protected boolean rolloverVisible
protected boolean valid
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 VectorStep(TTrack track,
int n,
double x,
double y,
double xc,
double yc)
track - the trackn - the frame numberx - the x coordinatey - the y coordinatexc - the x componentyc - the y component| Method Detail |
|---|
public TPoint getTip()
public TPoint getTail()
public TPoint getHandle()
public TPoint getHinge()
public void setXComponent(double x)
x - the x componentpublic void setYComponent(double y)
y - the y component
public void setXYComponents(double x,
double y)
x - the x componenty - the y componentpublic double getXComponent()
public double getYComponent()
public boolean isLabelVisible()
true if label is visiblepublic void setLabelVisible(boolean visible)
visible - true to make label visiblepublic boolean isRolloverVisible()
true if labels are visible on rollover onlypublic void setRolloverVisible(boolean visible)
visible - true to make labels visible on rollover onlypublic static void setPointSnapEnabled(boolean enabled)
enabled - true to enable snap-to-pointpublic static boolean isPointSnapEnabled()
true if snap-to-point is enabledpublic static void setVectorSnapEnabled(boolean enabled)
enabled - true to enable snap-to-vectorpublic static boolean isVectorSnapEnabled()
true if snap-to-vector is enabledpublic void snap(TrackerPanel trackerPanel)
trackerPanel - the tracker panel drawing thispublic VectorChain getChain()
public void attach(TPoint pt)
pt - the attachment pointpublic TPoint getAttachmentPoint()
public void setTipEnabled(boolean enabled)
enabled - true to enable the tippublic boolean isTipEnabled()
true if the tip is enabledpublic void setFootprint(Footprint footprint)
setFootprint in class Stepfootprint - the footprint
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 draw
public Interactive findInteractive(DrawingPanel panel,
int xpix,
int ypix)
findInteractive in class Steppanel - the drawing panelxpix - the x pixel positionypix - the y pixel position
protected 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 void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenere - the property change eventpublic void setFirePropertyChangeEvents(boolean fireEvents)
fireEvents - true to request this to fire property
change eventspublic VectorStep 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 | ||||||||