org.globus.cog.gui.grapheditor.canvas
Interface GraphCanvas

All Superinterfaces:
EventConsumer
All Known Implementing Classes:
AbstractCanvas, EchoCanvas, GenericCanvas, ParallelCanvas, ProjectCanvas, RootCanvas, SerialCanvas, TargetCanvas, TaskCanvas

public interface GraphCanvas
extends EventConsumer


Method Summary
 void addCanvasEventListener(CanvasEventListener listener)
          Adds a listener that can be used to receive various notification events about the state of the canvas
 void addComponent(GraphComponent c)
          Adds a graph component to the graph
 void addStatusEventListener(StatusEventListener listener)
           
 GraphComponent createComponent(String type)
          Allows the automatic creation of a graph component based on the requested type.
 EdgeComponent createEdge(String type)
          A specialized method for createComponent that only creates edges.
 NodeComponent createNode(String type)
          A specialized method for createComponent that only creates nodes.
 void fireCanvasEvent(CanvasEvent e)
           
 void fireStatusEvent(StatusEvent e)
           
 GraphInterface getGraph()
           
 NodeComponent getOwner()
           
 StatusManager getStatusManager()
          Each canvas can have a status manager that can be used to represent various pieces of information pertaining to outcomes of various actions performed on the canvas or its descendants.
 List getSupportedEdges()
          This method is used to define the valid edge types that can appear within this canvas.
 List getSupportedNodes()
          This method is used to define the valid node types that can appear within this canvas.
 void invalidate()
          Notifies the canvas about changes in its sub-components that may require the re-evaluation of the state of the canvas object, most notably a re-rendering of the canvas.
 CanvasRenderer newRenderer()
          Creates a new renderer for this canvas using the current target
 CanvasRenderer newRenderer(String target)
          Creates a new renderer for this canvas using the specified target
 void removeCanvasEventListener(CanvasEventListener listener)
          Removes a previously added listener
 void removeComponent(GraphComponent c)
          Removes a component from the graph.
 void removeStatusEventListener(StatusEventListener listener)
           
 void setEventsActive(boolean eventsActive)
           
 void setGraph(GraphInterface graph)
          sets the graph that is to be displayed/edited by this canvas
 void setOwner(NodeComponent owner)
          Sets the value of the owner of this canvas
 
Methods inherited from interface org.globus.cog.gui.grapheditor.util.EventConsumer
event
 

Method Detail

getSupportedNodes

List getSupportedNodes()
This method is used to define the valid node types that can appear within this canvas.

Returns:
A list of node components that are valid for this canvas

getSupportedEdges

List getSupportedEdges()
This method is used to define the valid edge types that can appear within this canvas.

Returns:
A list of edge components that are valid for this canvas

setGraph

void setGraph(GraphInterface graph)
sets the graph that is to be displayed/edited by this canvas

Parameters:
graph -

getGraph

GraphInterface getGraph()
Returns:
the graph of this canvas

createComponent

GraphComponent createComponent(String type)
Allows the automatic creation of a graph component based on the requested type. The method should consult the list of supported nodes and edges and return a new graph component accordingly. The component should be uninitialized and it should not be added to the graph in order to allow proper initialization by the requesting object.

Parameters:
type - the requested type
Returns:
the new component

addComponent

void addComponent(GraphComponent c)
Adds a graph component to the graph

Parameters:
c -

removeComponent

void removeComponent(GraphComponent c)
Removes a component from the graph. It will also remove other components if neccessary. For example, removing a node, will also cause the removal of incident edges.

Parameters:
c -

createNode

NodeComponent createNode(String type)
A specialized method for createComponent that only creates nodes.

Parameters:
type -
Returns:

createEdge

EdgeComponent createEdge(String type)
A specialized method for createComponent that only creates edges.

Parameters:
type -
Returns:

getOwner

NodeComponent getOwner()
Returns:
the node that owns this canvas

setOwner

void setOwner(NodeComponent owner)
Sets the value of the owner of this canvas

Parameters:
owner -

getStatusManager

StatusManager getStatusManager()
Each canvas can have a status manager that can be used to represent various pieces of information pertaining to outcomes of various actions performed on the canvas or its descendants. This method returns the status manager of this canvas.


newRenderer

CanvasRenderer newRenderer()
Creates a new renderer for this canvas using the current target


newRenderer

CanvasRenderer newRenderer(String target)
Creates a new renderer for this canvas using the specified target


addCanvasEventListener

void addCanvasEventListener(CanvasEventListener listener)
Adds a listener that can be used to receive various notification events about the state of the canvas


removeCanvasEventListener

void removeCanvasEventListener(CanvasEventListener listener)
Removes a previously added listener


fireCanvasEvent

void fireCanvasEvent(CanvasEvent e)

addStatusEventListener

void addStatusEventListener(StatusEventListener listener)

removeStatusEventListener

void removeStatusEventListener(StatusEventListener listener)

fireStatusEvent

void fireStatusEvent(StatusEvent e)

invalidate

void invalidate()
Notifies the canvas about changes in its sub-components that may require the re-evaluation of the state of the canvas object, most notably a re-rendering of the canvas.


setEventsActive

void setEventsActive(boolean eventsActive)