Id - Type used to identify JointsG - Type of child JointGroupsJ - Type of Joints used by this JointGrouppublic abstract class AbstractJointGroup<Id,G extends JointGroup,J extends Joint> extends PropertyChangeNotifier implements JointGroup<Id,G,J>
| Modifier and Type | Field and Description |
|---|---|
protected List<G> |
myGroups
Child JointGroups
|
protected List<Id> |
myJointIds
JointIds used by this JointGroup
|
protected String |
myName
Name of this JointGroup
|
PROP_ADD_JOINT_GROUP, PROP_ADD_JOINT_ID, PROP_ENABLED, PROP_JOINT_CHANGED, PROP_NAME, PROP_REMOVE_JOINT_GROUP, PROP_REMOVE_JOINT_ID, PROP_STRUCTURE_CHANGED| Constructor and Description |
|---|
AbstractJointGroup()
Creates an empty AbstractJointGroup
|
AbstractJointGroup(String name,
List<Id> ids,
List<G> groups) |
| Modifier and Type | Method and Description |
|---|---|
void |
addGroup(G group)
Add a child JointGroup.
|
void |
addJointId(Id jointId)
Adds a JointId to this JointGroup.
|
boolean |
getEnabled()
Returns the enabled state
|
int |
getGroupCount()
Return the number of child JointGroups.
|
J |
getJoint(int index)
Returns the Joint at the given index, or null if out of bounds.
|
protected abstract J |
getJointById(Id jointId)
Retrieves a Joint with the given jointId.
|
int |
getJointCount()
Returns the number of JointIds for this JointGroup.
|
G |
getJointGroup(int index)
Returns the child JointGroup at the given index.
|
List<G> |
getJointGroups()
Returns a List of the children JointGroups.
|
Id |
getJointId(int index)
Returns the JointId at the given index.
|
List<Id> |
getJointIds()
Returns a List of JointIds for this JointGroup
|
List<J> |
getJoints()
Returns a List of Joints belonging to this JointGroup.
|
String |
getName()
Returns the name to use
|
void |
insertGroup(G group,
int index)
Add a child JointGroup at the given index.
|
void |
insertJointId(Id jointId,
int index)
Adds a JointId to this JointGroup at the given index.
|
void |
removeGroup(G group)
Removes a child JointGroup.
|
void |
removeGroupAt(int index)
Removes a child JointGroup at the given index.
|
void |
removeJointId(Id jointId)
Removes a JointId
|
void |
removeJointIdAt(int index)
Removes the JointId with the given index.
|
void |
setEnabled(boolean enabled)
Sets the enabled state of the JointGroup
|
void |
setName(String name)
Sets the name of the JointGroup
|
String |
toString() |
addPropertyChangeListener, addPropertyChangeListener, clearAllListeners, clearListeners, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListenerprotected String myName
protected List<G extends JointGroup> myGroups
public AbstractJointGroup()
protected abstract J getJointById(Id jointId)
jointId - id of the joint to retrievepublic void setName(String name)
JointGroupsetName in interface JointGroup<Id,G extends JointGroup,J extends Joint>name - new name to usepublic String getName()
JointGroupgetName in interface JointGroup<Id,G extends JointGroup,J extends Joint>public void setEnabled(boolean enabled)
JointGroupsetEnabled in interface JointGroup<Id,G extends JointGroup,J extends Joint>enabled - enabled state to usepublic J getJoint(int index)
getJoint in interface JointGroup<Id,G extends JointGroup,J extends Joint>index - index of the Joint to returnpublic List<J> getJoints()
getJoints in interface JointGroup<Id,G extends JointGroup,J extends Joint>public boolean getEnabled()
JointGroupgetEnabled in interface JointGroup<Id,G extends JointGroup,J extends Joint>public void addJointId(Id jointId)
JointGroupaddJointId in interface JointGroup<Id,G extends JointGroup,J extends Joint>jointId - the id to addpublic void insertJointId(Id jointId, int index)
JointGroupinsertJointId in interface JointGroup<Id,G extends JointGroup,J extends Joint>jointId - the id to addindex - index at which to insert the Joint Idpublic void removeJointId(Id jointId)
JointGroupremoveJointId in interface JointGroup<Id,G extends JointGroup,J extends Joint>jointId - id to removepublic void removeJointIdAt(int index)
JointGroupremoveJointIdAt in interface JointGroup<Id,G extends JointGroup,J extends Joint>index - position of the JointId in this JointGroup's JointIdspublic List<Id> getJointIds()
JointGroupgetJointIds in interface JointGroup<Id,G extends JointGroup,J extends Joint>public Id getJointId(int index)
JointGroupgetJointId in interface JointGroup<Id,G extends JointGroup,J extends Joint>index - position of the JointId in the JointGroup's JointIdspublic int getJointCount()
JointGroupgetJointCount in interface JointGroup<Id,G extends JointGroup,J extends Joint>public void addGroup(G group)
JointGroupaddGroup in interface JointGroup<Id,G extends JointGroup,J extends Joint>group - child JointGroup to addpublic void insertGroup(G group, int index)
JointGroupinsertGroup in interface JointGroup<Id,G extends JointGroup,J extends Joint>group - child JointGroup to addindex - position to add the childpublic void removeGroup(G group)
JointGroupremoveGroup in interface JointGroup<Id,G extends JointGroup,J extends Joint>group - the child to removepublic void removeGroupAt(int index)
JointGroupremoveGroupAt in interface JointGroup<Id,G extends JointGroup,J extends Joint>index - position of the child to removepublic List<G> getJointGroups()
JointGroupgetJointGroups in interface JointGroup<Id,G extends JointGroup,J extends Joint>public G getJointGroup(int index)
JointGroupgetJointGroup in interface JointGroup<Id,G extends JointGroup,J extends Joint>index - position to the child to removepublic int getGroupCount()
JointGroupgetGroupCount in interface JointGroup<Id,G extends JointGroup,J extends Joint>Copyright © 2011-2014. All Rights Reserved.