org.bounce.plaf
Class BounceLabelUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.LabelUI
          extended by javax.swing.plaf.basic.BasicLabelUI
              extended by org.bounce.plaf.BounceLabelUI
All Implemented Interfaces:
PropertyChangeListener, EventListener

public class BounceLabelUI
extends BasicLabelUI

Extend the BasicLabelUI class, this LabelUI allows for a multi-line label.

Version:
$Revision: 1.6 $, $Date: 2008/01/28 21:28:37 $
Author:
Edwin Dankert

Constructor Summary
BounceLabelUI()
           
 
Method Summary
static ComponentUI createUI(JComponent c)
          Creates the one version of this UI.
 Dimension getPreferredSize(JComponent c)
          Returns the preferred size of the label, this size will return the full width of the text as the preferred width and the full height of the lines as the height.
 void installUI(JComponent c)
          Installs the UI for the supplied component.
 void paint(Graphics g, JComponent c)
          Overrides the paint method in the BasicLabelUI class.
 void uninstallUI(JComponent c)
          Un-installs the current UI for the supplied component.
 
Methods inherited from class javax.swing.plaf.basic.BasicLabelUI
getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, installComponents, installDefaults, installKeyboardActions, installListeners, layoutCL, paintDisabledText, paintEnabledText, propertyChange, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners
 
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
 

Constructor Detail

BounceLabelUI

public BounceLabelUI()
Method Detail

createUI

public static ComponentUI createUI(JComponent c)
Creates the one version of this UI.

Parameters:
c - the component the ui needs to be installed for.
Returns:
the component's ui!

installUI

public void installUI(JComponent c)
Installs the UI for the supplied component.

Overrides:
installUI in class BasicLabelUI
Parameters:
c - the component the ui needs to be installed for.

uninstallUI

public void uninstallUI(JComponent c)
Un-installs the current UI for the supplied component.

Overrides:
uninstallUI in class BasicLabelUI
Parameters:
c - the component the ui needs to be un-installed for.

paint

public void paint(Graphics g,
                  JComponent c)
Overrides the paint method in the BasicLabelUI class.

Overrides:
paint in class BasicLabelUI
Parameters:
g - the graphics.
c - the button component.

getPreferredSize

public Dimension getPreferredSize(JComponent c)
Returns the preferred size of the label, this size will return the full width of the text as the preferred width and the full height of the lines as the height.

This method is a revamped version of the method found in: BasicLabelUI.getPreferredSize()

Overrides:
getPreferredSize in class BasicLabelUI
Parameters:
c - the button component.
Returns:
the preferred size of the button.


Copyright © 2002-2011 Edwin Dankert. All Rights Reserved.