com.sas.swing.visuals
Class BasicLabelViewUI

com.sas.swing.visuals.BasicLabelViewUI
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener

public class BasicLabelViewUI

An extension of the BasicLabelUI. This implementation is completely static, i.e. there's only one UIView implementation that's shared by all LabelView objects.


Field Summary
protected  java.awt.Rectangle iconR
           
protected static BasicLabelViewUI labelViewUI
           
protected static java.awt.Rectangle oPaintIconR
           
protected static java.awt.Rectangle oPaintTextR
           
protected static java.awt.Rectangle paintIconR
           
protected static java.awt.Rectangle paintTextR
           
protected static java.awt.Insets paintViewInsets
           
protected static java.awt.Rectangle paintViewR
           
protected  java.awt.Rectangle textR
           
protected static java.awt.Insets viewInsets
           
protected  java.awt.Rectangle viewR
           
 
Constructor Summary
BasicLabelViewUI()
          Initializes static veriables.
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
           
 java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
           
 java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
           
 java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
           
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, int orientation, boolean lineWrap, boolean wrapStyleWord, int gapBetweenLines, boolean clippedMode, int tabSize, int leadingContentOffset, int topContentOffset)
          Forwards the call to Util.layoutCompoundLabel().
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, int orientation, boolean lineWrap, boolean wrapStyleWord, int gapBetweenLines, boolean clippedMode, int tabSize, int leadingContentOffset, int topContentOffset, boolean replaceTab)
          Forwards the call to Util.layoutCompoundLabel().
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, int orientation, boolean lineWrap, boolean wrapStyleWord, int gapBetweenLines, boolean clippedMode, int tabSize, int leadingContentOffset, int topContentOffset, boolean replaceTab, boolean replaceNewline)
          Forwards the call to Util.layoutCompoundLabel().
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
           
protected  boolean paintDisabledText(javax.swing.JLabel l, java.awt.Graphics g, java.lang.String s, int textX, int textY, int accChar)
          Paint clippedText at textX, textY with background.lighter() and then shifted down and to the right by one pixel with background.darker().
protected  boolean paintEnabledText(javax.swing.JLabel l, java.awt.Graphics g, java.lang.String s, int textX, int textY, int accChar)
          Paint clippedText at textX, textY with the labels foreground color.
 

Field Detail

labelViewUI

protected static BasicLabelViewUI labelViewUI

iconR

protected java.awt.Rectangle iconR

textR

protected java.awt.Rectangle textR

viewR

protected java.awt.Rectangle viewR

viewInsets

protected static java.awt.Insets viewInsets

paintIconR

protected static java.awt.Rectangle paintIconR

paintTextR

protected static java.awt.Rectangle paintTextR

paintViewR

protected static java.awt.Rectangle paintViewR

paintViewInsets

protected static java.awt.Insets paintViewInsets

oPaintIconR

protected static java.awt.Rectangle oPaintIconR

oPaintTextR

protected static java.awt.Rectangle oPaintTextR
Constructor Detail

BasicLabelViewUI

public BasicLabelViewUI()
Initializes static veriables.

Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)

layoutCL

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,
                                    int orientation,
                                    boolean lineWrap,
                                    boolean wrapStyleWord,
                                    int gapBetweenLines,
                                    boolean clippedMode,
                                    int tabSize,
                                    int leadingContentOffset,
                                    int topContentOffset)
Forwards the call to Util.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)

layoutCL

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,
                                    int orientation,
                                    boolean lineWrap,
                                    boolean wrapStyleWord,
                                    int gapBetweenLines,
                                    boolean clippedMode,
                                    int tabSize,
                                    int leadingContentOffset,
                                    int topContentOffset,
                                    boolean replaceTab)
Forwards the call to Util.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)

layoutCL

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,
                                    int orientation,
                                    boolean lineWrap,
                                    boolean wrapStyleWord,
                                    int gapBetweenLines,
                                    boolean clippedMode,
                                    int tabSize,
                                    int leadingContentOffset,
                                    int topContentOffset,
                                    boolean replaceTab,
                                    boolean replaceNewline)
Forwards the call to Util.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 boolean paintEnabledText(javax.swing.JLabel l,
                                   java.awt.Graphics g,
                                   java.lang.String s,
                                   int textX,
                                   int textY,
                                   int accChar)
Paint clippedText at textX, textY with the labels foreground color. Return true if the accelerator Character was printed

See Also:
paint(java.awt.Graphics, javax.swing.JComponent), paintDisabledText(javax.swing.JLabel, java.awt.Graphics, java.lang.String, int, int, int)

paintDisabledText

protected boolean paintDisabledText(javax.swing.JLabel l,
                                    java.awt.Graphics g,
                                    java.lang.String s,
                                    int textX,
                                    int textY,
                                    int accChar)
Paint clippedText at textX, textY with background.lighter() and then shifted down and to the right by one pixel with background.darker(). Return true if the accelerator Character was printed

See Also:
paint(java.awt.Graphics, javax.swing.JComponent), paintEnabledText(javax.swing.JLabel, java.awt.Graphics, java.lang.String, int, int, int)

getPreferredSize

public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
Overrides:
getPreferredSize in class javax.swing.plaf.basic.BasicLabelUI

getMinimumSize

public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
Overrides:
getMinimumSize in class javax.swing.plaf.basic.BasicLabelUI
Returns:
getPreferredSize(c)

getMaximumSize

public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
Overrides:
getMaximumSize in class javax.swing.plaf.basic.BasicLabelUI
Returns:
getPreferredSize(c)

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
Overrides:
paint in class javax.swing.plaf.basic.BasicLabelUI



Copyright © 2009 SAS Institute Inc. All Rights Reserved.