mxGraph 2.1.0.3


com.mxgraph.swing.handler
Class mxSelectionCellsHandler

java.lang.Object
  extended by com.mxgraph.swing.handler.mxSelectionCellsHandler
All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener

public class mxSelectionCellsHandler
extends Object
implements MouseListener, MouseMotionListener


Field Summary
protected  Rectangle bounds
          Reference to the enclosing graph component.
static int DEFAULT_MAX_HANDLERS
          Defines the default value for maxHandlers.
protected  boolean enabled
          Specifies if this handler is enabled.
protected  mxGraphComponent graphComponent
          Reference to the enclosing graph component.
protected  LinkedHashMap<Object,mxCellHandler> handlers
          Maps from cells to handlers in the order of the selection cells.
protected  PropertyChangeListener labelMoveHandler
           
protected  int maxHandlers
          Defines the maximum number of handlers to paint individually.
protected  mxEventSource.mxIEventListener refreshHandler
           
protected  boolean visible
          Specifies if this handler is visible.
 
Constructor Summary
mxSelectionCellsHandler(mxGraphComponent graphComponent)
           
 
Method Summary
protected  void addGraphListeners(mxGraph graph)
          Installs the listeners to update the handles after any changes.
 mxGraphComponent getGraphComponent()
           
 mxCellHandler getHandler(Object cell)
           
 int getMaxHandlers()
           
 String getToolTipText(MouseEvent e)
          Redirects the tooltip handling of the JComponent to the graph component, which in turn may use getHandleToolTipText in this class to find a tooltip associated with a handle.
 boolean isEnabled()
           
 boolean isVisible()
           
 void mouseClicked(MouseEvent arg0)
           
 void mouseDragged(MouseEvent e)
           
 void mouseEntered(MouseEvent arg0)
           
 void mouseExited(MouseEvent arg0)
           
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent e)
          Dispatches the mousepressed event to the subhandles.
 void mouseReleased(MouseEvent e)
           
 void paintHandles(Graphics g)
           
 void refresh()
           
protected  void removeGraphListeners(mxGraph graph)
          Removes all installed listeners.
 void reset()
           
 void setEnabled(boolean value)
           
 void setMaxHandlers(int value)
           
 void setVisible(boolean value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_HANDLERS

public static int DEFAULT_MAX_HANDLERS
Defines the default value for maxHandlers. Default is 100.


graphComponent

protected mxGraphComponent graphComponent
Reference to the enclosing graph component.


enabled

protected boolean enabled
Specifies if this handler is enabled.


visible

protected boolean visible
Specifies if this handler is visible.


bounds

protected Rectangle bounds
Reference to the enclosing graph component.


maxHandlers

protected int maxHandlers
Defines the maximum number of handlers to paint individually. Default is DEFAULT_MAX_HANDLES.


handlers

protected transient LinkedHashMap<Object,mxCellHandler> handlers
Maps from cells to handlers in the order of the selection cells.


refreshHandler

protected transient mxEventSource.mxIEventListener refreshHandler

labelMoveHandler

protected transient PropertyChangeListener labelMoveHandler
Constructor Detail

mxSelectionCellsHandler

public mxSelectionCellsHandler(mxGraphComponent graphComponent)
Parameters:
graphComponent -
Method Detail

addGraphListeners

protected void addGraphListeners(mxGraph graph)
Installs the listeners to update the handles after any changes.


removeGraphListeners

protected void removeGraphListeners(mxGraph graph)
Removes all installed listeners.


getGraphComponent

public mxGraphComponent getGraphComponent()

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean value)

isVisible

public boolean isVisible()

setVisible

public void setVisible(boolean value)

getMaxHandlers

public int getMaxHandlers()

setMaxHandlers

public void setMaxHandlers(int value)

getHandler

public mxCellHandler getHandler(Object cell)

mousePressed

public void mousePressed(MouseEvent e)
Dispatches the mousepressed event to the subhandles. This is called from the connection handler as subhandles have precedence over the connection handler.

Specified by:
mousePressed in interface MouseListener

mouseMoved

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

mouseDragged

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

mouseReleased

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

getToolTipText

public String getToolTipText(MouseEvent e)
Redirects the tooltip handling of the JComponent to the graph component, which in turn may use getHandleToolTipText in this class to find a tooltip associated with a handle.


reset

public void reset()

refresh

public void refresh()

paintHandles

public void paintHandles(Graphics g)

mouseClicked

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

mouseEntered

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

mouseExited

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

mxGraph 2.1.0.3


Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.