org.openbp.swing.plaf.sky
Class SkyTreeUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.TreeUI
          extended by javax.swing.plaf.basic.BasicTreeUI
              extended by javax.swing.plaf.metal.MetalTreeUI
                  extended by org.openbp.swing.plaf.sky.SkyTreeUI

public class SkyTreeUI
extends javax.swing.plaf.metal.MetalTreeUI

PLAF for a JTree component We override this class in order to customize the mouse handling if the click count of the tree is set to 1. However, this doesn't work correctly yet, so it's currently not used.

Author:
Heiko Erhardt

Nested Class Summary
 class SkyTreeUI.MouseHandler
          Responsible for updating the selection based on mouse events.
 class SkyTreeUI.MouseMotionHandler
          Responsible for updating the selection based on mouse events.
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTreeUI
javax.swing.plaf.basic.BasicTreeUI.CellEditorHandler, javax.swing.plaf.basic.BasicTreeUI.ComponentHandler, javax.swing.plaf.basic.BasicTreeUI.FocusHandler, javax.swing.plaf.basic.BasicTreeUI.KeyHandler, javax.swing.plaf.basic.BasicTreeUI.MouseInputHandler, javax.swing.plaf.basic.BasicTreeUI.NodeDimensionsHandler, javax.swing.plaf.basic.BasicTreeUI.PropertyChangeHandler, javax.swing.plaf.basic.BasicTreeUI.SelectionModelPropertyChangeHandler, javax.swing.plaf.basic.BasicTreeUI.TreeCancelEditingAction, javax.swing.plaf.basic.BasicTreeUI.TreeExpansionHandler, javax.swing.plaf.basic.BasicTreeUI.TreeHomeAction, javax.swing.plaf.basic.BasicTreeUI.TreeIncrementAction, javax.swing.plaf.basic.BasicTreeUI.TreeModelHandler, javax.swing.plaf.basic.BasicTreeUI.TreePageAction, javax.swing.plaf.basic.BasicTreeUI.TreeSelectionHandler, javax.swing.plaf.basic.BasicTreeUI.TreeToggleAction, javax.swing.plaf.basic.BasicTreeUI.TreeTraverseAction
 
Field Summary
 
Fields inherited from class javax.swing.plaf.basic.BasicTreeUI
cellEditor, collapsedIcon, createdCellEditor, createdRenderer, currentCellRenderer, depthOffset, drawingCache, editingComponent, editingPath, editingRow, editorHasDifferentSize, expandedIcon, largeModel, lastSelectedRow, leftChildIndent, nodeDimensions, preferredMinSize, preferredSize, rendererPane, rightChildIndent, stopEditingInCompleteEditing, totalChildIndent, tree, treeModel, treeSelectionModel, treeState, validCachedPreferredSize
 
Constructor Summary
SkyTreeUI()
          Default constructor.
 
Method Summary
protected  java.awt.event.MouseListener createMouseListener()
          Creates the listener responsible for updating the selection based on mouse events.
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Creates a new instance of this ui.
protected  void installListeners()
           
protected  void selectPathForEvent(javax.swing.tree.TreePath path, java.awt.event.MouseEvent event)
          Messaged to update the selection based on a MouseEvent over a particular row.
 
Methods inherited from class javax.swing.plaf.metal.MetalTreeUI
decodeLineStyle, getHorizontalLegBuffer, installUI, isLocationInExpandControl, paint, paintHorizontalPartOfLeg, paintHorizontalSeparators, paintVerticalPartOfLeg, uninstallUI
 
Methods inherited from class javax.swing.plaf.basic.BasicTreeUI
cancelEditing, checkForClickInExpandControl, completeEditing, completeEditing, completeUIInstall, completeUIUninstall, configureLayoutCache, createCellEditorListener, createCellRendererPane, createComponentListener, createDefaultCellEditor, createDefaultCellRenderer, createFocusListener, createKeyListener, createLayoutCache, createNodeDimensions, createPropertyChangeListener, createSelectionModelPropertyChangeListener, createTreeExpansionListener, createTreeModelListener, createTreeSelectionListener, drawCentered, drawDashedHorizontalLine, drawDashedVerticalLine, ensureRowsAreVisible, getBaseline, getBaselineResizeBehavior, getCellEditor, getCellRenderer, getClosestPathForLocation, getCollapsedIcon, getEditingPath, getExpandedIcon, getHashColor, getLastChildPath, getLeftChildIndent, getMaximumSize, getMinimumSize, getModel, getPathBounds, getPathForRow, getPreferredMinSize, getPreferredSize, getPreferredSize, getRightChildIndent, getRowCount, getRowForPath, getRowHeight, getRowX, getSelectionModel, getShowsRootHandles, getVerticalLegBuffer, handleExpandControlClick, installComponents, installDefaults, installKeyboardActions, isEditable, isEditing, isLargeModel, isLeaf, isLocationInExpandControl, isMultiSelectEvent, isRootVisible, isToggleEvent, isToggleSelectionEvent, paintExpandControl, paintHorizontalLine, paintRow, paintVerticalLine, pathWasCollapsed, pathWasExpanded, prepareForUIInstall, prepareForUIUninstall, setCellEditor, setCellRenderer, setCollapsedIcon, setEditable, setExpandedIcon, setHashColor, setLargeModel, setLeftChildIndent, setModel, setPreferredMinSize, setRightChildIndent, setRootVisible, setRowHeight, setSelectionModel, setShowsRootHandles, shouldPaintExpandControl, startEditing, startEditingAtPath, stopEditing, toggleExpandState, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, updateCachedPreferredSize, updateCellEditor, updateDepthOffset, updateExpandedDescendants, updateLayoutCacheExpandedNodes, updateRenderer, updateSize
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SkyTreeUI

public SkyTreeUI()
Default constructor.

Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Creates a new instance of this ui.

Parameters:
c - Component to create this ui for
Returns:
The new ui instance

installListeners

protected void installListeners()
Overrides:
installListeners in class javax.swing.plaf.basic.BasicTreeUI

createMouseListener

protected java.awt.event.MouseListener createMouseListener()
Creates the listener responsible for updating the selection based on mouse events.

Overrides:
createMouseListener in class javax.swing.plaf.basic.BasicTreeUI
Returns:
The new listener

selectPathForEvent

protected void selectPathForEvent(javax.swing.tree.TreePath path,
                                  java.awt.event.MouseEvent event)
Messaged to update the selection based on a MouseEvent over a particular row. If the event is a toggle selection event, the row is either selected, or deselected. If the event identifies a multi selection event, the selection is updated from the anchor point. Otherwise the row is selected, and if the event specified a toggle event the row is expanded/collapsed.

Overrides:
selectPathForEvent in class javax.swing.plaf.basic.BasicTreeUI


Copyright © 2011. All Rights Reserved.