javax.swing.plaf.metal
Class MetalSliderUI
A UI delegate for the
JSlider
component.
MAX_SCROLL , MIN_SCROLL , NEGATIVE_SCROLL , POSITIVE_SCROLL , changeListener , componentListener , contentRect , focusInsets , focusListener , focusRect , insetCache , labelRect , leftToRightCache , propertyChangeListener , scrollListener , scrollTimer , slider , thumbRect , tickRect , trackBuffer , trackListener , trackRect |
calculateContentRect , calculateFocusRect , calculateGeometry , calculateLabelRect , calculateThumbLocation , calculateThumbSize , calculateTickRect , calculateTrackBuffer , calculateTrackRect , createChangeListener , createComponentListener , createFocusListener , createPropertyChangeListener , createScrollListener , createTrackListener , createUI , drawInverted , getFocusColor , getHeightOfHighValueLabel , getHeightOfLowValueLabel , getHeightOfTallestLabel , getHighestValueLabel , getHighlightColor , getLowestValueLabel , getMaximumSize , getMinimumHorizontalSize , getMinimumSize , getMinimumVerticalSize , getPreferredHorizontalSize , getPreferredSize , getPreferredVerticalSize , getShadowColor , getThumbSize , getTickLength , getWidthOfHighValueLabel , getWidthOfLowValueLabel , getWidthOfWidestLabel , installDefaults , installKeyboardActions , installListeners , installUI , paint , paintFocus , paintHorizontalLabel , paintLabels , paintMajorTickForHorizSlider , paintMajorTickForVertSlider , paintMinorTickForHorizSlider , paintMinorTickForVertSlider , paintThumb , paintTicks , paintTrack , paintVerticalLabel , recalculateIfInsetsChanged , recalculateIfOrientationChanged , scrollByBlock , scrollByUnit , scrollDueToClickInTrack , setThumbLocation , uninstallKeyboardActions , uninstallListeners , uninstallUI , valueForXPosition , valueForYPosition , xPositionForValue , yPositionForValue |
contains , createUI , getAccessibleChild , getAccessibleChildrenCount , getMaximumSize , getMinimumSize , getPreferredSize , installUI , paint , uninstallUI , update |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
TICK_BUFFER
protected final int TICK_BUFFER
The gap between the track and the tick marks.
filledSlider
protected boolean filledSlider
A flag that controls whether or not the track is filled up to the value
of the slider.
horizThumbIcon
protected static Icon horizThumbIcon
The icon used for the thumb control of horizontally oriented sliders.
tickLength
protected static int tickLength
The length of the major tick marks.
trackWidth
protected static int trackWidth
The track width.
vertThumbIcon
protected static Icon vertThumbIcon
The icon used for the thumb control of vertically oriented sliders.
createUI
public static ComponentUI createUI(JComponent component)
Returns an instance of MetalSliderUI.
- createUI in interface BasicSliderUI
component
- the component for which we return an UI instance
- an instance of MetalSliderUI
getThumbOverhang
protected int getThumbOverhang()
Returns the thumb overhang.
- The thumb overhang.
getTickLength
public int getTickLength()
Returns the length of the major tick marks.
- getTickLength in interface BasicSliderUI
- The length of the major tick marks.
getTrackLength
protected int getTrackLength()
Returns the track length.
- The track length.
getTrackWidth
protected int getTrackWidth()
Returns the track width.
- The track width.
installUI
public void installUI(JComponent c)
Installs and initializes all fields for this UI delegate. Any properties
of the UI that need to be initialized and/or set to defaults will be
done now. It will also install any listeners necessary.
- installUI in interface BasicSliderUI
c
- The JComponent
that is having this UI installed.
paintFocus
public void paintFocus(Graphics g)
Draws the focus rectangle for the slider. The Metal look and feel
indicates that the
JSlider
has the focus by changing the color of
the thumb control - this is handled elsewhere and so this method is empty
(it overrides the method in the
BasicSliderUI
class to prevent
a default focus highlight from being drawn).
- paintFocus in interface BasicSliderUI
g
- the graphics device.
paintMajorTickForHorizSlider
protected void paintMajorTickForHorizSlider(Graphics g,
Rectangle tickBounds,
int x)
Paints the major ticks for a slider with a horizontal orientation.
- paintMajorTickForHorizSlider in interface BasicSliderUI
g
- the graphics device.tickBounds
- the tick bounds.x
- the x value for the tick.
paintMajorTickForVertSlider
protected void paintMajorTickForVertSlider(Graphics g,
Rectangle tickBounds,
int y)
Paints the major ticks for a slider with a vertical orientation.
- paintMajorTickForVertSlider in interface BasicSliderUI
g
- the graphics device.tickBounds
- the tick bounds.y
- the y value for the tick.
paintMinorTickForHorizSlider
protected void paintMinorTickForHorizSlider(Graphics g,
Rectangle tickBounds,
int x)
Paints the minor ticks for a slider with a horizontal orientation.
- paintMinorTickForHorizSlider in interface BasicSliderUI
g
- the graphics device.tickBounds
- the tick bounds.x
- the x value for the tick.
paintMinorTickForVertSlider
protected void paintMinorTickForVertSlider(Graphics g,
Rectangle tickBounds,
int y)
Paints the minor ticks for a slider with a vertical orientation.
- paintMinorTickForVertSlider in interface BasicSliderUI
g
- the graphics device.tickBounds
- the tick bounds.y
- the y value for the tick.
paintTrack
public void paintTrack(Graphics g)
Paints the track along which the thumb control moves.
- paintTrack in interface BasicSliderUI
g
- the graphics device.
scrollDueToClickInTrack
protected void scrollDueToClickInTrack(int dir)
This method is called when there has been a click in the track and the
thumb needs to be scrolled on regular intervals. This method is only
responsible for starting the timer and not for stopping it.
- scrollDueToClickInTrack in interface BasicSliderUI
dir
- The direction to move in.
MetalSliderUI.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.