is new.
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.LabelUI
javax.swing.plaf.basic.BasicLabelUI
public class BasicLabelUI
A Windows L&F implementation of LabelUI. This implementation is completely static, i.e. there's only one UIView implementation that's shared by all JLabel objects.
| Field Summary | |
|---|---|
| protected static BasicLabelUI |
labelUI
|
| Constructor Summary | |
|---|---|
|
BasicLabelUI
() |
|
| Method Summary | |
|---|---|
| static ComponentUI |
createUI
(
JComponent
c) |
int
|
getBaseline
(
JComponent
Returns the baseline.
|
Component.BaselineResizeBehavior
|
getBaselineResizeBehavior
(
JComponent
Returns an enum indicating how the baseline of the component changes as the size changes.
|
| Dimension |
getMaximumSize
(
JComponent
c) Returns the specified component's maximum size appropriate for the look and feel. |
| Dimension |
getMinimumSize
(
JComponent
c) Returns the specified component's minimum size appropriate for the look and feel. |
| Dimension |
getPreferredSize
(
JComponent
c) Returns the specified component's preferred size appropriate for the look and feel. |
| protected void |
installComponents
(
JLabel
c) |
| protected void |
installDefaults
(
JLabel
c) |
| protected void |
installKeyboardActions
(
JLabel
l) |
| protected void |
installListeners
(
JLabel
c) |
| void |
installUI
(
JComponent
c) Configures the specified component appropriate for the look and feel. |
| protected String |
layoutCL
(
JLabel
label,
FontMetrics
fontMetrics,
String
text,
Icon
icon,
Rectangle
viewR,
Rectangle
iconR,
Rectangle
textR) Forwards the call to SwingUtilities.layoutCompoundLabel(). |
| void |
paint
(
Graphics
g,
JComponent
c) Paint the label text in the foreground color, if the label is opaque then paint the entire background with the background color. |
| protected void |
paintDisabledText
(
JLabel
l,
Graphics
g,
String
s, int textX, int textY) Paint clippedText at textX, textY with background.lighter() and then shifted down and to the right by one pixel with background.darker(). |
| protected void |
paintEnabledText
(
JLabel
l,
Graphics
g,
String
s, int textX, int textY) Paint clippedText at textX, textY with the labels foreground color. |
| void |
propertyChange
(
PropertyChangeEvent
e) This method gets called when a bound property is changed. |
| protected void |
uninstallComponents
(
JLabel
c) |
| protected void |
uninstallDefaults
(
JLabel
c) |
| protected void |
uninstallKeyboardActions
(
JLabel
c) |
| protected void |
uninstallListeners
(
JLabel
c) |
| void |
uninstallUI
(
JComponent
c) Reverses configuration which was done on the specified component during installUI. |
| Methods inherited from class javax.swing.plaf. ComponentUI |
|---|
| contains , getAccessibleChild , getAccessibleChildrenCount , update |
| Methods inherited from class java.lang. Object |
|---|
| clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
| Field Detail |
|---|
protected static BasicLabelUI labelUI
| Constructor Detail |
|---|
public BasicLabelUI()
| Method Detail |
|---|
protected String layoutCL(JLabel label,
FontMetrics fontMetrics,
String text,
Icon icon,
Rectangle viewR,
Rectangle iconR,
Rectangle textR)
protected void paintEnabledText(JLabel l,
Graphics g,
String s,
int textX,
int textY)
protected void paintDisabledText(JLabel l,
Graphics g,
String s,
int textX,
int textY)
public void paint(Graphics g,
JComponent c)
public Dimension getPreferredSize(JComponent c)
public Dimension getMinimumSize(JComponent c)
public Dimension getMaximumSize(JComponent c)
getBaseline
public int
getBaseline
(
JComponent
c, int width, int height)
Returns the baseline.
Overrides:
getBaseline
in class
ComponentUI
Parameters:
c - JComponent baseline is being requested for
width - the width to get the baseline for
height - the height to get the baseline for
Returns:
baseline or a value < 0 indicating there is no reasonable baseline
Throws:
NullPointerException
- if c is null
IllegalArgumentException
- if width or height is < 0
Since:
1.6
See Also:
JComponent.getBaseline(int, int)
getBaselineResizeBehavior
public
Component.BaselineResizeBehavior
getBaselineResizeBehavior
(
JComponent
c)
Returns an enum indicating how the baseline of the component changes as the size changes.
Overrides:
getBaselineResizeBehavior
in class
ComponentUI
Parameters:
c - JComponent to return baseline resize behavior for
Returns:
an enum indicating how the baseline changes as the component size changes
Throws:
NullPointerException
- if c is null
Since:
1.6
See Also:
JComponent.getBaseline(int, int)
public void installUI(JComponent c)
public void uninstallUI(JComponent c)
protected void installDefaults(JLabel c)
protected void installListeners(JLabel c)
protected void installComponents(JLabel c)
protected void installKeyboardActions(JLabel l)
protected void uninstallDefaults(JLabel c)
protected void uninstallListeners(JLabel c)
protected void uninstallComponents(JLabel c)
protected void uninstallKeyboardActions(JLabel c)
public static ComponentUI createUI(JComponent c)
public void propertyChange(PropertyChangeEvent e)