Class DWindow
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- org.kopi.vkopi.lib.ui.swing.visual.DWindow
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,java.util.EventListener,javax.accessibility.Accessible,org.kopi.galite.visual.base.UComponent,org.kopi.galite.visual.FileProductionListener,org.kopi.galite.visual.ModelCloseListener,org.kopi.galite.visual.ProgressDialogListener,org.kopi.galite.visual.UWindow,org.kopi.galite.visual.VActionListener,org.kopi.galite.visual.WaitDialogListener,org.kopi.galite.visual.WaitInfoListener
- Direct Known Subclasses:
DChart,DForm,DItemTree,DPreviewWindow,DReport
public abstract class DWindow extends javax.swing.JPanel implements org.kopi.galite.visual.UWindowThis class displays a window with a menu, a tool bar, a content panel and a footbar- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classDWindow.DUndoableEditListenerclassDWindow.RedoActionclassDWindow.UndoAction-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description static org.kopi.vkopi.lib.ui.swing.visual.DWindow.KopiFocusManagerfocusManagerstatic javax.swing.ImageIconICN_ASKstatic javax.swing.ImageIconICN_ERRORstatic javax.swing.ImageIconICN_NOTICEstatic javax.swing.ImageIconICN_WAITstatic javax.swing.ImageIconICN_WARNINGprotected DWindow.RedoActionredoActionjava.lang.ExceptionruntimeDebugInfoprotected DWindow.UndoActionundoAction-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDWindow(org.kopi.galite.visual.VWindow model)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static intaskPostition(java.awt.Component parent, int current, int total)Asks a position numberbooleanaskUser(java.lang.String message, boolean yesIsDefault)Displays an ask dialog boxbooleanaskUserImpl(java.lang.String message, boolean yesIsDefault)Displays an ask dialog boxvoidbuild()Deprecated.do not use anymorevoidclose()Deprecated.Use closeWindow() or close(int code) instead.protected voidclose(int code)Close the view and the model, definitelyvoidcloseWindow()Called to close the view (from the user), it does not definitly close the view(it may ask the user before) Allowed to call outside the event disp. threadprotected voidcreateEditMenu()Allow building of a customized edit menu.javax.swing.JFramecreateFrame()static voiddisplayError(java.awt.Component parent, java.lang.String message)voiddisplayError(java.lang.String message)Displays an error message.static voiddisplayNotice(java.awt.Component frame, java.lang.String message)voiddisplayNotice(java.lang.String message)Displays a notice.voiddisplayWarning(java.lang.String message)Displays a warning message.voiddispose()voidfileProduced(java.io.File file, java.lang.String name)protected javax.swing.ActiongetActionByName(java.lang.String name)javax.swing.JPanelgetContentPanel()Adds the specified component to the end of the content panel.protected DMenuBargetDMenuBar()javax.swing.JFramegetFrame()booleangetInAction()org.kopi.galite.visual.VWindowgetModel()Get Modeljavax.swing.ActiongetRedoAction()intgetReturnCode()javax.swing.event.UndoableEditListenergetUndoableEditListener()javax.swing.ActiongetUndoAction()javax.swing.undo.UndoManagergetUndoManager()voidmodelClosed(int type)voidopenURL(java.lang.String url)voidperformAction(org.kopi.galite.visual.Action action, boolean block)Deprecated.Use method #performAsyncAction(KopiAction action) without boolean parameter because this parameter was ignored.voidperformAsyncAction(org.kopi.galite.visual.Action action)Performs the appropriate action asynchronously.voidperformBasicAction(org.kopi.galite.visual.Action action)Performs the appropriate action synchronously.voidrelease()Release: we definitively don't want anymore this window (JFrame)voidreportError(org.kopi.galite.visual.VRuntimeException e)abstract voidrun()starts the windowvoidsetCurrentJob(int currentJob)voidsetInformationText(java.lang.String text)Displays a text in the lower left corner of the window.voidsetModel(org.kopi.galite.visual.VWindow model)Set modelvoidsetProgressDialog(java.lang.String message, int totalJobs)voidsetStatePanel(javax.swing.JPanel panel)voidsetStatisticsText(java.lang.String text)Displays a text in the lower right corner of the window.voidsetTitle(java.lang.String title)set the titlevoidsetTotalJobs(int totalJobs)voidsetUndoManager(javax.swing.undo.UndoManager undo)voidsetVisible(boolean b)Show/Hide this windowvoidsetWaitDialog(java.lang.String message, int maxTime)setWaitInfovoidsetWaitInfo(java.lang.String message)setWaitInfovoidsetWindowFocusEnabled(boolean enabled)static intshowOptionDialog(javax.swing.JFrame frame, java.lang.Object message, java.lang.String title, int optionType, int messageType, javax.swing.Icon icon, java.lang.Object[] options, java.lang.Object initialValue)Show a dialog with a key assignated to each button (the first letter)voidunsetProgressDialog()voidunsetWaitDialog()change mode to free statevoidunsetWaitInfo()change mode to free statevoidupdateWaitDialogMessage(java.lang.String message)protected voidverifyNotInTransaction(java.lang.String message)Reports if a message is shown while in a transaction.-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
runtimeDebugInfo
public java.lang.Exception runtimeDebugInfo
-
undoAction
protected DWindow.UndoAction undoAction
-
redoAction
protected DWindow.RedoAction redoAction
-
ICN_WAIT
public static final javax.swing.ImageIcon ICN_WAIT
-
ICN_ERROR
public static final javax.swing.ImageIcon ICN_ERROR
-
ICN_WARNING
public static final javax.swing.ImageIcon ICN_WARNING
-
ICN_ASK
public static final javax.swing.ImageIcon ICN_ASK
-
ICN_NOTICE
public static final javax.swing.ImageIcon ICN_NOTICE
-
focusManager
public static final org.kopi.vkopi.lib.ui.swing.visual.DWindow.KopiFocusManager focusManager
-
-
Method Detail
-
getModel
public org.kopi.galite.visual.VWindow getModel()
Get Model- Specified by:
getModelin interfaceorg.kopi.galite.visual.UWindow
-
setModel
public void setModel(org.kopi.galite.visual.VWindow model)
Set model
-
getContentPanel
public javax.swing.JPanel getContentPanel()
Adds the specified component to the end of the content panel.
-
setWindowFocusEnabled
public void setWindowFocusEnabled(boolean enabled)
- Specified by:
setWindowFocusEnabledin interfaceorg.kopi.galite.visual.UWindow
-
setVisible
public void setVisible(boolean b)
Show/Hide this window- Specified by:
setVisiblein interfaceorg.kopi.galite.visual.base.UComponent- Overrides:
setVisiblein classjavax.swing.JComponent
-
setTitle
public void setTitle(java.lang.String title)
set the title- Specified by:
setTitlein interfaceorg.kopi.galite.visual.UWindow
-
close
protected void close(int code)
Close the view and the model, definitely- See Also:
closeWindow()
-
getReturnCode
public int getReturnCode()
-
close
public void close()
Deprecated.Use closeWindow() or close(int code) instead.
-
closeWindow
public void closeWindow()
Called to close the view (from the user), it does not definitly close the view(it may ask the user before) Allowed to call outside the event disp. thread- Specified by:
closeWindowin interfaceorg.kopi.galite.visual.UWindow
-
modelClosed
public void modelClosed(int type)
- Specified by:
modelClosedin interfaceorg.kopi.galite.visual.ModelCloseListener
-
build
public void build()
Deprecated.do not use anymoreBuilds the display structure
-
getFrame
public javax.swing.JFrame getFrame()
-
displayNotice
public void displayNotice(java.lang.String message)
Displays a notice.
-
displayNotice
public static void displayNotice(java.awt.Component frame, java.lang.String message)
-
displayError
public void displayError(java.lang.String message)
Displays an error message.
-
displayError
public static void displayError(java.awt.Component parent, java.lang.String message)
-
askPostition
public static int askPostition(java.awt.Component parent, int current, int total)Asks a position number
-
displayWarning
public void displayWarning(java.lang.String message)
Displays a warning message.
-
askUser
public boolean askUser(java.lang.String message, boolean yesIsDefault)Displays an ask dialog box
-
askUserImpl
public boolean askUserImpl(java.lang.String message, boolean yesIsDefault)Displays an ask dialog box
-
getUndoableEditListener
public javax.swing.event.UndoableEditListener getUndoableEditListener()
-
getUndoManager
public javax.swing.undo.UndoManager getUndoManager()
-
setUndoManager
public void setUndoManager(javax.swing.undo.UndoManager undo)
-
createEditMenu
protected void createEditMenu()
Allow building of a customized edit menu.
-
getActionByName
protected javax.swing.Action getActionByName(java.lang.String name)
-
getRedoAction
public javax.swing.Action getRedoAction()
-
getUndoAction
public javax.swing.Action getUndoAction()
-
performAction
public void performAction(org.kopi.galite.visual.Action action, boolean block)Deprecated.Use method #performAsyncAction(KopiAction action) without boolean parameter because this parameter was ignored.
-
performAsyncAction
public void performAsyncAction(org.kopi.galite.visual.Action action)
Performs the appropriate action asynchronously. You can use this method to perform any operation out of the UI event process- Specified by:
performAsyncActionin interfaceorg.kopi.galite.visual.VActionListener- Parameters:
action- the action to perform.
-
performBasicAction
public void performBasicAction(org.kopi.galite.visual.Action action)
Performs the appropriate action synchronously.- Specified by:
performBasicActionin interfaceorg.kopi.galite.visual.UWindow- Parameters:
action- the action to perform.
-
openURL
public void openURL(java.lang.String url) throws java.lang.Exception- Specified by:
openURLin interfaceorg.kopi.galite.visual.UWindow- Throws:
java.lang.Exception
-
reportError
public void reportError(org.kopi.galite.visual.VRuntimeException e)
-
getInAction
public boolean getInAction()
-
setInformationText
public final void setInformationText(java.lang.String text)
Displays a text in the lower left corner of the window.- Specified by:
setInformationTextin interfaceorg.kopi.galite.visual.UWindow
-
setStatisticsText
public final void setStatisticsText(java.lang.String text)
Displays a text in the lower right corner of the window.
-
setStatePanel
public final void setStatePanel(javax.swing.JPanel panel)
-
setProgressDialog
public final void setProgressDialog(java.lang.String message, int totalJobs)- Specified by:
setProgressDialogin interfaceorg.kopi.galite.visual.ProgressDialogListener
-
unsetProgressDialog
public final void unsetProgressDialog()
- Specified by:
unsetProgressDialogin interfaceorg.kopi.galite.visual.ProgressDialogListener
-
setTotalJobs
public final void setTotalJobs(int totalJobs)
- Specified by:
setTotalJobsin interfaceorg.kopi.galite.visual.UWindow
-
setCurrentJob
public final void setCurrentJob(int currentJob)
- Specified by:
setCurrentJobin interfaceorg.kopi.galite.visual.UWindow
-
updateWaitDialogMessage
public final void updateWaitDialogMessage(java.lang.String message)
- Specified by:
updateWaitDialogMessagein interfaceorg.kopi.galite.visual.UWindow
-
setWaitDialog
public final void setWaitDialog(java.lang.String message, int maxTime)setWaitInfo- Specified by:
setWaitDialogin interfaceorg.kopi.galite.visual.WaitDialogListener
-
unsetWaitDialog
public final void unsetWaitDialog()
change mode to free state- Specified by:
unsetWaitDialogin interfaceorg.kopi.galite.visual.WaitDialogListener
-
setWaitInfo
public final void setWaitInfo(java.lang.String message)
setWaitInfo- Specified by:
setWaitInfoin interfaceorg.kopi.galite.visual.WaitInfoListener
-
unsetWaitInfo
public final void unsetWaitInfo()
change mode to free state- Specified by:
unsetWaitInfoin interfaceorg.kopi.galite.visual.WaitInfoListener
-
fileProduced
public void fileProduced(java.io.File file, java.lang.String name)- Specified by:
fileProducedin interfaceorg.kopi.galite.visual.FileProductionListener
-
release
public void release()
Release: we definitively don't want anymore this window (JFrame)
-
dispose
public void dispose()
- Specified by:
disposein interfaceorg.kopi.galite.visual.ModelCloseListener
-
getDMenuBar
protected DMenuBar getDMenuBar()
-
run
public abstract void run() throws org.kopi.galite.visual.VExceptionstarts the window- Specified by:
runin interfaceorg.kopi.galite.visual.UWindow- Throws:
org.kopi.galite.visual.VException- an exception may be raised by triggers
-
createFrame
public javax.swing.JFrame createFrame()
-
verifyNotInTransaction
protected void verifyNotInTransaction(java.lang.String message)
Reports if a message is shown while in a transaction.
-
showOptionDialog
public static int showOptionDialog(javax.swing.JFrame frame, java.lang.Object message, java.lang.String title, int optionType, int messageType, javax.swing.Icon icon, java.lang.Object[] options, java.lang.Object initialValue)Show a dialog with a key assignated to each button (the first letter)
-
-