org.globus.cog.gui.grapheditor.nodes
Class AbstractNodeComponent

java.lang.Object
  extended by org.globus.cog.gui.grapheditor.AbstractGraphComponent
      extended by org.globus.cog.gui.grapheditor.nodes.AbstractNodeComponent
All Implemented Interfaces:
Cloneable, GraphComponent, NodeComponent, PropertyHolder
Direct Known Subclasses:
EditableNodeComponent

public abstract class AbstractNodeComponent
extends AbstractGraphComponent
implements NodeComponent, PropertyHolder

Implements the basic functionality for a node component


Constructor Summary
AbstractNodeComponent()
           
 
Method Summary
 boolean acceptsInEdgeConnection(EdgeComponent edge)
          Determines if a specific edge can be connected to this node
 boolean acceptsOutEdgeConnection(EdgeComponent edge)
          Determines if a specific edge can be connected to this node
 GraphCanvas createCanvas()
           
 GraphCanvas getCanvas()
          Returns a canvas for this node, if it is supported.
 Class getCanvasType()
           
 boolean isResizable()
           
 void setCanvas(GraphCanvas canvas)
           
 void setCanvasType(Class canvasType)
           
 void setResizable(boolean resizable)
           
 
Methods inherited from class org.globus.cog.gui.grapheditor.AbstractGraphComponent
addClassProperty, addProperty, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, get_ID, getClassProperties, getClassProperty, getClassProperty2, getComponentType, getParent, getProperties, getProperty, getProperty2, getPropertyValue, getRootNode, hasClassProperty, hasClassProperty, hasProperty, newInstance, newRenderer, newRenderer, removeProperty, removeProperty, removePropertyChangeListener, set_ID, setClassRendererClass, setClassRendererClass, setClassRendererClass, setClassRendererClass, setComponentType, setInstanceRendererClass, setInstanceRendererClass, setParent, setPropertyValue, supportsType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.globus.cog.gui.grapheditor.GraphComponent
clone, get_ID, getComponentType, getParent, getRootNode, newInstance, newRenderer, newRenderer, set_ID, setComponentType, setParent, supportsType
 
Methods inherited from interface org.globus.cog.gui.grapheditor.properties.PropertyHolder
addProperty, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getProperties, getProperty, getPropertyValue, hasProperty, removeProperty, removePropertyChangeListener, setPropertyValue
 

Constructor Detail

AbstractNodeComponent

public AbstractNodeComponent()
Method Detail

getCanvas

public GraphCanvas getCanvas()
Returns a canvas for this node, if it is supported. If a canvas has not already been defined for this node, the getCanvasType() method is called, and a new canvas is instantiated. This form of lazy creation is used in order to allow generic nodes that can be generated recursively, without entering an infinite loop at initialization.

Specified by:
getCanvas in interface NodeComponent
Returns:
An existing canvas, a new canvas, or null if the node does not support a canvas.

createCanvas

public GraphCanvas createCanvas()
Specified by:
createCanvas in interface NodeComponent

setCanvas

public void setCanvas(GraphCanvas canvas)

acceptsInEdgeConnection

public boolean acceptsInEdgeConnection(EdgeComponent edge)
Description copied from interface: NodeComponent
Determines if a specific edge can be connected to this node

Specified by:
acceptsInEdgeConnection in interface NodeComponent
Returns:

acceptsOutEdgeConnection

public boolean acceptsOutEdgeConnection(EdgeComponent edge)
Description copied from interface: NodeComponent
Determines if a specific edge can be connected to this node

Specified by:
acceptsOutEdgeConnection in interface NodeComponent
Returns:

getCanvasType

public Class getCanvasType()

setCanvasType

public void setCanvasType(Class canvasType)

setResizable

public void setResizable(boolean resizable)

isResizable

public boolean isResizable()
Specified by:
isResizable in interface NodeComponent