org.globus.cog.gui.grapheditor.canvas.views
Class AbstractView

java.lang.Object
  extended byorg.globus.cog.gui.grapheditor.canvas.views.AbstractView
All Implemented Interfaces:
CanvasView
Direct Known Subclasses:
DotGraphView, HtmlGraphView, NullView, PostScriptGraphView, RemoteCanvasView, SVGGraphView, SwingView

public abstract class AbstractView
extends Object
implements CanvasView

Implements basic methods for a view


Constructor Summary
AbstractView()
           
 
Method Summary
 void activate()
           
 void addTransformation(GraphTransformation transformation)
          Adds a transformation to the chain of transformations.
 void clean()
          Cleans up this view.
 GraphCanvas getCanvas()
           
 GraphInterface getGraph()
           
 String getName()
           
 CanvasView getNewInstance(GraphCanvas canvas)
           
 CanvasRenderer getRenderer()
           
 List getTransformations()
           
 String getType()
           
 Rectangle getViewport()
           
 void invalidate()
          Forces the view to reevaluate its internal state.
 boolean isActive()
           
 boolean isSelective()
           
 void reLayout()
           
 void setGraph(GraphInterface graph)
           
 void setName(String name)
           
 void setRenderer(CanvasRenderer renderer)
          Sets the canvas to which this view belongs
 void setTransformation(GraphTransformation transformation)
          Sets the transformation.
 void setType(String type)
           
 void setViewport(Rectangle rect)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractView

public AbstractView()
Method Detail

setTransformation

public void setTransformation(GraphTransformation transformation)
Description copied from interface: CanvasView
Sets the transformation. The said transformation is applied before rendering.

Specified by:
setTransformation in interface CanvasView

addTransformation

public void addTransformation(GraphTransformation transformation)
Description copied from interface: CanvasView
Adds a transformation to the chain of transformations. The transformations will be applied successively, in REVERSE order: Last added first.

Specified by:
addTransformation in interface CanvasView

getTransformations

public List getTransformations()

getName

public String getName()
Specified by:
getName in interface CanvasView

setName

public void setName(String name)

getType

public String getType()

setType

public void setType(String type)

getNewInstance

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

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

getGraph

public GraphInterface getGraph()
Specified by:
getGraph in interface CanvasView

setGraph

public void setGraph(GraphInterface graph)
Specified by:
setGraph in interface CanvasView

reLayout

public void reLayout()
Specified by:
reLayout in interface CanvasView

setViewport

public void setViewport(Rectangle rect)
Specified by:
setViewport in interface CanvasView

getViewport

public Rectangle getViewport()
Specified by:
getViewport in interface CanvasView

isSelective

public boolean isSelective()
Specified by:
isSelective in interface CanvasView

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

activate

public void activate()
Specified by:
activate in interface CanvasView

getRenderer

public CanvasRenderer getRenderer()
Specified by:
getRenderer in interface CanvasView

setRenderer

public void setRenderer(CanvasRenderer renderer)
Description copied from interface: CanvasView
Sets the canvas to which this view belongs

Specified by:
setRenderer in interface CanvasView

getCanvas

public GraphCanvas getCanvas()

isActive

public boolean isActive()