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