java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.LabelUI
javax.swing.plaf.basic.BasicLabelUI
org.gui4j.core.swing.MultiLineLabelUI
- All Implemented Interfaces:
- java.util.EventListener, java.beans.PropertyChangeListener
- public class MultiLineLabelUI
- extends javax.swing.plaf.basic.BasicLabelUI
|
Method Summary |
static java.awt.Dimension |
computeMultiLineDimension(java.awt.FontMetrics fm,
java.lang.String[] strs)
|
protected void |
drawString(java.awt.Graphics g,
java.lang.String s,
int accChar,
int textX,
int textY)
|
static javax.swing.plaf.LabelUI |
getInstance()
|
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)
This method is simply calls SwingUtilities's layoutCompoundLabel. |
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)
Paints the text if the label is disabled. |
protected void |
paintEnabledText(javax.swing.JLabel l,
java.awt.Graphics g,
java.lang.String s,
int textX,
int textY)
Paints the text if the label is enabled. |
java.lang.String[] |
splitStringByLines(java.lang.String pStr)
|
| Methods inherited from class javax.swing.plaf.basic.BasicLabelUI |
createUI, 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 |
LEADING
static final int LEADING
- See Also:
- Constant Field Values
TRAILING
static final int TRAILING
- See Also:
- Constant Field Values
LEFT
static final int LEFT
- See Also:
- Constant Field Values
RIGHT
static final int RIGHT
- See Also:
- Constant Field Values
TOP
static final int TOP
- See Also:
- Constant Field Values
CENTER
static final int CENTER
- See Also:
- Constant Field Values
str
protected java.lang.String str
strs
protected java.lang.String[] strs
MultiLineLabelUI
public MultiLineLabelUI()
getInstance
public static javax.swing.plaf.LabelUI getInstance()
layoutCL
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)
- Description copied from class:
javax.swing.plaf.basic.BasicLabelUI
- This method is simply calls SwingUtilities's layoutCompoundLabel.
layoutCompoundLabel
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)
- 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 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. 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(javax.swing.JLabel l,
java.awt.Graphics g,
java.lang.String s,
int textX,
int textY)
- Description copied from class:
javax.swing.plaf.basic.BasicLabelUI
- Paints the text if the label is enabled. The text is painted using the
foreground color.
paintDisabledText
protected void paintDisabledText(javax.swing.JLabel l,
java.awt.Graphics g,
java.lang.String s,
int textX,
int textY)
- Description copied from class:
javax.swing.plaf.basic.BasicLabelUI
- Paints the text if the label is disabled. By default, this paints the
clipped text returned by layoutCompoundLabel using the
background.brighter() color. It also paints the same text using the
background.darker() color one pixel to the right and one pixel down.
drawString
protected void drawString(java.awt.Graphics g,
java.lang.String s,
int accChar,
int textX,
int textY)
computeMultiLineDimension
public static java.awt.Dimension computeMultiLineDimension(java.awt.FontMetrics fm,
java.lang.String[] strs)
splitStringByLines
public java.lang.String[] splitStringByLines(java.lang.String pStr)