|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.graph.impl.AbstractGraph<N,E>
com.kuka.graph.impl.AbstractBaseGraph<N,E>
com.kuka.graph.impl.AbstractBaseListenableGraph<TopologyNode,TopologyEdge>
com.kuka.nav.fleet.graph.TopologyGraph
public class TopologyGraph
Represents a graph containing TopologyNodes and TopologyEdges.
| Nested Class Summary | |
|---|---|
protected static class |
TopologyGraph.ListenerContainer
Contains a collection of listeners. |
| Field Summary | |
|---|---|
static String |
GRAPH_TRANSITION
Key used for registering graph transition custom actions. |
static int |
INVALID_ID
Invalid node and graph id. |
| Constructor Summary | |
|---|---|
TopologyGraph()
Creates a new topology graph. |
|
| Method Summary | |
|---|---|
boolean |
addEdge(TopologyEdge edge)
|
boolean |
addNode(TopologyNode node)
|
void |
addTopologyGraphListener(TopologyGraphListener listener)
Adds the given listener to this graph. |
protected void |
checkLegalNodeAddition(TopologyGraph g,
TopologyNode n)
Checks whether the node may be added to the given topology graph. |
TopologyEdge |
createEdge(TopologyNode source,
TopologyNode target)
|
TopologyNode |
createNode()
Additionally an id is generated for the new node. |
TopologyNode |
createNode(int id)
Creates a new node with the given id, adds it to this graph and returns the created node. |
protected void |
fireEdgeChanged(TopologyEdge edge)
Fires an edge changed event. |
protected void |
fireEdgePropertyAdded(TopologyEdge edge,
Property property)
Fires a property added event. |
protected void |
fireEdgePropertyChanged(TopologyEdge edge,
Property property)
Fires a property changed event. |
protected void |
fireEdgePropertyRemoved(TopologyEdge edge,
Property property)
Deprecated. use instead |
protected void |
fireEdgePropertyRemoved(TopologyEdge edge,
Property property,
Integer robotTypeId)
Fires a property removed event. |
protected void |
fireNodeChanged(TopologyNode node)
Fires a node changed event. |
protected void |
fireNodePropertyAdded(TopologyNode node,
Property property)
Fires a property added event. |
protected void |
fireNodePropertyChanged(TopologyNode node,
Property property)
Fires a property changed event. |
protected void |
fireNodePropertyRemoved(TopologyNode node,
Property property)
Deprecated. use instead |
protected void |
fireNodePropertyRemoved(TopologyNode node,
Property property,
Integer robotTypeId)
Fires a property removed event. |
TopologyEdge |
getEdge(int sourceNodeID,
int targetNodeID)
Retrieves an edge by its node IDs or null if no such edge exists. |
TopologyEdge |
getEdge(TopologyEdge e)
Retrieves an edge by edge reference, e.g., to map input parameters to 'real' edges. |
int |
getId()
Gets the graph ID. |
int |
getMapId()
Gets the ID of the map the graph is configured on. |
String |
getName()
Gets the name of the graph or null if no name is set. |
int |
getNextFreeNodeId()
Finds the smallest unused node id that is bigger than 0. |
TopologyNode |
getNode(int id)
Retrieves a node by its id. |
TopologyNode |
getNode(String name)
Retrieves a node by its name. |
TopologyNode |
getNode(TopologyNodeId node)
Retrieves a node by a node reference, e.g. to map an input parameter to a 'real' topology graph node. |
TopologyGraph |
getSubgraphOf(TopologyNodeId node)
Returns the subgraph of this topology graph which contains the given node. |
Collection<TopologyGraph> |
getSubgraphs()
Returns all contained subgraphs. |
com.kuka.nav.provider.util.ObjectMap<String> |
getTags()
Gets the tags of the graph. |
protected Collection<TopologyGraphListener> |
getTopologyGraphListeners()
Returns all contained listeners. |
boolean |
hasName()
Checks if the graph has a name assigned. |
boolean |
removeEdge(TopologyEdge edge)
|
boolean |
removeNode(TopologyNode node)
|
void |
removeTopologyGraphListener(TopologyGraphListener listener)
Removes the given listener from this graph. |
void |
setGraphId(int id)
Recursively sets graph ID to graph and all contained elements. |
String |
toString()
|
static TopologyGraph |
withId(int id)
Creates a new topology graph instance with given ID. |
static TopologyGraph |
withName(String name)
Creates a new topology graph instance with given name. |
| Methods inherited from class com.kuka.graph.impl.AbstractBaseListenableGraph |
|---|
addListener, hasListeners, removeListener |
| Methods inherited from class com.kuka.graph.impl.AbstractBaseGraph |
|---|
clone, containsEdge, containsNode, edges, getEdge, incomingEdges, neighbors, nodes, outgoingEdges |
| Methods inherited from class com.kuka.graph.impl.AbstractGraph |
|---|
addAllEdges, addAllNodes, clear, containsAllEdges, containsAllNodes, containsEdge, edges, edgeSize, isEmpty, iterator, nodes, nodeSize, removeAllEdges, removeAllNodes, removeEdge, retainAllEdges, retainAllNodes |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.kuka.graph.Graph |
|---|
addAllEdges, addAllNodes, clear, containsAllEdges, containsAllNodes, containsEdge, containsEdge, containsNode, edges, edges, edgeSize, getEdge, incomingEdges, isEmpty, neighbors, nodes, nodes, nodeSize, outgoingEdges, removeAllEdges, removeAllNodes, removeEdge, retainAllEdges, retainAllNodes |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Field Detail |
|---|
public static final int INVALID_ID
public static final String GRAPH_TRANSITION
| Constructor Detail |
|---|
public TopologyGraph()
| Method Detail |
|---|
public static TopologyGraph withId(int id)
Note that the object created with this static factory method is only an identifier and does not reflect the state of the corresponding element in the data source, i.e. most of the getters will fail.
A TopologyNode returned by this method can be used to parameterize a
GraphMotion#GraphMotion(TopologyGraph, TopologyNode).
id - the topology element ID
GraphMotion#GraphMotion(TopologyGraph, TopologyNode)public static TopologyGraph withName(String name)
Note that the object created with this static factory method is only an identifier and does not reflect the state of the corresponding element in the data source, i.e. most of the getters will fail.
A TopologyNode returned by this method can be used to parameterize a
GraphMotion#GraphMotion(TopologyGraph, TopologyNode).
name - the graph name
GraphMotion#GraphMotion(TopologyGraph, TopologyNode)public com.kuka.nav.provider.util.ObjectMap<String> getTags()
public TopologyNode createNode()
Additionally an id is generated for the new node. It will be the first free id found starting from 1.
createNode(int)public TopologyNode createNode(int id)
id - the id of the new node
public TopologyEdge createEdge(TopologyNode source,
TopologyNode target)
public int getId()
public int getMapId()
public boolean hasName()
public String getName()
public TopologyNode getNode(int id)
id - id of the node
public TopologyNode getNode(String name)
name - name of the node
public TopologyEdge getEdge(TopologyEdge e)
e - the edge reference
null if no such
edge exists.public TopologyNode getNode(TopologyNodeId node)
node - the reference node
public TopologyEdge getEdge(int sourceNodeID,
int targetNodeID)
sourceNodeID - the source node IDtargetNodeID - the target node ID
public String toString()
toString in class com.kuka.graph.impl.AbstractGraph<TopologyNode,TopologyEdge>public boolean addNode(TopologyNode node)
addNode in interface com.kuka.graph.Graph<TopologyNode,TopologyEdge>addNode in class com.kuka.graph.impl.AbstractBaseListenableGraph<TopologyNode,TopologyEdge>public boolean addEdge(TopologyEdge edge)
addEdge in interface com.kuka.graph.Graph<TopologyNode,TopologyEdge>addEdge in class com.kuka.graph.impl.AbstractBaseListenableGraph<TopologyNode,TopologyEdge>public boolean removeNode(TopologyNode node)
removeNode in interface com.kuka.graph.Graph<TopologyNode,TopologyEdge>removeNode in class com.kuka.graph.impl.AbstractBaseListenableGraph<TopologyNode,TopologyEdge>public boolean removeEdge(TopologyEdge edge)
removeEdge in interface com.kuka.graph.Graph<TopologyNode,TopologyEdge>removeEdge in class com.kuka.graph.impl.AbstractBaseListenableGraph<TopologyNode,TopologyEdge>public void setGraphId(int id)
id - the graph IDpublic Collection<TopologyGraph> getSubgraphs()
This topology graph itself is not considered to be its own subgraph, hence, it is not contained in the returned collection.
public TopologyGraph getSubgraphOf(TopologyNodeId node)
null is returned.
This topology graph itself is not considered to be its own subgraph, hence, if the given node is contained in
this graph null is returned.
node - the node to get the corresponding subgraph for
nullpublic void addTopologyGraphListener(TopologyGraphListener listener)
listener - the listener to addpublic void removeTopologyGraphListener(TopologyGraphListener listener)
listener - the listener to removeprotected Collection<TopologyGraphListener> getTopologyGraphListeners()
protected void fireNodeChanged(TopologyNode node)
node - the node that has been changed
protected void fireNodePropertyAdded(TopologyNode node,
Property property)
node - the node that contains the propertyproperty - the property that has been added
@Deprecated
protected void fireNodePropertyRemoved(TopologyNode node,
Property property)
instead
node - the node that contains the propertyproperty - the property that has been removed
protected void fireNodePropertyRemoved(TopologyNode node,
Property property,
Integer robotTypeId)
node - the node that contains the propertyproperty - the property that has been removedrobotTypeId - the corresponding robot type to the removed property
protected void fireNodePropertyChanged(TopologyNode node,
Property property)
node - the node that contains the propertyproperty - the property that has been changedprotected void fireEdgeChanged(TopologyEdge edge)
edge - the edge that has been changed
protected void fireEdgePropertyAdded(TopologyEdge edge,
Property property)
edge - the edge that contains the propertyproperty - the property that has been added
@Deprecated
protected void fireEdgePropertyRemoved(TopologyEdge edge,
Property property)
instead
edge - the edge that contains the propertyproperty - the property that has been removed
protected void fireEdgePropertyRemoved(TopologyEdge edge,
Property property,
Integer robotTypeId)
edge - the edge that contains the propertyproperty - the property that has been removedrobotTypeId - the corresponding robot type to the removed property
protected void fireEdgePropertyChanged(TopologyEdge edge,
Property property)
edge - the edge that contains the propertyproperty - the property that has been changed
protected void checkLegalNodeAddition(TopologyGraph g,
TopologyNode n)
n - the node to be added.g - the graph to which the node shall be added.public int getNextFreeNodeId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||