]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d/src/org/simantics/g2d/routing/IConnection.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / routing / IConnection.java
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
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.g2d.routing;\r
13 \r
14 import java.awt.geom.Path2D;\r
15 import java.awt.geom.Rectangle2D;\r
16 import java.util.Collection;\r
17 \r
18 public interface IConnection {\r
19     \r
20     public class Connector {    \r
21         public double x, y;\r
22         public int allowedDirections;\r
23         public Rectangle2D parentObstacle;\r
24         \r
25         public Connector() {\r
26             allowedDirections = 0xf;\r
27         }\r
28         \r
29         public Connector(double x, double y, int allowedDirections,\r
30             Rectangle2D parentObstacle) {\r
31             this.x = x;\r
32             this.y = y;\r
33             this.allowedDirections = allowedDirections;\r
34             this.parentObstacle = parentObstacle;\r
35         }\r
36     }    \r
37     \r
38     Collection<? extends Object> getSegments();\r
39     Connector getBegin(Object seg);\r
40     Connector getEnd(Object seg);\r
41     \r
42     void setPath(Object seg, Path2D path);    \r
43     \r
44 }\r