Class MDDialogParentProvider

  • All Implemented Interfaces:
    DialogParentProvider

    @OpenApiAll
    public final class MDDialogParentProvider
    extends java.lang.Object
    implements DialogParentProvider
    Parent provider for the dialogs used in MagicDraw
    • Field Detail

      • fakeParent

        private java.awt.Frame fakeParent
      • dialogOwner

        @CheckForNull
        private java.awt.Window dialogOwner
    • Constructor Detail

      • MDDialogParentProvider

        private MDDialogParentProvider()
    • Method Detail

      • getDialogParent

        @Deprecated
        public java.awt.Frame getDialogParent()
        Deprecated.
        use getDialogOwner(). Frame is not always a good choice to pass as parent. Parent sometimes should be another dialog, not just a frame.
        Returns parent frame for dialogs.
        Specified by:
        getDialogParent in interface DialogParentProvider
        Returns:
        parent
      • getDialogOwner

        public java.awt.Window getDialogOwner​(@CheckForNull
                                              java.awt.Component invoker)
        Description copied from interface: DialogParentProvider
        Returns parent window(dialog or frame) for a dialog which will be invoked by given component
        Specified by:
        getDialogOwner in interface DialogParentProvider
        Parameters:
        invoker - invoker component
        Returns:
        owner window of invoker component
      • getWindowOf

        @CheckForNull
        private static java.awt.Window getWindowOf​(@CheckForNull
                                                   java.awt.Component invoker)
      • getDialogParent

        @CheckForNull
        public java.awt.Frame getDialogParent​(boolean useFake)
        Method returns the frame used for dialogs as parent. If there is no parent returns null.
        Parameters:
        useFake - true return fake parent if there is no real parent.
        Returns:
        dialog parent frame.
      • setDialogParent

        public void setDialogParent​(@CheckForNull
                                    java.awt.Window parent)
        Sets the parent for dialogs those will be created in future.
        Parameters:
        parent - the new dialog's parent.
      • hideFakeParent

        public static void hideFakeParent()
        Hides fake parent