|
||||||||||
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.TextAreaSkin
public class TextAreaSkin
Text area skin.
Nested Class Summary | |
---|---|
class |
TextAreaSkin.DocumentView
Document view. |
class |
TextAreaSkin.ElementView
Abstract base class for element views. |
class |
TextAreaSkin.ImageNodeView
|
class |
TextAreaSkin.NodeView
Abstract base class for node views. |
class |
TextAreaSkin.ParagraphView
|
class |
TextAreaSkin.TextNodeView
Text node view. |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TextAreaListener |
---|
TextAreaListener.Adapter |
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 | |
---|---|
static int |
PARAGRAPH_TERMINATOR_WIDTH
|
Fields inherited from class org.apache.pivot.wtk.skin.ComponentSkin |
---|
SHOW_TOOLTIP_TIMEOUT |
Constructor Summary | |
---|---|
TextAreaSkin()
|
Method Summary | |
---|---|
void |
documentChanged(TextArea textArea,
Document previousDocument)
Called when a text area's document has changed. |
void |
editableChanged(TextArea textArea)
Called when a text area's editable state has changed. |
void |
enabledChanged(Component component)
Called when a component's enabled state has changed. |
void |
focusedChanged(Component component,
Component obverseComponent)
Called when a component's focused state has changed. |
int |
getCharacterAt(int x,
int y)
Returns the offset of the character at a given location. |
Bounds |
getCharacterBounds(int offset)
Returns the bounds of the character at a given offset within the document. |
Font |
getFont()
|
Insets |
getMargin()
|
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. |
void |
install(Component component)
Associates a skin with a component. |
boolean |
isBreakOnWhitespaceOnly()
|
boolean |
isFocusable()
By default, components are focusable. |
boolean |
isOpaque()
By default, skins are assumed to be opaque. |
boolean |
keyPressed(Component component,
int keyCode,
Keyboard.KeyLocation keyLocation)
Called when a key has been pressed. |
boolean |
keyTyped(Component component,
char character)
Called when a key has been typed. |
void |
layout()
If the component on which the skin is installed is a container, lays out the container's children. |
void |
locationChanged(Component component,
int previousX,
int previousY)
Called when a component's location has changed. |
boolean |
mouseDown(Component component,
Mouse.Button button,
int x,
int y)
Called when a mouse button is pressed over a component. |
void |
paint(Graphics2D graphics)
Paints the visual. |
void |
selectionChanged(TextArea textArea,
int previousSelectionStart,
int previousSelectionLength)
Called when a text area's selection state has changed. |
void |
setBreakOnWhitespaceOnly(boolean breakOnWhitespaceOnly)
|
void |
setFont(Font font)
|
void |
setFont(String font)
|
void |
setMargin(Dictionary<String,?> margin)
|
void |
setMargin(Insets margin)
|
void |
setMargin(int margin)
|
void |
setMargin(Number margin)
|
void |
setMargin(String margin)
|
void |
textKeyChanged(TextArea textArea,
String previousTextKey)
Called when a text area'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, getComponent, getHeight, getWidth, invalidateComponent, keyReleased, menuHandlerChanged, mouseClick, 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 |
Field Detail |
---|
public static final int PARAGRAPH_TERMINATOR_WIDTH
Constructor Detail |
---|
public TextAreaSkin()
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 boolean isFocusable()
ComponentSkin
isFocusable
in interface Skin
isFocusable
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 boolean isOpaque()
ComponentSkin
isOpaque
in interface Skin
isOpaque
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 int getCharacterAt(int x, int y)
TextArea.Skin
getCharacterAt
in interface TextArea.Skin
public Bounds getCharacterBounds(int offset)
TextArea.Skin
getCharacterBounds
in interface TextArea.Skin
public Font getFont()
public void setFont(Font font)
public final void setFont(String font)
public Insets getMargin()
public void setMargin(Insets margin)
public final void setMargin(Dictionary<String,?> margin)
public final void setMargin(int margin)
public final void setMargin(Number margin)
public final void setMargin(String margin)
public boolean isBreakOnWhitespaceOnly()
public void setBreakOnWhitespaceOnly(boolean breakOnWhitespaceOnly)
public void locationChanged(Component component, int previousX, int previousY)
ComponentListener
locationChanged
in interface ComponentListener
locationChanged
in class ComponentSkin
public boolean mouseDown(Component component, Mouse.Button button, int x, int y)
ComponentMouseButtonListener
mouseDown
in interface ComponentMouseButtonListener
mouseDown
in class ComponentSkin
public boolean keyTyped(Component component, char character)
ComponentKeyListener
keyTyped
in interface ComponentKeyListener
keyTyped
in class ComponentSkin
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
ComponentKeyListener
keyPressed
in interface ComponentKeyListener
keyPressed
in class ComponentSkin
public void enabledChanged(Component component)
ComponentStateListener
enabledChanged
in interface ComponentStateListener
enabledChanged
in class ComponentSkin
public void focusedChanged(Component component, Component obverseComponent)
ComponentStateListener
focusedChanged
in interface ComponentStateListener
focusedChanged
in class ComponentSkin
public void documentChanged(TextArea textArea, Document previousDocument)
TextAreaListener
documentChanged
in interface TextAreaListener
public void editableChanged(TextArea textArea)
TextAreaListener
editableChanged
in interface TextAreaListener
public void textKeyChanged(TextArea textArea, String previousTextKey)
TextAreaListener
textKeyChanged
in interface TextAreaListener
public void selectionChanged(TextArea textArea, int previousSelectionStart, int previousSelectionLength)
TextAreaSelectionListener
selectionChanged
in interface TextAreaSelectionListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |