From 3b2c08763597b818088df54bf12f2eccd3717695 Mon Sep 17 00:00:00 2001 From: Ricardo Gudwin Date: Fri, 28 Apr 2023 09:05:45 -0300 Subject: [PATCH] Changes in TreeElement and Icon comparisons --- build.gradle | 2 +- .../unicamp/cst/util/viewer/MindRenderer.java | 99 +------------------ .../unicamp/cst/util/viewer/TreeElement.java | 35 +++++++ .../idea/IdeaTreeNodeComparator.java | 19 ++++ 4 files changed, 59 insertions(+), 96 deletions(-) diff --git a/build.gradle b/build.gradle index 9cc15d8..a41b569 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ description = "CST-Desktop" sourceCompatibility = 1.8 targetCompatibility = 1.8 -version = '1.0.5' +version = '1.0.6' repositories { flatDir { 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 e7efd53..7f49a1d 100644 --- a/src/main/java/br/unicamp/cst/util/viewer/MindRenderer.java +++ b/src/main/java/br/unicamp/cst/util/viewer/MindRenderer.java @@ -51,101 +51,10 @@ public Component getTreeCellRendererComponent(JTree tree, Object value, boolean DefaultMutableTreeNode dmtn = (DefaultMutableTreeNode) value; DefaultMutableTreeNode objectNode; TreeElement node = (TreeElement) dmtn.getUserObject(); - switch (node.getIcon()) { - case TreeElement.ICON_COMPOSITE: - img = new ImageIcon(this.getClass().getClassLoader().getResource("object.png")); - break; - case TreeElement.ICON_AGGREGATE: - img = new ImageIcon(this.getClass().getClassLoader().getResource("object2.gif")); - break; - case TreeElement.ICON_PROPERTY: - img = new ImageIcon(this.getClass().getClassLoader().getResource("property.png")); - break; - case TreeElement.ICON_QUALITYDIM: - img = new ImageIcon(this.getClass().getClassLoader().getResource("qualityDim.png")); - break; - case TreeElement.ICON_VALUE: - img = new ImageIcon(this.getClass().getClassLoader().getResource("value.png")); - break; - default: - case TreeElement.ICON_MIND: - img = new ImageIcon(this.getClass().getClassLoader().getResource("mind.png")); - break; - case TreeElement.ICON_CODELET: - img = new ImageIcon(this.getClass().getClassLoader().getResource("codelet.png")); - break; - case TreeElement.ICON_CODELETS: - img = new ImageIcon(this.getClass().getClassLoader().getResource("codelets.png")); - break; - case TreeElement.ICON_MEMORY: - img = new ImageIcon(this.getClass().getClassLoader().getResource("memory.png")); - break; - case TreeElement.ICON_MEMORIES: - img = new ImageIcon(this.getClass().getClassLoader().getResource("memories.png")); - break; - case TreeElement.ICON_CONTAINER: - img = new ImageIcon(this.getClass().getClassLoader().getResource("container.png")); - break; - case TreeElement.ICON_MO: - img = new ImageIcon(this.getClass().getClassLoader().getResource("mo.png")); - break; - case TreeElement.ICON_INPUT: - img = new ImageIcon(this.getClass().getClassLoader().getResource("input.png")); - break; - case TreeElement.ICON_OUTPUT: - img = new ImageIcon(this.getClass().getClassLoader().getResource("output.png")); - break; - case TreeElement.ICON_BROADCAST: - img = new ImageIcon(this.getClass().getClassLoader().getResource("broadcast.png")); - break; - case TreeElement.ICON_AFFORDANCE: - img = new ImageIcon(this.getClass().getClassLoader().getResource("codelet2.png")); - break; - case TreeElement.ICON_OBJECT2: - img = new ImageIcon(this.getClass().getClassLoader().getResource("object2.png")); - break; - case TreeElement.ICON_OBJECT3: - img = new ImageIcon(this.getClass().getClassLoader().getResource("object3.png")); - break; - case TreeElement.ICON_CONFIGURATION: - img = new ImageIcon(this.getClass().getClassLoader().getResource("configuration.png")); - break; - case TreeElement.ICON_TIME: - img = new ImageIcon(this.getClass().getClassLoader().getResource("time-machine.png")); - break; - case TreeElement.ICON_PROPERTYCATEGORY: - img = new ImageIcon(this.getClass().getClassLoader().getResource("propertyCategory.png")); - break; - case TreeElement.ICON_OBJECTCATEGORY: - img = new ImageIcon(this.getClass().getClassLoader().getResource("objectCategory.png")); - 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; - case TreeElement.ICON_ACTIONPOSSIBILITY: - img = new ImageIcon(this.getClass().getClassLoader().getResource("action-p.png")); - break; - case TreeElement.ICON_ACTIONEXISTENCE: - img = new ImageIcon(this.getClass().getClassLoader().getResource("action-e.png")); - break; - case TreeElement.ICON_ACTIONCATEGORY: - img = new ImageIcon(this.getClass().getClassLoader().getResource("action-l.png")); - break; - case TreeElement.ICON_GOAL: - img = new ImageIcon(this.getClass().getClassLoader().getResource("goal.png")); - break; + img = new ImageIcon(this.getClass().getClassLoader().getResource("mind.png")); // This is the default img if not found anyone else + for (int i=0;i