buoy.widget
Class BDialog

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.BDialog

public class BDialog
extends WindowWidget

A BDialog is a WidgetContainer corresponding to a dialog 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, BDialogs generate the following event types:

Author:
Peter Eastman

Constructor Summary
BDialog()
          Create a non-modal BDialog with no title or parent window.
BDialog(java.lang.String title)
          Create a non-modal BDialog with no parent window.
BDialog(WindowWidget parent, boolean modal)
          Create a new BDialog with no title.
BDialog(WindowWidget parent, java.lang.String title, boolean modal)
          Create a new BDialog.
 
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.JDialog getComponent()
          Get the java.awt.Component corresponding to this Widget.
 BMenuBar getMenuBar()
          Get the BMenuBar for this window.
 java.lang.String getTitle()
          Get the title of the dialog.
 boolean isModal()
          Determine whether this dialog is modal.
 boolean isResizable()
          Determine whether this dialog may be resized by the user.
 void pack()
          Select an appropriate size for the dialog, based on the preferred size of its contents, then re-layout all of its contents.
 void remove(Widget widget)
          Remove a child Widget from this container.
 void removeAll()
          Remove all child Widgets from this container.
 void setMenuBar(BMenuBar menus)
          Set the BMenuBar for this window.
 void setModal(boolean modal)
          Set whether this dialog is modal.
 void setResizable(boolean resizable)
          Set whether this dialog may be resized by the user.
 void setTitle(java.lang.String title)
          Set the title of the dialog.
 
Methods inherited from class buoy.widget.WindowWidget
dispose, getContent, getDefaultButton, isVisible, layoutChildren, 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

BDialog

public BDialog()
Create a non-modal BDialog with no title or parent window.


BDialog

public BDialog(java.lang.String title)
Create a non-modal BDialog with no parent window.

Parameters:
title - the title of the dialog

BDialog

public BDialog(WindowWidget parent,
               boolean modal)
Create a new BDialog with no title.

Parameters:
parent - the parent window (a BFrame or BDialog) for this dialog
modal - specifies whether this is a modal dialog

BDialog

public BDialog(WindowWidget parent,
               java.lang.String title,
               boolean modal)
Create a new BDialog.

Parameters:
parent - the parent window (a BFrame or BDialog) for this dialog
title - the title of the dialog
modal - specifies whether this is a modal dialog
Method Detail

getComponent

public javax.swing.JDialog 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 dialog.


setTitle

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


setModal

public void setModal(boolean modal)
Set whether this dialog is modal. This must be called before the dialog is made visible. It is not possible to change whether a currently visible dialog is modal.


isModal

public boolean isModal()
Determine whether this dialog is modal.


isResizable

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


setResizable

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


pack

public void pack()
Select an appropriate size for the dialog, based on the preferred size of its contents, then re-layout all of its contents. If this is being called for the first time before the dialog has yet been shown, it also centers the dialog relative to its parent (or the screen if it does not have a parent).

Overrides:
pack in class WindowWidget


Written by Peter Eastman.