All Packages Class Hierarchy This Package Previous Next Index
Class jp.kyasu.graphics.VLabel
java.lang.Object
|
+----jp.kyasu.graphics.VWrapper
|
+----jp.kyasu.graphics.VLabel
- public class VLabel
- extends VWrapper
The VLabel
class implements the visual label that
acts as a label model. The label has a enabled state and a focused
state. The label creates different visual presentations according to
the enabled state and the focused state. If the label is disabled,
the grayed label is displayed. If the label is focused, the label is
displayed with a dashed line border.
- Version:
- 12 Jun 1998
- Author:
- Kazuki YASUMATSU
- See Also:
- Label
-
VLabel()
- Constructs an empty label.
-
VLabel(String)
- Constructs a label with the specified string.
-
VLabel(Text)
- Constructs a label with the specified text.
-
VLabel(Visualizable)
- Constructs a label with the specified visual object.
-
clearDisabledVisualizable()
- Clears the cached visual presentation used when the label is disabled.
-
clone()
- Returns a clone of this label.
-
deriveLabel(Visualizable)
- Creates a new label by replicating this label with a new visual
object associated with it.
-
getDisabledBackground()
- Returns the background color when the label is disabled.
-
getDisabledForeground()
- Returns the foreground color when the label is disabled.
-
getSize()
- Returns the size of this label.
-
isEnabled()
- Checks if this label is enabled.
-
isFocused()
- Checks if this label is focused.
-
paint(Graphics, Point)
- Paints the label at the specified location.
-
paint(Graphics, Point, Component)
- Paints the label at the specified location with the component.
-
setDisabledBackground(Color)
- Sets the background color when the label is disabled
to be the specified color.
-
setDisabledForeground(Color)
- Sets the foreground color when the label is disabled
to be the specified color.
-
setEnabled(boolean)
- Sets the enabled state to be the specified boolean.
-
setFocused(boolean)
- Sets the focused state to be the specified boolean.
-
setFocusedSize(Dimension)
- Resizes the visual content with the focused (dashed line) border
to the specified dimension.
-
setSize(Dimension)
- Resizes the label to the specified dimension.
-
setVisualizable(Visualizable)
- Sets the visual content of this label to be the specified
visual object.
VLabel
public VLabel()
- Constructs an empty label.
VLabel
public VLabel(String str)
- Constructs a label with the specified string.
- Parameters:
- str - the string.
VLabel
public VLabel(Text text)
- Constructs a label with the specified text.
- Parameters:
- text - the text.
VLabel
public VLabel(Visualizable visualizable)
- Constructs a label with the specified visual object.
- Parameters:
- visualizable - the visual object.
deriveLabel
public VLabel deriveLabel(Visualizable visualizable)
- Creates a new label by replicating this label with a new visual
object associated with it.
- Parameters:
- visualizable - the visual object for the new label.
- Returns:
- a new label.
setVisualizable
public void setVisualizable(Visualizable visualizable)
- Sets the visual content of this label to be the specified
visual object.
- Parameters:
- visualizable - the visual object.
- Overrides:
- setVisualizable in class VWrapper
isFocused
public boolean isFocused()
- Checks if this label is focused.
- Returns:
-
true
if this label is focused;
false
otherwise.
setFocused
public void setFocused(boolean b)
- Sets the focused state to be the specified boolean.
- Parameters:
- b - the boolean.
isEnabled
public boolean isEnabled()
- Checks if this label is enabled.
- Returns:
-
true
if this label is enabled;
false
otherwise.
setEnabled
public void setEnabled(boolean b)
- Sets the enabled state to be the specified boolean.
- Parameters:
- b - the boolean.
getDisabledForeground
public Color getDisabledForeground()
- Returns the foreground color when the label is disabled.
- Returns:
- the foreground color when the label is disabled.
setDisabledForeground
public void setDisabledForeground(Color c)
- Sets the foreground color when the label is disabled
to be the specified color.
- Parameters:
- c - the color.
getDisabledBackground
public Color getDisabledBackground()
- Returns the background color when the label is disabled.
- Returns:
- the background color when the label is disabled.
setDisabledBackground
public void setDisabledBackground(Color c)
- Sets the background color when the label is disabled
to be the specified color.
- Parameters:
- c - the color.
clearDisabledVisualizable
public synchronized void clearDisabledVisualizable()
- Clears the cached visual presentation used when the label is disabled.
getSize
public Dimension getSize()
- Returns the size of this label.
- Overrides:
- getSize in class VWrapper
- See Also:
- getSize
setSize
public void setSize(Dimension d)
- Resizes the label to the specified dimension.
- Overrides:
- setSize in class VWrapper
- See Also:
- setSize
setFocusedSize
public void setFocusedSize(Dimension d)
- Resizes the visual content with the focused (dashed line) border
to the specified dimension.
paint
public void paint(Graphics g,
Point p)
- Paints the label at the specified location.
- Overrides:
- paint in class VWrapper
- See Also:
- paint
paint
public void paint(Graphics g,
Point p,
Component comp)
- Paints the label at the specified location with the component.
- Parameters:
- g - the graphics.
- p - the location.
- comp - the component used to make the disabled presentation.
clone
public Object clone()
- Returns a clone of this label.
- Overrides:
- clone in class VWrapper
All Packages Class Hierarchy This Package Previous Next Index