public class GraphicNode extends GraphicElement implements Node
A graphic node defines a position (x,y,z), a string label, and a style from the style sheet.
GraphicGraphGraphicElement.SwingElementRendererAbstractElement.AttributeChangeEvent| Modifier and Type | Field and Description |
|---|---|
boolean |
positionned |
double |
x
The position of the node.
|
double |
y
The position of the node.
|
double |
z
The position of the node.
|
component, hidden, label, style| Constructor and Description |
|---|
GraphicNode(GraphicGraph graph,
String id,
HashMap<String,Object> attributes)
New graphic node.
|
| Modifier and Type | Method and Description |
|---|---|
Iterator<Node> |
getBreadthFirstIterator()
Not implemented.
|
Iterator<Node> |
getBreadthFirstIterator(boolean directed)
Not implemented.
|
int |
getDegree()
Total number of relations with other nodes or this node.
|
Iterator<Node> |
getDepthFirstIterator()
Not implemented.
|
Iterator<Node> |
getDepthFirstIterator(boolean directed)
Not implemented.
|
<T extends Edge> |
getEachEdge()
Set of all entering and leaving edges.
|
<T extends Edge> |
getEachEnteringEdge()
Set of all entering edges.
|
<T extends Edge> |
getEachLeavingEdge()
Set of all leaving edges.
|
<T extends Edge> |
getEdge(int i)
I-th edge.
|
<T extends Edge> |
getEdgeBetween(int index)
Retrieves an edge between this node and the node with index i if one
exists.
|
<T extends Edge> |
getEdgeBetween(Node Node)
Retrieves an edge between this node and and another node if one exists.
|
<T extends Edge> |
getEdgeBetween(String id)
Retrieve an edge between this node and the node 'id', if it exits.
|
<T extends Edge> |
getEdgeFrom(int index)
Retrieves an edge that leaves node with given index toward this node.
|
<T extends Edge> |
getEdgeFrom(Node Node)
Retrieves an edge that leaves given node toward this node.
|
<T extends Edge> |
getEdgeFrom(String id)
Retrieve an edge that leaves node 'id' toward this node.
|
<T extends Edge> |
getEdgeIterator()
Iterator on the set of connected edges.
|
<T extends Edge> |
getEdgeSet()
Set of all entering and leaving edges.
|
<T extends Edge> |
getEdgeToward(int index)
Retrieves an edge that leaves this node toward the node with given index.
|
<T extends Edge> |
getEdgeToward(Node Node)
Retrieves an edge that leaves this node toward another node.
|
<T extends Edge> |
getEdgeToward(String id)
Retrieve an edge that leaves this node toward 'id'.
|
<T extends Edge> |
getEnteringEdge(int i)
I-th entering edge.
|
<T extends Edge> |
getEnteringEdgeIterator()
Iterator only on leaving edges.
|
<T extends Edge> |
getEnteringEdgeSet()
Set of all entering edges.
|
Graph |
getGraph()
Parent graph.
|
String |
getGraphName() |
String |
getHost() |
int |
getInDegree()
Number of entering edges.
|
<T extends Edge> |
getLeavingEdge(int i)
I-th leaving edge.
|
<T extends Edge> |
getLeavingEdgeIterator()
Iterator only on entering edges.
|
<T extends Edge> |
getLeavingEdgeSet()
Set of all leaving edges.
|
Iterator<Node> |
getNeighborNodeIterator()
Iterator on the set of neighbor nodes connected to this node via one or
more edges.
|
int |
getOutDegree()
Number of leaving edges.
|
Selector.Type |
getSelectorType()
Type of selector for the graphic element (Node, Edge, Sprite ?).
|
double |
getX()
Abscissa of the element, always in GU (graph units).
|
double |
getY()
Ordinate of the element, always in GU (graph units).
|
double |
getZ()
Depth of the element, always in GU (graph units).
|
boolean |
hasEdgeBetween(int index)
True if an edge exists between this node and a node with given index.
|
boolean |
hasEdgeBetween(Node node)
True if an edge exists between this node and another node.
|
boolean |
hasEdgeBetween(String id)
True if an edge exists between this node and node 'id'.
|
boolean |
hasEdgeFrom(int index)
True if an edge enters this node from a node with given index.
|
boolean |
hasEdgeFrom(Node node)
True if an edge enters this node from a given node.
|
boolean |
hasEdgeFrom(String id)
True if an edge enters this node from node 'id'.
|
boolean |
hasEdgeToward(int index)
True if an edge leaves this node toward a node with given index.
|
boolean |
hasEdgeToward(Node node)
True if an edge leaves this node toward a given node.
|
boolean |
hasEdgeToward(String id)
True if an edge leaves this node toward node 'id'.
|
boolean |
isDistributed() |
Iterator<Edge> |
iterator() |
void |
move(double x,
double y,
double z)
Try to force the element to move at the give location in graph units
(GU).
|
void |
setGraph(Graph graph) |
void |
setGraphName(String newHost) |
void |
setHost(String newHost) |
addAttribute, getComponent, getLabel, getStyle, myGraph, setComponentaddAttributes, changeAttribute, clearAttributes, getArray, getAttribute, getAttribute, getAttributeCount, getAttributeKeyIterator, getAttributeKeySet, getEachAttributeKey, getFirstAttributeOf, getFirstAttributeOf, getHash, getId, getIndex, getLabel, getNumber, getVector, hasArray, hasAttribute, hasAttribute, hasHash, hasLabel, hasNumber, hasVector, removeAttribute, setAttribute, toStringequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddAttribute, addAttributes, changeAttribute, clearAttributes, getArray, getAttribute, getAttribute, getAttributeCount, getAttributeKeyIterator, getAttributeKeySet, getEachAttributeKey, getFirstAttributeOf, getFirstAttributeOf, getHash, getId, getIndex, getLabel, getNumber, getVector, hasArray, hasAttribute, hasAttribute, hasHash, hasLabel, hasNumber, hasVector, removeAttribute, setAttributepublic double x
public double y
public double z
public boolean positionned
public GraphicNode(GraphicGraph graph, String id, HashMap<String,Object> attributes)
id - The node identifier.attributes - The node attribute set (can be null).public Selector.Type getSelectorType()
GraphicElementgetSelectorType in class GraphicElementpublic double getX()
GraphicElementgetX in class GraphicElementpublic double getY()
GraphicElementgetY in class GraphicElementpublic double getZ()
GraphicElementgetZ in class GraphicElementpublic void move(double x,
double y,
double z)
GraphicElementmove in class GraphicElementx - The new X.y - The new Y.z - the new Z.public Iterator<Node> getBreadthFirstIterator()
getBreadthFirstIterator in interface Nodepublic Iterator<Node> getBreadthFirstIterator(boolean directed)
getBreadthFirstIterator in interface Nodedirected - If false, the iterator will ignore edge orientation (the
default is "True").public Iterator<Node> getDepthFirstIterator()
getDepthFirstIterator in interface Nodepublic Iterator<Node> getDepthFirstIterator(boolean directed)
getDepthFirstIterator in interface Nodedirected - If false, the iterator will ignore edge orientation (the
default is "True").public int getDegree()
Nodepublic <T extends Edge> T getEdge(int i)
NodeHowever this method allows to iterate very quickly on all edges, or to choose a given edge with direct access.
This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedEdge e = node.getEdge(i);the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.
public <T extends Edge> T getEdgeBetween(String id)
NodeThis method selects directed or undirected edges. If the edge is directed, its direction is not important and leaving or entering edges will be selected.
This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedEdge e = node.getEdgeBetween("...");
the method will return an ExtendedEdge. If no left part exists, method
will just return an Edge.
getEdgeBetween in interface Nodeid - Identifier of the opposite node.public <T extends Edge> T getEdgeFrom(String id)
NodeThis method selects only edges leaving node 'id' an pointing at this node (this also selects undirected edges).
This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedEdge e = node.getEdgeFrom("...");
the method will return an ExtendedEdge. If no left part exists, method
will just return an Edge.
getEdgeFrom in interface Nodeid - Identifier of the source node.public <T extends Edge> Iterator<T> getEdgeIterator()
NodeThis iterator iterates on all edges leaving and entering (this includes any non-directed edge present, and a non-directed edge is only iterated once).
This method is implicitly generic and return an Iterator over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
Iterator<ExtendedEdge> ite = node.getEdgeIterator();the method will return an Iterator<ExtendedEdge>. If no left part exists, method will just return an Iterator<Edge>.
getEdgeIterator in interface Nodepublic <T extends Edge> Iterable<T> getEachEdge()
NodeThis method is implicitly generic and return an Iterable over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
Iterable<ExtendedEdge> ite = node.getEdgeSet();the method will return an Iterable<ExtendedEdge>. If no left part exists, method will just return an Iterable<Edge>.
getEachEdge in interface Nodepublic <T extends Edge> Collection<T> getEdgeSet()
NodeThis method is implicitly generic and return an Iterable over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
Iterable<ExtendedEdge> ite = node.getEdgeSet();the method will return an Iterable<ExtendedEdge>. If no left part exists, method will just return an Iterable<Edge>.
getEdgeSet in interface Nodepublic <T extends Edge> T getEdgeToward(String id)
NodeThis method selects only edges leaving this node an pointing at node 'id' (this also selects undirected edges).
This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedEdge e = node.getEdgeToward("...");
the method will return an ExtendedEdge. If no left part exists, method
will just return an Edge.
getEdgeToward in interface Nodeid - Identifier of the target node.public <T extends Edge> Iterator<T> getEnteringEdgeIterator()
NodeThis iterator iterates only on directed edges going from this node to others (non-directed edges are included in the iteration).
This method is implicitly generic and return an Iterator over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
Iterator<ExtendedEdge> ite = node.getEnteringEdgeIterator();the method will return an Iterator<ExtendedEdge>. If no left part exists, method will just return an Iterator<Edge>.
getEnteringEdgeIterator in interface Nodepublic <T extends Edge> Iterable<T> getEachEnteringEdge()
NodeThis method is implicitly generic and return an Iterable over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
Iterable<ExtendedEdge> ite = node.getEnteringEdgeSet();the method will return an Iterable<ExtendedEdge>. If no left part exists, method will just return an Iterable<Edge>.
getEachEnteringEdge in interface Nodepublic <T extends Edge> Collection<T> getEnteringEdgeSet()
NodeThis method is implicitly generic and return an Iterable over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
Iterable<ExtendedEdge> ite = node.getEnteringEdgeSet();the method will return an Iterable<ExtendedEdge>. If no left part exists, method will just return an Iterable<Edge>.
getEnteringEdgeSet in interface Nodepublic Graph getGraph()
Nodepublic String getGraphName()
public String getHost()
public int getInDegree()
NodegetInDegree in interface Nodepublic <T extends Edge> Iterator<T> getLeavingEdgeIterator()
NodeThis iterator iterates only on directed edges going from other nodes toward this node (non-directed edges are included in the iteration).
This method is implicitly generic and return an Iterator over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
Iterator<ExtendedEdge> ite = node.getLeavingEdgeIterator();the method will return an Iterator<ExtendedEdge>. If no left part exists, method will just return an Iterator<Edge>.
getLeavingEdgeIterator in interface Nodepublic <T extends Edge> Iterable<T> getEachLeavingEdge()
NodeThis method is implicitly generic and return an Iterable over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
Iterable<ExtendedEdge> ite = node.getLeavingEdgeSet();the method will return an Iterable<ExtendedEdge>. If no left part exists, method will just return an Iterable<Edge>.
getEachLeavingEdge in interface Nodepublic <T extends Edge> Collection<T> getLeavingEdgeSet()
NodeThis method is implicitly generic and return an Iterable over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
Iterable<ExtendedEdge> ite = node.getLeavingEdgeSet();the method will return an Iterable<ExtendedEdge>. If no left part exists, method will just return an Iterable<Edge>.
getLeavingEdgeSet in interface Nodepublic Iterator<Node> getNeighborNodeIterator()
NodegetNeighborNodeIterator in interface Nodepublic int getOutDegree()
NodegetOutDegree in interface Nodepublic boolean hasEdgeBetween(String id)
NodehasEdgeBetween in interface Nodeid - Identifier of another node.public boolean hasEdgeFrom(String id)
NodehasEdgeFrom in interface Nodeid - Identifier of the source node.public boolean hasEdgeToward(String id)
NodehasEdgeToward in interface Nodeid - Identifier of the target node.public boolean isDistributed()
public void setGraph(Graph graph)
public void setGraphName(String newHost)
public void setHost(String newHost)
public <T extends Edge> T getEdgeBetween(Node Node)
NodeThis method selects directed or undirected edges. If the edge is directed, its direction is not important and leaving or entering edges will be selected.
This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedEdge e = node.getEdgeBetween(...);the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.
getEdgeBetween in interface NodeNode - The opposite node.public <T extends Edge> T getEdgeBetween(int index)
NodeThis method selects directed or undirected edges. If the edge is directed, its direction is not important and leaving or entering edges will be selected.
This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedEdge e = node.getEdgeBetween(...);the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.
getEdgeBetween in interface Nodeindex - The index of the opposite node.public <T extends Edge> T getEdgeFrom(Node Node)
NodeThis method selects only edges leaving the other node an pointing at this node (this also selects undirected edges).
This method is implicitly generic and returns something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedEdge e = node.getEdgeFrom(...);the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.
getEdgeFrom in interface NodeNode - The source node.public <T extends Edge> T getEdgeFrom(int index)
NodeThis method selects only edges leaving the other node an pointing at this node (this also selects undirected edges).
This method is implicitly generic and returns something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedEdge e = node.getEdgeFrom("...");
the method will return an ExtendedEdge. If no left part exists, method
will just return an Edge.
getEdgeFrom in interface Nodeindex - Index of the source node.public <T extends Edge> T getEdgeToward(Node Node)
NodeThis method selects only edges leaving this node an pointing at the parameter node (this also selects undirected edges).
This method is implicitly generic and returns something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedEdge e = node.getEdgeToward(...);the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.
getEdgeToward in interface NodeNode - The target node.public <T extends Edge> T getEdgeToward(int index)
NodeThis method selects only edges leaving this node an pointing at the parameter node (this also selects undirected edges).
This method is implicitly generic and returns something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedEdge e = node.getEdgeToward(...);the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.
getEdgeToward in interface Nodeindex - Index of the target node.public boolean hasEdgeBetween(Node node)
NodehasEdgeBetween in interface Nodenode - Another node.public boolean hasEdgeBetween(int index)
NodehasEdgeBetween in interface Nodeindex - Index of another node.public boolean hasEdgeFrom(Node node)
NodehasEdgeFrom in interface Nodenode - The source node.public boolean hasEdgeFrom(int index)
NodehasEdgeFrom in interface Nodeindex - Index of the source node.public boolean hasEdgeToward(Node node)
NodehasEdgeToward in interface Nodenode - The target node.public boolean hasEdgeToward(int index)
NodehasEdgeToward in interface Nodeindex - Index of the target node.public <T extends Edge> T getEnteringEdge(int i)
NodeHowever this method allows to iterate very quickly on all entering edges, or to choose a given entering edge with direct access.
This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedEdge e = node.getEnteringEdge(i);the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.
getEnteringEdge in interface Nodei - Index of the edge.public <T extends Edge> T getLeavingEdge(int i)
NodeHowever this method allows to iterate very quickly on all leaving edges, or to choose a given leaving edge with direct access.
This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedEdge e = node.getLeavingEdge(i);the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.
getLeavingEdge in interface Nodei - Index of the edge.Copyright © 2015. All rights reserved.