|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.TreeUI
javax.swing.plaf.basic.BasicTreeUI
com.explodingpixels.macwidgets.plaf.SourceListTreeUI
public class SourceListTreeUI
A UI delegate that paints a JTree as an Apple defined
Source List. Consider using this UI delegate with
MacWidgetFactory.createSourceListScrollPane(javax.swing.JComponent).
For the best development experience, it is recommended that you migrate your code to use the
SourceList with the SourceListModel, as this component abstracts away many of the
complexities of JTree.
Pictured below are the two different rendering styles of a Source List: focused and unfocused.
The corresponding JTree's focusable property drives this rendering style.
![]() |
![]() |
| Focusable SourceList | Non-focusable SourceList |
DefaultMutableTreeNode, and the
DefaultMutableTreeNode.getUserObject() is an instance of TextProvider, then
the TextProvider will be queried for the node text.TextProvider is found, the standard
JTree.convertValueToText(Object, boolean, boolean, boolean, int, boolean) method will
be consulted.DefaultMutableTreeNode, and the
DefaultMutableTreeNode.getUserObject() is an instance of IconProvider, then
the IconProvider will be queried for the node icon.
| Nested Class Summary |
|---|
| 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.MouseHandler, 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 | |
|---|---|
SourceListTreeUI()
|
|
| Method Summary | |
|---|---|
protected void |
completeUIInstall()
|
protected javax.swing.tree.AbstractLayoutCache.NodeDimensions |
createNodeDimensions()
|
java.awt.Font |
getCategoryFont()
|
SourceListColorScheme |
getColorScheme()
Gets the SourceListColorScheme that this SourceListTreeUI uses to paint. |
java.awt.Font |
getItemFont()
|
java.awt.Font |
getItemSelectedFont()
|
java.awt.Rectangle |
getPathBounds(javax.swing.JTree tree,
javax.swing.tree.TreePath path)
|
protected void |
installKeyboardActions()
|
protected void |
installListeners()
|
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c)
|
protected void |
paintExpandControl(java.awt.Graphics g,
java.awt.Rectangle clipBounds,
java.awt.Insets insets,
java.awt.Rectangle bounds,
javax.swing.tree.TreePath path,
int row,
boolean isExpanded,
boolean hasBeenExpanded,
boolean isLeaf)
|
protected void |
paintHorizontalLine(java.awt.Graphics g,
javax.swing.JComponent c,
int y,
int left,
int right)
|
protected void |
paintVerticalPartOfLeg(java.awt.Graphics g,
java.awt.Rectangle clipBounds,
java.awt.Insets insets,
javax.swing.tree.TreePath path)
|
protected void |
selectPathForEvent(javax.swing.tree.TreePath path,
java.awt.event.MouseEvent event)
|
void |
setCategoryFont(java.awt.Font categoryFont)
|
void |
setColorScheme(SourceListColorScheme colorScheme)
Sets the SourceListColorScheme that this SourceListTreeUI uses to paint. |
void |
setItemFont(java.awt.Font itemFont)
|
void |
setItemSelectedFont(java.awt.Font itemSelectedFont)
|
protected void |
setModel(javax.swing.tree.TreeModel model)
|
| Methods inherited from class javax.swing.plaf.basic.BasicTreeUI |
|---|
cancelEditing, checkForClickInExpandControl, completeEditing, completeEditing, completeUIUninstall, configureLayoutCache, createCellEditorListener, createCellRendererPane, createComponentListener, createDefaultCellEditor, createDefaultCellRenderer, createFocusListener, createKeyListener, createLayoutCache, createMouseListener, createPropertyChangeListener, createSelectionModelPropertyChangeListener, createTreeExpansionListener, createTreeModelListener, createTreeSelectionListener, createUI, drawCentered, drawDashedHorizontalLine, drawDashedVerticalLine, ensureRowsAreVisible, getBaseline, getBaselineResizeBehavior, getCellEditor, getCellRenderer, getClosestPathForLocation, getCollapsedIcon, getEditingPath, getExpandedIcon, getHashColor, getHorizontalLegBuffer, getLastChildPath, getLeftChildIndent, getMaximumSize, getMinimumSize, getModel, getPathForRow, getPreferredMinSize, getPreferredSize, getPreferredSize, getRightChildIndent, getRowCount, getRowForPath, getRowHeight, getRowX, getSelectionModel, getShowsRootHandles, getVerticalLegBuffer, handleExpandControlClick, installComponents, installDefaults, installUI, isEditable, isEditing, isLargeModel, isLeaf, isLocationInExpandControl, isMultiSelectEvent, isRootVisible, isToggleEvent, isToggleSelectionEvent, paintHorizontalPartOfLeg, paintRow, paintVerticalLine, pathWasCollapsed, pathWasExpanded, prepareForUIInstall, prepareForUIUninstall, setCellEditor, setCellRenderer, setCollapsedIcon, setEditable, setExpandedIcon, setHashColor, setLargeModel, setLeftChildIndent, setPreferredMinSize, setRightChildIndent, setRootVisible, setRowHeight, setSelectionModel, setShowsRootHandles, shouldPaintExpandControl, startEditing, startEditingAtPath, stopEditing, toggleExpandState, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI, 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 |
|---|
public SourceListTreeUI()
| Method Detail |
|---|
protected void completeUIInstall()
completeUIInstall in class javax.swing.plaf.basic.BasicTreeUIpublic java.awt.Font getCategoryFont()
public void setCategoryFont(java.awt.Font categoryFont)
public java.awt.Font getItemFont()
public void setItemFont(java.awt.Font itemFont)
public java.awt.Font getItemSelectedFont()
public void setItemSelectedFont(java.awt.Font itemSelectedFont)
protected void installListeners()
installListeners in class javax.swing.plaf.basic.BasicTreeUIprotected void installKeyboardActions()
installKeyboardActions in class javax.swing.plaf.basic.BasicTreeUIprotected void setModel(javax.swing.tree.TreeModel model)
setModel in class javax.swing.plaf.basic.BasicTreeUIpublic SourceListColorScheme getColorScheme()
SourceListColorScheme that this SourceListTreeUI uses to paint.
SourceListColorScheme that this SourceList uses to paint.public void setColorScheme(SourceListColorScheme colorScheme)
SourceListColorScheme that this SourceListTreeUI uses to paint.
colorScheme - the SourceListColorScheme that this SourceList uses to
paint.
protected void paintExpandControl(java.awt.Graphics g,
java.awt.Rectangle clipBounds,
java.awt.Insets insets,
java.awt.Rectangle bounds,
javax.swing.tree.TreePath path,
int row,
boolean isExpanded,
boolean hasBeenExpanded,
boolean isLeaf)
paintExpandControl in class javax.swing.plaf.basic.BasicTreeUIprotected javax.swing.tree.AbstractLayoutCache.NodeDimensions createNodeDimensions()
createNodeDimensions in class javax.swing.plaf.basic.BasicTreeUI
public java.awt.Rectangle getPathBounds(javax.swing.JTree tree,
javax.swing.tree.TreePath path)
getPathBounds in class javax.swing.plaf.basic.BasicTreeUI
public void paint(java.awt.Graphics g,
javax.swing.JComponent c)
paint in class javax.swing.plaf.basic.BasicTreeUI
protected void paintHorizontalLine(java.awt.Graphics g,
javax.swing.JComponent c,
int y,
int left,
int right)
paintHorizontalLine in class javax.swing.plaf.basic.BasicTreeUI
protected void paintVerticalPartOfLeg(java.awt.Graphics g,
java.awt.Rectangle clipBounds,
java.awt.Insets insets,
javax.swing.tree.TreePath path)
paintVerticalPartOfLeg in class javax.swing.plaf.basic.BasicTreeUI
protected void selectPathForEvent(javax.swing.tree.TreePath path,
java.awt.event.MouseEvent event)
selectPathForEvent in class javax.swing.plaf.basic.BasicTreeUI
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||