org.globus.tools.ui.swing
Class MultiLineLabelUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.LabelUI
javax.swing.plaf.basic.BasicLabelUI
org.globus.tools.ui.swing.MultiLineLabelUI
- All Implemented Interfaces:
- PropertyChangeListener, EventListener
public class MultiLineLabelUI
- extends BasicLabelUI
Method Summary |
static Dimension |
computeMultiLineDimension(FontMetrics fm,
String[] strs)
|
protected void |
drawString(Graphics g,
String s,
int accChar,
int textX,
int textY)
|
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)
|
String[] |
splitStringByLines(String str)
|
Methods inherited from class javax.swing.plaf.basic.BasicLabelUI |
createUI, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, paint, propertyChange, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
str
protected String str
strs
protected String[] strs
MultiLineLabelUI
public MultiLineLabelUI()
layoutCL
protected String layoutCL(JLabel label,
FontMetrics fontMetrics,
String text,
Icon icon,
Rectangle viewR,
Rectangle iconR,
Rectangle textR)
- Overrides:
layoutCL
in class BasicLabelUI
layoutCompoundLabel
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)
- 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. Locations are computed
relative to the viewR rectangle.
The JComponents orientation (LEADING/TRAILING) will also be taken
into account and translated into LEFT/RIGHT values accordingly.
layoutCompoundLabel
public 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. Locations are computed
relative to the viewR rectangle.
This layoutCompoundLabel() does not know how to handle LEADING/TRAILING
values in horizontalTextPosition (they will default to RIGHT) and in
horizontalAlignment (they will default to CENTER).
Use the other version of layoutCompoundLabel() instead.
paintEnabledText
protected void paintEnabledText(JLabel l,
Graphics g,
String s,
int textX,
int textY)
- Overrides:
paintEnabledText
in class BasicLabelUI
paintDisabledText
protected void paintDisabledText(JLabel l,
Graphics g,
String s,
int textX,
int textY)
- Overrides:
paintDisabledText
in class BasicLabelUI
drawString
protected void drawString(Graphics g,
String s,
int accChar,
int textX,
int textY)
computeMultiLineDimension
public static Dimension computeMultiLineDimension(FontMetrics fm,
String[] strs)
splitStringByLines
public String[] splitStringByLines(String str)