3909N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * The basic L&F for a hierarchical data structure. 0N/A * @author Scott Violet 0N/A * @author Shannon Hickey (drag and drop) 0N/A // Old actions forward to an instance of this. 0N/A * Color used to draw hash marks. If <code>null</code> no hash marks 0N/A /** Distance between left margin and where vertical dashes will be 0N/A /** Distance to add to leftChildIndent to determine where cell 0N/A * contents will be drawn. */ 0N/A /** Total distance that will be indented. The sum of leftChildIndent 0N/A * and rightChildIndent. */ 0N/A /** Minimum preferred size. */ 0N/A /** Index of the row that was last selected. */ 0N/A /** Component that we're going to be drawing into. */ 0N/A /** Renderer that is being used to do the actual cell drawing. */ 0N/A /** Set to true if the renderer that is currently in the tree was 0N/A * created by this instance. */ 0N/A /** Editor for the tree. */ 0N/A /** Set to true if editor that is currently in the tree was 0N/A * created by this instance. */ 0N/A /** Set to false when editing and shouldSelectCell() returns true meaning 0N/A * the node should be selected before editing, used in completeEditing. */ 0N/A /** Used to paint the TreeCellRenderer. */ 0N/A /** Size needed to completely display all the nodes. */ 0N/A /** Is the preferredSize valid? */ 0N/A /** Object responsible for handling sizing and expanded issues. */ 0N/A // WARNING: Be careful with the bounds held by treeState. They are 0N/A // always in terms of left-to-right. They get mapped to right-to-left 0N/A // by the various methods of this class. 0N/A /** Used for minimizing the drawing of vertical lines. */ 0N/A /** True if doing optimizations for a largeModel. Subclasses that 0N/A * don't support this may wish to override createLayoutCache to not 0N/A * return a FixedHeightLayoutCache instance. */ 0N/A /** Reponsible for telling the TreeState the size needed for a node. */ 0N/A /** Used to determine what to display. */ 0N/A /** Model maintaing the selection. */ 0N/A /** How much the depth should be offset to properly calculate 0N/A * x locations. This is based on whether or not the root is visible, 0N/A * and if the root handles are visible. */ 0N/A // Following 4 ivars are only valid when editing. 0N/A /** When editing, this will be the Component that is doing the actual 0N/A /** Path that is being edited. */ 0N/A /** Row that is being edited. Should only be referenced if 0N/A * editingComponent is not null. */ 0N/A /** Set to true if the editor has a different size than the renderer. */ 0N/A /** Row correspondin to lead path. */ 0N/A /** If true, the property change event for LEAD_SELECTION_PATH_PROPERTY, 0N/A * or ANCHOR_SELECTION_PATH_PROPERTY will not generate a repaint. */ 0N/A /** Indicates the orientation. */ 0N/A * updates the validCachedPreferredSize bit accordingly. */ 0N/A /** Listens for CellEditor events. */ 0N/A /** Updates the display when the selection changes. */ 0N/A /** Is responsible for updating the display based on model events. */ 0N/A /** Updates the treestate as the nodes expand. */ 0N/A /** UI property indicating whether to paint lines */ 0N/A /** UI property for painting dashed lines */ 0N/A * The time factor to treate the series of typed alphanumeric key 0N/A * as prefix for first letter navigation. 0N/A * A temporary variable for communication between startEditingOnRelease 0N/A // Methods for configuring the behavior of the tree. None of them 0N/A // push the value to the JTree instance. You should really only 0N/A // call these methods on the JTree. 0N/A * Updates the componentListener, if necessary. 0N/A * Sets the row height, this is forwarded to the treeState. 0N/A * Sets the TreeCellRenderer to <code>tcr</code>. This invokes 0N/A * <code>updateRenderer</code>. 0N/A * Return currentCellRenderer, which will either be the trees 0N/A * renderer, or defaultCellRenderer, which ever wasn't null. 0N/A * Sets the TreeModel. 0N/A * Sets the root to being visible. 0N/A * Determines whether the node handles are to be displayed. 0N/A * Sets the cell editor. 0N/A * Configures the receiver to allow, or not allow, editing. 0N/A * Resets the selection model. The appropriate listener are installed 0N/A * Returns the Rectangle enclosing the label portion that the 0N/A * last item in path will be drawn into. Will return null if 0N/A * any component in path is currently valid. 0N/A * Returns the path for passed in row. If row is not visible 0N/A * Returns the row that the last item identified in path is visible 0N/A * at. Will return -1 if any of the elements in path are not 0N/A * currently visible. 0N/A * Returns the number of rows that are being displayed. 0N/A * Returns the path to the node that is closest to x,y. If 0N/A * there is nothing currently visible this will return null, otherwise 0N/A * it'll always return a valid path. If you need to test if the 0N/A * returned object is exactly at x, y you should get the bounds for 0N/A * the returned path and test x, y against that. 0N/A // TreeState doesn't care about the x location, hence it isn't 0N/A * Returns true if the tree is being edited. The item that is being 0N/A * edited can be returned by getEditingPath(). 0N/A * Stops the current editing session. This has no effect if the 0N/A * tree isn't being edited. Returns true if the editor allows the 0N/A * editing session to stop. 0N/A * Cancels the current editing session. 0N/A * Selects the last item in path and tries to edit it. Editing will 0N/A * fail if the CellEditor won't allow it for the selected item. 0N/A * Returns the path to the element that is being edited. 0N/A // Boilerplate install block 0N/A * Invoked after the <code>tree</code> instance variable has been 0N/A // Data member initializations 0N/A // Custom install code 0N/A // Create, if necessary, the TreeState instance. 0N/A // JTree's original row height is 16. To correctly display the 0N/A // contents on Linux we should have set it to 18, Windows 19 and 0N/A // Solaris 20. As these values vary so much it's too hard to 0N/A // be backward compatable and try to update the row height, we're 0N/A // therefor NOT going to adjust the row height based on font. If the 0N/A // developer changes the font, it's there responsibility to update 0N/A // default TransferHandler doesn't support drop 0N/A // so we don't want drop handling 0N/A "Tree.ancestorInputMap");
0N/A "Tree.focusInputMap");
0N/A "Tree.focusInputMap.RightToLeft")) ==
null)) {
0N/A * Intalls the subcomponents of the tree, which is the renderer pane. 0N/A * Creates an instance of NodeDimensions that is able to determine 0N/A * the size of a given node in the tree. 0N/A * Creates a listener that is responsible that updates the UI based on 0N/A * how the tree changes. 0N/A * Creates the listener responsible for updating the selection based on 0N/A * Creates a listener that is responsible for updating the display 0N/A * Creates the listener reponsible for getting key events from 0N/A * Creates the listener responsible for getting property change 0N/A * events from the selection model. 0N/A * Creates the listener that updates the display based on selection change 0N/A * Creates a listener to handle events from the current editor. 0N/A * Creates and returns a new ComponentHandler. This is used for 0N/A * the large model to mark the validCachedPreferredSize as invalid 0N/A * when the component moves. 0N/A * Creates and returns the object responsible for updating the treestate 0N/A * when nodes expanded state changes. 0N/A * Creates the object responsible for managing what is expanded, as 0N/A * well as the size of nodes. 0N/A * Returns the renderer pane that renderer components are placed in. 0N/A * Creates a default cell editor. 0N/A * Returns the default cell renderer that is used to do the 0N/A * stamping of each node. 0N/A * Returns a listener that can update the tree when the model changes. 0N/A // Uninstall methods 0N/A * Uninstalls the renderer pane. 0N/A * Recomputes the right margin, and invalidates any tree states 0N/A * Returns the baseline. 0N/A * @throws NullPointerException {@inheritDoc} 0N/A * @throws IllegalArgumentException {@inheritDoc} 0N/A * @see javax.swing.JComponent#getBaseline(int, int) 0N/A tree,
"a",
false,
false,
false, -
1,
false);
0N/A * Returns an enum indicating how the baseline of the component 0N/A * changes as the size changes. 0N/A * @throws NullPointerException {@inheritDoc} 0N/A * @see javax.swing.JComponent#getBaseline(int, int) 0N/A // Painting routines. 0N/A // Should never happen if installed for a UI 0N/A // Draw the lines, knobs, and rows 0N/A // Find each parent and have them draw a line to their last child 0N/A // Information for the node being rendered. 0N/A // This will only happen if the model changes out 0N/A // from under us (usually in another thread). 0N/A // Swing isn't multithreaded, but I'll put this 0N/A // See if the vertical line to the parent has been drawn. 0N/A // Empty out the renderer pane, allowing renderers to be gc'ed. 1999N/A * Tells if a {@code DropLocation} should be indicated by a line between 1999N/A * nodes. This is meant for {@code javax.swing.DropMode.INSERT} and 1999N/A * {@code javax.swing.DropMode.ON_OR_INSERT} drop modes. 1999N/A * @param loc a {@code DropLocation} 1999N/A * @return {@code true} if the drop location should be shown as a line 1999N/A * @param g {@code Graphics} object to draw on 1999N/A * Returns a ubounding box for the drop line. 1999N/A * @param loc a {@code DropLocation} 1999N/A * @return bounding box for the drop line 0N/A * Paints the horizontal part of the leg. The receiver should 0N/A * NOT modify <code>clipBounds</code>, or <code>insets</code>.<p> 0N/A * NOTE: <code>parentRow</code> can be -1 if the root is not visible. 0N/A // Don't paint the legs for the root'ish node if the 0N/A * Paints the vertical part of the leg. The receiver should 0N/A * NOT modify <code>clipBounds</code>, <code>insets</code>.<p> 0N/A // This shouldn't happen, but if the model is modified 0N/A // in another thread it is possible for this to happen. 0N/A // Swing isn't multithreaded, but I'll add this check in 0N/A * Paints the expand (toggle) part of a row. The receiver should 0N/A * NOT modify <code>clipBounds</code>, or <code>insets</code>. 0N/A // Draw icons if not a leaf and either hasn't been loaded, 0N/A // or the model child count is > 0. 0N/A * Paints the renderer part of a row. The receiver should 0N/A * NOT modify <code>clipBounds</code>, or <code>insets</code>. 0N/A // Don't paint the renderer if editing this row. 0N/A * Returns true if the expand (toggle) control should be drawn for 0N/A * the specified row. 0N/A * Paints a vertical line. 0N/A * Paints a horizontal line. 0N/A * The vertical element of legs between nodes starts at the bottom of the 0N/A * parent node by default. This method makes the leg start below that. 0N/A * The horizontal element of legs between nodes starts at the 0N/A * right of the left-hand side of the child node by default. This 0N/A * method makes the leg end before that. 0N/A // Generic painting methods 0N/A // Draws the icon centered at (x,y) 0N/A // This method is slow -- revisit when Java2D is ready. 0N/A // Drawing only even coordinates helps join line segments so they 0N/A // appear as one line. This can be defeated by translating the 0N/A // Graphics by an odd amount. 0N/A // This method is slow -- revisit when Java2D is ready. 0N/A // Drawing only even coordinates helps join line segments so they 0N/A // appear as one line. This can be defeated by translating the 0N/A // Graphics by an odd amount. 0N/A // Various local methods 0N/A * Returns the location, along the x-axis, to render a particular row 0N/A * at. The return value does not include any Insets specified on the JTree. 0N/A * This does not check for the validity of the row or depth, it is assumed 0N/A * to be correct and will not throw an Exception if the row or depth 0N/A * doesn't match that of the tree. 0N/A * @param row Row to return x location for 0N/A * @param depth Depth of the row 0N/A * @return amount to indent the given row. 0N/A * Makes all the nodes that are expanded in JTree expanded in LayoutCache. 0N/A * This invokes updateExpandedDescendants with the root path. 0N/A * Updates the expanded state of all the descendants of <code>path</code> 0N/A * by getting the expanded descendants from the tree and forwarding 0N/A * to the tree state. 0N/A * Returns a path to the last child of <code>parent</code>. 0N/A * Updates how much each depth should be offset by. 0N/A * Updates the cellEditor based on the editability of the JTree that 0N/A * we're contained in. If the tree is editable but doesn't have a 0N/A * cellEditor, a basic one will be used. 0N/A * Messaged from the tree we're in when the renderer has changed. 0N/A * Resets the TreeState instance based on the tree we're providing the 0N/A * look and feel for. 0N/A // Only do this if necessary, may loss state if call with 0N/A // same model as it currently has. 0N/A // Create a listener to update preferred size when bounds 0N/A // changes, if necessary. 0N/A * Marks the cached size as being invalid, and messages the 0N/A * tree with <code>treeDidChange</code>. 0N/A * Updates the <code>preferredSize</code> instance variable, 0N/A * which is returned from <code>getPreferredSize()</code>.<p> 0N/A * For left to right orientations, the size is determined from the 0N/A * current AbstractLayoutCache. For RTL orientations, the preferred size 0N/A * becomes the width minus the minimum x position. 0N/A // The tree doesn't have a valid bounds yet. Calculate 0N/A // based on visible row count. 5659N/A // we should consider a non-visible area above 0N/A * Messaged from the VisibleTreeNode after it has been expanded. 0N/A * Messaged from the VisibleTreeNode after it has collapsed. 0N/A * Ensures that the rows identified by beginRow through endRow are 0N/A "Tree.scrollsHorizontallyAndVertically",
false);
0N/A /** Sets the preferred minimum size. 0N/A /** Returns the minimum preferred size. 0N/A /** Returns the preferred size to properly display the tree, 3557N/A * this is a cover method for getPreferredSize(c, true). 0N/A /** Returns the preferred size to represent the tree in 3557N/A * <I>c</I>. If <I>checkConsistency</I> is true 3557N/A * <b>checkConsistency</b> is messaged first. 0N/A * Returns the minimum size for this component. Which will be 0N/A * the min preferred size or 0, 0. 0N/A * Returns the maximum size for this component, which will be the 0N/A * preferred size if the instance is currently in a JTree, or 0, 0. 0N/A * Messages to stop the editing session. If the UI the receiver 0N/A * is providing the look and feel for returns true from 0N/A * <code>getInvokesStopCellEditing</code>, stopCellEditing will 0N/A * invoked on the current editor. Then completeEditing will 0N/A * be messaged with false, true, false to cancel any lingering 0N/A /* If should invoke stopCellEditing, try that */ 0N/A /* Invoke cancelCellEditing, this will do nothing if stopCellEditing 0N/A * Stops the editing session. If messageStop is true the editor 0N/A * is messaged with stopEditing, if messageCancel is true the 0N/A * editor is messaged with cancelEditing. If messageTree is true 0N/A * the treeModel is messaged with valueForPathChanged. 0N/A // cover method for startEditing that allows us to pass extra 0N/A // information into that method via a class variable 0N/A * Will start editing for node if there is a cellEditor and 0N/A * shouldSelectCell returns true.<p> 0N/A * This assumes that path is valid and visible. 0N/A // Only allow odd heights if explicitly set. 0N/A // Editor wants different width or height, invalidate 0N/A // treeState and relayout. 0N/A // To make sure x/y are updated correctly, fetch 0N/A // the bounds again. 0N/A /* Find the component that will get forwarded all the 0N/A mouse events until mouseReleased. */ 0N/A /* Create an instance of BasicTreeMouseListener to handle 0N/A // We really want similar behavior to getMouseEventTarget, 0N/A // but it is package private. 0N/A // Following are primarily for handling mouse events. 0N/A * If the <code>mouseX</code> and <code>mouseY</code> are in the 0N/A * Returns true if <code>mouseX</code> and <code>mouseY</code> fall 0N/A * the node at <code>row</code> does not represent a leaf. 0N/A * Messaged when the user clicks the particular row, this invokes 0N/A * toggleExpandState. 0N/A * Expands path if it is not expanded, or collapses row if it is expanded. 0N/A * If expanding a path and JTree scrolls on expand, ensureRowsAreVisible 0N/A * is invoked to scroll as many of the children to visible as possible 0N/A * (tries to scroll to last visible descendant of path). 0N/A * Returning true signifies a mouse event on the node should toggle 0N/A * the selection of only the row under mouse. 0N/A * Returning true signifies a mouse event on the node should select 0N/A * from the anchor point. 0N/A * Returning true indicates the row under the mouse should be toggled 0N/A * based on the event. This is invoked after checkForClickInExpandControl, 0N/A * implying the location is not in the expand (toggle) control 0N/A * Messaged to update the selection based on a MouseEvent over a 0N/A * particular row. If the event is a toggle selection event, the 0N/A * row is either selected, or deselected. If the event identifies 0N/A * a multi selection event, the selection is updated from the 0N/A * anchor point. Otherwise the row is selected, and if the event 0N/A /* Adjust from the anchor point. */ 0N/A // Should this event toggle the selection of this row? 0N/A /* Control toggles just this node. */ 0N/A /* Otherwise set the selection to just this interval. */ 0N/A * @return true if the node at <code>row</code> is a leaf. 0N/A // Have to return something here... 0N/A // The following selection methods (lead/anchor) are covers for the 0N/A // methods in JTree. 1999N/A * Updates the lead row of the selection. 1999N/A * Returns the lead row of the selection. 1999N/A * @return selection lead row 0N/A * Extends the selection from the anchor to make <code>newLead</code> 0N/A * the lead of the selection. This does not scroll. 0N/A * Invokes <code>repaint</code> on the JTree for the passed in TreePath, 0N/A * <code>path</code>. 0N/A // NOTE: This class exists only for backward compatability. All 0N/A // its functionality has been moved into Handler. If you need to add 0N/A // new functionality add it to the Handler, but make sure this 0N/A // class calls into the Handler. 0N/A * Called whenever an item in the tree has been expanded. 0N/A * Called whenever an item in the tree has been collapsed. 0N/A }
// BasicTreeUI.TreeExpansionHandler 0N/A * Updates the preferred size when scrolling (if necessary). 0N/A /** Timer used when inside a scrollpane and the scrollbar is 0N/A /** ScrollBar that is being adjusted. */ 0N/A // Try the horizontal scrollbar. 0N/A * Creates, if necessary, and starts a Timer to check if need to 0N/A * resize the bounds. 0N/A * Returns the JScrollPane housing the JTree, or null if one isn't 0N/A * Public as a result of Timer. If the scrollBar is null, or 0N/A * not adjusting, this stops the timer and updates the sizing. 0N/A }
// End of BasicTreeUI.ComponentHandler 0N/A * Forwards all TreeModel events to the TreeState. 0N/A // NOTE: This class exists only for backward compatability. All 0N/A // its functionality has been moved into Handler. If you need to add 0N/A // new functionality add it to the Handler, but make sure this 0N/A // class calls into the Handler. 0N/A }
// End of BasicTreeUI.TreeModelHandler 0N/A * Listens for changes in the selection model and updates the display 0N/A // NOTE: This class exists only for backward compatability. All 0N/A // its functionality has been moved into Handler. If you need to add 0N/A // new functionality add it to the Handler, but make sure this 0N/A // class calls into the Handler. 0N/A * Messaged when the selection changes in the tree we're displaying 0N/A * for. Stops editing, messages super and displays the changed paths. 0N/A }
// End of BasicTreeUI.TreeSelectionHandler 0N/A * Listener responsible for getting cell editing events and updating 0N/A * the tree accordingly. 0N/A // NOTE: This class exists only for backward compatability. All 0N/A // its functionality has been moved into Handler. If you need to add 0N/A // new functionality add it to the Handler, but make sure this 0N/A // class calls into the Handler. 0N/A /** Messaged when editing has stopped in the tree. */ 0N/A /** Messaged when editing has been canceled in the tree. */ 0N/A }
// BasicTreeUI.CellEditorHandler 0N/A * This is used to get mutliple key down events to appropriately generate 0N/A // NOTE: This class exists only for backward compatability. All 0N/A // its functionality has been moved into Handler. If you need to add 0N/A // new functionality add it to the Handler, but make sure this 0N/A // class calls into the Handler. 0N/A // Also note these fields aren't use anymore, nor does Handler have 0N/A // the old functionality. This behavior worked around an old bug 0N/A // in JComponent that has long since been fixed. 0N/A /** Key code that is being generated for. */ 0N/A /** Set to true while keyPressed is active. */ 0N/A * Invoked when a key has been typed. 0N/A * Moves the keyboard focus to the first element 0N/A * whose first letter matches the alphanumeric key 0N/A * pressed by the user. Subsequent same key presses 0N/A * move the keyboard focus to the next object that 0N/A * starts with the same letter. 0N/A }
// End of BasicTreeUI.KeyHandler 0N/A // NOTE: This class exists only for backward compatability. All 0N/A // its functionality has been moved into Handler. If you need to add 0N/A // new functionality add it to the Handler, but make sure this 0N/A // class calls into the Handler. 0N/A * Invoked when focus is activated on the tree we're in, redraws the 0N/A * Invoked when focus is activated on the tree we're in, redraws the 0N/A }
// End of class BasicTreeUI.FocusHandler 0N/A * Class responsible for getting size of node, method is forwarded 0N/A * to BasicTreeUI method. X location does not include insets, that is 0N/A * handled in getPathBounds. 0N/A // This returns locations that don't include any Insets. 0N/A * Responsible for getting the size of a particular node. 0N/A // Return size of editing component, if editing and asking 0N/A // Not editing, use renderer. 0N/A // Only ever removed when UI changes, this is OK! 0N/A * @return amount to indent the given row. 0N/A }
// End of class BasicTreeUI.NodeDimensionsHandler 0N/A * TreeMouseListener is responsible for updating the selection 0N/A * based on mouse events. 0N/A // NOTE: This class exists only for backward compatability. All 0N/A // its functionality has been moved into Handler. If you need to add 0N/A // new functionality add it to the Handler, but make sure this 0N/A // class calls into the Handler. 0N/A * Invoked when a mouse button has been pressed on a component. 0N/A * Invoked when the mouse button has been moved on a component 0N/A * (with no buttons no down). 0N/A }
// End of BasicTreeUI.MouseHandler 0N/A * PropertyChangeListener for the tree. Updates the appropriate 0N/A * varaible, or TreeState, based on what changes. 0N/A // NOTE: This class exists only for backward compatability. All 0N/A // its functionality has been moved into Handler. If you need to add 0N/A // new functionality add it to the Handler, but make sure this 0N/A // class calls into the Handler. 0N/A }
// End of BasicTreeUI.PropertyChangeHandler 0N/A * Listener on the TreeSelectionModel, resets the row selection if 0N/A * any of the properties of the model change. 0N/A // NOTE: This class exists only for backward compatability. All 0N/A // its functionality has been moved into Handler. If you need to add 0N/A // new functionality add it to the Handler, but make sure this 0N/A // class calls into the Handler. 0N/A }
// End of BasicTreeUI.SelectionModelPropertyChangeHandler 0N/A * <code>TreeTraverseAction</code> is the action used for left/right keys. 0N/A * Will toggle the expandedness of a node, as well as potentially 0N/A * incrementing the selection. 0N/A /** Determines direction to traverse, 1 means expand, -1 means 0N/A /** True if the selection is reset, false means only the lead path 0N/A }
// BasicTreeUI.TreeTraverseAction 0N/A /** TreePageAction handles page up and page down events. 0N/A /** Specifies the direction to adjust the selection by. */ 0N/A /** True indicates should set selection from anchor path. */ 0N/A }
// BasicTreeUI.TreePageAction 0N/A /** TreeIncrementAction is used to handle up/down actions. Selection 0N/A * is moved up or down based on direction. 0N/A /** Specifies the direction to adjust the selection by. */ 0N/A /** If true the new item is added to the selection, if false the 0N/A * selection is reset. */ 0N/A }
// End of class BasicTreeUI.TreeIncrementAction 0N/A * TreeHomeAction is used to handle end/home actions. 0N/A * Scrolls either the first or last cell to be visible based on 0N/A /** Set to true if append to selection. */ 0N/A }
// End of class BasicTreeUI.TreeHomeAction 0N/A * For the first selected row expandedness will be toggled. 0N/A }
// End of class BasicTreeUI.TreeToggleAction 0N/A * ActionListener that invokes cancelEditing when action performed. 0N/A }
// End of class BasicTreeUI.TreeCancelEditingAction 0N/A * MouseInputHandler handles passing all mouse events, 0N/A * including mouse motion events, until the mouse is released to 0N/A * the destination it is constructed with. It is assumed all the 0N/A * events are currently target at source. 0N/A /** Source that events are coming from. */ 0N/A /** Destination that receives all events. */ 0N/A /* Dispatch the editing event! */ 0N/A }
// End of class BasicTreeUI.MouseInputHandler 0N/A * Create a Transferable to use as the source for a data transfer. 0N/A * @param c The component holding the data to be transfered. This 0N/A * argument is provided to enable sharing of TransferHandlers by 0N/A * multiple components. 0N/A * @return The representation of the data to be transfered. 0N/A // remove the last newline 0N/A * Selection paths are in selection order. The conversion to 0N/A * HTML requires display order. This method resorts the paths 0N/A * to be in the display order. 0N/A // sort the paths to display order rather than selection order 0N/A for (
int i =
0; i < n; i++) {
0N/A * Invoked when a key has been typed. 0N/A * Moves the keyboard focus to the first element whose prefix matches the 0N/A * sequence of alphanumeric keys pressed by the user with delay less 0N/A * than value of <code>timeFactor</code> property (or 1000 milliseconds 0N/A * if it is not defined). Subsequent same key presses move the keyboard 0N/A * focus to the next object that starts with the same letter until another 0N/A * key is pressed, then it is treated as the prefix with appropriate number 0N/A * of the same letters followed by first typed another letter. 0N/A // handle first letter navigation 0N/A // Subsequent same key presses move the keyboard focus to the next 0N/A // object that starts with the same letter. 0N/A * Invoked when a key has been pressed. 0N/A * Checks to see if the key event is a navigation key to prevent 0N/A * dispatching these keys for the first letter navigation. 0N/A * Returns whether or not the supplied key event maps to a key that is used for 0N/A * navigation. This is used for optimizing key input by only passing non- 0N/A * navigation keys to the first letter navigation mechanism. 0N/A // PropertyChangeListener 0N/A // Whether or not the mouse press (which is being considered as part 0N/A // of a drag sequence) also caused the selection change to be fully 0N/A // Set to true when a drag gesture has been fully recognized and DnD 0N/A // begins. Use this to ignore further mouse events which could be 0N/A // delivered if DnD is cancelled (via ESCAPE for example) 0N/A // The path over which the press occurred and the press event itself 0N/A // Used to detect whether the press event causes a selection change. 0N/A // If it does, we won't try to start editing on the release. 0N/A * Invoked when a mouse button has been pressed on a component. 0N/A // if we can't stop any ongoing editing, do nothing 0N/A // if we have a valid path and this is a drag initiating event 0N/A // do nothing for control - will be handled on release 0N/A // or when drag starts 0N/A // clicking on something that's already selected 0N/A // and need to make it the lead now 0N/A // could be a drag initiating event - don't grab focus 0N/A // Preferably checkForClickInExpandControl could take 0N/A // the Event to do this it self! 0N/A // Perhaps they clicked the cell itself. If so, 0N/A * Invoked when the mouse button has been moved on a component 0N/A * (with no buttons no down). 0N/A // Note: We don't give the tree a chance to start editing if the 0N/A // mouse press caused a selection change. Otherwise the default 0N/A // tree cell editor will start editing on EVERY press and 0N/A // release. If it turns out that this affects some editors, we 0N/A // can always parameterize this with a client property. ex: 0N/A // if (pressedPath != null && 0N/A // (Boolean.TRUE == tree.getClientProperty("Tree.DnD.canEditOnValueChange") || 0N/A // !valueChangedOnPress) && ... 0N/A // CellEditorListener 0N/A /** Messaged when editing has been canceled in the tree. */ 0N/A // TreeSelectionListener 0N/A // Make sure all the paths are visible, if necessary. 0N/A // PENDING: This should be tweaked when isAdjusting is added 0N/A // Indicates this path isn't valid anymore, 0N/A // we shouldn't attempt to expand it then. 0N/A // TreeExpansionListener 0N/A // TreeModelListener 0N/A // The root has changed 0N/A // Changed nodes are visible 0N/A // Find the minimum index, we only need paint from there 0N/A // Forward to the treestate 0N/A // Mark preferred size as bogus. 0N/A // Nodes that changed aren't visible. No need to paint 0N/A // PENDING(sky): Need a method in TreeModelEvent 0N/A // that can return the count, getChildIndices allocs 0N/A "selectPreviousChangeLead";
0N/A "selectPreviousExtendSelection";
0N/A "selectNextChangeLead";
0N/A "selectNextExtendSelection";
0N/A "selectChildChangeLead";
0N/A "selectParentChangeLead";
0N/A "scrollUpChangeSelection";
0N/A "scrollUpChangeLead";
0N/A "scrollUpExtendSelection";
0N/A "scrollDownChangeSelection";
0N/A "scrollDownExtendSelection";
0N/A "scrollDownChangeLead";
0N/A "selectFirstChangeLead";
0N/A "selectFirstExtendSelection";
0N/A "selectLastChangeLead";
0N/A "selectLastExtendSelection";
0N/A "scrollLeftExtendSelection";
0N/A "scrollRightExtendSelection";
0N/A "scrollRightChangeLead";
0N/A "scrollLeftChangeLead";
0N/A "moveSelectionToParent";
0N/A // add the lead item to the selection without changing lead or anchor 0N/A // toggle the selected state of the lead item and move the anchor to it 0N/A // extend the selection to the lead item 0N/A // move the anchor to the lead and ensure only that item is selected 0N/A // disable moving of lead unless in discontiguous mode 0N/A /* Aparently people don't like wrapping;( */ 0N/A // disable moving of lead unless in discontiguous mode 0N/A /* Try and expand the node, otherwise go to next 0N/A /* Try to collapse node. */ 0N/A // disable moving of lead unless in discontiguous mode 0N/A // disable moving of lead unless in discontiguous mode 0N/A}
// End of class BasicTreeUI