|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.skin.ComponentSkin
org.apache.pivot.wtk.skin.LabelSkin
public class LabelSkin
Label skin.
TODO showEllipsis style
TODO breakOnWhitespaceOnly style
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener |
---|
ComponentListener.Adapter |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener |
---|
ComponentStateListener.Adapter |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener |
---|
ComponentMouseListener.Adapter |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener |
---|
ComponentMouseButtonListener.Adapter |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener |
---|
ComponentKeyListener.Adapter |
Field Summary |
---|
Fields inherited from class org.apache.pivot.wtk.skin.ComponentSkin |
---|
SHOW_TOOLTIP_TIMEOUT |
Constructor Summary | |
---|---|
LabelSkin()
|
Method Summary | |
---|---|
Color |
getBackgroundColor()
|
Color |
getColor()
|
Font |
getFont()
|
int |
getFontSize()
|
HorizontalAlignment |
getHorizontalAlignment()
|
Insets |
getPadding()
|
int |
getPreferredHeight(int width)
Returns the visual's preferred height given the provided width constraint. |
Dimensions |
getPreferredSize()
Returns the visual's unconstrained preferred size. |
int |
getPreferredWidth(int height)
Returns the visual's preferred width given the provided height constraint. |
TextDecoration |
getTextDecoration()
|
VerticalAlignment |
getVerticalAlignment()
|
boolean |
getWrapText()
|
void |
install(Component component)
Associates a skin with a component. |
boolean |
isFocusable()
By default, components are focusable. |
boolean |
isFontBold()
|
boolean |
isFontItalic()
|
boolean |
isOpaque()
Labels are never fully opaque. |
void |
layout()
If the component on which the skin is installed is a container, lays out the container's children. |
void |
paint(Graphics2D graphics)
Paints the visual. |
void |
setBackgroundColor(Color backgroundColor)
|
void |
setBackgroundColor(String backgroundColor)
|
void |
setColor(Color color)
|
void |
setColor(String color)
|
void |
setFont(Font font)
|
void |
setFont(String font)
|
void |
setFontBold(boolean fontBold)
|
void |
setFontItalic(boolean fontItalic)
|
void |
setFontSize(int fontSize)
|
void |
setHorizontalAlignment(HorizontalAlignment horizontalAlignment)
|
void |
setHorizontalAlignment(String horizontalAlignment)
|
void |
setPadding(Dictionary<String,?> padding)
|
void |
setPadding(Insets padding)
|
void |
setPadding(int padding)
|
void |
setPadding(Number padding)
|
void |
setPadding(String padding)
|
void |
setTextDecoration(String textDecoration)
|
void |
setTextDecoration(TextDecoration textDecoration)
|
void |
setVerticalAlignment(String verticalAlignment)
|
void |
setVerticalAlignment(VerticalAlignment verticalAlignment)
|
void |
setWrapText(boolean wrapText)
|
void |
textChanged(Label label,
String previousText)
Called when a label's text has changed. |
void |
textKeyChanged(Label label,
String previousTextKey)
Called when a label's text key has changed. |
void |
uninstall()
Dissociates a skin from a component. |
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin |
---|
cursorChanged, dragSourceChanged, dropTargetChanged, enabledChanged, focusedChanged, getComponent, getHeight, getWidth, invalidateComponent, keyPressed, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, parentChanged, preferredHeightLimitsChanged, preferredSizeChanged, preferredWidthLimitsChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, styleUpdated, tooltipTextChanged, visibleChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LabelSkin()
Method Detail |
---|
public void install(Component component)
Skin
install
in interface Skin
install
in class ComponentSkin
component
- The component to which the skin is being attached.public void uninstall()
Skin
uninstall
in interface Skin
uninstall
in class ComponentSkin
public int getPreferredWidth(int height)
ConstrainedVisual
getPreferredWidth
in interface ConstrainedVisual
height
- The height by which to constrain the preferred width, or -1
for no constraint.public int getPreferredHeight(int width)
ConstrainedVisual
getPreferredHeight
in interface ConstrainedVisual
width
- The width by which to constrain the preferred height, or -1
for no constraint.public Dimensions getPreferredSize()
ConstrainedVisual
getPreferredSize
in interface ConstrainedVisual
getPreferredSize
in class ComponentSkin
public void layout()
Skin
layout
in interface Skin
public void paint(Graphics2D graphics)
Visual
paint
in interface Visual
graphics
- The graphics context in which to paint the visual.public boolean isFocusable()
ComponentSkin
isFocusable
in interface Skin
isFocusable
in class ComponentSkin
public boolean isOpaque()
isOpaque
in interface Skin
isOpaque
in class ComponentSkin
public Font getFont()
public void setFont(Font font)
public final void setFont(String font)
public int getFontSize()
public void setFontSize(int fontSize)
public boolean isFontBold()
public void setFontBold(boolean fontBold)
public boolean isFontItalic()
public void setFontItalic(boolean fontItalic)
public Color getColor()
public void setColor(Color color)
public final void setColor(String color)
public Color getBackgroundColor()
public void setBackgroundColor(Color backgroundColor)
public final void setBackgroundColor(String backgroundColor)
public TextDecoration getTextDecoration()
public void setTextDecoration(TextDecoration textDecoration)
public final void setTextDecoration(String textDecoration)
public HorizontalAlignment getHorizontalAlignment()
public void setHorizontalAlignment(HorizontalAlignment horizontalAlignment)
public final void setHorizontalAlignment(String horizontalAlignment)
public VerticalAlignment getVerticalAlignment()
public void setVerticalAlignment(VerticalAlignment verticalAlignment)
public final void setVerticalAlignment(String verticalAlignment)
public Insets getPadding()
public void setPadding(Insets padding)
public final void setPadding(Dictionary<String,?> padding)
public final void setPadding(int padding)
public final void setPadding(Number padding)
public final void setPadding(String padding)
public boolean getWrapText()
public void setWrapText(boolean wrapText)
public void textChanged(Label label, String previousText)
LabelListener
textChanged
in interface LabelListener
public void textKeyChanged(Label label, String previousTextKey)
LabelListener
textKeyChanged
in interface LabelListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |