Package org.jgraph.plaf.basic
Class BasicGraphUI.MouseHandler
- java.lang.Object
-
- java.awt.event.MouseAdapter
-
- org.jgraph.plaf.basic.BasicGraphUI.MouseHandler
-
- All Implemented Interfaces:
java.awt.event.MouseListener,java.awt.event.MouseMotionListener,java.awt.event.MouseWheelListener,java.io.Serializable,java.util.EventListener
- Enclosing class:
- BasicGraphUI
public class BasicGraphUI.MouseHandler extends java.awt.event.MouseAdapter implements java.awt.event.MouseMotionListener, java.io.SerializableTreeMouseListener is responsible for updating the selection based on mouse events.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected CellViewcellprotected java.lang.Objecthandlerprotected java.awt.CursorpreviousCursor
-
Constructor Summary
Constructors Constructor Description MouseHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanhandleEditTrigger(java.lang.Object cell, java.awt.event.MouseEvent e)Handles edit trigger by starting the edit and return true if the editing has already started.protected booleanisDescendant(CellView parentView, CellView childView)voidmouseDragged(java.awt.event.MouseEvent e)voidmouseMoved(java.awt.event.MouseEvent e)Invoked when the mouse pointer has been moved on a component (with no buttons down).voidmousePressed(java.awt.event.MouseEvent e)Invoked when a mouse button has been pressed on a component.voidmouseReleased(java.awt.event.MouseEvent e)protected voidpostProcessSelection(java.awt.event.MouseEvent e, java.lang.Object cell, boolean wasSelected)Invoked after a cell has been selected in the mouseReleased method.
-
-
-
Field Detail
-
cell
protected CellView cell
-
handler
protected java.lang.Object handler
-
previousCursor
protected transient java.awt.Cursor previousCursor
-
-
Method Detail
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component.- Specified by:
mousePressedin interfacejava.awt.event.MouseListener- Overrides:
mousePressedin classjava.awt.event.MouseAdapter
-
handleEditTrigger
protected boolean handleEditTrigger(java.lang.Object cell, java.awt.event.MouseEvent e)Handles edit trigger by starting the edit and return true if the editing has already started.- Parameters:
cell- the cell being editede- the mouse event triggering the edit- Returns:
trueif the editing has already started
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Specified by:
mouseDraggedin interfacejava.awt.event.MouseMotionListener- Overrides:
mouseDraggedin classjava.awt.event.MouseAdapter
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse pointer has been moved on a component (with no buttons down).- Specified by:
mouseMovedin interfacejava.awt.event.MouseMotionListener- Overrides:
mouseMovedin classjava.awt.event.MouseAdapter
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener- Overrides:
mouseReleasedin classjava.awt.event.MouseAdapter
-
postProcessSelection
protected void postProcessSelection(java.awt.event.MouseEvent e, java.lang.Object cell, boolean wasSelected)Invoked after a cell has been selected in the mouseReleased method. This can be used to do something interesting if the cell was already selected, in which case this implementation selects the parent. Override if you want different behaviour, such as start editing.
-
-