Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
charva.awt.Component
charva.awt.Container
public abstract class Container
extends Component
Field Summary | |
protected Vector |
|
protected Component |
|
protected Insets |
|
protected boolean |
|
protected LayoutManager |
|
protected Dimension |
|
protected Dimension |
|
Fields inherited from class charva.awt.Component | |
BOTTOM_ALIGNMENT , CENTER_ALIGNMENT , LEFT_ALIGNMENT , RIGHT_ALIGNMENT , TOP_ALIGNMENT , _alignmentX , _alignmentY , _background , _cursesColor , _enabled , _focusListeners , _foreground , _keyListeners , _origin , _parent , _visible |
Constructor Summary | |
Method Summary | |
Component | |
void | |
void |
|
void |
|
void |
|
Component |
|
Component |
|
Component |
|
int |
|
Component[] |
|
Component |
|
int | |
Insets | |
Dimension |
|
int |
|
void |
|
boolean |
|
boolean |
|
Dimension | |
void |
|
void |
|
void |
|
void | |
void | |
void |
|
void | |
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
Methods inherited from class charva.awt.Component | |
addFocusListener , addKeyListener , contains , contains , debug , draw , getAlignmentX , getAlignmentY , getAncestorWindow , getBackground , getBounds , getCursesColor , getForeground , getHeight , getLocation , getLocationOnScreen , getName , getParent , getSize , getWidth , hasFocus , hide , invalidate , isDisplayed , isEnabled , isFocusTraversable , isTotallyObscured , isValid , isVisible , minimumSize , processEvent , processFocusEvent , processKeyEvent , processMouseEvent , repaint , requestFocus , requestSync , setBackground , setEnabled , setForeground , setLocation , setLocation , setName , setParent , setVisible , show , validate , validateCursesColor |
protected Vector _components
The list of components contained within this Container.
protected Component _currentFocus
The component (which may itself be a Container) inside this Container that currently has the input focus (or, if the input focus is currently outside this Container, the component to which focus will return if and when this Container regains focus).
protected Insets _insets
The insets define how much padding to insert inside the Container, to take into account the border frame (if any). For a Window they will be (1,1); for a Panel, they will be (0,0).
protected boolean _isValid
A flag that is set to true when the container is laid out, and set to false when a component is added or removed from the container (indicating that it needs to be laid out again).
protected LayoutManager _layoutMgr
The layout manager that will be used to lay out the components.
protected Dimension _minimumSize
Used for caching the minimum size of this container, so that we don't have to keep recalculating it. This dimension is valid only if _isValid is true.
public Component add(Component component_)
The contained component will inherit the foreground and background colors of the container if they have not been set yet.
public void add(Component component_, Object constraint_)
Adds the specified component to the end of this container. Also notifies the layout manager to add this component to the layout using the specified constraint. If the layout manager does not implement the LayoutManager2 interface, i.e. does not know about layout constraints, we silently ignore the constraint (maybe fix this to throw an exception?).
public void doLayout()
doLayout is intended to be used by subclasses of Container, such as Window, JPanel and JScrollPane.
public void draw()
Draw all the components in this container.
public Component getComponentAt(Point p)
Returns the component that contains the specified point, or null if no component contains the point. The x and y coordinates of the point are relative to the origin of this container.
public Component getComponentAt(int x, int y)
Returns the component that contains the specified point, or null if no component contains the point. The x and y coordinates of the point are relative to the origin of this container.
public int getComponentCount()
Returns the number of components in this Container.
public Component[] getComponents()
Returns an array of all the components in this container.
public Component getCurrentFocus()
Return a reference to the (non-container) component inside this Container that has the keyboard input focus (or would have it, if the focus was inside this container). If no component inside the container has the focus, choose the first FocusTraversable component.
- Returns:
- the Component in this container that would have the focus; never null.
public void invalidate()
Marks the container and all parents above it as needing to be laid out again.
- Overrides:
- invalidate in interface Component
public boolean isFocusTraversable()
Return true if any of the components within this Container are focus-traversable (i.e. will accept keyboard input focus when TAB or SHIFT-TAB is pressed).
- Overrides:
- isFocusTraversable in interface Component
public boolean isValid()
Determines whether this component is valid. A container is valid when it is correctly sized and positioned within its parent container and all its children are also valid.
public void nextFocus()
Set the _currentFocus to refer to the next focus-traversable component in the list of contained components, and put FocusEvents on the queue, one for the component that is losing the focus and one for the component gaining the focus.
public void previousFocus()
Set the _currentFocus to refer to the previous focus-traversable component in the list of contained components, and put FocusEvents on the queue, one for the component that is losing the focus and one for the component gaining the focus.
public void processKeyEvent(KeyEvent ke_)
- Overrides:
- processKeyEvent in interface Component
public void setBackground(Color color_)
Sets the background color of this container and all its contained components that do not yet have their background color set. Overrides the same method in the Component class.
- Overrides:
- setBackground in interface Component
public void setFocus(Component focus_)
Set this container's current keyboard focus. Called by the requestFocus() method of the contained component.
public void setForeground(Color color_)
Sets the foreground color of this container and all its contained components that do not yet have their foreground color set. Overrides the same method in the Component class.
- Overrides:
- setForeground in interface Component
public void setHeight(int height_)
public void setSize(int width_, int height_)
public void setWidth(int width_)