|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.Component
org.apache.pivot.wtk.Container
public abstract class Container
Abstract base class for containers.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component |
---|
Component.ComponentDictionary, Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary |
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence |
---|
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. |
protected void |
descendantGainedFocus(Component descendant,
Component previousFocusedComponent)
|
protected void |
descendantLostFocus(Component descendant)
|
protected void |
descendantRemoved(Component descendant)
|
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. |
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()
|
boolean |
requestFocus()
Requests that focus be given to this container. |
void |
setContextKey(String contextKey)
Sets the component's context key. |
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 |
transferFocus(Component component,
Direction direction)
Transfers focus to the next focusable component. |
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, finalize, 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
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 setTooltip(String tooltip)
public boolean isAncestor(Component component)
component
- The component to test.
public boolean requestFocus()
requestFocus
in class Component
public Component transferFocus(Component component, Direction direction)
component
- The component from which focus will be transferred.direction
- The direction in which to transfer focus.public FocusTraversalPolicy getFocusTraversalPolicy()
public void setFocusTraversalPolicy(FocusTraversalPolicy focusTraversalPolicy)
focusTraversalPolicy
- The focus traversal policy to use with this container.public boolean containsFocus()
protected void descendantGainedFocus(Component descendant, Component previousFocusedComponent)
protected void descendantLostFocus(Component descendant)
protected void descendantRemoved(Component descendant)
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 |