wt.clients.beans.graph
Class GraphView

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended bywt.clients.beans.graph.AbstractGraphView
                  extended bywt.clients.beans.graph.GraphView
All Implemented Interfaces:
Accessible, EventListener, FocusListener, GraphModelListener, GraphSelectionModelListener, ImageObserver, MenuContainer, MouseListener, MouseMotionListener, Serializable

public class GraphView
extends AbstractGraphView
implements GraphModelListener, GraphSelectionModelListener

See Also:
Serialized Form

Nested Class Summary
(package private)  class GraphView.GraphLabelComponentMouseListener
           
(package private)  class GraphView.GraphNodeComponentMouseListener
           
(package private)  class GraphView.GraphViewActionListener
           
(package private)  class GraphView.GraphViewMouseListener
           
(package private)  class GraphView.SymMouse
           
 
Nested classes inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
(package private)  ActionListener actionListener
           
private  ActionLoader actionLoader
           
(package private)  Dimension canvasSize
           
private  String clickBackgroundAction
           
private  String clickLinkAction
           
private  String clickLinkHyperlinkAction
           
private  String clickNodeAction
           
private  String clickNodeHyperlinkAction
           
static String COPY
           
static String CUT
           
private  String dblClickBackgroundAction
           
private  String dblClickLinkAction
           
private  String dblClickNodeAction
           
(package private)  boolean editMode
           
(package private)  Point end
           
(package private)  GraphLink graphLinkInsert
           
(package private)  GraphNode graphNodeInsert
           
(package private)  ActionListener graphViewActionListener
           
static int LINK
           
(package private)  Hashtable linkHashtable
           
(package private)  int mode
           
(package private)  boolean moved
           
(package private)  boolean moveEnd
           
(package private)  Vector movingNodes
           
static int NODE
           
(package private)  Hashtable nodeHashtable
           
(package private)  Graphics offgraphics
           
(package private)  Image offscreen
           
(package private)  Dimension offscreensize
           
static String OPEN
           
static String PASTE
           
static int POINTER
           
(package private)  PopupMenu popup
           
(package private)  int previousMode
           
(package private)  GraphNodeComponent savedNode
           
(package private)  ScrollPane scrollPane
           
(package private)  Vector selected
           
(package private)  GraphLinkComponent selectedLink
           
(package private)  Dimension size
           
(package private)  Point start
           
(package private)  ThreadGroup threadGroup
           
private static String versionID
           
 
Fields inherited from class wt.clients.beans.graph.AbstractGraphView
FOCUSED_COMPONENT, MODEL, SELECTION_MODEL
 
Fields inherited from class java.awt.Panel
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface wt.clients.beans.graph.GraphModelListener
LINK_INSERTED, LINK_REMOVED, NODE_INSERTED, NODE_REMOVED, STRUCTURE_CHANGED
 
Fields inherited from interface wt.clients.beans.graph.GraphSelectionModelListener
LINK_SELECTED, LINK_UNSELECTED, NODE_SELECTED, NODE_UNSELECTED, SELECTION_CLEARED
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GraphView(boolean edit_mode)
           
 
Method Summary
 void addNotify()
           
 void deleteSelected()
           
 ActionLoader getActionLoader()
          Gets the value of the attribute: actionLoader.
 String getClickBackgroundAction()
          Gets the value of the attribute: clickBackgroundAction.
 String getClickLinkAction()
          Gets the value of the attribute: clickLinkAction.
 String getClickLinkHyperlinkAction()
          Gets the value of the attribute: clickLinkHyperlinkAction.
 String getClickNodeAction()
          Gets the value of the attribute: clickNodeAction.
 String getClickNodeHyperlinkAction()
          Gets the value of the attribute: clickNodeHyperlinkAction.
 String getDblClickBackgroundAction()
          Gets the value of the attribute: dblClickBackgroundAction.
 String getDblClickLinkAction()
          Gets the value of the attribute: dblClickLinkAction.
 String getDblClickNodeAction()
          Gets the value of the attribute: dblClickNodeAction.
 GraphLink getGraphLinkInsert()
           
 GraphNode getGraphNodeInsert()
           
 int getMode()
           
 PopupMenu getPopupMenu()
           
 Dimension getPreferredSize()
           
 void graphLinkChanged(PropertyChangeEvent e)
           
 void graphLinkInserted(GraphModelEvent e)
           
 void graphLinkRemoved(GraphModelEvent e)
           
 void graphLinkSelected(GraphSelectionModelEvent e)
           
 void graphLinkUnselected(GraphSelectionModelEvent e)
           
 void graphNodeChanged(PropertyChangeEvent e)
           
 void graphNodeInserted(GraphModelEvent e)
           
 void graphNodeRemoved(GraphModelEvent e)
           
 void graphNodeSelected(GraphSelectionModelEvent e)
          Satisfy the GraphSelectionModelListener interface.
 void graphNodeUnselected(GraphSelectionModelEvent e)
           
 void graphSelectionCleared(GraphSelectionModelEvent e)
           
 void graphStructureChanged(GraphModelEvent e)
           
