|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.plaf.ComponentUI javax.swing.plaf.LabelUI javax.swing.plaf.basic.BasicLabelUI javax.swing.plaf.synth.SynthLabelUI
public class SynthLabelUI
Disabled: no SafeJ information.
Provides the Synth L&F UI delegate for
JLabel
.
Field Summary |
---|
Fields inherited from class javax.swing.plaf.basic.BasicLabelUI |
---|
labelUI |
Fields inherited from interface javax.swing.plaf.synth.SynthConstants |
---|
DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED |
Constructor Summary | |
---|---|
SynthLabelUI()
|
Method Summary | |
---|---|
static ComponentUI |
createUI(JComponent c)
Returns the LabelUI implementation used for the skins look and feel. |
int |
getBaseline(JComponent c,
int width,
int height)
Returns the baseline. |
SynthContext |
getContext(JComponent c)
Returns the Context for the specified component. |
Dimension |
getMaximumSize(JComponent c)
Returns the specified component's maximum size appropriate for the look and feel. |
Dimension |
getMinimumSize(JComponent c)
Returns the specified component's minimum size appropriate for the look and feel. |
Dimension |
getPreferredSize(JComponent c)
Returns the specified component's preferred size appropriate for the look and feel. |
protected void |
installDefaults(JLabel c)
|
void |
paint(Graphics g,
JComponent c)
Paints the label text with the foreground color, if the label is opaque then paints the entire background with the background color. |
protected void |
paint(SynthContext context,
Graphics g)
Paints the specified component. |
void |
paintBorder(SynthContext context,
Graphics g,
int x,
int y,
int w,
int h)
Paints the border. |
void |
propertyChange(PropertyChangeEvent e)
This method gets called when a bound property is changed. |
protected void |
uninstallDefaults(JLabel c)
|
void |
update(Graphics g,
JComponent c)
Notifies this UI delegate that it is time to paint the specified component. |
Methods inherited from class javax.swing.plaf.basic.BasicLabelUI |
---|
getBaselineResizeBehavior, installComponents, installKeyboardActions, installListeners, installUI, layoutCL, paintDisabledText, paintEnabledText, uninstallComponents, uninstallKeyboardActions, uninstallListeners, uninstallUI |
Methods inherited from class javax.swing.plaf.ComponentUI |
---|
contains, getAccessibleChild, getAccessibleChildrenCount |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SynthLabelUI()
Method Detail |
---|
public static ComponentUI createUI(JComponent c)
c
- component to create UI object for
protected void installDefaults(JLabel c)
installDefaults
in class BasicLabelUI
protected void uninstallDefaults(JLabel c)
uninstallDefaults
in class BasicLabelUI
public SynthContext getContext(JComponent c)
SynthUI
getContext
in interface SynthUI
c
- Component requesting SynthContext.
public int getBaseline(JComponent c, int width, int height)
BasicLabelUI
getBaseline
in class BasicLabelUI
c
- JComponent
baseline is being requested forwidth
- the width to get the baseline forheight
- the height to get the baseline for
JComponent.getBaseline(int, int)
public void update(Graphics g, JComponent c)
ComponentUI
JComponent
when the specified component is being painted.
By default this method fills the specified component with
its background color if its opaque
property is true
,
and then immediately calls paint
. In general this method need
not be overridden by subclasses; all look-and-feel rendering code should
reside in the paint
method.
update
in class ComponentUI
g
- the Graphics
context in which to paintc
- the component being painted;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple componentsComponentUI.paint(java.awt.Graphics, javax.swing.JComponent)
,
JComponent.paintComponent(java.awt.Graphics)
public void paint(Graphics g, JComponent c)
BasicLabelUI
BasicLabelUI.paintEnabledText(javax.swing.JLabel, java.awt.Graphics, java.lang.String, int, int)
or BasicLabelUI.paintDisabledText(javax.swing.JLabel, java.awt.Graphics, java.lang.String, int, int)
.
The locations of the label parts are computed by BasicLabelUI.layoutCL(javax.swing.JLabel, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle)
.
paint
in class BasicLabelUI
g
- the Graphics
context in which to paintc
- the component being painted;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple componentsBasicLabelUI.paintEnabledText(javax.swing.JLabel, java.awt.Graphics, java.lang.String, int, int)
,
BasicLabelUI.paintDisabledText(javax.swing.JLabel, java.awt.Graphics, java.lang.String, int, int)
,
BasicLabelUI.layoutCL(javax.swing.JLabel, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle)
protected void paint(SynthContext context, Graphics g)
context
- context for the component being paintedg
- Graphics
object used for paintingpublic void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
SynthUI
paintBorder
in interface SynthUI
context
- a component contextg
- Graphics
to paint onx
- the X coordinatey
- the Y coordinatew
- width of the borderh
- height of the borderpublic Dimension getPreferredSize(JComponent c)
ComponentUI
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
.
getPreferredSize
in class BasicLabelUI
c
- the component whose preferred size is being queried;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple componentsJComponent.getPreferredSize()
,
LayoutManager.preferredLayoutSize(java.awt.Container)
public Dimension getMinimumSize(JComponent c)
ComponentUI
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.
getMinimumSize
in class BasicLabelUI
c
- the component whose minimum size is being queried;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple components
JComponent.getMinimumSize()
,
LayoutManager.minimumLayoutSize(java.awt.Container)
,
ComponentUI.getPreferredSize(javax.swing.JComponent)
public Dimension getMaximumSize(JComponent c)
ComponentUI
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.
getMaximumSize
in class BasicLabelUI
c
- the component whose maximum size is being queried;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple components
JComponent.getMaximumSize()
,
LayoutManager2.maximumLayoutSize(java.awt.Container)
public void propertyChange(PropertyChangeEvent e)
PropertyChangeListener
propertyChange
in interface PropertyChangeListener
propertyChange
in class BasicLabelUI
e
- A PropertyChangeEvent object describing the event source
and the property that has changed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |