Skip to content

Commit

Permalink
changes in gradle version to make it compatible with JDK 19
Browse files Browse the repository at this point in the history
  • Loading branch information
rgudwin committed Mar 22, 2023
1 parent af5f673 commit 2d5279b
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "CST-Desktop"

sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '1.0.4'
version = '1.0.5'

repositories {
flatDir {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
15 changes: 10 additions & 5 deletions src/main/java/br/unicamp/cst/util/viewer/MemoryInspector.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,15 @@ public void updateAbstractObject(AbstractObject ao, String name, boolean setvalu
}

public void updateIdea(Idea ao, String name) {
if (ao.getType() == 1) updateString(ao.getValue().toString(),name);
else {
if (!ao.getName().equals(ToString.getSimpleName(name))) updateString(ao.getName(),name);
else updateString("",name);
}
// if (ao.getType() == 1) updateString(ao.getValue().toString(),name);
// else {
// if (!ao.getName().equals(ToString.getSimpleName(name))) updateString(ao.getName(),name);
// else updateString("",name);
// }
String bracketvalue = "";
if (!ao.getValue().equals("")) bracketvalue = " ["+ao.getValue()+"]";
if (!ao.getName().equals(ToString.getSimpleName(name))) updateString(ao.getName()+bracketvalue,name);
else updateString(ao.getValue().toString(),name);
List<Idea> parts = ao.getL();
for (Idea oo : parts) {
updateIdea(oo,name+"."+oo.getName());
Expand All @@ -256,6 +260,7 @@ public void updateIdea(Idea ao, String name) {

public void updateObject(Object o, String name) {
if (!nodeAlreadyExists(name)) {
System.out.println("Trying to include node with type "+o.getClass().getName()+" with name "+name);
includeNode(o,name);
return;
}
Expand Down
15 changes: 4 additions & 11 deletions src/main/java/br/unicamp/cst/util/viewer/ObjectTreeNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import br.unicamp.cst.representation.owrl.QualityDimension;
import br.unicamp.cst.representation.idea.Idea;
import br.unicamp.cst.support.ToString;
import br.unicamp.cst.util.viewer.representation.idea.IdeaTreeNode;

import java.lang.reflect.Array;
import java.lang.reflect.Field;
Expand All @@ -24,6 +25,7 @@
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeNode;

/**
*
Expand Down Expand Up @@ -210,21 +212,12 @@ private DefaultMutableTreeNode addAffordance(String fullname, Affordance a) {

private DefaultMutableTreeNode addIdea(String fullname, Idea wo) {
DefaultMutableTreeNode objectNode;
switch(wo.getType()) {
default:
case 0: objectNode = addItem(fullname,wo.getValue().toString(),wo,TreeElement.ICON_OBJECT3);
break;
case 1: objectNode = addItem(fullname,wo.getValue().toString(),wo,TreeElement.ICON_QUALITYDIM);
break;
case 2: objectNode = addItem(fullname,wo.getValue().toString(),wo,TreeElement.ICON_OBJECT2);
break;
}
if (wo.getType() == 0)
objectNode = addItem(fullname,wo.getValue().toString(),wo,TreeElement.iconByType(wo.getType()));
for (Idea oo : wo.getL()) {
DefaultMutableTreeNode part = addIdea(fullname+"."+oo.getName(),oo);
objectNode.add(part);
}
return(objectNode);
}
}

}
21 changes: 21 additions & 0 deletions src/main/java/br/unicamp/cst/util/viewer/TreeElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,26 @@ public void setId_node(int id_node) {
this.id_node = id_node;
}

public static int iconByType(int type) {
switch(type) {
case 0: return(ICON_OBJECTEXISTENCE);
case 1: return(ICON_PROPERTY);
case 2: return(ICON_OBJECT2);
case 3: return(ICON_QUALITYDIM);
case 4: return(ICON_AFFORDANCE);
case 5: return(ICON_COMPOSITE);
case 6: return(ICON_AGGREGATE);
case 7: return(ICON_CONFIGURATION);
case 8: return(ICON_TIME);
case 9: return(ICON_PROPERTYCATEGORY);
case 10: return(ICON_OBJECTCATEGORY);
case 11: return(ICON_EPISODECATEGORY);
case 12: return(ICON_PROPERTYPOSSIBILITY);
case 13: return(ICON_OBJECTPOSSIBILITY);
case 14: return(ICON_EPISODEPOSSIBILITY);
default: return(ICON_OBJECT3);
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ public IdeaTreeNode(Idea idea) {
representIdea(idea);
}

public IdeaTreeNode(String fullname, Idea idea) {
super(new TreeElement(fullname+"."+idea.getName(),TreeElement.NODE_NORMAL,idea,TreeElement.ICON_OBJECT3));
for (Idea i : idea.getL()) {
IdeaTreeNode ntn = new IdeaTreeNode(fullname+"."+idea.getName(),i);
add(ntn);
}
representIdea(idea);
}

public IdeaTreeNode addRootNode(String rootNodeName) {
Idea rootWM = Idea.createIdea(rootNodeName,"",0);
IdeaTreeNode root = new IdeaTreeNode(rootNodeName, TreeElement.NODE_NORMAL, rootWM, TreeElement.ICON_MIND);
Expand Down

0 comments on commit 2d5279b

Please sign in to comment.