|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ucb.gui.TopLevel
public class TopLevel
A top-level window with optional menu bar. A TopLevel primarily exists to contain Widgets. The general technique is to extend TopLevel. Most of the methods here are protected: the intent is that any calls to them are from within your extension class, thus allowing the latter to retain control over its size, menu, etc.
Constructor Summary | |
---|---|
protected |
TopLevel(String title,
boolean exitOnClose)
A new TopLevel with the given TITLE (which window managers typically display on the border). |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
|
protected void |
add(Widget widget,
LayoutSpec layout)
Add a new Widget, placed according to LAYOUT. |
protected void |
addButton(String label,
Object receiver,
String funcName,
LayoutSpec layout)
Add a new button displaying LABEL, laid out according to LAYOUT, which when clicked calls the method named FUNCNAME of RECEIVER with LABEL as its single String argument. |
protected void |
addButton(String label,
String funcName,
LayoutSpec layout)
Add a new button displaying LABEL, placed according to LAYOUT, which when clicked calls my method named FUNCNAME with LABEL as its single String argument. |
protected void |
addLabel(String text,
LayoutSpec layout)
Add a new, anonymous label that displays the text TEXT, placed according to LAYOUT. |
protected void |
addLabel(String text,
String id,
LayoutSpec layout)
Add a label that initially displays the text TEXT, placed according to LAYOUT, and identified by the tag ID. |
protected void |
addMenuButton(String label,
Object receiver,
String funcName)
Add a new simple menu button labeled LABEL to my menus, which when clicked, invokes a method named FUNCNAME on RECEIVER, sending LABEL as data. |
protected void |
addMenuButton(String label,
String funcName)
Add a new simple menu button labeled LABEL to my menus, which when clicked invokes a function named FUNCNAME on me, sending LABEL as data. |
protected void |
addMenuRadioButton(String label,
String groupName,
boolean selected,
Object receiver,
String funcName)
Add a radio button labeled LABEL to my menus, belonging to the group of buttons called GROUPNAME. |
protected void |
addMenuRadioButton(String label,
String groupName,
boolean selected,
String funcName)
Add a radio button labeled LABEL to my menus, belonging to the group of buttons called GROUPNAME. |
protected void |
addSeparator(String label)
Add a separator to the end of the menu labeled LABEL (which must exist) in my menu bar. |
void |
display(boolean visible)
If VISIBLE, display this TopLevel. |
int |
getHeight()
My current height in pixels. |
String |
getTextInput(String message,
String title,
String type,
String init)
Display a dialog box with message MESSAGE and title TITLE that prompts the user for textual input, with INIT providing the initial value of the text. |
int |
getWidth()
My current width in pixels. |
protected boolean |
isSelected(String label)
True iff the button named LABEL is currently selected. |
protected void |
select(String label,
boolean val)
Set isSelected (LABEL) to VAL, if LABEL is a valid button. |
protected void |
setEnabled(boolean enable,
String... labels)
Set the enabled status of the buttons labeled LABELS[0], ... |
protected void |
setLabel(String id,
String text)
Set the text of the existing label with tag ID to TEXT. |
protected void |
setMaximumSize(int width,
int height)
Set my maximum size to WIDTHxHEIGHT pixels. |
protected void |
setMinimumSize(int width,
int height)
Set my minimum size to WIDTHxHEIGHT pixels. |
protected void |
setPreferredSize(int width,
int height)
Set my preferred size to WIDTHxHEIGHT pixels. |
void |
showMessage(String text,
String title,
String type)
Display the dismissable message TEXT of type TYPE in a separate dialog window with title TITLE. |
int |
showOptions(String message,
String title,
String type,
String deflt,
String... labels)
Display a choice of optional responses, labeled LABELS0,...,LABELSn in a separate dialog box with title TITLE and message MESSAGE. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected TopLevel(String title, boolean exitOnClose)
Method Detail |
---|
public void display(boolean visible)
protected void setPreferredSize(int width, int height)
protected void setMinimumSize(int width, int height)
protected void setMaximumSize(int width, int height)
public int getWidth()
public int getHeight()
protected void addMenuButton(String label, Object receiver, String funcName)
protected void addMenuButton(String label, String funcName)
protected void addMenuRadioButton(String label, String groupName, boolean selected, Object receiver, String funcName)
protected void addMenuRadioButton(String label, String groupName, boolean selected, String funcName)
protected void addSeparator(String label)
protected boolean isSelected(String label)
protected void select(String label, boolean val)
protected void setEnabled(boolean enable, String... labels)
protected void addButton(String label, Object receiver, String funcName, LayoutSpec layout)
protected void addButton(String label, String funcName, LayoutSpec layout)
protected void add(Widget widget, LayoutSpec layout)
protected void addLabel(String text, String id, LayoutSpec layout)
protected void setLabel(String id, String text)
protected void addLabel(String text, LayoutSpec layout)
public void showMessage(String text, String title, String type)
public int showOptions(String message, String title, String type, String deflt, String... labels)
public String getTextInput(String message, String title, String type, String init)
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |