TWE 2.3-2 API

org.enhydra.jawe.components.graph
Class JaWEGraphUI

java.lang.Object
  extended byjavax.swing.plaf.ComponentUI
      extended byorg.jgraph.plaf.GraphUI
          extended byorg.jgraph.plaf.basic.BasicGraphUI
              extended byorg.enhydra.jawe.components.graph.JaWEGraphUI
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
GraphOverviewGraphUI

public class JaWEGraphUI
extends org.jgraph.plaf.basic.BasicGraphUI

This class and it's inner classes controls mouse actions and clipboard. It is addapted to get wanted editing cell behaviour, selection behaviour , to implement cell overlaping, to implement right participant adjustment after cell (or group of cells) is moved, and to implement proper copying and pasting/cloning of cells, as well as pasting at wanted location (along with right participant adjustment).

See Also:
Serialized Form

Nested Class Summary
 class JaWEGraphUI.PEGraphLayoutCacheHandler
          This class observes view changes and is adapted to disallow deselection of cells after dragging.
 class JaWEGraphUI.PEGraphModelHandler
          Listens for changes in the graph model and updates the view accordingly.
 class JaWEGraphUI.PEKeyHandler
          This is used to get multiple key down events to appropriately generate events.
 class JaWEGraphUI.PEMouseHandler
          Handles selection in a way that we expect.
 class JaWEGraphUI.PERootHandle
          Manages selection movement.
 
Nested classes inherited from class org.jgraph.plaf.basic.BasicGraphUI
org.jgraph.plaf.basic.BasicGraphUI.CellEditorHandler, org.jgraph.plaf.basic.BasicGraphUI.ComponentHandler, org.jgraph.plaf.basic.BasicGraphUI.GraphDropTargetListener, org.jgraph.plaf.basic.BasicGraphUI.GraphIncrementAction, org.jgraph.plaf.basic.BasicGraphUI.GraphLayoutCacheHandler, org.jgraph.plaf.basic.BasicGraphUI.GraphModelHandler, org.jgraph.plaf.basic.BasicGraphUI.GraphSelectionHandler, org.jgraph.plaf.basic.BasicGraphUI.KeyHandler, org.jgraph.plaf.basic.BasicGraphUI.MouseHandler, org.jgraph.plaf.basic.BasicGraphUI.MouseInputHandler, org.jgraph.plaf.basic.BasicGraphUI.PropertyChangeHandler, org.jgraph.plaf.basic.BasicGraphUI.RootHandle
 
Field Summary
protected  boolean aborted
           
static int INSERT_ELEMENT
           
static int INSERT_PARTICIPANT
           
static int INSERT_SPEC_ELEMENT
           
static int INSERT_TRANSITION_POINTS
           
static int INSERT_TRANSITION_START
           
static int MULTIPLE_SELECTION
           
static int SELECTION
           
protected  boolean selectOnRelease
           
protected  int status
           
 
Fields inherited from class org.jgraph.plaf.basic.BasicGraphUI
cellEditor, cellEditorListener, componentListener, defaultDropTargetListener, defaultTransferHandler, DNDPREVIEW, dropAction, dropTarget, editingCell, editingComponent, editorHasDifferentSize, focus, graph, graphLayoutCache, graphLayoutCacheListener, graphModel, graphModelListener, graphSelectionListener, graphSelectionModel, handle, insertionLocation, keyListener, marquee, MAXCELLS, MAXCLIPCELLS, MAXHANDLES, mouseListener, preferredMinSize, preferredSize, propertyChangeListener, rendererPane, SCROLLBORDER, SCROLLSTEP, snapSelectedView, stopEditingInCompleteEditing, validCachedPreferredSize
 
Constructor Summary
JaWEGraphUI()
           
 
Method Summary
protected  org.jgraph.event.GraphLayoutCacheListener createGraphLayoutCacheListener()
          Returns a listener that can update the graph when the view changes.
 org.jgraph.graph.CellHandle createHandle(org.jgraph.graph.GraphContext context)
          Constructs the "root handle" for context.
protected  java.awt.event.KeyListener createKeyListener()
          Creates the listener reponsible for getting key events from the graph.
