Package org.omegat.gui.main
Class MainWindow
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- org.omegat.gui.main.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
-
-
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
-
-
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 asIMainWindow.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 positionvoid
doRecycleTrans()
replace entire edit area with active fuzzy match or selectionjava.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 ErrorDialogvoid
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 modevoid
showMessageDialog(java.lang.String message)
Shows message to uservoid
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 asIMainWindow.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 org.omegat.gui.main.IMainWindow
getCursor, setCursor
-
-
-
-
Field Detail
-
menu
public final MainWindowMenu menu
-
-
Method Detail
-
getApplicationFrame
public javax.swing.JFrame getApplicationFrame()
Get application frame.- Specified by:
getApplicationFrame
in interfaceIMainWindow
-
getApplicationFont
public java.awt.Font getApplicationFont()
Get main application font.- Specified by:
getApplicationFont
in interfaceIMainWindow
-
getMainMenu
public IMainMenu getMainMenu()
Retrieve main manu instance.- Specified by:
getMainMenu
in interfaceIMainWindow
-
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 interfaceIMainWindow
- 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 interfaceIMainWindow
- Parameters:
messageKey
- message key in resource bundleparams
- message parameters for formatting
-
showTimedStatusMessageRB
public void showTimedStatusMessageRB(java.lang.String messageKey, java.lang.Object... params)
Same asIMainWindow.showStatusMessageRB(String, Object...)
but this will clear the message after ten seconds.- Specified by:
showTimedStatusMessageRB
in interfaceIMainWindow
- Parameters:
messageKey
- message key in resource bundleparams
- message parameters for formatting
-
showProgressMessage
public void showProgressMessage(java.lang.String messageText)
Show message in progress bar.- Specified by:
showProgressMessage
in interfaceIMainWindow
- 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 interfaceIMainWindow
- 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 interfaceIMainWindow
- Parameters:
messageText
- message text
-
displayWarningRB
public void displayWarningRB(java.lang.String warningKey, java.lang.Object... params)
Display warning.- Specified by:
displayWarningRB
in interfaceIMainWindow
- Parameters:
warningKey
- warning message key in resource bundleparams
- warning text parameters
-
displayWarningRB
public void displayWarningRB(java.lang.String warningKey, java.lang.String supercedesKey, java.lang.Object... params)
Same asIMainWindow.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 interfaceIMainWindow
- Parameters:
warningKey
- warning message key in resource bundlesupercedesKey
- the key of the warning dialog to close, if still openparams
- 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 interfaceIMainWindow
- Parameters:
ex
- exception to showerrorKey
- error message key in resource bundleparams
- error text parameters
-
lockUI
public void lockUI()
Lock UI for long-term operations.- Specified by:
lockUI
in interfaceIMainWindow
-
unlockUI
public void unlockUI()
Unlock UI after locking.- Specified by:
unlockUI
in interfaceIMainWindow
-
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 interfaceIMainWindow
- Parameters:
title
- title of dialog. message key in resource bundle of title that is to be displayedmessage
- message key in resource bundle of message that is to be displayedargs
- 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 interfaceIMainWindow
- Parameters:
message
- the Object to displaytitle
- 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_OPTIONmessageType
- 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 interfaceIMainWindow
- Parameters:
message
- the message to show
-
getDesktop
public com.vlsolutions.swing.docking.DockingDesktop getDesktop()
get DockableDesktop object.- Specified by:
getDesktop
in interfaceIMainWindow
-
-