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

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

public abstract ProjectAccessor

Interface to Operate Astah project.


Field Summary
static int REFERENCE_PROJECT_STATUS_LATEST
           
static int REFERENCE_PROJECT_STATUS_NEED_UPDATE
           
static int REFERENCE_PROJECT_STATUS_NOT_FOUND
           
 
Method Summary
abstract  void addEntityEditListener(EntityEditListener listener)
          Add EntityEditListener.
abstract  void addProjectEventListener(ProjectEventListener listener)
          Add ProjectEventListener.
abstract  void addReferenceProject(String path)
          Not implemented yet. Add Reference Project in Astah Project.
abstract  void changeReferenceProject(String fromPath, String toPath)
          Not implemented yet. Change Reference Project Path in Astah Project.
abstract  void clearReferenceProject(String path)
          Not implemented yet. Clear Reference Project in Astah Project.
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, and it should specify path when save the project.
abstract  void create(String projectPath, String templatePath, boolean useDefinedTaggedValues)
          Create Astah Project.
abstract  void create(String projectPath, String templatePath)
          Create Astah Project without loading the user defined tagged values.
abstract  void easyCompare(String path)
          Compare a project with the current project.
abstract  void easyMerge(String path, boolean isKeepBase)
          Not implemented yet. Merge a project into the current project.
abstract  void exportXMI(String fileName)
          Not implemented yet. Save Astah Project as parameter's xmi name.
abstract  INamedElement[] findElements(Class<E> elementKind, String name)
          Search elements in an Astah model by element kind and element name.
abstract  INamedElement[] findElements(Class<E> 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  String getAstahInstallPath()
          Obtain where the Astah installation path
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  IModel getCurrentProject()
          Deprecated. Get the top level model of a facet from a return value of getFacet(), etc. This method will be deleted in the future.
abstract  IDiagramEditorFactory getDiagramEditorFactory()
          Get IDiagramEditorFactory.
abstract  IEntity getEntity(String id)
          Returns IEntity that has special ID.
abstract  IFacet getFacet(String symbolicName)
          Get the facet contained in the project by specifying the symbolic name.
abstract  List<IFacet> getFacets()
          Get the facets owned by the project accessor.
abstract  IModelEditorFactory getModelEditorFactory()
          Get IModelEditorFactory.
abstract  IModel getProject()
          Deprecated. Get the top level model of a facet from a return value of getFacet(), etc. This method will be deleted in the future.
abstract  int getProjectModelVersion()
          Obtain the model version of project which is currently open
abstract  String getProjectPath()
          Obtain where the Astah project is saved
abstract  String[] getReferenceProjectPaths()
          Get Reference Project Paths in Astah Project.
abstract  int getReferenceProjectStatus(String path)
          Get Reference Project Status in Astah Project.
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)
          Returns whether there is an element with the same name
abstract  boolean hasSameElement(String name, Class<E> clazz)
          Returns whether there is an element with the same name and the same type
abstract  void importXMI(String projectName)
          Open Astah Project's XMI.
abstract  void importXMI(String projectName, boolean isIgnoreModelVersion)
          Open Astah Project's XMI.
abstract  boolean isProjectModified()
          Returns whether current model is modified
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(ProjectEventListener listener)
          Remove ProjectEventListener.
abstract  void removeReferenceProject(String path)
          Not implemented yet. Delete Reference Project in Astah Project.
abstract  void save()
          Save Astah Project.
abstract  void saveAs(String projectName)
          Save Astah Project as parameter's name.
abstract  void updateReferenceProject(String path)
          Not implemented yet. Update Reference Project in Astah Project.
abstract  void validateProject()
          Find invalid models in Astah project
 

Field Detail

REFERENCE_PROJECT_STATUS_LATEST

static final int REFERENCE_PROJECT_STATUS_LATEST

REFERENCE_PROJECT_STATUS_NEED_UPDATE

static final int REFERENCE_PROJECT_STATUS_NEED_UPDATE

REFERENCE_PROJECT_STATUS_NOT_FOUND

static final int REFERENCE_PROJECT_STATUS_NOT_FOUND
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. If an argument is a relative path, save in the current directory.

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

importXMI

abstract void importXMI(String projectName)
Open Astah Project's XMI.

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
InvalidUsingException - community and UML version cannot use XMI API.

importXMI

abstract void importXMI(String projectName,
                        boolean isIgnoreModelVersion)
Open Astah Project's XMI.

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
InvalidUsingException - community and UML version cannot use XMI API.

exportXMI

abstract void exportXMI(String fileName)
Not implemented yet. Save Astah Project as parameter's xmi name.

Parameters:
fileName - File Name
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
IOException - input/output error
InvalidUsingException - community and UML version cannot use XMI API.

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

getFacet

abstract IFacet getFacet(String symbolicName)
Get the facet contained in the project by specifying the symbolic name.

Parameters:
symbolicName - symbolic name of the facet
Returns:
Facet, otherwise null.

getFacets

abstract List<IFacet> getFacets()
Get the facets owned by the project accessor.

Returns:
the list of the facets owned by the project accessor.

getProject

abstract IModel getProject()
Deprecated. Get the top level model of a facet from a return value of getFacet(), etc. This method will be deleted in the future.

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.

getCurrentProject

abstract IModel getCurrentProject()
Deprecated. Get the top level model of a facet from a return value of getFacet(), etc. This method will be deleted in the future.

Get Model of project accessor.

Returns:
Model

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, and it should specify path when save the project.

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 Project has been locked

validateProject

abstract void validateProject()
Find invalid models in Astah project

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

addReferenceProject

abstract void addReferenceProject(String path)
Not implemented yet. Add Reference Project in Astah Project.

Parameters:
path - Reference Project Path. Absolute/Relative Path can be specified.
Throws:
ProjectNotFoundException - Project doesn't exist
InvalidEditingException - Invalid models exist
Keys:
       ILLEGAL_VERSION_ERROR_KEY - if Editing API is used in Astah community.
       PARAMETER_ERROR_KEY - if a parameter is not set properly.
Values:
       Error messages for exceptions.

removeReferenceProject

abstract void removeReferenceProject(String path)
Not implemented yet. Delete Reference Project in Astah Project.

Parameters:
path - Reference Project Path. Absolute/Relative Path can be specified.
Throws:
ProjectNotFoundException - Project doesn't exist
InvalidEditingException - Invalid models exist
Keys:
       ILLEGAL_VERSION_ERROR_KEY - if Editing API is used in Astah community.
       PARAMETER_ERROR_KEY - if a parameter is not set properly.
Values:
       Error messages for exceptions.

updateReferenceProject

abstract void updateReferenceProject(String path)
Not implemented yet. Update Reference Project in Astah Project.

Parameters:
path - Reference Project Path. Absolute/Relative Path can be specified.
Throws:
ProjectNotFoundException - Project doesn't exist
InvalidEditingException - Invalid models exist
Keys:
       ILLEGAL_VERSION_ERROR_KEY - if Editing API is used in Astah community.
       PARAMETER_ERROR_KEY - if a parameter is not set properly.
Values:
       Error messages for exceptions.

clearReferenceProject

abstract void clearReferenceProject(String path)
Not implemented yet. Clear Reference Project in Astah Project.

Parameters:
path - Reference Project Path. Absolute/Relative Path can be specified.
Throws:
ProjectNotFoundException - Project doesn't exist
InvalidEditingException - Invalid models exist
Keys:
       ILLEGAL_VERSION_ERROR_KEY - if Editing API is used in Astah community.
       PARAMETER_ERROR_KEY - if a parameter is not set properly.
Values:
       Error messages for exceptions.

changeReferenceProject

abstract void changeReferenceProject(String fromPath,
                                     String toPath)
Not implemented yet. Change Reference Project Path in Astah Project.

