Package com.mxgraph.swing.handler
Class mxSelectionCellsHandler
- java.lang.Object
-
- com.mxgraph.swing.handler.mxSelectionCellsHandler
-
- All Implemented Interfaces:
java.awt.event.MouseListener,java.awt.event.MouseMotionListener,java.util.EventListener
public class mxSelectionCellsHandler extends java.lang.Object implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.RectangleboundsReference to the enclosing graph component.static intDEFAULT_MAX_HANDLERSDefines the default value for maxHandlers.protected booleanenabledSpecifies if this handler is enabled.protected mxGraphComponentgraphComponentReference to the enclosing graph component.protected java.util.LinkedHashMap<java.lang.Object,mxCellHandler>handlersMaps from cells to handlers in the order of the selection cells.protected java.beans.PropertyChangeListenerlabelMoveHandlerprotected intmaxHandlersDefines the maximum number of handlers to paint individually.protected mxEventSource.mxIEventListenerrefreshHandlerprotected booleanvisibleSpecifies if this handler is visible.
-
Constructor Summary
Constructors Constructor Description mxSelectionCellsHandler(mxGraphComponent graphComponent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddGraphListeners(mxGraph graph)Installs the listeners to update the handles after any changes.mxGraphComponentgetGraphComponent()mxCellHandlergetHandler(java.lang.Object cell)intgetMaxHandlers()java.lang.StringgetToolTipText(java.awt.event.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.booleanisEnabled()booleanisVisible()voidmouseClicked(java.awt.event.MouseEvent arg0)voidmouseDragged(java.awt.event.MouseEvent e)voidmouseEntered(java.awt.event.MouseEvent arg0)voidmouseExited(java.awt.event.MouseEvent arg0)voidmouseMoved(java.awt.event.MouseEvent e)voidmousePressed(java.awt.event.MouseEvent e)Dispatches the mousepressed event to the subhandles.voidmouseReleased(java.awt.event.MouseEvent e)voidpaintHandles(java.awt.Graphics g)voidrefresh()protected voidremoveGraphListeners(mxGraph graph)Removes all installed listeners.voidreset()voidsetEnabled(boolean value)voidsetMaxHandlers(int value)voidsetVisible(boolean value)
-
-
-
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 java.awt.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 java.util.LinkedHashMap<java.lang.Object,mxCellHandler> handlers
Maps from cells to handlers in the order of the selection cells.
-
refreshHandler
protected transient mxEventSource.mxIEventListener refreshHandler
-
labelMoveHandler
protected transient java.beans.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(java.lang.Object cell)
-
mousePressed
public void mousePressed(java.awt.event.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:
mousePressedin interfacejava.awt.event.MouseListener
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
- Specified by:
mouseMovedin interfacejava.awt.event.MouseMotionListener
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Specified by:
mouseDraggedin interfacejava.awt.event.MouseMotionListener
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener
-
getToolTipText
public java.lang.String getToolTipText(java.awt.event.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(java.awt.Graphics g)
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent arg0)
- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent arg0)
- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent arg0)
- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener
-
-