org.jgraph.plaf.basic

Class BasicGraphUI.MouseHandler

public class BasicGraphUI.MouseHandler extends MouseAdapter implements MouseMotionListener, Serializable

TreeMouseListener is responsible for updating the selection based on mouse events.
Field Summary
protected CellViewcell
protected Objecthandler
protected CursorpreviousCursor
Method Summary
protected booleanhandleEditTrigger(Object cell, 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(MouseEvent e)
voidmouseMoved(MouseEvent e)
Invoked when the mouse pointer has been moved on a component (with no buttons down).
voidmousePressed(MouseEvent e)
Invoked when a mouse button has been pressed on a component.
voidmouseReleased(MouseEvent e)
protected voidpostProcessSelection(MouseEvent e, Object cell, boolean wasSelected)
Invoked after a cell has been selected in the mouseReleased method.

Field Detail

cell

protected CellView cell

handler

protected Object handler

previousCursor

protected transient Cursor previousCursor

Method Detail

handleEditTrigger

protected boolean handleEditTrigger(Object cell, MouseEvent e)
Handles edit trigger by starting the edit and return true if the editing has already started.

Parameters: cell the cell being edited e the mouse event triggering the edit

Returns: true if the editing has already started

isDescendant

protected boolean isDescendant(CellView parentView, CellView childView)

mouseDragged

public void mouseDragged(MouseEvent e)

mouseMoved

public void mouseMoved(MouseEvent e)
Invoked when the mouse pointer has been moved on a component (with no buttons down).

mousePressed

public void mousePressed(MouseEvent e)
Invoked when a mouse button has been pressed on a component.

mouseReleased

public void mouseReleased(MouseEvent e)

postProcessSelection

protected void postProcessSelection(MouseEvent e, 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.
Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.