1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2011 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.modeling.ui.diagramEditor;
\r
14 import java.awt.geom.AffineTransform;
\r
15 import java.util.Collections;
\r
16 import java.util.Set;
\r
18 import org.simantics.db.Resource;
\r
19 import org.simantics.g2d.canvas.Hints;
\r
20 import org.simantics.g2d.canvas.IToolMode;
\r
23 * @author Tuukka Lehtonen
\r
25 public class EditorState {
\r
27 public AffineTransform viewTransform;
\r
29 public Set<Resource> selection = Collections.emptySet();
\r
31 public String toolMode;
\r
33 public IToolMode toToolMode() {
\r
34 if (Hints.POINTERTOOL.getId().equals(toolMode))
\r
35 return Hints.POINTERTOOL;
\r
36 else if (Hints.PANTOOL.getId().equals(toolMode))
\r
37 return Hints.PANTOOL;
\r
38 else if (Hints.CONNECTTOOL.getId().equals(toolMode))
\r
39 return Hints.CONNECTTOOL;
\r