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