wt.clients.beans.graph
Class DefaultGraphView

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.DefaultGraphView
All Implemented Interfaces:
Accessible, EventListener, FocusListener, GraphModelListener, GraphSelectionModelListener, ImageObserver, MenuContainer, MouseListener, MouseMotionListener, Serializable

public class DefaultGraphView
extends AbstractGraphView

See Also:
Serialized Form

Nested Class Summary
 
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
private  ActionLoader actionLoader
           
private static String CLASSNAME
           
private  String clickBackgroundAction
           
private  String clickLinkAction
           
private  String clickNodeAction
           
static int CONNECT_MODE
           
private  String connectAction
           
private  Rectangle currentClip
           
private  String dblClickBackgroundAction
           
private  String dblClickLinkAction
           
private  String dblClickNodeAction
           
private static boolean DEVELOPER
           
private  GraphNode endConnectNode
           
private  Point endPoint
           
private  GraphViewCellRenderer graphViewCellRenderer
           
private  GraphViewLinkRenderer graphViewLinkRenderer
           
private  GraphLink linkOverlayed
           
private  Hashtable linkToRender
           
private  int mode
           
static int MOVE_MODE
           
private  GraphNode nodeOverlayed
           
private  Graphics offgraphics
           
private  Image offscreen
           
private  Dimension offscreensize
           
static int PADDING_MODE
           
private  Rectangle realClip
           
private static String RESOURCE
           
static int SELECT_MODE
           
private  Hashtable selectionZone
           
private  GraphNode startConnectNode
           
private  Point startPoint
           
private  Polygon startPolygon
           
private static boolean VERBOSE
           
private static String versionID
           
private  float zoomFactor
           
 
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
DefaultGraphView()
           
DefaultGraphView(GraphModel pGraphModel)
           
DefaultGraphView(GraphModel pGraphModel, GraphSelectionModel pGraphSelectionModel)
           
DefaultGraphView(GraphSelectionModel pGraphSelectionModel)
           
 
Method Summary
 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 getClickNodeAction()
          Gets the value of the attribute: clickNodeAction.
 String getConnectAction()
          Gets the value of the attribute: connectAction.
 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.
 GraphNode getEndConnectNode()
          Gets the value of the attribute: endConnectNode.
 GraphViewCellRenderer getGraphViewCellRenderer()
          Gets the object for the association that plays role: graphViewCellRenderer.
 GraphViewLinkRenderer getGraphViewLinkRenderer()
          Gets the object for the association that plays role: graphViewLinkRenderer.
 GraphLink getLinkOverlayed()
          Gets the value of the attribute: linkOverlayed.
 int getMode()
          Gets the value of the attribute: mode.
 GraphNode getNodeOverlayed()
          Gets the value of the attribute: nodeOverlayed.
 Dimension getPreferredSize()
           
 GraphNode getStartConnectNode()
          Gets the value of the attribute: startConnectNode.
protected  Polygon getZoneAt(Point pPoint)
           
 float getZoomFactor()
          Gets the value of the attribute: zoomFactor.
 boolean isLinkMouseOverlayed(GraphLink pLink)
           
 boolean isNodeMouseOverlayed(GraphNode pNode)
           
 boolean isObjectExisting(Point pPosition)
           
 void mouseClicked(MouseEvent e)
           
 void mouseDragged(MouseEvent e)
           
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void paint(Graphics g)
           
protected  void paintLink(Graphics g, GraphLink pLink)
           
protected  void paintLink(Graphics g, GraphLink pLink, GraphViewLinkRenderer pLinkRenderer)
           
protected  void paintNode(Graphics g, GraphNode pNode)
           
protected  void paintNode(Graphics g, GraphNode pNode, GraphViewCellRenderer pNodeRenderer)
           
 void setActionLoader(ActionLoader a_ActionLoader)
          Sets the value of the attribute: actionLoader.
 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 setClickNodeAction(String a_ClickNodeAction)
          Sets the value of the attribute: clickNodeAction.
 void setConnectAction(String a_ConnectAction)
          Sets the value of the attribute: connectAction.
 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 setEndConnectNode(GraphNode a_EndConnectNode)
          Sets the value of the attribute: endConnectNode.
 void setGraphViewCellRenderer(GraphViewCellRenderer a_GraphViewCellRenderer)
          Sets the object for the association that plays role: graphViewCellRenderer.
 void setGraphViewLinkRenderer(GraphViewLinkRenderer a_GraphViewLinkRenderer)
          Sets the object for the association that plays role: graphViewLinkRenderer.
 void setLinkOverlayed(GraphLink a_LinkOverlayed)
          Sets the value of the attribute: linkOverlayed.
 void setMode(int a_Mode)
          Sets the value of the attribute: mode.
 void setModel(GraphModel pGraphModel)
          Sets the object for the association that plays role: MODEL.
 void setNodeOverlayed(GraphNode a_NodeOverlayed)
          Sets the value of the attribute: nodeOverlayed.
 void setStartConnectNode(GraphNode a_StartConnectNode)
          Sets the value of the attribute: startConnectNode.
 void setZoomFactor(float a_ZoomFactor)
          Sets the value of the attribute: zoomFactor.
 void update(Graphics g)
           
 
Methods inherited from class wt.clients.beans.graph.AbstractGraphView
createDefaultGraphModel, createDefaultGraphSelectionModel, focusGained, focusLost, getFocusedComponent, getModel, getSelectionModel, graphLinkChanged, graphLinkInserted, graphLinkRemoved, graphLinkSelected, graphLinkUnselected, graphNodeChanged, graphNodeInserted, graphNodeRemoved, graphNodeSelected, graphNodeUnselected, graphSelectionCleared, graphStructureChanged, mouseEntered, mouseExited, setFocusedComponent, setSelectionModel
 
Methods inherited from class java.awt.Panel
addNotify, 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, setLayout, 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, 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

CLASSNAME

private static final String CLASSNAME

versionID

private static final String versionID
See Also:
Constant Field Values

offscreen

private Image offscreen

offscreensize

private Dimension offscreensize

offgraphics

private Graphics offgraphics

selectionZone

private Hashtable selectionZone

startPolygon

private Polygon startPolygon

startPoint

private Point startPoint

endPoint

private Point endPoint

startConnectNode

private GraphNode startConnectNode

endConnectNode

private GraphNode endConnectNode

connectAction

private String connectAction

nodeOverlayed

private GraphNode nodeOverlayed

linkOverlayed

private GraphLink linkOverlayed

mode

private int mode

realClip

private Rectangle realClip

currentClip

private Rectangle currentClip

SELECT_MODE

public static final int SELECT_MODE
See Also:
Constant Field Values

MOVE_MODE

public static final int MOVE_MODE
See Also:
Constant Field Values

CONNECT_MODE

public static final int CONNECT_MODE
See Also:
Constant Field Values

PADDING_MODE

public static final int PADDING_MODE
See Also:
Constant Field Values

zoomFactor

private float zoomFactor

clickBackgroundAction

private String clickBackgroundAction

clickNodeAction

private String clickNodeAction

clickLinkAction

private String clickLinkAction

dblClickBackgroundAction

private String dblClickBackgroundAction

dblClickNodeAction

private String dblClickNodeAction

dblClickLinkAction

private String dblClickLinkAction

linkToRender

private Hashtable linkToRender

actionLoader

private ActionLoader actionLoader

graphViewCellRenderer

private GraphViewCellRenderer graphViewCellRenderer

graphViewLinkRenderer

private GraphViewLinkRenderer graphViewLinkRenderer

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

VERBOSE

private static boolean VERBOSE

DEVELOPER

private static boolean DEVELOPER
Constructor Detail

DefaultGraphView

public DefaultGraphView(GraphModel pGraphModel,
                        GraphSelectionModel pGraphSelectionModel)
Parameters:
pGraphModel -
pGraphSelectionModel -

DefaultGraphView

public DefaultGraphView(GraphModel pGraphModel)
Parameters:
pGraphModel -

DefaultGraphView

public DefaultGraphView(GraphSelectionModel pGraphSelectionModel)
Parameters:
pGraphSelectionModel -

DefaultGraphView

public DefaultGraphView()
Method Detail

getStartConnectNode

public GraphNode getStartConnectNode()
Gets the value of the attribute: startConnectNode.

Returns:
GraphNode

setStartConnectNode

public void setStartConnectNode(GraphNode a_StartConnectNode)
                         throws WTPropertyVetoException
Sets the value of the attribute: startConnectNode.

Parameters:
a_StartConnectNode -
Throws:
WTPropertyVetoException

getEndConnectNode

public GraphNode getEndConnectNode()
Gets the value of the attribute: endConnectNode.

Returns:
GraphNode

setEndConnectNode

public void setEndConnectNode(GraphNode a_EndConnectNode)
                       throws WTPropertyVetoException
Sets the value of the attribute: endConnectNode.

Parameters:
a_EndConnectNode -
Throws:
WTPropertyVetoException

getConnectAction

public String getConnectAction()
Gets the value of the attribute: connectAction.

Returns:
String

setConnectAction

public void setConnectAction(String a_ConnectAction)
Sets the value of the attribute: connectAction.

Parameters:
a_ConnectAction -

getNodeOverlayed

public GraphNode getNodeOverlayed()
Gets the value of the attribute: nodeOverlayed.

Returns:
GraphNode

setNodeOverlayed

public void setNodeOverlayed(GraphNode a_NodeOverlayed)
Sets the value of the attribute: nodeOverlayed.

Parameters:
a_NodeOverlayed -

getLinkOverlayed

public GraphLink getLinkOverlayed()
Gets the value of the attribute: linkOverlayed.

Returns:
GraphLink

setLinkOverlayed

public void setLinkOverlayed(GraphLink a_LinkOverlayed)
Sets the value of the attribute: linkOverlayed.

Parameters:
a_LinkOverlayed -

getMode

public int getMode()
Gets the value of the attribute: mode.

Returns:
int

setMode

public void setMode(int a_Mode)
             throws WTPropertyVetoException
Sets the value of the attribute: mode.

Parameters:
a_Mode -
Throws:
WTPropertyVetoException

getZoomFactor

public float getZoomFactor()
Gets the value of the attribute: zoomFactor.

Returns:
float

setZoomFactor

public void setZoomFactor(float a_ZoomFactor)
                   throws WTPropertyVetoException
Sets the value of the attribute: zoomFactor.

Parameters:
a_ZoomFactor -
Throws:
WTPropertyVetoException

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 -

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 -

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 -

getGraphViewCellRenderer

public GraphViewCellRenderer getGraphViewCellRenderer()
Gets the object for the association that plays role: graphViewCellRenderer.

Returns:
GraphViewCellRenderer

setGraphViewCellRenderer

public void setGraphViewCellRenderer(GraphViewCellRenderer a_GraphViewCellRenderer)
Sets the object for the association that plays role: graphViewCellRenderer.

Parameters:
a_GraphViewCellRenderer -

getGraphViewLinkRenderer

public GraphViewLinkRenderer getGraphViewLinkRenderer()
Gets the object for the association that plays role: graphViewLinkRenderer.

Returns:
GraphViewLinkRenderer

setGraphViewLinkRenderer

public void setGraphViewLinkRenderer(GraphViewLinkRenderer a_GraphViewLinkRenderer)
Sets the object for the association that plays role: graphViewLinkRenderer.

Parameters:
a_GraphViewLinkRenderer -

setModel

public void setModel(GraphModel pGraphModel)
              throws WTPropertyVetoException
Description copied from class: AbstractGraphView
Sets the object for the association that plays role: MODEL.

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

update

public void update(Graphics g)
Parameters:
g -

paint

public void paint(Graphics g)
Parameters:
g -

paintNode

protected void paintNode(Graphics g,
                         GraphNode pNode)
Parameters:
g -
pNode -

paintNode

protected void paintNode(Graphics g,
                         GraphNode pNode,
                         GraphViewCellRenderer pNodeRenderer)
Parameters:
g -
pNode -
pNodeRenderer -

paintLink

protected void paintLink(Graphics g,
                         GraphLink pLink)
Parameters:
g -
pLink -

paintLink

protected void paintLink(Graphics g,
                         GraphLink pLink,
                         GraphViewLinkRenderer pLinkRenderer)
Parameters:
g -
pLink -
pLinkRenderer -

getPreferredSize

public Dimension getPreferredSize()
Returns:
Dimension

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener
Overrides:
mouseClicked in class AbstractGraphView
Parameters:
e -

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener
Overrides:
mousePressed in class AbstractGraphView
Parameters:
e -

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener
Overrides:
mouseReleased in class AbstractGraphView
Parameters:
e -

mouseDragged

public void mouseDragged(MouseEvent e)
Specified by:
mouseDragged in interface MouseMotionListener
Overrides:
mouseDragged in class AbstractGraphView
Parameters:
e -

mouseMoved

public void mouseMoved(MouseEvent e)
Specified by:
mouseMoved in interface MouseMotionListener
Overrides:
mouseMoved in class AbstractGraphView
Parameters:
e -

getZoneAt

protected Polygon getZoneAt(Point pPoint)
Parameters:
pPoint -
Returns:
Polygon

isObjectExisting

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

isNodeMouseOverlayed

public boolean isNodeMouseOverlayed(GraphNode pNode)
Parameters:
pNode -
Returns:
boolean

isLinkMouseOverlayed

public boolean isLinkMouseOverlayed(GraphLink pLink)
Parameters:
pLink -
Returns:
boolean