Java Doc for BasicTreeUI.java in  » 6.0-JDK-Core » swing » javax » swing » plaf » basic » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » swing » javax.swing.plaf.basic 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.swing.plaf.ComponentUI
      javax.swing.plaf.TreeUI
         javax.swing.plaf.basic.BasicTreeUI

All known Subclasses:   javax.swing.plaf.synth.SynthTreeUI,  javax.swing.plaf.metal.MetalTreeUI,
BasicTreeUI
public class BasicTreeUI extends TreeUI (Code)
The basic L&F for a hierarchical data structure.


version:
   1.202 05/05/07
author:
   Scott Violet
author:
   Shannon Hickey (drag and drop)


Inner Class :public class TreeExpansionHandler implements TreeExpansionListener
Inner Class :public class ComponentHandler extends ComponentAdapter implements ActionListener
Inner Class :public class TreeModelHandler implements TreeModelListener
Inner Class :public class TreeSelectionHandler implements TreeSelectionListener
Inner Class :public class CellEditorHandler implements CellEditorListener
Inner Class :public class KeyHandler extends KeyAdapter
Inner Class :public class FocusHandler implements FocusListener
Inner Class :public class NodeDimensionsHandler extends AbstractLayoutCache.NodeDimensions
Inner Class :public class MouseHandler extends MouseAdapter implements MouseMotionListener
Inner Class :public class PropertyChangeHandler implements PropertyChangeListener
Inner Class :public class SelectionModelPropertyChangeHandler implements PropertyChangeListener
Inner Class :public class TreeTraverseAction extends AbstractAction
Inner Class :public class TreePageAction extends AbstractAction
Inner Class :public class TreeIncrementAction extends AbstractAction
Inner Class :public class TreeHomeAction extends AbstractAction
Inner Class :public class TreeToggleAction extends AbstractAction
Inner Class :public class TreeCancelEditingAction extends AbstractAction
Inner Class :public class MouseInputHandler extends Object implements MouseInputListener
Inner Class :static class TreeTransferHandler extends TransferHandler implements UIResource,Comparator

Field Summary
protected transient  TreeCellEditorcellEditor
     Editor for the tree.
protected transient  IconcollapsedIcon
    
protected  booleancreatedCellEditor
     Set to true if editor that is currently in the tree was created by this instance.
protected  booleancreatedRenderer
     Set to true if the renderer that is currently in the tree was created by this instance.
protected transient  TreeCellRenderercurrentCellRenderer
     Renderer that is being used to do the actual cell drawing.
protected  intdepthOffset
     How much the depth should be offset to properly calculate x locations.
protected  Hashtable<TreePath, Boolean>drawingCache
     Used for minimizing the drawing of vertical lines.
protected  ComponenteditingComponent
     When editing, this will be the Component that is doing the actual editing.
protected  TreePatheditingPath
     Path that is being edited.
protected  inteditingRow
     Row that is being edited.
protected  booleaneditorHasDifferentSize
     Set to true if the editor has a different size than the renderer.
protected transient  IconexpandedIcon
    
protected  booleanlargeModel
     True if doing optimizations for a largeModel.
protected  intlastSelectedRow
     Index of the row that was last selected.
protected  intleftChildIndent
     Distance between left margin and where vertical dashes will be drawn.
protected  AbstractLayoutCache.NodeDimensionsnodeDimensions
     Reponsible for telling the TreeState the size needed for a node.
protected  DimensionpreferredMinSize
     Minimum preferred size.
protected  DimensionpreferredSize
     Size needed to completely display all the nodes.
protected  CellRendererPanerendererPane
     Used to paint the TreeCellRenderer.
protected  intrightChildIndent
     Distance to add to leftChildIndent to determine where cell contents will be drawn.
protected  booleanstopEditingInCompleteEditing
     Set to false when editing and shouldSelectCell() returns true meaning the node should be selected before editing, used in completeEditing.
protected  inttotalChildIndent
     Total distance that will be indented.
protected  JTreetree
     Component that we're going to be drawing into.
protected  TreeModeltreeModel
     Used to determine what to display.
protected  TreeSelectionModeltreeSelectionModel
     Model maintaing the selection.
protected  AbstractLayoutCachetreeState
     Object responsible for handling sizing and expanded issues.
protected  booleanvalidCachedPreferredSize
    

Constructor Summary
public  BasicTreeUI()
    

Method Summary
public  voidcancelEditing(JTree tree)
     Cancels the current editing session.