(package private)  void GraphView_MouseClicked(MouseEvent event)
           
(package private)  void GraphView_MousePressed(MouseEvent event)
           
(package private)  void GraphView_MouseReleased(MouseEvent event)
           
(package private)  void insertGraphLink(GraphLink link)
           
(package private)  void insertGraphNode(GraphNode node)
          Helper methods.
private  boolean isLinkAt(GraphLinkComponent link, MouseEvent event)
           
 boolean isObjectExisting(Point position)
           
 void paint(Graphics g)
           
(package private)  void removeGraphLink(GraphLink link)
           
(package private)  void removeGraphNode(GraphNode node)
           
 void setActionLoader(ActionLoader a_ActionLoader)
          Sets the value of the attribute: actionLoader.
 void setBounds(int x, int y, int width, int height)
           
 void setClickBackgroundAction(String a_ClickBackgroundAction)
          Sets the value of the attribute: clickBackgroundAction.
 void setClickLinkAction(String a_ClickLinkAction)
          Sets the value of the attribute: clickLinkAction.
 void setClickLinkHyperlinkAction(String a_ClickLinkHyperlinkAction)
          Sets the value of the attribute: clickLinkHyperlinkAction.
 void setClickNodeAction(String a_ClickNodeAction)
          Sets the value of the attribute: clickNodeAction.
 void setClickNodeHyperlinkAction(String a_ClickNodeHyperlinkAction)
          Sets the value of the attribute: clickNodeAction.
 void setDblClickBackgroundAction(String a_DblClickBackgroundAction)
          Sets the value of the attribute: dblClickBackgroundAction.
 void setDblClickLinkAction(String a_DblClickLinkAction)
          Sets the value of the attribute: dblClickLinkAction.
 void setDblClickNodeAction(String a_DblClickNodeAction)
          Sets the value of the attribute: dblClickNodeAction.
 void setGraphLinkInsert(GraphLink node)
           
 void setGraphNodeInsert(GraphNode node)
           
 void setLayout(LayoutManager l)
           
 void setLinkActionListener(ActionListener l)
           
 void setMode(int mode)
           
 void setModel(GraphModel model)
          Satisfy the GraphModelListener interface.
 void setPopupMenu(PopupMenu popup)
           
 void setPreviousMode()
           
 void setStraitLines(boolean strait)
           
 void update(Graphics g)
           
 
Methods inherited from class wt.clients.beans.graph.AbstractGraphView
createDefaultGraphModel, createDefaultGraphSelectionModel, focusGained, focusLost, getFocusedComponent, getModel, getSelectionModel, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, setFocusedComponent, setSelectionModel
 
Methods inherited from class java.awt.Panel
getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

size

Dimension size

nodeHashtable

Hashtable nodeHashtable

linkHashtable

Hashtable linkHashtable

POINTER

public static final int POINTER
See Also:
Constant Field Values

NODE

public static final int NODE
See Also:
Constant Field Values

LINK

public static final int LINK
See Also:
Constant Field Values

CUT

public static final String CUT
See Also:
Constant Field Values

COPY

public static final String COPY
See Also:
Constant Field Values

PASTE

public static final String PASTE
See Also:
Constant Field Values

OPEN

public static final String OPEN
See Also:
Constant Field Values

graphNodeInsert

GraphNode graphNodeInsert

graphLinkInsert

GraphLink graphLinkInsert

mode

int mode

previousMode

int previousMode

savedNode

GraphNodeComponent savedNode

selectedLink

GraphLinkComponent selectedLink

graphViewActionListener

ActionListener graphViewActionListener

threadGroup

ThreadGroup threadGroup

editMode

boolean editMode

clickBackgroundAction

private String clickBackgroundAction

dblClickBackgroundAction

