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;
15 import java.awt.Shape;
16 import java.awt.geom.Rectangle2D;
18 import org.simantics.diagram.flag.IFlagType.FlagInfo;
19 import org.simantics.g2d.elementclass.FlagClass.Type;
20 import org.simantics.g2d.utils.Alignment;
23 * @author Tuukka Lehtonen
25 public class FlagInfoImpl implements FlagInfo {
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;
35 public FlagInfoImpl(Shape shape, String[] text, Type type, Rectangle2D textArea,
36 Alignment horizontalAlignment, Alignment verticalAlignment, Font font) {
40 this.textArea = textArea;
41 this.horizontalAlignment = horizontalAlignment;
42 this.verticalAlignment = verticalAlignment;
47 public Shape getShape() {
52 public String[] getText() {
57 public Type getType() {
62 public Rectangle2D getTextArea() {
67 public Alignment getHorizontalAlignment() {
68 return horizontalAlignment;
72 public Alignment getVerticalAlignment() {
73 return verticalAlignment;
77 public Font getFont() {