E - component typeU - component UI typeD - decoration typepublic class SplitButtonPainter<E extends WebSplitButton,U extends WebSplitButtonUI,D extends IDecoration<E,D>> extends AbstractButtonPainter<E,U,D> implements ISplitButtonPainter<E,U>
| Modifier and Type | Field and Description |
|---|---|
protected int |
contentGap |
protected boolean |
onSplit
Runtime variables.
|
protected java.awt.event.MouseAdapter |
splitButtonTracker
Listeners.
|
protected int |
splitIconGap |
protected java.awt.Color |
splitLineColor
Style settings.
|
protected java.awt.Color |
splitLineDisabledColor |
iconRect, modelChangeListener, selectedForeground, textRect, viewRectancestor, DECORATION_STATES_PROPERTY, decorationCache, decorations, focused, focusStateTracker, hierarchyTracker, hover, hoverStateTracker, neighboursTracker, statescomponent, listeners, ltr, propertyChangeListener, ui| Constructor and Description |
|---|
SplitButtonPainter() |
| Modifier and Type | Method and Description |
|---|---|
java.awt.Insets |
getBorders()
Returns borders required for visual data provided by this painter.
|
int |
getContentGap()
Returns gap between split part and button content.
|
protected java.awt.Rectangle |
getSplitButtonBounds(java.awt.Rectangle b,
E c)
Returns bounds of the split button part.
|
protected java.awt.Rectangle |
getSplitButtonHitbox(E c)
Returns split button part hitbox.
|
int |
getSplitIconGap()
Returns gap between split icon and split part sides.
|
protected java.awt.Rectangle |
getSplitLineBounds(java.awt.Rectangle b,
E c)
Returns bounds of the split line part.
|
void |
install(E c,
U ui)
Called when painter is installed onto some component.
|
boolean |
isOnSplit()
Returns whether or not mouse is currently over the split menu button.
|
protected void |
paintContent(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
Paints content decorated by this painter.
|
protected void |
paintSplitButton(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c)
Paints split button.
|
protected void |
propertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
Performs various updates on property changes.
|
void |
setContentGap(int contentGap)
Sets gap between split part and button content.
|
void |
setSplitIconGap(int splitIconGap)
Sets gap between split icon and split part sides
|
void |
uninstall(E c,
U ui)
Called when painter is installed into some component.
|
calculateBounds, getDecorationStates, isOpaqueUndecorated, paintIcon, paintTextadjustBounds, asList, collectDecorationStates, getDecoration, getDecorations, getDecorationSize, getPreferredSize, getSectionPainters, installFocusListener, installHierarchyListener, installHoverListener, isDecorated, isDecorationPaintAllowed, isEnabled, isFocused, isHover, isOpaque, isOpaqueDecorated, isPlainBackgroundPaintAllowed, paint, provideShape, uninstallFocusListener, uninstallHierarchyListener, uninstallHoverListener, updateDecorationState, usesState, usesStateaddPainterListener, b, borderChange, getCompleteBorder, i, i, i, installPropertyChangeListener, isSectionPainter, isSettingsUpdateAllowed, orientationChange, p, removePainterListener, repaint, repaint, repaint, revalidate, saveOrientation, uninstallPropertyChangeListener, updateAll, updateBorder, updateOpacity, updateOrientationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPainterListener, getPreferredSize, isOpaque, paint, removePainterListenerprotected java.awt.Color splitLineColor
protected java.awt.Color splitLineDisabledColor
protected int splitIconGap
protected int contentGap
protected java.awt.event.MouseAdapter splitButtonTracker
protected boolean onSplit
public void install(E c, U ui)
Painterinstall in interface Painter<E extends WebSplitButton,U extends WebSplitButtonUI>install in class AbstractButtonPainter<E extends WebSplitButton,U extends WebSplitButtonUI,D extends IDecoration<E,D>>c - component this painter is being installed ontoui - component UIpublic void uninstall(E c, U ui)
Painteruninstall in interface Painter<E extends WebSplitButton,U extends WebSplitButtonUI>uninstall in class AbstractButtonPainter<E extends WebSplitButton,U extends WebSplitButtonUI,D extends IDecoration<E,D>>c - component this painter is being uninstalled fromui - component UIprotected void propertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
AbstractPainterpropertyChange in class AbstractButtonPainter<E extends WebSplitButton,U extends WebSplitButtonUI,D extends IDecoration<E,D>>property - modified propertyoldValue - old property valuenewValue - new property valuepublic int getSplitIconGap()
public void setSplitIconGap(int splitIconGap)
splitIconGap - gap between split icon and split part sidespublic int getContentGap()
public void setContentGap(int contentGap)
contentGap - gap between split part and button contentpublic boolean isOnSplit()
ISplitButtonPainterisOnSplit in interface ISplitButtonPainter<E extends WebSplitButton,U extends WebSplitButtonUI>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 WebSplitButton,U extends WebSplitButtonUI>getBorders in class AbstractDecorationPainter<E extends WebSplitButton,U extends WebSplitButtonUI,D extends IDecoration<E,D>>null in case those aren't neededprotected void paintContent(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
AbstractDecorationPainterpaintContent in class AbstractButtonPainter<E extends WebSplitButton,U extends WebSplitButtonUI,D extends IDecoration<E,D>>g2d - graphics contextbounds - painting boundsc - painted componentui - painted component UIprotected void paintSplitButton(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c)
g2d - graphics contextbounds - painting boundsc - split buttonprotected java.awt.Rectangle getSplitButtonBounds(java.awt.Rectangle b,
E c)
b - painting boundsc - split buttonprotected java.awt.Rectangle getSplitLineBounds(java.awt.Rectangle b,
E c)
b - painting boundsc - split buttonprotected java.awt.Rectangle getSplitButtonHitbox(E c)
c - split button