From: Marko Luukkainen Date: Wed, 23 Oct 2019 07:42:56 +0000 (+0300) Subject: Customise camera and selector action X-Git-Tag: v1.43.0~178 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=7531a473ca1fa611ae1a1b84b09f89effd4fa919;p=simantics%2F3d.git Customise camera and selector action gitlab #29 Change-Id: I5bc9d1511c3a3f714b38888a32861de712aa8a2e --- diff --git a/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/swt/vtkCameraAndSelectorAction.java b/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/swt/vtkCameraAndSelectorAction.java index 56255631..7eb4cfc9 100644 --- a/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/swt/vtkCameraAndSelectorAction.java +++ b/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/swt/vtkCameraAndSelectorAction.java @@ -194,8 +194,8 @@ public class vtkCameraAndSelectorAction extends vtkSwtAction implements ISelecti return true; } - private List selectActors = new ArrayList(); - private List hoverActor = new ArrayList(); + protected List selectActors = new ArrayList(); + protected List hoverActor = new ArrayList(); @Override public boolean mouseClicked(MouseEvent e) { @@ -327,7 +327,7 @@ public class vtkCameraAndSelectorAction extends vtkSwtAction implements ISelecti fireSelectionChanged(); } - private void fireSelectionChanged() { + protected void fireSelectionChanged() { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java b/org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java index 8387650b..82d592c4 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java @@ -132,7 +132,7 @@ public class Plant3DEditor extends ResourceEditorPart { new ContextMenuListener(panel, contextMenu); - cameraAction = new vtkCameraAndSelectorAction(panel); + cameraAction = createCameraAction(); panel.setDefaultAction(cameraAction); panel.useDefaultAction(); panel.setPickType(4); @@ -208,6 +208,10 @@ public class Plant3DEditor extends ResourceEditorPart { } + protected vtkCameraAndSelectorAction createCameraAction() { + return new vtkCameraAndSelectorAction(panel); + } + protected void createActions() { translateAction = new TranslateAction(panel,nodeMap); translateInlineAction = new TranslateInlineAction(panel, nodeMap);