API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.plaf.metal. MetalTreeUI View Source
Author(s)
Tom Santos
Steve Wilson (value add stuff)
Since
Version
1.25 01/08/07
Serial
Hierarchy
 Object
      ComponentUI
          TreeUI
              BasicTreeUI
                  MetalTreeUI
Implements
Subclasses
Description
public class MetalTreeUI
  The metal look and feel implementation of TreeUI.
See also:   
Constructors
public MetalTreeUI ()
Methods
Hide/Show inherited methods
public void cancelEditing (JTree tree) [Inherited From BasicTreeUI] [Specified in TreeUI]
Cancels the current editing session.
protected void checkForClickInExpandControl (TreePath path, int mouseX, int mouseY) [Inherited From BasicTreeUI]
If the mouseX and mouseY are in the expand/collapse region of the row, this will toggle the row.
protected void completeEditing () [Inherited From BasicTreeUI]
  Messages to stop the editing session.
protected void completeEditing (boolean messageStop, boolean messageCancel, boolean messageTree) [Inherited From BasicTreeUI]
  Stops the editing session.
protected void completeUIInstall () [Inherited From BasicTreeUI]
Invoked from installUI after all the defaults/listeners have been installed.
protected void completeUIUninstall () [Inherited From BasicTreeUI]
protected void configureLayoutCache () [Inherited From BasicTreeUI]
Resets the TreeState instance based on the tree we're providing the look and feel for.
public boolean contains (JComponent c, int x, int y) [Inherited From ComponentUI]
  Returns true if the specified x,y location is contained within the look and feel's defined shape of the specified component.
protected CellEditorListener createCellEditorListener () [Inherited From BasicTreeUI]
Creates a listener to handle events from the current editor.
protected CellRendererPane createCellRendererPane () [Inherited From BasicTreeUI]
Returns the renderer pane that renderer components are placed in.
protected ComponentListener createComponentListener () [Inherited From BasicTreeUI]
  Creates and returns a new ComponentHandler.
protected TreeCellEditor createDefaultCellEditor () [Inherited From BasicTreeUI]
Creates a default cell editor.
protected TreeCellRenderer createDefaultCellRenderer () [Inherited From BasicTreeUI]
Returns the default cell renderer that is used to do the stamping of each node.
protected FocusListener createFocusListener () [Inherited From BasicTreeUI]
Creates a listener that is responsible for updating the display when focus is lost/gained.
protected KeyListener createKeyListener () [Inherited From BasicTreeUI]
Creates the listener reponsible for getting key events from the tree.
protected AbstractLayoutCache createLayoutCache () [Inherited From BasicTreeUI]
Creates the object responsible for managing what is expanded, as well as the size of nodes.
protected MouseListener createMouseListener () [Inherited From BasicTreeUI]
Creates the listener responsible for updating the selection based on mouse events.
protected NodeDimensions createNodeDimensions () [Inherited From BasicTreeUI]
Creates an instance of NodeDimensions that is able to determine the size of a given node in the tree.
protected PropertyChangeListener createPropertyChangeListener () [Inherited From BasicTreeUI]
Creates a listener that is responsible that updates the UI based on how the tree changes.
protected PropertyChangeListener createSelectionModelPropertyChangeListener () [Inherited From BasicTreeUI]
Creates the listener responsible for getting property change events from the selection model.
protected TreeExpansionListener createTreeExpansionListener () [Inherited From BasicTreeUI]
Creates and returns the object responsible for updating the treestate when nodes expanded state changes.
protected TreeModelListener createTreeModelListener () [Inherited From BasicTreeUI]
Returns a listener that can update the tree when the model changes.
protected TreeSelectionListener createTreeSelectionListener () [Inherited From BasicTreeUI]
Creates the listener that updates the display based on selection change methods.
publicstatic ComponentUI createUI (JComponent x) [Overrides BasicTreeUI]
protected void decodeLineStyle (Object lineStyleFlag)
this function converts between the string passed into the client property and the internal representation (currently and int)
protected void drawCentered (Component c, Graphics graphics, Icon icon, int x, int y) [Inherited From BasicTreeUI]
protected void drawDashedHorizontalLine (Graphics g, int y, int x1, int x2) [Inherited From BasicTreeUI]
protected void drawDashedVerticalLine (Graphics g, int x, int y1, int y2) [Inherited From BasicTreeUI]
protected void ensureRowsAreVisible (int beginRow, int endRow) [Inherited From BasicTreeUI]
Ensures that the rows identified by beginRow through endRow are visible.
public Accessible getAccessibleChild (JComponent c, int i) [Inherited From ComponentUI]
  Returns the ith Accessible child of the object.
