PropertyChangeListener
, EventListener
, SwingConstants
public class BasicStyledLabelUI extends BasicLabelUI implements SwingConstants
Modifier and Type | Field | 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 | Description |
---|---|
BasicStyledLabelUI() |
Modifier and Type | Method | 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) |
Gets the preferred size of the text portion of the StyledLabel including the icon.
|
Dimension |
getPreferredSize(JComponent c) |
|
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, 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)
public Dimension getPreferredSize(JComponent c)
getPreferredSize
in class BasicLabelUI
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)
label
- the StyledLabelprotected 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