-/*******************************************************************************\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.Color;\r
-import java.awt.Shape;\r
-import java.awt.Stroke;\r
-import java.util.EnumSet;\r
-\r
-import org.simantics.g2d.element.IElement;\r
-import org.simantics.g2d.element.handler.impl.ConfigurableEdgeVisuals;\r
-import org.simantics.g2d.element.handler.impl.StaticEdgeVisuals;\r
-\r
-/**\r
- * Edge visual properties\r
- * \r
- * @See {@link ConfigurableEdgeVisuals}\r
- * @See {@link StaticEdgeVisuals}\r
- * @author Toni Kalajainen\r
- * \r
- * TODO: configurable arrow shape\r
- */\r
-public interface EdgeVisuals extends ElementHandler {\r
-\r
- public static enum StrokeType { Absolute, Relative }\r
-\r
- public static enum ArrowType { None, Stroke, Fill, Both }\r
-\r
- public static interface Arrow {\r
- ArrowType getType();\r
- Color getStrokeColor();\r
- Color getFillColor();\r
- /**\r
- * @return the renderable arrow shape described by this arrow type. The\r
- * returned shape is interpreted to be facing in the positive X\r
- * direction (right), with 0 degree rotation\r
- */\r
- Shape getShape();\r
- }\r
-\r
- public static enum EdgeEnd {\r
- Begin, End;\r
- public EdgeEnd other() {\r
- return this == Begin ? End : Begin;\r
- }\r
- }\r
-\r
- public static EnumSet<EdgeEnd> BEGIN = EnumSet.of(EdgeEnd.Begin);\r
- public static EnumSet<EdgeEnd> END = EnumSet.of(EdgeEnd.End);\r
- public static EnumSet<EdgeEnd> BOTH = EnumSet.allOf(EdgeEnd.class);\r
-\r
- Stroke getStroke(IElement e);\r
- void setStroke(IElement e, Stroke s);\r
-\r
- StrokeType getStrokeType(IElement e);\r
- void setStrokeType(IElement e, StrokeType t);\r
-\r
- ArrowType getArrowType(IElement e, EdgeEnd end);\r
- void setArrowType(IElement e, EdgeEnd end, ArrowType arrowType);\r
-\r
- double getArrowSize(IElement e, EdgeEnd end);\r
- void setArrowSize(IElement e, EdgeEnd end, double size);\r
-\r
- // TODO: weight, transparency, corner rounds/rounding size\r
-\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.Color;
+import java.awt.Shape;
+import java.awt.Stroke;
+import java.util.EnumSet;
+
+import org.simantics.g2d.element.IElement;
+import org.simantics.g2d.element.handler.impl.ConfigurableEdgeVisuals;
+import org.simantics.g2d.element.handler.impl.StaticEdgeVisuals;
+
+/**
+ * Edge visual properties
+ *
+ * @See {@link ConfigurableEdgeVisuals}
+ * @See {@link StaticEdgeVisuals}
+ * @author Toni Kalajainen
+ *
+ * TODO: configurable arrow shape
+ */
+public interface EdgeVisuals extends ElementHandler {
+
+ public static enum StrokeType { Absolute, Relative }
+
+ public static enum ArrowType { None, Stroke, Fill, Both }
+
+ public static interface Arrow {
+ ArrowType getType();
+ Color getStrokeColor();
+ Color getFillColor();
+ /**
+ * @return the renderable arrow shape described by this arrow type. The
+ * returned shape is interpreted to be facing in the positive X
+ * direction (right), with 0 degree rotation
+ */
+ Shape getShape();
+ }
+
+ public static enum EdgeEnd {
+ Begin, End;
+ public EdgeEnd other() {
+ return this == Begin ? End : Begin;
+ }
+ }
+
+ public static EnumSet<EdgeEnd> BEGIN = EnumSet.of(EdgeEnd.Begin);
+ public static EnumSet<EdgeEnd> END = EnumSet.of(EdgeEnd.End);
+ public static EnumSet<EdgeEnd> BOTH = EnumSet.allOf(EdgeEnd.class);
+
+ Stroke getStroke(IElement e);
+ void setStroke(IElement e, Stroke s);
+
+ StrokeType getStrokeType(IElement e);
+ void setStrokeType(IElement e, StrokeType t);
+
+ ArrowType getArrowType(IElement e, EdgeEnd end);
+ void setArrowType(IElement e, EdgeEnd end, ArrowType arrowType);
+
+ double getArrowSize(IElement e, EdgeEnd end);
+ void setArrowSize(IElement e, EdgeEnd end, double size);
+
+ // TODO: weight, transparency, corner rounds/rounding size
+
+}