charva.awt
Class Window

java.lang.Object
  extended bycharva.awt.Component
      extended bycharva.awt.Container
          extended bycharva.awt.Window
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
Dialog, Frame

public class Window
extends Container
implements java.lang.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
_alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
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, doLayout, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getCurrentFocus, getHeight, getInsets, getSize, getWidth, invalidate, 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, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getLocation, getName, getParent, hasFocus, isEnabled, isTotallyObscured, isVisible, processFocusEvent, processMouseEvent, repaint, requestSync, setBounds, setBounds, setBounds, setEnabled, setLocation, setLocation, setName, setParent, setVisible, validateCursesColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_term

protected Toolkit _term
Constructor Detail

Window

public Window(Window owner_)

Window

public Window(Frame owner_)
Method Detail

getOwner

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


addWindowListener

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


processWindowEvent

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


isDisplayed

public boolean isDisplayed()
Returns true if this Window is currently displayed.

Overrides:
isDisplayed in class Component

pack

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


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 class Component

run

public void run()
Specified by:
run in interface java.lang.Runnable

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 class Component

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 class Component

draw

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

Overrides:
draw in class 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 class 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 class Container

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 class Container