|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object charva.awt.Component charva.awt.Container
Container is the abstract superclass of Window and Panel.
Field Summary | |
protected java.util.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). |
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. |
protected Dimension |
_size
The container's size |
Fields inherited from class charva.awt.Component |
_alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
Container()
|
Method Summary | |
Component |
add(Component component_)
The contained component will inherit the foreground and background colors of the container if they have not been set yet. |
void |
add(Component component_,
java.lang.Object constraint_)
Adds the specified component to the end of this container. |
void |
debug(int level_)
|
void |
doLayout()
doLayout is intended to be used by subclasses of Container, such as Window, JPanel and JScrollPane. |
void |
draw()
Draw all the components in this container. |
Component |
getComponent(int n)
Returns the component at the specified index. |
Component |
getComponentAt(int x,
int y)
Returns the component that contains the specified point, or null if no component contains the point. |
Component |
getComponentAt(Point p)
Returns the component that contains the specified point, or null if no component contains the point. |
int |
getComponentCount()
Returns the number of components in this Container. |
Component[] |
getComponents()
Returns an array of all the components in this container. |
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). |
int |
getHeight()
|
Insets |
getInsets()
|
Dimension |
getSize()
|
int |
getWidth()
|
void |
invalidate()
Marks the container and all parents above it as needing to be laid out again. |
boolean |
isFocusTraversable()
Return true if any of the components within this Container are focus-traversable (i.e. |
boolean |
isValid()
Determines whether this component is valid. |
Dimension |
minimumSize()
|
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. |
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. |
void |
processKeyEvent(KeyEvent ke_)
Invoke all the KeyListener callbacks that may have been registered for this component. |
void |
remove(Component component_)
Removes the specified component from this container. |
void |
requestFocus()
This method should be invoked by all subclasses of Component which override this method; because this method generates the FOCUS_GAINED event when the component gains the keyboard focus. |
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. |
void |
setFocus(Component focus_)
Set this container's current keyboard focus. |
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. |
void |
setHeight(int height_)
|
void |
setLayout(LayoutManager mgr_)
|
void |
setSize(Dimension size_)
|
void |
setSize(int width_,
int height_)
|
void |
setWidth(int width_)
|
void |
validate()
Validates this container and all of its contained components. |
Methods inherited from class charva.awt.Component |
addFocusListener, addKeyListener, contains, contains, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getLocation, getLocationOnScreen, getName, getParent, hasFocus, hide, isDisplayed, isEnabled, isTotallyObscured, isVisible, processEvent, processFocusEvent, processMouseEvent, repaint, requestSync, setBounds, setBounds, setBounds, setEnabled, setLocation, setLocation, setName, setParent, setVisible, show, validateCursesColor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector _components
protected Dimension _size
protected LayoutManager _layoutMgr
protected Component _currentFocus
protected Insets _insets
protected boolean _isValid
protected Dimension _minimumSize
Constructor Detail |
public Container()
Method Detail |
public void doLayout()
public Dimension getSize()
getSize
in class Component
public int getHeight()
getHeight
in class Component
public int getWidth()
getWidth
in class Component
public void setSize(Dimension size_)
public void setSize(int width_, int height_)
public void setHeight(int height_)
public void setWidth(int width_)
public Dimension minimumSize()
minimumSize
in class Component
public Component getComponent(int n)
public Component getComponentAt(Point p)
public Component getComponentAt(int x, int y)
public Component add(Component component_)
public void remove(Component component_)
public void add(Component component_, java.lang.Object constraint_)
public void setLayout(LayoutManager mgr_)
public Component[] getComponents()
public int getComponentCount()
public void draw()
draw
in class Component
public void setForeground(Color color_)
setForeground
in class Component
public void setBackground(Color color_)
setBackground
in class Component
public void processKeyEvent(KeyEvent ke_)
Component
processKeyEvent
in class Component
public void requestFocus()
Component
requestFocus
in class Component
public Component getCurrentFocus()
IllegalComponentStateException
- if there is no
focus-traversable component in this container.public void nextFocus()
public void previousFocus()
public void setFocus(Component focus_)
public boolean isFocusTraversable()
isFocusTraversable
in class Component
public Insets getInsets()
public void debug(int level_)
debug
in class Component
public void validate()
validate
in class Component
public boolean isValid()
isValid
in class Component
public void invalidate()
invalidate
in class Component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |