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

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.GraphView
All Implemented Interfaces:
ActionListener, CanvasActionListener, CanvasEventListener, CanvasView, Editor, EventListener, GraphComponentWrapperListener, MouseListener, MouseMotionListener, WindowListener
Direct Known Subclasses:
FlowView, ParallelFlowView, SerialFlowView, TargetsGraphView

public class GraphView
extends SwingView
implements ActionListener, CanvasView, GraphComponentWrapperListener, MouseListener, MouseMotionListener, Editor, CanvasActionListener, WindowListener, CanvasEventListener

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


Field Summary
static String CONTROL_POINTS
           
static Dimension DEFAULT_SIZE
           
static String LOCATION
           
static String SIZE
           
 
Constructor Summary
GraphView()
           
GraphView(GraphLayoutEngine engine)
           
GraphView(GraphLayoutEngine engine, String name)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 void activate()
           
 void cancelEdgeEditing()
           
 void cancelEdgeRequest()
           
 void canvasActionPerformed(CanvasActionEvent e)
           
 void canvasEvent(CanvasEvent e)
           
 void clean()
          Synchronized so that it waits until any pending invalidations are completed.
 void disable()
           
 void enable()
           
 boolean getAntiAliasing()
           
 Point getCenter(Component component)
           
 GraphLayoutEngine getLayoutEngine()
           
 CanvasView getNewInstance(GraphCanvas canvas)
           
static Point getRectIntersection(Component comp, Point p)
           
static Point getRectIntersection(int xCenter, int yCenter, int x, int y, int width, int height, Point p)
           
static Point getRectIntersection(int x, int y, int width, int height, Point p)
           
static Point getRectIntersection(NodeComponent comp, Point p)
           
static Point getRectIntersection2(int xCenter, int yCenter, int width, int height, Point p)
           
 void graphChanged(GraphChangedEvent e)
           
 void graphComponentEvent(GraphComponentWrapperEvent e)
           
 void initializeEdgesNormal(Map newWrappers, Map coords)
           
 void initializeEdgesSelective(Map coords)
           
 void initializeNodesNormal(Map newWrappers, Map coords)
           
 void initializeNodesSelective(Map coords)
           
 void invalidate()
          Forces the view to reevaluate its internal state.
 void invalidate(boolean ignoreOld)
           
 boolean isEditable()
           
 boolean isSelective()
           
 void mouseClicked(MouseEvent e)
           
 void mouseDragged(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void newEdgeRequested(EdgeComponent prototype)
           
 EdgeComponentWrapper newWrapper(Edge e)
           
 NodeComponentWrapper newWrapper(Node n)
           
 void reLayout()
           
 void setAntiAliasing(boolean antiAliasing)
           
 void setCenter(Component component, Point p)
           
 void setEdgeCoords(EdgeComponentWrapper edge, Component from, Component to)
           
static void setEdgeCoords(EdgeComponentWrapper edge, Component from, Point pt)
           
 void setEdgeCoords(EdgeComponentWrapper edge, NodeComponent from, NodeComponent to)
           
 void setEditable(boolean editable)
           
 void setLayoutEngine(GraphLayoutEngine layoutEngine)
           
protected  void setMode(int mode)
           
 void setUpListenersNormal(Map newWrappers)
           
 void setViewport(Rectangle rect)
           
 EdgeComponentWrapper updateWrapper(Edge e)
           
 NodeComponentWrapper updateWrapper(Node n)
           
 void windowActivated(WindowEvent e)
           
 void windowClosed(WindowEvent e)
           
 void windowClosing(WindowEvent e)
           
 void windowDeactivated(WindowEvent e)
           
 void windowDeiconified(WindowEvent e)
           
 void windowIconified(WindowEvent e)
           
 void windowOpened(WindowEvent e)
           
protected  void wrapperEntered(MouseEvent e)
           
protected  void wrapperExited(MouseEvent e)
           
 
Methods inherited from class org.globus.cog.gui.grapheditor.targets.swing.views.SwingView
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, setGraph, setName, setRenderer, setTransformation, setType
 
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, setGraph, setRenderer, setTransformation
 

Field Detail

LOCATION

public static final String LOCATION
See Also:
Constant Field Values

SIZE

public static final String SIZE
See Also:
Constant Field Values

CONTROL_POINTS

public static final String CONTROL_POINTS
See Also:
Constant Field Values

DEFAULT_SIZE

public static final Dimension DEFAULT_SIZE
Constructor Detail

GraphView

public GraphView()

GraphView

public GraphView(GraphLayoutEngine engine)

GraphView

public GraphView(GraphLayoutEngine engine,
                 String name)
Method Detail

activate

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

enable

public void enable()
Overrides:
enable in class SwingView

cancelEdgeEditing

public void cancelEdgeEditing()

cancelEdgeRequest

public void cancelEdgeRequest()
Specified by:
cancelEdgeRequest in interface Editor

clean

public void clean()
Synchronized so that it waits until any pending invalidations are completed.

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

disable

public void disable()
Overrides:
disable in class SwingView

getAntiAliasing

public boolean getAntiAliasing()

getCenter

public Point getCenter(Component component)

getLayoutEngine

public GraphLayoutEngine getLayoutEngine()

getNewInstance

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

getRectIntersection

public static Point getRectIntersection(NodeComponent comp,
                                        Point p)

getRectIntersection

public static Point getRectIntersection(Component comp,
                                        Point p)

getRectIntersection

public static Point getRectIntersection(int x,
                                        int y,
                                        int width,
                                        int height,
                                        Point p)

getRectIntersection2

public static Point getRectIntersection2(int xCenter,
                                         int yCenter,
                                         int width,
                                         int height,
                                         Point p)

getRectIntersection

public static Point getRectIntersection(int xCenter,
                                        int yCenter,
                                        int x,
                                        int y,
                                        int width,
                                        int height,
                                        Point p)

graphChanged

public void graphChanged(GraphChangedEvent e)

graphComponentEvent

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

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)

initializeNodesSelective

public void initializeNodesSelective(Map coords)

initializeNodesNormal

public void initializeNodesNormal(Map newWrappers,
                                  Map coords)

newWrapper

public NodeComponentWrapper newWrapper(Node n)

updateWrapper

public NodeComponentWrapper updateWrapper(Node n)

initializeEdgesSelective

public void initializeEdgesSelective(Map coords)

initializeEdgesNormal

public void initializeEdgesNormal(Map newWrappers,
                                  Map coords)

newWrapper

public EdgeComponentWrapper newWrapper(Edge e)

updateWrapper

public EdgeComponentWrapper updateWrapper(Edge e)

setUpListenersNormal

public void setUpListenersNormal(Map newWrappers)

isEditable

public boolean isEditable()
Specified by:
isEditable in interface Editor

isSelective

public boolean isSelective()
Specified by:
isSelective in interface CanvasView
Overrides:
isSelective in class AbstractView

canvasActionPerformed

public void canvasActionPerformed(CanvasActionEvent e)
Specified by:
canvasActionPerformed in interface CanvasActionListener

setMode

protected void setMode(int mode)

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mouseDragged

public void mouseDragged(MouseEvent e)
Specified by:
mouseDragged in interface MouseMotionListener

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

mouseMoved

public void mouseMoved(MouseEvent e)
Specified by:
mouseMoved in interface MouseMotionListener

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

newEdgeRequested

public void newEdgeRequested(EdgeComponent prototype)
Specified by:
newEdgeRequested in interface Editor

reLayout

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

setAntiAliasing

public void setAntiAliasing(boolean antiAliasing)

setCenter

public void setCenter(Component component,
                      Point p)

setEdgeCoords

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

setEdgeCoords

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

setEdgeCoords

public static void setEdgeCoords(EdgeComponentWrapper edge,
                                 Component from,
                                 Point pt)

setEditable

public void setEditable(boolean editable)
Specified by:
setEditable in interface Editor

setLayoutEngine

public void setLayoutEngine(GraphLayoutEngine layoutEngine)

setViewport

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

windowActivated

public void windowActivated(WindowEvent e)
Specified by:
windowActivated in interface WindowListener

windowClosed

public void windowClosed(WindowEvent e)
Specified by:
windowClosed in interface WindowListener

windowClosing

public void windowClosing(WindowEvent e)
Specified by:
windowClosing in interface WindowListener

windowDeactivated

public void windowDeactivated(WindowEvent e)
Specified by:
windowDeactivated in interface WindowListener

windowDeiconified

public void windowDeiconified(WindowEvent e)
Specified by:
windowDeiconified in interface WindowListener

windowIconified

public void windowIconified(WindowEvent e)
Specified by:
windowIconified in interface WindowListener

windowOpened

public void windowOpened(WindowEvent e)
Specified by:
windowOpened in interface WindowListener

wrapperEntered

protected void wrapperEntered(MouseEvent e)

wrapperExited

protected void wrapperExited(MouseEvent e)

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

canvasEvent

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