E - component typeU - component UI typepublic class ScrollBarPainter<E extends javax.swing.JScrollBar,U extends WebScrollBarUI> extends AbstractPainter<E,U> implements IScrollBarPainter<E,U>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
animated
Runtime variables.
|
protected boolean |
dragged |
protected java.awt.event.MouseAdapter |
mouseAdapter
Listeners.
|
protected boolean |
pressed |
protected boolean |
rollover |
protected com.alee.utils.swing.WebTimer |
rolloverAnimator |
protected float |
rolloverState |
protected java.lang.Integer |
scrollBarWidth |
protected java.awt.Color |
thumbBackgroundColor |
protected java.awt.Color |
thumbBorderColor |
protected java.awt.Rectangle |
thumbBounds |
protected java.awt.Color |
thumbDisabledBackgroundColor |
protected java.awt.Color |
thumbDisabledBorderColor |
protected java.awt.Insets |
thumbMargin |
protected java.awt.Insets |
thumbMarginHL |
protected java.awt.Insets |
thumbMarginHR |
protected java.awt.Insets |
thumbMarginR |
protected java.awt.Color |
thumbPressedBackgroundColor |
protected java.awt.Color |
thumbPressedBorderColor |
protected java.awt.Color |
thumbRolloverBackgroundColor |
protected java.awt.Color |
thumbRolloverBorderColor |
protected java.lang.Integer |
thumbRound
Style settings.
|
protected java.awt.Color |
trackBackgroundColor |
protected java.awt.Color |
trackBorderColor |
protected java.awt.Rectangle |
trackBounds
Painting variables.
|
component, listeners, ltr, propertyChangeListener, ui| Constructor and Description |
|---|
ScrollBarPainter() |
| Modifier and Type | Method and Description |
|---|---|
java.awt.Insets |
getBorders()
Returns borders required for visual data provided by this painter.
|
protected java.awt.Color |
getCurrentThumbBackgroundColor(E scrollbar)
Returns current thumb background color.
|
protected java.awt.Color |
getCurrentThumbBorderColor(E scrollbar)
Returns current thumb border color.
|
protected java.awt.Insets |
getCurrentThumbMargin(E scrollbar)
Returns current thumb margin rotated into proper position.
|
java.awt.Dimension |
getPreferredSize()
Returns preferred size required for proper painting of visual data provided by this painter.
|
void |
install(E c,
U ui)
Called when painter is installed onto some component.
|
java.lang.Boolean |
isOpaque()
Returns whether visual data provided by this painter is opaque or not.
|
boolean |
isPressed()
Returns whether scroll bar thumb is pressed or not.
|
boolean |
isRollover()
Returns whether scroll bar thumb is in rollover state or not.
|
void |
paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E scrollbar,
U ui)
Paints visual data using component graphics context.
|
protected void |
paintBackground(java.awt.Graphics2D g2d,
E scrollbar,
java.awt.Rectangle bounds)
Paints scroll bar background.
|
protected void |
paintThumb(java.awt.Graphics2D g2d,
E scrollbar,
java.awt.Rectangle bounds)
Paints scroll bar thumb.
|
protected void |
paintTrack(java.awt.Graphics2D g2d,
E scrollbar,
java.awt.Rectangle bounds)
Paints scroll bar track.
|
void |
repaintThumb()
Forces scroll bar thumb to be repainted.
|
void |
setDragged(boolean dragged)
Sets whether scroll bar thumb is being dragged or not.
|
void |
setPressed(boolean pressed)
Sets whether scroll bar thumb is pressed or not.
|
void |
setRollover(boolean rollover)
Sets whether scroll bar thumb is in rollover state or not.
|
void |
setThumbBounds(java.awt.Rectangle bounds)
Sets scroll bar thumb bounds.
|
void |
setTrackBounds(java.awt.Rectangle bounds)
Sets scroll bar track bounds.
|
void |
uninstall(E c,
U ui)
Called when painter is installed into some component.
|
protected void |
updateThumbMargins()
Updates thumb margins cache.
|
addPainterListener, b, borderChange, getCompleteBorder, i, i, i, installPropertyChangeListener, 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, removePainterListenerprotected java.lang.Integer thumbRound
protected java.awt.Insets thumbMargin
protected java.lang.Integer scrollBarWidth
protected java.awt.Color trackBorderColor
protected java.awt.Color trackBackgroundColor
protected java.awt.Color thumbBorderColor
protected java.awt.Color thumbBackgroundColor
protected java.awt.Color thumbDisabledBorderColor
protected java.awt.Color thumbDisabledBackgroundColor
protected java.awt.Color thumbRolloverBorderColor
protected java.awt.Color thumbRolloverBackgroundColor
protected java.awt.Color thumbPressedBorderColor
protected java.awt.Color thumbPressedBackgroundColor
protected java.awt.event.MouseAdapter mouseAdapter
protected boolean animated
protected com.alee.utils.swing.WebTimer rolloverAnimator
protected float rolloverState
protected boolean rollover
protected boolean pressed
protected boolean dragged
protected java.awt.Rectangle trackBounds
protected java.awt.Rectangle thumbBounds
protected java.awt.Insets thumbMarginR
protected java.awt.Insets thumbMarginHL
protected java.awt.Insets thumbMarginHR
public void install(E c, U ui)
Painterinstall in interface Painter<E extends javax.swing.JScrollBar,U extends WebScrollBarUI>install in class AbstractPainter<E extends javax.swing.JScrollBar,U extends WebScrollBarUI>c - component this painter is being installed ontoui - component UIpublic void uninstall(E c, U ui)
Painteruninstall in interface Painter<E extends javax.swing.JScrollBar,U extends WebScrollBarUI>uninstall in class AbstractPainter<E extends javax.swing.JScrollBar,U extends WebScrollBarUI>c - component this painter is being uninstalled fromui - component UIpublic boolean isRollover()
public void setRollover(boolean rollover)
rollover - whether scroll bar thumb is in rollover state or notpublic boolean isPressed()
public void setPressed(boolean pressed)
pressed - whether scroll bar thumb is pressed or notpublic void setDragged(boolean dragged)
IScrollBarPaintersetDragged in interface IScrollBarPainter<E extends javax.swing.JScrollBar,U extends WebScrollBarUI>dragged - whether scroll bar thumb is being dragged or notpublic void setTrackBounds(java.awt.Rectangle bounds)
IScrollBarPaintersetTrackBounds in interface IScrollBarPainter<E extends javax.swing.JScrollBar,U extends WebScrollBarUI>bounds - new scroll bar track boundspublic void setThumbBounds(java.awt.Rectangle bounds)
IScrollBarPaintersetThumbBounds in interface IScrollBarPainter<E extends javax.swing.JScrollBar,U extends WebScrollBarUI>bounds - new scroll bar thumb boundspublic java.lang.Boolean isOpaque()
PainterisOpaque in interface Painter<E extends javax.swing.JScrollBar,U extends WebScrollBarUI>isOpaque in class AbstractPainter<E extends javax.swing.JScrollBar,U extends WebScrollBarUI>public java.awt.Insets getBorders()
Painter
You may pass null in case additional borders aren't needed for this painter.
getBorders in interface Painter<E extends javax.swing.JScrollBar,U extends WebScrollBarUI>getBorders in class AbstractPainter<E extends javax.swing.JScrollBar,U extends WebScrollBarUI>null in case those aren't neededpublic void paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E scrollbar,
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.JScrollBar,U extends WebScrollBarUI>g2d - graphics contextbounds - painting boundsscrollbar - painted componentui - painted component UIprotected void paintBackground(java.awt.Graphics2D g2d,
E scrollbar,
java.awt.Rectangle bounds)
g2d - graphics contextscrollbar - scroll barbounds - scroll bar boundsprotected void paintTrack(java.awt.Graphics2D g2d,
E scrollbar,
java.awt.Rectangle bounds)
g2d - graphics contextscrollbar - scroll barbounds - track boundsprotected void paintThumb(java.awt.Graphics2D g2d,
E scrollbar,
java.awt.Rectangle bounds)
g2d - graphics contextscrollbar - scroll bar componentbounds - thumb boundsprotected java.awt.Insets getCurrentThumbMargin(E scrollbar)
scrollbar - scroll bar componentprotected void updateThumbMargins()
protected java.awt.Color getCurrentThumbBorderColor(E scrollbar)
scrollbar - scroll bar componentprotected java.awt.Color getCurrentThumbBackgroundColor(E scrollbar)
scrollbar - scroll bar componentpublic void repaintThumb()
public java.awt.Dimension getPreferredSize()
PaintergetPreferredSize in interface Painter<E extends javax.swing.JScrollBar,U extends WebScrollBarUI>getPreferredSize in class AbstractPainter<E extends javax.swing.JScrollBar,U extends WebScrollBarUI>