]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d/src/org/simantics/g2d/elementclass/FlagHandler.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / elementclass / FlagHandler.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\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
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.g2d.elementclass;\r
13 \r
14 import org.simantics.g2d.diagram.IDiagram;\r
15 import org.simantics.g2d.element.IElement;\r
16 import org.simantics.g2d.element.ElementClass.Single;\r
17 import org.simantics.g2d.element.handler.ElementHandler;\r
18 \r
19 /**\r
20  * @author Tuukka Lehtonen\r
21  */\r
22 @Single\r
23 public interface FlagHandler extends ElementHandler {\r
24 \r
25     FlagClass.Type getType(IElement e);\r
26     void setType(IElement e, FlagClass.Type type);\r
27 \r
28     boolean isExternal(IElement e);\r
29     /**\r
30      * A flag can be set as external only when it is not connected.\r
31      * \r
32      * @param e\r
33      * @param external\r
34      * @return\r
35      */\r
36     void setExternal(IElement e, boolean external);\r
37 \r
38     void connect(IElement e1, IElement e2);\r
39 \r
40     /**\r
41      * @param e1 the element to connect\r
42      * @param o1 the back-end object of e1\r
43      * @param o2 the other object o1 is connected to or <code>null</code> if\r
44      *        disconnected\r
45      */\r
46     void connectData(IElement e1, Object o1, Object o2);\r
47 \r
48     FlagClass.Connection<IElement> getConnection(IElement e);\r
49     FlagClass.Connection<Object> getConnectionData(IElement e);\r
50 \r
51     void disconnect(IElement e);\r
52 \r
53     boolean isWithinDiagram(IDiagram d, FlagClass.Connection<?> c);\r
54     IElement getCorrespondence(IElement end);\r
55 \r
56 }\r