@OpenApi
public class Application
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Application.Environment
Contains application environment specific constants and utility methods.
|
static class |
Application.Runtime
Contains application runtime related constants and utility methods.
|
Modifier | Constructor and Description |
---|---|
protected |
Application()
Constructor of Application.
|
Modifier and Type | Method and Description |
---|---|
void |
addActivityAfterStartup(java.lang.Runnable activity)
Registered runnable is executed right after MagicDraw application startup.
|
void |
addNewDiagramType(DiagramDescriptor descriptor)
Registers new diagram type in the MagicDraw application.
|
void |
addProjectEventListener(ProjectEventListener listener)
Method adds new ProjectEventListener.
|
void |
addSaveParticipant(SaveParticipant participant)
Registers SaveParticipant for custom actions on project saving.
|
static Application.Environment |
environment()
Gets application environment.
|
CookieSet |
getCookieSet()
Returns cookie set of the application.
|
EnvironmentOptions |
getEnvironmentOptions()
Gets application environment options.
|
GUILog |
getGUILog()
Returns the interface to log window.
|
static Application |
getInstance()
Returns single instance of Application.
|
MainFrame |
getMainFrame()
Returns the mainFrame - main MagicDraw GUI component.
|
Project |
getProject()
Returns current active Project.
|
ProjectsManager |
getProjectsManager()
Returns the projectsManager.
|
java.util.List<SaveParticipant> |
getSaveParticipants()
List of registered SaveParticipants.
|
boolean |
isTryToLoadProject()
Checks if it is allowed to load project on startup.
|
void |
loadAliases()
Loads alias.properties file into memory.
|
void |
removeProjectEventListener(ProjectEventListener listener)
Method removes ProjectEventListener.
|
void |
removeSaveParticipant(SaveParticipant participant)
Unregister custom SaveParticipant.
|
static Application.Runtime |
runtime()
Gets application runtime.
|
void |
setApplicationName(java.lang.String name)
Set the name of the application.
|
void |
shutdown()
Shutdowns the application.
|
void |
start(boolean visible,
boolean silentMode,
boolean tryToLoadProject,
java.lang.String[] args,
StartupParticipant participant)
Starts the application.
|
void |
start(java.lang.String[] args)
Starts the application.
|
@OpenApi public void loadAliases() throws java.lang.Exception
java.lang.Exception
- in case of some error@OpenApi public EnvironmentOptions getEnvironmentOptions()
@OpenApi public static Application getInstance()
@CheckForNull @OpenApi public Project getProject()
@OpenApi public ProjectsManager getProjectsManager()
@OpenApi public MainFrame getMainFrame()
@OpenApi public void setApplicationName(java.lang.String name)
name
- application name@OpenApi public void start(java.lang.String[] args) throws ApplicationExitedException
args
- command line arguments passed to MagicDraw.ApplicationExitedException
- in case of some error@OpenApi public void start(boolean visible, boolean silentMode, boolean tryToLoadProject, java.lang.String[] args, @CheckForNull StartupParticipant participant) throws ApplicationExitedException
visible
- start MagicDraw as visible frame?silentMode
- true if GUI must be in silent mode(batch mode).tryToLoadProject
- true if application should try to load file passed as argument.args
- command line arguments passed to MagicDraw.participant
- the participant of startup process. May be null.ApplicationExitedException
- if application exists during the startup.@OpenApi public void shutdown() throws ApplicationExitedException
ApplicationExitedException
- in case of some error@OpenApi public GUILog getGUILog()
@OpenApi public void addProjectEventListener(ProjectEventListener listener)
listener
- listener to be added.@OpenApi public void removeProjectEventListener(ProjectEventListener listener)
listener
- to be removed.@OpenApi public void addActivityAfterStartup(java.lang.Runnable activity)
activity
- runnable to execute.@OpenApi public CookieSet getCookieSet()
@OpenApi public void addNewDiagramType(DiagramDescriptor descriptor)
descriptor
- descriptor of the new diagram.@OpenApi public java.util.List<SaveParticipant> getSaveParticipants()
@OpenApi public void addSaveParticipant(SaveParticipant participant)
participant
- the custom SaveParticipant.@OpenApi public void removeSaveParticipant(SaveParticipant participant)
participant
- the custom SaveParticipant.@OpenApi public boolean isTryToLoadProject()
@OpenApi public static Application.Runtime runtime()
@OpenApi public static Application.Environment environment()