org.globus.cog.gui.grapheditor.targets.swing.views
Class WrappedPassiveGraphView

java.lang.Object
  extended byorg.globus.cog.gui.grapheditor.canvas.views.AbstractView
      extended byorg.globus.cog.gui.grapheditor.targets.swing.views.SwingView
          extended byorg.globus.cog.gui.grapheditor.targets.swing.views.WrappedPassiveGraphView
All Implemented Interfaces:
CanvasEventListener, CanvasView, EventListener, GraphComponentWrapperListener, PropertyChangeListener

public class WrappedPassiveGraphView
extends SwingView
implements CanvasView, PropertyChangeListener, CanvasEventListener, GraphComponentWrapperListener

Implements a graph view. The initial layout is determined by a layout enging. Can filter nodes and edges based on their class types.


Constructor Summary
WrappedPassiveGraphView()
           
WrappedPassiveGraphView(GraphLayoutEngine engine)
           
WrappedPassiveGraphView(GraphLayoutEngine engine, String name)
           
 
Method Summary
 void activate()
           
 void canvasEvent(CanvasEvent e)
           
 void clean()
          Cleans up this view.
 void createWrapper(Edge edge, EdgeComponent ec, Hashtable oldWrappers, Hashtable newWrappers)
           
 void createWrapper(Node node, NodeComponent nc, Hashtable oldWrappers, Hashtable newWrappers, Point l)
           
 Point getCenter(Component component)
           
 GraphLayoutEngine getLayoutEngine()
           
 CanvasView getNewInstance(GraphCanvas canvas)
           
 void graphComponentEvent(GraphComponentWrapperEvent e)
           
 void invalidate()
          Forces the view to reevaluate its internal state.
 void invalidate(boolean ignoreOld)
           
 boolean isEditable()
           
 void propertyChange(PropertyChangeEvent evt)
           
 void reLayout()
           
 void setCenter(Component component, Point p)
           
 void setEdgeCoords(EdgeComponentWrapper edge, Component from, Component to)
           
 void setLayoutEngine(GraphLayoutEngine layoutEngine)
           
 
Methods inherited from class org.globus.cog.gui.grapheditor.targets.swing.views.SwingView
disable, enable, getComponent, getSwingRenderer, repaint, setComponent
 
Methods inherited from class org.globus.cog.gui.grapheditor.canvas.views.AbstractView
addTransformation, getCanvas, getGraph, getName, getRenderer, getTransformations, getType, getViewport, isActive, isSelective, setGraph, setName, setRenderer, setTransformation, setType, setViewport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.globus.cog.gui.grapheditor.canvas.views.CanvasView
addTransformation, getGraph, getName, getRenderer, getViewport, isSelective, setGraph, setRenderer, setTransformation, setViewport
 

Constructor Detail

WrappedPassiveGraphView

public WrappedPassiveGraphView()

WrappedPassiveGraphView

public WrappedPassiveGraphView(GraphLayoutEngine engine)

WrappedPassiveGraphView

public WrappedPassiveGraphView(GraphLayoutEngine engine,
                               String name)
Method Detail

activate

public void activate()
Specified by:
activate in interface CanvasView
Overrides:
activate in class SwingView

clean

public void clean()
Description copied from interface: CanvasView
Cleans up this view. This method should be called when a view is deactivated. The view can be reused later, by invalidating it.

Specified by:
clean in interface CanvasView
Overrides:
clean in class SwingView

getLayoutEngine

public GraphLayoutEngine getLayoutEngine()

getNewInstance

public CanvasView getNewInstance(GraphCanvas canvas)
Specified by:
getNewInstance in interface CanvasView
Overrides:
getNewInstance in class AbstractView

invalidate

public void invalidate()
Description copied from interface: CanvasView
Forces the view to reevaluate its internal state. This method is called whenever the structure of the graph changes

Specified by:
invalidate in interface CanvasView
Overrides:
invalidate in class AbstractView

invalidate

public void invalidate(boolean ignoreOld)

isEditable

public boolean isEditable()

reLayout

public void reLayout()
Specified by:
reLayout in interface CanvasView
Overrides:
reLayout in class AbstractView

setLayoutEngine

public void setLayoutEngine(GraphLayoutEngine layoutEngine)

setCenter

public void setCenter(Component component,
                      Point p)

getCenter

public Point getCenter(Component component)

setEdgeCoords

public void setEdgeCoords(EdgeComponentWrapper edge,
                          Component from,
                          Component to)

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

canvasEvent

public void canvasEvent(CanvasEvent e)
Specified by:
canvasEvent in interface CanvasEventListener

createWrapper

public void createWrapper(Node node,
                          NodeComponent nc,
                          Hashtable oldWrappers,
                          Hashtable newWrappers,
                          Point l)

createWrapper

public void createWrapper(Edge edge,
                          EdgeComponent ec,
                          Hashtable oldWrappers,
                          Hashtable newWrappers)

graphComponentEvent

public void graphComponentEvent(GraphComponentWrapperEvent e)
Specified by:
graphComponentEvent in interface GraphComponentWrapperListener