public class CoordinatePanel extends ControlPanel implements ValueChangeListener
ControlPanel
with support for widgets that control
joint coordinate values. These widgets are instances of CoordinateWidget
, which are subclassed of DoubleFieldSlider
.
A CoordinatePanel is associated with a MechModel, which is assumed to
contain the joints whose coordinates are represented by the panel. When
coordinate values are changed through the panel, the MechModel is asked to
update various components, including the wrap paths for MultiPointSpring
s and the positions of attached components.
ModelComponent.FilePathSaveType, ModelComponent.NavpanelVisibility
myProps
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
Constructor and Description |
---|
CoordinatePanel() |
CoordinatePanel(java.lang.String name,
MechModel mech)
Creates a CoordinatePanel with a specified name and
MechModel . |
CoordinatePanel(java.lang.String name,
MechModel mech,
java.lang.String options)
Creates a CoordinatePanel with a specified name,
MechModel , and
options. |
Modifier and Type | Method and Description |
---|---|
CoordinateWidget |
addCoordinateWidget(JointBase joint,
int cidx)
Creates and adds a widget to this panel for the
cidx -th
coordinate of a specified joint. |
CoordinateWidget |
addCoordinateWidget(JointBase joint,
int cidx,
double min,
double max)
Creates and adds a widget to this panel for the
cidx -th
coordinate of a specified joint. |
CoordinateWidget |
addCoordinateWidget(JointBase joint,
java.lang.String cname)
Creates and adds a widget to this panel for the named coordinate of a
specified joint.
|
CoordinateWidget |
addCoordinateWidget(java.lang.String label,
JointBase joint,
int cidx)
Creates and adds a widget to this panel for the
cidx -th
coordinate of a specified joint. |
CoordinateWidget |
addCoordinateWidget(java.lang.String label,
JointBase joint,
int cidx,
double min,
double max)
Creates and adds a widget to this panel for the
cidx -th
coordinate of a specified joint. |
CoordinateWidget |
addCoordinateWidget(java.lang.String label,
JointBase joint,
java.lang.String cname)
Creates and adds a widget to this panel for the named coordinate of a
specified joint.
|
java.util.List<CoordinateWidget> |
addCoordinateWidgets(JointBase joint)
Creates and adds widgets to this panel for all the coordinate of a
specified joint.
|
java.util.List<CoordinateWidget> |
getCoordinateWidgets()
Returns a list of all the coordinate widgets currently in this panel.
|
MechModel |
getMechModel()
Queries the
MechModel associated with this panel. |
void |
postscan(java.util.Deque<ScanToken> tokens,
CompositeComponent ancestor)
Performs any required post-scanning for this component.
|
boolean |
scanItem(ReaderTokenizer rtok,
java.util.Deque<ScanToken> tokens) |
void |
setMechModel(MechModel mech)
Sets the
MechModel associated with this panel. |
void |
updateComponentCaches() |
void |
updateCoordinateWidgetList() |
void |
updateWidgetValues()
Update the value of all property widgets in this window and its owned
windows.
|
void |
updateWrapPaths() |
void |
valueChange(ValueChangeEvent e) |
actionPerformed, addGlobalValueChangeListener, addLabel, addWidget, addWidget, addWidget, addWidget, addWidget, addWidget, addWidget, addWidget, addWidget, addWidget, addWidget, addWidgets, connectToHierarchy, disconnectFromHierarchy, dispose, enableLiveUpdating, getAllPropertyInfo, getFrame, getGlobalValueChangeListeners, getHeight, getLocation, getPropertyPanel, getSize, getSoftReferences, getSynchronizeObject, getWidth, isLiveUpdatingEnabled, isScrollable, isVisible, locateRight, numWidgets, pack, postscanWidget, removeGlobalValueChangeListener, removeStalePropertyWidgets, scanWidget, setDefaultValues, setFocusableWindowState, setLocation, setLocation, setName, setScrollable, setSize, setSize, setSynchronizeObject, setVisible, updateReferences, write, writeWidget
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, copy, createTempFlag, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, hasChildren, hasState, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable
public CoordinatePanel()
public CoordinatePanel(java.lang.String name, MechModel mech)
MechModel
.name
- name of the panelmech
- MechModel
associated with the panelpublic MechModel getMechModel()
MechModel
associated with this panel.public void setMechModel(MechModel mech)
MechModel
associated with this panel.mech
- MechModel to associate with this panelpublic CoordinateWidget addCoordinateWidget(JointBase joint, java.lang.String cname)
joint
- joint containing the coordinatecname
- name of the coordinatepublic CoordinateWidget addCoordinateWidget(java.lang.String label, JointBase joint, java.lang.String cname)
label
- widget labeljoint
- joint containing the coordinatecname
- name of the coordinatepublic CoordinateWidget addCoordinateWidget(java.lang.String label, JointBase joint, int cidx)
cidx
-th
coordinate of a specified joint.label
- widget labeljoint
- joint containing the coordinatecidx
- coordinate indexpublic CoordinateWidget addCoordinateWidget(JointBase joint, int cidx)
cidx
-th
coordinate of a specified joint. The widget's label is set to the
coordinate name.joint
- joint containing the coordinatecidx
- coordinate indexpublic CoordinateWidget addCoordinateWidget(java.lang.String label, JointBase joint, int cidx, double min, double max)
cidx
-th
coordinate of a specified joint.label
- widget labeljoint
- joint containing the coordinatecidx
- coordinate indexmin
- minimum widget valuemax
- maximum widget valuepublic CoordinateWidget addCoordinateWidget(JointBase joint, int cidx, double min, double max)
cidx
-th
coordinate of a specified joint. The widget's label is set to the
coordinate name.joint
- joint containing the coordinatecidx
- coordinate indexmin
- minimum widget valuemax
- maximum widget valuepublic java.util.List<CoordinateWidget> addCoordinateWidgets(JointBase joint)
joint
- joint containing the coordinatespublic java.util.List<CoordinateWidget> getCoordinateWidgets()
public void valueChange(ValueChangeEvent e)
valueChange
in interface ValueChangeListener
public void updateComponentCaches()
public void updateCoordinateWidgetList()
public void updateWrapPaths()
public void updateWidgetValues()
PropertyWindow
updateWidgetValues
in interface PropertyWindow
updateWidgetValues
in class ControlPanel
public boolean scanItem(ReaderTokenizer rtok, java.util.Deque<ScanToken> tokens) throws java.io.IOException
scanItem
in class ControlPanel
java.io.IOException
public void postscan(java.util.Deque<ScanToken> tokens, CompositeComponent ancestor) throws java.io.IOException
PostScannable
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 PostScannable
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)