Class MainWindow

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, IMainWindow

    public class MainWindow
    extends javax.swing.JFrame
    implements IMainWindow
    The main window of OmegaT application (unless the application is started in consoleMode).
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.BaselineResizeBehavior
    • Field Summary

      Fields 
      Modifier and Type Field Description
      MainWindowMenu menu  
      • Fields inherited from class java.awt.Frame

        CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
      • 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
      • Fields inherited from interface javax.swing.WindowConstants

        DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
    • Constructor Summary

      Constructors 
      Constructor Description
      MainWindow()
      Creates new form MainWindow
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDockable​(com.vlsolutions.swing.docking.Dockable pane)
      Add new dockable pane into application frame.
      void displayErrorRB​(java.lang.Throwable ex, java.lang.String errorKey, java.lang.Object... params)
      Display error.
      void displayWarningRB​(java.lang.String warningKey, java.lang.Object... params)
      Display warning.
      void displayWarningRB​(java.lang.String warningKey, java.lang.String supercedesKey, java.lang.Object... params)
      Same as IMainWindow.displayWarningRB(String, Object...) but this will close the previous dialog if the dialog is still open and the supplied supercedesKey matches the previous dialog's key.
      void doInsertTrans()
      insert current fuzzy match or selection at cursor position
      void doRecycleTrans()
      replace entire edit area with active fuzzy match or selection
      java.awt.Font getApplicationFont()
      Get main application font.
      javax.swing.JFrame getApplicationFrame()
      Get application frame.
      com.vlsolutions.swing.docking.DockingDesktop getDesktop()
      get DockableDesktop object.
      IMainMenu getMainMenu()
      Retrieve main manu instance.
      void lockUI()
      Lock UI for long-term operations.
      void setProgressToolTipText​(java.lang.String toolTipText)  
      int showConfirmDialog​(java.lang.Object message, java.lang.String title, int optionType, int messageType)
      shows a confirm dialog.
      void showErrorDialogRB​(java.lang.String title, java.lang.String message, java.lang.Object... args)
      Show message in an ErrorDialog
      void showLengthMessage​(java.lang.String messageText)
      Show message in length label.
      void showLockInsertMessage​(java.lang.String messageText, java.lang.String toolTip)
      Show message indicating the state of the Lock cursor and Insert/overwrite mode
      void showMessageDialog​(java.lang.String message)
      Shows message to user
      void showProgressMessage​(java.lang.String messageText)
      Show message in progress bar.
      void showStatusMessageRB​(java.lang.String messageKey, java.lang.Object... params)
      Show message in status bar from resource bundle by key.
      void showTimedStatusMessageRB​(java.lang.String messageKey, java.lang.Object... params)
      Same as IMainWindow.showStatusMessageRB(String, Object...) but this will clear the message after ten seconds.
      void unlockUI()
      Unlock UI after locking.
      • Methods inherited from class javax.swing.JFrame

        getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
      • Methods inherited from class java.awt.Frame

        addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • 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, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, 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, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, 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, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, 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 java.awt.MenuContainer

        getFont, postEvent
    • Constructor Detail

      • MainWindow

        public MainWindow()
                   throws java.io.IOException
        Creates new form MainWindow
        Throws:
        java.io.IOException
    • Method Detail

      • getApplicationFrame

        public javax.swing.JFrame getApplicationFrame()
        Get application frame.
        Specified by:
        getApplicationFrame in interface IMainWindow
      • getApplicationFont

        public java.awt.Font getApplicationFont()
        Get main application font.
        Specified by:
        getApplicationFont in interface IMainWindow
      • addDockable

        public void addDockable​(com.vlsolutions.swing.docking.Dockable pane)
        Add new dockable pane into application frame. This method called on application startup.
        Specified by:
        addDockable in interface IMainWindow
        Parameters:
        pane - dockable pane
      • doInsertTrans

        public void doInsertTrans()
        insert current fuzzy match or selection at cursor position
      • doRecycleTrans

        public void doRecycleTrans()
        replace entire edit area with active fuzzy match or selection
      • showStatusMessageRB

        public void showStatusMessageRB​(java.lang.String messageKey,
                                        java.lang.Object... params)
        Show message in status bar from resource bundle by key.
        Specified by:
        showStatusMessageRB in interface IMainWindow
        Parameters:
        messageKey - message key in resource bundle
        params - message parameters for formatting
      • showProgressMessage

        public void showProgressMessage​(java.lang.String messageText)
        Show message in progress bar.
        Specified by:
        showProgressMessage in interface IMainWindow
        Parameters:
        messageText - message text
      • setProgressToolTipText

        public void setProgressToolTipText​(java.lang.String toolTipText)
      • showLengthMessage

        public void showLengthMessage​(java.lang.String messageText)
        Show message in length label.
        Specified by:
        showLengthMessage in interface IMainWindow
        Parameters:
        messageText - message text
      • showLockInsertMessage

        public void showLockInsertMessage​(java.lang.String messageText,
                                          java.lang.String toolTip)
        Description copied from interface: IMainWindow
        Show message indicating the state of the Lock cursor and Insert/overwrite mode
        Specified by:
        showLockInsertMessage in interface IMainWindow
        Parameters:
        messageText - message text
      • displayWarningRB

        public void displayWarningRB​(java.lang.String warningKey,
                                     java.lang.Object... params)
        Display warning.
        Specified by:
        displayWarningRB in interface IMainWindow
        Parameters:
        warningKey - warning message key in resource bundle
        params - warning text parameters
      • displayWarningRB

        public void displayWarningRB​(java.lang.String warningKey,
                                     java.lang.String supercedesKey,
                                     java.lang.Object... params)
        Same as IMainWindow.displayWarningRB(String, Object...) but this will close the previous dialog if the dialog is still open and the supplied supercedesKey matches the previous dialog's key.
        Specified by:
        displayWarningRB in interface IMainWindow
        Parameters:
        warningKey - warning message key in resource bundle
        supercedesKey - the key of the warning dialog to close, if still open
        params - warning text parameters
      • displayErrorRB

        public void displayErrorRB​(java.lang.Throwable ex,
                                   java.lang.String errorKey,
                                   java.lang.Object... params)
        Display error.
        Specified by:
        displayErrorRB in interface IMainWindow
        Parameters:
        ex - exception to show
        errorKey - error message key in resource bundle
        params - error text parameters
      • lockUI

        public void lockUI()
        Lock UI for long-term operations.
        Specified by:
        lockUI in interface IMainWindow
      • unlockUI

        public void unlockUI()
        Unlock UI after locking.
        Specified by:
        unlockUI in interface IMainWindow
      • showErrorDialogRB

        public void showErrorDialogRB​(java.lang.String title,
                                      java.lang.String message,
                                      java.lang.Object... args)
        Show message in an ErrorDialog
        Specified by:
        showErrorDialogRB in interface IMainWindow
        Parameters:
        title - title of dialog. message key in resource bundle of title that is to be displayed
        message - message key in resource bundle of message that is to be displayed
        args - arguments of the resource bundle message
      • showConfirmDialog

        public int showConfirmDialog​(java.lang.Object message,
                                     java.lang.String title,
                                     int optionType,
                                     int messageType)
                              throws java.awt.HeadlessException
        shows a confirm dialog. For a GUI main window, this can be implemented as JOptionPane.showConfirmDialog
        Specified by:
        showConfirmDialog in interface IMainWindow
        Parameters:
        message - the Object to display
        title - the title string for the dialog (can be null)
        optionType - an integer designating the JOptionPane options available on the dialog: YES_NO_OPTION, YES_NO_CANCEL_OPTION, or OK_CANCEL_OPTION
        messageType - an integer designating the kind of message this is; primarily used to determine the icon from the pluggable Look and Feel: (JOptionPane ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
        Returns:
        an integer indicating the option selected by the user
        Throws:
        java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
        See Also:
        JOptionPane.showConfirmDialog(java.awt.Component, Object, String, int, int)
      • showMessageDialog

        public void showMessageDialog​(java.lang.String message)
        Description copied from interface: IMainWindow
        Shows message to user
        Specified by:
        showMessageDialog in interface IMainWindow
        Parameters:
        message - the message to show
      • getDesktop

        public com.vlsolutions.swing.docking.DockingDesktop getDesktop()
        get DockableDesktop object.
        Specified by:
        getDesktop in interface IMainWindow