buoy.widget
Class WindowWidget

java.lang.Object
  extended by buoy.event.EventSource
      extended by buoy.widget.Widget
          extended by buoy.widget.WidgetContainer
              extended by buoy.widget.WindowWidget
Direct Known Subclasses:
BDialog, BFrame, BWindow

public abstract class WindowWidget
extends WidgetContainer

A WindowWidget is a WidgetContainer corresponding to a window. This is an abstract class, with subclasses for particular types of windows.

Author:
Peter Eastman

Constructor Summary
WindowWidget()
           
 
Method Summary
 void dispose()
          Close the window, and dispose of all resources associated with it.
 java.awt.Window getComponent()
          Get the java.awt.Component corresponding to this Widget.
 Widget getContent()
          Get the Widget that holds the main contents of the window.
 BButton getDefaultButton()
          Get the default button for this window.
 boolean isVisible()
          Determine whether this Widget is currently visible.
 void layoutChildren()
          Layout the child Widgets.
 void pack()
          Select an appropriate size for the window, based on the preferred size of its contents, then re-layout all of the window contents.
 void setBounds(java.awt.Rectangle bounds)
          Set the position and size of the window, then re-layout the window contents.
 void setContent(Widget contentWidget)
          Set the Widget that holds the main contents of the window.
 void setDefaultButton(BButton button)
          Set the default button for this window.
 void setVisible(boolean visible)
          Set whether this Widget should be visible.
 void toBack()
          Request that this window be sent to the back, so that it is displayed behind all other windows.
 void toFront()
          Request that this window be brought to the front, so that it is displayed over all other windows.
 
Methods inherited from class buoy.widget.WidgetContainer
getChildCount, getChildren, isOpaque, remove, removeAll, setOpaque
 
Methods inherited from class buoy.widget.Widget
addEventLink, dispatchEvent, getBackground, getBounds, getCursor, getFont, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName
 
Methods inherited from class buoy.event.EventSource
addEventLink, addEventLink, removeEventLink
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowWidget

public WindowWidget()
Method Detail

getComponent

public java.awt.Window getComponent()
Description copied from class: Widget
Get the java.awt.Component corresponding to this Widget.

Overrides:
getComponent in class Widget

setBounds

public void setBounds(java.awt.Rectangle bounds)
Set the position and size of the window, then re-layout the window contents.


getContent

public Widget getContent()
Get the Widget that holds the main contents of the window.


setContent

public void setContent(Widget contentWidget)
Set the Widget that holds the main contents of the window.


pack

public void pack()
Select an appropriate size for the window, based on the preferred size of its contents, then re-layout all of the window contents.


layoutChildren

public void layoutChildren()
Layout the child Widgets. This may be invoked whenever something has changed (the size of this WidgetContainer, the preferred size of one of its children, etc.) that causes the layout to no longer be correct. If a child is itself a WidgetContainer, its layoutChildren() method will be called in turn.

Specified by:
layoutChildren in class WidgetContainer

dispose

public void dispose()
Close the window, and dispose of all resources associated with it.


toFront

public void toFront()
Request that this window be brought to the front, so that it is displayed over all other windows.

Note that the behavior of this method is highly platform dependent. It is not guaranteed to work on all platforms. In addition, this method may or may not affect which Widget has focus.


toBack

public void toBack()
Request that this window be sent to the back, so that it is displayed behind all other windows.

Note that the behavior of this method is highly platform dependent. It is not guaranteed to work on all platforms. In addition, this method may or may not affect which Widget has focus.


isVisible

public boolean isVisible()
Determine whether this Widget is currently visible.

Overrides:
isVisible in class Widget

setVisible

public void setVisible(boolean visible)
Set whether this Widget should be visible.

Overrides:
setVisible in class Widget

getDefaultButton

public BButton getDefaultButton()
Get the default button for this window. If the user presses the Return or Enter key while the window has focus, it will be treated as if they had clicked the default button (unless another Widget first consumes the event). The default button is typically drawn differently to indicate its special status. This may be null.


setDefaultButton

public void setDefaultButton(BButton button)
Set the default button for this window. If the user presses the Return or Enter key while the window has focus, it will be treated as if they had clicked the default button (unless another Widget first consumes the event). The default button is typically drawn differently to indicate its special status. This may be null.



Written by Peter Eastman.