Package com.nomagic.magicdraw.core
Class Project
java.lang.Object
com.dassault_systemes.modeler.foundation.project.ModelElementProjectImpl
com.nomagic.magicdraw.core.Project
- All Implemented Interfaces:
com.dassault_systemes.modeler.foundation.model.ModelElementRegistry
,com.dassault_systemes.modeler.foundation.project.ModelElementProject
,BaseElement
,MDElement
,com.nomagic.uml2.ext.jmi.reflect.ElementRegistry
,com.nomagic.uml2.ext.jmi.reflect.RepositoryProvider
,com.nomagic.uml2.project.ElementProject
,Cloneable
,Comparable
@OpenApi
public class Project
extends com.dassault_systemes.modeler.foundation.project.ModelElementProjectImpl
implements com.nomagic.uml2.project.ElementProject, MDElement
The
Project
class represents main storage of all project data like: main package,
all diagrams and diagram windows.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The any command (adding object, deleting object, changing specifications) executing event type and naming.static final String
The diagram focus on event type and naming.static final String
The diagram window closing event type and naming.static final String
Deprecated.not used anymorestatic final String
The diagram window opening event type and naming.static final String
The diagram window focus on event type and naming.static final String
Project "dirty" flag changestatic final String
Project file name propertystatic final String
Event type when many elements in project are changed (for example after project update,massive source reverse operation and etc)static final String
Deprecated.now SelectionProvider fires selection changed, useSelectionProvider.SelectionChangedListener
The diagram objects selecting event type and naming. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(AbstractVisitor visitor) Method accepts a visitor, and calls method visit < class name > (this) of visitor.void
Method accepts a visitor, and calls method "visit<class name>(this)" of a visitor.void
addElementByID
(BaseElement obj, String oldID) Register the object by id.static void
addFeature
(String feature) Register a feature for a new project.void
Registers the listener to the element.void
addToProjectRepository
(Element element) Adds element into this project repository and removes it from previous project repository.void
addToQueryChangeRegistry
(com.dassault_systemes.modeler.foundation.model.ModelElement element) void
addWindow
(ProjectWindow window) void
atInsert()
This method is called then this element is added into the project.final boolean
canAdd
(BaseElement element, boolean checkPermissions) Checks if this element can add a given element.boolean
Checks if new elements can be added to this elementboolean
boolean
Checks if this object can add element of given type.boolean
Checks if an element can be deleted from a project.boolean
canChangeParent
(Collection elements, BaseElement newParent) Returns true, if element can change parent.boolean
canDeleteChild
(BaseElement child) Checks if given element can be deleted from this element.clone()
int
Compares sort key at index 1 with given element's sort key at index 1.void
dispose()
Destroys the project.void
elementAdded
(BaseElement element) Marks element as added, if it was previously removed its id is removed from id collection.void
Marks element removed, its id added to mDeletedObjectIDS.boolean
executeIntensiveAction
(String reason) Executes time-intensive action if user agrees to.void
firePropertyChange
(String propertyName, Object oldValue, Object newValue) DelegatesfirePropertyChange
to thePropertyChangeSupport
, the member of this class, which reports a bound property update to any registered listeners.Generate ID.Returns currently active diagram.Gets collection of all model elements in the projectReturns the collection of all ids in the project.com.nomagic.magicdraw.core.BinaryStreamAtticCleaner
Get browser.Gets the type of the element class.com.nomagic.magicdraw.commands.CommandHistory
com.nomagic.magicdraw.core.MDCounter
getDiagram
(Diagram diagramElement) Returns diagram presentation element for specified diagram model element.Returns all existing diagrams stored in this Project.getDiagrams
(String type) Returns existing diagrams of given type stored in Project.Deprecated.use #getFile.getParentReturns project dirty type if project is dirty, otherwise - null.com.nomagic.magicdraw.dsl.DSL
getDSL()
Returns project DSL service instance.com.nomagic.magicdraw.ui.dsl.DSLManager
Deprecated.usegetDSL()
getElementByID
(String id) Return the element with given id.com.nomagic.magicdraw.core.Project.ElementByIDFetcher
Collection<? extends BaseElement>
getElementsByIDs
(Collection<String> ids) Return the objects by given ids.Collection<? extends BaseElement>
getElementsByIDs
(Collection<String> ids, Supplier<Collection<BaseElement>> collectionFactory) Return the objects by given ids.Provides UML elements factorystatic Collection<String>
getElementsIDs
(Collection<? extends BaseElement> elements) Retrieves the elements ids from DTObjects collection.Return registered features for a new project.com.nomagic.utils.ExtendedFile
getFile()
Method returns file of this project.Method returns file name of this project.boolean
Returns human representation of the element.Returns human representation of the element type.getID()
Returns the ID of theElement
.Return location from were project was loaded.org.eclipse.emf.common.util.URI
Get URI location according the primary project.getModel()
Deprecated.deprecated because of ambiguity with historical API evolutionReturns a list of models in the project (the primary model of the project and all the models of the modules (attached projects)).getName()
Returns project name.Returns the element parent.Getter for project options.getPresentationElementByID
(String elementID) Return the presentation element with given id from currently registered elements.Returns a primary model of this project.com.nomagic.ci.persistence.IPrimaryProject
Primary project of MagicDraw project.static Project
getProject
(BaseElement element) Returns Project for a given elementstatic Project
getProject
(Collection<? extends BaseElement> elements) Returns Project from first given elementcom.nomagic.magicdraw.ui.ProjectEditorWindowsManager
This method is deprecated and will be removed soon.Get project repository.Return listener registry for repository.Returns registry that allows to register smart listener configurations by element type.final com.dassault_systemes.modeler.foundation.common.sort.SortKeys
Implementation of getSortKeys() from Sortable interface.com.nomagic.magicdraw.uml.symbols.StereotypesStyleChangeManager
Returns style managerGet element symbol map.getTitle()
Return transaction manager.com.nomagic.magicdraw.uml.UMLModelProjectFeature
boolean
boolean
void
Invalidates thegetHasUnloadedManuallyReachableModules()
flagboolean
static boolean
boolean
isDirty()
Returns true if this project was modified after last save/load.boolean
isDisposed
(BaseElement element) Check if given element is unregistered from project.boolean
Checks if an element can be edited.static boolean
isElementDisposed
(com.dassault_systemes.modeler.foundation.model.ModelElement element) Check if given element is unregistered from project.boolean
Check if element with a given id is in this project.boolean
Returns whether the registry supports EMF proxies.boolean
Determines whether this is an ESI projectboolean
isFrozen()
boolean
isLoaded()
Return value of "loaded" flagboolean
isModel
(BaseElement element) Checks if the given element is a one of the models in this project.boolean
Checks if the given element is a one of the models in this project.boolean
Teamwork projects after commit can be saved locally, using flag to hold state about teamwork projects were saved locally.boolean
isNew()
boolean
isParentOf
(BaseElement obj) Returns true, if current element is parent of given element.boolean
boolean
Checks if this project was already disposed(closed).boolean
Deprecated.use #isProjectClosedboolean
isReady()
boolean
boolean
isRemote()
Returns the remote or not remote state of the project.boolean
To check if project is for UML models.void
refAddInstance
(javax.jmi.reflect.RefBaseObject instance) Collection<javax.jmi.reflect.RefBaseObject>
refAllOfClasses
(Set<com.nomagic.uml2.ext.jmi.reflect.AbstractRefClass> classes) void
refRemoveInstance
(javax.jmi.reflect.RefBaseObject instance) <T> void
Registers the specified service.void
Removes all property change listeners from this element.void
Unregister the object by id.static void
removeFeature
(String feature) Unregister a feature for a new project.void
removeFromQueryChangeRegistry
(com.dassault_systemes.modeler.foundation.model.ModelElement modelElement) void
Unregisters the given listener from the element.void
removeWindow
(ProjectWindow window) void
reSetDirty
(boolean dirty, StateChangeHandler.DirtyType dirtyType) Marks this project modified and sets modification type without checking previous project's dirty type.void
Removes current dynamic repository if such exist and installs a new dynamic repository.void
setClosing
(boolean closing) Set closing project statevoid
setCounter
(com.nomagic.magicdraw.core.MDCounter c) Sets the counter for the project.static void
setCreateBrowser
(boolean createBrowser) void
setDirectory
(String dir) Deprecated.void
setDirty
(boolean dirty) Deprecated.void
setDirty
(boolean dirty, StateChangeHandler.DirtyType dirtyType) Marks this project modified and sets modification type depending on previous type.void
setExporterDescription
(XmiExporterDescription exporterDescription) void
setFileName
(String fileName) Set the name of file as location of this project.void
setFrozen
(boolean frozen) Set frozen flag.void
Sets the specified ID to theElement
.void
setLoaded
(boolean loaded) Set "Loaded" flag for project.void
void
Deprecated.void
setNeedLocallySave
(boolean locallySaved) void
setPrimaryProject
(com.nomagic.ci.persistence.IProject primaryProject) void
setPrimaryProject
(com.nomagic.ci.persistence.IProject primaryProject, boolean closeOldProject, boolean changeModel) Set primary project.void
setRelocatingIn
(boolean relocating) Set project state to relocating.void
final String
sGetID()
Returns the actual ID of theElement
.toString()
Returns string representation of this element.Methods inherited from class com.dassault_systemes.modeler.foundation.project.ModelElementProjectImpl
getOptionalService, getService, getServiceProvider
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.nomagic.magicdraw.uml.BaseElement
canAdd, isSelfChangeable
Methods inherited from interface com.nomagic.magicdraw.uml.MDElement
getProject
Methods inherited from interface com.dassault_systemes.modeler.foundation.project.ModelElementProject
getOptionalService, getService, getServiceProvider
-
Field Details
-
COMMAND_EXECUTED
The any command (adding object, deleting object, changing specifications) executing event type and naming.- See Also:
-
SELECTION_CHANGED
Deprecated.now SelectionProvider fires selection changed, useSelectionProvider.SelectionChangedListener
The diagram objects selecting event type and naming.- See Also:
-
DIAGRAM_OPENED
The diagram window opening event type and naming.- See Also:
-
DIAGRAM_CLOSED
The diagram window closing event type and naming.- See Also:
-
DIAGRAM_EDITED
Deprecated.not used anymoreAny diagram properties editing event type and naming.- See Also:
-
DIAGRAM_ACTIVATED
The diagram focus on event type and naming.- See Also:
-
DIAGRAM_WINDOW_ACTIVATED
The diagram window focus on event type and naming.- See Also:
-
MANY_CLASSES_UPDATED
Event type when many elements in project are changed (for example after project update,massive source reverse operation and etc)- See Also:
-
FILE_NAME_PROPERTY
Project file name property- See Also:
-
DIRTY_PROPERTY
Project "dirty" flag change- See Also:
-
-
Constructor Details
-
Project
public Project()Constructor creates project.
-
-
Method Details
-
isCreateBrowser
public static boolean isCreateBrowser() -
setCreateBrowser
public static void setCreateBrowser(boolean createBrowser) -
getElementsIDs
Retrieves the elements ids from DTObjects collection.- Parameters:
elements
- collection of elements to get ID's for- Returns:
- the collection of elements ids from the DTObjects collection.
-
executeIntensiveAction
Executes time-intensive action if user agrees to.- Parameters:
reason
- reason why the action might take a long time- Returns:
- true if execute action
-
getProxyManager
- Returns:
- proxy manager of the project
-
getDSL
public com.nomagic.magicdraw.dsl.DSL getDSL()Returns project DSL service instance.- Returns:
- the manager.
-
getDSLManager
Deprecated.usegetDSL()
Returns project customization manager.- Returns:
- the manager
-
getBrowser
Get browser.- Returns:
- browser.
-
getOptions
Getter for project options.- Returns:
- project options
-
getCommandHistory
public com.nomagic.magicdraw.commands.CommandHistory getCommandHistory()- Returns:
- project command history.
-
getElementByIDQuerier
public com.nomagic.magicdraw.core.Project.ElementByIDFetcher getElementByIDQuerier() -
getActiveDiagram
Returns currently active diagram.- Returns:
- currently active diagram presentation element.
- See Also:
-
getActiveAbstractDiagram
-
getDiagrams
Returns all existing diagrams stored in this Project.- Returns:
- all existing DiagramPresentationElements. The collection is unmodifiable.
- See Also:
-
getDiagrams
Returns existing diagrams of given type stored in Project.- Parameters:
type
- the given diagrams type. Returns all diagrams if type is null.- Returns:
- collection of all diagram views.
- See Also:
-
getDiagram
Returns diagram presentation element for specified diagram model element.- Parameters:
diagramElement
- diagram model element- Returns:
- diagram presentation element.
-
setModel
-
getTitle
- Returns:
- project title
-
setTitle
-
getFileName
Method returns file name of this project. If file name is undefined returns project name.- Returns:
- file name of this project.
-
getDirectory
Deprecated.use #getFile.getParentReturns project directory.- Returns:
- project location directory.
-
setDirectory
Deprecated.Sets the project directory.- Parameters:
dir
- the new project directory.
-
setName
Deprecated.Sets the project name.- Parameters:
name
- the new project name.
-
getFile
public com.nomagic.utils.ExtendedFile getFile()Method returns file of this project.- Returns:
- file of this project
-
setFileName
Set the name of file as location of this project. Only local projects or locally saved remote projects can have file name.- Parameters:
fileName
- absolute file path
-
getCounter
public com.nomagic.magicdraw.core.MDCounter getCounter()- Returns:
- id counter
-
getStyleManager
Returns style manager- Returns:
- style manager
-
getProjectEditorWindowsManager
public com.nomagic.magicdraw.ui.ProjectEditorWindowsManager getProjectEditorWindowsManager()- Returns:
- editor windows manager
-
isRemote
@OpenApi public boolean isRemote()Returns the remote or not remote state of the project.- Returns:
- true if project is a remote project, false otherwise.
-
isEsiProject
@OpenApi public boolean isEsiProject()Determines whether this is an ESI project- Returns:
true
if ESI project,false
otherwise
-
isUMLProject
public boolean isUMLProject()To check if project is for UML models.- Returns:
- true if project is suitable for creating UML models
-
isDirty
@OpenApi public boolean isDirty()Returns true if this project was modified after last save/load.- Returns:
- true if this project was modified after last save/load.
-
setDirty
Deprecated.Marks this project modified.- Parameters:
dirty
- new dirty flag.
-
setDirty
Marks this project modified and sets modification type depending on previous type.- Parameters:
dirty
- new dirty flag.dirtyType
- specifies how much dirty is project.
IfdirtyType == null
, then default dirtyType value (DirtyType.HARD_DIRTY
) is set.
Ifdirty == true && dirtyType == DirtyType.SOFT_DIRTY
and project is already in state
dirty == true && dirtyType == DirtyType.HARD_DIRTY
, then project's state is not going to be changed.
-
getDirtyType
Returns project dirty type if project is dirty, otherwise - null.- Returns:
- project dirty type
-
reSetDirty
@OpenApi public void reSetDirty(boolean dirty, @CheckForNull StateChangeHandler.DirtyType dirtyType) Marks this project modified and sets modification type without checking previous project's dirty type.- Parameters:
dirty
- new dirty flag.dirtyType
- specifies how much dirty is project. IfdirtyType == null
, then default dirtyType value (DirtyType.HARD_DIRTY
) is set.
-
setCounter
public void setCounter(com.nomagic.magicdraw.core.MDCounter c) Sets the counter for the project.- Parameters:
c
- the new counter;
-
addElementByID
Register the object by id. The record about this object and its old id is removed.- Specified by:
addElementByID
in interfacecom.dassault_systemes.modeler.foundation.model.ModelElementRegistry
- Parameters:
obj
- the object to register.oldID
- the old id of the object.
-
addToProjectRepository
Adds element into this project repository and removes it from previous project repository. If element does not have an ID then it will be created.
After this operation element can be retrieved from project bygetElementByID(String)
.- Parameters:
element
- any element
-
removeElementByID
Unregister the object by id. The record about this object and is removed.- Specified by:
removeElementByID
in interfacecom.dassault_systemes.modeler.foundation.model.ModelElementRegistry
- Parameters:
obj
- the object.
-
addToQueryChangeRegistry
public void addToQueryChangeRegistry(com.dassault_systemes.modeler.foundation.model.ModelElement element) -
removeFromQueryChangeRegistry
public void removeFromQueryChangeRegistry(com.dassault_systemes.modeler.foundation.model.ModelElement modelElement) -
getElementByID
Return the element with given id.- Specified by:
getElementByID
in interfacecom.dassault_systemes.modeler.foundation.model.ModelElementRegistry
- Parameters:
id
- the id of the element.- Returns:
- the element with given id or null if element with such id is not registered in the project.
-
getPresentationElementByID
Return the presentation element with given id from currently registered elements.- Parameters:
elementID
- the id of the element, cannot be null- Returns:
- the element with given id or null if element with such id is not registered in the project.
-
isElementDisposed
@OpenApi public static boolean isElementDisposed(@CheckForNull com.dassault_systemes.modeler.foundation.model.ModelElement element) Check if given element is unregistered from project.- Parameters:
element
- element- Returns:
- true if element is disposed
-
isDisposed
Check if given element is unregistered from project.- Specified by:
isDisposed
in interfacecom.dassault_systemes.modeler.foundation.model.ModelElementRegistry
- Parameters:
element
- element- Returns:
- true if element is disposed
-
getElementsByIDs
Return the objects by given ids.- Parameters:
ids
- the collection of the ids of the objects.- Returns:
- the collection of objects with given ids.
-
getElementsByIDs
public Collection<? extends BaseElement> getElementsByIDs(Collection<String> ids, Supplier<Collection<BaseElement>> collectionFactory) Return the objects by given ids.- Parameters:
ids
- the collection of the ids of the objects.- Returns:
- the collection of objects with given ids.
-
getAllIDS
Returns the collection of all ids in the project.- Returns:
- the collection of all ids in the project.
-
getAllElements
Gets collection of all model elements in the project- Specified by:
getAllElements
in interfacecom.nomagic.uml2.ext.jmi.reflect.ElementRegistry
- Returns:
- collection of elements
-
isProjectClosed
public boolean isProjectClosed()Checks if this project was already disposed(closed). Such project cannot be activated any more.- Specified by:
isProjectClosed
in interfacecom.dassault_systemes.modeler.foundation.project.ModelElementProject
- Returns:
- true if project was disposed (closed)
-
isProjectDisposed
Deprecated.use #isProjectClosedChecks if this project was already disposed(closed). Such project cannot be activated any more.- Returns:
- true if project was disposed (closed)
-
isClosing
public boolean isClosing()- Specified by:
isClosing
in interfacecom.dassault_systemes.modeler.foundation.project.ModelElementProject
- Returns:
- true if project is closing (preCloseFinal event is fired)
-
setClosing
public void setClosing(boolean closing) Set closing project state- Parameters:
closing
- true if project is closing
-
getStateChangeHandler
- Returns:
- StateChangeHandler for this project.
-
elementAdded
Marks element as added, if it was previously removed its id is removed from id collection.- Parameters:
element
- element id which was added.
-
elementRemoved
Marks element removed, its id added to mDeletedObjectIDS.- Parameters:
obj
- element which was removed.
-
isElementInProject
Check if element with a given id is in this project.- Parameters:
id
- element id- Returns:
- true if element with given id is registered in project and is not removed.
-
addWindow
-
removeWindow
-
getWindows
-
hasWindow
-
getWindow
-
getStereotypesStyleChangeHandler
public com.nomagic.magicdraw.uml.symbols.StereotypesStyleChangeManager getStereotypesStyleChangeHandler() -
getRepository
Get project repository.- Specified by:
getRepository
in interfacecom.nomagic.uml2.ext.jmi.reflect.RepositoryProvider
- Returns:
- repository.
-
resetDynamicRepository
public void resetDynamicRepository()Removes current dynamic repository if such exist and installs a new dynamic repository. -
getElementsFactory
Description copied from interface:com.nomagic.uml2.project.ElementProject
Provides UML elements factory- Specified by:
getElementsFactory
in interfacecom.nomagic.uml2.project.ElementProject
- Returns:
- Class for creating uml model elements.
-
getSmartEventSupport
Returns registry that allows to register smart listener configurations by element type.- Returns:
- smart listener registry.
-
isModel
Checks if the given element is a one of the models in this project.- Parameters:
element
- element to check.- Returns:
- true if given element is a one of the models in this project.
-
isModel
Description copied from interface:com.nomagic.uml2.project.ElementProject
Checks if the given element is a one of the models in this project.- Specified by:
isModel
in interfacecom.nomagic.uml2.project.ElementProject
- Parameters:
element
- element to check- Returns:
- true if given package belongs to models of this project
- See Also:
-
ElementProject.getModels()
-
getModel
Deprecated.deprecated because of ambiguity with historical API evolutionReturns root primary model - root container of all model structure. This method should not be called anymore for TWC projects, because the returned model does not include the root models of modules (attached projects).getModels()
orgetPrimaryModel()
should be used instead as needed.- Returns:
- root model element
- Throws:
IllegalStateException
- in case root element is not a Model, but a Package
-
getPrimaryModel
Description copied from interface:com.nomagic.uml2.project.ElementProject
Returns a primary model of this project. Other models comes from modules (attached projects).- Specified by:
getPrimaryModel
in interfacecom.nomagic.uml2.project.ElementProject
- Returns:
- primary model
- See Also:
-
ElementProject.getModels()
-
getModels
Description copied from interface:com.nomagic.uml2.project.ElementProject
Returns a list of models in the project (the primary model of the project and all the models of the modules (attached projects)).- Specified by:
getModels
in interfacecom.nomagic.uml2.project.ElementProject
- Returns:
- models
-
getSymbolElementMap
Get element symbol map.- Returns:
- symbol element map
-
getRepositoryListenerRegistry
Return listener registry for repository.- Returns:
- listener registry for repository.
-
getRemoteID
-
isLoaded
public boolean isLoaded()Return value of "loaded" flag- Returns:
- true if this project was loaded from some location or is saved to some location (is not just created from template)
-
getLoadedFrom
Return location from were project was loaded. For Teamwork project returns local file if project was saved into file (or was loaded from file).- Returns:
- location of project
-
setLoaded
public void setLoaded(boolean loaded) Set "Loaded" flag for project. Project created from template is not "loaded"- Parameters:
loaded
- loaded flag
-
getProject
Returns Project from first given element- Parameters:
elements
- project elements- Returns:
- project in which first given element exists
-
getProject
Returns Project for a given element- Parameters:
element
- project element.- Returns:
- project in which a given element exists.
- See Also:
-
ProjectProvider
-
getExporterDescription
-
setExporterDescription
-
getTransactionsManager
Return transaction manager.- Returns:
- transaction manager
-
isNeedLocallySave
public boolean isNeedLocallySave()Teamwork projects after commit can be saved locally, using flag to hold state about teamwork projects were saved locally.- Returns:
- true if project was not locally saved. Should be used only for teamwork projects.
-
setNeedLocallySave
public void setNeedLocallySave(boolean locallySaved) -
setPrimaryProject
public void setPrimaryProject(com.nomagic.ci.persistence.IProject primaryProject) -
setPrimaryProject
public void setPrimaryProject(com.nomagic.ci.persistence.IProject primaryProject, boolean closeOldProject, boolean changeModel) Set primary project.- Parameters:
primaryProject
- project to set.closeOldProject
- close old project (do not close project when adding to teamwork).changeModel
- dispose old model (do not dispose UML model when adding to teamwork)
-
getPrimaryProject
@OpenApi public com.nomagic.ci.persistence.IPrimaryProject getPrimaryProject()Primary project of MagicDraw project.- Returns:
- primary project.
-
addFeature
Register a feature for a new project.- Parameters:
feature
- feature name
-
removeFeature
Unregister a feature for a new project.- Parameters:
feature
- name
-
getFeatures
Return registered features for a new project.- Returns:
- registered features for a new project.
-
getUMLModelStorageFeature
public com.nomagic.magicdraw.uml.UMLModelProjectFeature getUMLModelStorageFeature() -
isNew
public boolean isNew()- Returns:
- true if project is new and was never saved
-
getLocationUri
public org.eclipse.emf.common.util.URI getLocationUri()Get URI location according the primary project.- Returns:
- URI.
-
isFrozen
public boolean isFrozen()- Returns:
- true if project is frozen
-
setFrozen
public void setFrozen(boolean frozen) Set frozen flag. Frozen projects do not provide some data.- Parameters:
frozen
- frozen flag
-
isReady
public boolean isReady()- Returns:
- true if project is ready to use. It has primary project, it is not closed.
-
isRelocatedIn
public boolean isRelocatedIn()- Returns:
- true if project is in relocating state
-
setRelocatingIn
public void setRelocatingIn(boolean relocating) Set project state to relocating. Project is relocating if project content is coming from other project. This other project is in "relocated" state.- Parameters:
relocating
- relocating state
-
refAddInstance
public void refAddInstance(javax.jmi.reflect.RefBaseObject instance) - Specified by:
refAddInstance
in interfacecom.nomagic.uml2.ext.jmi.reflect.ElementRegistry
-
refRemoveInstance
public void refRemoveInstance(javax.jmi.reflect.RefBaseObject instance) - Specified by:
refRemoveInstance
in interfacecom.nomagic.uml2.ext.jmi.reflect.ElementRegistry
-
refAllOfClasses
public Collection<javax.jmi.reflect.RefBaseObject> refAllOfClasses(Set<com.nomagic.uml2.ext.jmi.reflect.AbstractRefClass> classes) - Specified by:
refAllOfClasses
in interfacecom.nomagic.uml2.ext.jmi.reflect.ElementRegistry
-
isPreloadProject
public boolean isPreloadProject()- Specified by:
isPreloadProject
in interfacecom.nomagic.uml2.ext.jmi.reflect.ElementRegistry
- Specified by:
isPreloadProject
in interfacecom.dassault_systemes.modeler.foundation.model.ModelElementRegistry
-
getBinaryStreamAtticCleaner
public com.nomagic.magicdraw.core.BinaryStreamAtticCleaner getBinaryStreamAtticCleaner() -
getHasUnloadedManuallyReachableModules
public boolean getHasUnloadedManuallyReachableModules()- Returns:
- the hasUnloadedManuallyReachableModules
-
invalidateHasUnloadedManuallyReachableModules
public void invalidateHasUnloadedManuallyReachableModules()Invalidates thegetHasUnloadedManuallyReachableModules()
flag -
toDebugRepresentation
-
register
Registers the specified service.- Type Parameters:
T
- type of the service.- Parameters:
type
- service type.service
- the service.
-
isEMFProxiesSupported
public boolean isEMFProxiesSupported()Description copied from interface:com.nomagic.uml2.ext.jmi.reflect.ElementRegistry
Returns whether the registry supports EMF proxies.- Specified by:
isEMFProxiesSupported
in interfacecom.nomagic.uml2.ext.jmi.reflect.ElementRegistry
- Specified by:
isEMFProxiesSupported
in interfacecom.dassault_systemes.modeler.foundation.model.ModelElementRegistry
- Returns:
- true if the element registry supports EMF proxies, otherwise - false.
-
generateID
Generate ID. -
getID
Description copied from interface:BaseElement
Returns the ID of theElement
. If the ID isnull
, new id for an element is generated. Element id is persistence and does not change during project save/load.- Specified by:
getID
in interfaceBaseElement
- Returns:
- the ID of the
Element
.
-
sGetID
Description copied from interface:BaseElement
Returns the actual ID of theElement
. May return null if ID was not generated or set for this element.- Specified by:
sGetID
in interfaceBaseElement
- Returns:
- the ID of the
Element
. - See Also:
-
setID
Description copied from interface:BaseElement
Sets the specified ID to theElement
.- Specified by:
setID
in interfaceBaseElement
- Parameters:
id
- the id to be set.
-
clone
- Specified by:
clone
in interfaceBaseElement
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
addPropertyChangeListener
Description copied from interface:BaseElement
Registers the listener to the element. The given listener will get notifications about property changes in this element.- Specified by:
addPropertyChangeListener
in interfaceBaseElement
- Parameters:
listener
- thePropertyChangeListener
to be added.- See Also:
-
hasListeners
public boolean hasListeners() -
removePropertyChangeListener
Description copied from interface:BaseElement
Unregisters the given listener from the element. The given listener will not get any notifications about property changes in this element.- Specified by:
removePropertyChangeListener
in interfaceBaseElement
- Parameters:
listener
- the PropertyChangeListener to be removed.- See Also:
-
removeAllPropertyChangeListeners
public void removeAllPropertyChangeListeners()Description copied from interface:BaseElement
Removes all property change listeners from this element.- Specified by:
removeAllPropertyChangeListeners
in interfaceBaseElement
-
firePropertyChange
public void firePropertyChange(String propertyName, @CheckForNull Object oldValue, @CheckForNull Object newValue) Description copied from interface:BaseElement
DelegatesfirePropertyChange
to thePropertyChangeSupport
, the member of this class, which reports a bound property update to any registered listeners. No event is fired if old and new values are equal or null.- Specified by:
firePropertyChange
in interfaceBaseElement
- Parameters:
propertyName
- the programmatic name of the property that was changed.oldValue
- the old value of the propertynewValue
- the new value of the property- See Also:
-
atInsert
public void atInsert()Description copied from interface:BaseElement
This method is called then this element is added into the project.- Specified by:
atInsert
in interfaceBaseElement
-
dispose
public void dispose()Destroys the project. After this method call project can not be used any more.- Specified by:
dispose
in interfaceBaseElement
-
accept
Description copied from interface:MDElement
Method accepts a visitor, and calls method "visit<class name>(this)" of a visitor. See "Visitor" pattern for more details. -
accept
Description copied from interface:BaseElement
Method accepts a visitor, and calls method visit < class name > (this) of visitor.- Specified by:
accept
in interfaceBaseElement
- Parameters:
visitor
- which visits this element.- Throws:
Exception
-
getName
Returns project name. -
getHumanName
Description copied from interface:BaseElement
Returns human representation of the element. Usually human name is constructed from element class type and name.- Specified by:
getHumanName
in interfaceBaseElement
- Returns:
- the human name of the element.
-
getProjectImpl
Description copied from interface:MDElement
This method is deprecated and will be removed soon.- Specified by:
getProjectImpl
in interfaceMDElement
- Returns:
- project
-
getSortKeys
public final com.dassault_systemes.modeler.foundation.common.sort.SortKeys getSortKeys()Description copied from interface:MDElement
Implementation of getSortKeys() from Sortable interface.- Specified by:
getSortKeys
in interfaceMDElement
- Returns:
- the array of predefined sort keys.
-
getHumanType
Description copied from interface:BaseElement
Returns human representation of the element type. Contains only element type without element name.- Specified by:
getHumanType
in interfaceBaseElement
- Returns:
- the human type of the element.
-
getResourceID
- Specified by:
getResourceID
in interfaceMDElement
-
canAdd
Description copied from interface:BaseElement
Checks if this element can add a given element.
Following rules must be true to have result true:
1.if checkTeamworkLock == true, this element must be locked for edit.
2.element can add given element as instance (class types are checked).
3.element can add given element as child (a given element is not a parent of current element etc.).- Specified by:
canAdd
in interfaceBaseElement
- Parameters:
element
- the element to add.checkPermissions
- check or not permissions.- Returns:
- true if an element can add the given element as a child.
-
canDeleteChild
Description copied from interface:BaseElement
Checks if given element can be deleted from this element. Following rules must be true to have result true: 1.this element must be editable. 2.project must be editable. 3.the type of given child must be valid for teamwork lock for edit operation (for example, class, package etc., not Attribute).- Specified by:
canDeleteChild
in interfaceBaseElement
- Parameters:
child
- a given child- Returns:
- true, if the given element can be deleted from the current element.
-
canBeDeleted
public boolean canBeDeleted()Description copied from interface:BaseElement
Checks if an element can be deleted from a project. Element cannot be deleted if it is not isEditable(), parent is not set, or parent does not allow to remove this element.- Specified by:
canBeDeleted
in interfaceBaseElement
- Returns:
- true, if an element can be deleted from a project.
- See Also:
-
canAddInstance
Description copied from interface:BaseElement
Checks if this object can add element of given type. Current implementation returns false.- Specified by:
canAddInstance
in interfaceBaseElement
- Returns:
- true if this object can elements of a given type.
-
canAddChild
- Specified by:
canAddChild
in interfaceMDElement
-
isEditable
public boolean isEditable()Description copied from interface:BaseElement
Checks if an element can be edited.- Specified by:
isEditable
in interfaceBaseElement
- Returns:
- true, if an element can be edited.
-
canAddChild
public boolean canAddChild()Description copied from interface:BaseElement
Checks if new elements can be added to this element- Specified by:
canAddChild
in interfaceBaseElement
- Returns:
- true, if new sub elements can be added.
-
getObjectParent
Description copied from interface:BaseElement
Returns the element parent. This implementation returns null. Should be overridden in subclasses.- Specified by:
getObjectParent
in interfaceBaseElement
- Returns:
- the parent of the element.
-
compareTo
Compares sort key at index 1 with given element's sort key at index 1.- Specified by:
compareTo
in interfaceComparable
- Parameters:
o
- the given object to compare to.- Returns:
- key's comparison result(String.compareTo()).
-
isParentOf
Description copied from interface:BaseElement
Returns true, if current element is parent of given element. Return false in this implementation.- Specified by:
isParentOf
in interfaceBaseElement
- Parameters:
obj
- the given element(possible child).- Returns:
- true if obj is the parent of this object.
-
getClassType
Description copied from interface:BaseElement
Gets the type of the element class. Every element has its own ClassType. Usually this class type is class of element or class interface of an element. All types are registered in ClassTypes.- Specified by:
getClassType
in interfaceBaseElement
- Returns:
- the type of the element.
-
toString
Returns string representation of this element. Useful for debugging purposes. -
canChangeParent
Description copied from interface:BaseElement
Returns true, if element can change parent.- Specified by:
canChangeParent
in interfaceBaseElement
- Parameters:
elements
- collection of the elements, whose will change the parent together with this.newParent
- new parent object.- Returns:
- true if an element can change parent.
-