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.g2d.element.handler.impl;
14 import java.awt.Shape;
15 import java.awt.geom.AffineTransform;
16 import java.awt.geom.Point2D;
18 import org.simantics.g2d.utils.geom.DirectionSet;
21 * @author Tuukka Lehtonen
23 public class BranchPointTerminal extends ObjectTerminal {
25 // public static final Object NEW_BRANCH_POINT_DATA = new Object();
26 public static final Object EXISTING_BRANCH_POINT_DATA = new Object() {
28 public String toString() { return "EXISTING_BRANCH_POINT"; }
31 private BranchPointTerminal(Object o, AffineTransform transform, DirectionSet ds, Shape shape) {
32 super(o, transform, ds, shape);
35 // public static BranchPointTerminal newTerminal(AffineTransform transform, DirectionSet ds, Shape shape) {
36 // return new BranchPointTerminal(NEW_BRANCH_POINT_DATA, transform, ds, shape);
39 public static BranchPointTerminal existingTerminal(AffineTransform transform, DirectionSet ds, Shape shape) {
40 return new BranchPointTerminal(EXISTING_BRANCH_POINT_DATA, transform, ds, shape);
43 public static BranchPointTerminal existingTerminal(Point2D p, DirectionSet ds, Shape shape) {
44 return existingTerminal(AffineTransform.getTranslateInstance(p.getX(), p.getY()), ds, shape);