]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Compiler warning elimination 60/3460/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Wed, 6 Nov 2019 13:07:21 +0000 (15:07 +0200)
committerReino Ruusu <reino.ruusu@semantum.fi>
Wed, 6 Nov 2019 13:07:21 +0000 (15:07 +0200)
Switch Java 1.6 with 1.8
Disable Java nature in pure binary bundles

Change-Id: I47d0344ffe9c2a924f2a4a72fae6cfd478bee121

90 files changed:
.project [new file with mode: 0644]
org.jcae.opencascade.win32.x86_64/.project
org.jcae.opencascade.win32.x86_64/META-INF/MANIFEST.MF
org.jcae.opencascade.win32.x86_64/build.properties
org.jcae.opencascade/META-INF/MANIFEST.MF
org.simantics.g3d.csg.ontology/.classpath
org.simantics.g3d.csg.ontology/.settings/org.eclipse.jdt.core.prefs
org.simantics.g3d.csg.ontology/META-INF/MANIFEST.MF
org.simantics.g3d.csg/.classpath
org.simantics.g3d.csg/.settings/org.eclipse.jdt.core.prefs
org.simantics.g3d.csg/META-INF/MANIFEST.MF
org.simantics.g3d.csg/src/org/simantics/g3d/csg/adapters/CSGSolidModelAdapter.java
org.simantics.g3d.csg/src/org/simantics/g3d/csg/editor/CSGEditor2.java
org.simantics.g3d.csg/src/org/simantics/g3d/csg/editor/CSGNodeMap.java
org.simantics.g3d.csg/src/org/simantics/g3d/csg/scenegraph2/CSGparentNode.java
org.simantics.g3d.csg/src/org/simantics/g3d/csg/scenegraph2/CSGrootNode.java
org.simantics.g3d.ontology/.classpath
org.simantics.g3d.ontology/.settings/org.eclipse.jdt.core.prefs
org.simantics.g3d.ontology/META-INF/MANIFEST.MF
org.simantics.g3d.vtk/.classpath
org.simantics.g3d.vtk/META-INF/MANIFEST.MF
org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/action/RemoveAction.java
org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/awt/RotateAction.java
org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/awt/TranslateAction.java
org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/AbstractVTKNodeMap.java
org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/HoverHighlighter.java
org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/NodeSelectionProvider2.java
org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/SelectionHighlighter.java
org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/VTKContentOutlinePage.java
org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/VTKNodeMap.java
org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/VTKSelectionItem.java
org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/shape/vtkShape.java
org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/swt/InteractiveVtkComposite.java
org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/swt/RotateAction.java
org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/swt/TranslateAction.java
org.simantics.g3d/.classpath
org.simantics.g3d/.settings/org.eclipse.jdt.core.prefs
org.simantics.g3d/META-INF/MANIFEST.MF
org.simantics.g3d/src/org/simantics/g3d/property/AnnotatedPropertyTabContributorFactory.java
org.simantics.g3d/src/org/simantics/g3d/property/MethodWithMapValueProvider.java
org.simantics.g3d/src/org/simantics/g3d/scenegraph/G3DNode.java
org.simantics.g3d/src/org/simantics/g3d/scenegraph/G3DparentNode.java
org.simantics.g3d/src/org/simantics/g3d/scenegraph/base/Node.java
org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/ComponentNode.java
org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/Connection.java
org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/G3DComponentNode.java
org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/G3DStructuralParentNode.java
org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/IComponentNode.java
org.simantics.g3d/src/org/simantics/g3d/scl/SCLUtil.java
org.simantics.g3d/src/org/simantics/g3d/scl/ScriptNodeMap.java
org.simantics.g3d/src/org/simantics/g3d/wizard/ModelExportWizardPage.java
org.simantics.opencascade.vtk/.classpath
org.simantics.opencascade.vtk/.settings/org.eclipse.jdt.core.prefs
org.simantics.opencascade.vtk/META-INF/MANIFEST.MF
org.simantics.opencascade.vtk/src/org/simantics/opencascade/vtk/VTKOCCTool.java
org.simantics.opencascade/.classpath
org.simantics.opencascade/.settings/org.eclipse.jdt.core.prefs
org.simantics.opencascade/META-INF/MANIFEST.MF
org.simantics.plant3d.ontology/.classpath
org.simantics.plant3d.ontology/.settings/org.eclipse.jdt.core.prefs
org.simantics.plant3d.ontology/META-INF/MANIFEST.MF
org.simantics.plant3d.product/.project
org.simantics.plant3d.product/META-INF/MANIFEST.MF
org.simantics.plant3d.product/build.properties
org.simantics.plant3d.product/src/org/simantics/plant3d/product/Activator.java [deleted file]
org.simantics.plant3d/.classpath
org.simantics.plant3d/META-INF/MANIFEST.MF
org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java
org.simantics.plant3d/src/org/simantics/plant3d/actions/RemoveAndSplitAction.java
org.simantics.plant3d/src/org/simantics/plant3d/actions/RoutePipeAction.java
org.simantics.plant3d/src/org/simantics/plant3d/actions/TranslateFreeVariableLengthAction.java
org.simantics.plant3d/src/org/simantics/plant3d/actions/TranslateInlineAction.java
org.simantics.plant3d/src/org/simantics/plant3d/browser/P3DBrowser.java
org.simantics.plant3d/src/org/simantics/plant3d/dialog/ComponentContentProvider.java
org.simantics.plant3d/src/org/simantics/plant3d/editor/P3DNodeMap.java
org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java
org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/P3DParentNode.java
org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/P3DRootNode.java
org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/ParameterizedNode.java
org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/PipeRun.java
org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/PipelineComponent.java
org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java
org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java
org.simantics.plant3d/src/org/simantics/plant3d/utils/P3DUtil.java
vtk.rendering.win32.win32.x86_64/.project
vtk.rendering.win32.win32.x86_64/build.properties
vtk.rendering/src/vtk/rendering/swt/vtkSwtInteractorForwarderDecorator.java
vtk.rendering/src/vtk/rendering/vtkAbstractComponent.java
vtk.win32.win32.x86_64/.project
vtk.win32.win32.x86_64/build.properties

diff --git a/.project b/.project
new file mode 100644 (file)
index 0000000..78c264c
--- /dev/null
+++ b/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<projectDescription>\r
+       <name>3d</name>\r
+       <comment></comment>\r
+       <projects>\r
+       </projects>\r
+       <buildSpec>\r
+               <buildCommand>\r
+                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+       </buildSpec>\r
+       <natures>\r
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
+       </natures>\r
+</projectDescription>\r
index 254ed58564b9bed7ed0b9e77f872f303a05f745a..484a557c61a7223879cd0964a46b9982c8ef3b6e 100644 (file)
@@ -5,11 +5,6 @@
        <projects>\r
        </projects>\r
        <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.jdt.core.javabuilder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
                <buildCommand>\r
                        <name>org.eclipse.pde.ManifestBuilder</name>\r
                        <arguments>\r
@@ -23,6 +18,5 @@
        </buildSpec>\r
        <natures>\r
                <nature>org.eclipse.pde.PluginNature</nature>\r
-               <nature>org.eclipse.jdt.core.javanature</nature>\r
        </natures>\r
 </projectDescription>\r
index 005a0031509bcfc307bfca72fe0956a844b49f1e..9eab8e0c19f3ae68039551ba9ace1e709c950ad4 100644 (file)
@@ -6,3 +6,4 @@ Bundle-Version: 7.3.0.qualifier
 Fragment-Host: org.jcae.opencascade;bundle-version="7.3.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Eclipse-PlatformFilter: (& (osgi.os=win32) (osgi.arch=x86_64))
+Automatic-Module-Name: org.jcae.opencascade.win32.x86_64
index 64c5d46d40d7d917f42f9c65af999e5f6d53ab17..d9144c833ed4f7501839adce8b6298d5dfce3ae7 100644 (file)
@@ -1,5 +1,4 @@
 
-output.. = bin/
 bin.includes = META-INF/,\
                .,\
                OccJava.dll,\
index 4be8c2cae2fdc3483d20f4f5706b13cdbde1e11e..d54c0feaf40fd4600fcde45a45002dfc81d8f224 100644 (file)
@@ -9,3 +9,4 @@ Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Export-Package: org.jcae.opencascade,
  org.jcae.opencascade.jni
+Automatic-Module-Name: org.jcae.opencascade
index 8a8f1668cdcc5c73a6921162616f01cb556ae7c1..b862a296d38fe04269faeee6c9d77d11ff77380d 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>\r
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
        <classpathentry kind="src" path="src"/>\r
        <classpathentry kind="output" path="bin"/>\r
index da2e9609fe5e33853541db91c1a5c66b44ed3287..295926d964165896ea8aa7c1b1b3c9d3d3caa77e 100644 (file)
@@ -1,8 +1,7 @@
-#Tue Dec 13 11:35:42 EET 2011\r
 eclipse.preferences.version=1\r
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\r
-org.eclipse.jdt.core.compiler.compliance=1.6\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8\r
+org.eclipse.jdt.core.compiler.compliance=1.8\r
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\r
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error\r
-org.eclipse.jdt.core.compiler.source=1.6\r
+org.eclipse.jdt.core.compiler.source=1.8\r
index 7fdef4a2806381d2494ffcc426241a3823231b56..aa284e2df0a89bafa8efbe0ab7aee49e93a07fe6 100644 (file)
@@ -13,5 +13,6 @@ Require-Bundle: org.eclipse.core.runtime,
  org.simantics.action.ontology;bundle-version="1.0.0",
  org.simantics.selectionview.ontology;bundle-version="1.0.0",
  org.simantics.simulation.ontology;bundle-version="1.0.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Export-Package: org.simantics.g3d.csg.ontology
+Automatic-Module-Name: org.simantics.g3d.csg.ontology
index 8a8f1668cdcc5c73a6921162616f01cb556ae7c1..b862a296d38fe04269faeee6c9d77d11ff77380d 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>\r
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
        <classpathentry kind="src" path="src"/>\r
        <classpathentry kind="output" path="bin"/>\r
index 56c2dc85b3cb118328a48369da24ecab8e8d313a..295926d964165896ea8aa7c1b1b3c9d3d3caa77e 100644 (file)
@@ -1,8 +1,7 @@
-#Mon Dec 12 16:51:11 EET 2011\r
 eclipse.preferences.version=1\r
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\r
-org.eclipse.jdt.core.compiler.compliance=1.6\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8\r
+org.eclipse.jdt.core.compiler.compliance=1.8\r
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\r
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error\r
-org.eclipse.jdt.core.compiler.source=1.6\r
+org.eclipse.jdt.core.compiler.source=1.8\r
index c2c209c92ee6a55bb5c3e13f29310f6478fd6a26..a1c042743519a2ba190b985881af7fd0ea5d2174 100644 (file)
@@ -22,7 +22,8 @@ Require-Bundle: org.eclipse.core.runtime,
  org.simantics.browsing.ui.common;bundle-version="1.1.0",
  org.simantics.objmap2;bundle-version="1.0.0",
  org.simantics.opencascade.vtk;bundle-version="1.0.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Bundle-ActivationPolicy: lazy
 Export-Package: org.simantics.g3d.csg.handler,
  org.simantics.g3d.csg.model
+Automatic-Module-Name: org.simantics.g3d.csg
index 972d797748980ba7055167ed7c192bde05f2c4db..2bfde870f6c2680810e2ff3e1b55b1acc646478a 100644 (file)
@@ -62,11 +62,10 @@ public class CSGSolidModelAdapter implements SolidModelProvider, IAdaptable, ISt
        \r
        }\r
        \r
-       @SuppressWarnings("rawtypes")\r
        @Override\r
