1 /*******************************************************************************
\r
2 * Copyright (c) 2007- VTT Technical Research Centre of Finland.
\r
3 * All rights reserved. This program and the accompanying materials
\r
4 * are made available under the terms of the Eclipse Public License v1.0
\r
5 * which accompanies this distribution, and is available at
\r
6 * http://www.eclipse.org/legal/epl-v10.html
\r
9 * VTT Technical Research Centre of Finland - initial API and implementation
\r
10 *******************************************************************************/
\r
11 package org.simantics.processeditor.adapters;
\r
13 import java.util.List;
\r
15 import org.simantics.proconf.g3d.base.ScenegraphAdapter;
\r
16 import org.simantics.proconf.g3d.base.SelectionAdapter;
\r
17 import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;
\r
18 import org.simantics.proconf.g3d.scenegraph.ISelectableNode;
\r
20 public class ProcessEditorSelectionAdapter extends SelectionAdapter {
\r
23 public ProcessEditorSelectionAdapter(ScenegraphAdapter adapter) {
\r
28 public void setEditorSelection() {
\r
29 List<IGraphicsNode> sel = getSelectedObjects();
\r
30 for (IGraphicsNode o : adapter.getNodes())
\r
31 if (o instanceof ISelectableNode) {
\r
32 if (sel.contains(o)) {
\r
33 ((ISelectableNode)o).setSelected(true);
\r
35 ((ISelectableNode)o).setSelected(false);
\r
42 protected void setEditorHighlightSelection() {
\r
43 List<IGraphicsNode> sel = getInteractiveSelectedObjects();
\r
44 for (IGraphicsNode o : adapter.getNodes())
\r
45 if (o instanceof ISelectableNode) {
\r
46 if (sel.contains(o)) {
\r
47 ((ISelectableNode)o).setHighlighted(true);
\r
49 ((ISelectableNode)o).setHighlighted(false);
\r