bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug swing/27956] JSlider getPreferredSize too small when labels enabled


From: cvs-commit at developer dot classpath dot org
Subject: [Bug swing/27956] JSlider getPreferredSize too small when labels enabled
Date: 12 Oct 2006 21:55:33 -0000


------- Comment #7 from cvs-commit at developer dot classpath dot org  
2006-10-12 21:55 -------
Subject: Bug 27956

CVSROOT:        /cvsroot/classpath
Module name:    classpath
Changes by:     Roman Kennke <rabbit78> 06/10/12 21:55:10

Modified files:
        javax/swing    : JSlider.java 
        javax/swing/plaf/basic: BasicSliderUI.java BasicLookAndFeel.java 
        javax/swing/plaf/metal: MetalSliderUI.java 
        .              : ChangeLog 

Log message:
        2006-10-12  Roman Kennke  <address@hidden>

                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.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/JSlider.java?cvsroot=classpath&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/basic/BasicSliderUI.java?cvsroot=classpath&r1=1.34&r2=1.35
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java?cvsroot=classpath&r1=1.100&r2=1.101
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/metal/MetalSliderUI.java?cvsroot=classpath&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.8671&r2=1.8672


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27956





reply via email to

[Prev in Thread] Current Thread [Next in Thread]