Class 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.UWindow
    This 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 class  DWindow.DUndoableEditListener  
      class  DWindow.RedoAction  
      class  DWindow.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
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.kopi.vkopi.lib.ui.swing.visual.DWindow.KopiFocusManager focusManager  
      static javax.swing.ImageIcon ICN_ASK  
      static javax.swing.ImageIcon ICN_ERROR  
      static javax.swing.ImageIcon ICN_NOTICE  
      static javax.swing.ImageIcon ICN_WAIT  
      static javax.swing.ImageIcon ICN_WARNING  
      protected DWindow.RedoAction redoAction  
      java.lang.Exception runtimeDebugInfo  
      protected DWindow.UndoAction undoAction  
      • 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
      • Fields inherited from class java.awt.Component

        accessibleContext, 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

      Constructors 
      Modifier Constructor Description
      protected DWindow​(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 int askPostition​(java.awt.Component parent, int current, int total)
      Asks a position number
      boolean askUser​(java.lang.String message, boolean yesIsDefault)
      Displays an ask dialog box
      boolean askUserImpl​(java.lang.String message, boolean yesIsDefault)
      Displays an ask dialog box
      void build()
      Deprecated.
      do not use anymore
      void close()
      Deprecated.
      Use closeWindow() or close(int code) instead.
      protected void close​(int code)
      Close the view and the model, definitely
      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
      protected void createEditMenu()
      Allow building of a customized edit menu.
      javax.swing.JFrame createFrame()  
      static void displayError​(java.awt.Component parent, java.lang.String message)  
      void displayError​(java.lang.String message)
      Displays an error message.
      static void displayNotice​(java.awt.Component frame, java.lang.String message)  
      void displayNotice​(java.lang.String message)
      Displays a notice.
      void displayWarning​(java.lang.String message)
      Displays a warning message.
      void dispose()  
      void fileProduced​(java.io.File file, java.lang.String name)  
      protected javax.swing.Action getActionByName​(java.lang.String name)  
      javax.swing.JPanel getContentPanel()
      Adds the specified component to the end of the content panel.
      protected DMenuBar getDMenuBar()  
      javax.swing.JFrame getFrame()  
      boolean getInAction()  
      org.kopi.galite.visual.VWindow getModel()
      Get Model
      javax.swing.Action getRedoAction()  
      int getReturnCode()  
      javax.swing.event.UndoableEditListener getUndoableEditListener()  
      javax.swing.Action getUndoAction()  
      javax.swing.undo.UndoManager getUndoManager()  
      void modelClosed​(int type)  
      void openURL​(java.lang.String url)  
      void performAction​(org.kopi.galite.visual.Action action, boolean block)
      Deprecated.
      Use method #performAsyncAction(KopiAction action) without boolean parameter because this parameter was ignored.
      void performAsyncAction​(org.kopi.galite.visual.Action action)
      Performs the appropriate action asynchronously.
      void performBasicAction​(org.kopi.galite.visual.Action action)
      Performs the appropriate action synchronously.
      void release()
      Release: we definitively don't want anymore this window (JFrame)
      void reportError​(org.kopi.galite.visual.VRuntimeException e)  
      abstract void run()
      starts the window
      void setCurrentJob​(int currentJob)  
      void setInformationText​(java.lang.String text)
      Displays a text in the lower left corner of the window.
      void setModel​(org.kopi.galite.visual.VWindow model)
      Set model
      void setProgressDialog​(java.lang.String message, int totalJobs)  
      void setStatePanel​(javax.swing.JPanel panel)  
      void setStatisticsText​(java.lang.String text)
      Displays a text in the lower right corner of the window.
      void setTitle​(java.lang.String title)
      set the title
      void setTotalJobs​(int totalJobs)  
      void setUndoManager​(javax.swing.undo.UndoManager undo)  
      void setVisible​(boolean b)
      Show/Hide this window
      void setWaitDialog​(java.lang.String message, int maxTime)
      setWaitInfo
      void setWaitInfo​(java.lang.String message)
      setWaitInfo
      void setWindowFocusEnabled​(boolean enabled)  
      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)
      void unsetProgressDialog()  
      void unsetWaitDialog()
      change mode to free state
      void unsetWaitInfo()
      change mode to free state
      void updateWaitDialogMessage​(java.lang.String message)  
      protected void verifyNotInTransaction​(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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.kopi.galite.visual.base.UComponent

        isEnabled, isVisible, setEnabled
    • Field Detail

      • runtimeDebugInfo

        public java.lang.Exception runtimeDebugInfo
      • 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
    • Constructor Detail

      • DWindow

        protected DWindow​(org.kopi.galite.visual.VWindow model)
        Constructor
    • Method Detail

      • getModel

        public org.kopi.galite.visual.VWindow getModel()
        Get Model
        Specified by:
        getModel in interface org.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:
        setWindowFocusEnabled in interface org.kopi.galite.visual.UWindow
      • setVisible

        public void setVisible​(boolean b)
        Show/Hide this window
        Specified by:
        setVisible in interface org.kopi.galite.visual.base.UComponent
        Overrides:
        setVisible in class javax.swing.JComponent
      • setTitle

        public void setTitle​(java.lang.String title)
        set the title
        Specified by:
        setTitle in interface org.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:
        closeWindow in interface org.kopi.galite.visual.UWindow
      • modelClosed

        public void modelClosed​(int type)
        Specified by:
        modelClosed in interface org.kopi.galite.visual.ModelCloseListener
      • build

        public void build()
        Deprecated.
        do not use anymore
        Builds 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:
        performAsyncAction in interface org.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:
        performBasicAction in interface org.kopi.galite.visual.UWindow
        Parameters:
        action - the action to perform.
      • openURL

        public void openURL​(java.lang.String url)
                     throws java.lang.Exception
        Specified by:
        openURL in interface org.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:
        setInformationText in interface org.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:
        setProgressDialog in interface org.kopi.galite.visual.ProgressDialogListener
      • unsetProgressDialog

        public final void unsetProgressDialog()
        Specified by:
        unsetProgressDialog in interface org.kopi.galite.visual.ProgressDialogListener
      • setTotalJobs

        public final void setTotalJobs​(int totalJobs)
        Specified by:
        setTotalJobs in interface org.kopi.galite.visual.UWindow
      • setCurrentJob

        public final void setCurrentJob​(int currentJob)
        Specified by:
        setCurrentJob in interface org.kopi.galite.visual.UWindow
      • updateWaitDialogMessage

        public final void updateWaitDialogMessage​(java.lang.String message)
        Specified by:
        updateWaitDialogMessage in interface org.kopi.galite.visual.UWindow
      • setWaitDialog

        public final void setWaitDialog​(java.lang.String message,
                                        int maxTime)
        setWaitInfo
        Specified by:
        setWaitDialog in interface org.kopi.galite.visual.WaitDialogListener
      • unsetWaitDialog

        public final void unsetWaitDialog()
        change mode to free state
        Specified by:
        unsetWaitDialog in interface org.kopi.galite.visual.WaitDialogListener
      • setWaitInfo

        public final void setWaitInfo​(java.lang.String message)
        setWaitInfo
        Specified by:
        setWaitInfo in interface org.kopi.galite.visual.WaitInfoListener
      • unsetWaitInfo

        public final void unsetWaitInfo()
        change mode to free state
        Specified by:
        unsetWaitInfo in interface org.kopi.galite.visual.WaitInfoListener
      • fileProduced

        public void fileProduced​(java.io.File file,
                                 java.lang.String name)
        Specified by:
        fileProduced in interface org.kopi.galite.visual.FileProductionListener
      • release

        public void release()
        Release: we definitively don't want anymore this window (JFrame)
      • dispose

        public void dispose()
        Specified by:
        dispose in interface org.kopi.galite.visual.ModelCloseListener
      • getDMenuBar

        protected DMenuBar getDMenuBar()
      • run

        public abstract void run()
                          throws org.kopi.galite.visual.VException
        starts the window
        Specified by:
        run in interface org.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)