javax.swing.plaf.basic
public class BasicLabelUI extends LabelUI implements PropertyChangeListener
Field Summary | |
---|---|
protected static BasicLabelUI | labelUI The labelUI that is shared by all labels. |
Constructor Summary | |
---|---|
BasicLabelUI()
Creates a new BasicLabelUI object. |
Method Summary | |
---|---|
static ComponentUI | createUI(JComponent c)
Creates and returns a UI for the label. |
Dimension | getMaximumSize(JComponent c)
This method returns the maximum size of the {@link JComponent} given. |
Dimension | getMinimumSize(JComponent c)
This method returns the minimum size of the {@link JComponent} given. |
Dimension | getPreferredSize(JComponent c)
Returns the preferred size of this component as calculated by the
{@link #layoutCL(JLabel, FontMetrics, String, Icon, Rectangle, Rectangle,
Rectangle)} method.
|
protected void | installComponents(JLabel c)
This method installs the components for this {@link JLabel}.
|
protected void | installDefaults(JLabel c)
This method installs the defaults that are defined in the Basic look and
feel for this {@link JLabel}.
|
protected void | installKeyboardActions(JLabel l)
Installs the keyboard actions for the given {@link JLabel}.
|
protected void | installListeners(JLabel c)
This method installs the listeners for the given {@link JLabel}. |
void | installUI(JComponent c)
This method installs the UI for the given {@link JComponent}. |
protected String | layoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR)
This method is simply calls SwingUtilities's layoutCompoundLabel.
|
void | paint(Graphics g, JComponent c)
The method that paints the label according to its current state.
|
protected void | paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY)
Paints the text if the label is disabled. |
protected void | paintEnabledText(JLabel l, Graphics g, String s, int textX, int textY)
Paints the text if the label is enabled. |
void | propertyChange(PropertyChangeEvent e)
This method is called whenever any JLabel's that use this UI has one of
their properties change.
|
protected void | uninstallComponents(JLabel c)
This method uninstalls the components for this {@link JLabel}.
|
protected void | uninstallDefaults(JLabel c)
This method uninstalls the defaults that are defined in the Basic look
and feel for this {@link JLabel}.
|
protected void | uninstallKeyboardActions(JLabel l)
This method uninstalls the keyboard actions for the given {@link JLabel}.
|
protected void | uninstallListeners(JLabel c)
This method uninstalls the listeners for the given {@link JLabel}. |
void | uninstallUI(JComponent c)
This method uninstalls the UI for the given {@link JComponent}. |
Parameters: c The {@link JComponent} that a UI is being created for.
Returns: A label UI for the Basic Look and Feel.
Parameters: c The {@link JComponent} to get a maximum size for.
Returns: The maximum size.
Parameters: c The {@link JComponent} to get a minimum size for.
Returns: The minimum size.
Parameters: c This {@link JComponent} to get a preferred size for.
Returns: The preferred size.
Parameters: c The {@link JLabel} to install components for.
Parameters: c The {@link JLabel} to install defaults for.
Parameters: l The {@link JLabel} to install keyboard actions for.
Parameters: c The {@link JLabel} to install listeners for.
Parameters: c The {@link JComponent} that this UI is being installed on.
Parameters: label The label to lay out. fontMetrics The FontMetrics for the font used. text The text to paint. icon The icon to draw. viewR The entire viewable rectangle. iconR The icon bounds rectangle. textR The text bounds rectangle.
Returns: A possibly clipped version of the text.
Parameters: g The {@link Graphics} object to paint with. c The {@link JComponent} to paint.
Parameters: l The {@link JLabel} being painted. g The {@link Graphics} object to paint with. s The String to paint. textX The x coordinate of the start of the baseline. textY The y coordinate of the start of the baseline.
Parameters: l The {@link JLabel} being painted. g The {@link Graphics} object to paint with. s The String to paint. textX The x coordinate of the start of the baseline. textY The y coordinate of the start of the baseline.
Parameters: e The {@link PropertyChangeEvent} that describes the change.
Parameters: c The {@link JLabel} to uninstall components for.
Parameters: c The {@link JLabel} to uninstall defaults for.
Parameters: l The {@link JLabel} to uninstall keyboard actions for.
Parameters: c The {@link JLabel} to uninstall listeners for.
Parameters: c The {@link JComponent} that this UI is being installed on.