diff --git a/README.md b/README.md index be5cb0c..6734fd9 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Note: This library is still under development, and some concepts or features mig ``` dependencies { ... - implementation 'com.github.CST-Group:cst-desktop:1.0.2' + implementation 'com.github.CST-Group:cst-desktop:1.0.3' } ``` @@ -57,7 +57,7 @@ Sometimes, the version number (tag) in this README gets out of date, as maintain com.github.CST-Group cst-desktop - 1.0.2 + 1.0.3 ``` diff --git a/build.gradle b/build.gradle index f3e827a..6130740 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ description = "CST-Desktop" sourceCompatibility = 1.8 targetCompatibility = 1.8 -version = '1.0.2' +version = '1.0.3' repositories { flatDir { @@ -35,7 +35,7 @@ configurations { dependencies { //api('com.github.CST-Group:cst:30fe97d') - api('com.github.CST-Group:cst-bindings:1.0.3') + api('com.github.CST-Group:cst-bindings:1.0.4') api group: 'org.jfree', name: 'jfreechart', version: '1.0.19' api 'com.soartech:jsoar-core:4.1.0' diff --git a/src/main/java/br/unicamp/cst/util/viewer/MindRenderer.java b/src/main/java/br/unicamp/cst/util/viewer/MindRenderer.java index a7caf30..63658c5 100644 --- a/src/main/java/br/unicamp/cst/util/viewer/MindRenderer.java +++ b/src/main/java/br/unicamp/cst/util/viewer/MindRenderer.java @@ -121,7 +121,19 @@ public Component getTreeCellRendererComponent(JTree tree, Object value, boolean break; case TreeElement.ICON_EPISODECATEGORY: img = new ImageIcon(this.getClass().getClassLoader().getResource("episodeCategory.png")); + break; + case TreeElement.ICON_PROPERTYPOSSIBILITY: + img = new ImageIcon(this.getClass().getClassLoader().getResource("property-p.png")); + break; + case TreeElement.ICON_OBJECTPOSSIBILITY: + img = new ImageIcon(this.getClass().getClassLoader().getResource("object-p.png")); + break; + case TreeElement.ICON_EPISODEPOSSIBILITY: + img = new ImageIcon(this.getClass().getClassLoader().getResource("episode-p.png")); break; + case TreeElement.ICON_OBJECTEXISTENCE: + img = new ImageIcon(this.getClass().getClassLoader().getResource("object-e.png")); + break; } setOpenIcon(img); setClosedIcon(img); diff --git a/src/main/java/br/unicamp/cst/util/viewer/TreeElement.java b/src/main/java/br/unicamp/cst/util/viewer/TreeElement.java index 80e64be..88c3d0c 100644 --- a/src/main/java/br/unicamp/cst/util/viewer/TreeElement.java +++ b/src/main/java/br/unicamp/cst/util/viewer/TreeElement.java @@ -55,6 +55,11 @@ public class TreeElement { public static final int ICON_PROPERTYCATEGORY = 21; public static final int ICON_OBJECTCATEGORY = 22; public static final int ICON_EPISODECATEGORY = 23; + public static final int ICON_PROPERTYPOSSIBILITY = 24; + public static final int ICON_OBJECTPOSSIBILITY = 25; + public static final int ICON_EPISODEPOSSIBILITY = 26; + public static final int ICON_OBJECTEXISTENCE = 27; + public TreeElement(String name, int node_type, Object element, int typeIcon) { diff --git a/src/main/java/br/unicamp/cst/util/viewer/representation/idea/IdeaEditor.form b/src/main/java/br/unicamp/cst/util/viewer/representation/idea/IdeaEditor.form index 45255c8..5a36f7e 100644 --- a/src/main/java/br/unicamp/cst/util/viewer/representation/idea/IdeaEditor.form +++ b/src/main/java/br/unicamp/cst/util/viewer/representation/idea/IdeaEditor.form @@ -43,9 +43,6 @@ - - - @@ -83,7 +80,6 @@ - diff --git a/src/main/java/br/unicamp/cst/util/viewer/representation/idea/IdeaEditor.java b/src/main/java/br/unicamp/cst/util/viewer/representation/idea/IdeaEditor.java index ed1e692..209c083 100644 --- a/src/main/java/br/unicamp/cst/util/viewer/representation/idea/IdeaEditor.java +++ b/src/main/java/br/unicamp/cst/util/viewer/representation/idea/IdeaEditor.java @@ -25,6 +25,7 @@ public class IdeaEditor extends javax.swing.JFrame { IdeaPanel wmp; Idea root; List listeners; + public boolean finished = false; /** * Creates new form IdeaEditor @@ -81,9 +82,6 @@ private void initComponents() { mClose = new javax.swing.JMenuItem(); jMenu2 = new javax.swing.JMenu(); - setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - - jToolBar1.setFloatable(false); jToolBar1.setRollover(true); zoom_in.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoom-in-icon.png"))); // NOI18N @@ -200,7 +198,10 @@ private void mSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:e private void mCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mCloseActionPerformed // TODO add your handling code here: - this.dispose(); + finished = true; + System.out.println("Setting finished to "+finished); + //this.dispose(); + //this.setVisible(false); }//GEN-LAST:event_mCloseActionPerformed private void mLoadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mLoadActionPerformed diff --git a/src/main/java/br/unicamp/cst/util/viewer/representation/idea/IdeaTreeNode.java b/src/main/java/br/unicamp/cst/util/viewer/representation/idea/IdeaTreeNode.java index 4ae02ca..73cc1f8 100644 --- a/src/main/java/br/unicamp/cst/util/viewer/representation/idea/IdeaTreeNode.java +++ b/src/main/java/br/unicamp/cst/util/viewer/representation/idea/IdeaTreeNode.java @@ -116,6 +116,15 @@ else if (category_type.equalsIgnoreCase("ObjectCategory")) { else if (category_type.equalsIgnoreCase("EpisodeCategory")) { node.setType(11); } + else if (category_type.equalsIgnoreCase("PropertyPossibility")) { + node.setType(12); + } + else if (category_type.equalsIgnoreCase("ObjectPossibility")) { + node.setType(13); + } + else if (category_type.equalsIgnoreCase("EpisodePossibility")) { + node.setType(14); + } } } @@ -127,7 +136,7 @@ public void representIdea(Idea node) { switch(node.getType()) { case 0: // This type is for Idea objects if (te.getIcon() != TreeElement.ICON_MIND) - te.setIcon(TreeElement.ICON_OBJECT3); + te.setIcon(TreeElement.ICON_OBJECTEXISTENCE); if (value.equalsIgnoreCase("")) te.setName(node.getName()); else te.setName(node.getName()+" ["+value+"]"); @@ -208,7 +217,28 @@ public void representIdea(Idea node) { if (value.equalsIgnoreCase("")) te.setName(node.getName()); else te.setName(node.getName()+" ["+value+"]"); + break; + case 12: // This type is for a PropertyCategory + if (te.getIcon() != TreeElement.ICON_MIND) + te.setIcon(TreeElement.ICON_PROPERTYPOSSIBILITY); + if (value.equalsIgnoreCase("")) + te.setName(node.getName()); + else te.setName(node.getName()+": "+value); break; + case 13: // This type is for a ObjectCategory + if (te.getIcon() != TreeElement.ICON_MIND) + te.setIcon(TreeElement.ICON_OBJECTPOSSIBILITY); + if (value.equalsIgnoreCase("")) + te.setName(node.getName()); + else te.setName(node.getName()+" ["+value+"]"); + break; + case 14: // This type is for a EpisodeCategory + if (te.getIcon() != TreeElement.ICON_MIND) + te.setIcon(TreeElement.ICON_EPISODEPOSSIBILITY); + if (value.equalsIgnoreCase("")) + te.setName(node.getName()); + else te.setName(node.getName()+" ["+value+"]"); + break; default: if (te.getIcon() != TreeElement.ICON_MIND) te.setIcon(TreeElement.ICON_OBJECT3); if (value.equalsIgnoreCase("")) diff --git a/src/main/resources/episode-p.png b/src/main/resources/episode-p.png new file mode 100644 index 0000000..eae3d13 Binary files /dev/null and b/src/main/resources/episode-p.png differ diff --git a/src/main/resources/object-e.png b/src/main/resources/object-e.png new file mode 100644 index 0000000..9c1d610 Binary files /dev/null and b/src/main/resources/object-e.png differ diff --git a/src/main/resources/object-p.png b/src/main/resources/object-p.png new file mode 100644 index 0000000..b935005 Binary files /dev/null and b/src/main/resources/object-p.png differ diff --git a/src/main/resources/property-p.png b/src/main/resources/property-p.png new file mode 100644 index 0000000..5e36c1d Binary files /dev/null and b/src/main/resources/property-p.png differ