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