use of de.cau.cs.kieler.klighd.krendering.KPolyline in project lingua-franca by lf-lang.
the class LinguaFrancaShapeExtensions method addStopwatchFigure.
/**
* Stopwatch figure for deadlines.
*/
public KRectangle addStopwatchFigure(KContainerRendering parent) {
final int size = 12;
KRectangle container = _kContainerRenderingExtensions.addRectangle(parent);
_kRenderingExtensions.setInvisible(container, true);
_kRenderingExtensions.setPointPlacementData(container, _kRenderingExtensions.LEFT, 0, 0, _kRenderingExtensions.TOP, 0, 0, _kRenderingExtensions.H_LEFT, _kRenderingExtensions.V_TOP, 0, 0, size, size);
KPolyline polyline = _kContainerRenderingExtensions.addPolyline(container, 2, List.of(_kRenderingExtensions.createKPosition(LEFT, 3, 0.5f, TOP, (-2), 0), _kRenderingExtensions.createKPosition(LEFT, (-3), 0.5f, TOP, (-2), 0)));
_kRenderingExtensions.setForeground(polyline, Colors.BROWN);
polyline = _kContainerRenderingExtensions.addPolyline(container, 2, List.of(_kRenderingExtensions.createKPosition(LEFT, 0, 0.5f, TOP, (-2), 0), _kRenderingExtensions.createKPosition(LEFT, 0, 0.5f, TOP, 1, 0)));
_kRenderingExtensions.setForeground(polyline, Colors.BROWN);
KEllipse body = _kContainerRenderingExtensions.addEllipse(container);
_kRenderingExtensions.setLineWidth(body, 1);
_kRenderingExtensions.setForeground(body, Colors.BROWN);
_kRenderingExtensions.<KEllipse>setPointPlacementData(body, _kRenderingExtensions.LEFT, 0, 0, _kRenderingExtensions.TOP, 0, 0, _kRenderingExtensions.H_LEFT, _kRenderingExtensions.V_TOP, 0, 0, size, size);
_linguaFrancaStyleExtensions.noSelectionStyle(body);
KArc arc = _kContainerRenderingExtensions.addArc(body);
arc.setStartAngle((-20));
arc.setArcAngle(110);
arc.setArcType(Arc.PIE);
_kRenderingExtensions.setLineWidth(arc, 0);
_kRenderingExtensions.setBackground(arc, Colors.BROWN);
_kRenderingExtensions.setPointPlacementData(arc, _kRenderingExtensions.LEFT, 2, 0, _kRenderingExtensions.TOP, 2, 0, _kRenderingExtensions.H_LEFT, _kRenderingExtensions.V_TOP, 2, 2, size - 4, size - 4);
_linguaFrancaStyleExtensions.noSelectionStyle(arc);
return container;
}
use of de.cau.cs.kieler.klighd.krendering.KPolyline in project lingua-franca by lf-lang.
the class LinguaFrancaShapeExtensions method addCommentPolyline.
public KPolyline addCommentPolyline(KEdge edge) {
KPolyline polyline = _kEdgeExtensions.addPolyline(edge);
_kRenderingExtensions.setLineWidth(polyline, 1);
_kRenderingExtensions.setLineStyle(polyline, LineStyle.DOT);
return polyline;
}
use of de.cau.cs.kieler.klighd.krendering.KPolyline in project lingua-franca by lf-lang.
the class InterfaceDependenciesVisualization method createDependencyEdge.
/**
* Create an edges for interface dependencies and adjust visibility based on the expansion state of the node.
*/
private KEdge createDependencyEdge(final Pair<KPort, KPort> connection, final boolean expanded) {
KEdge depEdge = _kEdgeExtensions.createEdge();
depEdge.setSource(connection.getKey().getNode());
depEdge.setSourcePort(connection.getKey());
depEdge.setTarget(connection.getValue().getNode());
depEdge.setTargetPort(connection.getValue());
depEdge.setProperty(InterfaceDependenciesVisualization.INTERFACE_DEPENDENCY, true);
// no routing!
depEdge.setProperty(CoreOptions.NO_LAYOUT, true);
DiagramSyntheses.suppressSelectability(depEdge);
KPolyline polyline = _kEdgeExtensions.addPolyline(depEdge);
_kRenderingExtensions.setLineStyle(polyline, LineStyle.DOT);
_linguaFrancaStyleExtensions.noSelectionStyle(polyline);
// make sure there is a style to toggle!
_kRenderingExtensions.setInvisible(polyline, expanded);
return depEdge;
}
use of de.cau.cs.kieler.klighd.krendering.KPolyline in project lingua-franca by lf-lang.
the class LinguaFrancaSynthesis method createDelayEdge.
private KEdge createDelayEdge(Object associate) {
KEdge edge = _kEdgeExtensions.createEdge();
associateWith(edge, associate);
KPolyline line = _kEdgeExtensions.addPolyline(edge);
_linguaFrancaStyleExtensions.boldLineSelectionStyle(line);
_kPolylineExtensions.addJunctionPointDecorator(line);
if (getBooleanValue(USE_ALTERNATIVE_DASH_PATTERN)) {
_kRenderingExtensions.setLineStyle(line, LineStyle.CUSTOM);
_kRenderingExtensions.getLineStyle(line).getDashPattern().addAll(ALTERNATIVE_DASH_PATTERN);
} else {
_kRenderingExtensions.setLineStyle(line, LineStyle.DASH);
}
return edge;
}
use of de.cau.cs.kieler.klighd.krendering.KPolyline in project lingua-franca by lf-lang.
the class LinguaFrancaSynthesis method createOrderEdge.
private KEdge createOrderEdge() {
KEdge edge = _kEdgeExtensions.createEdge();
KPolyline line = _kEdgeExtensions.addPolyline(edge);
_kRenderingExtensions.setLineWidth(line, 1.5f);
_kRenderingExtensions.setLineStyle(line, LineStyle.DOT);
_kRenderingExtensions.setForeground(line, Colors.CHOCOLATE_1);
_linguaFrancaStyleExtensions.boldLineSelectionStyle(line);
// addFixedTailArrowDecorator() // Fix for bug: https://github.com/kieler/KLighD/issues/38
_kPolylineExtensions.addHeadArrowDecorator(line);
return edge;
}
Aggregations