org.jgraph.pad
Class GPGraph

java.lang.Object
  extended byJGraph
      extended byorg.jgraph.pad.GPGraph

public class GPGraph
extends JGraph

See Also:
Serialized Form

Nested Class Summary
static class GPGraph.ScaledVertexRenderer
           
 class GPGraph.ScaledVertexView
           
 
Field Summary
protected  java.awt.Image background
           
protected  java.awt.Color defaultBorderColor
           
static java.lang.String FILE_FORMAT_VERSION
           
protected  java.awt.print.PageFormat pageFormat
           
protected  boolean pagevisible
           
static VertexRenderer renderer
           
 
Constructor Summary
GPGraph()
           
GPGraph(GraphModel model)
           
GPGraph(GraphModel model, GraphLayoutCache view)
           
 
Method Summary
static void addSampleData(GraphModel model)
           
 java.lang.Object[] getAll()
           
 java.awt.Image getBackgroundImage()
           
 java.lang.Object[] getEdges(java.lang.Object[] cells)
           
 java.lang.Object[] getEdgesBetween(java.lang.Object vertex1, java.lang.Object vertex2)
           
static GPUserObject getGPUserObject(java.lang.Object cell)
           
 java.lang.Object getNeighbour(java.lang.Object edge, java.lang.Object vertex)
           
 java.awt.print.PageFormat getPageFormat()
           
 java.lang.Object[] getSelectionEdges()
           
 java.lang.Object[] getSelectionVertices()
           
 java.lang.Object getSourceVertex(java.lang.Object edge)
           
 CellView getSourceView(java.lang.Object edge)
           
 java.lang.Object getTargetVertex(java.lang.Object edge)
           
 CellView getTargetView(java.lang.Object edge)
           
protected  java.lang.String getToolTipForCell(java.lang.Object cell)
           
 java.lang.String getToolTipText(java.awt.event.MouseEvent event)
          Overrides JComponent'buttonSelect getToolTipText method in order to allow the graph controller to create a tooltip for the topmost cell under the mousepointer.
 java.lang.Object[] getVertices(java.lang.Object[] cells)
           
 boolean isEdge(java.lang.Object object)
           
 boolean isGroup(java.lang.Object cell)
          Returns true if object is a vertex, that is, if it is not an instance of Port or Edge, and all of its children are ports, or it has no children.
 boolean isNeighbour(java.lang.Object v1, java.lang.Object v2)
          Returns true if the given vertices are conntected by a single edge in this document.
 boolean isPageVisible()
           
 boolean isPort(java.lang.Object object)
           
 boolean isVertex(java.lang.Object object)
          Returns true if object is a vertex, that is, if it is not an instance of Port or Edge, and all of its children are ports, or it has no children.
 void setBackgroundImage(java.awt.Image img)
           
 void setPageFormat(java.awt.print.PageFormat format)
           
 void setPageVisible(boolean flag)
           
 void updateUI()
          Notification from the UIManager that the L&F has changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_FORMAT_VERSION

public static java.lang.String FILE_FORMAT_VERSION

pagevisible

protected boolean pagevisible

pageFormat

protected transient java.awt.print.PageFormat pageFormat

background

protected java.awt.Image background

defaultBorderColor

protected transient java.awt.Color defaultBorderColor

renderer

public static VertexRenderer renderer
Constructor Detail

GPGraph

public GPGraph()

GPGraph

public GPGraph(GraphModel model)

GPGraph

public GPGraph(GraphModel model,
               GraphLayoutCache view)
Method Detail

getGPUserObject

public static GPUserObject getGPUserObject(java.lang.Object cell)

addSampleData

public static void addSampleData(GraphModel model)

setPageFormat

public void setPageFormat(java.awt.print.PageFormat format)

getPageFormat

public java.awt.print.PageFormat getPageFormat()

setPageVisible

public void setPageVisible(boolean flag)

isPageVisible

public boolean isPageVisible()

setBackgroundImage

public void setBackgroundImage(java.awt.Image img)

getBackgroundImage

public java.awt.Image getBackgroundImage()

isGroup

public boolean isGroup(java.lang.Object cell)
Returns true if object is a vertex, that is, if it is not an instance of Port or Edge, and all of its children are ports, or it has no children.


isVertex

public boolean isVertex(java.lang.Object object)
Returns true if object is a vertex, that is, if it is not an instance of Port or Edge, and all of its children are ports, or it has no children.


isPort

public boolean isPort(java.lang.Object object)

isEdge

public boolean isEdge(java.lang.Object object)

getSelectionVertices

public java.lang.Object[] getSelectionVertices()

getVertices

public java.lang.Object[] getVertices(java.lang.Object[] cells)

getSelectionEdges

public java.lang.Object[] getSelectionEdges()

getAll

public java.lang.Object[] getAll()

getEdges

public java.lang.Object[] getEdges(java.lang.Object[] cells)

getNeighbour

public java.lang.Object getNeighbour(java.lang.Object edge,
                                     java.lang.Object vertex)

getSourceVertex

public java.lang.Object getSourceVertex(java.lang.Object edge)

getTargetVertex

public java.lang.Object getTargetVertex(java.lang.Object edge)

getSourceView

public CellView getSourceView(java.lang.Object edge)

getTargetView

public CellView getTargetView(java.lang.Object edge)

getEdgesBetween

public java.lang.Object[] getEdgesBetween(java.lang.Object vertex1,
                                          java.lang.Object vertex2)

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
Overrides JComponent'buttonSelect getToolTipText method in order to allow the graph controller to create a tooltip for the topmost cell under the mousepointer. This differs from JTree where the renderers tooltip is used.

NOTE: For JGraph to properly display tooltips of its renderers, JGraph must be a registered component with the ToolTipManager. This can be done by invoking ToolTipManager.sharedInstance().registerComponent(graph). This is not done automatically!

Parameters:
event - the MouseEvent that initiated the ToolTip display
Returns:
a string containing the tooltip or null if event is null

getToolTipForCell

protected java.lang.String getToolTipForCell(java.lang.Object cell)

updateUI

public void updateUI()
Notification from the UIManager that the L&F has changed. Replaces the current UI object with the latest version from the UIManager. Subclassers can override this to support different GraphUIs.

See Also:
JComponent.updateUI()

isNeighbour

public boolean isNeighbour(java.lang.Object v1,
                           java.lang.Object v2)
Returns true if the given vertices are conntected by a single edge in this document.