private String dblClickBackgroundAction

clickNodeAction

private String clickNodeAction

dblClickNodeAction

private String dblClickNodeAction

clickNodeHyperlinkAction

private String clickNodeHyperlinkAction

clickLinkAction

private String clickLinkAction

clickLinkHyperlinkAction

private String clickLinkHyperlinkAction

dblClickLinkAction

private String dblClickLinkAction

actionLoader

private ActionLoader actionLoader

popup

PopupMenu popup

actionListener

transient ActionListener actionListener

scrollPane

ScrollPane scrollPane

offscreen

Image offscreen

offscreensize

Dimension offscreensize

offgraphics

Graphics offgraphics

selected

Vector selected

start

Point start

end

Point end

moveEnd

boolean moveEnd

moved

boolean moved

canvasSize

Dimension canvasSize

movingNodes

Vector movingNodes
Constructor Detail

GraphView

public GraphView(boolean edit_mode)
Method Detail

setLayout

public void setLayout(LayoutManager l)

setPopupMenu

public void setPopupMenu(PopupMenu popup)

getPopupMenu

public PopupMenu getPopupMenu()

setStraitLines

public void setStraitLines(boolean strait)

setLinkActionListener

public void setLinkActionListener(ActionListener l)

setMode

public void setMode(int mode)

getMode

public int getMode()

setPreviousMode

public void setPreviousMode()

getClickBackgroundAction

public String getClickBackgroundAction()
Gets the value of the attribute: clickBackgroundAction.

Returns:
String

setClickBackgroundAction

public void setClickBackgroundAction(String a_ClickBackgroundAction)
Sets the value of the attribute: clickBackgroundAction.

Parameters:
a_ClickBackgroundAction -

getClickNodeAction

public String getClickNodeAction()
Gets the value of the attribute: clickNodeAction.

Returns:
String

setClickNodeAction

public void setClickNodeAction(String a_ClickNodeAction)
Sets the value of the attribute: clickNodeAction.

Parameters:
a_ClickNodeAction -

getClickNodeHyperlinkAction

public String getClickNodeHyperlinkAction()
Gets the value of the attribute: clickNodeHyperlinkAction.

Returns:
String

setClickNodeHyperlinkAction

public void setClickNodeHyperlinkAction(String a_ClickNodeHyperlinkAction)
Sets the value of the attribute: clickNodeAction.


getClickLinkAction

public String getClickLinkAction()
Gets the value of the attribute: clickLinkAction.

Returns:
String

setClickLinkAction

public void setClickLinkAction(String a_ClickLinkAction)
Sets the value of the attribute: clickLinkAction.

Parameters:
a_ClickLinkAction -

getClickLinkHyperlinkAction

public String getClickLinkHyperlinkAction()
Gets the value of the attribute: clickLinkHyperlinkAction.

Returns:
String

setClickLinkHyperlinkAction

public void setClickLinkHyperlinkAction(String a_ClickLinkHyperlinkAction)
Sets the value of the attribute: clickLinkHyperlinkAction.


getDblClickBackgroundAction

public String getDblClickBackgroundAction()
Gets the value of the attribute: dblClickBackgroundAction.

Returns:
String

setDblClickBackgroundAction

public void setDblClickBackgroundAction(String a_DblClickBackgroundAction)
Sets the value of the attribute: dblClickBackgroundAction.

Parameters:
a_DblClickBackgroundAction -

getDblClickNodeAction

public String getDblClickNodeAction()
Gets the value of the attribute: dblClickNodeAction.

Returns:
String

setDblClickNodeAction

public void setDblClickNodeAction(String a_DblClickNodeAction)
Sets the value of the attribute: dblClickNodeAction.

Parameters:
a_DblClickNodeAction -

getDblClickLinkAction

public String getDblClickLinkAction()
Gets the value of the attribute: dblClickLinkAction.

Returns:
String

setDblClickLinkAction

public void setDblClickLinkAction(String a_DblClickLinkAction)
Sets the value of the attribute: dblClickLinkAction.

Parameters:
a_DblClickLinkAction -

getActionLoader

public ActionLoader getActionLoader()
Gets the value of the attribute: actionLoader.

Returns:
ActionLoader

setActionLoader

public void setActionLoader(ActionLoader a_ActionLoader)
Sets the value of the attribute: actionLoader.

Parameters:
a_ActionLoader -

setGraphNodeInsert

public void setGraphNodeInsert(GraphNode node)

