Skip to content

Commit

Permalink
Updated to use cst-bindings 1.0.4 and cst 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rgudwin committed May 25, 2022
1 parent 02e8a93 commit 5c6e930
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
```

Expand All @@ -57,7 +57,7 @@ Sometimes, the version number (tag) in this README gets out of date, as maintain
<dependency>
<groupId>com.github.CST-Group</groupId>
<artifactId>cst-desktop</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
</dependency>
```

Expand Down
4 changes: 2 additions & 2 deletions 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.2'
version = '1.0.3'

repositories {
flatDir {
Expand All @@ -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'
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/br/unicamp/cst/util/viewer/MindRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 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 @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
</SubComponents>
</Menu>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="3"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
Expand Down Expand Up @@ -83,7 +80,6 @@
<SubComponents>
<Container class="javax.swing.JToolBar" name="jToolBar1">
<Properties>
<Property name="floatable" type="boolean" value="false"/>
<Property name="rollover" type="boolean" value="true"/>
</Properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class IdeaEditor extends javax.swing.JFrame {
IdeaPanel wmp;
Idea root;
List<IdeaEditorListener> listeners;
public boolean finished = false;

/**
* Creates new form IdeaEditor
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand All @@ -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+"]");
Expand Down Expand Up @@ -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(""))
Expand Down
Binary file added src/main/resources/episode-p.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 src/main/resources/object-e.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 src/main/resources/object-p.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 src/main/resources/property-p.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5c6e930

Please sign in to comment.