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
32 protected void setEditorHighlightSelection() {
\r
33 List<IGraphicsNode> sel = getInteractiveSelectedObjects();
\r
34 for (IGraphicsNode o : adapter.getNodes())
\r
35 if (o instanceof ISelectableNode) {
\r
36 if (sel.contains(o)) {
\r
37 ((ISelectableNode)o).setHighlighted(true);
\r
39 ((ISelectableNode)o).setHighlighted(false);
\r