java.lang.Object | |||
↳ | javax.swing.plaf.ComponentUI | ||
↳ | javax.swing.plaf.LabelUI | ||
↳ | javax.swing.plaf.basic.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.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
labelUI | The default BasicLabelUI instance. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the baseline.
| |||||||||||
Returns an enum indicating how the baseline of the component
changes as the size changes.
| |||||||||||
Returns the specified component's maximum size appropriate for
the look and feel.
| |||||||||||
Returns the specified component's minimum size appropriate for
the look and feel.
| |||||||||||
Returns the specified component's preferred size appropriate for
the look and feel.
| |||||||||||
Configures the specified component appropriate for the look and feel.
| |||||||||||
Paint the label text in the foreground color, if the label
is opaque then paint the entire background with the background
color.
| |||||||||||
This method gets called when a bound property is changed.
| |||||||||||
Reverses configuration which was done on the specified component during
installUI . |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Forwards the call to SwingUtilities.layoutCompoundLabel().
| |||||||||||
Paint clippedText at textX, textY with background.lighter() and then
shifted down and to the right by one pixel with background.darker().
| |||||||||||
Paint clippedText at textX, textY with the labels foreground color.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
The default BasicLabelUI
instance. This field might
not be used. To change the default instance use a subclass which
overrides the createUI
method, and place that class
name in defaults table under the key "LabelUI".
Returns the baseline.
c | JComponent baseline is being requested for |
---|---|
width | the width to get the baseline for |
height | the height to get the baseline for |
Returns an enum indicating how the baseline of the component changes as the size changes.
c | JComponent to return baseline resize behavior for |
---|
NullPointerException |
---|
Returns the specified component's maximum size appropriate for
the look and feel. If null
is returned, the maximum
size will be calculated by the component's layout manager instead
(this is the preferred approach for any component with a specific
layout manager installed). The default implementation of this
method invokes getPreferredSize
and returns that value.
c | the component whose maximum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components |
---|
Returns the specified component's minimum size appropriate for
the look and feel. If null
is returned, the minimum
size will be calculated by the component's layout manager instead
(this is the preferred approach for any component with a specific
layout manager installed). The default implementation of this
method invokes getPreferredSize
and returns that value.
c | the component whose minimum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components |
---|
Returns the specified component's preferred size appropriate for
the look and feel. If null
is returned, the preferred
size will be calculated by the component's layout manager instead
(this is the preferred approach for any component with a specific
layout manager installed). The default implementation of this
method returns null
.
c | the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components |
---|
Configures the specified component appropriate for the look and feel.
This method is invoked when the ComponentUI
instance is being installed
as the UI delegate on the specified component. This method should
completely configure the component for the look and feel,
including the following:
LayoutManager
on the component if necessary.
PropertyChangeListener
on the component in order
to detect and respond to component property changes appropriately.
c | the component where this UI delegate is being installed |
---|
Paint the label text in the foreground color, if the label is opaque then paint the entire background with the background color. The Label text is drawn by paintEnabledText() or paintDisabledText(). The locations of the label parts are computed by layoutCL.
g | the Graphics context in which to paint |
---|---|
c | the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components |
This method gets called when a bound property is changed.
e | A PropertyChangeEvent object describing the event source and the property that has changed. |
---|
Reverses configuration which was done on the specified component during
installUI
. This method is invoked when this
UIComponent
instance is being removed as the UI delegate
for the specified component. This method should undo the
configuration performed in installUI
, being careful to
leave the JComponent
instance in a clean state (no
extraneous listeners, look-and-feel-specific property objects, etc.).
This should include the following:
c | the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components |
---|
Forwards the call to SwingUtilities.layoutCompoundLabel(). This method is here so that a subclass could do Label specific layout and to shorten the method name a little.
Paint clippedText at textX, textY with background.lighter() and then shifted down and to the right by one pixel with background.darker().
Paint clippedText at textX, textY with the labels foreground color.