org.kohsuke.graphviz
Class GraphObject<T extends GraphObject<T>>

java.lang.Object
  extended by org.kohsuke.graphviz.GraphObject<T>
Direct Known Subclasses:
Edge, Graph, Node, Style

public abstract class GraphObject<T extends GraphObject<T>>
extends java.lang.Object

Base class of graph related objects.

This class maintains a list of attributes that decorates a graph object.

Author:
Kohsuke Kawaguchi

Constructor Summary
GraphObject()
           
 
Method Summary
<V> V
attr(Attribute<V> attribute)
          Gets the effective value of the attribute.
<V> T
attr(Attribute<V> attribute, V value)
          Adds an attribute.
 java.lang.String attr(java.lang.String name)
          Gets the effective value of the attribute.
 T attr(java.lang.String name, java.lang.String value)
          Adds an attribute.
protected static java.lang.String escape(java.lang.String value)
           
 java.util.Map<java.lang.String,java.lang.String> getEffectiveAttributes()
          Gets the snapshot of all effective attributes, after inheriting all values from the style.
 T id(java.lang.String id)
          Explicitly set the ID of this object.
 Style style()
          Gets the style of this object.
 T style(Style s)
          Sets the style of this object to the given one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphObject

public GraphObject()
Method Detail

id

public final T id(java.lang.String id)
Explicitly set the ID of this object.


style

public final T style(Style s)
Sets the style of this object to the given one.


style

public Style style()
Gets the style of this object.


attr

public final T attr(java.lang.String name,
                    java.lang.String value)
Adds an attribute.


attr

public final <V> T attr(Attribute<V> attribute,
                        V value)
Adds an attribute.


attr

public final java.lang.String attr(java.lang.String name)
Gets the effective value of the attribute.


attr

public final <V> V attr(Attribute<V> attribute)
Gets the effective value of the attribute.


getEffectiveAttributes

public java.util.Map<java.lang.String,java.lang.String> getEffectiveAttributes()
Gets the snapshot of all effective attributes, after inheriting all values from the style.


escape

protected static java.lang.String escape(java.lang.String value)


Copyright © 2008. All Rights Reserved.