getGraphNodeInsert

public GraphNode getGraphNodeInsert()

setGraphLinkInsert

public void setGraphLinkInsert(GraphLink node)

getGraphLinkInsert

public GraphLink getGraphLinkInsert()

getPreferredSize

public Dimension getPreferredSize()

deleteSelected

public void deleteSelected()

setModel

public void setModel(GraphModel model)
              throws WTPropertyVetoException
Satisfy the GraphModelListener interface.

Overrides:
setModel in class AbstractGraphView
Parameters:
model -
Throws:
WTPropertyVetoException

graphNodeInserted

public void graphNodeInserted(GraphModelEvent e)
Specified by:
graphNodeInserted in interface GraphModelListener
Overrides:
graphNodeInserted in class AbstractGraphView
Parameters:
e -

graphNodeChanged

public void graphNodeChanged(PropertyChangeEvent e)
Specified by:
graphNodeChanged in interface GraphModelListener
Overrides:
graphNodeChanged in class AbstractGraphView
Parameters:
e -

graphNodeRemoved

public void graphNodeRemoved(GraphModelEvent e)
Specified by:
graphNodeRemoved in interface GraphModelListener
Overrides:
graphNodeRemoved in class AbstractGraphView
Parameters:
e -

graphStructureChanged

public void graphStructureChanged(GraphModelEvent e)
Specified by:
graphStructureChanged in interface GraphModelListener
Overrides:
graphStructureChanged in class AbstractGraphView
Parameters:
e -

graphLinkInserted

public void graphLinkInserted(GraphModelEvent e)
Specified by:
graphLinkInserted in interface GraphModelListener
Overrides:
graphLinkInserted in class AbstractGraphView
Parameters:
e -

graphLinkChanged

public void graphLinkChanged(PropertyChangeEvent e)
Specified by:
graphLinkChanged in interface GraphModelListener
Overrides:
graphLinkChanged in class AbstractGraphView
Parameters:
e -

graphLinkRemoved

public void graphLinkRemoved(GraphModelEvent e)
Specified by:
graphLinkRemoved in interface GraphModelListener
Overrides:
graphLinkRemoved in class AbstractGraphView
Parameters:
e -

graphNodeSelected

public void graphNodeSelected(GraphSelectionModelEvent e)
Satisfy the GraphSelectionModelListener interface.

Specified by:
graphNodeSelected in interface GraphSelectionModelListener
Overrides:
graphNodeSelected in class AbstractGraphView
Parameters:
e -

graphNodeUnselected

public void graphNodeUnselected(GraphSelectionModelEvent e)
Specified by:
graphNodeUnselected in interface GraphSelectionModelListener
Overrides:
graphNodeUnselected in class AbstractGraphView
Parameters:
e -

graphLinkSelected

public void graphLinkSelected(GraphSelectionModelEvent e)
Specified by:
graphLinkSelected in interface GraphSelectionModelListener
Overrides:
graphLinkSelected in class AbstractGraphView
Parameters:
e -

graphLinkUnselected

public void graphLinkUnselected(GraphSelectionModelEvent e)
Specified by:
graphLinkUnselected in interface GraphSelectionModelListener
Overrides:
graphLinkUnselected in class AbstractGraphView
Parameters:
e -

graphSelectionCleared

public void graphSelectionCleared(GraphSelectionModelEvent e)
Specified by:
graphSelectionCleared in interface GraphSelectionModelListener
Overrides:
graphSelectionCleared in class AbstractGraphView
Parameters:
e -

insertGraphNode

void insertGraphNode(GraphNode node)
Helper methods.


removeGraphNode

void removeGraphNode(GraphNode node)

insertGraphLink

void insertGraphLink(GraphLink link)

removeGraphLink

void removeGraphLink(GraphLink link)

update

public void update(Graphics g)

addNotify

public void addNotify()

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)

paint

public void paint(Graphics g)

isObjectExisting

public boolean isObjectExisting(Point position)
Specified by:
isObjectExisting in class AbstractGraphView
Parameters:
position -
Returns:
boolean

GraphView_MouseReleased

void GraphView_MouseReleased(MouseEvent event)

GraphView_MousePressed

void GraphView_MousePressed(MouseEvent event)

isLinkAt

private boolean isLinkAt(GraphLinkComponent link,
                         MouseEvent event)

GraphView_MouseClicked

void GraphView_MouseClicked(MouseEvent event)