|
JavaView© v3.95.000 | |||||||||
| 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
jv.object.PsDialog
Basic class for dialogs extending java.awt.Dialog by some minor features. E.g. dialog is destroyed when it receives a WINDOW.DESTROY event, and it has an easy mechanism to insert standard buttons at bottom part of dialog. The actionPerformed() method supplies default event handling which is usually sufficient.
When dialog window is cancelled by pressing the cross in one of its corners, then the same operations are performed as if the user had pressed the CANCEL button.
PsPanel,
Serialized Form| Field Summary | |
static int |
BUTTON_CANCEL
|
static int |
BUTTON_CLEAR
|
static int |
BUTTON_CLOSE
|
static int |
BUTTON_HIDE
|
static int |
BUTTON_LOAD
|
static int |
BUTTON_OK
|
static int |
BUTTON_RESET
|
static int |
BUTTON_SAVE
|
| 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 | |
PsDialog(java.awt.Frame frame,
boolean modal)
Create an initially invisible new dialog without title and modal status. |
|
PsDialog(java.awt.Frame frame,
java.lang.String name,
boolean modal)
Create an initially invisible new dialog with given title and modal status. |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent event)
Method forwards action events issued by buttons. |
void |
addActionListener(java.awt.event.ActionListener listener)
Action events are sent when a user clicks on Ok or Cancel button, doubleclicks on a model in the model dialog or presses |
java.awt.Panel |
getBottomButtons(int flag)
Convenient way to get a panel with standard buttons. |
PsUpdateIf |
getFather()
Return parent of this dialog. |
int |
getUserAction()
Get index of standard button pressed by user. |
void |
init()
This initialization method simply set the font of this dialog. |
boolean |
instanceOf(java.lang.String aClassName)
Deprecated. use "if (getClass() == PsObject.class)" instead |
void |
removeActionListener(java.awt.event.ActionListener listener)
Removes (one occurrence of) a listener from internal list. |
void |
reset()
Method should be overriden by subclasses, maybe to reset themself. |
java.awt.Label |
setHeader(java.lang.String header)
Set string of panel header and return label m_lHeader.
|
void |
setParent(PsUpdateIf object)
Set parent of this dialog. |
boolean |
update(java.lang.Object event)
Update the class whenever a child has changed. |
void |
windowActivated(java.awt.event.WindowEvent event)
Method does nothing. |
void |
windowClosed(java.awt.event.WindowEvent event)
Method does nothing. |
void |
windowClosing(java.awt.event.WindowEvent event)
Dispose window if user clicks on 'delete'-cross of title bar. |
void |
windowDeactivated(java.awt.event.WindowEvent event)
Method does nothing. |
void |
windowDeiconified(java.awt.event.WindowEvent event)
Method does nothing. |
void |
windowIconified(java.awt.event.WindowEvent event)
Method does nothing. |
void |
windowOpened(java.awt.event.WindowEvent event)
Method does nothing. |
| Methods inherited from class java.awt.Dialog |
addNotify, dispose, getAccessibleContext, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
| Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jv.object.PsUpdateIf |
getName |
| Field Detail |
public static final int BUTTON_CANCEL
public static final int BUTTON_HIDE
public static final int BUTTON_OK
public static final int BUTTON_RESET
public static final int BUTTON_CLOSE
public static final int BUTTON_SAVE
public static final int BUTTON_CLEAR
public static final int BUTTON_LOAD
| Constructor Detail |
public PsDialog(java.awt.Frame frame,
java.lang.String name,
boolean modal)
Initial layout manager is jv.object.PsStackLayout.
frame - parent frame is owner of this dialogname - title of this dialogmodal - if true, dialog blocks input to the parent window when shownPsDialog(Frame, boolean)
public PsDialog(java.awt.Frame frame,
boolean modal)
Initial layout manager is jv.object.PsStackLayout.
frame - parent frame is owner of this dialogmodal - if true, dialog blocks input to the parent window when shownPsDialog(Frame, String, boolean)| Method Detail |
public void init()
public java.awt.Panel getBottomButtons(int flag)
Usage:
Panel pButtons = dialog.getBottomButtons(PsDialog.BUTTON_CANCEL | PsDialog.BUTTON_OK); dialog.add(pButtons, BorderLayout.SOUTH);If a modal dialog returns, the dialog can be asked about the user action:
if (dialog.getUserAction() == PsDialog.BUTTON_CANCEL) {
...
}
flag - one of the static buttons identifiers like PsDebug.BUTTON_OK.
public java.awt.Label setHeader(java.lang.String header)
m_lHeader.
Method does not add the header to the panel.
public final boolean instanceOf(java.lang.String aClassName)
false.
This method is different from Java operator instanceof which
is true even if current instance is subclass of class 'aClassName'.
The current implementation checks the string only against the classname without the prefixed package names. This may change in future implementations of this method.
aClassName - name of class without package identifiers
public PsUpdateIf getFather()
getFather in interface PsUpdateIfsetParent(PsUpdateIf),
update(Object)public void setParent(PsUpdateIf object)
setParent in interface PsUpdateIfobject - will receive events which this does not handlegetFather(),
update(Object)public boolean update(java.lang.Object event)
update in interface PsUpdateIfevent - carries a lot of information
getFather(),
setParent(PsUpdateIf)public void reset()
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed in interface java.awt.event.ActionListenerpublic int getUserAction()
public void windowOpened(java.awt.event.WindowEvent event)
windowOpened in interface java.awt.event.WindowListenerpublic void windowClosed(java.awt.event.WindowEvent event)
windowClosed in interface java.awt.event.WindowListenerpublic void windowDeiconified(java.awt.event.WindowEvent event)
windowDeiconified in interface java.awt.event.WindowListenerpublic void windowIconified(java.awt.event.WindowEvent event)
windowIconified in interface java.awt.event.WindowListenerpublic void windowDeactivated(java.awt.event.WindowEvent event)
windowDeactivated in interface java.awt.event.WindowListenerpublic void windowActivated(java.awt.event.WindowEvent event)
windowActivated in interface java.awt.event.WindowListenerpublic void windowClosing(java.awt.event.WindowEvent event)
dispose().
windowClosing in interface java.awt.event.WindowListenerpublic void addActionListener(java.awt.event.ActionListener listener)
getUserAction().
Listeners will receive an ActionEvent whose keyId is one of the possibilities of PsDialog.BUTTON_{OK, CANCEL, ...}.
public void removeActionListener(java.awt.event.ActionListener listener)
fireAction(ActionEvent).
|
JavaView© v3.95.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||