public class GradientSliderUI extends MultiThumbSliderUI
slider.putClientProperty(key,value);
Or you can set these globally by calling:
UIManager.put(key,value);
The three properties are:
| Property Name | Default Value | Description |
| GradientSlider.useBevel | "false" | If this is
true, then this slider will be painted in a rectangle with a
bevel effect around the borders. If this is false, then this
slider will be painted in a rounded rectangle.
|
| GradientSlider.showTranslucency | "true" | If this is
true, then the slider will reflect the opacity of the colors in
the gradient, and paint a checkered background underneath the colors to
indicate opacity. If this is false, then this slider will always
paint with completely opaque colors, although the actual colors may be
translucent.
|
| GradientSlider.includeOpacity | "true" | This is used when
the user double-clicks a color and a ColorPicker dialog is invoked. (So this
value may not have any meaning if you override
GradientSlider.doDoubleClick().) This controls whether the
opacity/alpha controls are available in that dialog. This does not
control whether translucent colors can be used in this slider: translucent
colors are always allowed, if the user can enter them. |
| MultiThumbSlider.indicateComponent | "true" | If this is
true, then the thumbs will only paint on this component when the
mouse is inside this slider or when this slider as the keyboard
focus.
|
| MultiThumbSlider.indicateThumb | "true" | If this is
true, then the thumb the mouse is over will gently fade into a
slightly different color.
|
MultiThumbSliderUI.State| Modifier and Type | Field and Description |
|---|---|
(package private) int[] |
array
A temporary array used for the buffered image
|
(package private) static TexturePaint |
checkerPaint |
(package private) static GeneralPath |
hTriangle |
(package private) BufferedImage |
img
The width of this image is the absolute widest the track will ever
become.
|
(package private) int |
TRIANGLE_SIZE |
(package private) static GeneralPath |
vTriangle |
animatingRunnable, animatingThread, compListener, DEPTH, focusListener, indication, keyListener, MAX_LENGTH, MIN_LENGTH, PREF_LENGTH, propertyListener, slider, thumbIndications, thumbPositions, trackRect| Constructor and Description |
|---|
GradientSliderUI(GradientSlider slider) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
calculateGeometry() |
protected void |
calculateImage() |
protected Rectangle |
calculateTrackRect() |
private static void |
createCheckerPaint() |
int |
getClickLocationTolerance()
How many pixels can you deviate from a thumb and and still "click" it
|
private Shape |
getFrame()
The "frame" includes the trackRect and possible some extra padding.
|
Dimension |
getMinimumSize(JComponent s) |
Dimension |
getPreferredSize(JComponent s) |
protected void |
paintFocus(Graphics2D g) |
protected void |
paintThumbs(Graphics2D g) |
protected void |
paintTick(Graphics2D g,
float f,
int d) |
protected void |
paintTrack(Graphics2D g) |
addThumb, getMaximumSize, getProperty, installUI, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paint, uninstallUI, updateIndication, validatePositionscontains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, updateint TRIANGLE_SIZE
BufferedImage img
int[] array
static TexturePaint checkerPaint
static GeneralPath hTriangle
static GeneralPath vTriangle
public GradientSliderUI(GradientSlider slider)
public int getClickLocationTolerance()
MultiThumbSliderUIgetClickLocationTolerance in class MultiThumbSliderUIprotected void calculateImage()
public Dimension getMinimumSize(JComponent s)
getMinimumSize in class MultiThumbSliderUIpublic Dimension getPreferredSize(JComponent s)
getPreferredSize in class MultiThumbSliderUIprotected Rectangle calculateTrackRect()
calculateTrackRect in class MultiThumbSliderUIprotected void calculateGeometry()
calculateGeometry in class MultiThumbSliderUIprivate static void createCheckerPaint()
private Shape getFrame()
protected void paintTrack(Graphics2D g)
paintTrack in class MultiThumbSliderUIprotected void paintTick(Graphics2D g, float f, int d)
protected void paintFocus(Graphics2D g)
paintFocus in class MultiThumbSliderUIprotected void paintThumbs(Graphics2D g)
paintThumbs in class MultiThumbSliderUICopyright © 2007–2017 Gephi Consortium. All rights reserved.