com.touchgraph.graphlayout
Class TGPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.touchgraph.graphlayout.TGPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
GraphPanel

public class TGPanel
extends JPanel

TGPanel contains code for drawing the graph, and storing which nodes are selected, and which ones the mouse is over. It houses methods to activate TGLayout, which performs dynamic layout. Whenever the graph is moved, or repainted, TGPanel fires listener methods on associated objects.

Parts of this code build upon Sun's Graph Layout example:
http://java.sun.com/applets/jdk/1.1/demo/GraphLayout/Graph.java

Version:
1.21 $Id: TGPanel.java,v 3.6 2005/04/03 01:55:16 altheim Exp $
Author:
Alexander Shapiro, Murray Altheim (see code for details)
See Also:
Serialized Form

Nested Class Summary
protected  class TGPanel.AdjustOriginLens
          A lens that adjusts the location of the provided point to a midpoint within the panel.
 class TGPanel.BasicMouseListener
           
 class TGPanel.BasicMouseMotionListener
           
 class TGPanel.SwitchSelectUI
           
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static Color BACK_COLOR
           
protected  TGPanel.BasicMouseMotionListener basicMML
           
protected  Point2D.Double bottomRightDraw
           
protected  GraphEltSet completeEltSet
           
protected  Node dragNode
           
static boolean fixedIsPinned
          Flag indicating when true that fixed nodes are "pinned" and not removed on locality shifts.
protected  Vector graphListeners
           
protected static Cursor handCursor
           
protected  LocalityUtils localityUtils
           
protected  boolean maintainMouseOver
           
protected  Edge mouseOverE
           
protected  Node mouseOverN
           
protected  Point mousePos
           
protected static Cursor moveCursor
           
protected  Graphics offgraphics
           
protected  Image offscreen
           
protected  Dimension offscreensize
           
protected  Vector paintListeners
           
protected  Node select
           
static String TG_THREADGROUP_ID
          The ThreadGroup identifier for all TouchGraph Threads.
 TGLayout tgLayout
           
protected  ThreadGroup threadgroup
           
protected  Point2D.Double topLeftDraw
           
protected  VisibleLocality visibleLocality
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TGPanel()
          Default constructor.
 
Method Summary
protected  void activateMMListener(boolean activate)
          Activates or deactivate the MouseMotionListener.
 void addEdge(Edge e)
           
 Edge addEdge(Node f, Node t, int tens)
           
 void addGraphListener(GraphListener gl)
           
 Node addNode()
          Adds a Node, with its ID and label being the current node count plus 1.
 void addNode(Node node)
          Add the Node node to the visibleLocality, checking for ID uniqueness.
 void addNode(Node node, Point2D.Double p)
          Add the Node node to the visibleLocality, checking for ID uniqueness.
 Node addNode(String label)
          Adds a Node, provided its label.
 Node addNode(String id, String label)
          Adds a Node, provided its ID and label.
 void addPaintListener(TGPaintListener pl)
           
 void clearAll()
           
 void clearSelect()
           
 void collapseNode(Node node)
           
 Point2D.Double convertDrawToReal(double x, double y)
          Returns the conversion between real position and visual position for the point described by x,y.
 Point2D.Double convertDrawToReal(Point p)
          Returns the conversion between real position and visual position for the Point p.
 Point2D.Double convertDrawToReal(Point2D.Double p)
          Returns the conversion between real position and visual position for the Point2D.Double p.
 Point2D.Double convertRealToDraw(double x, double y)
          Returns the conversion between visual position and real position for the point described by x,y.
 Point2D.Double convertRealToDraw(Point p)
          Returns the conversion between visual position and real position for the Point p.
 Point2D.Double convertRealToDraw(Point2D.Double p)
          Returns the conversion between visual position and real position for the Point2D.Double p.
 void deleteEdge(Edge edge)
           
 void deleteEdge(Node from, Node to)
           
 boolean deleteNode(Node node)
          Delete the Node node from the visibleLocality.
 boolean deleteNodeById(String id)
          Remove the Node object matching the ID id, returning true if the deletion occurred, false if a Node matching the ID does not exist (or if the ID value was null).
 int edgeNum()
          Deprecated. this method has been replaced by the visibleEdgeCount() method.
 void expandNode(Node node)
           
 void fastFinishAnimation()
          Quickly wraps up the add node animation.
 Edge findEdge(Node f, Node t)
           
protected  void findMouseOver()
           
 Node findNode(String id)
          Return the Node whose ID matches the String id, null if no match is found.
 Node findNodeLabelContaining(String substring)
          Return the first Nodes whose label contains the String substring, null if no match is found.
 Collection findNodesByLabel(String label)
          Return a Collection of all Nodes whose label matches the String label, null if no match is found.
 Collection findNodesByLabel(String label, boolean ignoreCase)
          Return a Collection of all Nodes whose label matches the String label, null if no match is found.
protected  void fireMovedEvent()
           
 void fireResetEvent()
           
 TGPanel.AdjustOriginLens getAdjustOriginLens()
           
 Iterator getAllEdges()
          Returns an Iterator over all edges in the complete graph.
 Iterator getAllNodes()
          Returns an Iterator over all nodes in the complete graph.
 GraphEltSet getAllNodesAsSet()
          Returns all nodes in the complete graph as a GraphEltSet (used by various utilities).
 Point2D.Double getBottomRightDraw()
           
 Point2D.Double getCenter()
           
 Node getDragNode()
           
 Point2D.Double getDrawCenter()
           
 int getEdgeCount()
          Returns the current edge count in the complete graph.
 ImmutableGraphEltSet getGES()
          Return the current visible locality.
 Edge getMouseOverE()
           
 Node getMouseOverN()
           
 Point getMousePos()
           
 int getNodeCount()
          Returns the current node count.
 Image getOffscreenImage()
          Returns the offscreen Image serving as the fundamental drawing area.
 Dimension getOffscreenImageSize()
          Returns the size (as a Dimension) of the offscreen Image serving as the fundamental drawing area.
 Node getSelect()
           
 TGPanel.SwitchSelectUI getSwitchSelectUI()
           
 ThreadGroup getThreadGroup()
          Returns the ThreadGroup used with TouchGraph threads.
 Point2D.Double getTopLeftDraw()
           
 void handleMouseEvent(MouseEvent e)
          Processes mouse entered or exited events from the BasicMouseListener.
 void handleMouseMotionEvent(MouseEvent e)
          Processes motion dragged or moved events from the BasicMouseMotionListener, mouseDragged() if mouseDragged is true, mouseMoved() if false.
 void hideEdge(Edge edge)
           
 void hideNode(Node node)
           
 boolean isShiftingLocality()
          Returns true if the locality shifting thread is active.
static void main(String[] args)
           
 void multiSelect(Point2D.Double from, Point2D.Double to)
           
 Color myBrighter(Color c)
           
 int nodeNum()
          Deprecated. this method has been replaced by the visibleNodeCount() method.
 void paint(Graphics g)
           
 void paintBackground(Graphics g, Dimension d)
           
 void paintForeground(Graphics g, Dimension d)
           
 void processGraphMove()
           
protected  void redraw()
           
 void removeGraphListener(GraphListener gl)
           
 void removePaintListener(TGPaintListener pl)
           
 void repaintAfterMove()
          Called by TGLayout and others to indicate that graph has moved.
 void resetDamper()
          Makes the graph mobile, and slowly slows it down.
 void selectFirstNode()
          A convenience method that selects the first node of a graph, so that hiding works.
 void setBackColor(Color color)
           
 void setDragNode(Node node)
           
 void setGraphEltSet(GraphEltSet ges)
           
 void setLensSet(TGLensSet lensSet)
           
 void setLocale(Node node, int radius)
           
 void setLocale(Node node, int radius, int maxAddEdgeCount, int maxExpandEdgeCount, boolean unidirectional)
           
 void setMaintainMouseOver(boolean maintain)
           
 void setMouseOverE(Edge edge)
           
 void setMouseOverN(Node node)
           
 void setMousePos(Point p)
           
 void setSelect(Node node)
           
 void setTGLayout(TGLayout tgl)
           
 void sleepTGThread(int millis)
          Causes the current thread to sleep for the specified number of milliseconds, if it is a thread in the "TouchGraph" ThreadGroup.
 void startDamper()
          Start and stop the damper.
 void stopDamper()
           
 void stopMotion()
          Gently stops the graph from moving
 void update(Graphics g)
           
 void updateDrawPos(Node node)
          Sets the visual position from the real position.
 void updateDrawPositions()
           
 void updateGraphSize()
           
 void updateLocalityFromVisibility()
           
 void updatePosFromDraw(Node node)
          Sets the real position from the visual position.
 int visibleEdgeCount()
          Return the number of Edges in the Locality.
 int visibleNodeCount()
          Returns the current node count within the VisibleLocality.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, 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

TG_THREADGROUP_ID

public static final String TG_THREADGROUP_ID
The ThreadGroup identifier for all TouchGraph Threads.

See Also:
Constant Field Values

BACK_COLOR

public static Color BACK_COLOR

tgLayout

public TGLayout tgLayout

fixedIsPinned

public static boolean fixedIsPinned
Flag indicating when true that fixed nodes are "pinned" and not removed on locality shifts. This is a feature enabling single nodes to remain visible when a node from a different graph is selected while using finite locality. The default is false.


topLeftDraw

protected Point2D.Double topLeftDraw

bottomRightDraw

protected Point2D.Double bottomRightDraw

completeEltSet

protected GraphEltSet completeEltSet

visibleLocality

protected VisibleLocality visibleLocality

localityUtils

protected LocalityUtils localityUtils

threadgroup

protected ThreadGroup threadgroup

basicMML

protected TGPanel.BasicMouseMotionListener basicMML

mouseOverE

protected Edge mouseOverE

mouseOverN

protected Node mouseOverN

maintainMouseOver

protected boolean maintainMouseOver

select

protected Node select

dragNode

protected Node dragNode

mousePos

protected Point mousePos

offscreen

protected Image offscreen

offscreensize

protected Dimension offscreensize

offgraphics

protected Graphics offgraphics

graphListeners

protected Vector graphListeners

paintListeners

protected Vector paintListeners

handCursor

protected static Cursor handCursor

moveCursor

protected static Cursor moveCursor
Constructor Detail

TGPanel

public TGPanel()
Default constructor.

Method Detail

getThreadGroup

public ThreadGroup getThreadGroup()
Returns the ThreadGroup used with TouchGraph threads.


getOffscreenImage

public Image getOffscreenImage()
Returns the offscreen Image serving as the fundamental drawing area.


getOffscreenImageSize

public Dimension getOffscreenImageSize()
Returns the size (as a Dimension) of the offscreen Image serving as the fundamental drawing area.


sleepTGThread

public void sleepTGThread(int millis)
Causes the current thread to sleep for the specified number of milliseconds, if it is a thread in the "TouchGraph" ThreadGroup.


isShiftingLocality

public boolean isShiftingLocality()
Returns true if the locality shifting thread is active.


setLensSet

public void setLensSet(TGLensSet lensSet)

setTGLayout

public void setTGLayout(TGLayout tgl)

setGraphEltSet

public void setGraphEltSet(GraphEltSet ges)

getAdjustOriginLens

public TGPanel.AdjustOriginLens getAdjustOriginLens()

getSwitchSelectUI

public TGPanel.SwitchSelectUI getSwitchSelectUI()

setBackColor

public void setBackColor(Color color)

getAllNodesAsSet

public GraphEltSet getAllNodesAsSet()
Returns all nodes in the complete graph as a GraphEltSet (used by various utilities).


getAllNodes

