Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New UI to access the ontouml2gufo service #49

Merged
merged 124 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
e7d5767
WIP - checkbox tree for diagrams and model
victorviola Apr 12, 2020
eacb705
added dynamic icons to the tree
victorviola Apr 12, 2020
1f87444
improved icon setting.
victorviola Apr 12, 2020
ad82359
wip - added option to choose between trees
victorviola Apr 13, 2020
6dc7d17
Save user config when exporting to GUFO
victorviola Apr 14, 2020
b0a6467
wip - selection tree - retrieving nodes
victorviola Apr 15, 2020
8e0206a
fixed window control
victorviola Apr 15, 2020
775d14c
created new constructors.
victorviola Apr 16, 2020
cd59790
fix bug when calling class constructor
victorviola Apr 16, 2020
ffe390e
added comments and removed others.
victorviola Apr 16, 2020
44bd763
Merge branch 'development' into issue22-ontouml2Gufo
tgoprince Apr 18, 2020
789f58a
Moved icons
tgoprince Apr 18, 2020
d20936a
wip - package tree explorer
victorviola Apr 21, 2020
af33eb2
now models and packages have priority in the package tree.
victorviola Apr 21, 2020
37eb78e
added new model elements to package tree
victorviola Apr 21, 2020
4be6879
added option to check class without checking attributes
victorviola Apr 21, 2020
7862e31
fix attribute selection
victorviola Apr 21, 2020
b4cc886
check all same objects in the tree
victorviola Apr 21, 2020
740f24b
fixed identation
victorviola Apr 21, 2020
ae8e6f9
fixed multiple selection when have commom objects in the selection.
victorviola Apr 21, 2020
25ec3b4
fixed selection for classes
victorviola Apr 23, 2020
6991199
now the tree is saving in the configurations
victorviola Apr 24, 2020
54a6f47
fixed attributes when selecting classes
victorviola Apr 24, 2020
f95106b
fixed model snapshot when selecting generalization sets
victorviola Apr 25, 2020
0b52c81
consider IDiagramUIModel as its parent element
victorviola Apr 25, 2020
52146ea
now nodes of the tree are being inserted sorted.
victorviola Apr 26, 2020
1e30364
now tree is organized per type AND alphabetically
victorviola Apr 26, 2020
db873d8
added associations and generalizations to the package tree
victorviola Apr 26, 2020
c3df0ca
select classes of the same type of the attribute selected.
victorviola Apr 28, 2020
36a19fd
check types for subtree
victorviola Apr 28, 2020
3a4fe46
request improved
victorviola May 1, 2020
dd4c111
improved tree cell renderer
victorviola May 1, 2020
a4e3a83
1st version export view
victorviola May 2, 2020
595910f
new export to gufo window finished
victorviola May 2, 2020
070a856
fixed diagram saving element
victorviola May 2, 2020
f09061a
added new icons
victorviola May 2, 2020
0ed4e42
new icons
victorviola May 3, 2020
283df32
icon for package changed
victorviola May 3, 2020
b105f01
fixed model building
victorviola May 3, 2020
7774a88
improved selection for similar node
victorviola May 3, 2020
c01a640
improved threads
victorviola May 3, 2020
7541701
changed icon for association end
victorviola May 3, 2020
a2a33b1
name for association end
victorviola May 3, 2020
e519e9f
changed name root element for diagram tree
victorviola May 3, 2020
1e2621e
fixed nullpointer
victorviola May 3, 2020
a0bc3c0
add labels for combos
victorviola May 3, 2020
bd4e36f
resize window false
victorviola May 3, 2020
75445ea
prevent window export to be opened twice
victorviola May 3, 2020
9b74d2b
prevent config window to be opened twice
victorviola May 3, 2020
6ad398d
changed UI export
victorviola May 3, 2020
2582a10
removed unused component
victorviola May 3, 2020
439b826
adjust in UI
victorviola May 3, 2020
4b8c68b
adjust in UI
victorviola May 3, 2020
99b0bbd
improved layout
victorviola May 3, 2020
facdb3e
fixed label
victorviola May 3, 2020
034d995
layout improvement
victorviola May 3, 2020
fb75c8c
adjust
victorviola May 3, 2020
1f5b85a
new layout for export - wip
victorviola May 9, 2020
752d532
layout improvement - wip
victorviola May 9, 2020
f759e6d
added table
victorviola May 10, 2020
59c6ae8
added packages tab
victorviola May 10, 2020
a29107a
Changed labels
tgoprince May 10, 2020
bd6471a
Added default language option
tgoprince May 10, 2020
053ea04
layout adjust
victorviola May 10, 2020
1041d6c
Merge branch 'issue22-ontouml2Gufo' of https://github.com/OntoUML/ont…
victorviola May 10, 2020
3ed78ce
update
victorviola May 10, 2020
8afa43f
ui updated
victorviola May 10, 2020
591fe9f
adjust ui
victorviola May 10, 2020
6b3e240
Adjusted labels
tgoprince May 10, 2020
f47a391
Set Base IRI default value
tgoprince May 10, 2020
39fd1c8
UI fixes
tgoprince May 10, 2020
26a2034
Merge branch 'development'
tgoprince May 10, 2020
3803b6d
changed default behavior for tables
victorviola May 10, 2020
0ee6456
Merge branch 'development' into issue22-ontouml2Gufo
tgoprince May 10, 2020
2cf94fb
get json string from tables
victorviola May 10, 2020
e73658e
Merge branch 'issue22-ontouml2Gufo' of https://github.com/OntoUML/ont…
victorviola May 10, 2020
6182c5c
generating json to send transformation to server
victorviola May 10, 2020
4d6703a
Bugfix on allowed nature serialization
tgoprince May 11, 2020
4a61102
Updates export file format and datatype serialization
claudenirmf May 11, 2020
33a5e49
Merge branch 'feature/server-update' into issue22-ontouml2Gufo
claudenirmf May 11, 2020
d096c5b
Minor refactoring
claudenirmf May 11, 2020
62c38b9
Bugfix tag removal on apply meta-properties
claudenirmf May 11, 2020
f0e4649
Updates meta-property serialization
claudenirmf May 11, 2020
ecd5d34
Minor presentation issue
claudenirmf May 12, 2020
ad41094
Bugfix on suggested stereotypes
tgoprince May 12, 2020
c52c183
Bugifx on gufo options export
tgoprince May 12, 2020
e9f235d
fixed model building for tree and package
victorviola May 16, 2020
3382188
added port number to the default server
victorviola May 16, 2020
1a05011
code improved
victorviola May 16, 2020
7ce5d10
adjusted images
victorviola May 16, 2020
3c5a2a3
select generalizations when g_set is selected
victorviola May 16, 2020
d5b0f3a
fixed tree for diagram and package views
victorviola May 18, 2020
d2996d2
fixed serialization
victorviola May 21, 2020
c0dad99
fixed name of the generalizations in the tree
victorviola May 22, 2020
cbccb87
Fixed element and package mapping serialization
tgoprince May 22, 2020
b0350be
General code improvements
tgoprince May 22, 2020
2f78a74
Smart painting based on restrictedTo meta-property
tgoprince May 25, 2020
7c7a548
Fixed bugs related to tagged values
tgoprince May 25, 2020
ad2feaf
Updates listeners for restrictedTo inference
claudenirmf Jun 18, 2020
8f92188
Updates inference criteria
claudenirmf Jun 18, 2020
cb762a4
Updates ApplyProperties
claudenirmf Jun 19, 2020
3baac20
Improving manipulation of tagged values
claudenirmf Jun 20, 2020
44fc3c5
Updates interaction with tagged values
claudenirmf Jun 21, 2020
8d7f8fe
BugFix
claudenirmf Jun 21, 2020
1597777
Bugfix and cleanup
claudenirmf Jun 21, 2020
d64757f
Bugfix
claudenirmf Jun 22, 2020
6f73d58
Updates smart modeling of historical roles
claudenirmf Jun 22, 2020
a86ad1d
BugFixes and updates menu ordering, menu access, and color scheme
claudenirmf Jun 23, 2020
11cedd4
Bugfix historicalRole rule
claudenirmf Jun 23, 2020
7d78423
Updates «historicalRoleMixin»
claudenirmf Jun 30, 2020
d79cd9e
Updates applicable stereotype based on generalization
claudenirmf Jul 1, 2020
08b02e7
Updates association constraints JSON file
claudenirmf Jul 1, 2020
1ba72e8
Updates association constraints JSON file
claudenirmf Jul 2, 2020
a1c06c6
Updates ReportErrorAction
claudenirmf Jul 17, 2020
3c43a5e
Updates guides and bug report
claudenirmf Jul 18, 2020
47c4757
Updates README
claudenirmf Jul 18, 2020
48fa178
Updates images size
claudenirmf Jul 18, 2020
2a312c3
Updates report error URL
claudenirmf Jul 24, 2020
f132ce3
Updates README
claudenirmf Jul 31, 2020
5c4dc73
Updates plugin update feature
claudenirmf Aug 1, 2020
0b13d6e
Updates README
claudenirmf Aug 1, 2020
93ecee7
Bugfix default cardinalities
tgoprince Aug 3, 2020
50cd66f
Updates situations support
claudenirmf Aug 3, 2020
06e9064
Updates README
claudenirmf Aug 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 160 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,103 @@ This project contains a [Visual Paradigm](https://www.visual-paradigm.com/) plug
This project is defined under the umbrella of the [OntoUML Server](https://github.com/OntoUML/ontouml-server) project and is currently a proof of concept.

If you are interested to know more, feel free to open an issue to provide feedback on the project or reach our team members for more specific cases:

* [Claudenir M. Fonseca](https://github.com/claudenirmf)
* [Tiago Prince Sales](https://github.com/tgoprince)
* [Lucas Bassetti](https://github.com/LucasBassetti)
* [Victor Viola](https://github.com/victorviola)

## Contents

* [Overview](#overview)
* [User Instructions](#user-instructions)
* [Developer Instructions](#developer-instructions)
* [Report Errors](#report-errors)
* [FAQ](#faq)

___

## Overview

The **OntoUML Plugin for Visual Paradigm** adds to any version of Visual Paradigm features designed for OntoUML modelers. These features range from enabling OntoUML stereotypes in class diagrams to model verification and transformation.

WARNING: some more advanced features are based on web services that process your model remotely. The software processing these models is also [openly available](https://github.com/OntoUML/ontouml-server) and if you prefer to have your models processed in your own server, you are able to set it up and change the server URL in the plugin's settings.

### Features

#### OntoUML Enhanced Modeling

Stereotypes and meta-properties that are essential to OntoUML modeling are easily available to classes, associations and attributes with a simple right-click.

Notice that beyond the full list of stereotypes, a dynamic list of stereotypes is also available. This dynamic list is usually preferred during modeling as it filters wrong stereotypes for your class or association based on, respectively, their super/sub classes and their associated classes. The full list, however, tends to provide a faster and more flexible option during model fixing and refactoring.

![GIF showing a OntoUML model being edited](./resources/feature-modeling.gif)

![A screenshot of a suggested list of stereotypes in a context menu](./resources/feature-suggested-stereotypes.png)

![A screenshot of meta-properties editing in context menu](./resources/feature-meta-properties.png)

![A screenshot of restricted instances menu selection](./resources/feature-restricte-to.png)

Try selecting multiple elements to fast update your models!

#### Smart Paint

Automatic diagram painting based on the possible instances of classes with highlighted ultimate sortals (i.e., «kind», «collective», «quantity», «relator», «mode», and «quality») for improved model readability.

![A screenshot of an automatically painted diagram](./resources/feature-smart-paint.png)

#### Smart Modeling

Smart modeling allows the plugin to set default values to OntoUML model elements based on their stereotypes that are different from the defaults of UML speeding up modeling.

Since the Smart Paint feature depends on the "restrictedTo" meta-property, it is directly affected by Smart Modeling (responsible for assigning this meta-property).

#### Model Verification and Diagram Verification

Automatic verification of OntoUML syntactical rules which are reported to the user to manage. At the moment the list of constraints is being re-developed and users may find that new checks were introduced during the period they work on their products.

The Diagram Verification feature performs the verification of the whole model but only displays issues about elements present in the currently open diagram, facilitating the user's task of fixing models.

![A gif exemplifying the model verification feature](./resources/feature-verification.gif)

#### Model Transformation to OWL with gUFO

Model transformation into OWL with support of the [Lightweight Implementation of the Unified Foundational Ontology (UFO) - gUFO](https://nemo-ufes.github.io/gufo/).

Users must select the elements that shall be exported to gUFO either selecting from the model or from the desired diagrams. A number of options may also be set by the user for the transformation.

**WARNING**: the transformation feature require the presence of no verification errors among the exported entities. In addition, partial transformations of the model should be executed with care as they may introduce violations of some syntactical constraint.

![A screenshot showing the "transformation to gUFO" window](./resources/feature-gufo.png)

#### Continuos Updates

The remote features are constantly updated and any fixes to them you not require you to update your Visual Paradigm plugin.

And last, but not least, this project is supported by the [OntoUML.org](https://ontouml.org/) community and its set of features will only grow, incorporating new and updated OntoUML technologies.

![A screenshot showing the toolbar of the OntoUML plugin](./resources/feature-toolbar.png)

In order to update to a new version of the plugin, please download the latest [release](https://github.com/OntoUML/ontouml-vp-plugin/releases) as a ZIP file and select it through the "Update Plugin" button in the plugin (available from version 0.3.0).

Back to [top](#ontouml-plugin-for-visual-paradigm).

___

## User Instructions

To install the **OntoUML Plugin for Visual Paradigm**, please go to our [releases page](https://github.com/OntoUML/ontouml-vp-plugin/releases).
To **install** or **update** the **OntoUML Plugin for Visual Paradigm**, please go to our [releases page](https://github.com/OntoUML/ontouml-vp-plugin/releases) and download the ZIP file `ontouml-vp-plugin` in the latest release. Then go to `Help > Install Plugin` in the top of your window and, after clicking `Install from a zip of plugin` and `Next`, select the download release.

![Install plugin window](./resources/toolbar-help-install.png)

![Install plugin window](./resources/install-plugin-dialog.png)

For more details, check out this [guide](https://knowhow.visual-paradigm.com/openapi/how-to-deploy-plugins-to-vp-application/).

Back to [top](#ontouml-plugin-for-visual-paradigm).

___

## Developer Instructions

Expand All @@ -26,39 +115,38 @@ To install the **OntoUML Plugin for Visual Paradigm**, please go to our [release

#### Setting up

1. Clone the project

`git clone https://github.com/OntoUML/ontouml-vp-plugin.git`
1. Clone the project

`git clone https://github.com/OntoUML/ontouml-vp-plugin.git`

2. Open `pom.xml` and set the value of the variables listed below:

2.1. Set the path to the folder in which the Visual Paradigm application is located:

```xml
<visualparadigm.app.dir>
/Applications/Visual Paradigm.app/Contents/Resources/app
</visualparadigm.app.dir>
```

This path is typically:
- On Windows: `C:\Program Files\Visual Paradigm CE 16.1`
- On macOS: `/Applications/Visual Paradigm.app/Contents/Resources/app/`

* On Windows: `C:\Program Files\Visual Paradigm CE 16.1`
* On macOS: `/Applications/Visual Paradigm.app/Contents/Resources/app/`

2.2. Set the path to Visual Paradigm's plugin folder

```xml
<visualparadigm.plugin.dir>
/Users/<YOUR_USERNAME>/Library/Application Support/VisualParadigm/plugins
</visualparadigm.plugin.dir>
```

This path is typically:
- On Linux: `~/.config/VisualParadigm/plugins/`
- On Windows: `C:\Users\<YOUR_USER_NAME>\AppData\Roaming\VisualParadigm\plugins\`
- On macOS: `/Users/<YOUR_USERNAME>/Library/Application Support/VisualParadigm/plugins/`

* On Linux: `~/.config/VisualParadigm/plugins/`
* On Windows: `C:\Users\<YOUR_USER_NAME>\AppData\Roaming\VisualParadigm\plugins\`
* On macOS: `/Users/<YOUR_USERNAME>/Library/Application Support/VisualParadigm/plugins/`

#### Maven Commands

Expand All @@ -67,8 +155,8 @@ On Windows, replace `./mvnw` for `./mvnw.cmd`

In any OS, to invoke your local Maven installation instead of the wrapper, replace `./mvnw` with `mvn`.

* To **compile** the plugin, run:
* To **compile** the plugin, run:

```shell script
$ ./mvnw compile
```
Expand Down Expand Up @@ -98,10 +186,10 @@ In any OS, to invoke your local Maven installation instead of the wrapper, repla
```

Note that before running this command, you should install the plugin. That can be achieved by running:

```shell script
$ ./mvnw install exec:exec
```
```

* To **clean** the built files, run:

Expand All @@ -111,3 +199,54 @@ In any OS, to invoke your local Maven installation instead of the wrapper, repla

This does not remove the installed files, just the `target` folder and its contents.

Back to [top](#ontouml-plugin-for-visual-paradigm).

___

## Report Errors

In case you are reading this, thank you for interesting on contributing to our efforts by submitting your questions/suggestions or reporting errors in our tool.

If you have a GitHub account, head over to our [issues section](https://github.com/OntoUML/ontouml-vp-plugin/issues) and submit bugs, suggestions, or questions.

If you don't have a GitHub account but still would like to contribute by reporting an error in our plugin, please fill in this [form](https://forms.gle/btx7CDSy9kn5yb3WA) sharing as many details as you wish. We will be creating a issue to discuss and solve any problems and improve our tool.

Before submitting issues, however, search for [previous issues](https://github.com/OntoUML/ontouml-vp-plugin/issues) or questions in our [FAQ](#faq) as there may already be a solution to your problem.

Also, the more detailed your issue the better. Therefore, we encourage you to share with us details on what happened, screenshot, project files (either `.vpp` files or [exported XML projects](https://www.visual-paradigm.com/support/documents/vpuserguide/124/218/6848_exportingxml.html)), and Visual Paradigm logs (see [how to retrieve Visual Paradigm's log](https://knowhow.visual-paradigm.com/technical-support/vp-log/)). Remember that the issues you post (differently from the [form](https://forms.gle/btx7CDSy9kn5yb3WA)) are public.

Back to [top](#ontouml-plugin-for-visual-paradigm).

___

## FAQ

* [Why do I get the error message "The ID [...] is already in use"?](#why-do-i-get-the-error-message-"the-id-[...]-is-already-in-use")

* [Why Protégé gives me an error message when I try to open my ontology exported to gUFO?](#why-protégé-gives-me-an-error-message-when-i-try-to-open-my-ontology-exported-to-gufo)

* [I had an error while updating the plugin through the "Update Plugin" button and now it does not work](#I-had-an-error-while-updating-the-plugin-through-the-"Update-Plugin"-button-and-now-it-does-not-work)

### Why do I get the error message "The ID [...] is already in use"?

![Error message: ID already in use](./resources/faq-id-in-use.png)

Each Visual Paradigm plugin must (i) have an ID, and (ii) be installed in a specific folder. If you are updating to a new version of the plugin, it may occur that the name of the folder has changed. In this case, Visual Paradigm will think that you are trying to install a new plugin with an ID already in use instead of updating it.

![Install plugin window](./resources/install-plugin-dialog-folder-path.png)

To solve this issue, go to the `plugins` folder listed in the "Install Plugin" window (see above) and delete your old plugin folder before installing the new version. You may be required to re-open the application for that to take effect.

### Why Protégé gives me an error message when I try to open my ontology exported to gUFO?

Some users reported issues when trying to open their ontologies on [Protégé](https://protege.stanford.edu/) after using the ["Export to gUFO"](#Model-Transformation-to-OWL-with-gUFO) feature. In order to avoid this problem, we recommend you to use stable releases of Protégé (the desktop version) and avoid beta releases. You can find the latest release on their [official website]((https://protege.stanford.edu/)) and their complete list of releases in this [link](https://protegewiki.stanford.edu/wiki/Protege_Desktop_Old_Versions).

Also, make sure that your machine is connected to the internet so Protégé can load the [gUFO](https://nemo-ufes.github.io/gufo/) ontology which is used but not included in the exported file.

If you still have problems opening your ontology, please [report it](#Report-Errors) so we can improve our solutions.

### I had an error while updating the plugin through the "Update Plugin" button and now it does not work

In that case, the error may have corrupted the previous installation. Please access the plugins folder of Visual Paradigm (instructions [here](#why-do-i-get-the-error-message-"the-id-[...]-is-already-in-use")) and manually remove old plugins' folders. After this, extract the new version you tried to update to into this (now empty) folder. If you have other Visual Paradigm plugins in these folder, there is no need to delete does, only the OntoUML one.

Back to [top](#ontouml-plugin-for-visual-paradigm).
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>it.unibz.inf.ontouml</groupId>
<artifactId>ontouml-vp-plugin</artifactId>
<version>0.0.2-SNAPSHOT</version>
<version>0.3.0-SNAPSHOT</version>

<name>OntoUML 2 Plugin for Visual Paradigm</name>

Expand Down
Binary file added resources/faq-id-in-use.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-gufo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-meta-properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-modeling.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-restricte-to.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-smart-paint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-suggested-stereotypes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-toolbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-verification.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/install-plugin-dialog-folder-path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/install-plugin-dialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/toolbar-help-install.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
125 changes: 69 additions & 56 deletions src/main/java/it/unibz/inf/ontouml/vp/OntoUMLPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,74 +8,87 @@
import com.vp.plugin.model.IProject;
import com.vp.plugin.model.factory.IModelElementFactory;

import it.unibz.inf.ontouml.vp.listeners.DiagramListener;
import it.unibz.inf.ontouml.vp.listeners.ModelListener;
import it.unibz.inf.ontouml.vp.listeners.ProjectDiagramListener;
import it.unibz.inf.ontouml.vp.listeners.ProjectListener;
import it.unibz.inf.ontouml.vp.listeners.ProjectModelListener;
import it.unibz.inf.ontouml.vp.utils.ViewUtils;

/**
*
* Implementation of VPPlugin responsible for configuring OntoUML Plugin's
* behaviour when loading and unload.
*
*
* @author Victor Viola
* @author Claudenir Fonseca
*
*/
public class OntoUMLPlugin implements VPPlugin {

public static final String PLUGIN_VERSION_RELEASE = "0.2.0";
public static final String PLUGIN_ID = "it.unibz.inf.ontouml.vp";
public static final String PLUGIN_NAME = "OntoUML Plugin";

public static IModelElement[] allModelElements;
public static boolean isPluginActive;

public static ModelListener MODEL_LISTENER = new ModelListener();
public static DiagramListener DIAGRAM_LISTENER = new DiagramListener();
public static ProjectModelListener PROJECT_MODEL_LISTENER = new ProjectModelListener();
public static ProjectDiagramListener PROJECT_DIAGRAM_LISTENER = new ProjectDiagramListener();

/**
*
* OntoUMLPlugin constructor. Declared to make explicit Open API requirements.
*
*/
public OntoUMLPlugin() {
// The constructor of a VPPlugin MUST NOT have parameters.
}
public static final String PLUGIN_VERSION_RELEASE = "0.3.0";
public static final String PLUGIN_ID = "it.unibz.inf.ontouml.vp";
public static final String PLUGIN_NAME = "OntoUML Plugin";
public static final String PLUGIN_REPO = "https://github.com/OntoUML/ontouml-vp-plugin/";

/**
*
* Called by Visual Paradigm when the plugin is loaded.
*
* @param pluginInfo
*
*/
@Override
public void loaded(VPPluginInfo pluginInfo) {

ProjectManager pm = ApplicationManager.instance().getProjectManager();
ProjectListener projectListener = new ProjectListener();
IProject p = pm.getProject();
p.addProjectListener(projectListener);
p.addProjectDiagramListener(OntoUMLPlugin.PROJECT_DIAGRAM_LISTENER);
p.addProjectModelListener(OntoUMLPlugin.PROJECT_MODEL_LISTENER);

OntoUMLPlugin.allModelElements = pm.getSelectableStereotypesForModelType(IModelElementFactory.MODEL_TYPE_CLASS,
p, true);

}
public static IModelElement[] allModelElements;
public static boolean isPluginActive;

private static boolean isExportToGUFOWindowOpen;
private static boolean isConfigWindowOpen;
private static ProjectListener projectListener;

/**
* OntoUMLPlugin constructor. Declared to make explicit Open API requirements.
*/
public OntoUMLPlugin() {
// The constructor of a VPPlugin MUST NOT have parameters.
isExportToGUFOWindowOpen = false;
isConfigWindowOpen = false;
System.out.println("OntoUML Plugin (v" + PLUGIN_VERSION_RELEASE +") loaded successfully.");
}

/**
* Called by Visual Paradigm when the plugin is loaded.
*
* @param pluginInfo
*/
@Override
public void loaded(VPPluginInfo pluginInfo) {
final ProjectManager pm = ApplicationManager.instance().getProjectManager();
final IProject p = pm.getProject();

projectListener = new ProjectListener();
p.addProjectListener(projectListener);

OntoUMLPlugin.allModelElements =
pm.getSelectableStereotypesForModelType(IModelElementFactory.MODEL_TYPE_CLASS, p, true);
}

/**
* Called by Visual Paradigm when the plugin is unloaded (i.e., Visual Paradigm
* will be exited). This method is not called when the plugin is reloaded.
*/
@Override
public void unloaded() {
}

public static void setExportToGUFOWindowOpen(boolean open) {
isExportToGUFOWindowOpen = open;

}

public static boolean getExportToGUFOWindowOpen() {
return isExportToGUFOWindowOpen;
}

public static void setConfigWindowOpen(boolean open) {
isConfigWindowOpen = open;

}

public static boolean getConfigWindowOpen() {
return isConfigWindowOpen;
}

/**
*
* Called by Visual Paradigm when the plugin is unloaded (i.e., Visual Paradigm
* will be exited). This method is not called when the plugin is reloaded.
*
*/
@Override
public void unloaded() {
public static void reload() {
ViewUtils.log("Reloading plugin: "+PLUGIN_ID);
ApplicationManager.instance().reloadPluginClasses(PLUGIN_ID);
// TODO: try to integrate listener to the reload process
}

}
Loading