Parameters:
fromPath - Original Reference Project Path. Absolute/Relative Path can be specified.
toPath - New Reference Project Path Absolute/Relative Path can be specified.
Throws:
ProjectNotFoundException - Project doesn't exist
InvalidEditingException - Invalid models exist
Keys:
       ILLEGAL_VERSION_ERROR_KEY - if Editing API is used in Astah community.
       PARAMETER_ERROR_KEY - if a parameter is not set properly.
Values:
       Error messages for exceptions.

getReferenceProjectPaths

abstract String[] getReferenceProjectPaths()
Get Reference Project Paths in Astah Project.

Returns:
Reference Project Paths. Absolute or Relative Path.
Throws:
ProjectNotFoundException - Project doesn't exist

getReferenceProjectStatus

abstract int getReferenceProjectStatus(String path)
Get Reference Project Status in Astah Project.

Parameters:
path - Reference Project Path. Absolute/Relative Path can be specified.
Returns:
reference project status.
 ProjectAccessor.REFERENCE_PROJECT_STATUS_LATEST:Latest
       ProjectAccessor.REFERENCE_PROJECT_STATUS_NEED_UPDATE :Need Update
       ProjectAccessor.REFERENCE_PROJECT_STATUS_NOT_FOUND   :Not Found
Throws:
ProjectNotFoundException - Project doesn't exist

easyMerge

abstract void easyMerge(String path,
                        boolean isKeepBase)
Not implemented yet. Merge a project into the current project. It should be called out of transaction, or InvalidEditingException throws.

Parameters:
path - Reference Project Path. Absolute/Relative Path can be specified.
isKeepBase - When differences found, keep current or overwrite with reference.
Throws:
ProjectNotFoundException - Project doesn't exist
InvalidEditingException - Invalid models exist
Keys:
       ILLEGAL_VERSION_ERROR_KEY - if Editing API is used in Astah community.
       CAN_NOT_MERGE_IN_TRANSACTION_KEY - if a file is merged in transaction.
       CAN_NOT_MERGE_WHEN_CURRENT_HAS_REFERENCE_PROJRCT_KEY - if a file is merged to the current project with reference models.
       PARAMETER_ERROR_KEY - if a parameter is not set properly.
Values:
       Error messages for exceptions.

easyCompare

abstract void easyCompare(String path)
Compare a project with the current project.

Parameters:
path - Reference Project Path. Absolute/Relative Path can be specified.
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<E> 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<E> 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:
picker - 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

create

abstract void create(String projectPath,
                     String templatePath,
                     boolean useDefinedTaggedValues)
Create Astah Project.

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

create

abstract void create(String projectPath,
                     String templatePath)
Create Astah Project without loading the user defined tagged values.

Parameters:
projectPath - Project Path
templatePath - Template Path
Throws:
IOException - input/output error Project cannot be found

getProjectModelVersion

abstract int getProjectModelVersion()
Obtain the model version of project which is currently open

Returns:
Astah project's model version
Throws:
ProjectNotFoundException - Project cannot be found

getAstahEdition

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

Returns:
edition of Astah "professional" "UML" "community" "think" "SystemSafety"

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

getAstahInstallPath

abstract String getAstahInstallPath()
Obtain where the Astah installation path

Returns:
where the Astah installation path

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
Throws:
InvalidUsingException - InvalidUsingException occurs.

addProjectEventListener

abstract void addProjectEventListener(ProjectEventListener listener)
Add ProjectEventListener.

Parameters:
listener - ProjectEventListener

removeProjectEventListener

abstract void removeProjectEventListener(ProjectEventListener listener)
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()
Returns whether current model is modified

Returns:
true Modified / false Unmodified

hasSameElement

abstract boolean hasSameElement(String name)
Returns whether there is an element with the same name

Parameters:
name - Element name
Returns:
true Element exists / false No such element

hasSameElement

abstract boolean hasSameElement(String name,
                                Class<E> clazz)
Returns whether there is an element with the same name and the same type

Parameters:
name - Element name
clazz - Element type class
Returns:
true Element exist / false No such element