|
||||||||||
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.ContainerSkin
org.apache.pivot.wtk.skin.TextPaneSkin
public class TextPaneSkin
Text pane skin.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.pivot.wtk.skin.ContainerSkin |
---|
ContainerSkin.IndexFocusTraversalPolicy |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TextPaneListener |
---|
TextPaneListener.Adapter |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerListener |
---|
ContainerListener.Adapter |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerMouseListener |
---|
ContainerMouseListener.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 | |
---|---|
TextPaneSkin()
|
Method Summary | |
---|---|
void |
documentChanged(TextPane textPane,
Document previousDocument)
Called when a text pane's document has changed. |
void |
editableChanged(TextPane textPane)
Called when a text pane'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 |
getBaseline(int width,
int height)
Returns the baseline for a given width and height. |
Bounds |
getCharacterBounds(int offset)
Returns the bounds of the character at a given offset within the document. |
Color |
getColor()
|
Font |
getFont()
|
Color |
getInactiveColor()
|
Color |
getInactiveSelectionBackgroundColor()
|
Color |
getInactiveSelectionColor()
|
int |
getInsertionPoint(int x,
int y)
Returns the insertion point for a given location. |
Insets |
getMargin()
|
int |
getNextInsertionPoint(int x,
int from,
TextPane.ScrollDirection direction)
Returns the next insertion point given an x coordinate and a character offset. |
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. |
int |
getRowAt(int offset)
Returns the row index of the character at a given offset within the document. |
int |
getRowCount()
Returns the total number of rows in the document. |
Color |
getSelectionBackgroundColor()
|
Color |
getSelectionColor()
|
boolean |
getWrapText()
|
void |
install(Component component)
Associates a skin with a component. |
boolean |
isFocusable()
By default, skins are focusable. |
boolean |
keyPressed(Component component,
int keyCode,
Keyboard.KeyLocation keyLocation)
TAB Transfers focus forwardsTAB + SHIFT Transfers focus
backwards |
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. |
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 |
selectionChanged(TextPane textPane,
int previousSelectionStart,
int previousSelectionLength)
Called when a text pane's selection state has changed. |
void |
setColor(Color color)
|
void |
setColor(String color)
|
void |
setFont(Dictionary<String,?> font)
|
void |
setFont(Font font)
|
void |
setFont(String font)
|
void |
setInactiveColor(Color inactiveColor)
|
void |
setInactiveColor(String inactiveColor)
|
void |
setInactiveSelectionBackgroundColor(Color inactiveSelectionBackgroundColor)
|
void |
setInactiveSelectionBackgroundColor(String inactiveSelectionBackgroundColor)
|
void |
setInactiveSelectionColor(Color inactiveSelectionColor)
|
void |
setInactiveSelectionColor(String inactiveSelectionColor)
|
void |
setMargin(Dictionary<String,?> margin)
|
void |
setMargin(Insets margin)
|
void |
setMargin(int margin)
|
void |
setMargin(Number margin)
|
void |
setMargin(String margin)
|
void |
setSelectionBackgroundColor(Color selectionBackgroundColor)
|
void |
setSelectionBackgroundColor(String selectionBackgroundColor)
|
void |
setSelectionColor(Color selectionColor)
|
void |
setSelectionColor(String selectionColor)
|
void |
setWrapText(boolean wrapText)
|
Methods inherited from class org.apache.pivot.wtk.skin.ContainerSkin |
---|
componentInserted, componentMoved, componentsRemoved, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isOpaque, mouseDown, mouseMove, mouseUp, mouseWheel, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint, setBackgroundPaint |
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin |
---|
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, getBaseline, getComponent, getHeight, getWidth, heightLimitsChanged, invalidateComponent, keyReleased, locationChanged, menuHandlerChanged, mouseClick, mouseOut, mouseOver, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setSize, 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 TextPaneSkin()
Method Detail |
---|
public void install(Component component)
Skin
install
in interface Skin
install
in class ContainerSkin
component
- The component to which the skin is being attached.public boolean isFocusable()
ComponentSkin
isFocusable
in interface Skin
isFocusable
in class ContainerSkin
public int getPreferredWidth(int height)
ConstrainedVisual
getPreferredWidth
in interface ConstrainedVisual
getPreferredWidth
in class ContainerSkin
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
getPreferredHeight
in class ContainerSkin
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
paint
in class ContainerSkin
graphics
- The graphics context in which to paint the visual.public int getInsertionPoint(int x, int y)
TextPane.Skin
getInsertionPoint
in interface TextPane.Skin
public int getNextInsertionPoint(int x, int from, TextPane.ScrollDirection direction)
TextPane.Skin
getNextInsertionPoint
in interface TextPane.Skin
public int getRowAt(int offset)
TextPane.Skin
getRowAt
in interface TextPane.Skin
public int getRowCount()
TextPane.Skin
getRowCount
in interface TextPane.Skin
public Bounds getCharacterBounds(int offset)
TextPane.Skin
getCharacterBounds
in interface TextPane.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 Color getInactiveColor()
public void setInactiveColor(Color inactiveColor)
public final void setInactiveColor(String inactiveColor)
public Color getSelectionColor()
public void setSelectionColor(Color selectionColor)
public final void setSelectionColor(String selectionColor)
public Color getSelectionBackgroundColor()
public void setSelectionBackgroundColor(Color selectionBackgroundColor)
public final void setSelectionBackgroundColor(String selectionBackgroundColor)
public Color getInactiveSelectionColor()
public void setInactiveSelectionColor(Color inactiveSelectionColor)
public final void setInactiveSelectionColor(String inactiveSelectionColor)
public Color getInactiveSelectionBackgroundColor()
public void setInactiveSelectionBackgroundColor(Color inactiveSelectionBackgroundColor)
public final void setInactiveSelectionBackgroundColor(String inactiveSelectionBackgroundColor)
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 getWrapText()
public void setWrapText(boolean wrapText)
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 keyTyped(Component component, char character)
ComponentKeyListener
keyTyped
in interface ComponentKeyListener
keyTyped
in class ComponentSkin
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
ComponentSkin
TAB
Transfers focus forwardsTAB
+ SHIFT
Transfers focus
backwards
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(TextPane textPane, Document previousDocument)
TextPaneListener
documentChanged
in interface TextPaneListener
public void editableChanged(TextPane textPane)
TextPaneListener
editableChanged
in interface TextPaneListener
public void selectionChanged(TextPane textPane, int previousSelectionStart, int previousSelectionLength)
TextPaneSelectionListener
selectionChanged
in interface TextPaneSelectionListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |