1 package org.simantics.sysdyn.ui.elements.connections;
\r
3 import java.awt.Color;
\r
4 import java.awt.Graphics2D;
\r
5 import java.awt.Stroke;
\r
6 import java.awt.geom.Path2D;
\r
8 import org.simantics.diagram.connection.rendering.BasicConnectionStyle;
\r
10 public class FlowConnectionStyle extends BasicConnectionStyle {
\r
12 private static final long serialVersionUID = 2777194644079591357L;
\r
17 public FlowConnectionStyle(Color lineColor, Stroke lineStroke) {
\r
18 super(lineColor, Color.BLACK, 0.5, lineStroke, lineStroke, 0.8);
\r
19 this.lineColor = lineColor;
\r
20 this.lineStroke = lineStroke;
\r
24 public void drawBranchPoint(Graphics2D g, double x, double y) {
\r
28 public void drawLine(Graphics2D g, double x1, double y1, double x2, double y2, boolean isTransient) {
\r
32 public void drawPath(Graphics2D g, Path2D path, boolean isTransient) {
\r
33 if (lineColor != null)
\r
34 g.setColor(lineColor);
\r
35 if (lineStroke != null)
\r
36 g.setStroke(lineStroke);
\r
38 Path2D p1 = Flows.createOffsetPath(path, 1);
\r
39 Path2D p2 = Flows.createOffsetPath(path, -1);
\r
40 p1.append(p2, false);
\r
45 public void drawDegeneratedLine(Graphics2D g, double x, double y, boolean isHorizontal, boolean isTransient) {
\r
49 public double getDegeneratedLineLength() {
\r