-/*******************************************************************************\r
- * Copyright (c) 2011 Association for Decentralized Information Management in\r
- * Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.diagram.connection;\r
-\r
-import gnu.trove.map.hash.THashMap;\r
-\r
-import java.util.Comparator;\r
-\r
-public abstract class RoutePoint {\r
- \r
- public static final Comparator<RoutePoint> X_COMPARATOR = new Comparator<RoutePoint>() {\r
- @Override\r
- public int compare(RoutePoint a, RoutePoint b) {\r
- return Double.compare(a.x, b.x);\r
- }\r
- };\r
- \r
- public static final Comparator<RoutePoint> Y_COMPARATOR = new Comparator<RoutePoint>() {\r
- @Override\r
- public int compare(RoutePoint a, RoutePoint b) {\r
- return Double.compare(a.y, b.y);\r
- }\r
- };\r
- \r
- double x;\r
- double y;\r
-\r
- public RoutePoint() {\r
- }\r
- \r
- public RoutePoint(double x, double y) {\r
- this.x = x;\r
- this.y = y;\r
- }\r
- \r
- public double getX() {\r
- return x;\r
- }\r
- \r
- public double getY() {\r
- return y;\r
- }\r
-\r
- void removeFromOther(RouteLine routeLine) {\r
- }\r
-\r
- public boolean isNear(double x2, double y2, double tolerance) {\r
- double dx = x2-x;\r
- double dy = y2-y;\r
- \r
- return dx*dx + dy*dy <= tolerance*tolerance;\r
- }\r
-\r
- abstract RoutePoint copy(THashMap<Object, Object> map);\r
- \r
- \r
- public void setX(double x) {\r
- this.x = x;\r
- }\r
- \r
- public void setY(double y) {\r
- this.y = y;\r
- }\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2011 Association for Decentralized Information Management in
+ * Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.diagram.connection;
+
+import gnu.trove.map.hash.THashMap;
+
+import java.util.Comparator;
+
+public abstract class RoutePoint {
+
+ public static final Comparator<RoutePoint> X_COMPARATOR = new Comparator<RoutePoint>() {
+ @Override
+ public int compare(RoutePoint a, RoutePoint b) {
+ return Double.compare(a.x, b.x);
+ }
+ };
+
+ public static final Comparator<RoutePoint> Y_COMPARATOR = new Comparator<RoutePoint>() {
+ @Override
+ public int compare(RoutePoint a, RoutePoint b) {
+ return Double.compare(a.y, b.y);
+ }
+ };
+
+ double x;
+ double y;
+
+ public RoutePoint() {
+ }
+
+ public RoutePoint(double x, double y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ public double getX() {
+ return x;
+ }
+
+ public double getY() {
+ return y;
+ }
+
+ void removeFromOther(RouteLine routeLine) {
+ }
+
+ public boolean isNear(double x2, double y2, double tolerance) {
+ double dx = x2-x;
+ double dy = y2-y;
+
+ return dx*dx + dy*dy <= tolerance*tolerance;
+ }
+
+ abstract RoutePoint copy(THashMap<Object, Object> map);
+
+
+ public void setX(double x) {
+ this.x = x;
+ }
+
+ public void setY(double y) {
+ this.y = y;
+ }
+}