public class BasicStyledLabelUI extends BasicLabelUI implements SwingConstants
Modifier and Type | Field and Description |
---|---|
static Comparator<StyleRange> |
_comparator |
protected static BasicStyledLabelUI |
styledLabelUI |
labelUI
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor and Description |
---|
BasicStyledLabelUI() |
Modifier and Type | Method and Description |
---|---|
protected void |
buildStyledText(StyledLabel label) |
static ComponentUI |
createUI(JComponent c) |
protected Font |
getFont(StyledLabel label)
Gets the font from the label.
|
protected Dimension |
getPreferredSize(StyledLabel label) |
protected String |
layoutCL(JLabel label,
FontMetrics fontMetrics,
String text,
Icon icon,
Rectangle viewR,
Rectangle iconR,
Rectangle textR) |
static String |
layoutCompoundLabel(FontMetrics fm,
String text,
Icon icon,
int verticalAlignment,
int horizontalAlignment,
int verticalTextPosition,
int horizontalTextPosition,
Rectangle viewR,
Rectangle iconR,
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 String |
layoutCompoundLabel(JComponent c,
FontMetrics fm,
String text,
Icon icon,
int verticalAlignment,
int horizontalAlignment,
int verticalTextPosition,
int horizontalTextPosition,
Rectangle viewR,
Rectangle iconR,
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(JLabel l,
Graphics g,
String s,
int textX,
int textY) |
protected void |
paintEnabledText(JLabel l,
Graphics g,
String s,
int textX,
int textY) |
protected void |
paintStyledText(StyledLabel label,
Graphics g,
int textX,
int textY) |
void |
propertyChange(PropertyChangeEvent e) |
getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, paint, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
public static Comparator<StyleRange> _comparator
protected static BasicStyledLabelUI styledLabelUI
public static ComponentUI createUI(JComponent c)
public void propertyChange(PropertyChangeEvent e)
propertyChange
in interface PropertyChangeListener
propertyChange
in class BasicLabelUI
protected void paintEnabledText(JLabel l, Graphics g, String s, int textX, int textY)
paintEnabledText
in class BasicLabelUI
protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY)
paintDisabledText
in class BasicLabelUI
protected void buildStyledText(StyledLabel label)
protected String layoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR)
layoutCL
in class BasicLabelUI
protected Dimension getPreferredSize(StyledLabel label)
protected Font getFont(StyledLabel label)
label
- the label.protected void paintStyledText(StyledLabel label, Graphics g, int textX, int textY)
public static String layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, 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 String layoutCompoundLabel(FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, 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