com.change_vision.jude.api.inf.project
Interface ProjectAccessor

com.change_vision.jude.api.inf.project.ProjectAccessor

public ProjectAccessor

Interface to Operate astah* project.


Method Summary
abstract  void addEntityEditListener(EntityEditListener listener)
          Add EntityEditListener.
abstract  void addProjectEventListener()
          Add ProjectEventListener.
abstract  void close()
          Close astah* Project.
abstract  void create(String projectPath, boolean useDefinedTaggedValues)
          Create astah* Project.
abstract  void create(String projectPath)
          Create astah* Project without loading the user defined tagged values.
abstract  void create()
          Create Astah project without loading the user defined tagged values.
abstract  INamedElement[] findElements(Class elementKind, String name)
          Search elements in an astah* model by element kind and element name.
abstract  INamedElement[] findElements(Class elementKind)
          Search elements in an astah* model by element kind.
abstract  INamedElement[] findElements(ModelFinder picker)
          Search elements in an astah* model by ModelPicker.
abstract  int getAstahAPIModelVersion()
          Obtain the model version of project created by astah* API
abstract  String getAstahAPIVersion()
          Obtain the version of astah* API
abstract  String getAstahEdition()
          Obtain the edition of astah* you currently use
abstract  int getAstahModelVersion()
          Obtain the model version of project created by this astah*
abstract  String getAstahVersion()
          Obtain the version of astah* you currently use
abstract  IDiagramEditorFactory getDiagramEditorFactory()
          Get IDiagramEditorFactory.
abstract  IEntity getEntity(String id)
          Returns IEntity that has special ID.
abstract  IModelEditorFactory getModelEditorFactory()
          Get IModelEditorFactory.
abstract  IModel getProject()
          Get Model of project accessor.
abstract  String getProjectPath()
          Obtain where the astah* project is saved
abstract  ITransactionManager getTransactionManager()
          Get ITransactionManager.
abstract  IViewManager getViewManager()
          Get IViewManager.
abstract  boolean hasProject()
          Get whether a project is open or not.
abstract  boolean hasSameElement(String name)
          hasSameElement
abstract  boolean hasSameElement(String name, Class clazz)
          hasSameElement
abstract  boolean isProjectModified()
          isProjectModified
abstract  void open(String projectName)
          Open astah* Project.
abstract  void open(String projectName, boolean isIgnoreModelVersion)
          Open astah* Project.
abstract  void open(String projectName, boolean isIgnoreModelVersion, boolean lockMode, boolean allowReadOnly)
          Open astah* Project.
abstract  void open(InputStream in)
          Open astah* Project.
abstract  void open(InputStream in, boolean isIgnoreModelVersion)
          Open astah* Project.
abstract  void removeEntityEditListener(EntityEditListener listener)
          Remove EntityEditListener.
abstract  void removeProjectEventListener()
          Remove ProjectEventListener.
abstract  void save()
          Save astah* Project.
abstract  void saveAs(String projectName)
          Save astah* Project as parameter's name.
abstract  void validateProject()
          Find invalid models in astah* project
 

Method Detail

open

abstract void open(String projectName)
Open astah* Project.

Parameters:
projectName - Project Name
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
NonCompatibleException - Old Model Version (The version of API is older than the version of astah* this project has been last edited with)
ClassNotFoundException - Cannot read some models
IOException - input/output error
ProjectLockedException - Project file has been locked

open

abstract void open(String projectName,
                   boolean isIgnoreModelVersion)
Open astah* Project.

Parameters:
projectName - Project Name
isIgnoreModelVersion - Select if you need a Model Version Check
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
NonCompatibleException - Old Model Version (The version of API is older than the version of astah* this project has been last edited with)
ClassNotFoundException - Cannot read some models
IOException - input/output error
ProjectLockedException - Project file has been locked

open

abstract void open(String projectName,
                   boolean isIgnoreModelVersion,
                   boolean lockMode,
                   boolean allowReadOnly)
Open astah* Project.

Parameters:
projectName - Project Name
isIgnoreModelVersion - Select if you need a Model Version Check
lockMode - Select if you lock a project file
allowReadOnly - Select if you open a project in ReadOnly mode when it has been locked.
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
NonCompatibleException - Old Model Version (The version of API is older than the version of astah* this project has been last edited with)
ClassNotFoundException - Cannot read some models
IOException - input/output error
ProjectLockedException - Project file has been locked

saveAs

abstract void saveAs(String projectName)
Save astah* Project as parameter's name.

Parameters:
fileName - File Name
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
IOException - input/output error
ProjectLockedException - Project file has been locked

open

abstract void open(InputStream in)
Open astah* Project.

Parameters:
in - InputStream
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
NonCompatibleException - Old Model Version (The version of API is older than the version of astah* this project has been last edited with)
ClassNotFoundException - Cannot read some models
IOException - input/output error
ProjectLockedException - Project file has been locked

open

abstract void open(InputStream in,
                   boolean isIgnoreModelVersion)
Open astah* Project.

Parameters:
in - InputStream
isIgnoreModelVersion - Select if you need a Model Version Check
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
NonCompatibleException - Old Model Version (The version of API is older than the version of astah* this project has been last edited with)
ClassNotFoundException - Cannot read some models
IOException - input/output error

