|
||||||||||
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.terra.TerraTextInputSkin
public class TerraTextInputSkin
Text input skin.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TextInputListener |
---|
TextInputListener.Adapter |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TextInputContentListener |
---|
TextInputContentListener.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 |
Constructor Summary | |
---|---|
TerraTextInputSkin()
|
Method Summary | |
---|---|
void |
editableChanged(TextInput textInput)
Called when the 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. |
Color |
getBackgroundColor()
|
int |
getBaseline(int width,
int height)
Returns the baseline for a given width and height. |
Color |
getBorderColor()
|
Bounds |
getCharacterBounds(int index)
Returns the bounds of the character at a given index. |
Color |
getColor()
|
Color |
getDisabledBackgroundColor()
|
Color |
getDisabledBorderColor()
|
Color |
getDisabledColor()
|
Font |
getFont()
|
HorizontalAlignment |
getHorizontalAlignment()
|
Color |
getInactiveSelectionBackgroundColor()
|
Color |
getInactiveSelectionColor()
|
int |
getInsertionPoint(int x)
Returns the insertion point for a given location. |
Color |
getInvalidBackgroundColor()
|
Color |
getInvalidColor()
|
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. |
Color |
getPromptColor()
|
Color |
getSelectionBackgroundColor()
|
Color |
getSelectionColor()
|
void |
insertTextVetoed(TextInput textInput,
Vote reason)
Called when a text insertion has been vetoed. |
void |
install(Component component)
Associates a skin with a component. |
boolean |
keyPressed(Component component,
int keyCode,
Keyboard.KeyLocation keyLocation)
DELETE Delete the character after the caret or
the entire selection if there is one. |
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 |
maximumLengthChanged(TextInput textInput,
int previousMaximumLength)
Called when a text input's maximum length has changed. |
boolean |
mouseClick(Component component,
Mouse.Button button,
int x,
int y,
int count)
Called when a mouse button is clicked over a component. |
boolean |
mouseDown(Component component,
Mouse.Button button,
int x,
int y)
Called when a mouse button is pressed over a component. |
boolean |
mouseMove(Component component,
int x,
int y)
Called when the mouse is moved over a component. |
boolean |
mouseUp(Component component,
Mouse.Button button,
int x,
int y)
Called when a mouse button is released over a component. |
void |
paint(Graphics2D graphics)
Paints the visual. |
void |
passwordChanged(TextInput textInput)
Called when a text input's password flag has changed. |
Vote |
previewInsertText(TextInput textInput,
CharSequence text,
int index)
Called to preview a text insertion. |
Vote |
previewRemoveText(TextInput textInput,
int index,
int count)
Called to preview a text removal. |
void |
promptChanged(TextInput textInput,
String previousPrompt)
Called when a text input's prompt has changed. |
void |
removeTextVetoed(TextInput textInput,
Vote reason)
Called when a text removal has been vetoed. |
void |
selectionChanged(TextInput textInput,
int previousSelectionStart,
int previousSelectionLength)
Called when a text input's selection state has changed. |
void |
setBackgroundColor(Color backgroundColor)
|
void |
setBackgroundColor(int color)
|
void |
setBackgroundColor(String backgroundColor)
|
void |
setBorderColor(Color borderColor)
|
void |
setBorderColor(int color)
|
void |
setBorderColor(String borderColor)
|
void |
setColor(Color color)
|
void |
setColor(int color)
|
void |
setColor(String color)
|
void |
setDisabledBackgroundColor(Color disabledBackgroundColor)
|
void |
setDisabledBackgroundColor(int color)
|
void |
setDisabledBackgroundColor(String disabledBackgroundColor)
|
void |
setDisabledBorderColor(Color disabledBorderColor)
|
void |
setDisabledBorderColor(int color)
|
void |
setDisabledBorderColor(String disabledBorderColor)
|
void |
setDisabledColor(Color disabledColor)
|
void |
setDisabledColor(int disabledColor)
|
void |
setDisabledColor(String disabledColor)
|
void |
setFont(Dictionary<String,?> font)
|
void |
setFont(Font font)
|
void |
setFont(String font)
|
void |
setHorizontalAlignment(HorizontalAlignment alignment)
|
void |
setInactiveSelectionBackgroundColor(Color inactiveSelectionBackgroundColor)
|
void |
setInactiveSelectionBackgroundColor(int color)
|
void |
setInactiveSelectionBackgroundColor(String inactiveSelectionBackgroundColor)
|
void |
setInactiveSelectionColor(Color inactiveSelectionColor)
|
void |
setInactiveSelectionColor(int color)
|
void |
setInactiveSelectionColor(String inactiveSelectionColor)
|
void |
setInvalidBackgroundColor(Color color)
|
void |
setInvalidBackgroundColor(int color)
|
void |
setInvalidBackgroundColor(String color)
|
void |
setInvalidColor(Color color)
|
void |
setInvalidColor(int color)
|
void |
setInvalidColor(String color)
|
void |
setPadding(Dictionary<String,?> padding)
|
void |
setPadding(Insets padding)
|
void |
setPadding(int padding)
|
void |
setPadding(Number padding)
|
void |
setPadding(String padding)
|
void |
setPromptColor(Color promptColor)
|
void |
setPromptColor(int promptColor)
|
void |
setPromptColor(String promptColor)
|
void |
setSelectionBackgroundColor(Color selectionBackgroundColor)
|
void |
setSelectionBackgroundColor(int color)
|
void |
setSelectionBackgroundColor(String selectionBackgroundColor)
|
void |
setSelectionColor(Color selectionColor)
|
void |
setSelectionColor(int color)
|
void |
setSelectionColor(String selectionColor)
|
void |
setSize(int width,
int height)
Sets the visual's render size. |
void |
showCaret(boolean show)
|
void |
strictValidationChanged(TextInput textInput)
Called when a text input's strict validation flag has changed. |
void |
textChanged(TextInput textInput)
Called when a text input's text has changed. |
void |
textInserted(TextInput textInput,
int index,
int count)
Called when text has been inserted into a text input. |
void |
textRemoved(TextInput textInput,
int index,
int count)
Called when text has been removed from a text input. |
void |
textSizeChanged(TextInput textInput,
int previousTextSize)
Called when a text input's text size has changed. |
void |
textValidatorChanged(TextInput textInput,
Validator previousValidator)
Called when the validator changes. |
void |
textValidChanged(TextInput textInput)
Called when the text changes validity. |
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin |
---|
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, getBaseline, getComponent, getHeight, getWidth, heightLimitsChanged, invalidateComponent, isFocusable, isOpaque, keyReleased, locationChanged, menuHandlerChanged, mouseOut, mouseOver, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, sizeChanged, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TerraTextInputSkin()
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 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 int getBaseline(int width, int height)
ConstrainedVisual
getBaseline
in interface ConstrainedVisual
getBaseline
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 getInsertionPoint(int x)
TextInput.Skin
getInsertionPoint
in interface TextInput.Skin
public Bounds getCharacterBounds(int index)
TextInput.Skin
getCharacterBounds
in interface TextInput.Skin
public Font getFont()
public void setFont(Font font)
public final void setFont(String font)
public final void setFont(Dictionary<String,?> font)
public Color getColor()
public void setColor(Color color)
public final void setColor(String color)
public final void setColor(int color)
public Color getPromptColor()
public void setPromptColor(Color promptColor)
public final void setPromptColor(String promptColor)
public final void setPromptColor(int promptColor)
public Color getDisabledColor()
public void setDisabledColor(Color disabledColor)
public final void setDisabledColor(String disabledColor)
public final void setDisabledColor(int disabledColor)
public Color getBackgroundColor()
public void setBackgroundColor(Color backgroundColor)
public final void setBackgroundColor(String backgroundColor)
public final void setBackgroundColor(int color)
public Color getInvalidColor()
public void setInvalidColor(Color color)
public final void setInvalidColor(String color)
public final void setInvalidColor(int color)
public Color getInvalidBackgroundColor()
public void setInvalidBackgroundColor(Color color)
public final void setInvalidBackgroundColor(String color)
public final void setInvalidBackgroundColor(int color)
public Color getDisabledBackgroundColor()
public void setDisabledBackgroundColor(Color disabledBackgroundColor)
public final void setDisabledBackgroundColor(String disabledBackgroundColor)
public final void setDisabledBackgroundColor(int color)
public Color getBorderColor()
public void setBorderColor(Color borderColor)
public final void setBorderColor(String borderColor)
public final void setBorderColor(int color)
public Color getDisabledBorderColor()
public void setDisabledBorderColor(Color disabledBorderColor)
public final void setDisabledBorderColor(String disabledBorderColor)
public final void setDisabledBorderColor(int color)
public Color getSelectionColor()
public void setSelectionColor(Color selectionColor)
public final void setSelectionColor(String selectionColor)
public final void setSelectionColor(int color)
public Color getSelectionBackgroundColor()
public void setSelectionBackgroundColor(Color selectionBackgroundColor)
public final void setSelectionBackgroundColor(String selectionBackgroundColor)
public final void setSelectionBackgroundColor(int color)
public Color getInactiveSelectionColor()
public void setInactiveSelectionColor(Color inactiveSelectionColor)
public final void setInactiveSelectionColor(String inactiveSelectionColor)
public final void setInactiveSelectionColor(int color)
public Color getInactiveSelectionBackgroundColor()
public void setInactiveSelectionBackgroundColor(Color inactiveSelectionBackgroundColor)
public final void setInactiveSelectionBackgroundColor(String inactiveSelectionBackgroundColor)
public final void setInactiveSelectionBackgroundColor(int color)
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 HorizontalAlignment getHorizontalAlignment()
public final void setHorizontalAlignment(HorizontalAlignment alignment)
public boolean mouseMove(Component component, int x, int y)
ComponentMouseListener
mouseMove
in interface ComponentMouseListener
mouseMove
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 mouseUp(Component component, Mouse.Button button, int x, int y)
ComponentMouseButtonListener
mouseUp
in interface ComponentMouseButtonListener
mouseUp
in class ComponentSkin
public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count)
ComponentMouseButtonListener
mouseClick
in interface ComponentMouseButtonListener
mouseClick
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)
DELETE
Delete the character after the caret or
the entire selection if there is one.BACKSPACE
Delete the character before the
caret or the entire selection if there is one.
HOME
Move the caret to the beginning of the text.
LEFT
+ META
Move the caret
to the beginning of the text.
HOME
+ SHIFT
Select from
the caret to the beginning of the text.
LEFT
+ META
+
SHIFT
Select from the caret to the beginning of
the text.
END
Move the caret to the end of the text.
RIGHT
+ META
Move the caret
to the end of the text.
END
+ SHIFT
Select from the
caret to the end of the text.
RIGHT
+ META
+
SHIFT
Select from the caret to the end of the
text.
LEFT
Clear the selection and move the caret back
by one character.
LEFT
+ SHIFT
Add the
previous character to the selection.
LEFT
+ CTRL
Clear the
selection and move the caret to the beginning of the text.
LEFT
+ CTRL
+
SHIFT
Add all preceding text to the selection.
RIGHT
Clear the selection and move the caret
forward by one character.
RIGHT
+ SHIFT
Add the next
character to the selection.
RIGHT
+ CTRL
Clear the
selection and move the caret to the end of the text.
RIGHT
+ CTRL
+
SHIFT
Add all subsequent text to the selection.
CommandModifier + A
Select all.
CommandModifier + X
Cut selection to clipboard (if
not a password TextInput).
CommandModifier + C
Copy selection to clipboard (if
not a password TextInput).
CommandModifier + V
Paste from clipboard.
CommandModifier + Z
Undo.
keyPressed
in interface ComponentKeyListener
keyPressed
in class ComponentSkin
Platform.getCommandModifier()
public void enabledChanged(Component component)
ComponentStateListener
Called both when the component is enabled and when it is disabled.
The component's enabled
flag has already been set when this
method is called so the new state can be determined by calling the
Component.isEnabled()
method.
enabledChanged
in interface ComponentStateListener
enabledChanged
in class ComponentSkin
component
- The component whose enabled state is changing.public void focusedChanged(Component component, Component obverseComponent)
ComponentStateListener
This will be called both when a component gains focus and when it loses
focus. The currently focused component has already been set when this method
is called, so that the new state of the component can be determined by calling
the Component.isFocused()
method.
focusedChanged
in interface ComponentStateListener
focusedChanged
in class ComponentSkin
component
- The component that is either gaining focus or the one that
previously had focus and is now losing it.obverseComponent
- If the component is gaining focus, this is the component
that is losing focus. If the component is losing focus
this is the component that is gaining the focus instead.public void textSizeChanged(TextInput textInput, int previousTextSize)
TextInputListener
textSizeChanged
in interface TextInputListener
public void maximumLengthChanged(TextInput textInput, int previousMaximumLength)
TextInputListener
maximumLengthChanged
in interface TextInputListener
public void passwordChanged(TextInput textInput)
TextInputListener
passwordChanged
in interface TextInputListener
public void promptChanged(TextInput textInput, String previousPrompt)
TextInputListener
promptChanged
in interface TextInputListener
public void textValidatorChanged(TextInput textInput, Validator previousValidator)
TextInputListener
textValidatorChanged
in interface TextInputListener
public void strictValidationChanged(TextInput textInput)
TextInputListener
strictValidationChanged
in interface TextInputListener
public void textValidChanged(TextInput textInput)
TextInputListener
textValidChanged
in interface TextInputListener
public Vote previewInsertText(TextInput textInput, CharSequence text, int index)
TextInputContentListener
previewInsertText
in interface TextInputContentListener
textInput
- The source of the event.text
- The text that will be inserted.index
- The index at which the text will be inserted.public void insertTextVetoed(TextInput textInput, Vote reason)
TextInputContentListener
insertTextVetoed
in interface TextInputContentListener
textInput
- The source of the event.reason
- The reason the event was vetoed.public void textInserted(TextInput textInput, int index, int count)
TextInputContentListener
textInserted
in interface TextInputContentListener
textInput
- The source of the event.index
- The index at which the text was inserted.count
- The number of characters that were inserted.public Vote previewRemoveText(TextInput textInput, int index, int count)
TextInputContentListener
previewRemoveText
in interface TextInputContentListener
textInput
- The source of the event.index
- The starting index from which the text will be removed.public void setSize(int width, int height)
ConstrainedVisual
setSize
in interface ConstrainedVisual
setSize
in class ComponentSkin
public void removeTextVetoed(TextInput textInput, Vote reason)
TextInputContentListener
removeTextVetoed
in interface TextInputContentListener
textInput
- The source of the event.reason
- The reason the event was vetoed.public void textRemoved(TextInput textInput, int index, int count)
TextInputContentListener
textRemoved
in interface TextInputContentListener
textInput
- The source of the event.index
- The index from which the text was removed.count
- The number of characters that were removed.public void textChanged(TextInput textInput)
TextInputContentListener
textChanged
in interface TextInputContentListener
textInput
- The source of the event.public void editableChanged(TextInput textInput)
TextInputListener
editableChanged
in interface TextInputListener
public void selectionChanged(TextInput textInput, int previousSelectionStart, int previousSelectionLength)
TextInputSelectionListener
selectionChanged
in interface TextInputSelectionListener
textInput
- The source of the event.previousSelectionStart
- If the selection changed directly, the previous selection start index.
Otherwise, the current selection start index.previousSelectionLength
- If the selection changed directly, the previous selection length.
Otherwise, the current selection length.public void showCaret(boolean show)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |