charva.awt

Class Window

Implemented Interfaces:
Runnable
Known Direct Subclasses:
Dialog, Frame

public class Window
extends Container
implements Runnable

The Window class represents a "toplevel" window with no decorative frame. The window is initially invisible; you must use the show() method to make it visible.

Field Summary

protected Toolkit
_term

Fields inherited from class charva.awt.Container

_components, _currentFocus, _insets, _isValid, _layoutMgr, _minimumSize, _size

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

Window(Frame owner_)
Window(Window owner_)

Method Summary

void
addWindowListener(WindowListener listener_)
Register a WindowListener object for this window.
void
adjustLocation()
Adjust the position of the window so that it fits inside the screen.
void
debug(int level_)
void
draw()
Draw all the components in this window, and request the keyboard focus.
Point
getLocationOnScreen()
Overrides the method in the Component superclass, because a Window has no parent container.
Window
getOwner()
Return the Window that is the "owner" of this Window.
void
hide()
Hide this window and all of its contained components.
boolean
isDisplayed()
Returns true if this Window is currently displayed.
boolean
isFocusTraversable()
A Window component will not receive input focus during keyboard focus traversal using Tab and Shift-Tab.
void
pack()
Causes this Window to be sized to fit the preferred sizes and layouts of its contained components.
protected void
processEvent(AWTEvent evt_)
Process an event off the event queue.
protected void
processWindowEvent(WindowEvent evt_)
Process window events occurring on this window by dispatching them to any registered WindowListener objects.
void
run()
void
show()
Lay out the contained components, draw the window and its contained components, and then read input events off the EventQueue and send them to the component that has the input focus.

Methods inherited from class charva.awt.Container

add, add, debug, doLayout, draw, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getCurrentFocus, getHeight, getInsets, getSize, getWidth, invalidate, isFocusTraversable, isValid, minimumSize, nextFocus, previousFocus, processKeyEvent, remove, requestFocus, setBackground, setFocus, setForeground, setHeight, setLayout, setSize, setSize, setWidth, validate

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

Field Details

_term

protected Toolkit _term

Constructor Details

Window

public Window(Frame owner_)

Window

public Window(Window owner_)

Method Details

addWindowListener

public void addWindowListener(WindowListener listener_)
Register a WindowListener object for this window.

adjustLocation

public void adjustLocation()
Adjust the position of the window so that it fits inside the screen.

debug

public void debug(int level_)
Overrides:
debug in interface Container

draw

public void draw()
Draw all the components in this window, and request the keyboard focus.
Overrides:
draw in interface Container

getLocationOnScreen

public Point getLocationOnScreen()
Overrides the method in the Component superclass, because a Window has no parent container. Note that we return a COPY of the origin, not a reference to it, so that the caller cannot modify our location via the returned value.
Overrides:
getLocationOnScreen in interface Component

getOwner

public Window getOwner()
Return the Window that is the "owner" of this Window.

hide

public void hide()
Hide this window and all of its contained components. This is done by putting a WINDOW_CLOSING event onto the queue.
Overrides:
hide in interface Component

isDisplayed

public boolean isDisplayed()
Returns true if this Window is currently displayed.
Overrides:
isDisplayed in interface Component

isFocusTraversable

public boolean isFocusTraversable()
A Window component will not receive input focus during keyboard focus traversal using Tab and Shift-Tab.
Overrides:
isFocusTraversable in interface Container

pack

public void pack()
Causes this Window to be sized to fit the preferred sizes and layouts of its contained components.

processEvent

protected void processEvent(AWTEvent evt_)
Process an event off the event queue. This method can be extended by subclasses of Window to deal with application-specific events.
Overrides:
processEvent in interface Component

processWindowEvent

protected void processWindowEvent(WindowEvent evt_)
Process window events occurring on this window by dispatching them to any registered WindowListener objects.

run

public void run()

show

public void show()
Lay out the contained components, draw the window and its contained components, and then read input events off the EventQueue and send them to the component that has the input focus.
Overrides:
show in interface Component