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 Details

  • 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

      public void setBounds(Rectangle r)
      Overrides:
      setBounds in class Window
    • getMainMenuBar

      @OpenApi public JMenuBar getMainMenuBar()
      Returns main menu bar.
      Returns:
      main menu bar.
    • setActiveFrame

      public void setActiveFrame(@CheckForNull Frame activeFrame)
    • getActiveFrame

      public Frame 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 public void createCommandBar()
      Deprecated.
      use createMenuAndToolbars(). 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 registered AMConfigurator in ActionsConfiguratorsManager
    • getBrowser

      @CheckForNull @OpenApi public Browser getBrowser()
      Returns model browser.
      Returns:
      model browser.
    • updateByEnvironmentProperties

      public void updateByEnvironmentProperties(List<Property> properties)
      Update environment by given properties.
      Specified by:
      updateByEnvironmentProperties in interface EnvironmentOptions.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

      public Cursor getSpecificCursor()
      Specified by:
      getSpecificCursor in interface com.nomagic.ui.CursorOwner
    • getCurrentCursor

      public Cursor getCurrentCursor()
      Specified by:
      getCurrentCursor in interface com.nomagic.ui.CursorOwner
    • setSpecificCursor

      public void setSpecificCursor(Cursor c)
      Specified by:
      setSpecificCursor in interface com.nomagic.ui.CursorOwner
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Handles Property changing event, fired by PropertyChangeSupport

      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      evt - PropertyChangeEvent, which has to be handled.

      See Also:
    • setLF

      public boolean setLF(String lf, String theme, int jideStyle, boolean explicitlyUpdateUI)
    • sSetLF

      public void sSetLF(String lf, String themeID, int jideStyle, boolean explicitlyUpdateUI) throws Throwable
      Set look and feel without handling errors
      Parameters:
      lf - lf name
      themeID - theme id
      jideStyle - jide style
      explicitlyUpdateUI - update ui flag
      Throws:
      Throwable - exception
    • isLFUpdateRequired

      public static boolean isLFUpdateRequired(String lf, String themeID, int jideStyle)
    • 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

      public void updateRecentProject(Project prj)
      Updates project label in projects choice.
      Parameters:
      prj - - project to update
    • getProjectWindowsManager

      @OpenApi public ProjectWindowsManager getProjectWindowsManager()
      Returns ProjectWindowsManager.
      Returns:
      project windows manager.
    • getWindowsManager

      public com.nomagic.magicdraw.ui.WindowsManagerImpl getWindowsManager()
    • addStateListener

      public static void addStateListener(PropertyChangeListener listener)
      Adds listener for listening changes of recent windows, projects or files.
      Parameters:
      listener - listener for listening changes of recent windows, projects or files.
    • updateTitle

      public void updateTitle(@CheckForNull Project project)
    • getProjectTitle

      public String getProjectTitle(Project project)
      Returns project title suitable for application title bar
      Parameters:
      project - project instance of Project
      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

      public CookieSet 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:
      setVisible in class Window
    • getToolbarsManager

      public com.nomagic.magicdraw.ui.toolbar.ToolbarsManager getToolbarsManager()
    • createStartupActivity

      public Runnable createStartupActivity()
      Creates startup activity for setting APPLICATION_STARTED flag.
      Returns:
      runnable
    • getWindowFullScreenCustomizer

      public Consumer<Window> getWindowFullScreenCustomizer()
    • setWindowFullScreenCustomizer

      public void setWindowFullScreenCustomizer(Consumer<Window> windowFullScreenCustomizer)