protected  voidcheckForClickInExpandControl(TreePath path, int mouseX, int mouseY)
     If the mouseX and mouseY are in the expand/collapse region of the row, this will toggle the row.
protected  voidcompleteEditing()
     Messages to stop the editing session.
protected  voidcompleteEditing(boolean messageStop, boolean messageCancel, boolean messageTree)
     Stops the editing session.
protected  voidcompleteUIInstall()
     Invoked from installUI after all the defaults/listeners have been installed.
protected  voidcompleteUIUninstall()
    
protected  voidconfigureLayoutCache()
     Resets the TreeState instance based on the tree we're providing the look and feel for.
protected  CellEditorListenercreateCellEditorListener()
     Creates a listener to handle events from the current editor.
protected  CellRendererPanecreateCellRendererPane()
     Returns the renderer pane that renderer components are placed in.
protected  ComponentListenercreateComponentListener()
     Creates and returns a new ComponentHandler.
protected  TreeCellEditorcreateDefaultCellEditor()
     Creates a default cell editor.
protected  TreeCellRenderercreateDefaultCellRenderer()
     Returns the default cell renderer that is used to do the stamping of each node.
protected  FocusListenercreateFocusListener()
     Creates a listener that is responsible for updating the display when focus is lost/gained.
protected  KeyListenercreateKeyListener()
     Creates the listener reponsible for getting key events from the tree.
protected  AbstractLayoutCachecreateLayoutCache()
     Creates the object responsible for managing what is expanded, as well as the size of nodes.
protected  MouseListenercreateMouseListener()
     Creates the listener responsible for updating the selection based on mouse events.
protected  AbstractLayoutCache.NodeDimensionscreateNodeDimensions()
     Creates an instance of NodeDimensions that is able to determine the size of a given node in the tree.
protected  PropertyChangeListenercreatePropertyChangeListener()
     Creates a listener that is responsible that updates the UI based on how the tree changes.
protected  PropertyChangeListenercreateSelectionModelPropertyChangeListener()
     Creates the listener responsible for getting property change events from the selection model.
protected  TreeExpansionListenercreateTreeExpansionListener()
     Creates and returns the object responsible for updating the treestate when nodes expanded state changes.
protected  TreeModelListenercreateTreeModelListener()
     Returns a listener that can update the tree when the model changes.
protected  TreeSelectionListenercreateTreeSelectionListener()
     Creates the listener that updates the display based on selection change methods.
public static  ComponentUIcreateUI(JComponent x)
    
protected  voiddrawCentered(Component c, Graphics graphics, Icon icon, int x, int y)
    
protected  voiddrawDashedHorizontalLine(Graphics g, int y, int x1, int x2)
    
protected  voiddrawDashedVerticalLine(Graphics g, int x, int y1, int y2)
    
protected  voidensureRowsAreVisible(int beginRow, int endRow)
     Ensures that the rows identified by beginRow through endRow are visible.
public  intgetBaseline(JComponent c, int width, int height)
     Returns the baseline.
public  Component.BaselineResizeBehaviorgetBaselineResizeBehavior(JComponent c)
     Returns an enum indicating how the baseline of the component changes as the size changes.
protected  TreeCellEditorgetCellEditor()
    
protected  TreeCellRenderergetCellRenderer()
     Return currentCellRenderer, which will either be the trees renderer, or defaultCellRenderer, which ever wasn't null.
public  TreePathgetClosestPathForLocation(JTree tree, int x, int y)
     Returns the path to the node that is closest to x,y.
public  IcongetCollapsedIcon()
    
public  TreePathgetEditingPath(JTree tree)
     Returns the path to the element that is being edited.
public  IcongetExpandedIcon()
    
protected  ColorgetHashColor()
    
protected  intgetHorizontalLegBuffer()
     The horizontal element of legs between nodes starts at the right of the left-hand side of the child node by default.
 InputMapgetInputMap(int condition)
    
protected  TreePathgetLastChildPath(TreePath parent)
     Returns a path to the last child of parent.
public  intgetLeftChildIndent()
    
public  DimensiongetMaximumSize(JComponent c)
     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  DimensiongetMinimumSize(JComponent c)
     Returns the minimum size for this component.
protected  TreeModelgetModel()
    
public  RectanglegetPathBounds(JTree tree, TreePath path)
     Returns the Rectangle enclosing the label portion that the last item in path will be drawn into.
public  TreePathgetPathForRow(JTree tree, int row)
     Returns the path for passed in row.
