|
||||||||||
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
public abstract class ContainerSkin
Abstract base class for container skins.
Nested Class Summary | |
---|---|
static class |
ContainerSkin.IndexFocusTraversalPolicy
Focus traversal policy that determines traversal order based on the order of components in the container's component sequence. |
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 | |
---|---|
ContainerSkin()
|
Method Summary | |
---|---|
void |
componentInserted(Container container,
int index)
Called when a component has been inserted into a container's component sequence. |
void |
componentMoved(Container container,
int from,
int to)
Called when a component has moved from one z-index to another within a container. |
void |
componentsRemoved(Container container,
int index,
Sequence<Component> removed)
Called when components have been removed from a container's component sequence. |
void |
focusTraversalPolicyChanged(Container container,
FocusTraversalPolicy previousFocusTraversalPolicy)
Called when a container's focus traversal policy has changed. |
Color |
getBackgroundColor()
Returns the color of the container's background if a solid color has been set as the background; otherwise null. |
Paint |
getBackgroundPaint()
Returns the Paint object used to paint the background of the container |
int |
getPreferredHeight(int width)
Returns the visual's preferred height given the provided width constraint. |
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 |
isFocusable()
By default, skins are focusable. |
boolean |
isOpaque()
By default, skins are assumed to be opaque. |
boolean |
mouseDown(Container container,
Mouse.Button button,
int x,
int y)
Called when the mouse is pressed over a container. |
boolean |
mouseMove(Container container,
int x,
int y)
Called when the mouse is moved over a container. |
boolean |
mouseUp(Container container,
Mouse.Button button,
int x,
int y)
Called when the mouse is released over a container. |
boolean |
mouseWheel(Container container,
Mouse.ScrollType scrollType,
int scrollAmount,
int wheelRotation,
int x,
int y)
Called when the mouse wheel is scrolled over a container. |
void |
paint(Graphics2D graphics)
Paints the visual. |
void |
setBackgroundColor(Color backgroundColor)
Sets the background of the container to a solid color. |
void |
setBackgroundColor(String backgroundColor)
Sets the background of the container to a solid color. |
void |
setBackgroundPaint(Dictionary<String,?> backgroundPaint)
Sets the object used to paint the background of the container. |
void |
setBackgroundPaint(Paint backgroundPaint)
Sets the object used to paint the background of the container. |
void |
setBackgroundPaint(String backgroundPaint)
Sets the object used to paint the background of the container. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.pivot.wtk.Skin |
---|
layout |
Constructor Detail |
---|
public ContainerSkin()
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 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()
ComponentSkin
isOpaque
in interface Skin
isOpaque
in class ComponentSkin
public Paint getBackgroundPaint()
Paint
object used to paint the background of the container
public void setBackgroundPaint(Paint backgroundPaint)
backgroundPaint
- The Paint
objectpublic final void setBackgroundPaint(String backgroundPaint)
backgroundPaint
- A string recognized by Pivot as a
Color or Paint value.public final void setBackgroundPaint(Dictionary<String,?> backgroundPaint)
backgroundPaint
- A dictionary containing a
Paint description.public Color getBackgroundColor()
public void setBackgroundColor(Color backgroundColor)
public final void setBackgroundColor(String backgroundColor)
backgroundColor
- Any of the color values recognized by Pivot.public void componentInserted(Container container, int index)
ContainerListener
componentInserted
in interface ContainerListener
public void componentsRemoved(Container container, int index, Sequence<Component> removed)
ContainerListener
componentsRemoved
in interface ContainerListener
public void componentMoved(Container container, int from, int to)
ContainerListener
componentMoved
in interface ContainerListener
public void focusTraversalPolicyChanged(Container container, FocusTraversalPolicy previousFocusTraversalPolicy)
ContainerListener
focusTraversalPolicyChanged
in interface ContainerListener
public boolean mouseMove(Container container, int x, int y)
ContainerMouseListener
mouseMove
in interface ContainerMouseListener
public boolean mouseDown(Container container, Mouse.Button button, int x, int y)
ContainerMouseListener
mouseDown
in interface ContainerMouseListener
public boolean mouseUp(Container container, Mouse.Button button, int x, int y)
ContainerMouseListener
mouseUp
in interface ContainerMouseListener
public boolean mouseWheel(Container container, Mouse.ScrollType scrollType, int scrollAmount, int wheelRotation, int x, int y)
ContainerMouseListener
mouseWheel
in interface ContainerMouseListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |