|
||||||||||
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 | |
---|---|
static interface |
Container.EDT_Checker
|
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component |
---|
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary |
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence |
---|
Sequence.Tree<T> |
Constructor Summary | |
---|---|
Container()
|
Method Summary | |
---|---|
int |
add(Component component)
Adds an item to the sequence. |
protected void |
assertEventDispatchThread()
|
static void |
assertEventDispatchThread(Component component)
|
void |
clear()
Propagates clear operation to subcomponents. |
boolean |
containsFocus()
Tests whether this container is an ancestor of the currently focused component. |
protected void |
descendantAdded(Component descendant)
|
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()
|
Component |
getDescendantAt(int x,
int y)
|
FocusTraversalPolicy |
getFocusTraversalPolicy()
Returns this container's focus traversal policy. |
Graphics2D |
getGraphics()
Creates a graphics context for this component. |
int |
getLength()
Returns the length of the sequence. |
Component |
getNamedComponent(String name)
|
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. |
void |
invalidate()
Flags the component's hierarchy as invalid, and clears any cached preferred size. |
boolean |
isAncestor(Component component)
Tests if this container is an ancestor of a given component. |
boolean |
isDoubleBuffered()
|
Iterator<Component> |
iterator()
|
protected void |
layout()
Called to lay out the component. |
void |
load(Object 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)
|
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 |
repaint(int x,
int y,
int width,
int height,
boolean immediate)
Flags an area as needing to be repainted. |
boolean |
requestFocus()
Requests that focus be given to this container. |
void |
setDoubleBuffered(boolean b)
|
static void |
setEventDispatchThreadChecker(Container.EDT_Checker runnable)
|
void |
setFocusTraversalPolicy(FocusTraversalPolicy focusTraversalPolicy)
Sets this container's focus traversal policy. |
protected void |
setParent(Container parent)
|
void |
setVisible(boolean visible)
Sets the component's visibility. |
void |
store(Object context)
Propagates binding to subcomponents. |
Component |
transferFocus(Component component,
FocusTraversalDirection direction)
Transfers focus to the next focusable component. |
Component |
update(int index,
Component component)
Updates the item at the given index. |
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()
public void move(int from, int to)
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 Component getNamedComponent(String name)
public void setVisible(boolean visible)
Component
setVisible
in class Component
visible
- true if the component should be painted; false,
otherwise.protected void layout()
Component
layout
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 boolean isAncestor(Component component)
component
- The component to test.
public boolean requestFocus()
requestFocus
in class Component
public Component transferFocus(Component component, FocusTraversalDirection 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 descendantAdded(Component descendant)
protected void descendantRemoved(Component descendant)
protected void descendantGainedFocus(Component descendant, Component previousFocusedComponent)
protected void descendantLostFocus(Component descendant)
public void load(Object context)
load
in class Component
context
- public void store(Object context)
store
in class Component
context
- public void clear()
clear
in class Component
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 void invalidate()
Component
invalidate
in class Component
public void repaint(int x, int y, int width, int height, boolean immediate)
Component
repaint
in class Component
public Graphics2D getGraphics()
Component
getGraphics
in class Component
Component.isShowing()
public boolean isDoubleBuffered()
public void setDoubleBuffered(boolean b)
public ListenerList<ContainerListener> getContainerListeners()
public ListenerList<ContainerMouseListener> getContainerMouseListeners()
protected final void assertEventDispatchThread()
public static final void assertEventDispatchThread(Component component)
public static final void setEventDispatchThreadChecker(Container.EDT_Checker runnable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |