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