public int getAccessibleChildrenCount (JComponent c) [Inherited From ComponentUI]
  Returns the number of accessible children in the object.
public int getBaseline (JComponent c, int width, int height) [Inherited From BasicTreeUI]
  Returns the baseline.
public BaselineResizeBehavior getBaselineResizeBehavior (JComponent c) [Inherited From BasicTreeUI]
  Returns an enum indicating how the baseline of the component changes as the size changes.
protected TreeCellEditor getCellEditor () [Inherited From BasicTreeUI]
protected TreeCellRenderer getCellRenderer () [Inherited From BasicTreeUI]
Return currentCellRenderer, which will either be the trees renderer, or defaultCellRenderer, which ever wasn't null.
public TreePath getClosestPathForLocation (JTree tree, int x, int y) [Inherited From BasicTreeUI] [Specified in TreeUI]
  Returns the path to the node that is closest to x,y.
public Icon getCollapsedIcon () [Inherited From BasicTreeUI]
public TreePath getEditingPath (JTree tree) [Inherited From BasicTreeUI] [Specified in TreeUI]
Returns the path to the element that is being edited.
public Icon getExpandedIcon () [Inherited From BasicTreeUI]
protected Color getHashColor () [Inherited From BasicTreeUI]
protected int getHorizontalLegBuffer () [Overrides BasicTreeUI]
protected TreePath getLastChildPath (TreePath parent) [Inherited From BasicTreeUI]
Returns a path to the last child of parent.
public int getLeftChildIndent () [Inherited From BasicTreeUI]
public Dimension getMaximumSize (JComponent c) [Inherited From BasicTreeUI]
Returns the maximum size for this component, which will be the preferred size if the instance is currently in a JTree, or 0, 0.
public Dimension getMinimumSize (JComponent c) [Inherited From BasicTreeUI]
  Returns the minimum size for this component.
protected TreeModel getModel () [Inherited From BasicTreeUI]
public Rectangle getPathBounds (JTree tree, TreePath path) [Inherited From BasicTreeUI] [Specified in TreeUI]
  Returns the Rectangle enclosing the label portion that the last item in path will be drawn into.
public TreePath getPathForRow (JTree tree, int row) [Inherited From BasicTreeUI] [Specified in TreeUI]
  Returns the path for passed in row.
public Dimension getPreferredMinSize () [Inherited From BasicTreeUI]
Returns the minimum preferred size.
public Dimension getPreferredSize (JComponent c) [Inherited From BasicTreeUI]
Returns the preferred size to properly display the tree, this is a cover method for getPreferredSize(c, false).
public Dimension getPreferredSize (JComponent c, boolean checkConsistancy) [Inherited From BasicTreeUI]
  Returns the preferred size to represent the tree in c.
public int getRightChildIndent () [Inherited From BasicTreeUI]
public int getRowCount (JTree tree) [Inherited From BasicTreeUI] [Specified in TreeUI]
Returns the number of rows that are being displayed.
public int getRowForPath (JTree tree, TreePath path) [Inherited From BasicTreeUI] [Specified in TreeUI]
  Returns the row that the last item identified in path is visible at.
protected int getRowHeight () [Inherited From BasicTreeUI]
protected int getRowX (int row, int depth) [Inherited From BasicTreeUI]
  Returns the location, along the x-axis, to render a particular row at.
protected TreeSelectionModel getSelectionModel () [Inherited From BasicTreeUI]
protected boolean getShowsRootHandles () [Inherited From BasicTreeUI]
protected int getVerticalLegBuffer () [Inherited From BasicTreeUI]
  The vertical element of legs between nodes starts at the bottom of the parent node by default.
protected void handleExpandControlClick (TreePath path, int mouseX, int mouseY) [Inherited From BasicTreeUI]
Messaged when the user clicks the particular row, this invokes toggleExpandState.
protected void installComponents () [Inherited From BasicTreeUI]
Intalls the subcomponents of the tree, which is the renderer pane.
protected void installDefaults () [Inherited From BasicTreeUI]
protected void installKeyboardActions () [Inherited From BasicTreeUI]
protected void installListeners () [Inherited From BasicTreeUI]
public void installUI (JComponent c) [Overrides BasicTreeUI]
protected boolean isEditable () [Inherited From BasicTreeUI]
public boolean isEditing (JTree tree) [Inherited From BasicTreeUI] [Specified in TreeUI]
  Returns true if the tree is being edited.
protected boolean isLargeModel () [Inherited From BasicTreeUI]
protected boolean isLeaf (int row) [Inherited From BasicTreeUI]
 
protected boolean isLocationInExpandControl (int row, int rowLevel, int mouseX, int mouseY)
protected boolean isLocationInExpandControl (TreePath path, int mouseX, int mouseY) [Inherited From BasicTreeUI]
Returns true if mouseX and mouseY fall in the area of row that is used to expand/collapse the node and the node at row does not represent a leaf.
protected boolean isMultiSelectEvent (MouseEvent event) [Inherited From BasicTreeUI]
Returning true signifies a mouse event on the node should select from the anchor point.
protected boolean isRootVisible () [Inherited From BasicTreeUI]
protected boolean isToggleEvent (MouseEvent event) [Inherited From BasicTreeUI]
  Returning true indicates the row under the mouse should be toggled based on the event.
protected boolean isToggleSelectionEvent (MouseEvent event) [Inherited From BasicTreeUI]
Returning true signifies a mouse event on the node should toggle the selection of only the row under mouse.
public void paint (Graphics g, JComponent c) [Overrides BasicTreeUI]
protected void paintExpandControl (Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) [Inherited From BasicTreeUI]
  Paints the expand (toggle) part of a row.
protected void paintHorizontalLine (Graphics g, JComponent c, int y, int left, int right) [Inherited From BasicTreeUI]
Paints a horizontal line.
protected void paintHorizontalPartOfLeg (Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) [Overrides BasicTreeUI]
protected void paintHorizontalSeparators (Graphics g, JComponent c)
protected void paintRow (Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) [Inherited From BasicTreeUI]
  Paints the renderer part of a row.
protected void paintVerticalLine (Graphics g, JComponent c, int x, int top, int bottom) [Inherited From BasicTreeUI]
Paints a vertical line.
protected void paintVerticalPartOfLeg (Graphics g, Rectangle clipBounds, Insets insets, TreePath path) [Overrides BasicTreeUI]
protected void pathWasCollapsed (TreePath path) [Inherited From BasicTreeUI]
Messaged from the VisibleTreeNode after it has collapsed.
protected void pathWasExpanded (TreePath path) [Inherited From BasicTreeUI]
Messaged from the VisibleTreeNode after it has been expanded.
protected void prepareForUIInstall () [Inherited From BasicTreeUI]
Invoked after the tree instance variable has been set, but before any defaults/listeners have been installed.
protected void prepareForUIUninstall () [Inherited From BasicTreeUI]
protected void selectPathForEvent (TreePath path, MouseEvent event) [Inherited From BasicTreeUI]
  Messaged to update the selection based on a MouseEvent over a particular row.
protected void setCellEditor (TreeCellEditor editor) [Inherited From BasicTreeUI]
Sets the cell editor.
protected void setCellRenderer (TreeCellRenderer tcr) [Inherited From BasicTreeUI]
  Sets the TreeCellRenderer to tcr.
public void setCollapsedIcon (Icon newG) [Inherited From BasicTreeUI]
protected void setEditable (boolean newValue) [Inherited From BasicTreeUI]
Configures the receiver to allow, or not allow, editing.
public void setExpandedIcon (Icon newG) [Inherited From BasicTreeUI]
protected void setHashColor (Color color) [Inherited From BasicTreeUI]
protected void setLargeModel (boolean largeModel) [Inherited From BasicTreeUI]
Updates the componentListener, if necessary.
public void setLeftChildIndent (int newAmount) [Inherited From BasicTreeUI]
protected void setModel (TreeModel model) [Inherited From BasicTreeUI]
Sets the TreeModel.
public void setPreferredMinSize (Dimension newSize) [Inherited From BasicTreeUI]
Sets the preferred minimum size.
public void setRightChildIndent (int newAmount) [Inherited From BasicTreeUI]
protected void setRootVisible (boolean newValue) [Inherited From BasicTreeUI]
Sets the root to being visible.
protected void setRowHeight (int rowHeight) [Inherited From BasicTreeUI]
Sets the row height, this is forwarded to the treeState.
protected void setSelectionModel (TreeSelectionModel newLSM) [Inherited From BasicTreeUI]
  Resets the selection model.
protected void setShowsRootHandles (boolean newValue) [Inherited From BasicTreeUI]
Determines whether the node handles are to be displayed.
protected boolean shouldPaintExpandControl (TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) [Inherited From BasicTreeUI]
Returns true if the expand (toggle) control should be drawn for the specified row.
protected boolean startEditing (TreePath path, MouseEvent event) [Inherited From BasicTreeUI]
  Will start editing for node if there is a cellEditor and shouldSelectCell returns true.
public void startEditingAtPath (JTree tree, TreePath path) [Inherited From BasicTreeUI] [Specified in TreeUI]
  Selects the last item in path and tries to edit it.
public boolean stopEditing (JTree tree) [Inherited From BasicTreeUI] [Specified in TreeUI]
  Stops the current editing session.
protected void toggleExpandState (TreePath path) [Inherited From BasicTreeUI]
  Expands path if it is not expanded, or collapses row if it is expanded.
protected void uninstallComponents () [Inherited From BasicTreeUI]
Uninstalls the renderer pane.
protected void uninstallDefaults () [Inherited From BasicTreeUI]
protected void uninstallKeyboardActions () [Inherited From BasicTreeUI]
protected void uninstallListeners () [Inherited From BasicTreeUI]
public void uninstallUI (JComponent c) [Overrides BasicTreeUI]
public void update (Graphics g, JComponent c) [Inherited From ComponentUI]
  Notifies this UI delegate that it's time to paint the specified component.
protected void updateCachedPreferredSize () [Inherited From BasicTreeUI]
  Updates the preferredSize instance variable, which is returned from getPreferredSize().
protected void updateCellEditor () [Inherited From BasicTreeUI]
  Updates the cellEditor based on the editability of the JTree that we're contained in.
protected void updateDepthOffset () [Inherited From BasicTreeUI]
Updates how much each depth should be offset by.
protected void updateExpandedDescendants (TreePath path) [Inherited From BasicTreeUI]
Updates the expanded state of all the descendants of path by getting the expanded descendants from the tree and forwarding to the tree state.
protected void updateLayoutCacheExpandedNodes () [Inherited From BasicTreeUI]
  Makes all the nodes that are expanded in JTree expanded in LayoutCache.
protected void updateRenderer () [Inherited From BasicTreeUI]
Messaged from the tree we're in when the renderer has changed.
protected void updateSize () [Inherited From BasicTreeUI]
Marks the cached size as being invalid, and messages the tree with treeDidChange.
Fields
Hide/Show inherited fields
protectedtransient TreeCellEditor cellEditor [Inherited From BasicTreeUI]
Editor for the tree.
protectedtransient Icon collapsedIcon [Inherited From BasicTreeUI]
protected boolean createdCellEditor [Inherited From BasicTreeUI]
Set to true if editor that is currently in the tree was created by this instance.
protected boolean createdRenderer [Inherited From BasicTreeUI]
Set to true if the renderer that is currently in the tree was created by this instance.
protectedtransient TreeCellRenderer currentCellRenderer [Inherited From BasicTreeUI]
Renderer that is being used to do the actual cell drawing.
protected int depthOffset [Inherited From BasicTreeUI]
  How much the depth should be offset to properly calculate x locations.
protected Hashtable<TreePath, Boolean> drawingCache [Inherited From BasicTreeUI]
Used for minimizing the drawing of vertical lines.
protected Component editingComponent [Inherited From BasicTreeUI]
When editing, this will be the Component that is doing the actual editing.
protected TreePath editingPath [Inherited From BasicTreeUI]
Path that is being edited.
protected int editingRow [Inherited From BasicTreeUI]
  Row that is being edited.
