]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.diagram/src/org/simantics/diagram/flag/FlagInfoImpl.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.diagram / src / org / simantics / diagram / flag / FlagInfoImpl.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.diagram.flag.IFlagType.FlagInfo;\r
18 import org.simantics.g2d.elementclass.FlagClass.Type;\r
19 import org.simantics.g2d.utils.Alignment;\r
20 \r
21 /**\r
22  * @author Tuukka Lehtonen\r
23  */\r
24 public class FlagInfoImpl implements FlagInfo {\r
25 \r
26     private final Shape       shape;\r
27     private final String[]    text;\r
28     private final Type        type;\r
29     private final Rectangle2D textArea;\r
30     private final Alignment   horizontalAlignment;\r
31     private final Alignment   verticalAlignment;\r
32 \r
33     public FlagInfoImpl(Shape shape, String[] text, Type type, Rectangle2D textArea,\r
34             Alignment horizontalAlignment, Alignment verticalAlignment) {\r
35         this.shape = shape;\r
36         this.text = text;\r
37         this.type = type;\r
38         this.textArea = textArea;\r
39         this.horizontalAlignment = horizontalAlignment;\r
40         this.verticalAlignment = verticalAlignment;\r
41     }\r
42 \r
43     @Override\r
44     public Shape getShape() {\r
45         return shape;\r
46     }\r
47 \r
48     @Override\r
49     public String[] getText() {\r
50         return text;\r
51     }\r
52 \r
53     @Override\r
54     public Type getType() {\r
55         return type;\r
56     }\r
57 \r
58     @Override\r
59     public Rectangle2D getTextArea() {\r
60         return textArea;\r
61     }\r
62 \r
63     @Override\r
64     public Alignment getHorizontalAlignment() {\r
65         return horizontalAlignment;\r
66     }\r
67 \r
68     @Override\r
69     public Alignment getVerticalAlignment() {\r
70         return verticalAlignment;\r
71     }\r
72 \r
73 }\r