|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
kirk.gui.dialog.PopupDialog
This class is an abstract class that other Dialogs can extend to
save on standard behaviour, like closing the Window. Also provided is
action listening for a Button with the "CLOSE" action command, so if
you add a Button, set "CLOSE" as its action command and set this
class as its ActionListener, then that Button will close
the PopupDialog.
The idea is that subclasses define the look of the popup. This is why there are no settings done in this class about how the contents are layout out.
The constructor initialises some things for you:
LayoutManager setWindowCloserIt also implements ActionListener, and it already implements
actionPerformed as well. However you can override it if you wish,
and/or call it by using super() for the standard "CLOSE" button
usage.
You can also close the dialog by calling close(). Useful for
subclasses.
| Nested Class Summary |
| Nested classes inherited from class java.awt.Dialog |
Dialog.AccessibleAWTDialog |
| Nested classes inherited from class java.awt.Window |
Window.AccessibleAWTWindow |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
| Fields inherited from class java.awt.Dialog |
|
| Fields inherited from class java.awt.Window |
|
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
PopupDialog(Frame owner,
String title)
Constructs a new PopupDialog. |
|
| Method Summary | |
void |
actionPerformed(ActionEvent event)
Closes this Dialog if the action command equals "CLOSE". |
protected void |
center()
Centers the Dialog in the screen. |
protected void |
close()
Closes this Dialog. |
protected String[] |
convertMessage(String message,
int amount)
Converts a message into a multiline format with amount
characters on a line maximum, breaking lines on these delimiters: " \t\n\r\f".
|
void |
doLayout()
Lays out this Dialog. |
| Methods inherited from class java.awt.Dialog |
addNotify, dispose, getAccessibleContext, getTitle, hide, isModal, isResizable, isUndecorated, paramString, setModal, setResizable, setTitle, setUndecorated, show |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public PopupDialog(Frame owner,
String title)
PopupDialog.
owner - The owner of this Dialog.title - The title of this Dialog.| Method Detail |
public void actionPerformed(ActionEvent event)
Dialog if the action command equals "CLOSE".
actionPerformed in interface ActionListenerevent - The standard passed ActionEvent.ActionListener.actionPerformed(java.awt.event.ActionEvent)protected void close()
Dialog.
public void doLayout()
Dialog. The actual laying out is done by a
LayoutManager, but this method first sets the correct size of the
window by using the preferred sizes of its components.
Component.doLayout()protected void center()
Dialog in the screen.
protected String[] convertMessage(String message,
int amount)
Converts a message into a multiline format with amount
characters on a line maximum, breaking lines on these delimiters: " \t\n\r\f".
If there are undelimited tokens longer than amount characters
they will occupy a single line.
This method is supplied for convenience, since many subclasses have use for it.
message - The message to convert.amount - The maximum amount of characters on a line.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||