protected boolean editorHasDifferentSize [Inherited From BasicTreeUI]
Set to true if the editor has a different size than the renderer.
protectedtransient Icon expandedIcon [Inherited From BasicTreeUI]
protected boolean largeModel [Inherited From BasicTreeUI]
  True if doing optimizations for a largeModel.
protected int lastSelectedRow [Inherited From BasicTreeUI]
Index of the row that was last selected.
protected int leftChildIndent [Inherited From BasicTreeUI]
Distance between left margin and where vertical dashes will be drawn.
protected NodeDimensions nodeDimensions [Inherited From BasicTreeUI]
Reponsible for telling the TreeState the size needed for a node.
protected Dimension preferredMinSize [Inherited From BasicTreeUI]
Minimum preferred size.
protected Dimension preferredSize [Inherited From BasicTreeUI]
Size needed to completely display all the nodes.
protected CellRendererPane rendererPane [Inherited From BasicTreeUI]
Used to paint the TreeCellRenderer.
protected int rightChildIndent [Inherited From BasicTreeUI]
Distance to add to leftChildIndent to determine where cell contents will be drawn.
protected boolean stopEditingInCompleteEditing [Inherited From BasicTreeUI]
Set to false when editing and shouldSelectCell() returns true meaning the node should be selected before editing, used in completeEditing.
protected int totalChildIndent [Inherited From BasicTreeUI]
  Total distance that will be indented.
protected JTree tree [Inherited From BasicTreeUI]
Component that we're going to be drawing into.
protected TreeModel treeModel [Inherited From BasicTreeUI]
Used to determine what to display.
protected TreeSelectionModel treeSelectionModel [Inherited From BasicTreeUI]
Model maintaing the selection.
protected AbstractLayoutCache treeState [Inherited From BasicTreeUI]
Object responsible for handling sizing and expanded issues.
protected boolean validCachedPreferredSize [Inherited From BasicTreeUI]
Is the preferredSize valid?
Nested Classes
  MetalTreeUI.LineListener
This class listens for changes in line style
  BasicTreeUI.TreeExpansionHandler
Updates the TreeState in response to nodes expanding/collapsing.
  BasicTreeUI.ComponentHandler
Updates the preferred size when scrolling (if necessary).
  BasicTreeUI.TreeModelHandler
Forwards all TreeModel events to the TreeState.
  BasicTreeUI.TreeSelectionHandler
Listens for changes in the selection model and updates the display accordingly.
  BasicTreeUI.CellEditorHandler
Listener responsible for getting cell editing events and updating the tree accordingly.
  BasicTreeUI.KeyHandler
This is used to get mutliple key down events to appropriately generate events.
  BasicTreeUI.FocusHandler
Repaints the lead selection row when focus is lost/gained.
  BasicTreeUI.NodeDimensionsHandler
Class responsible for getting size of node, method is forwarded to BasicTreeUI method.
  BasicTreeUI.MouseHandler
TreeMouseListener is responsible for updating the selection based on mouse events.
  BasicTreeUI.PropertyChangeHandler
PropertyChangeListener for the tree.
  BasicTreeUI.SelectionModelPropertyChangeHandler
Listener on the TreeSelectionModel, resets the row selection if any of the properties of the model change.
  BasicTreeUI.TreeTraverseAction
TreeTraverseAction is the action used for left/right keys.
  BasicTreeUI.TreePageAction
TreePageAction handles page up and page down events.
  BasicTreeUI.TreeIncrementAction
TreeIncrementAction is used to handle up/down actions.
  BasicTreeUI.TreeHomeAction
TreeHomeAction is used to handle end/home actions.
  BasicTreeUI.TreeToggleAction
For the first selected row expandedness will be toggled.
  BasicTreeUI.TreeCancelEditingAction
ActionListener that invokes cancelEditing when action performed.
  BasicTreeUI.MouseInputHandler
MouseInputHandler handles passing all mouse events, including mouse motion events, until the mouse is released to the destination it is constructed with.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar