summaryrefslogtreecommitdiff
path: root/javax/swing/plaf/basic/BasicTreeUI.java
Commit message (Collapse)AuthorAgeFilesLines
* 2006-08-16 Roman Kennke <kennke@aicas.com>Roman Kennke2006-08-161-102/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 28750 * javax/swing/plaf/basic/BasicTreeUI.java (CellEditorHandler.editingCancelled): Call completeEditing directly. (CellEditorHandler.editingStopped): Call completeEditing directly. (NodeDimensionHandler.getNodeDimensions): Rewritten to use the preferred sizes of the renderer and editor. (TreeExpansionHandler.treeCollapsed): Complete editing here. (TreeSelectionHandler.valueChanged): Complete editing here. (cancelEditing): Call completeEditing with false, false and false. Don't call finish (removed method). (completeEditing(boolean,boolean,boolean): Only do something when stopEditingInCompleteEditing is true. Nullify editingComponent and editingPath. Remove editingComponent from tree. Update the layout when necessary and repaint. (completeEditing): Stop editing when necessary. (editorRequestFocus): New helper method. Request focus on the actual editor. (finish) Removed. This is now done in completeEditing(). (prepareForUIInstall): Set stopEditingInCompleteEditing to true. (setLargeModel): Complete editing here. (setRootVisible): Complete editing here. (setRowHeight): Complete editing here. (setSelectionModel): Complete editing here. (startEditing): Correctly initialize and start editing. (updateExpandedDescendants): Complete editing here. * javax/swing/tree/DefaultTreeCellEditor.java (DefaultTextField): Fetch size from super and use renderer's height if appropriate. (EditorContainer.EditorContainer): Set layout to null, just to make sure. (EditorContainer.doLayout): Layout so that the editor is offset to the right of the icon. (EditorContainer.getPreferredSize): Implemented to provide a reasonable preferred size. (EditorContainer.paint): Position icon in the middle. Also paint border if appropriate. (EditorContainer.setBounds): Removed. (RealEditorListener): Removed. (DefaultTreeCellEditor): Set correct border. (cancelCellEditing): Message real editor. Call finish(). (createCellEditor): Don't add listener. (determineOffset): Correctly determine offset, and update the icon. (finish): New helper method. (getTreeCellEditorComponent): Set correct font. Call prepareForEditing() and determineOffset() to correctly initialize the state. (stopCellEditing): Messsage realEditor to stop editing. Call finish to clean up. (stopEditingTimer): Removed. (valueChanged): Correctly reset lastPath. * javax/swing/tree/DefaultTreeCellRenderer.java (getPreferredSize): Return super plus some extra space for better readability.
* 2006-08-15 Roman Kennke <kennke@aicas.com>Roman Kennke2006-08-151-118/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTreeUI.java (MouseHandler.selectedOnPress): New field. (MouseHandler.handleEvent): New helper method for handling selection and start/stop editing for mouse events. (MouseHandler.mouseDragged): Commented as no-op method. (MouseHandler.mouseMoved): Commented as no-op method. (MouseHandler.mousePressed): Use handleEvent() to handle selection and editing handling. (MouseHandler.mouseReleased): Use handleEvent() to handle selection and editing handling. (MouseInputHandler.MouseInputHandler): Register itself as mouse listener on source. Redispatch event to destination. (MouseInputHandler.dispatch): New helper method. (MouseInputHandler.mouseClicked): Dispatch event. (MouseInputHandler.mouseDragged): Dispatch event. (MouseInputHandler.mouseEntered): Stop dispatching if dragging stopped. (MouseInputHandler.mouseExited): Stop dispatching if dragging stopped. (MouseInputHandler.mouseMoved): Stop dispatching. (MouseInputHandler.mousePressed): Marked as no-op. (MouseInputHandler.mouseReleased): Dispatch and stop dispatching afterwards. (MouseInputHandler.removeFromSource): Implemented. (PropertyChangeHandler.propertyChange): Also handle editable property changes by calling setEditable(). (SelectionModelPropertyChangeHandler.propertyChange): Reset row selection. (startEditTimer): Removed. (setCellEditor): Call updateEditor(). (setEditable): Call updateEditor(). (startEditingAtPath): Make path fully visible before starting editing. (startEditing): Maybe cancel previous edit session. Add editing component itself, not its parent container. Register MouseInputHandler for correctly redispatching initial events. (stopEditing): Message cellEditor and only completeEditing() when approved by cell editor. (updateCellEditor): Complete editing before updating the cell editor. Get cell editor from JTree if possible, otherwise create default editor. Update the listeners on the editor. * javax/swing/tree/DefaultTreeCellEditor.java (CLICK_COUNT_TO_START): Removed. (DefaultTreeCellEditor): Install correct border. Let setTree() update the listeners. Don't initialize lastPath and font yet. (actionPerformed): Implemented to start editing. (createTreeCellEditor): Set click count to start to 1, rather than 3. (isCellEditable): Prepare editor here. Determine if we can start immediately, or if we trigger a timer to do so. (prepareForEditing): Don't removeAll() (not necessary), check editingComponent to be non-null. (setTree): Update listeners. (shouldStartEditingTimer): Check for left mouse button. (startEditingTimer): Lazily create timer.
* 2006-08-05 Roman Kennke <kennke@aicas.com>Roman Kennke2006-08-081-97/+3
| | | | | | | | | | | | | | | | PR 28650 * javax/swing/plaf/basic/BasicMenuBarUI.java (getActionMap): Store ActionMap in MenuBar.actionMap, rather than Tree.actionMap. * javax/swing/plaf/basic/BasicTreeUI.java (action): Removed obsolete field. (uninstallKeyboardActions): Removed action field handling. (installKeyboardActions): Removed action field handling. (createDefaultActions): Don't install removed TreeAction. (TreeAction): Removed obsolete inner class. (ActionListenerProxy): Removed obsolete inner class. (MouseHandler.mousePressed): Request focus on JTree component on mouse press.
* 2006-07-31 Roman Kennke <kennke@aicas.com>Roman Kennke2006-08-011-5/+31
| | | | | | | | | | | | | PR 28534 * javax/swing/JTree.java (JTree(TreeModel)): Set cell renderer to null. * javax/swing/plaf/basic/BasicTreeUI.java (setCellRenderer): Finish editing before setting the cell renderer. Refresh the layout. Don't set the currentCellRenderer field here (that's done in updateRenderer). (updateRenderer): Handle createdRenderer field here too. Set renderer to a default handler when the current renderer in the JTree is null.
* 2006-07-04 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-07-041-6/+44
| | | | * javax/swing/plaf/basic/BasicTreeUI.java (KeyHandler): Implemented.
* 2006-07-04 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-07-041-4/+21
| | | | | | | | PR 28061 * javax/swing/plaf/basic/BasicTreeUI.java (isLocationInExpandControl): Mind the effect of the root visibility on the position of the control. Quess icon width 18. (paintVerticalPartOfLeg): Do no paint the vertical line over first level nodes.
* 2006-07-04 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-07-041-0/+5
| | | | | | | | | | | | PR 28061 * gnu/javax/swing/plaf/gnu/GNULookAndFeel.java (getDefaults): Set hash color to black. * javax/swing/plaf/basic/BasicLookAndFeel.java (initComponentDefaults): Set hash color to grey blue. * javax/swing/plaf/basic/BasicTreeUI.java (instellDefaults): Set hash color. * javax/swing/plaf/metal/MetalIconFactory.java (TreeControlIcon.paint): Rewritten.
* 2006-07-04 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-07-041-5/+19
| | | | | | | | | | PR 28061 * javax/swing/plaf/basic/BasicTreeUI.java (MouseHandler.mousePressed): Always cancel the current editing session before doing anything else, return immediately if this fails. (TreeHomeAction): Ensure that the lead selection path is visible after the action is performed. TreeIncrementAction: Likewise. TreeToggleAction: Likewise. TreeTraverseAction: Likewise.
* 2006-07-04 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-07-041-5/+85
| | | | | | | | | | | | | PR 28061 * javax/swing/plaf/basic/BasicTreeUI.java (MouseHandler.mousePressed): Returned back the code to handle the start of the click-pause-click editing initiation, explained about this code. (TreeStartEditingAction): New inner class. (stopEditingInCompleteEditing): Explained about this field. (completeEditing(boolean, boolean, boolean): Only return early if there is no current editing session. (createDefaultActions): Install TreeStartEditingAction and TreeCancelEditingAction.
* 2006-07-04 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-07-031-3/+4
| | | | | | | | | | PR 28061 * javax/swing/JTree.java (COLLAPSED): Initialise to Boolean.FALSE. (EXPANDED): Initialise to Boolean.TRUE. * javax/swing/plaf/basic/BasicTreeUI.java (completeUIInstall): First configure layout cache and then set the assigned value as row mapper. Set the root visibility property. (toggleExpandState): Obtains expansion state from the layout cache.
* 2006-06-13 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-06-131-26/+26
| | | | | | | | | | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicCheckBoxUI.java: Source code formatting changes only, * javax/swing/plaf/basic/BasicComboBoxUI.java: Likewise, * javax/swing/plaf/basic/BasicComboPopup.java: Likewise, * javax/swing/plaf/basic/BasicFileChooserUI.java: Likewise, * javax/swing/plaf/basic/BasicInternalFrameUI.java: Likewise, * javax/swing/plaf/basic/BasicLookAndFeel.java: Likewise, * javax/swing/plaf/basic/BasicMenuItemUI.java: Likewise, * javax/swing/plaf/basic/BasicOptionPaneUI.java: Likewise, * javax/swing/plaf/basic/BasicProgressBarUI.java: Likewise, * javax/swing/plaf/basic/BasicRadioButtonUI.java: Likewise, * javax/swing/plaf/basic/BasicScrollBarUI.java: Likewise, * javax/swing/plaf/basic/BasicSliderUI.java: Likewise, * javax/swing/plaf/basic/BasicTableHeaderUI.java: Likewise, * javax/swing/plaf/basic/BasicTableUI.java: Likewise, * javax/swing/plaf/basic/BasicTextUI.java: Likewise, * javax/swing/plaf/basic/BasicToolBarUI.java: Likewise, * javax/swing/plaf/basic/BasicTreeUI.java: Likewise. ----------------------------------------------------------------------
* 2006-06-08 Roman Kennke <kennke@aicas.com>Roman Kennke2006-06-081-17/+134
| | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTreeUI.java (createDefaultActions): Added new actions. (TreePageAction.TreePageAction): Set action name. (TreePageAction.actionPerformed): Implemented. (TreePageAction.isEnabled): Implemented. (TreeToggleAction.TreePageAction): Set action name. (TreeToggleAction.actionPerformed): Implemented. (TreeToggleAction.isEnabled): Implemented. (TreeTraverseAction.TreeTraverseAction): Set action name. (TreeTraverseAction.actionPerformed): Use action name as command. (TreeTraverseAction.isEnabled): Implemented.
* 2006-06-08 Roman Kennke <kennke@aicas.com>Roman Kennke2006-06-081-53/+141
| | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTreeUI.java (installKeyboardActions): Rewritten to correctly install the UI input and action maps. (getActionMap): New helper method. (createDefaultActionMap): New helper method. (TreeHomeAction.TreeHomeAction()): Implemented. (TreeHomeAction.actionPerformed): Implemented. (TreeHomeAction.isEnabled): Implemented. (TreeIncrementAction.TreeIncrementAction()): Implemented. (TreeIncrementAction.actionPerformed): Use action name as command. (TreeIncrementAction.isEnabled): Implemented.
* 2006-06-07 Roman Kennke <kennke@aicas.com>Roman Kennke2006-06-071-18/+61
| | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTreeUI.java (completeUIUninstall): Implemented. (uninstallUI): Moved some bits to completeUIUninstall(). Complete editing before uninstalling anything. (isToggleEvent): Implemented. (selectPathForEvent): Make use of isToggleEvent(). (ComponentHandler.componentMoved): Implemented. (ComponentHandler.startTimer): Implemented. (ComponentHandler.getScrollPane): Implemented. (ComponentHandler.actionPerformed): Implemented.
* 2006-06-06 Roman Kennke <kennke@aicas.com>Roman Kennke2006-06-071-135/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 27920 * javax/swing/JTree.java (JTree()): Initialize with default model. (JTree(TreeModel)): Clear expanded state hashtable. Added comment on the updateUI() / setModel() order. (setModel): Correctly (un-)setup the listeners. Clear the expanded paths. * javax/swing/plaf/basic/BasicTreeUI.java (BasicTreeUI()): Initialize listeners in installListeners(). (setModel): Complete editing on model change. Correctly resetup the listeners. Update the layout cache accordingly. (setShowRootHandles): Complete editing and update layout. Do not call back into the JTree, this could cause cycles. (prepareForUIInstall): Implemented. Moved some init code from installUI() to this method. (completeUIInstall): Implemented. Moved some init code from installUI() to this method. (createDefaultCellEditor): Check for type of renderer, and install with null renderer when not DefaultTreeCellRenderer. (updateLayoutCacheExpandedNodes): Added null check for tree root to avoid NPE. (updateRenderer): Call updateEditor(). (installListeners): Initialize the listeners here. Added some null checks to avoid NPEs. (installUI): Moved some init code to prepareForUIInstall() and completeUIInstall(). (completeEditing): Return immediately if editing component is null or if the setting is to not stop editing on complete editing. (checkForClickInExpandControl): Call handleExpandControlClick() instead of toggleExpandState() directly. (isLocationInExpandControl): Rewritten to correctly determine the expand click location. (MouseHandler.mousePressed): Rewritten to make better use of the instance methods of BasicTreeUI to handle the click. (PropertyHandler.propertyChange): Handle model and cell renderer updates. * javax/swing/tree/DefaultTreeCellEditor.java (DefaultTreeCellEditor): Removed initialization of the icon. This is done so that the constructor can deal with null renderer as the RI does. Maybe this needs more fixing. * javax/swing/tree/TreePath.java (isDescendant): Fixed this method. The previous version did too much and compared the wrong things, which lead to a ClassCastException in equals(). * javax/swing/tree/VariableHeightLayoutCache.java (update): Do nothing when model is null. (setModel): Clear the tables and update the layout. Added null check to prevent NPE.
* 2006-05-25 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-05-251-20/+9
| | | | | * javax/swing/plaf/basic/BasicTreeUI.java (TreeCancelEditingAction): Implemented.
* 2006-05-16 Lillian Angel <langel@redhat.com>Lillian Angel2006-05-161-5/+58
| | | | | | | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicComboBoxUI.java (installKeyboardActions): Implemented. (uninstallKeyboardActions): Implemented. * javax/swing/plaf/basic/BasicComboPopup.java (uninstallKeyboardActions): Removed FIXME. Nothing to be done here. (installKeyboardActions): Likewise. * javax/swing/plaf/basic/BasicTextUI.java (uninstallKeyboardActions): Implemented. * javax/swing/plaf/basic/BasicTreeUI.java: Added field for hashColor. Marked stub methods. (getHashColor): Implemented to use field. (setHashColor): Likewise. (getRowX): Implemented. (NodeDimensions.getRowX): Changed to use BasicTreeUI.getRowX.
* 2006-05-07 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-05-061-27/+71
| | | | | | | | | | | | | PR 27298 * javax/swing/plaf/basic/BasicTreeUI.java (NodeDimensionsHandler. getNodeDimensions): Mind the size of the node icon. (getRowX): use totalChildIndent. (TreeExpansionHandler): Set maximal height to zero on events. (nullIcon): New field. (getCurrentControlIcon): Return nullIcon if there is no other icon. (getNodeIcon): New method. (installDefaults): assign totalChildIndent. (installUI): Call updateExpandedDescendants. (paintHorizontalPartOfLeg): Rewritten. (paintRow): Rewritten. (updateRenderer): Do not set the renderer for the tree.
* 2006-05-05 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-05-051-3/+7
| | | | | * javax/swing/plaf/basic/BasicTreeUI.java (paint): Return early if there are no visible nodes to paint.
* 2006-04-27 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-04-271-3/+5
| | | | | | | | | | | | | | | | | | | | * examples/gnu/classpath/examples/swing/TreeDemo.java (createContent): Added root visibility and selection listener demos. * javax/swing/JTree.java (setRootVisible): If false, unselect the root node, if it is selected. * javax/swing/plaf/basic/BasicTreeUI.java (TreeTraverseAction.actionPerformed): Do not select the root if it is not visible. * javax/swing/tree/DefaultTreeSelectionModel.java (removeSelectionPath, removeSelectionPaths): Reset lead to null if the current lead path is removed from selection. * javax/swing/tree/TreePath.java (getParentPath): Cache the parent path. * javax/swing/tree/FixedHeightLayoutCache.java (NodeRecord.getPath): Return the same path regardless is root visible or not. (update): Reduce the identation if the root is not visible. * javax/swing/tree/VariableHeightLayoutCache.java (NodeRecord.getPath): Return the same path regardless is root visible or not. (update): Reduce the identation if the root is not visible.
* 2006-04-26 Audrius Meskauskas <AudriusA@Bioinformatics.orgAudrius Meskauskas2006-04-261-9/+26
| | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTreeUI.java (TreeAction.actionPerformed):Newly obtain the current lead path that must stay visible. (TreeTraverseAction.actionPerformed):Rewritten. * javax/swing/tree/FixedHeightLayoutCache.java (countRows): Do not treat root specially. (setModel): Assume the root node initially expanded. * javax/swing/tree/VariableHeightLayoutCache.java:(countRows): Do not treat root specially. (setModel): Assume the root node initially expanded.
* 2006-04-26 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-04-261-16/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/JTree.java (setLeadSelectionPath): Repaint the new and old lead pathes. * javax/swing/plaf/basic/BasicTreeUI.java (FocusHandler): Repaint the lead row when focus changes. (PropertyChangeHandler): Use existing constants, not the string literals for the property names. (TreeIncrementAction): Shrink the selection when moving from the selection edge to the selection anchor. (TreeSelectionHandler.valueChanged): Repaint the new and old lead pathes. (paintRow): Treat row as focused only if it is the lead row. * javax/swing/tree/DefaultTreeCellRenderer.java (getTreeCellRendererComponent): Set the vertical alignment to CENTER. (paint): Rewritten. * javax/swing/tree/DefaultTreeSelectionModel.java (addSelectionPath): Event construction fix (old and new lead were always the same). (addSelectionPaths): Likewise. * javax/swing/JComponent.java (setOpaque): Explained. * javax/swing/tree/FixedHeightLayoutCache.java (getBounds): Accept null. * javax/swing/tree/VariableHeightLayoutCache.java (getBounds): Accept null.
* 2006-04-26 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-04-261-11/+17
| | | | | | | | | | | | | | | | | | | * examples/gnu/classpath/examples/swing/TreeDemo.java (createContent): Call DefaultTreeModel.reload(), not the tree.repaint(). Expand the parent of the added node. * javax/swing/JTree.java (constructor): Do not call UpdateUI (and documented why). (treeDidChange): Added comment, excluding the misinterpretation of this method. * javax/swing/plaf/basic/BasicTreeUI.java (componentListener, focusListener, keyListener, mouseListener, propertyListener, selectionModelPropertyChangeListener, treeModelListener, treeSelectionListener): Made package private. (PropertyChangeHandler): If the model changes, install the listener on it. (installUI): Assign treeModel. * javax/swing/tree/DefaultMutableTreeNode.java (add): Added comment, excluding misinterpretation. * javax/swing/tree/DefaultTreeModel.java (reload): Implemented. (reload(TreeNode)): Implemented.
* 2006-04-25 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-04-251-0/+5
| | | | | * javax/swing/plaf/basic/BasicTreeUI.java (MouseHandler.mousePressed): If clicked on the other row, cancel the current editing session.
* 2006-04-25 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-04-251-7/+10
| | | | | | | | | | | * javax/swing/plaf/basic/BasicTreeUI.java (NodeDimensionsHandler.getRowX): Add half of the icon width. (paintExpandControl): Always paint in one gap distance from the left border of the path bounds. (paintHorizontalPartOfLeg): Rewritted, taking the icon width into consideration. (paintVerticalPartOfLeg): Paint two gaps from the parent's bounds left edge.
* 2006-04-25 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-04-251-17/+34
| | | | * javax/swing/plaf/basic/BasicTreeUI.java (paint): Rewritten.
* 2006-04-23 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-04-231-31/+45
| | | | | | | | | | | | | | * examples/gnu/classpath/examples/swing/TreeDemo.java: (createContent): Added check box to swith between single and multiple selection. * javax/swing/JTree.java (leadSelectionPath): Removed. (addSelectionInterval): Explained. (getLeadSelectionPath): Request the path from model. (getPathsBetweenRows): Explained. (setLeadSelectionPath): Set the path in model. * javax/swing/plaf/basic/BasicTreeUI.java (TreeIncrementAction.actionPerformed, isMultiSelectionEvent, isToggleSelectionEvent, selectPath, selectPathForEvent): Rewritten. (MouseHandler.mousePressed): Call selectPathForEvent.
* 2006-04-22 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-04-221-11/+16
| | | | | | | | | | | | | | | | | | | * javax/swing/JTree.java (TreeSelectionRedirector.valueChanged): Only repaint the patches, speficied in the passed event. (expandPath): Do nothing if the path is already expanded. (scrollPathToVisible): Only scroll to visible, do nothing else. * javax/swing/plaf/basic/BasicTreeUI.java (TreeExpansionHandler.treeColapsed): Revalidate and repaint. (TreeExpansionHandler.treeExpanded): Revalidate and repaint. (TreeTraverseAction.actionPerformed): Collapse the node on the action "selectParent". (selectPath): Rewritten. * javax/swing/tree/DefaultTreeSelectionModel.java (clearSelection): Fire change event. (notifyPathChange): Implemented. (setSelectionPath): Do not reuse selection array. * javax/swing/tree/FixedHeightLayoutCache.java (getRowForPath): Accept null. * javax/swing/tree/VariableHeightLayoutCache.java (getRowForPath): Accept null.
* 2006-04-21 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-04-211-0/+5
| | | | | | | | | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTreeUI.java (PropertyChangeHandler.propertyChange): Set the row mapper for the selection model. * javax/swing/tree/AbstractLayoutCache.java (NodeDimensions.getNodeDimensions): Explained. (getPreferredHeight, getPreferredWidth, isFixedRowHeight): Implemented. (setRowHeight): Invalidate sizes. * javax/swing/tree/DefaultTreeSelectionModel.java (addSelectionPath, addSelectionPaths): Update lead row. (removeSelectionPath, removeSelectionPaths): Do nothing if selection is empty. (clone): Only clone list selection model if it is not null. (getRow): New method. (isRowSelected, getLeadSelectionRow, setSelectionPath, setSelectionPaths): Implemented. * javax/swing/tree/FixedHeightLayoutCache.java (NodeRecord.getBounds): Pass the empty rectangle. (isFixedRowHeight): New method. * javax/swing/tree/VariableHeightLayoutCache.java (NodeRecord.getBounds): Pass the empty rectangle.
* 2006-04-20 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-04-201-2/+1
| | | | | | | | | * javax/swing/plaf/basic/BasicSpinnerUI.java: Removed unused imports, * javax/swing/plaf/basic/BasicTextAreaUI.java: Likewise, * javax/swing/plaf/basic/BasicTextFieldUI.java: Likewise, * javax/swing/plaf/basic/BasicTextUI.java: Likewise, * javax/swing/plaf/basic/BasicTreeUI.java: Likewise. ----------------------------------------------------------------------
* 2006-04-20 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-04-201-10/+9
| | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTreeUI.java (finish): Invalidate path bounds. (getMaxHeight): Set the row height to the layout cache. (startEditing): Do not request to recalculated row height and preferred size. * javax/swing/tree/DefaultTreeCellEditor.java (ICON_TEXT_GAP, ICON_TREE_GAP): Removed, replacing with 0. * javax/swing/tree/FixedHeightLayoutCache.java: Rewritten.
* 2006-04-13 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-04-131-7/+0
| | | | * javax/swing/plaf/basic/BasicTreeUI.java (getPreferredSize): Removed debugging code.
* 2006-04-13 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-04-131-937/+459
| | | | | | | | | | | | | * javax/swing/JTree.java (getPreferredSize): Return the cloned instance. * javax/swing/ViewportLayout.java (layoutContainer): Do not manage the view size and location if the view is in the scroll pane. Also manage size and location for Scrollable, if it is not in the scroll pane. * javax/swing/plaf/basic/BasicTreeUI.java, * javax/swing/tree/FixedHeightLayoutCache.java, * javax/swing/tree/VariableHeightLayoutCache.java: Rewritten. * gnu/javax/swing/tree/GnuPath.java: New file.
* 2006-01-27 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-01-271-0/+1
| | | | | * javax/swing/plaf/basic/BasicTreeUI.java (updateCachedPreferredSize): Call updateCurrentVisiblePath.
* 2006-01-27 Roman Kennke <kennke@aicas.com>Roman Kennke2006-01-271-1/+0
| | | | | | | | | | | * javax/swing/plaf/basic/BasicTreeUI.java (installDefaults): Removed requestFocusInWindow() call. * javax/swing/JComponent.java (requestFocusInWindow(boolean)): Made method protected. (printComponent): Made method protected. (printChildren): Made method protected. (printComponent): Made method protected. (printBorder): Made method protected.
* 2006-01-26 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-01-261-14/+74
| | | | | | | | | | | * javax/swing/plaf/basic/BasicTreeUI.java (MouseHandler.mousePressed): Call startEditing when appropriate. (WAIT_TILL_EDITING, EDIT, startEditTimer): New fields. (startEditing): Always edit if directly ordered from MouseHandler.mousePressed. * javax/swing/tree/DefaultTreeCellEditor.java (CLICK_COUNT_TO_START): New field. (createTreeCellEditor): Set click count to start. (getTreeCellEditorComponent): Assing realEditor directly.
* 2006-01-25 Audrius Meskauskas <AudriusA@Bioinformatics.org>Audrius Meskauskas2006-01-251-146/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 25205 * javax/swing/DefaultCellEditor.java (getTreeCellEditorComponent): Rewritten. * javax/swing/JTree.java (stopEditing, cancelEditing): Return without action if not editing. * javax/swing/plaf/basic/BasicTreeUI.java (CellEditorHandler.editingCancelled): Delegate to cancelEditing. (CellEditorHandler.editingStopped): Delegate to stopEditing. (EditorUpdateTimer): Removed. (TreeAction.actionPerformed): Stop and not cancel the current editing when starting editing another node. (editorTimer, newVal): Removed. (cancelEditing): Do not send the cancel message. (completeEditing): Obtain the edited value from the editor. (finish): New method. (paintRow): Do not paint the editing component here. (startEditing, stopEditing): Rewritten. * javax/swing/tree/DefaultTreeCellEditor.java (DefaultTextField): Added SVUID. (EditorContainer): Rewritten. (RealEditorListener): New inner class. (ICON_TEXT_GAP, TREE_ICON_GAP: New constants). (constructor): Add cell editor listener. Do not instantiate timer. (actionPerformed): Return without action. (cancelCellEditing): Rewritten. (createTreeCellEditor): Add cell editor listener to the editor. (getCellEditorValue): Request the value from the realEditor. (isCellEditable): Removed timer management. (prepareForEditing): Remove all components befor adding the editingComponent. (startEditingTimer): Start only if it is not null. (stopCellEditing): Rewritten. (stopEditingTimer): New method. (valueChanged): Do not configure editing component here.
* 2006-01-09 Lillian Angel <langel@redhat.com>Lillian Angel2006-01-091-224/+290
| | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTreeUI.java: Added new field. (setRowHeight): Row height is set to the max height of all the nodes, or 20 as a default value. (getPathBounds): Cleaned up code. (getMaxHeight): New helper function that gets the max height of all the rows. (getClosestPathForLocation): Fixed to use getMaxHeight. (updateCachedPreferredSize): Likewise. (installUI): Shouldn't expand tree on startup. (getNodeDimensions): Fixed to use getMaxHeight.
* 2005-12-20 Lillian Angel <langel@redhat.com>Lillian Angel2005-12-201-25/+12
| | | | | | | | | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTreeUI.java (pathWasExpanded): Removed unneeded revalidate call. (pathWasCollapsed): Likewise. (installUI): Fixed to check for null root. (paint): Fixed to always update path. (toggleExpandState): Removed call to update path. (editingStopped): Likewise. (editingCanceled): Likewise. (treeStructureChanged): Likewise. (treeExpanded): Likewise. (treeCollapsed): Likewise. (treeNodesChanged): Likewise. (treeNodesInserted): Likewise. (treeNodesRemoved): Likewise. (updateCurrentVisiblePath): Added check for null root. If root is null, nothing should be painted or in the path. * javax/swing/tree/DefaultTreeModel.java (setRoot): Root can be null.
* 2005-11-16 Lillian Angel <langel@redhat.com>Lillian Angel2005-11-161-3/+3
| | | | | | * javax/swing/plaf/basic/BasicTreeUI.java (paintVerticalPartOfLeg): Added a check to prevent ArrayOutOfBoundsException.
* 2005-11-15 Lillian Angel <langel@redhat.com>Lillian Angel2005-11-151-1/+1
| | | | | * javax/swing/plaf/basic/BasicTreeUI.java (paint): Added check to prevent NPE.
* 2005-11-15 Lillian Angel <langel@redhat.com>Lillian Angel2005-11-151-2/+7
| | | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicLookAndFeel.java (initComponentDefaults): Default rowHeight for tree's should be 0. This is Sun and IBM's default. * javax/swing/plaf/metal/MetalLookAndFeel.java (initComponentDefaults): Default rowHeight for tree's should e 0. This is Sun and IBM's default. * javax/swing/plaf/basic/BasicTreeUI.java: Added a default rowHeight field. (setRowHeight): Set the rowHeight to the class default if parameter is 0. Tree row height should never be set to 0. 20 is the minimum. (installDefaults): fixed call to tree.setRowHeight (shouldPaintExpandControl): Added to check to prevent NPE.
* 2005-11-15 Roman Kennke <kennke@aicas.com>Roman Kennke2005-11-151-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicBorders.java (getButtonBorder): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). (getRadioButtonBorder): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). (getToggleButtonBorder): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). (getMenuBarBorder): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). (getSplitPaneBorder): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). (getSplitPaneDividerBorder): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). (getTextFieldBorder): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). (getInternalFrameBorder): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). * javax/swing/plaf/basic/BasicButtonUI.java (paintText): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). * javax/swing/plaf/basic/BasicCheckBoxUI.java (getDefaultIcon): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). * javax/swing/plaf/basic/BasicComboBoxUI.java (paintCurrentValue): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). * javax/swing/plaf/basic/BasicFileChooserUI.java (installStrings): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). * javax/swing/plaf/basic/BasicInternalFrameTitlePane.java (installDefaults): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). * javax/swing/plaf/basic/BasicListUI.java (installKeyboardActions): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). * javax/swing/plaf/basic/BasicProgressBarUI.java (boxRect): Added @since tag to the API comment. * javax/swing/plaf/basic/BasicRadioButtonUI.java (getDefaultIcon): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). * javax/swing/plaf/basic/BasicScrollBarUI.java (configureScrollBarColors): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). (calculatePreferredSize): Fetch preferred width or height from UI defaults. * javax/swing/plaf/basic/BasicTableUI.java (installKeyboardActions): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). * javax/swing/plaf/basic/BasicTextUI.java (createKeymap): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). (getInputMap): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). (getActionMap): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). * javax/swing/plaf/basic/BasicToolBarUI.java (dragTo): Don't use cached* fields. (installComponents): Don't use cached* fields. * javax/swing/plaf/basic/BasicTreeUI.java (getHashColor): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). (setHashColor): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get(). Added FIXME comment. (installKeyboardActions): Replaced UIManager.getLookAndFeelDefaults().get() with UIManager.get().
* 2005-11-15 Lillian Angel <langel@redhat.com>Lillian Angel2005-11-151-302/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTreeUI.java: Removed unneeded field. (getPathBounds): Reimplemented to use getNodeDimensions. (getRowCount): Removed call to updateCurrentVisiblePath. (uninstallKeyboardActions): Implemented. (paint): Reimplemented to only paint rows contained in clip. No longer uses recursion. (mousePressed): If control icon is clicked, should scroll to that path. (getNodeDimensions): Implemented. (getRowX): Implemented. (getCellBounds): Removed. (getCellLocation): Removed. (paintRecursive): Removed. (paintControlIcons): Removed. (getPreviousVisibleNode): Removed call to updateCurrentVisiblePath. (getLevel): Added check for invisible root. (paintVerticalLine): Set graphics color. (paintHorizontalLine): Likewise. (drawCentered): Added negative check. (drawDashedHorizontalLine): Set graphics color. (drawDashedVerticalLine): Likewise. (paintExpandControl): Implemented. (paintHorizontalPartOfLeg): Likewise. (paintVerticalPartOfLeg): Likewise. (paintRow): Added call to paint the control icons. (updateCurrentVisiblePath): Cleaned up function.
* 2005-11-14 Lillian Angel <langel@redhat.com>Lillian Angel2005-11-141-26/+44
| | | | | | | | | | | | | | | | * javax/swing/JTree.java (expandPath): No need to get the parent path. * javax/swing/event/TreeModelEvent.java: Variables should be initialized to null. (toString): Implemented. * javax/swing/plaf/basic/BasicTreeUI.java (treeStructureChanged): Implemented. (getParent): Added check to avoid infinite loop. (findNode): Fixed check to use getChild, instead of getIndexOfChild. (updateCurrentVisiblePath): Added a loop to check the parent's sibling, if the current node has no other siblings.
* 2005-11-08 Lillian Angel <langel@redhat.com>Lillian Angel2005-11-081-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * java/awt/Window.java (setLocationRelativeTo): Changed x and y to use getLocationOnScreen and moved setLocation call outside of check. * javax/swing/JOptionPane.java (createDialog): Moved pack call and setLocationRelativeTo call here and removed these calls from all other functions that call createDialog. Also, removed FIXME, since call to setLocationRelativeTo fixes this. (showConfirmDialog): Removed pack and setLocationRelativeTo calls. (showConfirmDialog): Likewise. (showConfirmDialog): Likewise. (showConfirmDialog): Likewise. (showInputDialog): Likewise. (showInputDialog): Likewise. (showInputDialog): Likewise. (showInputDialog): Likewise. (showInputDialog): Likewise. (showInputDialog): Likewise. (showMessageDialog): Likewise. (showMessageDialog): Likewise. (showOptionDialog): Likewise. * javax/swing/JTree.java (JTree): Should not use a shared instance of the selection model. It is a problem when one application has two different trees. * javax/swing/plaf/basic/BasicTreeUI.java (paintRow): Changed parameter to be the focus of the tree. (updateCurrentVisiblePath): Adjusted root path incase the root is hidden.
* 2005-11-08 Anthony Balkissoon <abalkiss@redhat.com>Anthony Balkissoon2005-11-081-1/+2
| | | | | | | | | | | | | | * javax/swing/SwingUtilities.java: (replaceUIActionMap): Stop climbing hierarchy once we've found an ActionMapUIResource, don't keep looking until parent is null. No need to check if child is null. (replaceUIInputMap): Use a local variable for the parent rather than 3 calls to get parent. No need to check if child is null. * javax/swing/plaf/basic/BasicListUI.java: * javax/swing/plaf/basic/BasicTableUI.java: * javax/swing/plaf/basic/BasicTreeUI.java: (installKeyboardActions): UI ActionMap should be of type ActionMapUIResource, not just ActionMap.
* 2005-11-07 Lillian Angel <langel@redhat.com>Lillian Angel2005-11-071-21/+43
| | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/JTable.java (tableChanged): Cleared selection if there are no more rows. Prevents a NPE. * javax/swing/JTree.java (scrollRectToVisible): No need to set the selection path here. (expandPath): Sometimes it is required to set the state of a leaf, especially if the leaf is the root node. * javax/swing/plaf/basic/BasicTreeUI.java (getRowCount): Added call to updateCurrentVisiblePath, so the correct value is always returned. (paint): No need to paint if the visible path is null. (propertyChange): Implemented. (paintRecursive): Added check for visibility of child. If it is not visible because it was explicitly set to be hidden, no lines should be drawn. (paintControlIcons): Likewise. (getPreviousNode): Fixed check to include root. (paintRow): Set focus to be true (this will change in the future). (updateCurrentVisiblePath): Fixed check to call getNextNode if the current node is a leaf (more efficent than calling getNextSibling). * javax/swing/tree/DefaultTreeCellRenderer.java (getTreeCellRendererComponent): Changed to draw border if node has focus.
* 2005-11-03 Lillian Angel <langel@redhat.com>Lillian Angel2005-11-031-10/+19
| | | | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTreeUI.java (mousePressed): If the control icon is clicked, the path selected should not be changed. (paintRecursively): Moved call to getChildCount before loop. (paintRow): Added a check to prevent NPE. (updateCurrentVisiblePath): Made this slightly more efficent. Instead of checking each path, we can check the siblings if the current node is not expanded. * javax/swing/table/DefaultTableCellRenderer.java (getTableCellRendererComponent): Fixed indentation, and changed to set the background color if it is not an instance of ColorUIResource. Prevents overriding a user-set color.
* * javax/swing/plaf/basic/BasicTreeUI.javaMark Wielaard2005-10-301-0/+3
| | | | (updateCurrentVisiblePath): Check whether treeModel is null.