]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/impl/BranchPointTerminal.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / element / handler / impl / BranchPointTerminal.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.g2d.element.handler.impl;
13
14 import java.awt.Shape;
15 import java.awt.geom.AffineTransform;
16 import java.awt.geom.Point2D;
17
18 import org.simantics.g2d.utils.geom.DirectionSet;
19
20 /**
21  * @author Tuukka Lehtonen
22  */
23 public class BranchPointTerminal extends ObjectTerminal {
24
25 //    public static final Object NEW_BRANCH_POINT_DATA      = new Object();
26     public static final Object EXISTING_BRANCH_POINT_DATA = new Object() {
27         @Override
28         public String toString() { return "EXISTING_BRANCH_POINT"; }
29     };
30
31     private BranchPointTerminal(Object o, AffineTransform transform, DirectionSet ds, Shape shape) {
32         super(o, transform, ds, shape);
33     }
34
35 //    public static BranchPointTerminal newTerminal(AffineTransform transform, DirectionSet ds, Shape shape) {
36 //        return new BranchPointTerminal(NEW_BRANCH_POINT_DATA, transform, ds, shape);
37 //    }
38
39     public static BranchPointTerminal existingTerminal(AffineTransform transform, DirectionSet ds, Shape shape) {
40         return new BranchPointTerminal(EXISTING_BRANCH_POINT_DATA, transform, ds, shape);
41     }
42
43     public static BranchPointTerminal existingTerminal(Point2D p, DirectionSet ds, Shape shape) {
44         return existingTerminal(AffineTransform.getTranslateInstance(p.getX(), p.getY()), ds, shape);
45     }
46
47 }