|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.robokind.api.common.property.PropertyChangeNotifier
org.robokind.api.motion.utils.AbstractJointGroup<Id,G,J>
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>
Abstract class providing common functionality for JointGroups.
Field Summary | |
---|---|
protected List<G> |
myGroups
Child JointGroups |
protected List<Id> |
myJointIds
JointIds used by this JointGroup |
protected String |
myName
Name of this JointGroup |
Fields inherited from interface org.robokind.api.motion.utils.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 Summary | |
---|---|
AbstractJointGroup()
Creates an empty AbstractJointGroup |
|
AbstractJointGroup(String name,
List<Id> ids,
List<G> groups)
|
Method Summary | |
---|---|
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()
|
Methods inherited from class org.robokind.api.common.property.PropertyChangeNotifier |
---|
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.robokind.api.common.property.PropertyChangeSource |
---|
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener |
Field Detail |
---|
protected String myName
protected List<Id> myJointIds
protected List<G extends JointGroup> myGroups
Constructor Detail |
---|
public AbstractJointGroup()
public AbstractJointGroup(String name, List<Id> ids, List<G> groups)
name
- name of this JointGroupids
- initial JointIdsgroups
- initial child JointGroupsMethod Detail |
---|
protected abstract J getJointById(Id jointId)
jointId
- id of the joint to retrieve
public void setName(String name)
JointGroup
setName
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
name
- new name to usepublic String getName()
JointGroup
getName
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
public void setEnabled(boolean enabled)
JointGroup
setEnabled
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 return
public List<J> getJoints()
getJoints
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
public boolean getEnabled()
JointGroup
getEnabled
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
public void addJointId(Id jointId)
JointGroup
addJointId
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
jointId
- the id to addpublic void insertJointId(Id jointId, int index)
JointGroup
insertJointId
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)
JointGroup
removeJointId
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
jointId
- id to removepublic void removeJointIdAt(int index)
JointGroup
removeJointIdAt
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
index
- position of the JointId in this JointGroup's JointIdspublic List<Id> getJointIds()
JointGroup
getJointIds
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
public Id getJointId(int index)
JointGroup
getJointId
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
index
- position of the JointId in the JointGroup's JointIds
public int getJointCount()
JointGroup
getJointCount
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
public void addGroup(G group)
JointGroup
addGroup
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
group
- child JointGroup to addpublic void insertGroup(G group, int index)
JointGroup
insertGroup
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
group
- child JointGroup to addindex
- position to add the childpublic void removeGroup(G group)
JointGroup
removeGroup
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
group
- the child to removepublic void removeGroupAt(int index)
JointGroup
removeGroupAt
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
index
- position of the child to removepublic List<G> getJointGroups()
JointGroup
getJointGroups
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
public G getJointGroup(int index)
JointGroup
getJointGroup
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
index
- position to the child to remove
public int getGroupCount()
JointGroup
getGroupCount
in interface JointGroup<Id,G extends JointGroup,J extends Joint>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |