public abstract class AbstractButtonPainter<E extends javax.swing.AbstractButton,U extends javax.swing.plaf.basic.BasicButtonUI,D extends IDecoration<E,D>> extends AbstractDecorationPainter<E,U,D> implements IAbstractButtonPainter<E,U>
| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Rectangle |
iconRect |
protected javax.swing.event.ChangeListener |
modelChangeListener
Listeners.
|
protected java.awt.Color |
selectedForeground
Style settings.
|
protected java.awt.Rectangle |
textRect |
protected java.awt.Rectangle |
viewRect
Painting variables.
|
ancestor, DECORATION_STATES_PROPERTY, decorationCache, decorations, focused, focusStateTracker, hierarchyTracker, hover, hoverStateTracker, neighboursTracker, statescomponent, listeners, ltr, propertyChangeListener, ui| Constructor and Description |
|---|
AbstractButtonPainter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
calculateBounds(java.awt.FontMetrics fm)
Calculates view, icon and text bounds for future usage.
|
protected java.util.List<java.lang.String> |
getDecorationStates()
Returns current component decoration states.
|
void |
install(E c,
U ui)
Called when painter is installed onto some component.
|
protected java.lang.Boolean |
isOpaqueUndecorated()
Returns opacity state for undecorated component.
|
protected void |
paintContent(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
Paints content decorated by this painter.
|
protected void |
paintIcon(java.awt.Graphics2D g2d)
Paints button icon.
|
protected void |
paintText(java.awt.Graphics2D g2d)
Paints button text.
|
protected void |
propertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
Performs various updates on property changes.
|
void |
uninstall(E c,
U ui)
Called when painter is installed into some component.
|
adjustBounds, asList, collectDecorationStates, getBorders, 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, getBorders, getPreferredSize, isOpaque, paint, removePainterListenerprotected javax.swing.event.ChangeListener modelChangeListener
protected java.awt.Color selectedForeground
protected java.awt.Rectangle viewRect
protected java.awt.Rectangle textRect
protected java.awt.Rectangle iconRect
public void install(E c, U ui)
Painterinstall in interface Painter<E extends javax.swing.AbstractButton,U extends javax.swing.plaf.basic.BasicButtonUI>install in class AbstractDecorationPainter<E extends javax.swing.AbstractButton,U extends javax.swing.plaf.basic.BasicButtonUI,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 javax.swing.AbstractButton,U extends javax.swing.plaf.basic.BasicButtonUI>uninstall in class AbstractDecorationPainter<E extends javax.swing.AbstractButton,U extends javax.swing.plaf.basic.BasicButtonUI,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 AbstractDecorationPainter<E extends javax.swing.AbstractButton,U extends javax.swing.plaf.basic.BasicButtonUI,D extends IDecoration<E,D>>property - modified propertyoldValue - old property valuenewValue - new property valueprotected java.util.List<java.lang.String> getDecorationStates()
AbstractDecorationPaintergetDecorationStates in class AbstractDecorationPainter<E extends javax.swing.AbstractButton,U extends javax.swing.plaf.basic.BasicButtonUI,D extends IDecoration<E,D>>protected java.lang.Boolean isOpaqueUndecorated()
AbstractDecorationPainterisOpaqueUndecorated in class AbstractDecorationPainter<E extends javax.swing.AbstractButton,U extends javax.swing.plaf.basic.BasicButtonUI,D extends IDecoration<E,D>>protected void paintContent(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
AbstractDecorationPainterpaintContent in class AbstractDecorationPainter<E extends javax.swing.AbstractButton,U extends javax.swing.plaf.basic.BasicButtonUI,D extends IDecoration<E,D>>g2d - graphics contextbounds - painting boundsc - painted componentui - painted component UIprotected void calculateBounds(java.awt.FontMetrics fm)
fm - font metricsprotected void paintIcon(java.awt.Graphics2D g2d)
g2d - graphics contextprotected void paintText(java.awt.Graphics2D g2d)
g2d - graphics context