|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.goui.util.GraphLayout.Vertex
This class is used to connect edges within the layout graph. A Vertex has a position which can either be set explicitly or will be determined during a layout procedure.
Unlike edges, which typically require specific constraint information to provide useful behaviour, it is not expected that Vertex will need to be subclassed during the use of a GraphLayout and while the class itself is not final, all its methods are.
| Constructor Summary | |
GraphLayout.Vertex()
Create a Vertex which will initially have no set position. |
|
| Method Summary | |
int |
getPosition()
This method returns the current position of this Vertex if it has been uniquely determined. |
int |
setPosition(int pos)
This method will attempt to set the position of this Vertex to the given value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GraphLayout.Vertex()
| Method Detail |
public final int setPosition(int pos)
If this occurs then the Vertex will be placed at the closest position to the given value which is permitted by the layout constraints and this new value will be returned. This method will never fail to place a Vertex, however once a Vertex has had its position set, the reset() method must be called on it (or on the GraphLayout to which it belongs) before a different position can be set.
Because there is an overall constraint that Vertices cannot hold negative positions, the value returned from this method will never be negative, irrespective of the input value.
Warning This method is unsynchronised and it is up to the user to ensure that concurrent modification of the layout graph does not occur.
pos - The requested position for this Vertex.
public final int getPosition()
Note that because any source Vertices must have a non-negative initial position and because Edges always have a non-negative size, the position of every Vertex in the graph must also be non-negative once it has been determined.
If the position is not known, GraphLayout.INVALID is returned.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||