buoy.widget
Class BFrame

java.lang.Object
  extended by buoy.event.EventSource
      extended by buoy.widget.Widget
          extended by buoy.widget.WidgetContainer
              extended by buoy.widget.WindowWidget
                  extended by buoy.widget.BFrame

public class BFrame
extends WindowWidget

A BFrame is a WidgetContainer corresponding to a main window. It may contain up to two child Widgets: a BMenuBar, and a single other Widget (usually a WidgetContainer of some sort) which fills the rest of the window.

In addition to the event types generated by all Widgets, BFrames generate the following event types:

Author:
Peter Eastman

Constructor Summary
BFrame()
          Create a new BFrame.
BFrame(java.lang.String title)
          Create a new BFrame.
 
Method Summary
 int getChildCount()
          Get the number of children in this container.
 java.util.Collection<Widget> getChildren()
          Get a Collection containing all child Widgets of this container.
 javax.swing.JFrame getComponent()
          Get the java.awt.Component corresponding to this Widget.
static java.util.List<BFrame> getFrames()
          Get a list of all BFrames that currently exist.
 javax.swing.ImageIcon getIcon()
          Get the image which should be used to represent this window when it is iconified.
 BMenuBar getMenuBar()
          Get the BMenuBar for this window.
 java.lang.String getTitle()
          Get the title of the window.
 boolean isIconified()
          Determine whether this window has been iconified.
 boolean isMaximized()
          Determine whether this window has been maximized.
 boolean isResizable()
          Determine whether this window may be resized by the user.
 void remove(Widget widget)
          Remove a child Widget from this container.
 void removeAll()
          Remove all child Widgets from this container.
 void setIcon(javax.swing.ImageIcon icon)
          Set the image which should be used to represent this window when it is iconified.
 void setIconified(boolean iconified)
          Set whether this window is iconified.
 void setMaximized(boolean maximized)
          Set whether this window is maximized.
 void setMenuBar(BMenuBar menus)
          Set the BMenuBar for this window.
 void setResizable(boolean resizable)
          Set whether this window may be resized by the user.
 void setTitle(java.lang.String title)
          Set the title of the window.
 
Methods inherited from class buoy.widget.WindowWidget
dispose, getContent, getDefaultButton, isVisible, layoutChildren, pack, setBounds, setContent, setDefaultButton, setVisible, toBack, toFront
 
Methods inherited from class buoy.widget.WidgetContainer
isOpaque, 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

BFrame

public BFrame()
Create a new BFrame.


BFrame

public BFrame(java.lang.String title)
Create a new BFrame.

Method Detail

getComponent

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

Overrides:
getComponent in class WindowWidget

getChildCount

public int getChildCount()
Get the number of children in this container.

Specified by:
getChildCount in class WidgetContainer

getChildren

public java.util.Collection<Widget> getChildren()
Get a Collection containing all child Widgets of this container.

Specified by:
getChildren in class WidgetContainer

getMenuBar

public BMenuBar getMenuBar()
Get the BMenuBar for this window.


setMenuBar

public void setMenuBar(BMenuBar menus)
Set the BMenuBar for this window.


remove

public void remove(Widget widget)
Remove a child Widget from this container.

Specified by:
remove in class WidgetContainer

removeAll

public void removeAll()
Remove all child Widgets from this container.

Specified by:
removeAll in class WidgetContainer

getTitle

public java.lang.String getTitle()
Get the title of the window.


setTitle

public void setTitle(java.lang.String title)
Set the title of the window.


isResizable

public boolean isResizable()
Determine whether this window may be resized by the user.


setResizable

public void setResizable(boolean resizable)
Set whether this window may be resized by the user.


isIconified

public boolean isIconified()
Determine whether this window has been iconified. The precise behavior of an iconified window is platform specific, but it generally causes the window to be hidden and replaced by an icon on the desktop or elsewhere on the screen.


setIconified

public void setIconified(boolean iconified)
Set whether this window is iconified. The precise behavior of an iconified window is platform specific, but it generally causes the window to be hidden and replaced by an icon on the desktop or elsewhere on the screen.


getIcon

public javax.swing.ImageIcon getIcon()
Get the image which should be used to represent this window when it is iconified. Note that the behavior of iconified windows is platform specific, and some platforms may ignore the image you set. Also, some platforms may display this image in the title bar of the window.

This may be null, in which case the platform-specific default image will be used.


setIcon

public void setIcon(javax.swing.ImageIcon icon)
Set the image which should be used to represent this window when it is iconified. Note that the behavior of iconified windows is platform specific, and some platforms may ignore the image you set. Also, some platforms may display this image in the title bar of the window.

This may be null, in which case the platform-specific default image will be used.


isMaximized

public boolean isMaximized()
Determine whether this window has been maximized. The precise behavior of a maximized window is platform specific, but it generally causes the window to expand to fill the entire screen.


setMaximized

public void setMaximized(boolean maximized)
Set whether this window is maximized. The precise behavior of a maximized window is platform specific, but it generally causes the window to expand to fill the entire screen.


getFrames

public static java.util.List<BFrame> getFrames()
Get a list of all BFrames that currently exist.



Written by Peter Eastman.