|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatt.grappa.Element
att.grappa.Subgraph
att.grappa.Graph
public class Graph
This class is the root of the overall graph and provides methods for working with the entire graph (for example, printing the graph). It is an extension of the Subgraph class.
Field Summary | |
---|---|
boolean |
filterMode
When filtering a graph (see GrappaSupport.filterGraph) or whenever edge names are desired as part of the output of a printGraph call, set this value to true. |
static java.lang.String |
INDENT_STRING
The string used for indentation when printing out the graph. |
java.awt.font.FontRenderContext |
REFCNTXT
Reference FontRenderContext |
Fields inherited from class att.grappa.Subgraph |
---|
currentSelection, defaultNamePrefix |
Fields inherited from class att.grappa.Element |
---|
counter, highlight, linewidth, object, printAllAttributes, printDefaultAttributes, usePrintList, visible |
Constructor Summary | |
---|---|
Graph(java.lang.String graphName)
Creates a directed graph that is not strict A convenience method equivalent to Graph(graphName,true,false). |
|
Graph(java.lang.String graphName,
boolean directed,
boolean strict)
Creates a new, empty Graph object. |
Method Summary | |
---|---|
void |
addPanel(GrappaPanel panel)
Adds a panel to the list of GrappaPanels that are displaying this graph. |
static int |
attributeType(java.lang.String attrname)
Returns the attribute conversion type for the supplied attribute name. |
void |
buildShapes()
Builds any GrappaNexus object not already built for elements in this graph. |
void |
decrementIndent()
Decrease the indent string by removing one INDENT_STRING. |
boolean |
dropcloth(boolean block,
boolean auto)
Sets and unsets a flag in a synchronized manner so that during the period that the flag is set, painting will not occur. |
java.io.PrintWriter |
getErrorWriter()
Get the current PrintWriter used for error messages. |
static Attribute |
getGlobalAttribute(int type,
java.lang.String key)
Gets a graph default attribute. |
static java.util.Iterator<java.lang.String> |
getGlobalAttributeKeys(int type)
Gets an Iterator of the specified graph default attribute keys |
static java.util.Iterator<Attribute> |
getGlobalAttributePairs(int type)
Gets an iterator of the specified graph default attributes |
static int |
getGlobalAttributeSize(int type)
Get a count of the graph default attributes of a particular type. |
Attribute |
getGrappaAttribute(java.lang.String key)
Gets Grappa default attribute. |
java.util.Iterator<java.lang.String> |
getGrappaAttributeKeys()
Get an Iterator of the Grappa package attribute keys. |
java.lang.Object |
getGrappaAttributeValue(java.lang.String key)
Gets Grappa default attribute value. |
int |
getId(int type)
Get the next id number for the specified type, but do not increment the counter. |
java.lang.String |
getIndent()
Get the current indent string. |
boolean |
getSynchronizePaint()
Get the current paint synchronization indicator value. |
java.lang.String |
getToolTipText()
Get the tooltip text displayed when outside the graph area. |
void |
incrementIndent()
Increase the indent string by appending INDENT_STRING. |
boolean |
isDirected()
Check if the graph is directed. |
boolean |
isEditable()
Check if this graph is interactively editable (i.e., through mouse events). |
boolean |
isMenuable()
Check if an element-specific menu is available interactively (i.e., through mouse events). |
boolean |
isSelectable()
Check if graph elements are interactively selectable (i.e., through mouse events). |
boolean |
isStrict()
Check if the graph is strict (i.e., no self-loops). |
void |
paintImmediately()
Makes a paintImmediately request of all GrappaPanels that are displaying this graph. |
void |
printError(java.lang.String msg)
Print the supplied message to the error output. |
void |
printError(java.lang.String msg,
java.lang.Exception ex)
Print the supplied message and exception information to the error output. |
void |
printGraph(java.io.OutputStream output)
Output graph to specified OutputStream. |
void |
printGraph(java.io.Writer output)
Output graph to specified Writer. |
void |
removePanel(GrappaPanel panel)
Removes a panel to the list of GrappaPanels that are displaying this graph. |
void |
repaint()
Makes a repaint request of all GrappaPanels that are displaying this graph. |
void |
reset()
Reset this graph by removing all its elements and re-initiailizing its internal variables. |
void |
reset(java.lang.String graphName,
boolean directed,
boolean strict)
Reset this graph by removing all its elements and re-initiailizing its internal variables and possibly changing its name, directedness and strictness. |
void |
resync()
Builds any GrappaNexus object not already built and rebuilds those that already exist for all elements in this graph. |
boolean |
setEditable(boolean mode)
Set the editability of the graph. |
java.io.PrintWriter |
setErrorWriter(java.io.PrintWriter errWriter)
Set the PrintWriter for error messages. |
java.lang.Object |
setGrappaAttribute(java.lang.String key,
java.lang.String value)
Sets a Grappa package attribute. |
boolean |
setMenuable(boolean mode)
Set whether element-specific menus are to be available interactively. |
boolean |
setSelectable(boolean mode)
Set the selectability of the graph. |
boolean |
setSynchronizePaint(boolean sync)
Sets or unsets indication that paint requests should be done within a synchronized wrapper that prevents concurrent paints and any paints between calls to the dropcloth method. |
java.lang.String |
setToolTipText(java.lang.String text)
Set the tooltip text displayed when outside the graph area. |
static boolean |
validGrappaAttributeKey(java.lang.String key)
Check if the given key has a format consistent with Grappa package attribute keys. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String INDENT_STRING
public boolean filterMode
public final java.awt.font.FontRenderContext REFCNTXT
Constructor Detail |
---|
public Graph(java.lang.String graphName, boolean directed, boolean strict)
graphName
- the name of this graph.directed
- use true if graph is to be a directed graphstrict
- use true if graph is a strict graphpublic Graph(java.lang.String graphName)
graphName
- the name of this graph.Graph(java.lang.String, boolean, boolean)
Method Detail |
---|
public boolean setSynchronizePaint(boolean sync)
sync
- value to which indicator will be set
dropcloth(boolean, boolean)
public boolean getSynchronizePaint()
setSynchronizePaint(boolean)
public boolean dropcloth(boolean block, boolean auto)
block
- value to which to set the indicator flagauto
- when block is false, setting this parameter true will request a repaint() if any paint requests arrived while the dropcloth was laid out.
setSynchronizePaint(boolean)
public Attribute getGrappaAttribute(java.lang.String key) throws java.lang.IllegalArgumentException
key
- the search key for the corresponding attribute.
java.lang.IllegalArgumentException
- whenever the key is nullpublic java.lang.Object getGrappaAttributeValue(java.lang.String key) throws java.lang.IllegalArgumentException
key
- the search key for the corresponding attribute.
java.lang.IllegalArgumentException
- whenever the key is nullpublic java.lang.Object setGrappaAttribute(java.lang.String key, java.lang.String value) throws java.lang.IllegalArgumentException
key
- the search key for the corresponding attribute.
java.lang.IllegalArgumentException
- whenever the key is not prefixed by Grappa.PKG_LOWERGrappaConstants.PKG_LOWER
public static int attributeType(java.lang.String attrname)
attrname
- the attribute name
public java.util.Iterator<java.lang.String> getGrappaAttributeKeys()
public static boolean validGrappaAttributeKey(java.lang.String key)
key
- the key to validate
GrappaConstants.PKG_LOWER
public static Attribute getGlobalAttribute(int type, java.lang.String key) throws java.lang.IllegalArgumentException
type
- indicates attribute type.key
- the search key for the corresponding attribute.
java.lang.IllegalArgumentException
- whenever the specified type is not validGrappaConstants.NODE
,
GrappaConstants.EDGE
,
GrappaConstants.SUBGRAPH
public static java.util.Iterator<java.lang.String> getGlobalAttributeKeys(int type) throws java.lang.IllegalArgumentException
type
- indicates attribute type.
java.lang.IllegalArgumentException
- whenever the specified type is not validGrappaConstants.NODE
,
GrappaConstants.EDGE
,
GrappaConstants.SUBGRAPH
public static java.util.Iterator<Attribute> getGlobalAttributePairs(int type) throws java.lang.IllegalArgumentException
type
- indicates attribute type.
java.lang.IllegalArgumentException
- whenever the specified type is not validGrappaConstants.NODE
,
GrappaConstants.EDGE
,
GrappaConstants.SUBGRAPH
public static int getGlobalAttributeSize(int type) throws java.lang.IllegalArgumentException
type
- indicates attribute type.
java.lang.IllegalArgumentException
- whenever the specified type is not validGrappaConstants.NODE
,
GrappaConstants.EDGE
,
GrappaConstants.SUBGRAPH
public void printGraph(java.io.Writer output)
output
- the Writer for writingpublic void printGraph(java.io.OutputStream output)
output
- the OutputStream for writingpublic int getId(int type) throws java.lang.IllegalArgumentException
type
- type of id number to return
java.lang.IllegalArgumentException
- whenever the specified type is not validGrappaConstants.NODE
,
GrappaConstants.EDGE
,
GrappaConstants.SUBGRAPH
public java.lang.String getIndent()
public void incrementIndent()
INDENT_STRING
public void decrementIndent()
INDENT_STRING
public boolean isDirected()
public boolean isStrict()
public java.lang.String setToolTipText(java.lang.String text)
text
- out-of-graph tooltip text
public java.lang.String getToolTipText()
public void reset()
public void reset(java.lang.String graphName, boolean directed, boolean strict)
public boolean isEditable()
public boolean setEditable(boolean mode)
mode
- true to turn on editability.
isEditable()
public boolean isSelectable()
public boolean setSelectable(boolean mode)
mode
- true to turn on selectability.
isSelectable()
public boolean isMenuable()
public boolean setMenuable(boolean mode)
mode
- true to turn on element-specific-menus.
isMenuable()
public java.io.PrintWriter setErrorWriter(java.io.PrintWriter errWriter)
errWriter
- the PrintWriter to use for error messages.
PrintWriter
public java.io.PrintWriter getErrorWriter()
PrintWriter
public void printError(java.lang.String msg)
msg
- the message to print on the error output.setErrorWriter(java.io.PrintWriter)
public void printError(java.lang.String msg, java.lang.Exception ex)
msg
- the message to print on the error output.ex
- if supplied, the stack trace associated with this exception is also printed.setErrorWriter(java.io.PrintWriter)
public void buildShapes()
public void resync()
public void repaint()
public void paintImmediately()
public void addPanel(GrappaPanel panel)
panel
- the GrappaPanel to be added to the listpublic void removePanel(GrappaPanel panel)
panel
- the GrappaPanel to be removed to the list
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |