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.TreeSelectionListenerCheckBoxTree'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 booleanclicksInCheckBox(java.awt.event.MouseEvent e, javax.swing.tree.TreePath path)Checks if the mouse event happens for the tree path.protected javax.swing.tree.TreePathgetTreePathForMouseEvent(java.awt.event.MouseEvent e)Gets the tree path according to the mouse event.voidkeyPressed(java.awt.event.KeyEvent e)voidkeyReleased(java.awt.event.KeyEvent e)voidkeyTyped(java.awt.event.KeyEvent e)voidmouseClicked(java.awt.event.MouseEvent e)voidmouseEntered(java.awt.event.MouseEvent e)voidmouseExited(java.awt.event.MouseEvent e)voidmousePressed(java.awt.event.MouseEvent e)voidmouseReleased(java.awt.event.MouseEvent e)protected voidtoggleSelections()Toggles the selected paths' selection state.voidvalueChanged(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:
mouseClickedin interfacejava.awt.event.MouseListener
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressedin interfacejava.awt.event.MouseListener
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
- Specified by:
keyPressedin interfacejava.awt.event.KeyListener
-
keyTyped
public void keyTyped(java.awt.event.KeyEvent e)
- Specified by:
keyTypedin interfacejava.awt.event.KeyListener
-
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)
- Specified by:
keyReleasedin interfacejava.awt.event.KeyListener
-
valueChanged
public void valueChanged(javax.swing.event.TreeSelectionEvent e)
- Specified by:
valueChangedin interfacejavax.swing.event.TreeSelectionListener
-
toggleSelections
protected void toggleSelections()
Toggles the selected paths' selection state.
-
-