]> gerrit.simantics Code Review - simantics/interop.git/commitdiff
Cleaning up compiler warnings
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 1 Sep 2011 08:54:15 +0000 (08:54 +0000)
committerMarko Luukkainen <marko.luukkainen@vtt.fi>
Thu, 2 Feb 2017 09:22:15 +0000 (11:22 +0200)
git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@22018 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.interop/src/org/simantics/interop/browsing/ImportNode.java
org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java
org.simantics.interop/src/org/simantics/interop/browsing/InteropChildRule.java
org.simantics.interop/src/org/simantics/interop/handlers/Contributor1.java
org.simantics.interop/src/org/simantics/interop/handlers/Contributor2.java
org.simantics.interop/src/org/simantics/interop/handlers/EvaluatorFactory1.java
org.simantics.interop/src/org/simantics/interop/ui/IssuesViewPart.java
org.simantics.interop/src/org/simantics/interop/utils/StringColumnComparator.java

index 51ef7e97e8934cd80b8502ff8714d16a833ab70a..496eb9b12c7c00d29033346dba4f4e8cafb17c88 100644 (file)
@@ -14,9 +14,9 @@ import org.simantics.db.WriteGraph;
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.interop.Activator;\r
 import org.simantics.interop.stubs.InteropResource;\r
-import org.simantics.layer0.Layer0;\r
 import org.simantics.modeling.ui.modelBrowser.model.INode;\r
 \r
+@SuppressWarnings("deprecation")\r
 public class ImportNode implements INode {\r
        \r
        //private Resource project;\r
@@ -26,6 +26,7 @@ public class ImportNode implements INode {
                this.model = project;\r
        }\r
        \r
+       @SuppressWarnings("rawtypes")\r
        @Override\r
        public Object getAdapter(Class adapter) {\r
                return null;\r
@@ -73,19 +74,8 @@ public class ImportNode implements INode {
        @Override\r
        public Collection<?> getChildren(ReadGraph graph) throws DatabaseException {\r
                List<INode> nodes = new ArrayList<INode>();\r
-               Layer0 l0 = Layer0.getInstance(graph);\r
                InteropResource i = InteropResource.getInstance(graph);\r
-//             Collection<Resource> models = graph.getObjects(project, b.ConsistsOf);\r
-//             for (Resource m : models) {\r
-//                     Collection<Resource> objs = graph.getObjects(m, b.ConsistsOf);\r
-//                     for (Resource o : objs) {\r
-//                             if (graph.isInstanceOf(o, i.ImportLibrary)) {\r
-//                                     INode node = graph.adapt(o, INode.class);\r
-//                                     nodes.add(node);\r
-//                             }\r
-//                     }\r
-//             }\r
-               //Collection<Resource> objs = graph.getObjects(model, b.ConsistsOf);\r
+               \r
                Collection<Resource> objs = graph.getObjects(model, i.HasImportData);\r
                for (Resource o : objs) {\r
                        if (graph.isInstanceOf(o, i.ImportLibrary)) {\r
@@ -95,22 +85,6 @@ public class ImportNode implements INode {
                }\r
                return nodes;\r
                \r
-//             ComosResource c = ComosResource.getInstance(graph);\r
-//             Collection<Resource> models = graph.getObjects(project, b.ConsistsOf);\r
-//             Collection<ComosGraphNode> comosImports = new ArrayList<ComosGraphNode>();\r
-//             for (Resource m : models) {\r
-//                     Collection<Resource> objs = graph.getObjects(m, b.ConsistsOf);\r
-//                     for (Resource o : objs) {\r
-//                             if (graph.isInstanceOf(o, c.ComosImportLibrary)) {\r
-//                                     String icon_db_path = ComosGraphTools.getIconPath(o, graph);\r
-//                                     if (icon_db_path == null)\r
-//                                             continue;\r
-//                                     ComosIconReader iconReader = new ComosIconReader(icon_db_path);\r
-//                                     comosImports.add(new ComosGraphNode(o, iconReader));\r
-//                             }\r
-//                     }\r
-//             }\r
-//             return comosImports;\r
        }\r
        \r
 \r
index 8bb6d7492747cf5e15e93a6fec807fa46e8fb2f1..54a8adaef71298bef19509f12e241ad7570b87c6 100644 (file)
@@ -14,9 +14,9 @@ import org.simantics.db.WriteGraph;
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.interop.Activator;\r
 import org.simantics.interop.stubs.InteropResource;\r
-import org.simantics.layer0.Layer0;\r
 import org.simantics.modeling.ui.modelBrowser.model.INode;\r
 \r
+@SuppressWarnings("deprecation")\r
 public class ImportNode2 implements INode {\r
        \r
        private Resource project;\r
@@ -25,6 +25,7 @@ public class ImportNode2 implements INode {
                this.project = project;\r
        }\r
        \r
+       @SuppressWarnings("rawtypes")\r
        @Override\r
        public Object getAdapter(Class adapter) {\r
                return null;\r
@@ -72,19 +73,8 @@ public class ImportNode2 implements INode {
        @Override\r
        public Collection<?> getChildren(ReadGraph graph) throws DatabaseException {\r
                List<INode> nodes = new ArrayList<INode>();\r
-               Layer0 l0 = Layer0.getInstance(graph);\r
                InteropResource i = InteropResource.getInstance(graph);\r
-//             Collection<Resource> models = graph.getObjects(project, b.ConsistsOf);\r
-//             for (Resource m : models) {\r
-//                     Collection<Resource> objs = graph.getObjects(m, b.ConsistsOf);\r
-//                     for (Resource o : objs) {\r
-//                             if (graph.isInstanceOf(o, i.ImportLibrary)) {\r
-//                                     INode node = graph.adapt(o, INode.class);\r
-//                                     nodes.add(node);\r
-//                             }\r
-//                     }\r
-//             }\r
-               //Collection<Resource> objs = graph.getObjects(project, b.ConsistsOf);\r
+\r
                Collection<Resource> objs = graph.getObjects(project, i.HasImportData);\r
                for (Resource o : objs) {\r
                        if (graph.isInstanceOf(o, i.ImportLibrary)) {\r
@@ -93,23 +83,7 @@ public class ImportNode2 implements INode {
                        }\r
                }\r
                return nodes;\r
-               \r
-//             ComosResource c = ComosResource.getInstance(graph);\r
-//             Collection<Resource> models = graph.getObjects(project, b.ConsistsOf);\r
-//             Collection<ComosGraphNode> comosImports = new ArrayList<ComosGraphNode>();\r
-//             for (Resource m : models) {\r
-//                     Collection<Resource> objs = graph.getObjects(m, b.ConsistsOf);\r
-//                     for (Resource o : objs) {\r
-//                             if (graph.isInstanceOf(o, c.ComosImportLibrary)) {\r
-//                                     String icon_db_path = ComosGraphTools.getIconPath(o, graph);\r
-//                                     if (icon_db_path == null)\r
-//                                             continue;\r
-//                                     ComosIconReader iconReader = new ComosIconReader(icon_db_path);\r
-//                                     comosImports.add(new ComosGraphNode(o, iconReader));\r
-//                             }\r
-//                     }\r
-//             }\r
-//             return comosImports;\r
+\r
        }\r
        \r
 \r
index 3b6d25ea42e615eb371e7658f4229f39e75f47f4..cf889aabcd3724ca0ed42f1e899d209168592f18 100644 (file)
@@ -9,16 +9,15 @@ import org.simantics.browsing.ui.model.children.ChildRule;
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
 import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.interop.stubs.InteropResource;\r
-import org.simantics.layer0.Layer0;\r
 import org.simantics.modeling.ui.modelBrowser.model.INode;\r
 \r
+@SuppressWarnings("deprecation")\r
 public class InteropChildRule implements ChildRule{\r
        @Override\r
     public boolean isCompatible(Class<?> contentType) {\r
         return Resource.class.isAssignableFrom(contentType);\r
     }\r
-    @Override\r
+       @Override\r
     public Collection<?> getChildren(ReadGraph graph, Object parent_)\r
             throws DatabaseException {\r
         Resource parent = (Resource)parent_;\r
index 2ca43914bfaf8fc3f7a11f2897950d2f45217c4b..7e0344b97265a92c621dbb6bb7d3ec454a343e2d 100644 (file)
@@ -5,14 +5,13 @@ import java.util.Collection;
 \r
 import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor;\r
 import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.interop.browsing.ImportNode;\r
-import org.simantics.layer0.utils.direct.GraphUtils;\r
 import org.simantics.modeling.ui.modelBrowser.model.INode;\r
 import org.simantics.structural.ui.modelBrowser.nodes.ModelNode;\r
 \r
 \r
+@SuppressWarnings("deprecation")\r
 public class Contributor1 extends ViewpointContributor<ModelNode> {\r
 \r
        \r
@@ -23,7 +22,6 @@ public class Contributor1 extends ViewpointContributor<ModelNode> {
        public Collection<?> getContribution(ReadGraph graph, ModelNode input)\r
                        throws DatabaseException {\r
                Collection<INode> nodes = new ArrayList<INode>();\r
-               System.out.println("Contributor 1 " + input + " " + GraphUtils.getReadableName(graph, input.resource));\r
                nodes.add(new ImportNode(input.resource));\r
                return nodes;\r
        }\r
@@ -36,26 +34,4 @@ public class Contributor1 extends ViewpointContributor<ModelNode> {
        \r
 \r
 }\r
-//public class Contributor1 extends ViewpointContributor<Resource> {\r
-//\r
-//     \r
-//     public Contributor1() {\r
-//             super();\r
-//     }\r
-//     @Override\r
-//     public Collection<?> getContribution(ReadGraph graph, Resource input)\r
-//                     throws DatabaseException {\r
-//             Collection<INode> nodes = new ArrayList<INode>();\r
-//             System.out.println("Contributor 1 " + input + " " + GraphUtils.getReadableName(graph, input));\r
-//             nodes.add(new ImportNode(input));\r
-//             return nodes;\r
-//     }\r
-//     \r
-//     @Override\r
-//     public String getViewpointId() {\r
-//             return "Standard";\r
-//     }\r
-//     \r
-//     \r
-//\r
-//}\r
+\r
index cc9f838af1a4956e4e8f1887217a78867304da14..89315547536da95406ef99e2b78c7ea9f74e4e9b 100644 (file)
@@ -8,10 +8,10 @@ import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.interop.browsing.ImportNode2;\r
-import org.simantics.layer0.utils.direct.GraphUtils;\r
 import org.simantics.modeling.ui.modelBrowser.model.INode;\r
 \r
 \r
+@SuppressWarnings("deprecation")\r
 public class Contributor2 extends ViewpointContributor<Resource> {\r
 \r
        \r
@@ -22,7 +22,6 @@ public class Contributor2 extends ViewpointContributor<Resource> {
        public Collection<?> getContribution(ReadGraph graph, Resource input)\r
                        throws DatabaseException {\r
                Collection<INode> nodes = new ArrayList<INode>();\r
-               System.out.println("Contributor 2 " + input + " " + GraphUtils.getReadableName(graph, input));\r
                nodes.add(new ImportNode2(input));\r
                return nodes;\r
        }\r
index 7b26fccd4bc86e6589f0f30ff5139747f76e878e..aa9b72ef8b0e392cb630323d26b8302729ab660c 100644 (file)
@@ -2,19 +2,15 @@ package org.simantics.interop.handlers;
 \r
 import java.util.Collection;\r
 \r
-import org.eclipse.jface.resource.JFaceResources;\r
-import org.eclipse.jface.resource.LocalResourceManager;\r
-import org.eclipse.swt.widgets.Display;\r
 import org.simantics.browsing.ui.common.EvaluatorData.Evaluator;\r
 import org.simantics.browsing.ui.common.extension.EvaluatorFactory;\r
 import org.simantics.modeling.ui.modelBrowser.ModelEvaluators;\r
 import org.simantics.modeling.ui.modelBrowser.model.INode;\r
-import org.simantics.ui.SimanticsUI;\r
 \r
+@SuppressWarnings("deprecation")\r
 public class EvaluatorFactory1 implements EvaluatorFactory {\r
 \r
        public EvaluatorFactory1() {\r
-               // TODO Auto-generated constructor stub\r
        }\r
        \r
        @Override\r
index d9e7b6d5329da132a81b9c3c9eb4be3a88d6074b..a4816237a9f70c372c1e13c22b07a500d968c8c6 100644 (file)
@@ -107,6 +107,7 @@ public class IssuesViewPart extends ViewPart {
                }\r
                \r
                \r
+               @SuppressWarnings("unchecked")\r
                @Override\r
                public Object[] getElements(Object inputElement) {\r
                        Collection<Issue> issues = (Collection<Issue>)inputElement;\r
index 3dccbd411ee856c3541eedcb63cb58c6b3f5d34e..e2a338a8c2e963088d991d4d810706c84ec25403 100644 (file)
@@ -28,6 +28,7 @@ public class StringColumnComparator extends ViewerComparator {
                }\r
        }\r
        \r
+       @SuppressWarnings("unchecked")\r
        @Override\r
        public int compare(Viewer viewer, Object e1, Object e2) {\r
                \r