]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/EditorState.java
Configurable connection crossing styles
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / diagramEditor / EditorState.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2011 Association for Decentralized Information Management in
3  * Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.modeling.ui.diagramEditor;
13
14 import java.awt.geom.AffineTransform;
15 import java.util.Collections;
16 import java.util.Set;
17
18 import org.simantics.db.Resource;
19 import org.simantics.g2d.canvas.Hints;
20 import org.simantics.g2d.canvas.IToolMode;
21
22 /**
23  * @author Tuukka Lehtonen
24  */
25 public class EditorState {
26
27     public AffineTransform viewTransform;
28
29     public Set<Resource>   selection = Collections.emptySet();
30
31     public String          toolMode;
32
33     public IToolMode toToolMode() {
34         if (Hints.POINTERTOOL.getId().equals(toolMode))
35             return Hints.POINTERTOOL;
36         else if (Hints.PANTOOL.getId().equals(toolMode))
37             return Hints.PANTOOL;
38         else if (Hints.CONNECTTOOL.getId().equals(toolMode))
39             return Hints.CONNECTTOOL;
40         return null;
41     }
42
43 }