|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jreality.ui.viewerapp.Selection
public class Selection
Represents selections in a displayed scene. A selection is a list of objects representing a directed path from a scene graph's root down to some node in the scene graph or arbitrary objects which are somehow linked to nodes of the scene graph (e.g. tools or attribute entities visible in the scene graph's tree view).
In particular, every selection starts with a SceneGraphPath
.
Adding an object which is not an instance of SceneGraphNode to the selection's path defines the end of the contained
SceneGraphPath, i.e any objects added subsequently are not treated as part of the SceneGraphPath.
Selections can be constructed from an existing SceneGraphPaths by using Selection(SceneGraphPath)
and truncated to a SceneGraphPath using getSGPath()
.
Constructor Summary | |
---|---|
Selection()
Default constructor, starts with an empty selection path |
|
Selection(SceneGraphPath path)
Constructs a selection object from the given SceneGraphPath |
|
Selection(Selection s)
Copy constructor |
Method Summary | |
---|---|
SceneGraphComponent |
asComponent()
Returns the selected component if the current selection is a SceneGraphComponent , null otherwise |
AttributeEntity |
asEntity()
Returns the selected entity if the current selection is an AttributeEntity , null otherwise |
SceneGraphNode |
asNode()
Returns the selected node if the current selection is a SceneGraphNode , null otherwise |
Tool |
asTool()
Returns the selected tool if the current selection is a Tool , null otherwise |
void |
clear()
Clear the selection's path |
boolean |
equals(java.lang.Object s)
|
SceneGraphNode |
getFirstElement()
Get the first element of the selection's path. Note that selections always start with a SceneGraphPath . |
SceneGraphComponent |
getLastComponent()
|
java.lang.Object |
getLastElement()
|
SceneGraphNode |
getLastNode()
|
int |
getLength()
|
SceneGraphPath |
getSGPath()
Truncates the selection to SceneGraphNodes. |
int |
hashCode()
|
boolean |
isComponent()
Returns true iff a SceneGraphComponent was selected |
boolean |
isEntity()
Returns true iff an AttributeEntity was selected |
boolean |
isEqual(Selection anotherSelection)
|
boolean |
isNode()
Returns true iff a SceneGraphNode was selected |
boolean |
isSGPath()
Returns true iff the selection corresponds to a SceneGraphPath, i.e. |
boolean |
isTool()
Returns true iff a Tool was selected |
java.util.ListIterator<java.lang.Object> |
iterator()
|
java.util.ListIterator<java.lang.Object> |
iterator(int start)
|
void |
pop()
|
void |
push(java.lang.Object o)
When pushing a SceneGraphNode, this method treats it as part of the SceneGraphPath the selection's path starts with if no other object was pushed before. |
java.util.Iterator |
reverseIterator()
|
java.util.Iterator |
reverseIterator(int start)
|
java.util.List<java.lang.Object> |
toList()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Selection()
public Selection(Selection s)
public Selection(SceneGraphPath path)
Method Detail |
---|
public void clear()
public final void push(java.lang.Object o)
public final void pop()
public SceneGraphNode getFirstElement()
SceneGraphPath
.
public SceneGraphPath getSGPath()
public SceneGraphComponent getLastComponent()
public SceneGraphNode getLastNode()
public java.lang.Object getLastElement()
public boolean isSGPath()
public int getLength()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object s)
equals
in class java.lang.Object
public boolean isEqual(Selection anotherSelection)
public java.util.ListIterator<java.lang.Object> iterator()
public java.util.ListIterator<java.lang.Object> iterator(int start)
public java.util.Iterator reverseIterator()
public java.util.Iterator reverseIterator(int start)
public java.util.List<java.lang.Object> toList()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isTool()
Tool
was selected
public Tool asTool()
Tool
, null
otherwise
public boolean isComponent()
SceneGraphComponent
was selected
public SceneGraphComponent asComponent()
SceneGraphComponent
, null
otherwise
public boolean isNode()
SceneGraphNode
was selected
public SceneGraphNode asNode()
SceneGraphNode
, null
otherwise
public boolean isEntity()
AttributeEntity
was selected
public AttributeEntity asEntity()
AttributeEntity
, null
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |