Package com.nomagic.magicdraw.ui
Class MainFrame
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
com.jidesoft.docking.DefaultDockableHolder
com.jidesoft.action.DefaultDockableBarDockableHolder
com.nomagic.magicdraw.ui.MainFrame
- All Implemented Interfaces:
com.jidesoft.action.DockableBarDockableHolder,com.jidesoft.action.DockableBarHolder,com.jidesoft.docking.DockableHolder,ActionsGroups,EnvironmentOptions.EnvironmentChangeListener,com.nomagic.ui.CursorOwner,ImageObserver,MenuContainer,PropertyChangeListener,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants
@OpenApi
public final class MainFrame
extends com.jidesoft.action.DefaultDockableBarDockableHolder
implements PropertyChangeListener, com.nomagic.ui.CursorOwner, ActionsGroups, EnvironmentOptions.EnvironmentChangeListener
The
MainFrame class represents main window of the MagicDraw application.
Also it has a set of inner classes- event listeners to handle all menu and toolbar events.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class com.jidesoft.docking.DefaultDockableHolder
_autoDispose, _contentContainer, _dockingManagerFields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabledFields 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_CURSORFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface com.nomagic.magicdraw.actions.ActionsGroups
ANY_DIAGRAM_EDIT_RELATED, ANY_DIAGRAM_OPENED_RELATED, ANY_PROJECT_EDIT_RELATED, ANY_PROJECT_OPENED_RELATED, ANY_PROJECT_SAVING_RELATED, ANY_REMOTE_ANY_PROJECT_EDIT_RELATED, ANY_REMOTE_PROJECT_EDIT_RELATED, ANY_REMOTE_PROJECT_OPENED_RELATED, ANY_REMOTE_UML_PROJECT_EDIT_RELATED, ANY_SERVER_LOGIN_RELATED, APPLICATION_RELATED, DIAGRAM_EDIT_RELATED, DIAGRAM_OPENED_RELATED, DIAGRAM_RELATED_ELEMENTS, DIAGRAM_ZOOMIN_RELATED, DIAGRAM_ZOOMOUT_RELATED, DIAGRAM_ZOOMTO11_RELATED, EDITOR_OPENED_RELATED, ESI_ANY_PROJECT_OPENED_RELATED, ESI_PROJECT_OPENED_RELATED, ESI_SERVER_LOGIN_RELATED, ESI_UML_PROJECT_OPENED_RELATED, LAYOUT_SHAPES_RELATED, LOCAL_PROJECT_OPENED_RELATED, LOCAL_UML_PROJECT_OPENED_RELATED, NOT_EMPTY_ANY_DIAGRAM_RELATED, NOT_EMPTY_CLASS_DIAGRAM_RELATED, NOT_EMPTY_DIAGRAM_RELATED, OPENED_MODULE_AS_PROJECT, PATH_STYLE_EDIT_RELATED, PE_SELECTION_AND_TEAMWORK_PROJECT_EDIT_RELATED, PRESENTATION_ELEMENT_ALIGN_RELATED, PRESENTATION_ELEMENT_SELECTION_RELATED, PROJECT_EDIT_RELATED, PROJECT_OPENED_RELATED, PROJECT_SAVING_RELATED, REDO_COMMAND_RELATED, STANDARD_SYSTEM_PROFILE_OPENED_RELATED, UML_PROJECT_EDIT_RELATED, UML_PROJECT_OPENED_RELATED, UNDO_COMMAND_RELATEDFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsConstructorDescriptionMainFrame(com.nomagic.magicdraw.core.Application.MainFrameController controller) Constructs MainFrame window, adds menu and popup buttons toolbar to it. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRecentWindow(com.nomagic.magicdraw.ui.editorwindows.EditorWindow window) Adds diagram window name to the recent window list.static voidaddStateListener(PropertyChangeListener listener) Adds listener for listening changes of recent windows, projects or files.voidDeprecated.voidCreate (or recreate) all menu and toolbars.Creates startup activity for setting APPLICATION_STARTED flag.Returns model browser.Returns main menu bar.com.nomagic.magicdraw.ui.ProgressBargetProjectTitle(Project project) Returns project title suitable for application title barReturns ProjectWindowsManager.com.nomagic.awt.StatusLinecom.nomagic.magicdraw.ui.toolbar.ToolbarsManagercom.nomagic.magicdraw.ui.UIInstallercom.nomagic.magicdraw.ui.WindowsManagerImplvoidinit()Creates GUI elements in MainFrame: menu and toolbar, browser and desktop.static booleanisLFUpdateRequired(String lf, String themeID, int jideStyle) static booleanReturns, flag, which shows if MF is working in silent mode.voidHandles Property changing event, fired byPropertyChangeSupportvoidsetActiveFrame(Frame activeFrame) voidbooleanvoidsetRecentWindowsList(Collection<com.nomagic.magicdraw.ui.editorwindows.EditorWindow<?>> windows) Sets the list of the recent windows.static voidsetSilentMode(boolean silentMode) Set flag, which shows if MF is working in silent mode.voidvoidsetStatusLine(com.nomagic.awt.StatusLine statusLine) voidsetUIInstaller(com.nomagic.magicdraw.ui.UIInstaller installer) voidsetVisible(boolean visible) voidsetWindowFullScreenCustomizer(Consumer<Window> windowFullScreenCustomizer) voidSet look and feel without handling errorsvoidupdateByEnvironmentProperties(List<Property> properties) Update environment by given properties.voidupdateFrameUI(boolean forceUpdate) Updates all elements uivoidUpdates project label in projects choice.voidupdateTitle(Project project) Methods inherited from class com.jidesoft.action.DefaultDockableBarDockableHolder
createContentContainer, createDockableBarManager, dispose, getDockableBarManager, getJMenuBar, getLayoutPersistence, initFrameMethods inherited from class com.jidesoft.docking.DefaultDockableHolder
createDockingManager, getDockingManager, isAutoDispose, isContentPaneCheckingEnabled, setAutoDispose, setContentPaneCheckingEnabledMethods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods 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, setUndecoratedMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, 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, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, show, toBack, toFrontMethods 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, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.jidesoft.docking.DockableHolder
getDockingManagerMethods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
MAIN_TOOLBAR_EXPERT
- See Also:
-
MAIN_TOOLBAR_STANDARD
- See Also:
-
RECENT_PROJECT_NAME_CHANGE
- See Also:
-
RECENT_WINDOWS
- See Also:
-
-
Constructor Details
-
MainFrame
public MainFrame(com.nomagic.magicdraw.core.Application.MainFrameController controller) Constructs MainFrame window, adds menu and popup buttons toolbar to it. Also this method sets event listeners for each menu item and toolbar button.- Parameters:
controller- controller
-
-
Method Details
-
setBounds
-
getMainMenuBar
Returns main menu bar.- Returns:
- main menu bar.
-
setActiveFrame
-
getActiveFrame
-
init
public void init()Creates GUI elements in MainFrame: menu and toolbar, browser and desktop. And adds action listeners to menu items and toolbar buttons -
createCommandBar
Deprecated.usecreateMenuAndToolbars(). Some people use this api, because we had no way -
createMenuAndToolbars
@OpenApi public void createMenuAndToolbars()Create (or recreate) all menu and toolbars. It will invoke all registeredAMConfiguratorinActionsConfiguratorsManager -
getBrowser
Returns model browser.- Returns:
- model browser.
-
updateByEnvironmentProperties
Update environment by given properties.- Specified by:
updateByEnvironmentPropertiesin interfaceEnvironmentOptions.EnvironmentChangeListener- Parameters:
properties- properties
-
isSilentMode
public static boolean isSilentMode()Returns, flag, which shows if MF is working in silent mode.- Returns:
- flag, which shows if MF is working in silent mode.
-
setSilentMode
public static void setSilentMode(boolean silentMode) Set flag, which shows if MF is working in silent mode. Used by Forte Integration.- Parameters:
silentMode- flag, which shows if MF is working in silent mode.
-
getSpecificCursor
- Specified by:
getSpecificCursorin interfacecom.nomagic.ui.CursorOwner
-
getCurrentCursor
- Specified by:
getCurrentCursorin interfacecom.nomagic.ui.CursorOwner
-
setSpecificCursor
- Specified by:
setSpecificCursorin interfacecom.nomagic.ui.CursorOwner
-
propertyChange
Handles Property changing event, fired byPropertyChangeSupport- Specified by:
propertyChangein interfacePropertyChangeListener- Parameters:
evt- PropertyChangeEvent, which has to be handled.- See Also:
-
setLF
-
sSetLF
public void sSetLF(String lf, String themeID, int jideStyle, boolean explicitlyUpdateUI) throws Throwable Set look and feel without handling errors- Parameters:
lf- lf namethemeID- theme idjideStyle- jide styleexplicitlyUpdateUI- update ui flag- Throws:
Throwable- exception
-
isLFUpdateRequired
-
updateFrameUI
public void updateFrameUI(boolean forceUpdate) Updates all elements ui- Parameters:
forceUpdate- set true to force update even if L&F did not change
-
addRecentWindow
public void addRecentWindow(com.nomagic.magicdraw.ui.editorwindows.EditorWindow window) Adds diagram window name to the recent window list.- Parameters:
window- the window to add.
-
setRecentWindowsList
public void setRecentWindowsList(Collection<com.nomagic.magicdraw.ui.editorwindows.EditorWindow<?>> windows) Sets the list of the recent windows.- Parameters:
windows- the new list of the recent windows.
-
updateRecentProject
Updates project label in projects choice.- Parameters:
prj- - project to update
-
getProjectWindowsManager
Returns ProjectWindowsManager.- Returns:
- project windows manager.
-
getWindowsManager
public com.nomagic.magicdraw.ui.WindowsManagerImpl getWindowsManager() -
addStateListener
Adds listener for listening changes of recent windows, projects or files.- Parameters:
listener- listener for listening changes of recent windows, projects or files.
-
updateTitle
-
getProjectTitle
Returns project title suitable for application title bar- Parameters:
project- project instance ofProject- Returns:
- project title suitable for application title bar
-
setStatusLine
public void setStatusLine(com.nomagic.awt.StatusLine statusLine) -
getStatusLine
public com.nomagic.awt.StatusLine getStatusLine() -
getCookieSet
-
getProgressBar
public com.nomagic.magicdraw.ui.ProgressBar getProgressBar()- Returns:
- Returns the progressBar.
-
getUIInstaller
public com.nomagic.magicdraw.ui.UIInstaller getUIInstaller()- Returns:
- Returns the uIInstaller.
-
setUIInstaller
public void setUIInstaller(com.nomagic.magicdraw.ui.UIInstaller installer) - Parameters:
installer- The uIInstaller to set.
-
setVisible
public void setVisible(boolean visible) - Overrides:
setVisiblein classWindow
-
getToolbarsManager
public com.nomagic.magicdraw.ui.toolbar.ToolbarsManager getToolbarsManager() -
createStartupActivity
Creates startup activity for setting APPLICATION_STARTED flag.- Returns:
- runnable
-
getWindowFullScreenCustomizer
-
setWindowFullScreenCustomizer
-
createMenuAndToolbars().