| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
* javax/swing/plaf/basic/BasicTreeUI.java (KeyHandler): Implemented.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* javax/swing/plaf/basic/BasicTreeUI.java (TreeCancelEditingAction):
Implemented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* javax/swing/plaf/basic/BasicTreeUI.java (paint): Return early
if there are no visible nodes to paint.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* javax/swing/plaf/basic/BasicTreeUI.java (MouseHandler.mousePressed):
If clicked on the other row, cancel the current editing session.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* javax/swing/plaf/basic/BasicTreeUI.java (paint): Rewritten.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
* 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.
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* javax/swing/plaf/basic/BasicTreeUI.java (getPreferredSize): Removed debugging code.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* javax/swing/plaf/basic/BasicTreeUI.java (updateCachedPreferredSize):
Call updateCurrentVisiblePath.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
* javax/swing/plaf/basic/BasicTreeUI.java
(paintVerticalPartOfLeg): Added a check to prevent
ArrayOutOfBoundsException.
|
|
|
|
|
| |
* javax/swing/plaf/basic/BasicTreeUI.java
(paint): Added check to prevent NPE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
(updateCurrentVisiblePath): Check whether treeModel is null.
|