1 package org.simantics.sysdyn.ui.elements2.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
29 System.out.println("DrawLine");
\r
33 public void drawPath(Graphics2D g, Path2D path, boolean isTransient) {
\r
34 if (lineColor != null)
\r
35 g.setColor(lineColor);
\r
36 if (lineStroke != null)
\r
37 g.setStroke(lineStroke);
\r
39 Path2D p1 = Flows.createOffsetPath(path, 1);
\r
40 Path2D p2 = Flows.createOffsetPath(path, -1);
\r
41 p1.append(p2, false);
\r
46 public void drawDegeneratedLine(Graphics2D g, double x, double y, boolean isHorizontal, boolean isTransient) {
\r
50 public double getDegeneratedLineLength() {
\r