public Iterator getAllNodes()
Returns an Iterator over all nodes in the complete graph.


getGES

public ImmutableGraphEltSet getGES()
Return the current visible locality.


getNodeCount

public int getNodeCount()
Returns the current node count.


nodeNum

public int nodeNum()
Deprecated. this method has been replaced by the visibleNodeCount() method.

Returns the current node count within the VisibleLocality.


visibleNodeCount

public int visibleNodeCount()
Returns the current node count within the VisibleLocality.


findNode

public Node findNode(String id)
Return the Node whose ID matches the String id, null if no match is found.

Parameters:
id - The ID identifier used as a query.
Returns:
The Node whose ID matches the provided 'id', null if no match is found.

findNodesByLabel

public Collection findNodesByLabel(String label)
Return a Collection of all Nodes whose label matches the String label, null if no match is found.


findNodesByLabel

public Collection findNodesByLabel(String label,
                                   boolean ignoreCase)
Return a Collection of all Nodes whose label matches the String label, null if no match is found. If the boolean ignoreCase is true, the comparisons are case-insensitive.


findNodeLabelContaining

public Node findNodeLabelContaining(String substring)
Return the first Nodes whose label contains the String substring, null if no match is found.

Parameters:
substring - The Substring used as a query.

addNode

public Node addNode()
             throws TGException
Adds a Node, with its ID and label being the current node count plus 1.

Throws:
TGException
See Also:
Node

addNode

public Node addNode(String label)
             throws TGException
Adds a Node, provided its label. The node is assigned a unique ID.

Throws:
TGException
See Also:
GraphEltSet

addNode

public Node addNode(String id,
                    String label)
             throws TGException
Adds a Node, provided its ID and label.

Throws:
TGException
See Also:
Node

addNode

public void addNode(Node node)
             throws TGException
Add the Node node to the visibleLocality, checking for ID uniqueness.

Throws:
TGException

addNode

public void addNode(Node node,
                    Point2D.Double p)
             throws TGException
Add the Node node to the visibleLocality, checking for ID uniqueness. If the point is non-null, sets the location of the Node.

Throws:
TGException

deleteNodeById

public boolean deleteNodeById(String id)
Remove the Node object matching the ID id, returning true if the deletion occurred, false if a Node matching the ID does not exist (or if the ID value was null).

Parameters:
id - The ID identifier used as a query.
Returns:
true if the deletion occurred.

deleteNode

public boolean deleteNode(Node node)
Delete the Node node from the visibleLocality.


clearAll

public void clearAll()

getSelect

public Node getSelect()

getMouseOverN

public Node getMouseOverN()

setMouseOverN

public void setMouseOverN(Node node)

getAllEdges

public Iterator getAllEdges()
Returns an Iterator over all edges in the complete graph.


deleteEdge

public void deleteEdge(Edge edge)

deleteEdge

public void deleteEdge(Node from,
                       Node to)

getEdgeCount

public int getEdgeCount()
Returns the current edge count in the complete graph.


edgeNum

public int edgeNum()
Deprecated. this method has been replaced by the visibleEdgeCount() method.

Return the number of Edges in the Locality.


visibleEdgeCount

public int visibleEdgeCount()
Return the number of Edges in the Locality.


findEdge

public Edge findEdge(Node f,
                     Node t)

addEdge

public void addEdge(Edge e)

addEdge

public Edge addEdge(Node f,
                    Node t,
                    int tens)

getMouseOverE

public Edge getMouseOverE()

setMouseOverE

public void setMouseOverE(Edge edge)

fireMovedEvent

protected void fireMovedEvent()

fireResetEvent

public void fireResetEvent()

addGraphListener

public void addGraphListener(GraphListener gl)

removeGraphListener

public void removeGraphListener(GraphListener gl)

addPaintListener

public void addPaintListener(TGPaintListener pl)

removePaintListener

public void removePaintListener(TGPaintListener pl)

redraw

protected void redraw()

setMaintainMouseOver

