]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.diagram/src/org/simantics/diagram/flag/IFlagType.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.diagram / src / org / simantics / diagram / flag / IFlagType.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.diagram.flag;\r
13 \r
14 import java.awt.Shape;\r
15 import java.awt.geom.Rectangle2D;\r
16 \r
17 import org.simantics.db.ReadGraph;\r
18 import org.simantics.db.exception.DatabaseException;\r
19 import org.simantics.g2d.elementclass.FlagClass;\r
20 import org.simantics.g2d.utils.Alignment;\r
21 \r
22 /**\r
23  * @author Tuukka Lehtonen\r
24  */\r
25 public interface IFlagType {\r
26 \r
27     /**\r
28      * @author Tuukka Lehtonen\r
29      * @see FlagInfoImpl\r
30      */\r
31     public interface FlagInfo {\r
32         Shape getShape();\r
33         String[] getText();\r
34         Rectangle2D getTextArea();\r
35         FlagClass.Type getType();\r
36         Alignment getHorizontalAlignment();\r
37         Alignment getVerticalAlignment();\r
38     }\r
39 \r
40     /**\r
41      * Reads and calculates information about this flags graphical\r
42      * representation.\r
43      * \r
44      * @param graph database read access\r
45      * @return all info gathered up about the flag\r
46      * @throws DatabaseException\r
47      */\r
48     FlagInfo getInfo(ReadGraph graph) throws DatabaseException;\r
49 \r
50 }\r