APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.plaf.synth

public Class SynthLabelUI

extends BasicLabelUI
implements SynthUI
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.synth.SynthUI, javax.swing.plaf.synth.SynthConstants
Imports
javax.swing.*, javax.swing.plaf.*, javax.swing.plaf.basic.*, javax.swing.text.View, javax.swing.tree.DefaultTreeCellRenderer, java.awt.Dimension, .Rectangle, .Insets, .Graphics, .FontMetrics, java.beans.PropertyChangeEvent

Provides the Synth L&F UI delegate for javax.swing.JLabel.
Author
Scott Violet
Since
1.7

Field Summary

Modifier and TypeField and Description
private SynthStyle
Inherited from javax.swing.plaf.basic.BasicLabelUI:
labelUI

Constructor Summary

AccessConstructor and Description
public
SynthLabelUI()

Constructs a SynthLabelUI.

Method Summary

Modifier and TypeMethod and Description
public static ComponentUI

Returns:

the UI object
createUI
(JComponent
component to create UI object for
c
)

Hides javax.swing.plaf.basic.BasicLabelUI.createUI.

Returns the LabelUI implementation used for the skins look and feel.

public int
getBaseline(JComponent c, int width, int height)

Overrides javax.swing.plaf.basic.BasicLabelUI.getBaseline.

Returns the baseline.

private int
public SynthContext
getContext(JComponent c)

Implements javax.swing.plaf.synth.SynthUI.getContext.

Returns the Context for the specified component.

private SynthContext
getContext(JComponent c, int state)

public Dimension
getMaximumSize(JComponent c)

Overrides javax.swing.plaf.basic.BasicLabelUI.getMaximumSize.

Returns the specified component's maximum size appropriate for the look and feel.

public Dimension
getMinimumSize(JComponent c)

Overrides javax.swing.plaf.basic.BasicLabelUI.getMinimumSize.

Returns the specified component's minimum size appropriate for the look and feel.

public Dimension
getPreferredSize(JComponent c)

Overrides javax.swing.plaf.basic.BasicLabelUI.getPreferredSize.

Returns the specified component's preferred size appropriate for the look and feel.

protected void
public void
paint(Graphics
the Graphics object used for painting
g
,
JComponent
the component being painted
c
)

Overrides javax.swing.plaf.basic.BasicLabelUI.paint.

Paints the specified component according to the Look and Feel.

protected void
paint(SynthContext
context for the component being painted
context
,
Graphics
the Graphics object used for painting
g
)

Paints the specified component.

public void
paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)

Implements javax.swing.plaf.synth.SynthUI.paintBorder.

Paints the border.

public void
protected void
public void
update(Graphics
the Graphics object used for painting
g
,
JComponent
the component being painted
c
)

Overrides javax.swing.plaf.ComponentUI.update.

Notifies this UI delegate to repaint the specified component.

pack-priv void
Inherited from javax.swing.plaf.basic.BasicLabelUI:
getBaselineResizeBehaviorinstallComponentsinstallKeyboardActionsinstallListenersinstallUIlayoutCLpaintDisabledTextpaintEnabledTextuninstallComponentsuninstallKeyboardActionsuninstallListenersuninstallUI

Field Detail

styleback to summary
private SynthStyle style

Constructor Detail

SynthLabelUIback to summary
public SynthLabelUI()

Constructs a SynthLabelUI.

Method Detail

createUIback to summary
public static ComponentUI createUI(JComponent c)

Hides javax.swing.plaf.basic.BasicLabelUI.createUI.

Returns the LabelUI implementation used for the skins look and feel.

Parameters
c:JComponent

component to create UI object for

Returns:ComponentUI

the UI object

getBaselineback to summary
public int getBaseline(JComponent c, int width, int height)

Overrides javax.swing.plaf.basic.BasicLabelUI.getBaseline.

Doc from javax.swing.plaf.basic.BasicLabelUI.getBaseline.

Returns the baseline.