public  DimensiongetPreferredMinSize()
     Returns the minimum preferred size.
public  DimensiongetPreferredSize(JComponent c)
     Returns the preferred size to properly display the tree, this is a cover method for getPreferredSize(c, false).
public  DimensiongetPreferredSize(JComponent c, boolean checkConsistancy)
     Returns the preferred size to represent the tree in c.
public  intgetRightChildIndent()
    
public  intgetRowCount(JTree tree)
     Returns the number of rows that are being displayed.
public  intgetRowForPath(JTree tree, TreePath path)
     Returns the row that the last item identified in path is visible at.
protected  intgetRowHeight()
    
protected  intgetRowX(int row, int depth)
     Returns the location, along the x-axis, to render a particular row at.
protected  TreeSelectionModelgetSelectionModel()
    
protected  booleangetShowsRootHandles()
    
protected  intgetVerticalLegBuffer()
     The vertical element of legs between nodes starts at the bottom of the parent node by default.
protected  voidhandleExpandControlClick(TreePath path, int mouseX, int mouseY)
     Messaged when the user clicks the particular row, this invokes toggleExpandState.
protected  voidinstallComponents()
     Intalls the subcomponents of the tree, which is the renderer pane.
protected  voidinstallDefaults()
    
protected  voidinstallKeyboardActions()
    
protected  voidinstallListeners()
    
public  voidinstallUI(JComponent c)
    
protected  booleanisEditable()
    
public  booleanisEditing(JTree tree)
     Returns true if the tree is being edited.
protected  booleanisLargeModel()
    
protected  booleanisLeaf(int row)
    
protected  booleanisLocationInExpandControl(TreePath path, int mouseX, int mouseY)
     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  booleanisMultiSelectEvent(MouseEvent event)
     Returning true signifies a mouse event on the node should select from the anchor point.
protected  booleanisRootVisible()
    
protected  booleanisToggleEvent(MouseEvent event)
     Returning true indicates the row under the mouse should be toggled based on the event.
protected  booleanisToggleSelectionEvent(MouseEvent event)
     Returning true signifies a mouse event on the node should toggle the selection of only the row under mouse.
static  voidloadActionMap(LazyActionMap map)
    
public  voidpaint(Graphics g, JComponent c)
    
protected  voidpaintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
     Paints the expand (toggle) part of a row.
protected  voidpaintHorizontalLine(Graphics g, JComponent c, int y, int left, int right)
     Paints a horizontal line.
protected  voidpaintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
     Paints the horizontal part of the leg.
protected  voidpaintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
     Paints the renderer part of a row.
protected  voidpaintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom)
     Paints a vertical line.
protected  voidpaintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
     Paints the vertical part of the leg.
protected  voidpathWasCollapsed(TreePath path)
     Messaged from the VisibleTreeNode after it has collapsed.
protected  voidpathWasExpanded(TreePath path)
     Messaged from the VisibleTreeNode after it has been expanded.
protected  voidprepareForUIInstall()
     Invoked after the tree instance variable has been set, but before any defaults/listeners have been installed.
protected  voidprepareForUIUninstall()
    
protected  voidselectPathForEvent(TreePath path, MouseEvent event)
     Messaged to update the selection based on a MouseEvent over a particular row.
protected  voidsetCellEditor(TreeCellEditor editor)
     Sets the cell editor.
protected  voidsetCellRenderer(TreeCellRenderer tcr)
     Sets the TreeCellRenderer to tcr.
public  voidsetCollapsedIcon(Icon newG)
    
protected  voidsetEditable(boolean newValue)
     Configures the receiver to allow, or not allow, editing.
public  voidsetExpandedIcon(Icon newG)
    
protected  voidsetHashColor(Color color)
    
protected  voidsetLargeModel(boolean largeModel)
     Updates the componentListener, if necessary.
public  voidsetLeftChildIndent(int newAmount)
    
protected  voidsetModel(TreeModel model)
     Sets the TreeModel.
public  voidsetPreferredMinSize(Dimension newSize)
     Sets the preferred minimum size.
public  voidsetRightChildIndent(int newAmount)
    
protected  voidsetRootVisible(boolean newValue)
     Sets the root to being visible.
protected  voidsetRowHeight(int rowHeight)
     Sets the row height, this is forwarded to the treeState.
protected  voidsetSelectionModel(TreeSelectionModel newLSM)
     Resets the selection model.
protected  voidsetShowsRootHandles(boolean newValue)
     Determines whether the node handles are to be displayed.
protected  booleanshouldPaintExpandControl(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
     Returns true if the expand (toggle) control should be drawn for the specified row.
protected  booleanstartEditing(TreePath path, MouseEvent event)
     Will start editing for node if there is a cellEditor and shouldSelectCell returns true.

This assumes that path is valid and visible.

public  voidstartEditingAtPath(JTree tree, TreePath path)
     Selects the last item in path and tries to edit it.
public  booleanstopEditing(JTree tree)
     Stops the current editing session.
protected  voidtoggleExpandState(TreePath path)
     Expands path if it is not expanded, or collapses row if it is expanded.
protected  voiduninstallComponents()
     Uninstalls the renderer pane.
protected  voiduninstallDefaults()
    
protected  voiduninstallKeyboardActions()
    
protected  voiduninstallListeners()
    
public  voiduninstallUI(JComponent c)
    
protected  voidupdateCachedPreferredSize()
     Updates the preferredSize instance variable, which is returned from getPreferredSize().

For left to right orientations, the size is determined from the current AbstractLayoutCache.

protected  voidupdateCellEditor()
     Updates the cellEditor based on the editability of the JTree that we're contained in.
protected  voidupdateDepthOffset()
     Updates how much each depth should be offset by.
protected  voidupdateExpandedDescendants(TreePath path)
     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  voidupdateLayoutCacheExpandedNodes()
     Makes all the nodes that are expanded in JTree expanded in LayoutCache.
protected  voidupdateRenderer()
     Messaged from the tree we're in when the renderer has changed.
protected  voidupdateSize()
     Marks the cached size as being invalid, and messages the tree with treeDidChange.

Field Detail
cellEditor
protected transient TreeCellEditor cellEditor(Code)
Editor for the tree.



collapsedIcon
protected transient Icon collapsedIcon(Code)



createdCellEditor
protected boolean createdCellEditor(Code)
Set to true if editor that is currently in the tree was created by this instance.



createdRenderer
protected boolean createdRenderer(Code)
Set to true if the renderer that is currently in the tree was created by this instance.



currentCellRenderer
protected transient TreeCellRenderer currentCellRenderer(Code)
Renderer that is being used to do the actual cell drawing.



depthOffset
protected int depthOffset(Code)
How much the depth should be offset to properly calculate x locations. This is based on whether or not the root is visible, and if the root handles are visible.



drawingCache
protected Hashtable<TreePath, Boolean> drawingCache(Code)
Used for minimizing the drawing of vertical lines.



editingComponent
protected Component editingComponent(Code)
When editing, this will be the Component that is doing the actual editing.



editingPath
protected TreePath editingPath(Code)
Path that is being edited.



editingRow
protected int editingRow(Code)
Row that is being edited. Should only be referenced if editingComponent is not null.



editorHasDifferentSize
protected boolean editorHasDifferentSize(Code)
Set to true if the editor has a different size than the renderer.



expandedIcon
protected transient Icon expandedIcon(Code)



largeModel
protected boolean largeModel(Code)
True if doing optimizations for a largeModel. Subclasses that don't support this may wish to override createLayoutCache to not return a FixedHeightLayoutCache instance.



lastSelectedRow
protected int lastSelectedRow(Code)
Index of the row that was last selected.



leftChildIndent
protected int leftChildIndent(Code)
Distance between left margin and where vertical dashes will be drawn.



nodeDimensions
protected AbstractLayoutCache.NodeDimensions nodeDimensions(Code)
Reponsible for telling the TreeState the size needed for a node.



preferredMinSize
protected Dimension preferredMinSize(Code)
Minimum preferred size.



preferredSize
protected Dimension preferredSize(Code)
Size needed to completely display all the nodes.



rendererPane
protected CellRendererPane rendererPane(Code)
Used to paint the TreeCellRenderer.



rightChildIndent
protected int rightChildIndent(Code)
Distance to add to leftChildIndent to determine where cell contents will be drawn.



stopEditingInCompleteEditing
protected boolean stopEditingInCompleteEditing(Code)
Set to false when editing and shouldSelectCell() returns true meaning the node should be selected before editing, used in completeEditing.



totalChildIndent
protected int totalChildIndent(Code)
Total distance that will be indented. The sum of leftChildIndent and rightChildIndent.



tree
protected JTree tree(Code)
Component that we're going to be drawing into.



treeModel
protected TreeModel treeModel(Code)
Used to determine what to display.



treeSelectionModel
protected TreeSelectionModel treeSelectionModel(Code)
Model maintaing the selection.



treeState
protected AbstractLayoutCache treeState(Code)
Object responsible for handling sizing and expanded issues.



validCachedPreferredSize
protected boolean validCachedPreferredSize(Code)
Is the preferredSize valid?




Constructor Detail
BasicTreeUI
public BasicTreeUI()(Code)




Method Detail
cancelEditing
public void cancelEditing(JTree tree)(Code)
Cancels the current editing session.



checkForClickInExpandControl
protected void checkForClickInExpandControl(TreePath path, int mouseX, int mouseY)(Code)
If the mouseX and mouseY are in the expand/collapse region of the row, this will toggle the row.



completeEditing
protected void completeEditing()(Code)
Messages to stop the editing session. If the UI the receiver is providing the look and feel for returns true from getInvokesStopCellEditing, stopCellEditing will invoked on the current editor. Then completeEditing will be messaged with false, true, false to cancel any lingering editing.



completeEditing
protected void completeEditing(boolean messageStop, boolean messageCancel, boolean messageTree)(Code)
Stops the editing session. If messageStop is true the editor is messaged with stopEditing, if messageCancel is true the editor is messaged with cancelEditing. If messageTree is true the treeModel is messaged with valueForPathChanged.



completeUIInstall
protected void completeUIInstall()(Code)
Invoked from installUI after all the defaults/listeners have been installed.



completeUIUninstall
protected void completeUIUninstall()(Code)



configureLayoutCache
protected void configureLayoutCache()(Code)
Resets the TreeState instance based on the tree we're providing the look and feel for.



createCellEditorListener
protected CellEditorListener createCellEditorListener()(Code)
Creates a listener to handle events from the current editor.



createCellRendererPane
protected CellRendererPane createCellRendererPane()(Code)
Returns the renderer pane that renderer components are placed in.



createComponentListener
protected ComponentListener createComponentListener()(Code)
Creates and returns a new ComponentHandler. This is used for the large model to mark the validCachedPreferredSize as invalid when the component moves.



createDefaultCellEditor
protected TreeCellEditor createDefaultCellEditor()(Code)
Creates a default cell editor.



createDefaultCellRenderer
protected TreeCellRenderer createDefaultCellRenderer()(Code)
Returns the default cell renderer that is used to do the stamping of each node.



createFocusListener
protected FocusListener createFocusListener()(Code)
Creates a listener that is responsible for updating the display when focus is lost/gained.



createKeyListener
protected KeyListener createKeyListener()(Code)
Creates the listener reponsible for getting key events from the tree.



createLayoutCache
protected AbstractLayoutCache createLayoutCache()(Code)
Creates the object responsible for managing what is expanded, as well as the size of nodes.



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



createNodeDimensions
protected AbstractLayoutCache.NodeDimensions createNodeDimensions()(Code)
Creates an instance of NodeDimensions that is able to determine the size of a given node in the tree.



createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener()(Code)
Creates a listener that is responsible that updates the UI based on how the tree changes.



createSelectionModelPropertyChangeListener
protected PropertyChangeListener createSelectionModelPropertyChangeListener()(Code)
Creates the listener responsible for getting property change events from the selection model.



createTreeExpansionListener
protected TreeExpansionListener createTreeExpansionListener()(Code)
Creates and returns the object responsible for updating the treestate when nodes expanded state changes.



createTreeModelListener
protected TreeModelListener createTreeModelListener()(Code)
Returns a listener that can update the tree when the model changes.



createTreeSelectionListener
protected TreeSelectionListener createTreeSelectionListener()(Code)
Creates the listener that updates the display based on selection change methods.



createUI
public static ComponentUI createUI(JComponent x)(Code)



drawCentered
protected void drawCentered(Component c, Graphics graphics, Icon icon, int x, int y)(Code)



drawDashedHorizontalLine
protected void drawDashedHorizontalLine(Graphics g, int y, int x1, int x2)(Code)



drawDashedVerticalLine
protected void drawDashedVerticalLine(Graphics g, int x, int y1, int y2)(Code)



ensureRowsAreVisible
protected void ensureRowsAreVisible(int beginRow, int endRow)(Code)
Ensures that the rows identified by beginRow through endRow are visible.



getBaseline
public int getBaseline(JComponent c, int width, int height)(Code)
Returns the baseline.
throws:
  NullPointerException -
throws:
  IllegalArgumentException -
See Also:   javax.swing.JComponent.getBaseline(intint)
since:
   1.6



getBaselineResizeBehavior
public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)(Code)
Returns an enum indicating how the baseline of the component changes as the size changes.
throws:
  NullPointerException -
See Also:   javax.swing.JComponent.getBaseline(intint)
since:
   1.6



getCellEditor
protected TreeCellEditor getCellEditor()(Code)



getCellRenderer
protected TreeCellRenderer getCellRenderer()(Code)
Return currentCellRenderer, which will either be the trees renderer, or defaultCellRenderer, which ever wasn't null.



getClosestPathForLocation
public TreePath getClosestPathForLocation(JTree tree, int x, int y)(Code)
Returns the path to the node that is closest to x,y. If there is nothing currently visible this will return null, otherwise it'll always return a valid path. If you need to test if the returned object is exactly at x, y you should get the bounds for the returned path and test x, y against that.



getCollapsedIcon
public Icon getCollapsedIcon()(Code)



getEditingPath
public TreePath getEditingPath(JTree tree)(Code)
Returns the path to the element that is being edited.



getExpandedIcon
public Icon getExpandedIcon()(Code)



getHashColor
protected Color getHashColor()(Code)



getHorizontalLegBuffer
protected int getHorizontalLegBuffer()(Code)
The horizontal element of legs between nodes starts at the right of the left-hand side of the child node by default. This method makes the leg end before that.



getInputMap
InputMap getInputMap(int condition)(Code)



getLastChildPath
protected TreePath getLastChildPath(TreePath parent)(Code)
Returns a path to the last child of parent.



getLeftChildIndent
public int getLeftChildIndent()(Code)



getMaximumSize
public Dimension getMaximumSize(JComponent c)(Code)
Returns the maximum size for this component, which will be the preferred size if the instance is currently in a JTree, or 0, 0.



getMinimumSize
public Dimension getMinimumSize(JComponent c)(Code)
Returns the minimum size for this component. Which will be the min preferred size or 0, 0.



getModel
protected TreeModel getModel()(Code)



getPathBounds
public Rectangle getPathBounds(JTree tree, TreePath path)(Code)
Returns the Rectangle enclosing the label portion that the last item in path will be drawn into. Will return null if any component in path is currently valid.



getPathForRow
public TreePath getPathForRow(JTree tree, int row)(Code)
Returns the path for passed in row. If row is not visible null is returned.



getPreferredMinSize
public Dimension getPreferredMinSize()(Code)
Returns the minimum preferred size.



getPreferredSize
public Dimension getPreferredSize(JComponent c)(Code)
Returns the preferred size to properly display the tree, this is a cover method for getPreferredSize(c, false).



getPreferredSize
public Dimension getPreferredSize(JComponent c, boolean checkConsistancy)(Code)
Returns the preferred size to represent the tree in c. If checkConsistancy is true checkConsistancy is messaged first.



getRightChildIndent
public int getRightChildIndent()(Code)



getRowCount
public int getRowCount(JTree tree)(Code)
Returns the number of rows that are being displayed.



getRowForPath
public int getRowForPath(JTree tree, TreePath path)(Code)
Returns the row that the last item identified in path is visible at. Will return -1 if any of the elements in path are not currently visible.



getRowHeight
protected int getRowHeight()(Code)



getRowX
protected int getRowX(int row, int depth)(Code)
Returns the location, along the x-axis, to render a particular row at. The return value does not include any Insets specified on the JTree. This does not check for the validity of the row or depth, it is assumed to be correct and will not throw an Exception if the row or depth doesn't match that of the tree.
Parameters:
  row - Row to return x location for
Parameters:
  depth - Depth of the row amount to indent the given row.
since:
   1.5



getSelectionModel
protected TreeSelectionModel getSelectionModel()(Code)



getShowsRootHandles
protected boolean getShowsRootHandles()(Code)



getVerticalLegBuffer
protected int getVerticalLegBuffer()(Code)
The vertical element of legs between nodes starts at the bottom of the parent node by default. This method makes the leg start below that.



handleExpandControlClick
protected void handleExpandControlClick(TreePath path, int mouseX, int mouseY)(Code)
Messaged when the user clicks the particular row, this invokes toggleExpandState.



installComponents
protected void installComponents()(Code)
Intalls the subcomponents of the tree, which is the renderer pane.



installDefaults
protected void installDefaults()(Code)



