-/*******************************************************************************\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.NodeHighlighter;
+import org.simantics.g3d.scenegraph.NodeHighlighter.HighlightEventType;
+import org.simantics.g3d.scenegraph.base.INode;
+
+public class HoverHighlighter<DBObject> extends SelectionHighlighter<DBObject> {
+
+ public HoverHighlighter(VtkView panel, VTKNodeMap<DBObject,?> nodeMap) {
+ super(panel, nodeMap);
+ }
+
+ @Override
+ protected void highlight(ISelection s) {
+ highlight(s, HighlightEventType.Hover, HighlightEventType.ClearHover);
+ }
+
+ @Override
+ protected void hilight(INode 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);
+ }
+ }
+
+ @Override
+ protected void setDefaultColor(INode node) {
+ double color[] = new double[]{0,0,0};
+ setColor(node, true, color);
+ }
+
+ @Override
+ protected void setSelectedColor(INode node) {
+ double color[] = new double[]{1,0,1};
+ setColor(node, true, color);
+ }
+
+}