X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d.vtk%2Fsrc%2Forg%2Fsimantics%2Fg3d%2Fvtk%2Fcommon%2FSelectionHighlighter.java;h=69ed83e2d2dea1857494b445e2635dc0e4ed127e;hb=9070983be64f9f107e0a6388549aad475fcd9d76;hp=95ba7aee2ef852e827a1070aa3c9dda48c15405f;hpb=9c5be9fa9ff5fece5710b9f21bcafca58388899d;p=simantics%2F3d.git diff --git a/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/SelectionHighlighter.java b/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/SelectionHighlighter.java index 95ba7aee..69ed83e2 100644 --- a/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/SelectionHighlighter.java +++ b/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/SelectionHighlighter.java @@ -32,23 +32,22 @@ import vtk.vtkAlgorithm; import vtk.vtkAlgorithmOutput; import vtk.vtkFeatureEdges; import vtk.vtkMapper; -import vtk.vtkPanel; import vtk.vtkProp; import vtk.vtkProperty; -public class SelectionHighlighter implements ISelectionChangedListener{ +public class SelectionHighlighter implements ISelectionChangedListener{ - vtkPanel panel; - VTKNodeMap nodeMap; + protected VtkView panel; + protected VTKNodeMap nodeMap; - List selectedNodes = new ArrayList(); - List selectedActors = new ArrayList(); + protected List selectedNodes = new ArrayList(); + protected List selectedActors = new ArrayList(); - HighlightObjectType type = HighlightObjectType.Node; + protected HighlightObjectType type = HighlightObjectType.Node; - public SelectionHighlighter(vtkPanel panel, VTKNodeMap nodeMap) { + public SelectionHighlighter(VtkView panel, VTKNodeMap nodeMap) { this.panel = panel; this.nodeMap = nodeMap; } @@ -57,7 +56,7 @@ public class SelectionHighlighter implements ISelectionChang public void selectionChanged(SelectionChangedEvent event) { final ISelection s = event.getSelection(); - if (Thread.currentThread().equals(AWTThread.getThreadAccess().getThread())) + if (Thread.currentThread().equals(panel.getThreadQueue().getThread())) highlight(s); else { ThreadUtils.asyncExec(AWTThread.getThreadAccess(), new Runnable() { @@ -65,8 +64,8 @@ public class SelectionHighlighter implements ISelectionChang public void run() { highlight(s); //System.out.println(this.getClass().getName() + " highlight "); - panel.Render(); - //panel.repaint(); + //panel.Render(); + panel.refresh(); } }); } @@ -144,7 +143,7 @@ public class SelectionHighlighter implements ISelectionChang selectedActors.addAll(currentSelectedActors); } if (changed) { - panel.repaint(); + panel.refresh(); } } @@ -172,7 +171,7 @@ public class SelectionHighlighter implements ISelectionChang } - protected void setColor(E node, boolean edge, double color[]) { + public void setColor(E node, boolean edge, double color[]) { for (vtkProp prop : nodeMap.getRenderObjects(node)) { if (prop instanceof vtkActor) { vtkActor act = (vtkActor)prop;