Package com.jidesoft.swing
Class CheckBoxTree.Handler
- java.lang.Object
-
- com.jidesoft.swing.CheckBoxTree.Handler
-
- All Implemented Interfaces:
java.awt.event.KeyListener
,java.awt.event.MouseListener
,java.util.EventListener
,javax.swing.event.TreeSelectionListener
- Enclosing class:
- CheckBoxTree
protected static class CheckBoxTree.Handler extends java.lang.Object implements java.awt.event.MouseListener, java.awt.event.KeyListener, javax.swing.event.TreeSelectionListener
CheckBoxTree's mouse event handler, key event handler and tree selection event handler.
-
-
Field Summary
Fields Modifier and Type Field Description protected CheckBoxTree
_tree
-
Constructor Summary
Constructors Constructor Description Handler(CheckBoxTree tree)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
clicksInCheckBox(java.awt.event.MouseEvent e, javax.swing.tree.TreePath path)
Checks if the mouse event happens for the tree path.protected javax.swing.tree.TreePath
getTreePathForMouseEvent(java.awt.event.MouseEvent e)
Gets the tree path according to the mouse event.void
keyPressed(java.awt.event.KeyEvent e)
void
keyReleased(java.awt.event.KeyEvent e)
void
keyTyped(java.awt.event.KeyEvent e)
void
mouseClicked(java.awt.event.MouseEvent e)
void
mouseEntered(java.awt.event.MouseEvent e)
void
mouseExited(java.awt.event.MouseEvent e)
void
mousePressed(java.awt.event.MouseEvent e)
void
mouseReleased(java.awt.event.MouseEvent e)
protected void
toggleSelections()
Toggles the selected paths' selection state.void
valueChanged(javax.swing.event.TreeSelectionEvent e)
-
-
-
Field Detail
-
_tree
protected CheckBoxTree _tree
-
-
Constructor Detail
-
Handler
public Handler(CheckBoxTree tree)
The constructor.- Parameters:
tree
- the CheckBoxTree
-
-
Method Detail
-
getTreePathForMouseEvent
protected javax.swing.tree.TreePath getTreePathForMouseEvent(java.awt.event.MouseEvent e)
Gets the tree path according to the mouse event.- Parameters:
e
- the mouse event- Returns:
- the tree path the mouse is over. null if no tree node is under the mouse position.
-
clicksInCheckBox
protected boolean clicksInCheckBox(java.awt.event.MouseEvent e, javax.swing.tree.TreePath path)
Checks if the mouse event happens for the tree path.- Parameters:
e
- the mouse eventpath
- the tree path- Returns:
- true if the mouse event need change the state of the tree node. Otherwise false.
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Specified by:
mouseClicked
in interfacejava.awt.event.MouseListener
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressed
in interfacejava.awt.event.MouseListener
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleased
in interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
- Specified by:
mouseEntered
in interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
- Specified by:
mouseExited
in interfacejava.awt.event.MouseListener
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
- Specified by:
keyPressed
in interfacejava.awt.event.KeyListener
-
keyTyped
public void keyTyped(java.awt.event.KeyEvent e)
- Specified by:
keyTyped
in interfacejava.awt.event.KeyListener
-
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)
- Specified by:
keyReleased
in interfacejava.awt.event.KeyListener
-
valueChanged
public void valueChanged(javax.swing.event.TreeSelectionEvent e)
- Specified by:
valueChanged
in interfacejavax.swing.event.TreeSelectionListener
-
toggleSelections
protected void toggleSelections()
Toggles the selected paths' selection state.
-
-