protected  java.awt.event.MouseListener createMouseListener()
          Creates the listener responsible for updating the selection based on mouse events.
 Graph getGraph()
          Returns graph.
 GraphController getGraphController()
           
protected  void paintBackground(java.awt.Graphics g)
          Paint the background of this graph.
 void reset()
           
protected  boolean startEditing(java.lang.Object cell, java.awt.event.MouseEvent event)
          This method is called by EditAction class, as well as by pressing F2 or clicking a mouse on a cell.
 void startEditingAtCell(org.jgraph.JGraph pGraph, java.lang.Object cell)
           
 
Methods inherited from class org.jgraph.plaf.basic.BasicGraphUI
autoscroll, cancelEditing, completeEditing, completeEditing, completeUIInstall, completeUIUninstall, createCellEditorListener, createCellRendererPane, createComponentListener, createContext, createGraphModelListener, createGraphSelectionListener, createPropertyChangeListener, createTransferHandler, createUI, getDropAction, getEditingCell, getEditorLocation, getFocusedCell, getHandle, getInsertionLocation, getMaximumSize, getMinimumSize, getPreferredMinSize, getPreferredSize, getPreferredSize, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, isAddToSelectionEvent, isConstrainedMoveEvent, isEditing, isForceMarqueeEvent, isSnapSelectedView, isToggleSelectionEvent, paint, paintCell, paintForeground, paintGrid, paintPorts, prepareForUIInstall, selectCellForEvent, selectCellsForEvent, selectCellsForEvent, setGraphLayoutCache, setInsertionLocation, setMarquee, setModel, setPreferredMinSize, setSelectionModel, setSnapSelectedView, stopEditing, toggleSelectionCellForEvent, uninstallComponents, uninstallKeyboardActions, uninstallListeners, uninstallUI, updateCachedPreferredSize, updateHandle, updateSize
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELECTION

public static final int SELECTION
See Also:
Constant Field Values

MULTIPLE_SELECTION

public static final int MULTIPLE_SELECTION
See Also:
Constant Field Values

INSERT_ELEMENT

public static final int INSERT_ELEMENT
See Also:
Constant Field Values

INSERT_PARTICIPANT

public static final int INSERT_PARTICIPANT
See Also:
Constant Field Values

INSERT_SPEC_ELEMENT

public static final int INSERT_SPEC_ELEMENT
See Also:
Constant Field Values

INSERT_TRANSITION_START

public static final int INSERT_TRANSITION_START
See Also:
Constant Field Values

INSERT_TRANSITION_POINTS

public static final int INSERT_TRANSITION_POINTS
See Also:
Constant Field Values

status

protected int status

aborted

protected boolean aborted

selectOnRelease

protected boolean selectOnRelease
Constructor Detail

JaWEGraphUI

public JaWEGraphUI()
Method Detail

getGraph

public Graph getGraph()
Returns graph.


getGraphController

public GraphController getGraphController()

paintBackground

protected void paintBackground(java.awt.Graphics g)
Paint the background of this graph. Calls paintGrid.


startEditing

protected boolean startEditing(java.lang.Object cell,
                               java.awt.event.MouseEvent event)
This method is called by EditAction class, as well as by pressing F2 or clicking a mouse on a cell.


startEditingAtCell

public void startEditingAtCell(org.jgraph.JGraph pGraph,
                               java.lang.Object cell)

createMouseListener

protected java.awt.event.MouseListener createMouseListener()
Creates the listener responsible for updating the selection based on mouse events.


createHandle

public org.jgraph.graph.CellHandle createHandle(org.jgraph.graph.GraphContext context)
Constructs the "root handle" for context.

Parameters:
context - reference to the context of the current selection.

createGraphLayoutCacheListener

protected org.jgraph.event.GraphLayoutCacheListener createGraphLayoutCacheListener()
Returns a listener that can update the graph when the view changes.


reset

public void reset()

createKeyListener

protected java.awt.event.KeyListener createKeyListener()
Creates the listener reponsible for getting key events from the graph.


TWE 2.3-2 API