public void setMaintainMouseOver(boolean maintain)

clearSelect

public void clearSelect()

selectFirstNode

public void selectFirstNode()
A convenience method that selects the first node of a graph, so that hiding works.


setSelect

public void setSelect(Node node)

multiSelect

public void multiSelect(Point2D.Double from,
                        Point2D.Double to)

updateLocalityFromVisibility

public void updateLocalityFromVisibility()
                                  throws TGException
Throws:
TGException

setLocale

public void setLocale(Node node,
                      int radius,
                      int maxAddEdgeCount,
                      int maxExpandEdgeCount,
                      boolean unidirectional)
               throws TGException
Throws:
TGException

fastFinishAnimation

public void fastFinishAnimation()
Quickly wraps up the add node animation.


setLocale

public void setLocale(Node node,
                      int radius)
               throws TGException
Throws:
TGException

expandNode

public void expandNode(Node node)

hideNode

public void hideNode(Node node)

collapseNode

public void collapseNode(Node node)

hideEdge

public void hideEdge(Edge edge)

setDragNode

public void setDragNode(Node node)

getDragNode

public Node getDragNode()

setMousePos

public void setMousePos(Point p)

getMousePos

public Point getMousePos()

startDamper

public void startDamper()
Start and stop the damper. Should be placed in the TGPanel too.


stopDamper

public void stopDamper()

resetDamper

public void resetDamper()
Makes the graph mobile, and slowly slows it down.


stopMotion

public void stopMotion()
Gently stops the graph from moving


activateMMListener

protected void activateMMListener(boolean activate)
Activates or deactivate the MouseMotionListener.


handleMouseEvent

public void handleMouseEvent(MouseEvent e)
Processes mouse entered or exited events from the BasicMouseListener.


handleMouseMotionEvent

public void handleMouseMotionEvent(MouseEvent e)
Processes motion dragged or moved events from the BasicMouseMotionListener, mouseDragged() if mouseDragged is true, mouseMoved() if false.


findMouseOver

protected void findMouseOver()

getTopLeftDraw

public Point2D.Double getTopLeftDraw()

getBottomRightDraw

public Point2D.Double getBottomRightDraw()

getCenter

public Point2D.Double getCenter()

getDrawCenter

public Point2D.Double getDrawCenter()

updateGraphSize

public void updateGraphSize()

processGraphMove

public void processGraphMove()

repaintAfterMove

public void repaintAfterMove()
Called by TGLayout and others to indicate that graph has moved.


convertRealToDraw

public Point2D.Double convertRealToDraw(Point2D.Double p)
Returns the conversion between visual position and real position for the Point2D.Double p.


convertRealToDraw

public Point2D.Double convertRealToDraw(Point p)
Returns the conversion between visual position and real position for the Point p.


convertRealToDraw

public Point2D.Double convertRealToDraw(double x,
                                        double y)
Returns the conversion between visual position and real position for the point described by x,y.


convertDrawToReal

public Point2D.Double convertDrawToReal(Point2D.Double p)
Returns the conversion between real position and visual position for the Point2D.Double p.


convertDrawToReal

public Point2D.Double convertDrawToReal(Point p)
Returns the conversion between real position and visual position for the Point p.


convertDrawToReal

public Point2D.Double convertDrawToReal(double x,
                                        double y)
Returns the conversion between real position and visual position for the point described by x,y.


updateDrawPos

public void updateDrawPos(Node node)
Sets the visual position from the real position.


updatePosFromDraw

public void updatePosFromDraw(Node node)
Sets the real position from the visual position.


updateDrawPositions

public void updateDrawPositions()

myBrighter

public Color myBrighter(Color c)

paint

public void paint(Graphics g)
Overrides:
paint in class JComponent

paintForeground

public void paintForeground(Graphics g,
                            Dimension d)

paintBackground

public void paintBackground(Graphics g,
                            Dimension d)

update

public void update(Graphics g)
Overrides:
update in class JComponent

main

public static void main(String[] args)


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.