Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.swing.plaf.basic
Class BasicLabelUI

    java.lang.Object
      |
      +--javax.swing.plaf.ComponentUI
            |
            +--javax.swing.plaf.LabelUI
                  |
                  +--javax.swing.plaf.basic.BasicLabelUI

Direct Known Subclasses:
  MetalLabelUI

public class BasicLabelUI
extends LabelUI
implements java.beans.PropertyChangeListener

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)`
`java.awt.Dimension` | `getMaximumSize(JComponent c)`
`java.awt.Dimension` | `getMinimumSize(JComponent c)`
`java.awt.Dimension` | `getPreferredSize(JComponent c)`
`protected void` | `installComponents(JLabel c)`
`protected void` | `installDefaults(JLabel c)`
`protected void` | `installKeyboardActions(JLabel l)`
`protected void` | `installListeners(JLabel c)`
`void` | `installUI(JComponent c)`
`protected java.lang.String` | `layoutCL(JLabel label, java.awt.FontMetrics fontMetrics, java.lang.String text, Icon icon, java.awt.Rectangle viewR, java.awt.Rectangle iconR, java.awt.Rectangle textR)` Forwards the call to SwingUtilities.layoutCompoundLabel().
`void` | `paint(java.awt.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, java.awt.Graphics g, java.lang.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, java.awt.Graphics g, java.lang.String s, int textX, int textY)` Paint clippedText at textX, textY with the labels foreground color.
`void` | `propertyChange(java.beans.PropertyChangeEvent e)`
`protected void` | `uninstallComponents(JLabel c)`
`protected void` | `uninstallDefaults(JLabel c)`
`protected void` | `uninstallKeyboardActions(JLabel c)`
`protected void` | `uninstallListeners(JLabel c)`
`void` | `uninstallUI(JComponent c)`

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

### labelUI

    protected static BasicLabelUI labelUI

Constructor Detail

### BasicLabelUI

    public BasicLabelUI()

Method Detail

### layoutCL

    protected java.lang.String layoutCL(JLabel label,
                                        java.awt.FontMetrics fontMetrics,
                                        java.lang.String text,
                                        Icon icon,
                                        java.awt.Rectangle viewR,
                                        java.awt.Rectangle iconR,
                                        java.awt.Rectangle textR)

  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.
  See Also:
    `SwingUtilities.layoutCompoundLabel(javax.swing.JComponent, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int)`

### paintEnabledText

    protected void paintEnabledText(JLabel l,
                                    java.awt.Graphics g,
                                    java.lang.String s,
                                    int textX,
                                    int textY)

  Paint clippedText at textX, textY with the labels foreground color.
  See Also:
    `paint(java.awt.Graphics, javax.swing.JComponent)`, `paintDisabledText(javax.swing.JLabel, java.awt.Graphics, java.lang.String, int, int)`

### paintDisabledText

    protected void paintDisabledText(JLabel l,
                                     java.awt.Graphics g,
                                     java.lang.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().
  See Also:
    `paint(java.awt.Graphics, javax.swing.JComponent)`, `paintEnabledText(javax.swing.JLabel, java.awt.Graphics, java.lang.String, int, int)`

### paint

    public void paint(java.awt.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. The Label text is drawn by paintEnabledText() or paintDisabledText(). The locations of the label parts are computed by layoutCL.
  Overrides:
    paint in class ComponentUI
  See Also:
    `paintEnabledText(javax.swing.JLabel, java.awt.Graphics, java.lang.String, int, int)`, `paintDisabledText(javax.swing.JLabel, java.awt.Graphics, java.lang.String, int, int)`, `layoutCL(javax.swing.JLabel, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle)`

### getPreferredSize

    public java.awt.Dimension getPreferredSize(JComponent c)

  Overrides:
    getPreferredSize in class ComponentUI

### getMinimumSize

    public java.awt.Dimension getMinimumSize(JComponent c)

  Returns:
    getPreferredSize(c)
  Overrides:
    getMinimumSize in class ComponentUI

### getMaximumSize

    public java.awt.Dimension getMaximumSize(JComponent c)

  Returns:
    getPreferredSize(c)
  Overrides:
    getMaximumSize in class ComponentUI

### installUI

    public void installUI(JComponent c)

  Overrides:
    installUI in class ComponentUI

### uninstallUI

    public void uninstallUI(JComponent c)

  Overrides:
    uninstallUI in class ComponentUI

### installDefaults

    protected void installDefaults(JLabel c)

### installListeners

    protected void installListeners(JLabel c)

### installComponents

    protected void installComponents(JLabel c)

### installKeyboardActions

    protected void installKeyboardActions(JLabel l)

### uninstallDefaults

    protected void uninstallDefaults(JLabel c)

### uninstallListeners

    protected void uninstallListeners(JLabel c)

### uninstallComponents

    protected void uninstallComponents(JLabel c)

### uninstallKeyboardActions

    protected void uninstallKeyboardActions(JLabel c)

### createUI

    public static ComponentUI createUI(JComponent c)

### propertyChange

    public void propertyChange(java.beans.PropertyChangeEvent e)

  Specified by:
    propertyChange in interface java.beans.PropertyChangeListener

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.