-/*******************************************************************************\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.impl;\r
-\r
-import java.awt.BasicStroke;\r
-import java.awt.Shape;\r
-import java.awt.Stroke;\r
-\r
-import org.simantics.g2d.element.ElementUtils;\r
-import org.simantics.g2d.element.IElement;\r
-import org.simantics.g2d.element.handler.EdgeVisuals;\r
-import org.simantics.g2d.element.handler.SelectionOutline;\r
-\r
-public class ConnectionSelectionOutline implements SelectionOutline {\r
-\r
- private static final long serialVersionUID = 1L;\r
-\r
- public final static ConnectionSelectionOutline INSTANCE = new ConnectionSelectionOutline();\r
-\r
- public static final Stroke defaultStroke = new BasicStroke(0.3f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);\r
-\r
- public Stroke resolveStroke(IElement e, Stroke defaultValue) {\r
- for (EdgeVisuals ev : e.getElementClass().getItemsByClass(EdgeVisuals.class)) {\r
- BasicStroke stroke = (BasicStroke) ev.getStroke(e);\r
- if (stroke != null) {\r
-// return stroke;\r
- return new BasicStroke(1.5f*stroke.getLineWidth(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);\r
- }\r
- }\r
- return defaultStroke;\r
- }\r
-\r
- @Override\r
- public Shape getSelectionShape(IElement e) {\r
- Stroke stroke = resolveStroke(e, defaultStroke);\r
- Shape es = ElementUtils.getElementShapeOrBounds(e);\r
- return stroke.createStrokedShape(es);\r
- }\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.impl;
+
+import java.awt.BasicStroke;
+import java.awt.Shape;
+import java.awt.Stroke;
+
+import org.simantics.g2d.element.ElementUtils;
+import org.simantics.g2d.element.IElement;
+import org.simantics.g2d.element.handler.EdgeVisuals;
+import org.simantics.g2d.element.handler.SelectionOutline;
+
+public class ConnectionSelectionOutline implements SelectionOutline {
+
+ private static final long serialVersionUID = 1L;
+
+ public final static ConnectionSelectionOutline INSTANCE = new ConnectionSelectionOutline();
+
+ public static final Stroke defaultStroke = new BasicStroke(0.3f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);
+
+ public Stroke resolveStroke(IElement e, Stroke defaultValue) {
+ for (EdgeVisuals ev : e.getElementClass().getItemsByClass(EdgeVisuals.class)) {
+ BasicStroke stroke = (BasicStroke) ev.getStroke(e);
+ if (stroke != null) {
+// return stroke;
+ return new BasicStroke(1.5f*stroke.getLineWidth(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);
+ }
+ }
+ return defaultStroke;
+ }
+
+ @Override
+ public Shape getSelectionShape(IElement e) {
+ Stroke stroke = resolveStroke(e, defaultStroke);
+ Shape es = ElementUtils.getElementShapeOrBounds(e);
+ return stroke.createStrokedShape(es);
+ }
+
+}