Annotations
@Override
getComponentStateback to summary
private int getComponentState(JComponent c)
getContextback to summary
public SynthContext getContext(JComponent c)

Implements javax.swing.plaf.synth.SynthUI.getContext.

Doc from javax.swing.plaf.synth.SynthUI.getContext.

Returns the Context for the specified component.

Annotations
@Override
getContextback to summary
private SynthContext getContext(JComponent c, int state)
getMaximumSizeback to summary
public Dimension getMaximumSize(JComponent c)

Overrides javax.swing.plaf.basic.BasicLabelUI.getMaximumSize.

Doc from javax.swing.plaf.ComponentUI.getMaximumSize.

Returns the specified component's maximum size appropriate for the look and feel. If null is returned, the maximum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokes getPreferredSize and returns that value.

Annotations
@Override
getMinimumSizeback to summary
public Dimension getMinimumSize(JComponent c)

Overrides javax.swing.plaf.basic.BasicLabelUI.getMinimumSize.

Doc from javax.swing.plaf.ComponentUI.getMinimumSize.

Returns the specified component's minimum size appropriate for the look and feel. If null is returned, the minimum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokes getPreferredSize and returns that value.

Annotations
@Override
getPreferredSizeback to summary
public Dimension getPreferredSize(JComponent c)

Overrides javax.swing.plaf.basic.BasicLabelUI.getPreferredSize.

Doc from javax.swing.plaf.ComponentUI.getPreferredSize.

Returns the specified component's preferred size appropriate for the look and feel. If null is returned, the preferred size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method returns null.

Annotations
@Override
installDefaultsback to summary
protected void installDefaults(JLabel c)

Overrides javax.swing.plaf.basic.BasicLabelUI.installDefaults.

Doc from javax.swing.plaf.basic.BasicLabelUI.installDefaults.

Installs default properties.

Annotations
@Override
paintback to summary
public void paint(Graphics g, JComponent c)

Overrides javax.swing.plaf.basic.BasicLabelUI.paint.

Paints the specified component according to the Look and Feel.

This method is not used by Synth Look and Feel. Painting is handled by the paint(SynthContext, Graphics) method.

Parameters
g:Graphics

the Graphics object used for painting

c:JComponent

the component being painted

Annotations
@Override
See Also
paint(SynthContext, Graphics)
paintback to summary
protected void paint(SynthContext context, Graphics g)

Paints the specified component.

Parameters
context:SynthContext

context for the component being painted

g:Graphics

the Graphics object used for painting

See Also
update(Graphics, JComponent)
paintBorderback to summary
public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)

Implements javax.swing.plaf.synth.SynthUI.paintBorder.

Doc from javax.swing.plaf.synth.SynthUI.paintBorder.

Paints the border.

Annotations
@Override
propertyChangeback to summary
public void propertyChange(PropertyChangeEvent e)

Overrides javax.swing.plaf.basic.BasicLabelUI.propertyChange.

Implements java.beans.PropertyChangeListener.propertyChange.

Doc from java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

Annotations
@Override
uninstallDefaultsback to summary
protected void uninstallDefaults(JLabel c)

Overrides javax.swing.plaf.basic.BasicLabelUI.uninstallDefaults.

Doc from javax.swing.plaf.basic.BasicLabelUI.uninstallDefaults.

Uninstalls default properties.

Annotations
@Override
updateback to summary
public void update(Graphics g, JComponent c)

Overrides javax.swing.plaf.ComponentUI.update.

Notifies this UI delegate to repaint the specified component. This method paints the component background, then calls the paint(SynthContext, Graphics) method.

In general, this method does not need to be overridden by subclasses. All Look and Feel rendering code should reside in the paint method.

Parameters
g:Graphics

the Graphics object used for painting

c:JComponent

the component being painted

Annotations
@Override
See Also
paint(SynthContext, Graphics)
updateStyleback to summary
pack-priv void updateStyle(JLabel c)