]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/BendsHandler.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / element / handler / BendsHandler.java
index 1d6290c19c9af930f9e3cb10f9f8d7c8428fcc2e..2a9f0af0ea8f0eeef749ee068a0cc6c5732e6250 100644 (file)
-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in 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.g2d.element.handler;\r
-\r
-import java.awt.geom.Path2D;\r
-import java.awt.geom.Point2D;\r
-import java.util.List;\r
-\r
-import org.simantics.g2d.diagram.handler.Topology;\r
-import org.simantics.g2d.element.IElement;\r
-import org.simantics.g2d.element.ElementClass.Single;\r
-\r
-/**\r
- * Interface for adapting editing edge bends between information models.\r
- * \r
- * Bend is a control point of an edge. The path of an edge follows thru all its \r
- * edges.  \r
- * \r
- * @see Topology \r
- * @author Toni Kalajainen\r
- */\r
-@Single\r
-public interface BendsHandler extends ElementHandler { \r
-\r
-       /** Information for painter */\r
-       public static enum AngleType { \r
-               Line,                           /* Straight from begin to end */ \r
-               RightAngled,            /* 90-degree angles */\r
-               Linear,                         /* 1st degree lines, free angles */\r
-               Quadratic                       /* 3rd degree line segments */\r
-               // FIXME: 2nd, not 3rd degree ?\r
-       }\r
-       AngleType getAngleType(IElement e);\r
-       void setAngleType(IElement e, AngleType angleType);\r
-       \r
-       public interface Bend {}\r
-       \r
-       /**\r
-        * Get bends\r
-        * @param e\r
-        * @param bends collection to be filled with bends\r
-        */\r
-       void getBends(IElement e, List<Bend> bends);\r
-       \r
-       \r
-       /**\r
-        * Get bend position in element coordinate system\r
-        * \r
-        * @param e\r
-        * @param b\r
-        * @param pos point object to be filled with the position (not null) \r
-        * @return point object pos \r
-        */\r
-       void getBendPosition(IElement e, Bend b, Point2D pos);\r
-       \r
-       /**\r
-        * Add bend\r
-        * @param e\r
-        * @param index\r
-        * @param pos element coordinate system position\r
-        * @return\r
-        */\r
-       Bend addBend(IElement e, int index, Point2D pos);\r
-       \r
-       /**\r
-        * Set bends\r
-        * @param e\r
-        * @param bends\r
-        * @return true if successful \r
-        */\r
-       boolean removeBend(IElement e, Bend b);\r
-       \r
-       /**\r
-        * move position of a bend\r
-        * @param e\r
-        * @param b\r
-        * @param pos position in element coordinate system\r
-        */\r
-       void moveBend(IElement e, Bend b, Point2D pos); \r
-       \r
-       /**\r
-        * Get bends count\r
-        * @param e bends\r
-        * @return bends count\r
-        */\r
-       int getBendsCount(IElement e);\r
-       \r
-       /**\r
-        * Get Element path\r
-        * @param e\r
-        * @return\r
-        */\r
-       Path2D getPath(IElement e);\r
-       \r
-       /**\r
-        * Set element path\r
-        * @param e\r
-        * @param p\r
-        */\r
-       void setPath(IElement e, Path2D p);\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 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.g2d.element.handler;
+
+import java.awt.geom.Path2D;
+import java.awt.geom.Point2D;
+import java.util.List;
+
+import org.simantics.g2d.diagram.handler.Topology;
+import org.simantics.g2d.element.IElement;
+import org.simantics.g2d.element.ElementClass.Single;
+
+/**
+ * Interface for adapting editing edge bends between information models.
+ * 
+ * Bend is a control point of an edge. The path of an edge follows thru all its 
+ * edges.  
+ * 
+ * @see Topology 
+ * @author Toni Kalajainen
+ */
+@Single
+public interface BendsHandler extends ElementHandler { 
+
+       /** Information for painter */
+       public static enum AngleType { 
+               Line,                           /* Straight from begin to end */ 
+               RightAngled,            /* 90-degree angles */
+               Linear,                         /* 1st degree lines, free angles */
+               Quadratic                       /* 3rd degree line segments */
+               // FIXME: 2nd, not 3rd degree ?
+       }
+       AngleType getAngleType(IElement e);
+       void setAngleType(IElement e, AngleType angleType);
+       
+       public interface Bend {}
+       
+       /**
+        * Get bends
+        * @param e
+        * @param bends collection to be filled with bends
+        */
+       void getBends(IElement e, List<Bend> bends);
+       
+       
+       /**
+        * Get bend position in element coordinate system
+        * 
+        * @param e
+        * @param b
+        * @param pos point object to be filled with the position (not null) 
+        * @return point object pos 
+        */
+       void getBendPosition(IElement e, Bend b, Point2D pos);
+       
+       /**
+        * Add bend
+        * @param e
+        * @param index
+        * @param pos element coordinate system position
+        * @return
+        */
+       Bend addBend(IElement e, int index, Point2D pos);
+       
+       /**
+        * Set bends
+        * @param e
+        * @param bends
+        * @return true if successful 
+        */
+       boolean removeBend(IElement e, Bend b);
+       
+       /**
+        * move position of a bend
+        * @param e
+        * @param b
+        * @param pos position in element coordinate system
+        */
+       void moveBend(IElement e, Bend b, Point2D pos); 
+       
+       /**
+        * Get bends count
+        * @param e bends
+        * @return bends count
+        */
+       int getBendsCount(IElement e);
+       
+       /**
+        * Get Element path
+        * @param e
+        * @return
+        */
+       Path2D getPath(IElement e);
+       
+       /**
+        * Set element path
+        * @param e
+        * @param p
+        */
+       void setPath(IElement e, Path2D p);
+}