|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpivot.wtk.Component
pivot.wtk.Container
public abstract class Container
Abstract base class for containers.
NOTES:
Window.setContent(Component)
); additional components may
be added by the skin when installed. Other components may still be added but
may not be rendered properly by the installed skin.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class pivot.wtk.Component |
---|
Component.Attributes, Component.ComponentDictionary, Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary |
Nested classes/interfaces inherited from interface pivot.collections.Sequence |
---|
Sequence.Search, Sequence.Sort, Sequence.Tree |
Constructor Summary | |
---|---|
Container()
|
Method Summary | |
---|---|
int |
add(Component component)
Adds an item to the sequence. |
boolean |
containsFocus()
Tests whether this container is an ancestor of the currently focused component. |
Component |
get(int index)
Retrieves the item at the given index. |
Component |
getComponentAt(int x,
int y)
|
ListenerList<ContainerListener> |
getContainerListeners()
|
ListenerList<ContainerMouseListener> |
getContainerMouseListeners()
|
String |
getContextKey()
Returns the container's context key. |
Component |
getDescendantAt(int x,
int y)
|
FocusTraversalPolicy |
getFocusTraversalPolicy()
Returns this container's focus traversal policy. |
int |
getLength()
Returns the length of the sequence. |
int |
indexOf(Component component)
Returns the index of an item in the sequence. |
void |
insert(Component component,
int index)
Inserts an item into the sequence at a specific index. |
boolean |
isAncestor(Component component)
Tests if this container is an ancestor of a given component. |
boolean |
isFocusable()
Returns this component's focusability. |
Iterator<Component> |
iterator()
|
void |
load(Dictionary<String,?> context)
Propagates binding to subcomponents. |
protected boolean |
mouseClick(Mouse.Button button,
int x,
int y,
int count)
|
protected boolean |
mouseDown(Mouse.Button button,
int x,
int y)
|
protected boolean |
mouseMove(int x,
int y)
|
protected void |
mouseOut()
|
protected boolean |
mouseUp(Mouse.Button button,
int x,
int y)
|
protected boolean |
mouseWheel(Mouse.ScrollType scrollType,
int scrollAmount,
int wheelRotation,
int x,
int y)
|
protected void |
move(int from,
int to)
Moves a component within the component sequence. |
void |
paint(Graphics2D graphics)
Paints the component. |
int |
remove(Component component)
Removes the first occurrence of the given item from the sequence. |
Sequence<Component> |
remove(int index,
int count)
Removes one or more items from the sequence. |
Sequence<Component> |
removeAll()
|
void |
requestFocus()
Requests that focus be given to this component. |
void |
setContextKey(String contextKey)
Sets the component's context key. |
void |
setEnabled(boolean enabled)
Sets the component's enabled state. |
void |
setFocusTraversalPolicy(FocusTraversalPolicy focusTraversalPolicy)
Sets this container's focus traversal policy. |
protected void |
setParent(Container parent)
|
void |
setTooltip(String tooltip)
Unsupported for containers. |
void |
setVisible(boolean visible)
Sets the component's visibility. |
void |
store(Dictionary<String,?> context)
Propagates binding to subcomponents. |
Component |
update(int index,
Component component)
Updates the item at the given index. |
void |
validate()
Lays out the component by calling Skin.layout() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Container()
Method Detail |
---|
public final int add(Component component)
Sequence
add
in interface Sequence<Component>
component
- The item to be added to the sequence.
public void insert(Component component, int index)
Sequence
insert
in interface Sequence<Component>
component
- The item to be added to the sequence.index
- The index at which the item should be inserted. Must be a value between
0 and getLength().public Component update(int index, Component component)
Sequence
update
in interface Sequence<Component>
index
- The index of the item to update.component
- The item that will replace any existing value at the given index.
public final int remove(Component component)
Sequence
remove
in interface Sequence<Component>
component
- The item to remove.
Sequence.remove(int, int)
public Sequence<Component> remove(int index, int count)
Sequence
remove
in interface Sequence<Component>
index
- The starting index to remove.count
- The number of items to remove, beginning with index.
public final Sequence<Component> removeAll()
protected void move(int from, int to)
WindowListener.windowMoved(Window, int, int)
as an example).
from
- to
- public Component get(int index)
Sequence
get
in interface Sequence<Component>
index
- The index of the item to retrieve.public int indexOf(Component component)
Sequence
indexOf
in interface Sequence<Component>
component
- The item to locate.
public int getLength()
Sequence
getLength
in interface Sequence<Component>
public Iterator<Component> iterator()
iterator
in interface Iterable<Component>
protected void setParent(Container parent)
setParent
in class Component
public Component getComponentAt(int x, int y)
public Component getDescendantAt(int x, int y)
public void setVisible(boolean visible)
Component
NOTE This method should only be called during layout. Callers should
use Component.setDisplayable(boolean)
.
setVisible
in class Component
visible
- true if the component should be painted; false,
otherwise.public void validate()
Component
Skin.layout()
.
validate
in class Component
public void paint(Graphics2D graphics)
Component
paint
in interface Visual
paint
in class Component
graphics
- The graphics context in which to paint the visual.public void setEnabled(boolean enabled)
Component
setEnabled
in class Component
enabled
- true if the component is enabled; false, otherwise.public void setTooltip(String tooltip)
public boolean isAncestor(Component component)
component
- The component to test.
public final boolean isFocusable()
Component
isFocusable
in class Component
public void requestFocus()
Component
requestFocus
in class Component
public FocusTraversalPolicy getFocusTraversalPolicy()
public void setFocusTraversalPolicy(FocusTraversalPolicy focusTraversalPolicy)
focusTraversalPolicy
- The focus traversal policy to use with this container.public boolean containsFocus()
public String getContextKey()
public void setContextKey(String contextKey)
contextKey
- The context key, or null to clear the context.public void load(Dictionary<String,?> context)
load
in class Component
context
- public void store(Dictionary<String,?> context)
store
in class Component
context
- protected boolean mouseMove(int x, int y)
mouseMove
in class Component
protected void mouseOut()
mouseOut
in class Component
protected boolean mouseDown(Mouse.Button button, int x, int y)
mouseDown
in class Component
protected boolean mouseUp(Mouse.Button button, int x, int y)
mouseUp
in class Component
protected boolean mouseClick(Mouse.Button button, int x, int y, int count)
mouseClick
in class Component
protected boolean mouseWheel(Mouse.ScrollType scrollType, int scrollAmount, int wheelRotation, int x, int y)
mouseWheel
in class Component
public ListenerList<ContainerListener> getContainerListeners()
public ListenerList<ContainerMouseListener> getContainerMouseListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |