Class PjWorkshop_Dialog
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- jv.object.PsDialog
-
- jvx.project.PjWorkshop_Dialog
-
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.awt.event.ContainerListener, java.awt.event.KeyListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, PsUpdateIf
public class PjWorkshop_Dialog extends PsDialog
Dialog for displaying the info panel of a workshop. The workshop is registered as parent of this dialog, and a new info panel of the workshop is displayed in the center of this dialog, plus an optional notice message in the north and a panel with dialog buttons in the south.The info panel of the workshop is registered as ActionListener of this dialog. Pressing either dialog button will fire an ActionEvent in PsDialog that is then handled by the info panel PjWorkshop_IP. PjWorkshop_IP will call methods corresponding to button events. This mechanism allows that the dialog has a universal use for all workshops in JavaView.
- See Also:
PjWorkshop_IP, Serialized Form- Author:
- Konrad Polthier
- Version:
- 06.02.05, 1.40 revised (kp) Disabled buttons if workshop-backup is disabled.
14.02.04, 1.30 revised (kp) Unused method actionPerformed() removed, handled by superclass.
05.03.03, 1.20 revised (kp) When actionPerformed received then call info panel instead of workshop.
20.10.02, 1.10 revised (kp) Missing method update(Object) added.
23.12.01, 1.00 created (kp)
-
-
Nested Class Summary
-
Field Summary
-
Fields inherited from class jv.object.PsDialog
BUTTON_APPLY, BUTTON_CANCEL, BUTTON_CLEAR, BUTTON_CLOSE, BUTTON_HIDE, BUTTON_LOAD, BUTTON_OK, BUTTON_RESET, BUTTON_SAVE
-
-
Constructor Summary
Constructors Constructor and Description PjWorkshop_Dialog()Constructor of dialog, dialog is not modal.PjWorkshop_Dialog(boolean modal)Constructor of dialog to show the info panel of a workshop.PjWorkshop_Dialog(java.lang.String title, boolean modal)Constructor of dialog to show the info panel of a workshop.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static PsPanelcreateNotice(java.lang.String text)Create a panel showing a user notice given as text with line breaks.voidinit()Initialization method sets the layout manager to BorderLayout.voidsetPanel(PjWorkshop_IP panel)Assign an inspector panel to be used to fill this dialog.voidsetParent(PsUpdateIf object)Assign the parent workshop and perform a layout of the dialog.booleanupdate(java.lang.Object event)Update the class whenever a child has changed.voidwindowClosed(java.awt.event.WindowEvent event)Catch closing of a dialog by the window manager and call parent workshop's cancel() method.-
Methods inherited from class jv.object.PsDialog
actionPerformed, addActionListener, componentAdded, componentRemoved, getBottomButtons, getFather, getInsets, getUserAction, instanceOf, keyPressed, keyReleased, keyTyped, removeActionListener, reset, setHeader, setInsetSize, setLocation, setSize, windowActivated, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.awt.Dialog
addNotify, getAccessibleContext, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setType, 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, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jv.object.PsUpdateIf
getName
-
-
-
-
Constructor Detail
-
PjWorkshop_Dialog
public PjWorkshop_Dialog()
Constructor of dialog, dialog is not modal.
-
PjWorkshop_Dialog
public PjWorkshop_Dialog(boolean modal)
Constructor of dialog to show the info panel of a workshop.- Parameters:
modal-trueif dialog is modal
-
PjWorkshop_Dialog
public PjWorkshop_Dialog(java.lang.String title, boolean modal)Constructor of dialog to show the info panel of a workshop.- Parameters:
title- title of the dialogmodal-trueif dialog is modal
-
-
Method Detail
-
init
public void init()
Initialization method sets the layout manager to BorderLayout.
-
setPanel
public void setPanel(PjWorkshop_IP panel)
Assign an inspector panel to be used to fill this dialog.Usually this method is called indirectly when a parent workshop is assigned to this dialog. Then this method is invoked with a new default inspector panel.
If a user wants to register a different inspector panel, then this panel must be created outside and registered using this method. After registration, the workshop registers as usual as parent using setParent().
Currently, this method does not register the info panel of the workshop as action listener in order to receive button events.
- Parameters:
panel- Must be an instance of jvx.project.PjWorkshop_IP.- Since:
- JavaView v.3.23.002
- Version:
- 15.05.04, 1.00 created (kp)
-
setParent
public void setParent(PsUpdateIf object)
Assign the parent workshop and perform a layout of the dialog. Create a new info panel of the workshop and add it to the center of this dialog. Also add a notice message and a panel with bottom buttons.Dialog title of the info panel is set as title of the dialog. If the title of the info panel shows the same string as the requested dialog title then the title label is removed from the info panel.
The info panel of the workshop is registered as action listener in order to receive button events.
- Specified by:
setParentin interfacePsUpdateIf- Overrides:
setParentin classPsDialog- Parameters:
object- Must be an instance of jvx.project.PjWorkshop.- See Also:
PsDialog.getFather(),PsDialog.update(Object)
-
update
public boolean update(java.lang.Object event)
Update the class whenever a child has changed. Method is usually invoked from the children.This method basically returns true if the event is the workshop. More functionality might be added by subclasses of this dialog.
- Specified by:
updatein interfacePsUpdateIf- Overrides:
updatein classPsDialog- Parameters:
event- carries a lot of information- Returns:
- true if event has been handled, otherwise false
- Since:
- JavaView 2.43
- See Also:
PsDialog.getFather(),PsDialog.setParent(PsUpdateIf)- Version:
- 20.10.02, 1.00 created (kp)
-
createNotice
public static PsPanel createNotice(java.lang.String text)
Create a panel showing a user notice given as text with line breaks. The panel is not added to a container yet. The text is displayed in a PsMultiLineLabel which automatically breaks the text at the border of the panel and at user requested line break characters.- Parameters:
text- text including line breaks "\n".- Returns:
- panel with notice message, must be added to some container.
-
windowClosed
public void windowClosed(java.awt.event.WindowEvent event)
Catch closing of a dialog by the window manager and call parent workshop's cancel() method. If we arrive here and the parent is non-null, then the user has closed the dialog using the window manager, and this is considered a cancellation of the workshop.- Specified by:
windowClosedin interfacejava.awt.event.WindowListener- Overrides:
windowClosedin classPsDialog
-
-
"