public class BasicStyledLabelUI
extends javax.swing.plaf.basic.BasicLabelUI
implements javax.swing.SwingConstants
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<StyleRange> |
_comparator |
protected static BasicStyledLabelUI |
styledLabelUI |
Constructor and Description |
---|
BasicStyledLabelUI() |
Modifier and Type | Method and Description |
---|---|
protected void |
buildStyledText(StyledLabel label) |
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c) |
protected java.awt.Font |
getFont(StyledLabel label)
Gets the font from the label.
|
protected java.awt.Dimension |
getPreferredSize(StyledLabel label) |
protected java.lang.String |
layoutCL(javax.swing.JLabel label,
java.awt.FontMetrics fontMetrics,
java.lang.String text,
javax.swing.Icon icon,
java.awt.Rectangle viewR,
java.awt.Rectangle iconR,
java.awt.Rectangle textR) |
static java.lang.String |
layoutCompoundLabel(java.awt.FontMetrics fm,
java.lang.String text,
javax.swing.Icon icon,
int verticalAlignment,
int horizontalAlignment,
int verticalTextPosition,
int horizontalTextPosition,
java.awt.Rectangle viewR,
java.awt.Rectangle iconR,
java.awt.Rectangle textR,
int textIconGap)
Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly
clipped version of the compound labels string.
|
static java.lang.String |
layoutCompoundLabel(javax.swing.JComponent c,
java.awt.FontMetrics fm,
java.lang.String text,
javax.swing.Icon icon,
int verticalAlignment,
int horizontalAlignment,
int verticalTextPosition,
int horizontalTextPosition,
java.awt.Rectangle viewR,
java.awt.Rectangle iconR,
java.awt.Rectangle textR,
int textIconGap)
Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly
clipped version of the compound labels string.
|
protected void |
paintDisabledText(javax.swing.JLabel l,
java.awt.Graphics g,
java.lang.String s,
int textX,
int textY) |
protected void |
paintEnabledText(javax.swing.JLabel l,
java.awt.Graphics g,
java.lang.String s,
int textX,
int textY) |
protected void |
paintStyledText(StyledLabel label,
java.awt.Graphics g,
int textX,
int textY) |
void |
propertyChange(java.beans.PropertyChangeEvent e) |
getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, paint, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
public static java.util.Comparator<StyleRange> _comparator
protected static BasicStyledLabelUI styledLabelUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange
in interface java.beans.PropertyChangeListener
propertyChange
in class javax.swing.plaf.basic.BasicLabelUI
protected void paintEnabledText(javax.swing.JLabel l, java.awt.Graphics g, java.lang.String s, int textX, int textY)
paintEnabledText
in class javax.swing.plaf.basic.BasicLabelUI
protected void paintDisabledText(javax.swing.JLabel l, java.awt.Graphics g, java.lang.String s, int textX, int textY)
paintDisabledText
in class javax.swing.plaf.basic.BasicLabelUI
protected void buildStyledText(StyledLabel label)
protected java.lang.String layoutCL(javax.swing.JLabel label, java.awt.FontMetrics fontMetrics, java.lang.String text, javax.swing.Icon icon, java.awt.Rectangle viewR, java.awt.Rectangle iconR, java.awt.Rectangle textR)
layoutCL
in class javax.swing.plaf.basic.BasicLabelUI
protected java.awt.Dimension getPreferredSize(StyledLabel label)
protected java.awt.Font getFont(StyledLabel label)
label
- the label.protected void paintStyledText(StyledLabel label, java.awt.Graphics g, int textX, int textY)
public static java.lang.String layoutCompoundLabel(javax.swing.JComponent c, java.awt.FontMetrics fm, java.lang.String text, javax.swing.Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, java.awt.Rectangle viewR, java.awt.Rectangle iconR, java.awt.Rectangle textR, int textIconGap)
c
- the componentfm
- the font metricstext
- the texticon
- the iconverticalAlignment
- vertical alignment modehorizontalAlignment
- horizontal alignment modeverticalTextPosition
- vertical text positionhorizontalTextPosition
- horizontal text positionviewR
- view rectangleiconR
- icon rectangletextR
- text rectangletextIconGap
- the gap between text and iconpublic static java.lang.String layoutCompoundLabel(java.awt.FontMetrics fm, java.lang.String text, javax.swing.Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, java.awt.Rectangle viewR, java.awt.Rectangle iconR, java.awt.Rectangle textR, int textIconGap)
fm
- the font metricstext
- the texticon
- the iconverticalAlignment
- vertical alignment modehorizontalAlignment
- horizontal alignment modeverticalTextPosition
- vertical text positionhorizontalTextPosition
- horizontal text positionviewR
- view rectangleiconR
- icon rectangletextR
- text rectangletextIconGap
- the gap between text and icon