E - component typeU - component UI typeD - decoration typepublic abstract class AbstractLabelPainter<E extends javax.swing.JLabel,U extends javax.swing.plaf.basic.BasicLabelUI,D extends IDecoration<E,D>> extends AbstractDecorationPainter<E,U,D> implements IAbstractLabelPainter<E,U>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
drawShade
Style settings.
|
protected java.awt.Rectangle |
paintIconR
Runtime variables.
|
protected java.awt.Rectangle |
paintTextR |
protected java.awt.Rectangle |
paintViewR |
protected Rotation |
rotation |
protected java.awt.Color |
shadeColor |
protected int |
shadeSize |
ancestor, DECORATION_STATES_PROPERTY, decorationCache, decorations, focused, focusStateTracker, hierarchyTracker, hover, hoverStateTracker, neighboursTracker, statescomponent, listeners, ltr, propertyChangeListener, ui| Constructor and Description |
|---|
AbstractLabelPainter() |
| Modifier and Type | Method and Description |
|---|---|
protected Rotation |
getActualRotation()
Returns actual label rotation.
|
java.awt.Insets |
getCompleteBorder()
Updates component border according to component's margin and padding and painter's borders.
|
protected java.awt.Dimension |
getContentSize()
Returns label content size.
|
java.awt.Dimension |
getPreferredSize()
Returns preferred size required for proper painting of visual data provided by this painter.
|
protected boolean |
isHtmlText(E label)
Returns whether or not label contains HTML text.
|
protected java.lang.Boolean |
isOpaqueUndecorated()
Returns opacity state for undecorated component.
|
protected java.lang.String |
layout(E label,
java.awt.FontMetrics fm,
int width,
int height)
Updates painted label layout and returns clipped or full label text.
|
protected java.lang.String |
layoutCL(E label,
java.awt.FontMetrics fm,
java.lang.String text,
javax.swing.Icon icon,
java.awt.Rectangle viewR,
java.awt.Rectangle iconR,
java.awt.Rectangle textR)
Performs label layout and returns clipped or full label text.
|
protected void |
paintBackground(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E label,
U ui)
Paints background.
|
protected void |
paintContent(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
Paints content decorated by this painter.
|
protected void |
paintDisabledText(E label,
java.awt.Graphics2D g2d,
java.lang.String text,
int textX,
int textY)
Performs disabled text painting.
|
protected void |
paintEnabledText(E label,
java.awt.Graphics2D g2d,
java.lang.String text,
int textX,
int textY)
Performs enabled text painting.
|
protected void |
paintHtmlText(java.awt.Graphics2D g2d,
E label)
Paints HTML text view.
|
protected void |
paintIcon(java.awt.Graphics2D g2d,
E label,
javax.swing.Icon icon)
Paints label icon.
|
protected void |
paintPlainText(java.awt.Graphics2D g2d,
E label,
java.lang.String text,
java.awt.FontMetrics fm)
Paints plain text view.
|
protected void |
paintShadowText(java.awt.Graphics2D g2d,
java.lang.String text,
int textX,
int textY)
Paints custom text shade.
|
protected void |
paintText(java.awt.Graphics2D g2d,
E label,
java.lang.String text,
java.awt.FontMetrics fm)
Paints label text.
|
protected java.awt.Dimension |
transposeDimension(java.awt.Dimension from)
Returns transposed dimension.
|
adjustBounds, asList, collectDecorationStates, getBorders, getDecoration, getDecorations, getDecorationSize, getDecorationStates, getSectionPainters, install, installFocusListener, installHierarchyListener, installHoverListener, isDecorated, isDecorationPaintAllowed, isEnabled, isFocused, isHover, isOpaque, isOpaqueDecorated, isPlainBackgroundPaintAllowed, paint, propertyChange, provideShape, uninstall, uninstallFocusListener, uninstallHierarchyListener, uninstallHoverListener, updateDecorationState, usesState, usesStateaddPainterListener, b, borderChange, 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, install, isOpaque, paint, removePainterListener, uninstallprotected boolean drawShade
protected java.awt.Color shadeColor
protected int shadeSize
protected Rotation rotation
protected java.awt.Rectangle paintIconR
protected java.awt.Rectangle paintTextR
protected java.awt.Rectangle paintViewR
protected Rotation getActualRotation()
protected java.lang.Boolean isOpaqueUndecorated()
AbstractDecorationPainterisOpaqueUndecorated in class AbstractDecorationPainter<E extends javax.swing.JLabel,U extends javax.swing.plaf.basic.BasicLabelUI,D extends IDecoration<E,D>>public java.awt.Insets getCompleteBorder()
AbstractPaintergetCompleteBorder in class AbstractPainter<E extends javax.swing.JLabel,U extends javax.swing.plaf.basic.BasicLabelUI>protected void paintContent(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
AbstractDecorationPainterpaintContent in class AbstractDecorationPainter<E extends javax.swing.JLabel,U extends javax.swing.plaf.basic.BasicLabelUI,D extends IDecoration<E,D>>g2d - graphics contextbounds - painting boundsc - painted componentui - painted component UIprotected void paintBackground(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E label,
U ui)
g2d - graphics contextbounds - bounds for painter visual datalabel - painted componentui - painted component UIprotected void paintIcon(java.awt.Graphics2D g2d,
E label,
javax.swing.Icon icon)
g2d - graphics contextlabel - painted componenticon - label iconprotected void paintText(java.awt.Graphics2D g2d,
E label,
java.lang.String text,
java.awt.FontMetrics fm)
g2d - graphics contextlabel - painted componenttext - label textfm - label font metricsprotected boolean isHtmlText(E label)
label - painted componentprotected void paintHtmlText(java.awt.Graphics2D g2d,
E label)
g2d - graphics contextlabel - painted componentprotected void paintPlainText(java.awt.Graphics2D g2d,
E label,
java.lang.String text,
java.awt.FontMetrics fm)
g2d - graphics contextlabel - painted componenttext - label textfm - label font metricsprotected java.lang.String layout(E label, java.awt.FontMetrics fm, int width, int height)
label - painted componentfm - label font metricswidth - label widthheight - label heightprotected java.lang.String layoutCL(E label, java.awt.FontMetrics fm, java.lang.String text, javax.swing.Icon icon, java.awt.Rectangle viewR, java.awt.Rectangle iconR, java.awt.Rectangle textR)
label - painted componentfm - label font metricstext - label texticon - label iconviewR - rectangle limited by label insetsiconR - icon rectangle dummytextR - text rectangle dummyprotected void paintEnabledText(E label, java.awt.Graphics2D g2d, java.lang.String text, int textX, int textY)
label - painted componentg2d - graphics contexttext - label texttextX - text X coordinatetextY - text Y coordinateprotected void paintDisabledText(E label, java.awt.Graphics2D g2d, java.lang.String text, int textX, int textY)
label - painted componentg2d - graphics contexttext - label texttextX - text X coordinatetextY - text Y coordinateprotected void paintShadowText(java.awt.Graphics2D g2d,
java.lang.String text,
int textX,
int textY)
g2d - graphics contexttext - texttextX - text X coordinatetextY - text Y coordinatepublic java.awt.Dimension getPreferredSize()
PaintergetPreferredSize in interface Painter<E extends javax.swing.JLabel,U extends javax.swing.plaf.basic.BasicLabelUI>getPreferredSize in class AbstractDecorationPainter<E extends javax.swing.JLabel,U extends javax.swing.plaf.basic.BasicLabelUI,D extends IDecoration<E,D>>protected java.awt.Dimension getContentSize()
protected java.awt.Dimension transposeDimension(java.awt.Dimension from)
from - dimension to transpose