public class WayPointProbe extends OutputProbe
ModelComponent.NavpanelVisibility
myProps, useOldSaveMethod, writeStartStopTimeInSeconds
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
Constructor and Description |
---|
WayPointProbe() |
WayPointProbe(RootModel model) |
Modifier and Type | Method and Description |
---|---|
WayPoint |
add(WayPoint newWay)
Adds a WayPoint to this probe, and returns any WayPoint that previously
occupied the same time location.
|
void |
apply(double t)
Called when the probe is being applied to a model
|
void |
clear() |
java.util.Iterator<WayPoint> |
get() |
WayPoint |
get(double time) |
WayPoint |
getAfter(double t) |
WayPoint |
getBreakPointAfter(double time) |
boolean |
getCheckState() |
WayPoint |
getLastValid() |
WayPoint |
getNearestValidBefore(double time)
Find the nearest valid waypoint to a time t, whose time
is less or equal to t.
|
java.util.LinkedList<WayPoint> |
getPoints() |
RootModel |
getRootModel() |
WayPoint |
getValidAfter(double t) |
WayPoint |
getValidBefore(double time)
Return the valid waypoint immediately before time, or null if
there is no such waypoint.
|
WayPoint |
getValidOnOrBefore(double time)
Return the waypoint immediately on or before time, or null if
there is no such waypoint.
|
void |
invalidateAfterTime(double t)
Invalidates all waypoints after a specified time.
|
void |
invalidateAll()
Invalidates all waypoints
|
boolean |
isEventTime(double t) |
void |
load()
Load waypoint state data from the attached file.
|
void |
loadfrom(java.lang.String fileName) |
double |
maxEventTime() |
double |
nextEventTime(double t) |
int |
numValid() |
void |
postscan(java.util.Deque<ScanToken> tokens,
CompositeComponent ancestor)
Performs any required post-scanning for this component.
|
boolean |
remove(WayPoint way) |
void |
save()
Write all waypoint state to the attached file if it exists.
|
void |
saveas(java.lang.String fileName) |
void |
scan(ReaderTokenizer rtok,
java.lang.Object ref)
Scans this element from a ReaderTokenizer.
|
boolean |
scanItem(ReaderTokenizer rtok,
java.util.Deque<ScanToken> tokens) |
void |
setCheckState(boolean enable) |
int |
size() |
void |
writeItems(java.io.PrintWriter pw,
NumberFormat fmt,
CompositeComponent ancestor)
Write probe attributes to a PrintWriter
|
createState, getAllPropertyInfo, getAttachedFile, getAttachedFileName, getChildren, getDefaultScale, getDefaultStartTime, getDefaultStopTime, getDefaultUpdateInterval, getDuration, getInitialState, getProperty, getScale, getStartTime, getState, getStopTime, getTimelineTime, getTrack, getUpdateInterval, getVirtualTime, hasAttachedFile, hasChildren, hasState, isAttachedFileRelative, isCloneable, isInput, isPrintable, isScalable, isSettable, print, setAttachedFileName, setData, setInterval, setName, setScalable, setScale, setStartStopTimes, setStartTime, setState, setStopTime, setTrack, setUpdateInterval
dispose, finalize, getModel, initialize, isActive, setActive, setModel, setModelFromComponent, write
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, copy, createTempFlag, disconnectFromHierarchy, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isConnectedToHierarchy, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, setFixed, setMarked, setNumber, setParent, setSelected, updateReferences
isWritable
public WayPointProbe()
public WayPointProbe(RootModel model)
public void setCheckState(boolean enable)
public boolean getCheckState()
public WayPoint add(WayPoint newWay)
newWay
- new WayPoint to addpublic java.util.Iterator<WayPoint> get()
public boolean remove(WayPoint way)
public void clear()
public double nextEventTime(double t)
nextEventTime
in class Probe
public boolean isEventTime(double t)
isEventTime
in class Probe
public int size()
public int numValid()
public double maxEventTime()
public java.util.LinkedList<WayPoint> getPoints()
public WayPoint getAfter(double t)
public WayPoint getValidAfter(double t)
public WayPoint getNearestValidBefore(double time)
public WayPoint getLastValid()
public WayPoint getBreakPointAfter(double time)
public WayPoint getValidOnOrBefore(double time)
public WayPoint getValidBefore(double time)
public WayPoint get(double time)
public void apply(double t)
Probe
apply
in class OutputProbe
public void invalidateAfterTime(double t)
t
- invalidate waypoints after this timepublic void invalidateAll()
public void save()
public void saveas(java.lang.String fileName)
public void load()
public void loadfrom(java.lang.String fileName)
public void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
ModelComponentBase
write
.scan
in interface ModelComponent
scan
in interface Scannable
scan
in class Probe
rtok
- Tokenizer from which to scan the elementref
- optional reference object which can be used for resolving references to
other objectsjava.io.IOException
- if an I/O or formatting error occuredpublic void postscan(java.util.Deque<ScanToken> tokens, CompositeComponent ancestor) throws java.io.IOException
ModelComponent
scan()
method and stored in the token queue.
The most common use of this method is to resolve the paths
of component references, which may not have been created
at the time of the initial scan()
call.postscan
in interface ModelComponent
postscan
in class ModelComponentBase
tokens
- token information that was stored during
scan()
.ancestor
- ancestor component with respect to which
reference component paths are defined.java.io.IOException
- if an error is encountered (such as a reference to a
non-existent component)public boolean scanItem(ReaderTokenizer rtok, java.util.Deque<ScanToken> tokens) throws java.io.IOException
java.io.IOException
public void writeItems(java.io.PrintWriter pw, NumberFormat fmt, CompositeComponent ancestor) throws java.io.IOException
Probe
pw
- writer to which components are writtenfmt
- format for floating point numbersancestor
- ancestor component which respect to which references are
expressedjava.io.IOException
- if an I/O error occurredpublic RootModel getRootModel()