]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/HoverHighlighter.java
Using SWT thread with Plant3d
[simantics/3d.git] / org.simantics.g3d.vtk / src / org / simantics / g3d / vtk / common / HoverHighlighter.java
index f80af054dd466c8921d3e9c38cd8dda54879ac73..7acb3f547adc3ced76f6e0e1932e69fcefbae73b 100644 (file)
@@ -1,55 +1,53 @@
-/*******************************************************************************\r
- * Copyright (c) 2012, 2013 Association for Decentralized Information Management in\r
- * Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.g3d.vtk.common;\r
-\r
-import org.eclipse.jface.viewers.ISelection;\r
-import org.simantics.g3d.scenegraph.IG3DNode;\r
-import org.simantics.g3d.scenegraph.NodeHighlighter;\r
-import org.simantics.g3d.scenegraph.NodeHighlighter.HighlightEventType;\r
-\r
-import vtk.vtkPanel;\r
-\r
-public class HoverHighlighter extends SelectionHighlighter {\r
-\r
-\r
-       public HoverHighlighter(vtkPanel panel, VTKNodeMap nodeMap) {\r
-               super(panel, nodeMap);\r
-               \r
-       }\r
-       \r
-       protected void highlight(ISelection s) {\r
-               highlight(s, HighlightEventType.Hover, HighlightEventType.ClearHover);\r
-       }\r
-       \r
-       protected void hilight(IG3DNode node, HighlightEventType type) {\r
-               if (node instanceof NodeHighlighter) {\r
-                       ((NodeHighlighter)node).highlight(type);\r
-                       return;\r
-               }\r
-               if (type == HighlightEventType.Hover) {\r
-                       setSelectedColor(node);\r
-               } else if (type == HighlightEventType.ClearHover) {\r
-                       setDefaultColor(node);\r
-               }\r
-       }\r
-\r
-       protected void setDefaultColor(IG3DNode node) {\r
-               double color[] = new double[]{0,0,0};\r
-               setColor(node, true, color);\r
-       }\r
-       \r
-       protected void setSelectedColor(IG3DNode node) {\r
-               double color[] = new double[]{1,0,1};\r
-               setColor(node, true, color);\r
-       }\r
-       \r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Association for Decentralized Information Management in
+ * Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+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;
+
+public class HoverHighlighter extends SelectionHighlighter {
+
+
+       public HoverHighlighter(VtkView panel, VTKNodeMap nodeMap) {
+               super(panel, nodeMap);
+               
+       }
+       
+       protected void highlight(ISelection s) {
+               highlight(s, HighlightEventType.Hover, HighlightEventType.ClearHover);
+       }
+       
+       protected void hilight(IG3DNode node, HighlightEventType type) {
+               if (node instanceof NodeHighlighter) {
+                       ((NodeHighlighter)node).highlight(type);
+                       return;
+               }
+               if (type == HighlightEventType.Hover) {
+                       setSelectedColor(node);
+               } else if (type == HighlightEventType.ClearHover) {
+                       setDefaultColor(node);
+               }
+       }
+
+       protected void setDefaultColor(IG3DNode node) {
+               double color[] = new double[]{0,0,0};
+               setColor(node, true, color);
+       }
+       
+       protected void setSelectedColor(IG3DNode node) {
+               double color[] = new double[]{1,0,1};
+               setColor(node, true, color);
+       }
+       
+}