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;
}
use of de.cau.cs.kieler.klighd.krendering.KPolyline in project lingua-franca by lf-lang.
the class LinguaFrancaSynthesis method createIODependencyEdge.
private KEdge createIODependencyEdge(Object associate, boolean multiport) {
KEdge edge = _kEdgeExtensions.createEdge();
if (associate != null) {
associateWith(edge, associate);
}
KPolyline line = _kEdgeExtensions.addPolyline(edge);
_linguaFrancaStyleExtensions.boldLineSelectionStyle(line);
_kPolylineExtensions.addJunctionPointDecorator(line);
if (multiport) {
// Render multiport connections and bank connections in bold.
_kRenderingExtensions.setLineWidth(line, 2.2f);
_kRenderingExtensions.setLineCap(line, LineCap.CAP_SQUARE);
// Adjust junction point size
_kPolylineExtensions.setJunctionPointDecorator(line, line.getJunctionPointRendering(), 6, 6);
}
return edge;
}
use of de.cau.cs.kieler.klighd.krendering.KPolyline in project lingua-franca by lf-lang.
the class LinguaFrancaSynthesis method createDependencyEdge.
private KEdge createDependencyEdge(Object associate) {
KEdge edge = _kEdgeExtensions.createEdge();
if (associate != null) {
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 LinguaFrancaStyleExtensions method applyOnEdgeDelayStyle.
public void applyOnEdgeDelayStyle(KLabel label) {
if (_onEdgeDelayLabelConfigurator == null) {
LabelDecorationConfigurator configurator = LabelDecorationConfigurator.create().withInlineLabels(true);
configurator = configurator.withLabelTextRenderingProvider((KContainerRendering container, KLabel klabel) -> {
KText kText = _kRenderingFactory.createKText();
_kRenderingExtensions.setFontSize(kText, 8);
boldTextSelectionStyle(kText);
kText.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, klabel.getProperty(KlighdInternalProperties.MODEL_ELEMEMT));
container.getChildren().add(kText);
return kText;
});
configurator = configurator.addDecoratorRenderingProvider(new IDecoratorRenderingProvider() {
@Override
public ElkPadding createDecoratorRendering(KContainerRendering container, KLabel label, LabelDecorationConfigurator.LayoutMode layoutMode) {
ElkPadding padding = new ElkPadding();
padding.top = 1;
padding.bottom = 1;
padding.left = 2;
padding.right = 2;
KPolygon polygon = _kRenderingFactory.createKPolygon();
_kRenderingExtensions.from(polygon, LEFT, (-2), 0, BOTTOM, 0, 0);
_kRenderingExtensions.to(polygon, LEFT, 2, 0, TOP, 0, 0);
_kRenderingExtensions.to(polygon, RIGHT, (-2), 0, TOP, 0, 0);
_kRenderingExtensions.to(polygon, RIGHT, 2, 0, BOTTOM, 0, 0);
_kRenderingExtensions.setBackground(polygon, Colors.WHITE);
_kRenderingExtensions.setForeground(polygon, Colors.WHITE);
container.getChildren().add(polygon);
KPolyline polyline = _kRenderingFactory.createKPolyline();
_kRenderingExtensions.from(polyline, LEFT, (-2), 0, BOTTOM, 0, 0);
_kRenderingExtensions.to(polyline, LEFT, 2, 0, TOP, 0, 0);
container.getChildren().add(polyline);
polyline = _kRenderingFactory.createKPolyline();
_kRenderingExtensions.from(polyline, RIGHT, 2, 0, BOTTOM, 0, 0);
_kRenderingExtensions.to(polyline, RIGHT, (-2), 0, TOP, 0, 0);
container.getChildren().add(polyline);
return padding;
}
});
_onEdgeDelayLabelConfigurator = configurator;
}
_onEdgeDelayLabelConfigurator.applyTo(label);
}
Aggregations