-       public Object getAdapter(Class adapter) {\r
-               if (Resource.class.equals(adapter))\r
-                       return model;\r
+       public <C> C getAdapter(Class<C> adapter) {\r
+               if (adapter.isAssignableFrom(Resource.class))\r
+                       return adapter.cast(model);\r
                return null;\r
        }\r
        \r
index 3a85691b07a400eb0bca0ff97a7772cc76b59260..9716d200d26e89eeaa356b167698b519c9dbde8e 100644 (file)
@@ -54,7 +54,6 @@ import org.simantics.g3d.csg.scenegraph2.SchemaBuilder;
 import org.simantics.g3d.csg.scenegraph2.SphereNode;
 import org.simantics.g3d.csg.scenegraph2.TorusNode;
 import org.simantics.g3d.csg.scenegraph2.UnionNode;
-import org.simantics.g3d.scenegraph.IG3DNode;
 import org.simantics.g3d.scenegraph.NodeMap;
 import org.simantics.g3d.scenegraph.base.INode;
 import org.simantics.g3d.vtk.action.RemoveAction;
@@ -96,9 +95,9 @@ public class CSGEditor2  extends ResourceEditorPart {
        private SWTAWTComponent component;
        
        private CSGrootNode rootNode;
-       private IMapping<Resource,Object> mapping;
+       private IMapping<Resource, INode> mapping;
        
-       private NodeSelectionProvider2<Resource,Object> selectionProvider;
+       private NodeSelectionProvider2<Resource, INode> selectionProvider;
        
        private vtkCameraAndSelectorAction cameraAction;
        private TranslateAction translateAction;
@@ -174,12 +173,12 @@ public class CSGEditor2  extends ResourceEditorPart {
                                throw new RuntimeException("Scenegraph loading failed.");
                        populate();
                        
-                       selectionProvider = new NodeSelectionProvider2<Resource,Object>(this,mapping,nodeMap);
+                       selectionProvider = new NodeSelectionProvider2<Resource,INode>(this,mapping,nodeMap);
 
                        cameraAction.addSelectionChangedListener(selectionProvider);
 
-                       cameraAction.addHoverChangedListener(new HoverHighlighter(panel,nodeMap));
-                       selectionProvider.addSelectionChangedListener(new SelectionHighlighter(panel,nodeMap));
+                       cameraAction.addHoverChangedListener(new HoverHighlighter<Resource>(panel,nodeMap));
+                       selectionProvider.addSelectionChangedListener(new SelectionHighlighter<Resource>(panel,nodeMap));
                        
                        getSite().setSelectionProvider(selectionProvider);
                        getSite().getPage().addPostSelectionListener(selectionProvider);
@@ -215,11 +214,11 @@ public class CSGEditor2  extends ResourceEditorPart {
                translateAction = new TranslateAction(panel,nodeMap);
                rotateAction = new RotateAction(panel,nodeMap);
                removeAction = new RemoveAction(nodeMap) {
-                       public void setNode(IG3DNode node) {
+                       @Override
+                       public void setNode(INode node) {
                                super.setNode(node);
                                if (node.getParent() instanceof CSGparentNode)
                                        setEnabled(false);
-                               
                        }
                };
                
@@ -399,7 +398,7 @@ public class CSGEditor2  extends ResourceEditorPart {
        private IContentOutlinePage createOutline() {
                if (rootNode == null || selectionProvider == null)
                        return null;
-               IContentOutlinePage outlinePage = new VTKContentOutlinePage<Resource,Object>(rootNode, selectionProvider);
+               IContentOutlinePage outlinePage = new VTKContentOutlinePage<Resource,INode>(rootNode, selectionProvider);
                outlinePage.addSelectionChangedListener(new ISelectionChangedListener() {
                        
                        @Override
@@ -410,28 +409,27 @@ public class CSGEditor2  extends ResourceEditorPart {
                return outlinePage;
        }
 
-       @SuppressWarnings("rawtypes")
        @Override
-       public Object getAdapter(Class adapter) {
-               if (IPropertyPage.class.equals(adapter))
-                       return new StandardPropertyPage(getSite(),getPropertyContexts());
-               if (IContentOutlinePage.class.equals(adapter)) {
-                       return createOutline();
+       public <T> T getAdapter(Class<T> adapter) {
+               if (adapter.isAssignableFrom(IPropertyPage.class))
+                       return adapter.cast(new StandardPropertyPage(getSite(),getPropertyContexts()));
+               if (adapter.isAssignableFrom(IContentOutlinePage.class)) {
+                       return adapter.cast(createOutline());
                }
-               if (NodeMap.class.equals(adapter)) {
-                       return nodeMap;
+               if (adapter.isAssignableFrom(NodeMap.class)) {
+                       return adapter.cast(nodeMap);
                }
-               if (INode.class.equals(adapter)) {
-                       return rootNode;
+               if (adapter.isAssignableFrom(INode.class)) {
+                       return adapter.cast(rootNode);
                }
-               if (IMapping.class.equals(adapter)) {
-                       return mapping;
+               if (adapter.isAssignableFrom(IMapping.class)) {
+                       return adapter.cast(mapping);
                }
-               if (InteractiveVtkPanel.class.equals(adapter)) {
-                       return panel;
+               if (adapter.isAssignableFrom(InteractiveVtkPanel.class)) {
+                       return adapter.cast(panel);
                }
-               if (VtkView.class.equals(adapter))
-                       return panel;
+               if (adapter.isAssignableFrom(VtkView.class))
+                       return adapter.cast(panel);
                return super.getAdapter(adapter);
        }
        
index 48b710f606895b789ed8e8c7a7d52104c0d777dc..89d05585dd3ace98ca09a1470e68b9baffe9362d 100644 (file)
@@ -20,6 +20,7 @@ import org.simantics.db.Resource;
 import org.simantics.db.Session;
 import org.simantics.g3d.csg.scenegraph2.CSGrootNode;
 import org.simantics.g3d.csg.scenegraph2.ICSGnode;
+import org.simantics.g3d.scenegraph.base.INode;
 import org.simantics.g3d.scenegraph.base.ParentNode;
 import org.simantics.g3d.vtk.awt.InteractiveVtkPanel;
 import org.simantics.g3d.vtk.common.AbstractVTKNodeMap;
@@ -30,9 +31,7 @@ import vtk.vtkProp3D;
 
 public class CSGNodeMap extends AbstractVTKNodeMap<Resource,ICSGnode> {
        
-
-       
-       public CSGNodeMap(Session session, IMapping mapping, InteractiveVtkPanel panel, CSGrootNode rootNode) {
+       public CSGNodeMap(Session session, IMapping<Resource,INode> mapping, InteractiveVtkPanel panel, CSGrootNode rootNode) {
                super(session, mapping, panel, rootNode);
                rootNode.setNodeMap(this);
        }
index 6f83fdbfc095f4cc362d94647b69f9b75e81dadb..087ec522468a2f13e3a9354f0f09a246ee61aff8 100644 (file)
@@ -313,7 +313,7 @@ public abstract class CSGparentNode extends ParentNode<ICSGnode> implements ICSG
        }
 
        @Override
-       public Object getAdapter(Class adapter) {
+       public <C> C getAdapter(Class<C> adapter) {
                return null;
        }
 }
index 9ae55a1fe33458359f5105108362578d44c6e614..2f3a3cacd1ca527da125e26d7a027c995b9efcfe 100644 (file)
@@ -159,9 +159,9 @@ public class CSGrootNode extends ParentNode<ICSGnode> implements IG3DNode, NodeM
        
 
        @Override
-       public Object getAdapter(Class adapter) {
-               if (NodeMap.class == adapter)
-                       return nodeMap;
+       public <C> C getAdapter(Class<C> adapter) {
+               if (adapter.isAssignableFrom(NodeMap.class))
+                       return adapter.cast(nodeMap);
                return null;
        }
        
index 8a8f1668cdcc5c73a6921162616f01cb556ae7c1..b862a296d38fe04269faeee6c9d77d11ff77380d 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>\r
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
        <classpathentry kind="src" path="src"/>\r
        <classpathentry kind="output" path="bin"/>\r
index 5c42125f8fca502a397d24f611c79e64cacbdead..295926d964165896ea8aa7c1b1b3c9d3d3caa77e 100644 (file)
@@ -1,8 +1,7 @@
-#Mon Dec 12 12:36:09 EET 2011\r
 eclipse.preferences.version=1\r
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\r
-org.eclipse.jdt.core.compiler.compliance=1.6\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8\r
+org.eclipse.jdt.core.compiler.compliance=1.8\r
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\r
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error\r
-org.eclipse.jdt.core.compiler.source=1.6\r
+org.eclipse.jdt.core.compiler.source=1.8\r
index 2ce6eaf64c4ea185edd3945c8285faf0fd1c75f8..90b9b4e88268fad5b86a19959a5bf049013a582d 100644 (file)
@@ -6,5 +6,6 @@ Bundle-Version: 1.0.0.qualifier
 Bundle-Vendor: VTT
 Require-Bundle: org.eclipse.core.runtime,
  org.simantics.layer0;bundle-version="1.0.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Export-Package: org.simantics.g3d.ontology
+Automatic-Module-Name: org.simantics.g3d.ontology
index 8a8f1668cdcc5c73a6921162616f01cb556ae7c1..b862a296d38fe04269faeee6c9d77d11ff77380d 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>\r
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
        <classpathentry kind="src" path="src"/>\r
        <classpathentry kind="output" path="bin"/>\r
index 827e4638162a173e595f76e3e591171b99b9d833..e0a83e09297d5096f4266ca2f57dfd33c29f18b3 100644 (file)
@@ -31,3 +31,4 @@ Export-Package: org.simantics.g3d.vtk.action,
  org.simantics.g3d.vtk.shape,
  org.simantics.g3d.vtk.swt,
  org.simantics.g3d.vtk.utils
+Automatic-Module-Name: org.simantics.g3d.vtk
index 2ff89210f3657972e56a2ea5e855b4c617964738..926a75de780740a81a33bf6e40cd5a8a2b4c0c8b 100644 (file)
@@ -12,7 +12,6 @@
 package org.simantics.g3d.vtk.action;
 
 import org.eclipse.jface.action.Action;
-import org.simantics.g3d.scenegraph.IG3DNode;
 import org.simantics.g3d.scenegraph.base.INode;
 import org.simantics.g3d.scenegraph.structural.IStructuralNode;
 import org.simantics.g3d.vtk.Activator;
@@ -20,10 +19,10 @@ import org.simantics.g3d.vtk.common.VTKNodeMap;
 
 public class RemoveAction extends Action {
 
-       private VTKNodeMap nodeMap;
+       private VTKNodeMap<?, ? extends INode> nodeMap;
        protected INode node;
        
-       public RemoveAction(VTKNodeMap nodeMap) {
+       public RemoveAction(VTKNodeMap<?, ? extends INode> nodeMap) {
                setText("Remove");
                setImageDescriptor(Activator.imageDescriptorFromPlugin("com.famfamfam.silk", "icons/delete.png"));
                this.nodeMap = nodeMap;
index aaadc0ed413b05a312c2563bac777adf0aad657f..07d50797c007a41142af47dcf903055b74016faf 100644 (file)
@@ -26,6 +26,7 @@ import org.simantics.g3d.math.MathTools;
 import org.simantics.g3d.math.Ray;
 import org.simantics.g3d.preferences.PreferenceConstants;
 import org.simantics.g3d.scenegraph.IG3DNode;
+import org.simantics.g3d.scenegraph.base.INode;
 import org.simantics.g3d.scenegraph.structural.IStructuralNode;
 import org.simantics.g3d.vtk.Activator;
 import org.simantics.g3d.vtk.common.VTKNodeMap;
@@ -48,7 +49,7 @@ public class RotateAction extends vtkAwtAction{
        public static final int Z = 2;
        public static final int P = 3;
 
-       private VTKNodeMap nodeMap;
+       private VTKNodeMap<?,? extends INode> nodeMap;
        //private TranslateGizmo  gizmo = new TranslateGizmo();
        private RotateAxisGizmo gizmo = new RotateAxisGizmo();
        private IG3DNode node;
@@ -102,7 +103,7 @@ public class RotateAction extends vtkAwtAction{
                return node;
        }
        
-       public RotateAction(InteractiveVtkPanel panel, VTKNodeMap nodeMap) {
+       public RotateAction(InteractiveVtkPanel panel, VTKNodeMap<?,? extends INode> nodeMap) {
                super(panel);
                setImageDescriptor(Activator.imageDescriptorFromPlugin("com.famfamfam.silk", "icons/arrow_rotate_clockwise.png"));
                setText("Rotate");
index bb59c563cebc2b4d8f8e76c686e9b4d8d4e014f4..a5edf45d7ce0462bf6b777124b92f60f6a76e13a 100644 (file)
@@ -24,6 +24,7 @@ import javax.vecmath.Vector3d;
 import org.simantics.g3d.math.MathTools;
 import org.simantics.g3d.math.Ray;
 import org.simantics.g3d.scenegraph.IG3DNode;
+import org.simantics.g3d.scenegraph.base.INode;
 import org.simantics.g3d.scenegraph.structural.IStructuralNode;
 import org.simantics.g3d.vtk.Activator;
 import org.simantics.g3d.vtk.common.VTKNodeMap;
@@ -44,7 +45,7 @@ public class TranslateAction extends vtkAwtAction{
        public static final int YZ = 5;
        public static final int P = 6;
 
-       private VTKNodeMap nodeMap;
+       private VTKNodeMap<?, ? extends INode> nodeMap;
        //private TranslateGizmo  gizmo = new TranslateGizmo();
        private TranslateAxisGizmo gizmo = new TranslateAxisGizmo();
        protected IG3DNode node;
@@ -67,7 +68,7 @@ public class TranslateAction extends vtkAwtAction{
                return node;
        }
        
-       public TranslateAction(InteractiveVtkPanel panel, VTKNodeMap nodeMap) {
+       public TranslateAction(InteractiveVtkPanel panel, VTKNodeMap<?, ? extends INode> nodeMap) {
                super(panel);
                setImageDescriptor(Activator.imageDescriptorFromPlugin("com.famfamfam.silk", "icons/arrow_out.png"));
                setText("Translate");
index 0866dde55e730b6acaa82fd71d9de56abe983e4a..a03e89cbc8e1fc6273708686fa5fcc4174b95dde 100644 (file)
@@ -22,6 +22,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.Stack;
+import java.util.function.Consumer;
 
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Session;
@@ -40,7 +41,6 @@ import org.simantics.g3d.scenegraph.base.ParentNode;
 import org.simantics.objmap.exceptions.MappingException;
 import org.simantics.objmap.graph.IMapping;
 import org.simantics.objmap.graph.IMappingListener;
-import org.simantics.utils.datastructures.Callback;
 import org.simantics.utils.datastructures.MapList;
 import org.simantics.utils.datastructures.MapSet;
 import org.simantics.utils.datastructures.Pair;
@@ -109,7 +109,7 @@ public abstract class AbstractVTKNodeMap<DBObject,E extends INode> implements VT
        @SuppressWarnings("unchecked")
        @Override
        public Collection<vtkProp> getRenderObjects(INode node) {
-               return nodeToActor.getValues((E)node);
+               return nodeToActor.getValues((E) node);
        }
        
        protected <T extends vtkProp> void map(E node, Collection<T> props) {
@@ -127,7 +127,6 @@ public abstract class AbstractVTKNodeMap<DBObject,E extends INode> implements VT
            nodeToActor.remove(node);
        }
        
-       @SuppressWarnings("unchecked")
        @Override
        public ParentNode<E> getRootNode() {
                return (ParentNode<E>)rootNode;
@@ -188,12 +187,11 @@ public abstract class AbstractVTKNodeMap<DBObject,E extends INode> implements VT
                
        }
        
-       @SuppressWarnings("unchecked")
        @Override
        public void updateRenderObjectsFor(E node) {
                List<vtkProp> toDelete = new ArrayList<vtkProp>();
                view.lock();
-               for (vtkProp prop : nodeToActor.getValues((E)node)) {
+               for (vtkProp prop : nodeToActor.getValues(node)) {
                        if (prop.GetVTKId() != 0) {
                                view.getRenderer().RemoveActor(prop);
                                //prop.Delete();
@@ -202,12 +200,12 @@ public abstract class AbstractVTKNodeMap<DBObject,E extends INode> implements VT
                        actorToNode.remove(prop);
                }
                view.unlock();
-               nodeToActor.remove((E)node);
-               Collection<vtkProp> coll = getActors((E)node);
+               nodeToActor.remove(node);
+               Collection<vtkProp> coll = getActors(node);
                if (coll != null) {
                        for (vtkProp prop : coll) {
-                               nodeToActor.add((E)node,prop);
-                               actorToNode.put(prop, (E)node);
+                               nodeToActor.add(node,prop);
+                               actorToNode.put(prop, node);
                                toDelete.remove(prop);
                        }
                }
@@ -253,7 +251,6 @@ public abstract class AbstractVTKNodeMap<DBObject,E extends INode> implements VT
                repaint();
        }
        
-       @SuppressWarnings("unchecked")
        private void receiveUpdate(E node, String id, boolean db) {
                if (DEBUG) System.out.println("receiveUpdate " + debugString(node)  + " " + id + " " + db);
                synchronized (syncMutex) {
@@ -296,10 +293,10 @@ public abstract class AbstractVTKNodeMap<DBObject,E extends INode> implements VT
                                commit(graph);
                        }
                        
-               }, new Callback<DatabaseException>() {
+               }, new Consumer<DatabaseException>() {
                        
                        @Override
-                       public void run(DatabaseException parameter) {
+                       public void accept(DatabaseException parameter) {
                                if (parameter != null)
                                        ExceptionUtils.logAndShowError("Cannot commit editor changes", parameter);
                        }
@@ -326,7 +323,6 @@ public abstract class AbstractVTKNodeMap<DBObject,E extends INode> implements VT
                if (DEBUG)System.out.println("domainModified");
                session.asyncRequest(new ReadRequest() {
                        
-                       @SuppressWarnings("unchecked")
                        @Override
                        public void run(ReadGraph graph) throws DatabaseException {
                                update(graph);
@@ -416,6 +412,7 @@ public abstract class AbstractVTKNodeMap<DBObject,E extends INode> implements VT
         * This code here synchronizes removed and added objects to collect deletable objects. (a deletable object is one which is removed but not added).  
         * 
         */
+       @SuppressWarnings("unused")
        protected void syncDeletes() {
                deleteUC.clear();
                for (Pair<E, String> n : removed) {
@@ -437,6 +434,7 @@ public abstract class AbstractVTKNodeMap<DBObject,E extends INode> implements VT
        /**
         * Clears deletable objects from mapping cache.
         */
+       @SuppressWarnings("unused")
        protected void clearDeletes() {
                if (DEBUG && delete.size() > 0) System.out.println("Delete");
                for (E n : delete) {
index 7acb3f547adc3ced76f6e0e1932e69fcefbae73b..4a07d69629a2e337a57ffe47f897400d5c0f9b21 100644 (file)
 package org.simantics.g3d.vtk.common;
 
 import org.eclipse.jface.viewers.ISelection;
-import org.simantics.g3d.scenegraph.IG3DNode;
 import org.simantics.g3d.scenegraph.NodeHighlighter;
 import org.simantics.g3d.scenegraph.NodeHighlighter.HighlightEventType;
+import org.simantics.g3d.scenegraph.base.INode;
 
-public class HoverHighlighter extends SelectionHighlighter {
+public class HoverHighlighter<DBObject> extends SelectionHighlighter<DBObject> {
 
-
-       public HoverHighlighter(VtkView panel, VTKNodeMap nodeMap) {
+       public HoverHighlighter(VtkView panel, VTKNodeMap<DBObject,?> nodeMap) {
                super(panel, nodeMap);
-               
        }
        
+       @Override
        protected void highlight(ISelection s) {
                highlight(s, HighlightEventType.Hover, HighlightEventType.ClearHover);
        }
        
-       protected void hilight(IG3DNode node, HighlightEventType type) {
+       @Override
+       protected void hilight(INode node, HighlightEventType type) {
                if (node instanceof NodeHighlighter) {
                        ((NodeHighlighter)node).highlight(type);
                        return;
@@ -40,12 +40,14 @@ public class HoverHighlighter extends SelectionHighlighter {
                }
        }
 
-       protected void setDefaultColor(IG3DNode node) {
+       @Override
+       protected void setDefaultColor(INode node) {
                double color[] = new double[]{0,0,0};
                setColor(node, true, color);
        }
        
-       protected void setSelectedColor(IG3DNode node) {
+       @Override
+       protected void setSelectedColor(INode node) {
                double color[] = new double[]{1,0,1};
                setColor(node, true, color);
        }
index b9e3a0e8fc222f330e1e05e91156d945f7180ac3..db4710ed78933fac3883deaac6e6fdb0989f9a2b 100644 (file)
@@ -43,9 +43,9 @@ public class NodeSelectionProvider2<DBObject,JavaObject> implements ISelectionPr
        
        protected IEditorPart part;
        protected IMapping<DBObject,JavaObject> mapping;
-       protected VTKNodeMap nodeMap;
+       protected VTKNodeMap<DBObject, ? extends INode> nodeMap;
        
-       public NodeSelectionProvider2(IEditorPart part, IMapping<DBObject,JavaObject> mapping, VTKNodeMap nodeMap) {
+       public NodeSelectionProvider2(IEditorPart part, IMapping<DBObject,JavaObject> mapping, VTKNodeMap<DBObject, ? extends INode> nodeMap) {
                this.part = part;
                this.mapping = mapping;
                this.nodeMap = nodeMap;
@@ -78,6 +78,7 @@ public class NodeSelectionProvider2<DBObject,JavaObject> implements ISelectionPr
            } else if (resources.size() > 0) {
                nodes = new ArrayList<IG3DNode>();
                for (Resource r : resources) {
+                   @SuppressWarnings("unchecked")
                    JavaObject n  = mapping.get((DBObject)r);
                    if (n instanceof IG3DNode) {
                        nodes.add((IG3DNode)n);
@@ -101,7 +102,6 @@ public class NodeSelectionProvider2<DBObject,JavaObject> implements ISelectionPr
                fireSelectionChanged(event.getSource());
        }
        
-       @SuppressWarnings("unchecked")
        protected void processSelection(ISelection s) {
                selectedNodes.clear();
                selectedItems.clear();
@@ -112,11 +112,12 @@ public class NodeSelectionProvider2<DBObject,JavaObject> implements ISelectionPr
            Collection<vtkProp> selectedActors = AdaptationUtils.adaptToCollection(s, vtkProp.class);
         if (selectedActors.size() > 0) {
             for (vtkProp a : selectedActors) {
-                IG3DNode node = (IG3DNode)nodeMap.getNode((vtkProp)a);
+                INode node = nodeMap.getNode(a);
                 if (node == null)
                     continue;
                 if (!selectedNodes.contains(node))
                     selectedNodes.add(node);
+                @SuppressWarnings("unchecked")
                 DBObject r = mapping.inverseGet((JavaObject)node);
                 selectedItems.add(new VTKSelectionItem<DBObject>(a, node,r));
             }
@@ -125,6 +126,7 @@ public class NodeSelectionProvider2<DBObject,JavaObject> implements ISelectionPr
             for (INode node : selectedNds) {
                 if (!selectedNodes.contains(node))
                     selectedNodes.add((IG3DNode)node);
+                @SuppressWarnings("unchecked")
                 DBObject r = mapping.inverseGet((JavaObject)node);
                 selectedItems.add(new VTKSelectionItem<DBObject>(null, (IG3DNode)node,r));
             }
index 69ed83e2d2dea1857494b445e2635dc0e4ed127e..7aa2ad4d6ff5587fbd46ce825855cda10362d39d 100644 (file)
@@ -35,19 +35,17 @@ import vtk.vtkMapper;
 import vtk.vtkProp;
 import vtk.vtkProperty;
 
-public class SelectionHighlighter<DBObject, E extends INode> implements ISelectionChangedListener{
+public class SelectionHighlighter<DBObject> implements ISelectionChangedListener {
 
-       
-       
        protected VtkView panel;
-       protected VTKNodeMap<DBObject,E> nodeMap;
+       protected VTKNodeMap<DBObject,?> nodeMap;
        
        protected List<IG3DNode> selectedNodes = new ArrayList<IG3DNode>();
        protected List<vtkActor> selectedActors = new ArrayList<vtkActor>();
        
        protected HighlightObjectType type = HighlightObjectType.Node;
        
-       public SelectionHighlighter(VtkView panel, VTKNodeMap<DBObject,E> nodeMap) {
+       public SelectionHighlighter(VtkView panel, VTKNodeMap<DBObject,?> nodeMap) {
                this.panel = panel;
                this.nodeMap = nodeMap;
        }
@@ -72,7 +70,7 @@ public class SelectionHighlighter<DBObject, E extends INode> implements ISelecti
                        
        }
        
-       protected void hilight(E node, HighlightEventType type) {
+       protected void hilight(INode node, HighlightEventType type) {
                if (node instanceof NodeHighlighter) {
                        ((NodeHighlighter)node).highlight(type);
                        return;
@@ -109,13 +107,13 @@ public class SelectionHighlighter<DBObject, E extends INode> implements ISelecti
                        }
                        for (IG3DNode node : selectedNodes) {
                                if (!currentSelectedNodes.contains(node)) {
-                                       hilight((E)node, clear);
+                                       hilight((INode)node, clear);
                                        changed = true;
                                }
                        }
                        for (IG3DNode node : currentSelectedNodes) {
                                if (!selectedNodes.contains(node)) {
-                                       hilight((E)node, apply);
+                                       hilight((INode)node, apply);
                                        changed = true;
                                }
                        }
@@ -160,18 +158,17 @@ public class SelectionHighlighter<DBObject, E extends INode> implements ISelecti
                return currentSelectedNodes;
        }
        
-       protected void setDefaultColor(E node) {
+       protected void setDefaultColor(INode node) {
                double color[] = new double[]{1,1,0};
                setColor(node, false, color);
        }
        
-       protected void setSelectedColor(E node) {
+       protected void setSelectedColor(INode node) {
                double color[] = new double[]{1,0,0};
                setColor(node, false, color);
        }
        
-       
-       public void setColor(E node, boolean edge, double color[]) {
+       public void setColor(INode node, boolean edge, double color[]) {
                for (vtkProp prop : nodeMap.getRenderObjects(node)) {
                        if (prop instanceof vtkActor) {
                                vtkActor act = (vtkActor)prop;
index ceaaecd8df243acfa04722de3b5a4d767064923d..3a9cd997f393b8a705d704fee4a645ff84d550ee 100644 (file)
@@ -26,12 +26,12 @@ import org.simantics.g3d.scenegraph.base.ParentNode;
 import org.simantics.g3d.tools.AdaptationUtils;\r
 import org.simantics.g3d.ui.ScenegraphOutlinePage;\r
 \r
-public class VTKContentOutlinePage<DBObject,JavaObject> extends ScenegraphOutlinePage{\r
-       private NodeSelectionProvider2<DBObject,JavaObject> provider;\r
+public class VTKContentOutlinePage<DBObject, JavaObject extends INode> extends ScenegraphOutlinePage{\r
+       private NodeSelectionProvider2<DBObject, JavaObject> provider;\r
        \r
-       public VTKContentOutlinePage(ParentNode<? extends INode> rootNode, NodeSelectionProvider2<DBObject,JavaObject> provider) {\r
+       public VTKContentOutlinePage(ParentNode<? extends JavaObject> rootNode, NodeSelectionProvider2<DBObject, JavaObject> selectionProvider) {\r
                super(rootNode);\r
-               this.provider = provider;\r
+               this.provider = selectionProvider;\r
        }\r
        \r
        private boolean outsideSelection = false;\r
index 5de2b10dd056ba7310d806826c5e8fbafbcea6e3..d3b9463303dc54edd8d956e1bf5060aeabd4686d 100644 (file)
  *******************************************************************************/
 package org.simantics.g3d.vtk.common;
 
-import org.simantics.g3d.scenegraph.IG3DNode;
 import org.simantics.g3d.scenegraph.NodeMap;
 import org.simantics.g3d.scenegraph.base.INode;
 
 import vtk.vtkProp;
 
-public interface VTKNodeMap<DBObject,E extends INode> extends NodeMap<DBObject,vtkProp, E>{
-
-       
-
+public interface VTKNodeMap<DBObject,E extends INode> extends NodeMap<DBObject, vtkProp, E>{
 }
index f332322f27287d68b855669ffd46cc94796c2fe5..deb812722b238065fc512e0525a9e9d1d0f67190 100644 (file)
@@ -31,25 +31,24 @@ public class VTKSelectionItem<DBObject> implements IAdaptable{
                this.resource = res;
        }
 
-       @SuppressWarnings("rawtypes")
        @Override
-       public Object getAdapter(Class adapter) {
-               if (adapter == Resource.class)
+       public <T> T getAdapter(Class<T> adapter) {
+               if (adapter.isAssignableFrom(Resource.class))
                        if (resource instanceof Resource)
-                               return resource;
+                               return adapter.cast(resource);
                        else
                                return null;
-               if (adapter == StructuralResource.class)
+               if (adapter.isAssignableFrom(StructuralResource.class))
                        if (resource instanceof StructuralResource)
-                               return resource;
+                               return adapter.cast(resource);
                        else
                                return null;
-               if (adapter == vtkProp.class)
-                       return prop;
-               if (adapter == IG3DNode.class && node instanceof IG3DNode)
-                       return node;
-               if (adapter == INode.class)
-                       return node;
+               if (adapter.isAssignableFrom(vtkProp.class))
+                       return adapter.cast(prop);
+               if (adapter.isAssignableFrom(IG3DNode.class) && node instanceof IG3DNode)
+                       return adapter.cast(node);
+               if (adapter.isAssignableFrom(INode.class))
+                       return adapter.cast(node);
                return null;
        }
        
index 99a9e6e8eedbbb3b74947b4889e2009b92647058..45ecc35cbbbab3663bf5e0d708dd36320f84ff88 100644 (file)
@@ -11,7 +11,6 @@
  *******************************************************************************/
 package org.simantics.g3d.vtk.shape;
 
-import javax.vecmath.Point3d;
 import javax.vecmath.Tuple3d;
 
 import vtk.vtkActor;
index b8f9ff0c459ded51c4e38679d8c5d595cd1e0b21..03d0d2fb8cde95f7f6e16f943119fb8dcdb1fba3 100644 (file)
@@ -1,17 +1,12 @@
 package org.simantics.g3d.vtk.swt;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 
-import javax.vecmath.Vector3d;
-
 import org.eclipse.swt.widgets.Composite;
-import org.simantics.g3d.math.Ray;
 import org.simantics.g3d.scenegraph.RenderListener;
 import org.simantics.g3d.vtk.action.vtkAction;
 import org.simantics.g3d.vtk.common.VtkView;
-import org.simantics.g3d.vtk.utils.vtkUtil;
 import org.simantics.utils.threads.IThreadWorkQueue;
 import org.simantics.utils.threads.SWTThread;
 import org.simantics.utils.threads.ThreadUtils;
@@ -23,7 +18,6 @@ import vtk.vtkAreaPicker;
 import vtk.vtkAssemblyNode;
 import vtk.vtkAssemblyPath;
 import vtk.vtkCellPicker;
-import vtk.vtkCoordinate;
 import vtk.vtkObjectBase;
 import vtk.vtkPointPicker;
 import vtk.vtkProp;
@@ -184,6 +178,7 @@ public class InteractiveVtkComposite extends vtkSwtComponent implements VtkView{
        public void lock() {
                getVTKLock().lock();
                if (getComponent().getContext() != null && !getComponent().getContext().isCurrent()) {
+                       @SuppressWarnings("unused")
                        int ret = getComponent().getContext().makeCurrent();
 //                     System.out.println("Make current2 " + ret);
                }
index bd581ac2c3b2d7639865c8ac9d66f02701a0360a..9cf39effb808ed8dc139f8bdafe77d2a5479d693 100644 (file)
@@ -29,12 +29,12 @@ import org.simantics.g3d.math.MathTools;
 import org.simantics.g3d.math.Ray;
 import org.simantics.g3d.preferences.PreferenceConstants;
 import org.simantics.g3d.scenegraph.IG3DNode;
+import org.simantics.g3d.scenegraph.base.INode;
 import org.simantics.g3d.scenegraph.structural.IStructuralNode;
 import org.simantics.g3d.vtk.Activator;
 import org.simantics.g3d.vtk.common.VTKNodeMap;
 import org.simantics.g3d.vtk.gizmo.RotateAxisGizmo;
 import org.simantics.g3d.vtk.utils.vtkUtil;
-import org.simantics.utils.threads.AWTThread;
 import org.simantics.utils.threads.ThreadUtils;
 
 import vtk.vtkProp;
@@ -51,7 +51,7 @@ public class RotateAction extends vtkSwtAction{
        public static final int Z = 2;
        public static final int P = 3;
 
-       private VTKNodeMap nodeMap;
+       private VTKNodeMap<?, ? extends INode> nodeMap;
        //private TranslateGizmo  gizmo = new TranslateGizmo();
        private RotateAxisGizmo gizmo = new RotateAxisGizmo();
        private IG3DNode node;
@@ -105,7 +105,7 @@ public class RotateAction extends vtkSwtAction{
                return node;
        }
        
-       public RotateAction(InteractiveVtkComposite panel, VTKNodeMap nodeMap) {
+       public RotateAction(InteractiveVtkComposite panel, VTKNodeMap<?, ? extends INode> nodeMap) {
                super(panel);
                setImageDescriptor(Activator.imageDescriptorFromPlugin("com.famfamfam.silk", "icons/arrow_rotate_clockwise.png"));
                setText("Rotate");
index b30573c5ec0c2cf2e487814d68dd6877873e0863..32b97c1bda3abf576796e52f063327c2ca133a4f 100644 (file)
@@ -27,12 +27,12 @@ import org.eclipse.swt.widgets.Display;
 import org.simantics.g3d.math.MathTools;
 import org.simantics.g3d.math.Ray;
 import org.simantics.g3d.scenegraph.IG3DNode;
+import org.simantics.g3d.scenegraph.base.INode;
 import org.simantics.g3d.scenegraph.structural.IStructuralNode;
 import org.simantics.g3d.vtk.Activator;
 import org.simantics.g3d.vtk.common.VTKNodeMap;
 import org.simantics.g3d.vtk.gizmo.TranslateAxisGizmo;
 import org.simantics.g3d.vtk.utils.vtkUtil;
-import org.simantics.utils.threads.AWTThread;
 import org.simantics.utils.threads.ThreadUtils;
 
 import vtk.vtkProp;
@@ -47,7 +47,7 @@ public class TranslateAction extends vtkSwtAction{
        public static final int YZ = 5;
        public static final int P = 6;
 
-       private VTKNodeMap nodeMap;
+       private VTKNodeMap<?, ? extends INode> nodeMap;
        //private TranslateGizmo  gizmo = new TranslateGizmo();
        private TranslateAxisGizmo gizmo = new TranslateAxisGizmo();
        protected IG3DNode node;
@@ -70,7 +70,7 @@ public class TranslateAction extends vtkSwtAction{
                return node;
        }
        
-       public TranslateAction(InteractiveVtkComposite panel, VTKNodeMap nodeMap) {
+       public TranslateAction(InteractiveVtkComposite panel, VTKNodeMap<?, ? extends INode> nodeMap) {
                super(panel);
                setImageDescriptor(Activator.imageDescriptorFromPlugin("com.famfamfam.silk", "icons/arrow_out.png"));
                setText("Translate");
index 8a8f1668cdcc5c73a6921162616f01cb556ae7c1..b862a296d38fe04269faeee6c9d77d11ff77380d 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>\r
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
        <classpathentry kind="src" path="src"/>\r
        <classpathentry kind="output" path="bin"/>\r
index 0c68a61dca867ceb49e79d2402935261ec3e3809..295926d964165896ea8aa7c1b1b3c9d3d3caa77e 100644 (file)
@@ -1,7 +1,7 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.8
+eclipse.preferences.version=1\r
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8\r
+org.eclipse.jdt.core.compiler.compliance=1.8\r
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\r
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error\r
+org.eclipse.jdt.core.compiler.source=1.8\r
index d1a9d0091614aa7af8585a06550d232af5981617..7e889b3589403058fc239391d099e8c91364c730 100644 (file)
@@ -38,3 +38,4 @@ Export-Package: org.simantics.g3d,
  org.simantics.g3d.tools,
  org.simantics.g3d.ui,
  org.simantics.g3d.wizard
+Automatic-Module-Name: org.simantics.g3d
index 7198ead22ba6ccd9ad96cc30303158f9a9b9f317..7e3f85333bb88022ce5038e43670bdf0ab792346 100644 (file)
@@ -216,6 +216,7 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri
        private static Map<PropertyItem, PropertyManipulator> createManipulators(CompoundPropertyItem item, Object obj) {
                try {
                        
+                       @SuppressWarnings("unchecked")
                        Map<String,Object> map = (Map<String, Object>)item.getter.invoke(obj);
                        Map<PropertyItem, PropertyManipulator> result = new HashMap<AnnotatedPropertyTabContributorFactory.PropertyItem, PropertyManipulator>();
                        for (String key : map.keySet()) {
@@ -232,7 +233,7 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri
                        return result;
                } catch (Exception e) {
                        e.printStackTrace();
-                       return Collections.EMPTY_MAP;
+                       return Collections.emptyMap();
                } 
                
        }
@@ -980,9 +981,9 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri
                        if (focusCellManager != null) {
                                try {
                                        Method m = focusCellManager.getClass().getSuperclass()
-                                                       .getDeclaredMethod("init", null);
+                                                       .getDeclaredMethod("init");
                                        m.setAccessible(true);
-                                       m.invoke(focusCellManager, null);
+                                       m.invoke(focusCellManager);
                                } catch (SecurityException e) {
                                        e.printStackTrace();
                                } catch (IllegalArgumentException e) {
@@ -1050,9 +1051,10 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri
                                                if (DEBUG)System.err.println("FOCUS CELL: " + focusCell);
                                                
                                                Method m = AbstractTableViewer.class.getDeclaredMethod(
-                                                               "getSelectionFromWidget", null);
+                                                               "getSelectionFromWidget");
                                                m.setAccessible(true);
-                                               List l = (List) m.invoke(getViewer(), null);
+                                               @SuppressWarnings("rawtypes")
+                                               List l = (List) m.invoke(getViewer());
                                                if (focusCellManager != null) {
                                                        m = focusCellManager
                                                                        .getClass()
@@ -1152,9 +1154,9 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri
                                        ViewerColumn column = (ViewerColumn) m.invoke(viewer,
                                                        new Object[] { new Integer(columnIndex) });
                                        m = ViewerColumn.class.getDeclaredMethod(
-                                                       "getEditingSupport", null);
+                                                       "getEditingSupport");
                                        m.setAccessible(true);
-                                       EditingSupport es = (EditingSupport) m.invoke(column, null);
+                                       EditingSupport es = (EditingSupport) m.invoke(column);
                                        if (column != null && es != null) {
                                                m = EditingSupport.class.getDeclaredMethod("canEdit",
                                                                new Class[] { Object.class });
@@ -1258,10 +1260,9 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri
                                m.setAccessible(true);
                                ViewerColumn column = (ViewerColumn) m.invoke(viewer,
                                                new Object[] { new Integer(cell.getColumnIndex()) });
-                               m = ViewerColumn.class.getDeclaredMethod("getEditingSupport",
-                                               null);
+                               m = ViewerColumn.class.getDeclaredMethod("getEditingSupport");
                                m.setAccessible(true);
-                               EditingSupport es = (EditingSupport) m.invoke(column, null);
+                               EditingSupport es = (EditingSupport) m.invoke(column);
                                if (column != null && es != null) {
                                        m = EditingSupport.class.getDeclaredMethod("canEdit",
                                                        new Class[] { Object.class });
index 7e9859a5ca8bb78f4a859ec88a4ea81e6bc672dd..eeae0dc89499dab28966d6083af0b74f977cfb5d 100644 (file)
@@ -29,9 +29,11 @@ public class MethodWithMapValueProvider implements ValueProvider {
        \r
        @Override\r
        public Object getValue(Object obj) throws Exception{\r
+               @SuppressWarnings("unchecked")\r
                Map<String,Object> map = (Map<String, Object>)getter.invoke(obj);\r
                return map.get(key);\r
        }\r
+       @SuppressWarnings("unchecked")\r
        @Override\r
        public void setValue(Object obj, Object value) throws Exception {\r
                Map<String,Object> map = new HashMap<String, Object>();\r
index c05269924534685fc0ef1992e1863bd4997a5b4a..c955dc6a3d21642bc23b4ff5b3f4420f177b74bd 100644 (file)
@@ -18,7 +18,6 @@ import org.simantics.g3d.ontology.G3D;
 import org.simantics.g3d.property.annotations.GetPropertyValue;\r
 import org.simantics.g3d.property.annotations.PropertyContributor;\r
 import org.simantics.g3d.property.annotations.SetPropertyValue;\r
-import org.simantics.g3d.scenegraph.base.INode;\r
 import org.simantics.g3d.scenegraph.base.Node;\r
 import org.simantics.g3d.tools.NodeTools;\r
 import org.simantics.objmap.graph.annotations.RelatedGetValue;\r
@@ -149,11 +148,9 @@ public class G3DNode extends Node implements IG3DNode {
        }\r
        \r
        @Override\r
-       public Object getAdapter(Class adapter) {\r
-               if (INode.class == adapter)\r
-                       return this;\r
-               if (IG3DNode.class == adapter)\r
-                       return this;\r
+       public <C> C getAdapter(Class<C> adapter) {\r
+               if (adapter.isInstance(this))\r
+                       return adapter.cast(this);\r
                return null;\r
        }\r
 \r
index ee35bac573027f22e875baa19fe0e83fb306c1fe..f28b1c3c6375617656bd87d5a2b4a823d8df1b2d 100644 (file)
@@ -143,7 +143,7 @@ public class G3DparentNode<T extends IG3DNode> extends ParentNode<T> implements
        }\r
        \r
        @Override\r
-       public Object getAdapter(Class adapter) {\r
+       public <C> C getAdapter(Class<C> adapter) {\r
                return null;\r
        }\r
 }\r
index 6d122930a3e2be155771d4b99d0e313cbf39d7c9..af1e3af5e2a7dc3b878ce3cabd3b686fae8cfd01 100644 (file)
@@ -11,9 +11,6 @@
  *******************************************************************************/
 package org.simantics.g3d.scenegraph.base;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.eclipse.core.runtime.ListenerList;
 
 
index 9cdc3bf4502cf20b4a2c62250909dedf4cd0441f..13ac2f523129356f9a12d659c6564ee7b2a33b08 100644 (file)
@@ -26,7 +26,7 @@ import org.simantics.objmap.graph.annotations.RelatedSetValue;
 import org.simantics.objmap.structural.IStructuralObject;\r
 import org.simantics.utils.datastructures.MapList;\r
 \r
-public abstract class ComponentNode<T extends Connection, T2 extends IComponentNode> extends Node implements IComponentNode<T, T2>{\r
+public abstract class ComponentNode<T extends Connection<T,T2>, T2 extends IComponentNode<T,T2>> extends Node implements IComponentNode<T, T2>{\r
 \r
        \r
        private String name;\r
@@ -123,7 +123,7 @@ public abstract class ComponentNode<T extends Connection, T2 extends IComponentN
        public List<T2> getAllConnectedNodes() {\r
                List<T2> list = new ArrayList<T2>();\r
                for (T c : getAllConnections()) {\r
-                       T2 node = (T2)c.getOther(this);\r
+                       T2 node = c.getOther(this);\r
                        if (node != null)\r
                                list.add(node);\r
                }\r
@@ -161,9 +161,10 @@ public abstract class ComponentNode<T extends Connection, T2 extends IComponentN
        private MapList<String, T> connections = new MapList<String, T>();\r
        \r
        \r
+       @SuppressWarnings("unchecked")\r
        protected void _addConnection(String id, T c) {\r
                connections.add(id, c);\r
-               c.addConnect(this);\r
+               c.addConnect((T2) this);\r
                firePropertyChanged(id);\r
        }\r
        \r
@@ -223,7 +224,7 @@ public abstract class ComponentNode<T extends Connection, T2 extends IComponentN
        public List<T2> getConnectedNodes(String id) {\r
                List<T2> list = new ArrayList<T2>();\r
                for (T c : getConnections(id)) {\r
-                       T2 node = (T2)c.getOther(this);\r
+                       T2 node = c.getOther(this);\r
                        if (node != null)\r
                                list.add(node);\r
                }\r
index c43ca12ff2412bda1f9b07ecbadde2bedc014088..bd8ade64c0222fe70b207a6f9ce6380444949f11 100644 (file)
@@ -19,42 +19,42 @@ import org.simantics.db.Resource;
 import org.simantics.objmap.structural.IStructuralObject;\r
 \r
 @SuppressWarnings("rawtypes")\r
-public abstract class  Connection <T extends IComponentNode> implements IStructuralObject{\r
+public abstract class Connection<T extends Connection<T, T2>, T2 extends IComponentNode<T, T2>> implements IStructuralObject{\r
 \r
+       private List<T2> connects = new ArrayList<T2>();\r
        \r
-       private List<T> connects = new ArrayList<T>();\r
-       \r
-       \r
-       public void addConnect(T node) {\r
+       public void addConnect(T2 node) {\r
                if (!connects.contains(node))\r
                        connects.add(node);\r
                fireChanged(node,true);\r
        }\r
        \r
-       protected void fireChanged(T node, boolean add){\r
-               for (IComponentNode n : connects) {\r
-                       n.connectionChanged(this,node,add);\r
+       @SuppressWarnings("unchecked")\r
+       protected void fireChanged(T2 node, boolean add){\r
+               for (T2 n : connects) {\r
+                       n.connectionChanged((T) this,node,add);\r
                }\r
        }\r
        \r
-       public Collection<T> getConnected() {\r
+       public Collection<T2> getConnected() {\r
                return connects;\r
        }\r
        \r
-       public void removeConnect(T node) {\r
+       public void removeConnect(T2 node) {\r
                connects.remove(node);\r
                fireChanged(node,false);\r
        }\r
        \r
+       @SuppressWarnings("unchecked")\r
        public void remove() {\r
-               List<T> toRemove = new ArrayList<T>(connects.size());\r
+               List<T2> toRemove = new ArrayList<T2>(connects.size());\r
                toRemove.addAll(connects);\r
                for (IComponentNode node : toRemove) {\r
-                       node.removeConnection(this);\r
+                       node.removeConnection((T) this);\r
                }\r
        }\r
        \r
-       public T getOther(T node) {\r
+       public T2 getOther(IComponentNode<T, T2> node) {\r
                if (connects.size() != 2) \r
                        return null;\r
                if (connects.get(0).equals(node))\r
index 0221bee2df49da6bf59e59eecc202242a343aa28..692913656bde8c3e9c05ea547803dc6c9e2c7736 100644 (file)
@@ -26,7 +26,7 @@ import org.simantics.objmap.graph.annotations.RelatedSetValue;
 import org.simantics.objmap.structural.IStructuralObject;\r
 import org.simantics.utils.datastructures.MapList;\r
 \r
-public abstract class G3DComponentNode<T extends Connection, T2 extends IComponentNode> extends G3DNode implements IComponentNode<T, T2>{\r
+public abstract class G3DComponentNode<T extends Connection<T,T2>, T2 extends IComponentNode<T,T2>> extends G3DNode implements IComponentNode<T, T2>{\r
 \r
        \r
        private String name;\r
@@ -161,9 +161,10 @@ public abstract class G3DComponentNode<T extends Connection, T2 extends ICompone
        private MapList<String, T> connections = new MapList<String, T>();\r
        \r
        \r
+       @SuppressWarnings("unchecked")\r
        protected void _addConnection(String id, T c) {\r
                connections.add(id, c);\r
-               c.addConnect(this);\r
+               c.addConnect((T2) this);\r
                firePropertyChanged(id);\r
        }\r
        \r
index b94cee31b16e787a155f5c8dbdd954ed13f83ca0..073ef79d49b2b6c89f9f6ad3182a6f7959915753 100644 (file)
@@ -21,7 +21,6 @@ import org.simantics.g3d.ontology.G3D;
 import org.simantics.g3d.property.annotations.GetPropertyValue;\r
 import org.simantics.g3d.property.annotations.SetPropertyValue;\r
 import org.simantics.g3d.scenegraph.IG3DNode;\r
-import org.simantics.g3d.scenegraph.base.INode;\r
 import org.simantics.g3d.scenegraph.base.NodeException;\r
 import org.simantics.g3d.tools.NodeTools;\r
 import org.simantics.objmap.graph.annotations.RelatedGetValue;\r
@@ -168,15 +167,12 @@ public abstract class G3DStructuralParentNode<T extends IStructuralNode> extends
        protected Collection<T> _getStrNodes(String id) {\r
                return getNodes(id+"/str");\r
        }\r
-       \r
-       public Object getAdapter(Class adapter) {\r
-               if (INode.class == adapter)\r
-                       return this;\r
-               if (IG3DNode.class == adapter)\r
-                       return this;\r
+\r
+       @Override\r
+       public <U> U getAdapter(Class<U> adapter) {\r
+               if (adapter.isInstance(this))\r
+                       return adapter.cast(this);\r
                return null;\r
        }\r
        \r
-       \r
-       \r
 }\r
index 6280b3747bbcae387a8b733baaa01e4557cfe4a6..a8371846c7bfc91eb655e1330fed410b777c8782 100644 (file)
@@ -15,8 +15,7 @@ import java.util.Collection;
 import java.util.List;\r
 \r
 \r
-@SuppressWarnings("rawtypes")\r
-public interface IComponentNode<T extends Connection, T2 extends IComponentNode> extends IStructuralNode{\r
+public interface IComponentNode<T extends Connection<T,T2>, T2 extends IComponentNode<T,T2>> extends IStructuralNode{\r
        \r
        public List<T> getAllConnections();\r
        //public void addConnection(Connection c);\r
index 940c244ed8d39bb368e1b7954c4a427dc7ff7396..39d4e441056838ec9d219c342bebe7c6ede619dc 100644 (file)
@@ -14,6 +14,7 @@ import org.simantics.scl.compiler.types.TCon;
 import org.simantics.scl.compiler.types.Type;
 import org.simantics.scl.osgi.SCLOsgi;
 
+@SuppressWarnings("restriction")
 public class SCLUtil {
        
        static Map<TCon,Class<?>> typeMap = new HashMap<TCon, Class<?>>();
index f9a245dcd541f0dd2b92b155a280a5c72ccb933f..3c1cd9f2cd235fed45870fed438ab23bfe97aed7 100644 (file)
@@ -93,9 +93,11 @@ public abstract class ScriptNodeMap<DBObject,E extends INode> implements NodeMap
        
        @Override
        public ParentNode<E> getRootNode() {
-               return (ParentNode<E>)rootNode;
+               return rootNode;
        }
        
+       
+       
        @Override
        public boolean isChangeTracking() {
                return changeTracking;
index 0146ff347b20365b0658a238f57b3d792099acf5..379927dfb93c0b9056c0c9c6ca648225fe13bfbb 100644 (file)
@@ -38,7 +38,6 @@ import org.simantics.db.Resource;
 import org.simantics.db.common.NamedResource;\r
 import org.simantics.db.common.request.ReadRequest;\r
 import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.layer0.Layer0;\r
 import org.simantics.ui.utils.ResourceAdaptionUtils;\r
 \r
 \r
@@ -206,7 +205,6 @@ public abstract class ModelExportWizardPage<T extends IExportModel> extends Wiza
                                new ReadRequest() {\r
                                        @Override\r
                                        public void run(ReadGraph graph) throws DatabaseException {\r
-                                               Layer0 L0 = Layer0.getInstance(graph);\r
                                                models = getSupportedModels(graph, Simantics.getProject().get());\r
                                        }\r
                                });\r
index 8a8f1668cdcc5c73a6921162616f01cb556ae7c1..b862a296d38fe04269faeee6c9d77d11ff77380d 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>\r
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
        <classpathentry kind="src" path="src"/>\r
        <classpathentry kind="output" path="bin"/>\r
index 24422af6f2d8ff120fe371f3a5cf055a80814d77..295926d964165896ea8aa7c1b1b3c9d3d3caa77e 100644 (file)
@@ -1,8 +1,7 @@
-#Wed Aug 08 16:10:05 EEST 2012\r
 eclipse.preferences.version=1\r
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\r
-org.eclipse.jdt.core.compiler.compliance=1.6\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8\r
+org.eclipse.jdt.core.compiler.compliance=1.8\r
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\r
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error\r
-org.eclipse.jdt.core.compiler.source=1.6\r
+org.eclipse.jdt.core.compiler.source=1.8\r
index 9297e52d95cbdcddb842f2a9ea4cd8c7e714a6ff..50b49bd16765e34a256a0f2a3a284b0628bb44f3 100644 (file)
@@ -13,6 +13,7 @@ Require-Bundle: org.eclipse.ui,
  javax.vecmath;bundle-version="1.5.2",
  org.simantics.utils.datastructures;bundle-version="1.1.0",
  org.simantics.g3d.vtk;bundle-version="1.0.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Bundle-ActivationPolicy: lazy
 Export-Package: org.simantics.opencascade.vtk
+Automatic-Module-Name: org.simantics.opencascade.vtk
index faa8efd18337d82b45848c3495061e8d127340ab..d9fc5f4c1979bf17e8daa299e991593eb8edb300 100644 (file)
@@ -105,6 +105,7 @@ public class VTKOCCTool {
                return assemblies;
        }
 
+       @SuppressWarnings("unused")
        private static void gridToAssembly(vtkAssembly assemblies, vtkPolyData partGrid, vtkAppendPolyData stlSurfaceData, vtkAppendPolyData stlEdgeData) {
 
                double featureAngle = 30;
index 8a8f1668cdcc5c73a6921162616f01cb556ae7c1..b862a296d38fe04269faeee6c9d77d11ff77380d 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>\r
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
        <classpathentry kind="src" path="src"/>\r
        <classpathentry kind="output" path="bin"/>\r
index a29390adccd19a701c4506d7958a412403b4e93d..295926d964165896ea8aa7c1b1b3c9d3d3caa77e 100644 (file)
@@ -1,8 +1,7 @@
-#Mon Dec 12 17:21:52 EET 2011\r
 eclipse.preferences.version=1\r
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\r
-org.eclipse.jdt.core.compiler.compliance=1.6\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8\r
+org.eclipse.jdt.core.compiler.compliance=1.8\r
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\r
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error\r
-org.eclipse.jdt.core.compiler.source=1.6\r
+org.eclipse.jdt.core.compiler.source=1.8\r
index 6b4948b1e8616a82002e7794af551f7e232b22af..3a8e79577be0acd5db2d856d8454fbe573ae9a10 100644 (file)
@@ -10,6 +10,7 @@ Require-Bundle: org.eclipse.core.runtime,
  org.jcae.opencascade;bundle-version="1.0.0",
  org.simantics.utils.datastructures;bundle-version="1.1.0",
  org.simantics.g3d;bundle-version="1.0.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Bundle-ActivationPolicy: lazy
 Export-Package: org.simantics.opencascade
+Automatic-Module-Name: org.simantics.opencascade
index ad32c83a7885b8953a938b41df3b4fd4fe1aae01..b862a296d38fe04269faeee6c9d77d11ff77380d 100644 (file)
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-       <classpathentry kind="src" path="src"/>
-       <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>\r
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+       <classpathentry kind="src" path="src"/>\r
+       <classpathentry kind="output" path="bin"/>\r
+</classpath>\r
index c537b63063ce6052bdc49c5fd0745b078f162c90..0c68a61dca867ceb49e79d2402935261ec3e3809 100644 (file)
@@ -1,7 +1,7 @@
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.8
index f74fbe6bd39b84893afa46dd24c50a1900a2bad7..8b7db6f78cb8b7f6bead3a799a995808a8fe3e55 100644 (file)
@@ -15,5 +15,6 @@ Require-Bundle: org.eclipse.core.runtime,
  org.simantics.image2.ontology;bundle-version="1.2.0",
  org.simantics.silk.ontology;bundle-version="1.1.0",
  org.simantics.project.ontology;bundle-version="1.2.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Export-Package: org.simantics.plant3d.ontology
+Automatic-Module-Name: org.simantics.plant3d.ontology
index 5ace73e5f80c7aa4014e36202d6b68a0bb3ae7d7..6ef52379484474d5901c5d42e252caffb5c7e42c 100644 (file)
@@ -5,11 +5,6 @@
        <projects>
        </projects>
        <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
                <buildCommand>
                        <name>org.eclipse.pde.ManifestBuilder</name>
                        <arguments>
@@ -23,6 +18,5 @@
        </buildSpec>
        <natures>
                <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
        </natures>
 </projectDescription>
index 199456f5b4a92e064407b54cd12198ea25b85785..b8e15b9118bac70de5bab97f1ad33e896ad3eee9 100644 (file)
@@ -3,11 +3,9 @@ Bundle-ManifestVersion: 2
 Bundle-Name: Product
 Bundle-SymbolicName: org.simantics.plant3d.product;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.simantics.plant3d.product.Activator
 Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.ui;bundle-version="3.7.0",
  org.simantics.plant3d;bundle-version="1.0.0",
  org.simantics.project;bundle-version="1.0.1"
 Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-Vendor: VTT
index e1d2deade8e6d82dc4472f1a73f6a661bfc89ce5..122283d1cb0236eb640911080cabc7c2f549b5bf 100644 (file)
@@ -1,5 +1,3 @@
-source.. = src/
-output.. = bin/
 bin.includes = META-INF/,\
                .,\
                plugin.xml,\
diff --git a/org.simantics.plant3d.product/src/org/simantics/plant3d/product/Activator.java b/org.simantics.plant3d.product/src/org/simantics/plant3d/product/Activator.java
deleted file mode 100644 (file)
index 87c1fac..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.simantics.plant3d.product;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
-
-       private static BundleContext context;
-
-       static BundleContext getContext() {
-               return context;
-       }
-
-       /*
-        * (non-Javadoc)
-        * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
-        */
-       public void start(BundleContext bundleContext) throws Exception {
-               Activator.context = bundleContext;
-       }
-
-       /*
-        * (non-Javadoc)
-        * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
-        */
-       public void stop(BundleContext bundleContext) throws Exception {
-               Activator.context = null;
-       }
-
-}
index ad32c83a7885b8953a938b41df3b4fd4fe1aae01..b862a296d38fe04269faeee6c9d77d11ff77380d 100644 (file)
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-       <classpathentry kind="src" path="src"/>
-       <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>\r
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+       <classpathentry kind="src" path="src"/>\r
+       <classpathentry kind="output" path="bin"/>\r
+</classpath>\r
index 8a67558d9016d1c467c84a7104d1dda57388c15f..7b8a3b0de349f2987084862cdda1de731cdcc58d 100644 (file)
@@ -34,7 +34,7 @@ Require-Bundle: org.eclipse.core.runtime,
  org.simantics.structural.ui;bundle-version="1.1.1",
  org.simantics.g3d.csg;bundle-version="1.0.0",
  org.simantics.utils.thread.swt;bundle-version="1.1.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Bundle-ActivationPolicy: lazy
 Export-Package: org.simantics.plant3d.actions,
  org.simantics.plant3d.browser,
@@ -49,3 +49,4 @@ Export-Package: org.simantics.plant3d.actions,
  org.simantics.plant3d.scenegraph.controlpoint,
  org.simantics.plant3d.scl,
  org.simantics.plant3d.utils
+Automatic-Module-Name: org.simantics.plant3d
index 88ab98383633de72e05bfb8b380528c1b8f5eaab..56b0443eb203b71a16300387d7e8c7e292e3c53d 100644 (file)
@@ -42,7 +42,9 @@ public class AddComponentAction extends vtkSwtAction {
        
        private Item toAdd = null;
        private PositionType insertPosition;
+       @SuppressWarnings("unused")
        private boolean insertAdjustable;
+       @SuppressWarnings("unused")
        private boolean lengthAdjustable;
        
        private String libUri;
index 3dc6a4aee38ade811b3ea872752aef96fdc13071..180eca2f0ba20a2517fc469df7fca41c279607c9 100644 (file)
@@ -7,7 +7,7 @@ import org.simantics.plant3d.scenegraph.PipelineComponent;
 
 public class RemoveAndSplitAction extends RemoveAction {
 
-    public RemoveAndSplitAction(VTKNodeMap nodeMap) {
+    public RemoveAndSplitAction(VTKNodeMap<?, ? extends INode> nodeMap) {
         super(nodeMap);
         setText("Remove/Split");
     }
index 7de27a31cde15fc90d939bd19df5e54908387ff2..a57fcc4c0be6d4e48db55f71710e2c1515f18be8 100644 (file)
@@ -839,6 +839,7 @@ public class RoutePipeAction extends vtkSwtAction {
                return true;
        }
        
+       @SuppressWarnings("unused")
        private Vector3d getLockDir() {
                switch (lock) {
                case CUSTOM:
@@ -849,8 +850,9 @@ public class RoutePipeAction extends vtkSwtAction {
                        return new Vector3d(0,1,0);
                case Z:
                        return new Vector3d(0,0,1);
+               default:
+                       return null;
                }
-               return null;
        }
        
        protected void updateRoute(Vector3d o, Vector3d d) {
index 16a388208be3c1713f7c9a0bc813b7e11fcb08a6..261ab8c36d88dd2ec8c092a579838e1db9764134 100644 (file)
@@ -10,8 +10,6 @@ import org.simantics.g3d.scenegraph.IG3DNode;
 import org.simantics.g3d.vtk.swt.InteractiveVtkComposite;
 import org.simantics.g3d.vtk.utils.vtkUtil;
 import org.simantics.plant3d.Activator;
-import org.simantics.plant3d.actions.RoutePipeAction.LockType;
-import org.simantics.plant3d.actions.RoutePipeAction.ToolState;
 import org.simantics.plant3d.scenegraph.EndComponent;
 import org.simantics.plant3d.scenegraph.InlineComponent;
 import org.simantics.plant3d.scenegraph.Nozzle;
@@ -19,9 +17,7 @@ import org.simantics.plant3d.scenegraph.P3DRootNode;
 import org.simantics.plant3d.scenegraph.PipelineComponent;
 import org.simantics.plant3d.scenegraph.TurnComponent;
 import org.simantics.plant3d.scenegraph.controlpoint.PipeControlPoint;
-import org.simantics.plant3d.scenegraph.controlpoint.PipingRules;
 import org.simantics.plant3d.scenegraph.controlpoint.PipeControlPoint.Direction;
-import org.simantics.plant3d.utils.ComponentUtils;
 
 public class TranslateFreeVariableLengthAction extends RoutePipeAction{
 
index 594c73d3688808109c03d86de18d1a1671007cda..3c5886d8bbd2779dc75735fc1bdac807d8e08f93 100644 (file)
@@ -9,6 +9,7 @@ import javax.vecmath.Vector3d;
 import org.simantics.g3d.math.MathTools;
 import org.simantics.g3d.math.Ray;
 import org.simantics.g3d.scenegraph.IG3DNode;
+import org.simantics.g3d.scenegraph.base.INode;
 import org.simantics.g3d.vtk.common.VTKNodeMap;
 import org.simantics.g3d.vtk.swt.InteractiveVtkComposite;
 import org.simantics.g3d.vtk.swt.TranslateAction;
@@ -26,7 +27,7 @@ public class TranslateInlineAction extends TranslateAction{
        private Vector3d e;
        private Vector3d dir;
 
-       public TranslateInlineAction(InteractiveVtkComposite panel, VTKNodeMap nodeMap) {
+       public TranslateInlineAction(InteractiveVtkComposite panel, VTKNodeMap<?, ? extends INode> nodeMap) {
                super(panel, nodeMap);
                setImageDescriptor(Activator.imageDescriptorFromPlugin("com.famfamfam.silk", "icons/arrow_refresh.png"));
        }
index 176fbaaa893608436f7a85d2248ec6841210aaac..f659c4be09c956fc65566f0de469ba40148d9ac4 100644 (file)
@@ -7,6 +7,7 @@ import org.simantics.structural.ui.modelBrowser.ModelBrowser2;
 public class P3DBrowser extends ModelBrowser2 {
        
        
+       @SuppressWarnings("deprecation")
        @Override
        protected Set<String> getBrowseContexts() {
                return browseContexts;
index fe55fdfa935d337a9600fb13dd639065f23f927f..288455a284f737ac149465bfcf66796d4bd9acfe 100644 (file)
@@ -10,6 +10,7 @@ public class ComponentContentProvider implements IStructuredContentProvider {
        
        @Override
        public Object[] getElements(Object inputElement) {
+               @SuppressWarnings("unchecked")
                List<Item> list = (List<Item>)inputElement;
                return list.toArray();
        }
index a145b71ab2d542c6dae6b792122bb25ccd6f1555..08ce5a07bc4f4adbc54687540de0a810ed768a01 100644 (file)
@@ -103,6 +103,7 @@ public class P3DNodeMap extends AbstractVTKNodeMap<Resource,INode> {
                node.update(view.getRenderer());
                
                if (node instanceof ParentNode<?>) {
+                       @SuppressWarnings("unchecked")
                        ParentNode<IP3DNode> p = (ParentNode<IP3DNode>)node;
                        for (IP3DNode n : p.getNodes())
                                updateTransform(n);
index 53a0ed2c78ed1298bca72e551986d2fe2f3cd8fc..b11cf90e98e2ea1dc35b116c20f1e5b1d8371db9 100644 (file)
@@ -82,7 +82,6 @@ import vtk.vtkRenderer;
 import vtk.vtkSSAAPass;
 import vtk.vtkSequencePass;
 import vtk.vtkSimpleMotionBlurPass;
-import vtk.vtkSobelGradientMagnitudePass;
 
 
 public class Plant3DEditor extends ResourceEditorPart {
@@ -230,12 +229,12 @@ public class Plant3DEditor extends ResourceEditorPart {
            return new NodeSelectionProvider2<Resource,INode>(this,mapping,nodeMap);
        }
        
-       protected HoverHighlighter createHoverHighlhighter() {
-           return new HoverHighlighter(panel,nodeMap);
+       protected HoverHighlighter<Resource> createHoverHighlhighter() {
+           return new HoverHighlighter<>(panel,nodeMap);
        }
        
-       protected SelectionHighlighter<Resource,INode> createSelectionHighlighter() {
-           return new SelectionHighlighter<Resource,INode>(panel,nodeMap);
+       protected SelectionHighlighter<Resource> createSelectionHighlighter() {
+           return new SelectionHighlighter<Resource>(panel,nodeMap);
        }
        
        protected String getLibraryUri() {
@@ -491,30 +490,29 @@ public class Plant3DEditor extends ResourceEditorPart {
                return outlinePage;
        }
 
-       @SuppressWarnings("rawtypes")
        @Override
-       public Object getAdapter(Class adapter) {
-               if (IPropertyPage.class.equals(adapter))
-                       return new StandardPropertyPage(getSite(),getPropertyContexts());
-               if (IContentOutlinePage.class.equals(adapter)) {
-                       return createOutline();
+       public <T> T getAdapter(Class<T> adapter) {
+               if (adapter.isAssignableFrom(IPropertyPage.class))
+                       return adapter.cast(new StandardPropertyPage(getSite(),getPropertyContexts()));
+               if (adapter.isAssignableFrom(ISelectionProvider.class))
+                       return adapter.cast(selectionProvider);
+               if (adapter.isAssignableFrom(IContentOutlinePage.class)) {
+                       return adapter.cast(createOutline());
                }
-               if (NodeMap.class.equals(adapter)) {
-                       return nodeMap;
+               if (adapter.isAssignableFrom(NodeMap.class)) {
+                       return adapter.cast(nodeMap);
                }
-               if (INode.class.equals(adapter)) {
-                       return rootNode;
+               if (adapter.isAssignableFrom(INode.class)) {
+                       return adapter.cast(rootNode);
                }
-               if (IMapping.class.equals(adapter)) {
-                       return mapping;
+               if (adapter.isAssignableFrom(IMapping.class)) {
+                       return adapter.cast(mapping);
                }
-//             if (InteractiveVtkPanel.class.equals(adapter)) {
-//                     return panel;
+//             if (adapter.isAssignableFrom(InteractiveVtkPanel.class)) {
+//                     return adapter.cast(panel);
 //             }
-               if (VtkView.class.equals(adapter))
-                       return panel;
-               if (ISelectionProvider.class.equals(adapter))
-                       return selectionProvider;
+               if (adapter.isAssignableFrom(VtkView.class))
+                       return adapter.cast(panel);
                return super.getAdapter(adapter);
        }
        
index dabae5ac46528c3ab445f8976fe003c4f7f83b80..2be491834d086e48ca23097bae41cf96c059dda7 100644 (file)
@@ -167,9 +167,9 @@ public abstract class P3DParentNode<T extends IP3DNode> extends ParentNode<T> im
        }
        
        @Override
-       public Object getAdapter(Class adapter) {
-               if (IG3DNode.class == adapter)
-                       return this;
+       public <C> C getAdapter(Class<C> adapter) {
+               if (adapter.isInstance(this))
+                       return adapter.cast(this);
                return null;
        }
        
index 5b7fe274c0b509dcba87151505d3794054a60e15..27b1d471bf97733e9fe46bbadc79a85b5898470f 100644 (file)
@@ -157,11 +157,10 @@ public class P3DRootNode extends ParentNode<INode> implements IG3DNode, NodeMapP
        }
 
        
-       @SuppressWarnings("rawtypes")
        @Override
-       public Object getAdapter(Class adapter) {
-               if (NodeMap.class == adapter)
-                       return nodeMap;
+       public <T> T getAdapter(Class<T> adapter) {
+               if (adapter.isAssignableFrom(NodeMap.class))
+                       return adapter.cast(nodeMap);
                return null;
        }
        
index 7aa0e8082b9a5a3034636b8ca84e7128f40dc4ac..2aa9c6982ce2c3e952d06fe00f35ff9b50858709 100644 (file)
@@ -1,7 +1,6 @@
 package org.simantics.plant3d.scenegraph;
 
 import java.util.Map;
-import java.util.Set;
 
 import org.simantics.g3d.scenegraph.IG3DNode;
 
index 36710e4fee17d16a5c10bed8f16b0059a38485e8..958228e8eefad236d03d6485f5f3a8d0b08030d1 100644 (file)
@@ -43,7 +43,7 @@ public class PipeRun extends P3DParentNode<IP3DNode> {
        
        @Override
        public Collection<vtkProp3D> getActors() {
-               return Collections.EMPTY_LIST;
+               return Collections.emptyList();
        }
        
        @Override
@@ -51,12 +51,14 @@ public class PipeRun extends P3DParentNode<IP3DNode> {
                
        }
        
+       @SuppressWarnings("deprecation")
        @RelatedGetValue(Plant3D.URIs.HasTurnRadius)
        @GetPropertyValue(value=Plant3D.URIs.HasTurnRadius, name = "Elbow radius")
        public double getTurnRadius() {
                return turnRadius[0];
        }
        
+       @SuppressWarnings("deprecation")
        @RelatedSetValue(Plant3D.URIs.HasTurnRadius)
        @SetPropertyValue(Plant3D.URIs.HasTurnRadius)
        public void setTurnRadius(double turnRadius) {
index 735916db6df2b31a0bae9bf7c880ce29c4d95194..37dd50124b220c8a9848bf008eafd2df97782288 100644 (file)
@@ -428,7 +428,7 @@ public abstract class PipelineComponent extends GeometryNode {
        }
        
        public Map<String,Object> updateParameterMap() {
-               return Collections.EMPTY_MAP;
+               return Collections.emptyMap();
        }
        
        public abstract String getType();
index eb07e9c0f86c5d1340eabc5da22931f12bfe893f..f5c6f876a98d507eca60c31bcd809dd8f25bb37d 100644 (file)
@@ -375,6 +375,7 @@ public class PipingRules {
 
        }
 
+       @SuppressWarnings("unused")
        private static boolean calculateOffset(Vector3d startPoint, Vector3d endPoint, ArrayList<PipeControlPoint> list, Vector3d dir, Vector3d offset) {
                boolean hasOffsets = false;
                List<PipeControlPoint> offsets = new ArrayList<PipeControlPoint>(list.size());
@@ -718,7 +719,7 @@ public class PipingRules {
                                                                                                        // position of the
                                                                                                        // component
                                dir.add(prevPos);
-                               PipeControlPoint scp = insertStraight(prev, icp, dir, length);
+                               insertStraight(prev, icp, dir, length);
                                return true;
                        } else {
                                triedIR = true;
@@ -1372,6 +1373,7 @@ public class PipingRules {
        // end,Point3d endPoint, Vector3d dir, boolean hasOffsets,int iter, boolean
        // reversed, ArrayList<ExpandIterInfo> toRemove) throws TransactionException
        // {
+       @SuppressWarnings("unused")
        private static void processPathLegNoOffset(UpdateStruct2 u) throws Exception {
                if (DEBUG)
                        System.out.println("PipingRules.processPathLeg " + u.start + " " + u.end);
@@ -1876,7 +1878,6 @@ public class PipingRules {
                        // this should not be possible
                        throw new RuntimeException("VariableLengthComponent " + splittingComponent + " is not connected to anything.");
                }
-               double reservedLength = splittingComponent.getControlPoint().getLength();
                double newLength = newComponent.getControlPoint().getLength();
                
                
@@ -1912,21 +1913,20 @@ public class PipingRules {
                vn.interpolate(next, 0.5);
                
                
-               PipeControlPoint newVariableLengthCP = null;//insertStraight(pcp1, pcp2, pos, length);
                if (nextCP == null) {
                        newCP.insert(splittingCP, Direction.NEXT);
-                       newVariableLengthCP = insertStraight(newCP, Direction.NEXT, new Vector3d(vn), ln);
+                       insertStraight(newCP, Direction.NEXT, new Vector3d(vn), ln);
                        splittingCP.setWorldPosition(new Vector3d(vp));
 //                     ControlPointTools.setWorldPosition(splittingCP, vp);
 //                     splittingCP.setRelatedScalarDouble(ProcessResource.plant3Dresource.HasLength, lp);
                } else if (prevCP == null) {
                        newCP.insert(splittingCP, Direction.PREVIOUS);
-                       newVariableLengthCP = insertStraight(newCP, Direction.PREVIOUS, new Vector3d(vp), lp);
+                       insertStraight(newCP, Direction.PREVIOUS, new Vector3d(vp), lp);
                        splittingCP.setWorldPosition(new Vector3d(vn));
 //                     splittingCP.setRelatedScalarDouble(ProcessResource.plant3Dresource.HasLength, ln);
                } else {
                        newCP.insert(splittingCP, nextCP);
-                       newVariableLengthCP = insertStraight(newCP, nextCP, new Vector3d(vn), ln);
+                       insertStraight(newCP, nextCP, new Vector3d(vn), ln);
                        splittingCP.setWorldPosition(new Vector3d(vp));
 //                     splittingCP.setRelatedScalarDouble(ProcessResource.plant3Dresource.HasLength, lp);
                }
index fb065f111f98b84c9d7ebf4ee27cb85ac4517190..4e3571444ae3bf759436fe01054330cf586b197b 100644 (file)
@@ -5,7 +5,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import javax.vecmath.Point3d;
 import javax.vecmath.Vector3d;
 
 import org.simantics.Simantics;
@@ -356,6 +355,8 @@ public class ComponentUtils {
                                        pipeRun = toPcp.getPipeRun();
                                }
                                break;
+                       default:
+                               break;
                        }
                        Vector3d start = new Vector3d();
                        Vector3d end = new Vector3d();
@@ -372,6 +373,8 @@ public class ComponentUtils {
                        case SPLIT:
                                pos = new Vector3d(toPcp.getWorldPosition());
                                break;
+                       default:
+                               break;
                        }
 
                } else if (toPcp.isDirected()) {
@@ -433,6 +436,8 @@ public class ComponentUtils {
                                break;
                        case SPLIT:
                                break;
+                       default:
+                               break;
                        }
                        
                        switch (position) {
@@ -450,6 +455,8 @@ public class ComponentUtils {
                                break;
                        case SPLIT:
                                PipingRules.splitVariableLengthComponent(newComponent, (InlineComponent)component, true);
+                       default:
+                               break;
                        }
                } else {
                        PipeRun other = new PipeRun();
@@ -479,6 +486,8 @@ public class ComponentUtils {
                                break;
                        case SPLIT:
                                break;
+                       default:
+                               break;
                        }
                        newPcp.setWorldPosition(pos);
                        
@@ -559,7 +568,6 @@ public class ComponentUtils {
                                // Runs do not have compatible specs, and a reducer must be attached in between.
                                InlineComponent reducer = ComponentUtils.createReducer(root);
                                PipeControlPoint pcp = reducer.getControlPoint();
-                               PipeControlPoint ocp = pcp.getSubPoint().get(0);
                                
                                Vector3d endPos = endCP.getWorldPosition();
                                Vector3d currentPos = currentCP.getWorldPosition();
index 65b93cffd2688102500fb30a0b67dce44949c87f..cb46546ed1371a133eb866fb527036cf035dc001 100644 (file)
@@ -69,7 +69,7 @@ public class P3DUtil {
                
                @Override
                public List<Item> perform(ReadGraph graph) throws DatabaseException {
-                       Resource project = Simantics.getProject().get();
+//                     Resource project = Simantics.getProject().get();
                        Resource builtins = graph.getResource(libUri);
                        List<Item> actions = new ArrayList<>();
 //                     actions.addAll(getItems(graph, project,type));
index 5b95169747c88eebcb22d3a011b7f78e7a151f55..ed43df676995c450f05e545e8bf76eb4ca4521e7 100644 (file)
@@ -5,11 +5,6 @@
        <projects>
        </projects>
        <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
                <buildCommand>
                        <name>org.eclipse.pde.ManifestBuilder</name>
                        <arguments>
@@ -23,6 +18,5 @@
        </buildSpec>
        <natures>
                <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
        </natures>
 </projectDescription>
index 34d2e4d2dad529ceaeb953bfcdb63c51d69ffed2..7594fab8d5994048759939b169d40a6f48dad67e 100644 (file)
@@ -1,4 +1,2 @@
-source.. = src/
-output.. = bin/
 bin.includes = META-INF/,\
                .
index 562595640f4b2262f7687178c8cd3d3e0e3ddae8..2784838877c5b2527fd9c2053721ed46b546956f 100644 (file)
@@ -24,6 +24,7 @@ import org.eclipse.swt.internal.DPIUtil;
  *            Commissariat a l'Energie Atomique et aux Energies Alternatives,
  *            15 avenue des Sablieres, CS 60001, 33116 Le Barp, France.
  */
+@SuppressWarnings("restriction")
 public class vtkSwtInteractorForwarderDecorator extends vtkInteractorForwarder
 implements MouseListener, MouseMoveListener, MouseTrackListener, MouseWheelListener, KeyListener {
 
index c905a72f3020a614d6fdce63f13ca87af3376478..6cb4895327583c2d3a5a46fc950ed89fbd06a297 100644 (file)
@@ -27,6 +27,7 @@ import vtk.vtkRenderer;
  *            Commissariat a l'Energie Atomique et aux Energies Alternatives,
  *            15 avenue des Sablieres, CS 60001, 33116 Le Barp, France.
  */
+@SuppressWarnings("restriction")
 public abstract class vtkAbstractComponent<T> implements vtkComponent<T> {
   protected vtkRenderWindow renderWindow;
   protected vtkRenderer renderer;
index 2214f1771df861bf871b39912b69c4bf10e8464c..fe987f73bbc88ee5246375fe54d4cb7d8c95487e 100644 (file)
@@ -5,11 +5,6 @@
        <projects>
        </projects>
        <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
                <buildCommand>
                        <name>org.eclipse.pde.ManifestBuilder</name>
                        <arguments>
@@ -23,6 +18,5 @@
        </buildSpec>
        <natures>
                <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
        </natures>
 </projectDescription>
index e621548a502c60c13360278da31941a5b98e80b8..eddd902b9016b82ef61a3653c1a87e460d7256af 100644 (file)
@@ -1,5 +1,3 @@
-source.. = src/
-output.. = bin/
 bin.includes = META-INF/,\
                .,\
                vtkChartsCore.dll,\