1 package org.simantics.processeditor.adapters;
\r
3 import java.util.List;
\r
5 import org.simantics.proconf.g3d.base.ScenegraphAdapter;
\r
6 import org.simantics.proconf.g3d.base.SelectionAdapter;
\r
7 import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;
\r
8 import org.simantics.proconf.g3d.scenegraph.ISelectableNode;
\r
10 public class ProcessEditorSelectionAdapter extends SelectionAdapter {
\r
13 public ProcessEditorSelectionAdapter(ScenegraphAdapter adapter) {
\r
18 public void setEditorSelection() {
\r
19 List<IGraphicsNode> sel = getSelectedObjects();
\r
20 for (IGraphicsNode o : adapter.getNodes())
\r
21 if (o instanceof ISelectableNode) {
\r
22 if (sel.contains(o)) {
\r
23 ((ISelectableNode)o).setSelected(true);
\r
25 ((ISelectableNode)o).setSelected(false);
\r
30 public void setEditorSelection(boolean addShapes) {
\r
32 List<IGraphicsNode> sel = getSelectedObjects();
\r
33 for (IGraphicsNode o : adapter.getNodes())
\r
34 if (o instanceof ISelectableNode) {
\r
35 if (sel.contains(o)) {
\r
36 ((ISelectableNode)o).setSelected(true);
\r
38 ((ISelectableNode)o).setSelected(false);
\r
44 protected void setEditorHighlightSelection() {
\r
45 List<IGraphicsNode> sel = getInteractiveSelectedObjects();
\r
46 for (IGraphicsNode o : adapter.getNodes())
\r
47 if (o instanceof ISelectableNode) {
\r
48 if (sel.contains(o)) {
\r
49 ((ISelectableNode)o).setHighlighted(true);
\r
51 ((ISelectableNode)o).setHighlighted(false);
\r