buoy.widget

Class 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(String title)
Create a non-modal BDialog with no parent window.
BDialog(WindowWidget parent, String title, boolean modal)
Create a new BDialog.
BDialog(WindowWidget parent, boolean modal)
Create a new BDialog with no title.

Method Summary

int
getChildCount()
Get the number of children in this container.
Collection
getChildren()
Get a Collection containing all child Widgets of this container.
JDialog
getComponent()
BMenuBar
getMenuBar()
Get the BMenuBar for this window.
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(String title)
Set the title of the dialog.

Methods inherited from class buoy.widget.WindowWidget

dispose, getComponent, getContent, getDefaultButton, isVisible, layoutChildren, pack, setBounds, setContent, setDefaultButton, setVisible, toBack, toFront

Methods inherited from class buoy.widget.WidgetContainer

getChildCount, getChildren, isOpaque, layoutChildren, remove, removeAll, setOpaque

Methods inherited from class buoy.widget.Widget

addEventLink, dispatchEvent, getBackground, getBounds, getComponent, getCursor, getFont, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible

Methods inherited from class buoy.event.EventSource

addEventLink, addEventLink, addEventLink, dispatchEvent, removeEventLink

Constructor Details

BDialog

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

BDialog

public BDialog(String title)
Create a non-modal BDialog with no parent window.
Parameters:
title - the title of the dialog

BDialog

public BDialog(WindowWidget parent,
               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

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

Method Details

getChildCount

public int getChildCount()
Get the number of children in this container.
Overrides:
getChildCount in interface WidgetContainer

getChildren

public Collection getChildren()
Get a Collection containing all child Widgets of this container.
Overrides:
getChildren in interface WidgetContainer

getComponent

public JDialog getComponent()
Overrides:
getComponent in interface WindowWidget

getMenuBar

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

getTitle

public String getTitle()
Get the title of the dialog.

isModal

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

isResizable

public boolean isResizable()
Determine 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 interface WindowWidget

remove

public void remove(Widget widget)
Remove a child Widget from this container.
Overrides:
remove in interface WidgetContainer

removeAll

public void removeAll()
Remove all child Widgets from this container.
Overrides:
removeAll in interface WidgetContainer

setMenuBar

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

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.

setResizable

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

setTitle

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

Written by Peter Eastman.