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