E - component typeU - component UI typepublic class SliderPainter<E extends javax.swing.JSlider,U extends WebSliderUI> extends AbstractPainter<E,U> implements ISliderPainter<E,U>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
angledThumb |
protected boolean |
animated |
protected javax.swing.event.ChangeListener |
changeListener |
protected java.awt.Rectangle |
contentRect |
protected boolean |
dragging |
protected boolean |
drawProgress |
protected boolean |
drawThumb |
protected java.awt.Rectangle |
focusRect |
protected java.awt.Insets |
insetCache |
protected java.awt.Rectangle |
labelRect |
protected boolean |
leftToRightCache |
static int |
MAX_DARKNESS |
protected java.awt.event.MouseAdapter |
mouseAdapter |
protected java.awt.event.MouseWheelListener |
mouseWheelListener
Listeners.
|
protected java.awt.Color |
progressBorderColor |
protected int |
progressRound |
protected int |
progressShadeWidth |
protected java.awt.Color |
progressTrackBgBottom |
protected java.awt.Color |
progressTrackBgTop |
protected boolean |
rollover
Runtime variables.
|
protected boolean |
rolloverDarkBorderOnly |
protected int |
rolloverDarkness |
protected com.alee.utils.swing.WebTimer |
rolloverTimer |
protected boolean |
sharpThumbAngle |
protected int |
thumbAngleLength |
protected java.awt.Color |
thumbBgBottom |
protected java.awt.Color |
thumbBgTop |
protected int |
thumbHeight |
protected java.awt.Rectangle |
thumbRect |
protected int |
thumbRound |
protected int |
thumbWidth |
protected java.awt.Rectangle |
tickRect |
protected java.awt.Color |
trackBgBottom |
protected java.awt.Color |
trackBgTop |
protected int |
trackBuffer
Painting variables.
|
protected int |
trackHeight
Style settings.
|
protected java.awt.Rectangle |
trackRect |
protected int |
trackRound |
protected int |
trackShadeWidth |
component, listeners, ltr, propertyChangeListener, ui| Constructor and Description |
|---|
SliderPainter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
calculateContentRect() |
protected void |
calculateFocusRect() |
protected void |
calculateGeometry() |
protected void |
calculateLabelRect() |
protected void |
calculateThumbLocation() |
protected void |
calculateThumbSize() |
protected void |
calculateTickRect() |
protected void |
calculateTrackBuffer() |
protected void |
calculateTrackRect() |
protected boolean |
drawInverted() |
protected java.awt.Color |
getBorderColor() |
protected int |
getHeightOfTallestLabel() |
protected java.lang.Integer |
getHighestValue()
Returns the biggest value that has an entry in the label table.
|
protected java.awt.Component |
getHighestValueLabel()
Returns the label that corresponds to the lowest slider value in the label table.
|
protected java.lang.Integer |
getLowestValue()
Returns the smallest value that has an entry in the label table.
|
protected java.awt.Component |
getLowestValueLabel()
Returns the label that corresponds to the highest slider value in the label table.
|
protected float |
getProgress() |
protected java.awt.Shape |
getProgressShape() |
protected java.awt.Shape |
getThumbShape() |
protected java.awt.Dimension |
getThumbSize() |
protected int |
getTickLength()
Gets the height of the tick area for horizontal sliders and the width of the
tick area for vertical sliders.
|
protected java.awt.Shape |
getTrackShape() |
protected int |
getWidthOfWidestLabel() |
void |
install(E c,
U ui)
Called when painter is installed onto some component.
|
void |
paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
Paints visual data using component graphics context.
|
protected void |
paintHorizontalLabel(java.awt.Graphics g,
int value,
java.awt.Component label)
Called for every label in the label table.
|
void |
paintLabels(java.awt.Graphics g) |
protected void |
paintMajorTickForHorizontalSlider(java.awt.Graphics g,
java.awt.Rectangle tickBounds,
int x) |
protected void |
paintMajorTickForVerticalSlider(java.awt.Graphics g,
java.awt.Rectangle tickBounds,
int y) |
protected void |
paintMinorTickForHorizontalSlider(java.awt.Graphics g,
java.awt.Rectangle tickBounds,
int x) |
protected void |
paintMinorTickForVerticalSlider(java.awt.Graphics g,
java.awt.Rectangle tickBounds,
int y) |
void |
paintThumb(java.awt.Graphics2D g2d) |
void |
paintTicks(java.awt.Graphics g) |
void |
paintTrack(java.awt.Graphics2D g2d) |
protected void |
paintVerticalLabel(java.awt.Graphics g,
int value,
java.awt.Component label)
Called for every label in the label table.
|
protected void |
recalculateIfInsetsChanged() |
protected void |
recalculateIfOrientationChanged() |
void |
setDragging(boolean dragging)
Provide true if the user is dragging the slider.
|
void |
uninstall(E c,
U ui)
Called when painter is installed into some component.
|
protected int |
xPositionForValue(int value) |
protected int |
yPositionForValue(int value) |
protected int |
yPositionForValue(int value,
int trackY,
int trackHeight)
Returns the y location for the specified value.
|
addPainterListener, b, borderChange, getBorders, getCompleteBorder, getPreferredSize, i, i, i, installPropertyChangeListener, isOpaque, isSectionPainter, isSettingsUpdateAllowed, orientationChange, p, propertyChange, removePainterListener, repaint, repaint, repaint, revalidate, saveOrientation, uninstallPropertyChangeListener, updateAll, updateBorder, updateOpacity, updateOrientationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPainterListener, getBorders, getPreferredSize, isOpaque, removePainterListenerpublic static final int MAX_DARKNESS
protected int trackHeight
protected int trackRound
protected int trackShadeWidth
protected int progressRound
protected int progressShadeWidth
protected int thumbWidth
protected int thumbHeight
protected int thumbRound
protected int thumbAngleLength
protected java.awt.Color trackBgTop
protected java.awt.Color trackBgBottom
protected java.awt.Color progressTrackBgTop
protected java.awt.Color progressTrackBgBottom
protected java.awt.Color progressBorderColor
protected java.awt.Color thumbBgTop
protected java.awt.Color thumbBgBottom
protected boolean drawProgress
protected boolean drawThumb
protected boolean angledThumb
protected boolean sharpThumbAngle
protected boolean rolloverDarkBorderOnly
protected boolean animated
protected java.awt.event.MouseWheelListener mouseWheelListener
protected javax.swing.event.ChangeListener changeListener
protected java.awt.event.MouseAdapter mouseAdapter
protected boolean rollover
protected int rolloverDarkness
protected com.alee.utils.swing.WebTimer rolloverTimer
protected int trackBuffer
protected java.awt.Insets insetCache
protected java.awt.Rectangle focusRect
protected java.awt.Rectangle contentRect
protected java.awt.Rectangle labelRect
protected java.awt.Rectangle tickRect
protected java.awt.Rectangle trackRect
protected java.awt.Rectangle thumbRect
protected boolean leftToRightCache
protected boolean dragging
public void install(E c, U ui)
Painterinstall in interface Painter<E extends javax.swing.JSlider,U extends WebSliderUI>install in class AbstractPainter<E extends javax.swing.JSlider,U extends WebSliderUI>c - component this painter is being installed ontoui - component UIpublic void uninstall(E c, U ui)
Painteruninstall in interface Painter<E extends javax.swing.JSlider,U extends WebSliderUI>uninstall in class AbstractPainter<E extends javax.swing.JSlider,U extends WebSliderUI>c - component this painter is being uninstalled fromui - component UIpublic void paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
PainterIt is highly recommended to honor provided painting bounds to avoid painting issues. These bounds might be representing full component size or contain just a small portion of the component.
paint in interface Painter<E extends javax.swing.JSlider,U extends WebSliderUI>g2d - graphics contextbounds - painting boundsc - painted componentui - painted component UIprotected void recalculateIfInsetsChanged()
protected void recalculateIfOrientationChanged()
protected void calculateGeometry()
protected void calculateFocusRect()
protected void calculateThumbSize()
protected void calculateContentRect()
protected void calculateThumbLocation()
protected void calculateTrackBuffer()
protected void calculateTrackRect()
protected int getTickLength()
protected void calculateTickRect()
protected void calculateLabelRect()
protected int xPositionForValue(int value)
protected int yPositionForValue(int value)
protected int yPositionForValue(int value,
int trackY,
int trackHeight)
trackHeight is negative undefined results may occur.value - the slider value to get the location fortrackY - y-origin of the tracktrackHeight - the height of the trackprotected boolean drawInverted()
protected java.lang.Integer getHighestValue()
protected java.lang.Integer getLowestValue()
protected java.awt.Component getLowestValueLabel()
JSlider.setLabelTable(java.util.Dictionary)protected java.awt.Component getHighestValueLabel()
JSlider.setLabelTable(java.util.Dictionary)protected int getWidthOfWidestLabel()
protected int getHeightOfTallestLabel()
protected java.awt.Dimension getThumbSize()
public void paintThumb(java.awt.Graphics2D g2d)
protected java.awt.Shape getThumbShape()
public void paintTrack(java.awt.Graphics2D g2d)
protected java.awt.Shape getTrackShape()
protected java.awt.Shape getProgressShape()
public void paintTicks(java.awt.Graphics g)
protected void paintMinorTickForHorizontalSlider(java.awt.Graphics g,
java.awt.Rectangle tickBounds,
int x)
protected void paintMajorTickForHorizontalSlider(java.awt.Graphics g,
java.awt.Rectangle tickBounds,
int x)
protected void paintMinorTickForVerticalSlider(java.awt.Graphics g,
java.awt.Rectangle tickBounds,
int y)
protected void paintMajorTickForVerticalSlider(java.awt.Graphics g,
java.awt.Rectangle tickBounds,
int y)
public void paintLabels(java.awt.Graphics g)
protected void paintHorizontalLabel(java.awt.Graphics g,
int value,
java.awt.Component label)
JSlider.setLabelTable(java.util.Dictionary)protected void paintVerticalLabel(java.awt.Graphics g,
int value,
java.awt.Component label)
JSlider.setLabelTable(java.util.Dictionary)protected float getProgress()
protected java.awt.Color getBorderColor()
public void setDragging(boolean dragging)
ISliderPaintersetDragging in interface ISliderPainter<E extends javax.swing.JSlider,U extends WebSliderUI>dragging - true if the user is dragging