summaryrefslogtreecommitdiff
path: root/javax/swing/plaf
Commit message (Collapse)AuthorAgeFilesLines
* 2006-12-06 Roman Kennke <kennke@aicas.com>Roman Kennke2006-12-061-2/+7
| | | | | | | | | | | | | | | | | | * javax/swing/JEditorPane.java (getStream): Buffer the stream for efficiency. (setPage): Don't scroll the view at this point. * javax/swing/plaf/basic/BasicTextUI.java (RootView.paint): Call RootView's setSize to get synchronization. (RootView.setSize): Synchronize to prevent race in layout code. * javax/swing/text/AbstractDocument.java (notifyListeners): New field. (fireChangedUpdate): Track notifyListener field. (fireRemoveUpdate): Track notifyListener field. (fireIndertUpdate): Track notifyListener field. (writeLock): Check notifyListener and throw IllegalStateException. * javax/swing/text/View.java (preferenceChanged): Create local var for better thread safety and more efficiency.
* * javax/swing/plaf/basic/BasicTreeUI.java (paint): Check whetherMark Wielaard2006-12-031-8/+14
| | | | | path[k] is null. (isLastChild): Return false when path is null.
* 2006-11-29 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-11-291-28/+32
| | | | | | * javax/swing/plaf/metal/MetalIconFactory.java (HorizontalSliderThumbIcon.paintIcon()): Commented out gradient paint, (VerticalSliderThumbIcon.paintIcon()): Likewise.
* 2006-11-20 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-201-10/+52
| | | | | | | | | | | | * javax/swing/plaf/basic/BasicTextUI.java (RootView.paint): Avoid allocation. (cachedInsets): New field. Caches an Insets instance. (getNextVisualPositionFrom): Read-lock the document to avoid thread nastiness. Push allocation. (getPreferredSize): Push fake allocation when not yet laid out. (getVisibleEditorRect): Use cached insets. (viewToModel): Read-lock the document to avoid thread nastiness. Push allocation.
* 2006-10-18 Roman Kennke <kennke@aicas.com>Roman Kennke2006-10-182-105/+81
| | | | | | | | | | | | | | | | | | | | | | | | | PR 28769 * javax/swing/JScrollPane.java (viewportBorder): Made field private. (wheelScrollingEnabled): Made field private. (JScrollPane): Enabled wheel scrolling by default. * javax/swing/JTree.java (TreeSelectionRedirector.valueChanged): Don't repaint anything here. (getScrollableUnitIncrement): Fixed thinko. * javax/swing/plaf/basic/BasicScrollBarUI.java (static scrollByBlock): New static method to avoid code duplication for the BasicScrollPane wheel scrolling. (static scrollByUnits): New static method to avoid code duplication for the BasicScrollPane wheel scrolling. (scrollByBlock): Delegate to static helper method. (scrollByUnit): Delegate to static helper method. * javax/swing/plaf/basic/BasicScrollPaneUI.java (MouseWheelHandler.mouseWheelMoved): Delegate to BasicScrollBarUI static helper methods to avoid code duplication. (MouseWheelHandler.bounds): Removed. (MouseWheelHandler.getValue): Removed. (MouseWheelHandler.scroll): Removed.
* 2006-10-13 Roman Kennke <kennke@aicas.com>Roman Kennke2006-10-131-17/+17
| | | | | | | | | | | | | | | | | | | | | | PR 27780 * javax/swing/JMenuItem.java (isDragging): New field. Indicates if we are inside a mouse drag. (createMenuDragMouseEvent): Removed unneeded method. (processMenuDragMouseEvent): Track if we are dragging. (processMouseEvent): Simply forward to processMenuDragMouseEvent(). * javax/swing/plaf/basic/BasicMenuItemUI.java (MenuDragMouseHandler.menuDragMouseDragged): Fetch MenuSelectionManager from event. (MenuDragMouseHandler.menuDragMouseEntered): Fetch MenuSelectionManager from event. (MenuDragMouseHandler.menuDragMouseExited): Fetch MenuSelectionManager from event. (MenuDragMouseHandler.menuDragMouseReleased): Click on mouse release inside menu item, otherwise clear selection. (MenuInputHandler.mouseReleased): Avoid multiple calls to getX() and getY(). Call doClick() rather than the doClick() of JMenuItem. (doClick): Perform an immediate click.
* 2006-10-12 Roman Kennke <kennke@aicas.com>Roman Kennke2006-10-123-374/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 27956 * javax/swing/JSlider.java (LabelUIResource): New inner class. A JLabel as UIResource. (createStandardLabels): Don't set label bounds here. Create LabelUIResource instances. (setInverted): Repaint. (setLabelTable): Update the label UIs. Revalidate and repaint. (setMajorTickSpacing): Update the label table. Repaint if necessary. (setMinorTickSpacing): Repaint if necessary. (setOrientation): Revalidate. (setPaintLabels): Revalidate and repaint. (setPaintTicks): Revalidate and repaint. (setPaintTrack): Repaint. (updateLabelUIs): Set the label sizes here. (updateUI): Also update the label UIs. * javax/swing/plaf/basic/BasicSliderUI.java (ComponentHandler.componentResized): Don't revalidate. (FocusHandler.focusGained): Don't set field. (FocusHandler.focusLost): Don't set field. (PropertyChangeHandler.propertyChange): Calculate geometry and repaint for a couple more properties. (TrackListener.mouseReleased): Repaint. (hasFocus): Removed unneeded field. (calculateContentRect): No need to check for content size < 0. (calculateFocusRect): Use insets from insetCache. (calculateLabelRect): Fixed calculation of label rectangle. It is relative to the tick rectangle, rather than the content rectangle. (calculateTickRect): Small restructuring to avoid unnecessary comparisons. (calculateTrackRect): Fixed calculation of track rectangle. (getMaximumSize): Fixed. Fetch preferred size and set the height of width to Short.MAX_VALUE. (getMinimumHorizontalSize): Fixed to return UIManager value. (getMinimumVerticalSize): Fixed to return UIManager value. (getPreferredHorizontalSize): Fixed to return UIManager value. (getPreferredVerticalSize): Fixed to return UIManager value. (getMinimumSize): Fixed to return the UIManager value plus insets added. (getPreferredSize): Fixed to return the UIManager value plus insets added. (getWidthOfWidestLabel): Restructured for more cleanness and efficiency. (hitClip): New helper method. (paintHorizontalLabel): Replaced by more efficient and clean implementation. (paintVerticalLabel): Replaced by more efficient and clean implementation. (paintLabels): Replaced by more efficient and clean implementation. (paint): Check if rectangles intersect with clip for maximum efficiency. (recalculateIfInsetsChanged): Fixed. This method should recalculate only when the insets changed. (setThumbLocation): Repaint with a reasonable clip. (xPositionForValue): Made more clean and efficient. (yPositionForValue): Made more clean and efficient. * javax/swing/plaf/basic/BasicLookAndFeel.java (initComponenDefaults): Added Slider.horizontalSize, Slider.verticalSize, Slider.minimumHorizontalSize and Slider.minimumVerticalSize properties. * javax/swing/plaf/metal/MetalSliderUI.java (getTickLength): Add 1 for horizontal sliders and 3 for vertical sliders. (paintMajorTickForHorizSlider): Fix colors. Fix line locations. (paintMinorTickForHorizSlider): Fix colors. Fix line locations. (paintMajorTickForVertSlider): Fix colors. Fix line locations. (paintMinorTickForVertSlider): Fix colors. Fix line locations.
* 2006-10-12 Roman Kennke <kennke@aicas.com>Roman Kennke2006-10-121-69/+38
| | | | | | | | PR 2873 * javax/swing/plaf/basic/BasicTabbedPaneUI.java (TabPaneLayout.normalizeTabRuns): Replaced algorithm with one that avoids faulty state that could cause division by zero error.
* 2006-10-12 Roman Kennke <kennke@aicas.com>Roman Kennke2006-10-123-37/+74
| | | | | | | | | | | | | | PR 28057 * javax/swing/plaf/basic/BasicRadioButtonUI.java (paint): Determine correct icon. Added support for HTML label. Added small optimizations. (getPreferredSize): Only consider the buttons iconTextGap, and only when the text is not null. * javax/swing/plaf/basic/BasicLookAndFeel.java (initComponentDefaults): Fetch border for RadioButton from BasicButtons.getRadioButtonBorder(). * javax/swing/plaf/metal/MetalRadioButtonUI.java (paintFocus): Paint focus rectangle one pixel smaller.
* 2006-10-09 Roman Kennke <kennke@aicas.com>Roman Kennke2006-10-091-15/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 29325 * javax/swing/JSplitPane.java (dividerLocation): New field. Stores the divider location. (JSplitPane): Initialize dividerLocation with -1. (addImpl): Removed unneeded local variables. (getDividerLocation): Manage dividerLocation in the JSplitPane class, not in the UI. (setDividerLocation): Manage dividerLocation in the JSplitPane class, not in the UI. Only call the UI method for notification. * javax/swing/plaf/basic/BasicSplitPaneUI.java (BasicHorizontalLayoutManager.layoutContainer): Fetch divider location from the JSplitPane. Honour the minimumSize, but only if the divider location hasn't been set explicitly. (BasicHorizontalLayoutManager.minimumLayoutSize): Removed unneeded statement. (BasicHorizontalLayoutManager.preferredLayoutSize): Removed unneeded statement. (BasicHorizontalLayoutManager.resetToPreferredSizes): Don't touch the divider location. (dividerLocationSet): New field. (dividerLocation): Removed field. (createActionMap): Fetch and set divider location on the JSplitPane. (getDividerLocation): Return the actual real divider location. (getMaximumSize): Removed unneeded cast. (getPreferredSize): Removed unneeded cast. (getMinimumSize): Removed unneeded cast. (installUI): Initialize dividerLocationSet with false. (uninstallUI): Initialize dividerLocationSet with false. (setDividerLocation): Set dividerLocationSet to true.
* 2006-08-29 Tania Bento <tbento@redhat.com>Tania Bento2006-09-291-3/+6
| | | | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTableUI.java (getPreferredSize): The number of iterations for the for-loop should be the number of columns in the table's column model, not the number of columns of the table. * javax/swing/JTable.java (JTable(TableModel, TableColumnModel, ListSelectionModel): Removed 4 lines that are not needed. (initializeLocalVars): dragEnabled should be set to false, not true. (getCellRenderer): Added a check to prevent an ArrayIndexOutOfBoundsException. (doLayout): The number of iterations for the for-loops should be the number of columns in the table's column model, not the number of columns of the table.
* 2006-09-27 Roman Kennke <kennke@aicas.com>Roman Kennke2006-09-272-73/+38
| | | | | | | | | | | | | | | | | | | | | | | | | PR 29036 PR 29161 * javax/swing/plaf/basic/BasicButtonUI.java (cachedInsets): New field. (installListeners): Fire synthetic property change to initialize TEXT_LAYOUT_CACHE for the button because the font has been installed before. (uninstallUI): Clear the TEXT_LAYOUT_CACHE for the button. (paint): Use cached insets. (paintText): Let new method forward to old one, not vice versa. * javax/swing/plaf/basic/BasicMenuItemUI.java (defaultAcceleratorLabelGap): Removed unused field. (MenuGap): Removed unused field. (propertyChangeListener): Made private. (getAcceleratorRect): Removed unused method. (getAcceleratorText): Removed unused method. (getPath): Removed unnecessary cast. (installListeners): Fire synthetic property change to initialize TEXT_LAYOUT_CACHE for the button because the font has been installed before. (uninstallUI): Clear the TEXT_LAYOUT_CACHE for the button. (layoutMenuItem): Removed unused statements.
* 2006-09-26 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-09-261-14/+22
| | | | | | | | | | | | * javax/swing/plaf/metal/MetalIconFactory.java (FileIcon16.paintIcon): Apply vertical shift by the number of pixels returned by getShift(), (FileIcon16.getShift): Updated API docs, (FolderIcon16.paintIcon): Apply vertical shift by the number of pixels returned by getShift(), (FolderIcon16.getShift): Updated API docs, (TreeFolderIcon.getShift): Likewise, (TreeLeafIcon.getShift): Likewise.
* 2006-09-26 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-09-261-9/+6
| | | | | | * javax/swing/plaf/metal/MetalIconFactory.java (FileIcon16.paintIcon): Fetch colors from look and feel, (FolderIcon16.paintIcon): Likewise.
* 2006-09-21 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-09-211-2/+8
| | | | | * javax/swing/plaf/basic/BasicInternalFrameTitlePane.java (MaximizeAction.actionPerformed): Change icon on maxButton.
* 2006-09-21 Roman Kennke <kennke@aicas.com>Roman Kennke2006-09-211-22/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicScrollPaneUI.java (syncScrollPaneWithViewport): Fixed typo (hsb vs. vsb). Use more efficient getViewPosition() and getViewSize() methods to avoid creating a rectangle. (HSBChangeListener.stateChanged): Update the view position unconditionally. Let the Viewport figure out if something changed. (VSBChangeListener.stateChanged): Update the view position unconditionally. Let the Viewport figure out if something changed. * javax/swing/JViewport.java (ViewListener.componentResized): Fire state change, because the extentSize changes. (extentSize): Removed unneeded field. (viewSize): Removed unneeded field. (getExtentSize): Return the viewport's size here. (getViewRect): Reformatted. (getViewSize): Reordered for only one return statement. (paintImmediately2): Fixed up javadoc. (paint): Removed unneeded statement. (setExtentSize): Set viewport size and check for actual change of value. (setViewPosition): Simplified condition. Set scrollUnderway true and don't set isViewSizeSet. Avoid creating one Point object. (setViewSize): Fixed != comparison with equals(). Set scrollUnderway to false. * javax/swing/JScrollBar.java (ScrollBarListener): New class. Forwards change events from the model as adjustment events. (sbChangeListener): New field. (JScrollBar): Install listener on new model. (fireAdjustmentValueChanged(int,int,int)): Delegate to new helper method. (fireAdjustmentValueChanged(int,int,int,boolean)): New helper method to allow custom isAdjusting value. (setMaximum): Only forward to model. (setMinimum): Only forward to model. (setValue): Only forward to model. (setVisibleAmount): Only forward to model. (setValues): Only forward to model. (setModel): Update the change listener.
* 2006-09-20 Roman Kennke <kennke@aicas.com>Roman Kennke2006-09-211-20/+82
| | | | | | | | | | | | | | | | | | | PR 29036 * javax/swing/plaf/metal/DefaultMetalTheme.java (PLAIN_CONTROL_TEXT_FONT): New constant field. (BOLD_CONTROL_TEXT_FONT): New constant field. (PLAIN_MENU_TEXT_FONT): New constant field. (BOLD_MENU_TEXT_FONT): New constant field. (controlTextFont): Removed. (menuTextFont): Removed. (CONTROL_TEXT_FONT): New constant field. (MENU_TEXT_FONT): New constant field. (getControlTextFont): Use getFont() helper method for fetching the correct font. (getMenuTextFont): Use getFont() helper method for fetching the correct font. (getFont): New helper method. (isBoldMetal): New helper method.
* 2006-09-20 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-09-201-2/+3
| | | | | | | * javax/swing/plaf/basic/BasicRadioButtonUI.java (BasicRadioButtonUI): Don't fetch icon here, (installDefaults): Initialise icon here, (getDefaultIcon): Just return icon.
* Missing patchlet from the last commit.Roman Kennke2006-09-191-1/+0
|
* 2006-09-19 Roman Kennke <kennke@aicas.com>Roman Kennke2006-09-191-31/+48
| | | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicScrollPaneUI.java (HSBChangeListener.stateChanged): Moved handling of header to syncScrollPaneWithViewport(). (VSBChangeListener.stateChanged): Moved handling of header to syncScrollPaneWithViewport(). (ViewportChangedHandler.stateChanged): Removed unused statements. (syncScrollPaneWithViewport): Added null checks. Use setValues rather then the single setter methods to avoid multiple adjustments and side effects. Also snyc the headers here. (updateScrollBarDisplayPolicy): Revalidate and repaint here. (uninstallUI): Removed unnecessary cast and this qualifier as well as the call to super.
* * javax/swing/plaf/basic/BasicToolBarUI.javaMark Wielaard2006-09-171-2/+4
| | | | | (setBorderToNonRollover): Check whether border is null. (setBorderToRollover): Likewise.
* 2006-09-12 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-09-121-8/+30
| | | | | | | | | * javax/swing/plaf/metal/DefaultMetalTheme.java (CONTROL_TEXT_FONT): Renamed 'controlTextFont', (MENU_TEXT_FONT): Renamed 'menuTextFont', (getControlTextFont): Check 'swing.boldMetal' setting before initialising font, (getMenuTextFont): Likewise.
* 2006-09-12 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-09-121-0/+2
| | | | | * javax/swing/plaf/metal/OceanTheme.java (addCustomEntriesToTable): Added 'List.focusCellHighlightBorder' entry.
* 2006-09-12 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-09-121-4/+4
| | | | | * javax/swing/plaf/metal/MetalIconFactory.java (InternalFrameDefaultMenuIcon.paintIcon): Use theme colors.
* 2006-09-07 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-09-071-0/+7
| | | | | * javax/swing/plaf/basic/BasicInternalFrameUI.java (setNorthPane): Assign component to titlePane.
* 2006-09-07 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-09-071-5/+10
| | | | | | | * javax/swing/plaf/metal/MetalScrollBarUI.java (installDefaults): Initialise scrollBarWidth from UI defaults here, (createDecreaseButton): Don't fetch scrollBarWidth here, (createIncreaseButton): Likewise.
* 2006-09-06 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-09-061-4/+1
| | | | | * javax/swing/plaf/basic/BasicScrollBarUI.java (installDefaults): Call configureScrollBarColors().
* 2006-09-06 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-09-061-14/+15
| | | | | * javax/swing/plaf/metal/MetalLookAndFeel.java (initComponentDefaults): Corrected various font defaults.
* 2006-09-02 Roman Kennke <kennke@aicas.com>Roman Kennke2006-09-021-22/+40
| | | | | | | | | | | | | PR 28928 * javax/swing/plaf/basic/BasicTextUI.java (RootView.getPreferredSpan): Default to 10 when there is no real view. (RootView.getMinimumSpan): Forward to view and default to 10 when there is no real view. (RootView.getMaximumSpan): Return Integer.MAX_VALUE. (getMaximumSize): Check for overflow. * javax/swing/text/FieldView.java (getResizeWeight): Removed unneeded assignment.
* 2006-09-01 Robert Schuster <robertschuster@fsfe.org>Robert Schuster2006-09-011-2/+2
| | | | | | * javax/swing/plaf/basic/BasicSplitPaneUI.java: (BasicHorizontalLayout.getAlignmentX): Return fixed value. (BasicHorizontalLayout.getAlignmentY): Return fixed value.
* 2006-09-01 Robert Schuster <robertschuster@fsfe.org>Robert Schuster2006-09-011-5/+6
| | | | | | * javax/swing/plaf/metal/MetalCheckBoxIcon.java: (paintIcon): Removed unused import statements, lowered cast requirement from JCheckBox to AbstractButton.
* 2006-09-01 Robert Schuster <robertschuster@fsfe.org>Robert Schuster2006-09-011-9/+8
| | | | | * javax/swing/plaf/basic/BasicLookAndFeel.java: (initComponentDefaults): Added and changed some tabbed pane properties.
* 2006-09-01 Roman Kennke <kennke@aicas.com>Roman Kennke2006-09-011-0/+17
| | | | | | | | PR 28922 * javax/swing/plaf/basic/BasicHTML.java (HTMLRootView.getAttributes): Overridden to return null. (HTMLRootView.getElement): Overridden to return the view's element.
* 2006-09-01 Robert Schuster <robertschuster@fsfe.org>Robert Schuster2006-09-011-2/+5
| | | | | | | * javax/swing/plaf/basic/BasicTabbedPaneUI.java: (calculateTabAreaHeight): Use getTabRunOverlay method instead of accessing variable directly. (calculateTabAreaWidth): Dito.
* 2006-08-31 Roman Kennke <kennke@aicas.com>Roman Kennke2006-08-311-10/+60
| | | | | | | | | | | | | | | | | * javax/swing/JEditorPane.java (getPreferredSize): Replace preferred size with minimum UI size only if the scrollable does _not_ track the viewport size and only if the viewport's size is smaller than the scrollable's size. (getScrollableTracksViewportWidth): Avoid unnecessary multiple method calls. * javax/swing/plaf/basic/BasicTextUI.java (getPreferredSize): Read-lock the document to avoid concurrency problems. (getMaximumSize): Return maximum size of the view. Read-lock the document to avoid concurrency problems. (getMinimumSize): Return minimum size of the view. Read-lock the document to avoid concurrency problems.
* 2006-08-29 Roman Kennke <kennke@aicas.com>Roman Kennke2006-08-291-158/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTextUI.java (FocusHandler): New class. This is moved from the anonymous inner focus listener class to a static member class, and is now shared between components. (DocumentHandler): This class is combined with the PropertyHandler into the Handler class. (PropertyChangeHandler): This class is combined with the DocumentHandler into the Handler class. (Handler): New class. This combines the Property and Document handler into one class. (RootView.changedUpdate): Only forward if real view != null. (RootView.insertUpdate): Only forward if real view != null. (RootView.removeUpdate): Only forward if real view != null. (documentHandler): Removed field and replaced by handler. (focuslistener): Made field static and renamed to focusListener. (handler): New field. (kit): Lazily initialize field. (rootView): Lazily initialize field. (updateHandler): Removed and replaced by handler. (getEditorKit): Lazily instantiate field. (installDefaults): Don't set margin twice. Install correct property for disabledTextColor. Moved caret and highlighter initialization to installFixedDefaults. (installFixedDefaults): New method. Installs defaults that can't be overridden by subclasses. (installListeners): Only install focus handler when new system property gnu.swing.text.no-xlike-clipboard is not set. Lazily initialize focus handler. (installUI): Lazily initialize rootView. Install handler both for property and document changes. (uninstallDefaults): Uninstall the UI defaults. (uninstallFixedDefaults): New method. Uninstalls the fixed defaults. (installListeners): Only uninstall focus handler when not null. (uninstallUI): Uninstall property and document listener here.
* 2006-08-24 Roman Kennke <kennke@aicas.com>Roman Kennke2006-08-241-21/+12
| | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTabbedPaneUI.java (TabbedPaneLayout.normalizeTabRuns): Removed unused statement. (TabbedPaneScrollLayout.layoutContainer): Likewise. (ScrollingPane.updateUI): Likewise. (calculateTabWidth): Rewritten to correctly and efficiently layout the tab width. (layoutLabel): Call SwingUtilities method with the tabPane as argument. (paintContentBorderLeftEdge): Removed unused statement. (paintContentBorderRightEdge): Removed unused statement. (paintContentBorder): Removed unused statement.
* 2006-08-24 Roman Kennke <kennke@aicas.com>Roman Kennke2006-08-241-0/+9
| | | | | | * javax/swing/plaf/basic/BasicTextUI.java (RootView.getAttributes): Overridden to return null, as the RootView has no parent.
* 2006-08-22 Roman Kennke <kennke@aicas.com>Roman Kennke2006-08-224-156/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/AbstractButton.java (ButtonChangeListener.stateChanged): Delegate to combined handler. (EventHandler): New inner class. Handles all three types of events on the model. (eventHandler): New field. Stores the combined event handler. (AbstractButton): Moved listener initialization to setModel(). (createActionListener): Return combined handler. (createChangeListener): Return combined handler. (createItemListener): Return combined handler. (getEventHandler): New helper method for creating the combined handler. (setModel): Initialize listeners here. * javax/swing/plaf/basic/BasicButtonListener.java (ButtonAction): New class. Implements the keyboard action for buttons. (checkOpacity): Implemented. (createDefaultActionMap): New helper method. (installKeyboardActions): Rewritten to install InputMap and ActionMap according to 'new' keyboard input method. (mouseClicked): Commented as no-op. (mouseDragged): Commented as no-op. (mouseMoved): Commented as no-op. (propertyChange): Check for contentAreaFilled change and update opacity. Pull handling of HTLM in font and text handler. (stateChanged): Repaint button. (uninstallKeyboardActions): Properly uninstall keyboard actions. * javax/swing/plaf/basic/BasicButtonUI.java (listener): Removed. (sharedListener): New static field. Stores the shared listener. (sharedUI): New static field. Stores the shared UI. (createButtonListener): Return shared instance here. (createUI): Return shared instance here. (getButtonListener): New helper method. Looks for the BasicButtonListener installed on a button and returns it. (installDefaults): Correctly install rollover property here. Fetch defaultTextShiftOffset. Initialize opaqueness correctly. (installKeyboardActions): Fetch listener with new helper method. (installListeners): Don't use removed field. Check for null. (installUI): Added comment about order of method invocations. (uninstallDefaults): Don't uninstall non-uninstallable properties. (uninstallKeyboardActions): Fetch listener with new helper method. (uninstallListeners): Fetch listener with new helper method. (paintIcon): Paint icon offset when pressed and armed. * javax/swing/plaf/metal/MetalButtonListener.java: Removed. * javax/swing/plaf/metal/MetalButtonUI.java (sharedUI): New field. Stores the shared UI. (MetalButtonUI): Don't initialize fields here. (createButtonListener): Removed method. Use super impl. (createUI): Return shared instance. (getDisabledTextColor): Update field here. (getFocusColor): Update field here. (getSelectColor): Update field here. (installDefaults): Don't handle rollover property here. (uninstallDefaults): Don't handle rollover property here. (paintButtonPressed): Use accessor method to update the field value.
* 2006-08-17 Roman Kennke <kennke@aicas.com>Roman Kennke2006-08-181-1/+10
| | | | | * javax/swing/plaf/basic/BasicTabbedPaneUI.java (layoutLabel): Reset the text and icon rectangles.
* 2006-08-17 Jeroen Frijters <jeroen@frijters.net>Jeroen Frijters2006-08-171-4/+4
| | | | | | | | * javax/swing/filechooser/FileSystemView.java (getFileSystemView): Always return UnixFileSystemView, since that's the only one we got. Marked with NotImplementedException. * javax/swing/plaf/basic/BasicFileChooserUI.java (mouseClicked, installUI): Don't parse path by hand.
* 2006-08-17 Roman Kennke <kennke@aicas.com>Roman Kennke2006-08-175-99/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/SwingUtilities.java (clipString): New helper method for trimming strings. (layoutCompoundLabelImpl): Fixed algorithm to conform testsuites. Trim text if it's too long. Avoid creating new Rectangles. Optimized for performance. (layoutCompoundLabel): Use switch rather then if-else-chain. * javax/swing/plaf/basic/BasicButtonUI.java (viewR): New field. (iconR): New field. (textR): New field. (paint): Reset and use cached rectangles. Only call paintIcon() if icon is not null. Don't call paintButtonPressed() when button is selected, only when it is both armed and pressed. * javax/swing/plaf/basic/BasicGraphicsUtils.java (getPreferredButtonSize): Reused cached rectangles rather then creating new ones. Don't create new Rectangle via Rectangle.union(). * javax/swing/plaf/basic/BasicLabelUI.java (getPreferredSize): Correctly reset cached rectangles. Especially the view rect must have a big size to give it room for layouting. Short cut layout when text == null. (paint): Correctly reset cached rectangles. * javax/swing/plaf/basic/BasicMenuItemUI.java (resetRectangles): New helper method. (getPreferredMenuItemSize): Correctly reset the cached rectangles. (paintMenuItem): Correctly reset the cached rectangles. * javax/swing/plaf/basic/BasicRadioButtonUI.java (getPreferredSize): Use cached Rectangle objects and initialize them correctly. (paint): Use cached Rectangle objects and initialize them correctly.
* 2006-08-17 Robert Schuster <robertschuster@fsfe.org>Robert Schuster2006-08-162-4/+32
| | | | | | | | | * javax/swing/plaf/basic/BasicTabbedPaneUI.java: (getTabBounds(JTabbedPane, int)): Added code to shift rectangle by current scroll offset, added method documention. (getTabBounds(int, Rectangle)): Added method documentation. * javax/swing/plaf/metal/MetalTabbedPaneUI.java: (paintContentBorderLeftEdge): Changed y to 1.
* 2006-08-17 Robert Schuster <robertschuster@fsfe.org>Robert Schuster2006-08-161-19/+128
| | | | | | | | | | | | | * javax/swing/plaf/basic/BasicTabbedPaneUI.java: (MouseHandler.mouseReleased): Implemented. (MouseHandler.mousePressed): Added delegation to tabbed pane. (MouseHandler.mouseEntered): Dito. (MouseHandler.mouseExited): Dito. (MouseHandler.mouseMoved): Dito. (MouseHandler.redispatchEvent): New method. (PropertyChangeHandler.propertyChange): Added extra block level, added code to handle tab placement changes, added comment. (updateViewPosition): Set unneeded coordinate to 0, added comment.
* 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-16 Roman Kennke <kennke@aicas.com>Roman Kennke2006-08-161-11/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/plaf/metal/MetalTreeUI.java (LineStyleListener): New property listener, that updates the line style setting if the corresponding property changes. (lineStyleListener): New field. (lineStyle): New field. (LINE_STYLE_ANGLED): New constant field. (LINE_STYLE_HORIZONTAL): New constant field. (LINE_STYLE_NONE): New constant field. (LINE_STYLE_VALUE_ANGLED): New constant field. (LINE_STYLE_VALUE_HORIZONTAL): New constant field. (LINE_STYLE_VALUE_NONE): New constant field. (LINE_STYLE_PROPERTY): New constant field. (decodeLineStyle): Implemented. (installUI): Install line style listener. Set initial lineStyle. (uninstallUI): Uninstall line style listener. (paintHorizontalPartOfLeg): Only call super for angled lineStyle. (paintVerticalPartOfLeg): Only call super for angled lineStyle. (paintHorizontalSeparators): Implemented. (paint): If lineStyle==HORIZONTAL, call paintHorizontalSeparators(). * examples/gnu/classpath/examples/swing/TreeDemo.java (createContent): Add panel for selecting line styles.
* 2006-08-16 Robert Schuster <robertschuster@fsfe.org>Robert Schuster2006-08-151-32/+46
| | | | | | * javax/swing/plaf/basic/BasicTabbedPaneUI.java: (MouseHandler.mousePressed): Fixed indentation, intercept clicks on disabled tabs, do proper revalidation in WRAP_TAB_LAYOUT mode.
* 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-14 Roman Kennke <kennke@aicas.com>Roman Kennke2006-08-143-264/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/plaf/basic/BasicSplitPaneDivider.java (DividerLayout.layoutContainer): Removed debug output. * javax/swing/plaf/basic/BasicSplitPaneUI.java (BasicHorizontalLayoutManager.axis): New field. (BasicHorizontalLayoutManager.BasicHorizontalLayoutManager(int)): New constructor. (BasicHorizontalLayoutManager.BasicHorizontalLayoutManager()): Call new axis constructor. (BasicHorizontalLayoutManager.getAvailableSize): Refactored to handle direction. (BasicHorizontalLayoutManager.getInitialLocation): Refactored to handle direction. (BasicHorizontalLayoutManager.getPreferredSizeOfComponent): Refactored to handle direction. (BasicHorizontalLayoutManager.getSizeOfComponent): Refactored to handle direction. (BasicHorizontalLayoutManager.minimumLayoutSize): Refactored to handle direction. (BasicHorizontalLayoutManager.preferredLayoutSize): Refactored to handle direction. (BasicHorizontalLayoutManager.minimumSizeOfComponent): Refactored to handle direction. (BasicHorizontalLayoutManager.setComponentToSize): Refactored to handle direction. (BasicHorizontalLayoutManager.updateComponents): Don't reset divider size. (BasicVerticalLayoutManager.BasicVerticalLayoutManager): New explicit constructor. Calls super with vertical axis. (BasicVerticalLayoutManager.getAvailableSize): Functionality moved to BasicHorizontalLayoutManager. (BasicVerticalLayoutManager.getInitialLocation): Functionality moved to BasicHorizontalLayoutManager. (BasicVerticalLayoutManager.getPreferredSizeOfComponent): Functionality moved to BasicHorizontalLayoutManager. (BasicVerticalLayoutManager.getSizeOfComponent): Functionality moved to BasicHorizontalLayoutManager. (BasicVerticalLayoutManager.minimumLayoutSize): Functionality moved to BasicHorizontalLayoutManager. (BasicVerticalLayoutManager.minimumSizeOfComponent): Functionality moved to BasicHorizontalLayoutManager. (BasicVerticalLayoutManager.preferredLayoutSize): Functionality moved to BasicHorizontalLayoutManager. (BasicVerticalLayoutManager.setComponentToSize): Functionality moved to BasicHorizontalLayoutManager. * javax/swing/plaf/metal/MetalSplitPaneDivider.java (BUTTON_SPRITE): Renamed to BUTTON_SPRITE_L. (BUTTON_SPRITE_R): New constant field. (MetalOneTouchButton.paint): Paint R sprite for right buttons, L sprite for left buttons.
* 2006-08-14 Roman Kennke <kennke@aicas.com>Roman Kennke2006-08-141-5/+14
| | | | | | | | | * javax/swing/plaf/metal/MetalLookAndFeel.java (MetalLookAndFeel): Moved theme initialization to getDefaults(). (createDefaultTheme): Forward to getCurrentTheme(). (getDefaults): Initialize theme before doing anything else. (getCurrentTheme): Recognize swing.metalTheme property.