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 91 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
23 changes: 23 additions & 0 deletions src/main/java/it/unibz/inf/ontouml/vp/OntoUMLPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public class OntoUMLPlugin implements VPPlugin {
public static DiagramListener DIAGRAM_LISTENER = new DiagramListener();
public static ProjectModelListener PROJECT_MODEL_LISTENER = new ProjectModelListener();
public static ProjectDiagramListener PROJECT_DIAGRAM_LISTENER = new ProjectDiagramListener();

private static boolean isExportToGUFOWindowOpen;
private static boolean isConfigWindowOpen;

/**
*
Expand All @@ -44,6 +47,8 @@ public class OntoUMLPlugin implements VPPlugin {
*/
public OntoUMLPlugin() {
// The constructor of a VPPlugin MUST NOT have parameters.
isExportToGUFOWindowOpen = false;
isConfigWindowOpen = false;
}

/**
Expand Down Expand Up @@ -77,5 +82,23 @@ public void loaded(VPPluginInfo pluginInfo) {
@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;
}

}
218 changes: 30 additions & 188 deletions src/main/java/it/unibz/inf/ontouml/vp/controllers/ApplyProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void performAction(VPAction action, VPContext context, ActionEvent event)

switch(action.getActionId()) {
case ActionIds.PROPERTY_SET_ALLOWED:
this.setAllowedProperty(action,context,event);
this.setAllowedProperty(context);
break;
case ActionIds.PROPERTY_SET_IS_ABSTRACT:
_class.setAbstract(!_class.isAbstract());
Expand All @@ -63,62 +63,46 @@ public void performAction(VPAction action, VPContext context, ActionEvent event)
}
}

private void setAllowedProperty(VPAction action, VPContext context, ActionEvent event) {
private ITaggedValue getValueToBeSet(VPContext context, String valueName){
if(context.getModelElement() == null) {
return ;
return null;
}

final IClass _class = (IClass) context.getModelElement();
ITaggedValueContainer container = _class.getTaggedValues();
Iterator<?> values = container == null ? null : container.taggedValueIterator();
String currentStereotype = _class.toStereotypeArray() != null && _class.toStereotypeArray().length > 0 ?
_class.toStereotypeArray() [0] :
null;

if(currentStereotype == null || !StereotypeUtils.getOntoUMLClassStereotypeNames().contains(currentStereotype)){
return ;
// Escape in case the stereotype is missing or incorrect
if(
currentStereotype == null
|| !StereotypeUtils.getOntoUMLClassStereotypeNames().contains(currentStereotype)
){
return null;
}

// Reapply stereotype making sure that the tagged values are there
StereotypeUtils.applyStereotype(_class, currentStereotype);

// Searches for tagged value
ITaggedValue allowedValue = null;
ITaggedValueContainer container = _class.getTaggedValues();
Iterator<?> values = container == null ? null : container.taggedValueIterator();
while(values != null && values.hasNext()) {
final ITaggedValue value = (ITaggedValue) values.next();

if(value.getName().equals("allowed")) {
allowedValue = value;
break ;
if(value.getName().equals(valueName)) {
return value;
}
}

// Adds missing tagged value
if(allowedValue == null) {
// Reset stereotype's tagged values
if(StereotypeUtils.STEREOTYPE_ELEMENTS == null) {
StereotypeUtils.generate();
}

if(_class.getTaggedValues() != null) {
ITaggedValueContainer c = _class.getTaggedValues();
_class.setTaggedValues(null);
c.delete();
}

_class.removeStereotype(currentStereotype);
_class.addStereotype(StereotypeUtils.STEREOTYPE_ELEMENTS.get(currentStereotype));
StereotypeUtils.setAllowed(_class, currentStereotype);

// Searches for the tagged value just added
container = _class.getTaggedValues();
values = container == null ? null : container.taggedValueIterator();
return null;
}

while(values != null && values.hasNext()) {
final ITaggedValue value = (ITaggedValue) values.next();
private void setAllowedProperty(VPContext context) {
final ITaggedValue allowedValue = getValueToBeSet(context, StereotypeUtils.PROPERTY_ALLOWED);

if(value.getName().equals("allowed")) {
allowedValue = value;
break ;
}
}
if(allowedValue == null) {
return ;
}

final ViewManager vm = ApplicationManager.instance().getViewManager();
Expand All @@ -130,172 +114,30 @@ private void setAllowedProperty(VPAction action, VPContext context, ActionEvent
}

private void setIsExtensionalProperty(VPAction action, VPContext context, ActionEvent event) {
if(context.getModelElement() == null) {
return ;
}
final ITaggedValue isExtensionalValue = getValueToBeSet(context, StereotypeUtils.PROPERTY_IS_EXTENSIONAL);

final IClass _class = (IClass) context.getModelElement();
ITaggedValueContainer container = _class.getTaggedValues();
Iterator<?> values = container == null ? null : container.taggedValueIterator();

if(!_class.hasStereotype(StereotypeUtils.STR_COLLECTIVE)){
return ;
}

// Searches for tagged value
ITaggedValue isExtensionalValue = null;
while(values != null && values.hasNext()) {
final ITaggedValue value = (ITaggedValue) values.next();

if(value.getName().equals("isExtensional")) {
isExtensionalValue = value;
break ;
}
}

// Adds missing tagged value
if(isExtensionalValue == null) {
// Reset stereotype's tagged values
if(StereotypeUtils.STEREOTYPE_ELEMENTS == null) {
StereotypeUtils.generate();
}

if(_class.getTaggedValues() != null) {
ITaggedValueContainer c = _class.getTaggedValues();
_class.setTaggedValues(null);
c.delete();
}

_class.removeStereotype(StereotypeUtils.STR_COLLECTIVE);
_class.addStereotype(StereotypeUtils.STEREOTYPE_ELEMENTS.get(StereotypeUtils.STR_COLLECTIVE));
StereotypeUtils.setAllowed(_class, StereotypeUtils.STR_COLLECTIVE);

// Searches for the tagged value just added
container = _class.getTaggedValues();
values = container == null ? null : container.taggedValueIterator();

while(values != null && values.hasNext()) {
final ITaggedValue value = (ITaggedValue) values.next();

if(value.getName().equals("isExtensional")) {
isExtensionalValue = value;
break ;
}
}
return ;
}

isExtensionalValue.setValue(!isExtensionalValue.getValueAsString().toLowerCase().equals("true"));
}

private void setIsPowertypeProperty(VPAction action, VPContext context, ActionEvent event) {
if(context.getModelElement() == null) {
return ;
}

final IClass _class = (IClass) context.getModelElement();
ITaggedValueContainer container = _class.getTaggedValues();
Iterator<?> values = container == null ? null : container.taggedValueIterator();
final ITaggedValue isPowertypeValue = getValueToBeSet(context, StereotypeUtils.PROPERTY_IS_POWERTYPE);

if(!_class.hasStereotype(StereotypeUtils.STR_TYPE)){
return ;
}

// Searches for tagged value
ITaggedValue isPowertypeValue = null;
while(values != null && values.hasNext()) {
final ITaggedValue value = (ITaggedValue) values.next();

if(value.getName().equals("isPowertype")) {
isPowertypeValue = value;
break ;
}
}

// Adds missing tagged value
if(isPowertypeValue == null) {
// Reset stereotype's tagged values
if(StereotypeUtils.STEREOTYPE_ELEMENTS == null) { StereotypeUtils.generate(); }

if(_class.getTaggedValues() != null) {
ITaggedValueContainer c = _class.getTaggedValues();
_class.setTaggedValues(null);
c.delete();
}

_class.removeStereotype(StereotypeUtils.STR_TYPE);
_class.addStereotype(StereotypeUtils.STEREOTYPE_ELEMENTS.get(StereotypeUtils.STR_TYPE));

StereotypeUtils.setAllowed(_class, StereotypeUtils.STR_TYPE);

// Searches for the tagged value just added
container = _class.getTaggedValues();
values = container == null ? null : container.taggedValueIterator();

while(values != null && values.hasNext()) {
final ITaggedValue value = (ITaggedValue) values.next();

if(value.getName().equals("isPowertype")) {
isPowertypeValue = value;
break ;
}
}
return ;
}

isPowertypeValue.setValue(!isPowertypeValue.getValueAsString().toLowerCase().equals("true"));
}

private void setOrderProperty(VPAction action, VPContext context, ActionEvent event) {
if(context.getModelElement() == null) {
return ;
}

final IClass _class = (IClass) context.getModelElement();
ITaggedValueContainer container = _class.getTaggedValues();
Iterator<?> values = container == null ? null : container.taggedValueIterator();
final ITaggedValue orderValue = getValueToBeSet(context, StereotypeUtils.PROPERTY_ORDER);

if(!_class.hasStereotype(StereotypeUtils.STR_TYPE)){
return ;
}

// Searches for tagged value
ITaggedValue orderValue = null;
while(values != null && values.hasNext()) {
final ITaggedValue value = (ITaggedValue) values.next();

if(value.getName().equals("order")) {
orderValue = value;
break ;
}
}

// Adds missing tagged value
if(orderValue == null) {
// Reset stereotype's tagged values
if(StereotypeUtils.STEREOTYPE_ELEMENTS == null) { StereotypeUtils.generate(); }

if(_class.getTaggedValues() != null) {
ITaggedValueContainer c = _class.getTaggedValues();
_class.setTaggedValues(null);
c.delete();
}

_class.removeStereotype(StereotypeUtils.STR_TYPE);
_class.addStereotype(StereotypeUtils.STEREOTYPE_ELEMENTS.get(StereotypeUtils.STR_TYPE));

StereotypeUtils.setAllowed(_class, StereotypeUtils.STR_TYPE);

// Searches for the tagged value just added
container = _class.getTaggedValues();
values = container == null ? null : container.taggedValueIterator();

while(values != null && values.hasNext()) {
final ITaggedValue value = (ITaggedValue) values.next();

if(value.getName().equals("order")) {
orderValue = value;
break ;
}
}
return ;
}

final ViewManager vm = ApplicationManager.instance().getViewManager();
Expand Down Expand Up @@ -344,7 +186,7 @@ public void update(VPAction action, VPContext context) {
while(values != null && values.hasNext()) {
final ITaggedValue value = (ITaggedValue) values.next();

if(value.getName().equals("isExtensional")) {
if(value.getName().equals(StereotypeUtils.PROPERTY_IS_EXTENSIONAL)) {
action.setEnabled(true);
action.setSelected(value.getValueAsString().toLowerCase().equals("true"));
return;
Expand All @@ -358,7 +200,7 @@ public void update(VPAction action, VPContext context) {
while(values != null && values.hasNext()) {
final ITaggedValue value = (ITaggedValue) values.next();

if(value.getName().equals("isPowertype")) {
if(value.getName().equals(StereotypeUtils.PROPERTY_IS_POWERTYPE)) {
action.setEnabled(true);
action.setSelected(value.getValueAsString().toLowerCase().equals("true"));
return;
Expand Down
Loading