public class BasicLabelUI extends javax.swing.plaf.LabelUI implements java.beans.PropertyChangeListener
| Modifier and Type | Field and Description |
|---|---|
protected static BasicLabelUI |
labelUI
The labelUI that is shared by all labels.
|
| Constructor and Description |
|---|
BasicLabelUI()
Creates a new BasicLabelUI object.
|
| Modifier and Type | Method and Description |
|---|---|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c)
Creates and returns a UI for the label.
|
java.awt.Dimension |
getMaximumSize(javax.swing.JComponent c)
This method returns the maximum size of the
JComponent given. |
java.awt.Dimension |
getMinimumSize(javax.swing.JComponent c)
This method returns the minimum size of the
JComponent given. |
java.awt.Dimension |
getPreferredSize(javax.swing.JComponent c)
Returns the preferred size of this component as calculated by the
layoutCL(JLabel, FontMetrics, String, Icon, Rectangle, Rectangle,
Rectangle) method. |
protected void |
installComponents(javax.swing.JLabel c)
This method installs the components for this
JLabel. |
protected void |
installDefaults(javax.swing.JLabel c)
This method installs the defaults that are defined in the Basic look and
feel for this
JLabel. |
protected void |
installKeyboardActions(javax.swing.JLabel l)
Installs the keyboard actions for the given
JLabel. |
protected void |
installListeners(javax.swing.JLabel c)
This method installs the listeners for the given
JLabel. |
void |
installUI(javax.swing.JComponent c)
This method installs the UI for the given
JComponent. |
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.
|
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c)
The method that paints the label according to its current state.
|
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.
|
void |
propertyChange(java.beans.PropertyChangeEvent e)
This method is called whenever any JLabel's that use this UI has one of
their properties change.
|
protected void |
uninstallComponents(javax.swing.JLabel c)
This method uninstalls the components for this
JLabel. |
protected void |
uninstallDefaults(javax.swing.JLabel c)
This method uninstalls the defaults that are defined in the Basic look
and feel for this
JLabel. |
protected void |
uninstallKeyboardActions(javax.swing.JLabel l)
This method uninstalls the keyboard actions for the given
JLabel. |
protected void |
uninstallListeners(javax.swing.JLabel c)
This method uninstalls the listeners for the given
JLabel. |
void |
uninstallUI(javax.swing.JComponent c)
This method uninstalls the UI for the given
JComponent. |
protected static BasicLabelUI labelUI
public BasicLabelUI()
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
c - The JComponent that a UI is being created for.public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
layoutCL(JLabel, FontMetrics, String, Icon, Rectangle, Rectangle,
Rectangle) method.getPreferredSize in class javax.swing.plaf.ComponentUIc - This JComponent to get a preferred size for.public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
JComponent given. If
this method returns null, then it is up to the Layout Manager to give
this component a minimum size.getMinimumSize in class javax.swing.plaf.ComponentUIc - The JComponent to get a minimum size for.public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
JComponent given. If
this method returns null, then it is up to the Layout Manager to give
this component a maximum size.getMaximumSize in class javax.swing.plaf.ComponentUIc - The JComponent to get a maximum size for.public void paint(java.awt.Graphics g, javax.swing.JComponent c)
paint in class javax.swing.plaf.ComponentUIg - The Graphics object to paint with.c - The JComponent to paint.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)
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.protected void paintDisabledText(javax.swing.JLabel l, java.awt.Graphics g, java.lang.String s, int textX, int textY)
l - The JLabel being painted.g - The 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.protected void paintEnabledText(javax.swing.JLabel l, java.awt.Graphics g, java.lang.String s, int textX, int textY)
l - The JLabel being painted.g - The 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.public void installUI(javax.swing.JComponent c)
JComponent. This
method will install the component, defaults, listeners, and keyboard
actions.installUI in class javax.swing.plaf.ComponentUIc - The JComponent that this UI is being installed on.ComponentUI.uninstallUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()public void uninstallUI(javax.swing.JComponent c)
JComponent. This
method will uninstall the component, defaults, listeners, and keyboard
actions.uninstallUI in class javax.swing.plaf.ComponentUIc - The JComponent that this UI is being installed on.ComponentUI.installUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()protected void installComponents(javax.swing.JLabel c)
JLabel.c - The JLabel to install components for.protected void uninstallComponents(javax.swing.JLabel c)
JLabel.c - The JLabel to uninstall components for.protected void installDefaults(javax.swing.JLabel c)
JLabel.c - The JLabel to install defaults for.protected void uninstallDefaults(javax.swing.JLabel c)
JLabel.c - The JLabel to uninstall defaults for.protected void installKeyboardActions(javax.swing.JLabel l)
JLabel.l - The JLabel to install keyboard actions for.protected void uninstallKeyboardActions(javax.swing.JLabel l)
JLabel.l - The JLabel to uninstall keyboard actions for.protected void installListeners(javax.swing.JLabel c)
JLabel. The UI
delegate only listens to the label.c - The JLabel to install listeners for.protected void uninstallListeners(javax.swing.JLabel c)
JLabel. The UI
delegate only listens to the label.c - The JLabel to uninstall listeners for.public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenere - The PropertyChangeEvent that describes the change.