getProject

abstract IModel getProject()
Get Model of project accessor.

Returns:
Model

hasProject

abstract boolean hasProject()
Get whether a project is open or not.

Returns:
true: If a project is open.

close

abstract void close()
Close astah* Project.


create

abstract void create(String projectPath,
                     boolean useDefinedTaggedValues)
Create astah* Project.

Parameters:
projectPath - Project Path
useDefinedTaggedValues - Set if you need to load the user defined tagged values as creating the project
Throws:
IOException - input/output error

create

abstract void create(String projectPath)
Create astah* Project without loading the user defined tagged values.

Parameters:
projectPath - Project Path
Throws:
IOException - input/output error

create

abstract void create()
Create Astah project without loading the user defined tagged values. The path of the project should be specified by using saveAs().

Throws:
IOException - input/output error

save

abstract void save()
Save astah* Project.

Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
IOException - input/output error
ProjectLockedException - Project has been locked

validateProject

abstract void validateProject()
Find invalid models in astah* project

Throws:
ProjectNotFoundException - Project doesn't exist
InvalidEditingException - Invalid models exist

getTransactionManager

abstract ITransactionManager getTransactionManager()
Get ITransactionManager.

Returns:
The object that implements ITransactionManager

getModelEditorFactory

abstract IModelEditorFactory getModelEditorFactory()
Get IModelEditorFactory.

Returns:
The object that implements IModelEditorFactory

getDiagramEditorFactory

abstract IDiagramEditorFactory getDiagramEditorFactory()
Get IDiagramEditorFactory.

Returns:
The object that implements IDiagramEditorFactory

findElements

abstract INamedElement[] findElements(Class elementKind,
                                      String name)
Search elements in an astah* model by element kind and element name. Presentations won't be searched.

Parameters:
elementKind - Element kind. API Class name is used for element kind, like IClass.
name - Element name.If name is null,Search elements in an astah* model by element kind.
Returns:
INamedElement[] Elements to be retrieved in any order.
Throws:
ProjectNotFoundException - Project doesn't exist

findElements

abstract INamedElement[] findElements(Class elementKind)
Search elements in an astah* model by element kind. Presentations won't be searched.

Parameters:
elementKind - Element kind. API Class name is used for element kind, like IClass.
Returns:
INamedElement[] Elements to be retrieved in any order.
Throws:
ProjectNotFoundException - Project doesn't exist

findElements

abstract INamedElement[] findElements(ModelFinder picker)
Search elements in an astah* model by ModelPicker. Presentations won't be searched.

Parameters:
ModelFinder - ModelFinder contains conditions searching models.Searching conditions should be implemented.
Returns:
INamedElement[] Elements to be retrieved in any order.
Throws:
ProjectNotFoundException - Project doesn't exist

getAstahEdition

abstract String getAstahEdition()
Obtain the edition of astah* you currently use

Returns:
edition of astah* "professional", "UML", "community" or "think"

getAstahVersion

abstract String getAstahVersion()
Obtain the version of astah* you currently use

Returns:
version of astah*

getProjectPath

abstract String getProjectPath()
Obtain where the astah* project is saved

Returns:
where the astah* project is saved
Throws:
ProjectNotFoundException - Project cannot be found

getAstahModelVersion

abstract int getAstahModelVersion()
Obtain the model version of project created by this astah*

Returns:
model version of project created by this astah*

getAstahAPIVersion

abstract String getAstahAPIVersion()
Obtain the version of astah* API

Returns:
version of astah* API

getAstahAPIModelVersion

abstract int getAstahAPIModelVersion()
Obtain the model version of project created by astah* API

Returns:
Model version of project created by astah* API

getViewManager

abstract IViewManager getViewManager()
Get IViewManager.

Returns:
The object that implements IViewManager

addProjectEventListener

abstract void addProjectEventListener()
Add ProjectEventListener.

Parameters:
listener - ProjectEventListener

removeProjectEventListener

abstract void removeProjectEventListener()
Remove ProjectEventListener.

Parameters:
listener - ProjectEventListener

addEntityEditListener

abstract void addEntityEditListener(EntityEditListener listener)
Add EntityEditListener.

Parameters:
listener - EntityEditListener

removeEntityEditListener

abstract void removeEntityEditListener(EntityEditListener listener)
Remove EntityEditListener.

Parameters:
listener - EntityEditListener

getEntity

abstract IEntity getEntity(String id)
Returns IEntity that has special ID. This will search model elements or diagram elements that have special from projects that you currently open. If the search was unable in any reasons such as no project is open, null will be returned.

Parameters:
id - ID string of the IEntity you'd like to search
Returns:
Found IEntity object

isProjectModified

abstract boolean isProjectModified()
isProjectModified

Returns:
true is Project modified.

hasSameElement

abstract boolean hasSameElement(String name)
hasSameElement

Parameters:
name - Name.
Returns:
True has same element.

hasSameElement

abstract boolean hasSameElement(String name,
                                Class clazz)
hasSameElement

Parameters:
name - Name.
clazz - Class.
Returns:
True has same element.