installKeyboardActions
protected void installKeyboardActions()(Code)



installListeners
protected void installListeners()(Code)



installUI
public void installUI(JComponent c)(Code)



isEditable
protected boolean isEditable()(Code)



isEditing
public boolean isEditing(JTree tree)(Code)
Returns true if the tree is being edited. The item that is being edited can be returned by getEditingPath().



isLargeModel
protected boolean isLargeModel()(Code)



isLeaf
protected boolean isLeaf(int row)(Code)
true if the node at row is a leaf.



isLocationInExpandControl
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY)(Code)
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.



isMultiSelectEvent
protected boolean isMultiSelectEvent(MouseEvent event)(Code)
Returning true signifies a mouse event on the node should select from the anchor point.



isRootVisible
protected boolean isRootVisible()(Code)



isToggleEvent
protected boolean isToggleEvent(MouseEvent event)(Code)
Returning true indicates the row under the mouse should be toggled based on the event. This is invoked after checkForClickInExpandControl, implying the location is not in the expand (toggle) control



isToggleSelectionEvent
protected boolean isToggleSelectionEvent(MouseEvent event)(Code)
Returning true signifies a mouse event on the node should toggle the selection of only the row under mouse.



loadActionMap
static void loadActionMap(LazyActionMap map)(Code)



paint
public void paint(Graphics g, JComponent c)(Code)



paintExpandControl
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)(Code)
Paints the expand (toggle) part of a row. The receiver should NOT modify clipBounds, or insets.



paintHorizontalLine
protected void paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right)(Code)
Paints a horizontal line.



paintHorizontalPartOfLeg
protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)(Code)
Paints the horizontal part of the leg. The receiver should NOT modify clipBounds, or insets.

NOTE: parentRow can be -1 if the root is not visible.




paintRow
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)(Code)
Paints the renderer part of a row. The receiver should NOT modify clipBounds, or insets.



paintVerticalLine
protected void paintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom)(Code)
Paints a vertical line.



paintVerticalPartOfLeg
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)(Code)
Paints the vertical part of the leg. The receiver should NOT modify clipBounds, insets.




pathWasCollapsed
protected void pathWasCollapsed(TreePath path)(Code)
Messaged from the VisibleTreeNode after it has collapsed.



pathWasExpanded
protected void pathWasExpanded(TreePath path)(Code)
Messaged from the VisibleTreeNode after it has been expanded.



prepareForUIInstall
protected void prepareForUIInstall()(Code)
Invoked after the tree instance variable has been set, but before any defaults/listeners have been installed.



prepareForUIUninstall
protected void prepareForUIUninstall()(Code)



selectPathForEvent
protected void selectPathForEvent(TreePath path, MouseEvent event)(Code)
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.



setCellEditor
protected void setCellEditor(TreeCellEditor editor)(Code)
Sets the cell editor.



setCellRenderer
protected void setCellRenderer(TreeCellRenderer tcr)(Code)
Sets the TreeCellRenderer to tcr. This invokes updateRenderer.



setCollapsedIcon
public void setCollapsedIcon(Icon newG)(Code)



setEditable
protected void setEditable(boolean newValue)(Code)
Configures the receiver to allow, or not allow, editing.



setExpandedIcon
public void setExpandedIcon(Icon newG)(Code)



setHashColor
protected void setHashColor(Color color)(Code)



setLargeModel
protected void setLargeModel(boolean largeModel)(Code)
Updates the componentListener, if necessary.



setLeftChildIndent
public void setLeftChildIndent(int newAmount)(Code)



setModel
protected void setModel(TreeModel model)(Code)
Sets the TreeModel.



setPreferredMinSize
public void setPreferredMinSize(Dimension newSize)(Code)
Sets the preferred minimum size.



setRightChildIndent
public void setRightChildIndent(int newAmount)(Code)



setRootVisible
protected void setRootVisible(boolean newValue)(Code)
Sets the root to being visible.



setRowHeight
protected void setRowHeight(int rowHeight)(Code)
Sets the row height, this is forwarded to the treeState.



setSelectionModel
protected void setSelectionModel(TreeSelectionModel newLSM)(Code)
Resets the selection model. The appropriate listener are installed on the model.



setShowsRootHandles
protected void setShowsRootHandles(boolean newValue)(Code)
Determines whether the node handles are to be displayed.



shouldPaintExpandControl
protected boolean shouldPaintExpandControl(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)(Code)
Returns true if the expand (toggle) control should be drawn for the specified row.



