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