edu.mit.csail.sdg.alloy4graph
Class GraphNode

java.lang.Object
  extended by edu.mit.csail.sdg.alloy4graph.GraphNode

public final class GraphNode
extends java.lang.Object

Mutable; represents a graphical node.

Thread Safety: Can be called only by the AWT event thread.


Field Summary
 java.lang.Object uuid
          a user-provided annotation that will be associated with this node (can be null) (need not be unique)
 
Constructor Summary
GraphNode(Graph graph, java.lang.Object uuid, java.lang.String... labels)
          Create a new node with the given list of labels, then add it to the given graph.
 
Method Summary
 GraphNode addLabel(java.lang.String label)
          Add the given label after the existing labels, then invalidate the computed bounds.
 java.util.List<GraphEdge> inEdges()
          Returns an unmodifiable view of the list of "in" edges.
 java.util.List<GraphEdge> outEdges()
          Returns an unmodifiable view of the list of "out" edges.
 java.util.List<GraphEdge> selfEdges()
          Returns an unmodifiable view of the list of "self" edges.
 GraphNode set(java.awt.Color color)
          Changes the node color, then invalidate the computed bounds.
 GraphNode set(DotShape shape)
          Changes the node shape (where null means change the node into a dummy node), then invalidate the computed bounds.
 GraphNode set(DotStyle style)
          Changes the line style, then invalidate the computed bounds.
 GraphNode setFontBoldness(boolean bold)
          Changes the font boldness, then invalidate the computed bounds.
 java.lang.String toString()
          Returns a DOT representation of this node (or "" if this is a dummy node)
 int x()
          Returns the X coordinate of the center of the node.
 int y()
          Returns the Y coordinate of the center of the node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

uuid

public final java.lang.Object uuid
a user-provided annotation that will be associated with this node (can be null) (need not be unique)

Constructor Detail

GraphNode

public GraphNode(Graph graph,
                 java.lang.Object uuid,
                 java.lang.String... labels)
Create a new node with the given list of labels, then add it to the given graph.

Method Detail

inEdges

public java.util.List<GraphEdge> inEdges()
Returns an unmodifiable view of the list of "in" edges.


outEdges

public java.util.List<GraphEdge> outEdges()
Returns an unmodifiable view of the list of "out" edges.


selfEdges

public java.util.List<GraphEdge> selfEdges()
Returns an unmodifiable view of the list of "self" edges.


x

public int x()
Returns the X coordinate of the center of the node.


y

public int y()
Returns the Y coordinate of the center of the node.


set

public GraphNode set(DotShape shape)
Changes the node shape (where null means change the node into a dummy node), then invalidate the computed bounds.


set

public GraphNode set(java.awt.Color color)
Changes the node color, then invalidate the computed bounds.


set

public GraphNode set(DotStyle style)
Changes the line style, then invalidate the computed bounds.


setFontBoldness

public GraphNode setFontBoldness(boolean bold)
Changes the font boldness, then invalidate the computed bounds.


addLabel

public GraphNode addLabel(java.lang.String label)
Add the given label after the existing labels, then invalidate the computed bounds.


toString

public java.lang.String toString()
Returns a DOT representation of this node (or "" if this is a dummy node)

Overrides:
toString in class java.lang.Object