startEditing
protected boolean startEditing(TreePath path, MouseEvent event)(Code)
Will start editing for node if there is a cellEditor and shouldSelectCell returns true.

This assumes that path is valid and visible.




startEditingAtPath
public void startEditingAtPath(JTree tree, TreePath path)(Code)
Selects the last item in path and tries to edit it. Editing will fail if the CellEditor won't allow it for the selected item.



stopEditing
public boolean stopEditing(JTree tree)(Code)
Stops the current editing session. This has no effect if the tree isn't being edited. Returns true if the editor allows the editing session to stop.



toggleExpandState
protected void toggleExpandState(TreePath path)(Code)
Expands path if it is not expanded, or collapses row if it is expanded. If expanding a path and JTree scrolls on expand, ensureRowsAreVisible is invoked to scroll as many of the children to visible as possible (tries to scroll to last visible descendant of path).



uninstallComponents
protected void uninstallComponents()(Code)
Uninstalls the renderer pane.



uninstallDefaults
protected void uninstallDefaults()(Code)



uninstallKeyboardActions
protected void uninstallKeyboardActions()(Code)



uninstallListeners
protected void uninstallListeners()(Code)



uninstallUI
public void uninstallUI(JComponent c)(Code)



updateCachedPreferredSize
protected void updateCachedPreferredSize()(Code)
Updates the preferredSize instance variable, which is returned from getPreferredSize().

For left to right orientations, the size is determined from the current AbstractLayoutCache. For RTL orientations, the preferred size becomes the width minus the minimum x position.




updateCellEditor
protected void updateCellEditor()(Code)
Updates the cellEditor based on the editability of the JTree that we're contained in. If the tree is editable but doesn't have a cellEditor, a basic one will be used.



updateDepthOffset
protected void updateDepthOffset()(Code)
Updates how much each depth should be offset by.



updateExpandedDescendants
protected void updateExpandedDescendants(TreePath path)(Code)
Updates the expanded state of all the descendants of path by getting the expanded descendants from the tree and forwarding to the tree state.



updateLayoutCacheExpandedNodes
protected void updateLayoutCacheExpandedNodes()(Code)
Makes all the nodes that are expanded in JTree expanded in LayoutCache. This invokes updateExpandedDescendants with the root path.



updateRenderer
protected void updateRenderer()(Code)
Messaged from the tree we're in when the renderer has changed.



updateSize
protected void updateSize()(Code)
Marks the cached size as being invalid, and messages the tree with treeDidChange.



Methods inherited from javax.swing.plaf.TreeUI
abstract public void cancelEditing(JTree tree)(Code)(Java Doc)
abstract public TreePath getClosestPathForLocation(JTree tree, int x, int y)(Code)(Java Doc)
abstract public TreePath getEditingPath(JTree tree)(Code)(Java Doc)
abstract public Rectangle getPathBounds(JTree tree, TreePath path)(Code)(Java Doc)
abstract public TreePath getPathForRow(JTree tree, int row)(Code)(Java Doc)
abstract public int getRowCount(JTree tree)(Code)(Java Doc)
abstract public int getRowForPath(JTree tree, TreePath path)(Code)(Java Doc)
abstract public boolean isEditing(JTree tree)(Code)(Java Doc)
abstract public void startEditingAtPath(JTree tree, TreePath path)(Code)(Java Doc)
abstract public boolean stopEditing(JTree tree)(Code)(Java Doc)

Methods inherited from javax.swing.plaf.ComponentUI
public boolean contains(JComponent c, int x, int y)(Code)(Java Doc)
public static ComponentUI createUI(JComponent c)(Code)(Java Doc)
public Accessible getAccessibleChild(JComponent c, int i)(Code)(Java Doc)
public int getAccessibleChildrenCount(JComponent c)(Code)(Java Doc)
public int getBaseline(JComponent c, int width, int height)(Code)(Java Doc)
public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)(Code)(Java Doc)
public Dimension getMaximumSize(JComponent c)(Code)(Java Doc)
public Dimension getMinimumSize(JComponent c)(Code)(Java Doc)
public Dimension getPreferredSize(JComponent c)(Code)(Java Doc)
public void installUI(JComponent c)(Code)(Java Doc)
public void paint(Graphics g, JComponent c)(Code)(Java Doc)
public void uninstallUI(JComponent c)(Code)(Java Doc)
public void update(Graphics g, JComponent c)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.