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
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.diagram.flag;
\r
14 import java.awt.Shape;
\r
15 import java.awt.geom.Rectangle2D;
\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
22 * @author Tuukka Lehtonen
\r
24 public class FlagInfoImpl implements FlagInfo {
\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
33 public FlagInfoImpl(Shape shape, String[] text, Type type, Rectangle2D textArea,
\r
34 Alignment horizontalAlignment, Alignment verticalAlignment) {
\r
38 this.textArea = textArea;
\r
39 this.horizontalAlignment = horizontalAlignment;
\r
40 this.verticalAlignment = verticalAlignment;
\r
44 public Shape getShape() {
\r
49 public String[] getText() {
\r
54 public Type getType() {
\r
59 public Rectangle2D getTextArea() {
\r
64 public Alignment getHorizontalAlignment() {
\r
65 return horizontalAlignment;
\r
69 public Alignment getVerticalAlignment() {
\r
70 return verticalAlignment;
\r