Search in sources :

Example 6 with KLabel

use of de.cau.cs.kieler.klighd.kgraph.KLabel in project lingua-franca by lf-lang.

the class LinguaFrancaStyleExtensions method applyOnEdgeStyle.

public void applyOnEdgeStyle(KLabel label) {
    if (_onEdgeLabelConfigurator == null) {
        LabelDecorationConfigurator configurator = LabelDecorationConfigurator.create().withInlineLabels(true);
        _onEdgeLabelConfigurator = configurator.withLabelTextRenderingProvider((KContainerRendering container, KLabel klabel) -> {
            KText kText = _kRenderingFactory.createKText();
            _kRenderingExtensions.setFontSize(kText, 9);
            container.getChildren().add(kText);
            return kText;
        });
    }
    _onEdgeLabelConfigurator.applyTo(label);
}
Also used : KText(de.cau.cs.kieler.klighd.krendering.KText) KLabel(de.cau.cs.kieler.klighd.kgraph.KLabel) LabelDecorationConfigurator(de.cau.cs.kieler.klighd.labels.decoration.LabelDecorationConfigurator) KContainerRendering(de.cau.cs.kieler.klighd.krendering.KContainerRendering)

Aggregations

KLabel (de.cau.cs.kieler.klighd.kgraph.KLabel)6 KContainerRendering (de.cau.cs.kieler.klighd.krendering.KContainerRendering)4 KText (de.cau.cs.kieler.klighd.krendering.KText)4 LabelDecorationConfigurator (de.cau.cs.kieler.klighd.labels.decoration.LabelDecorationConfigurator)4 KPolygon (de.cau.cs.kieler.klighd.krendering.KPolygon)3 IDecoratorRenderingProvider (de.cau.cs.kieler.klighd.labels.decoration.IDecoratorRenderingProvider)3 ElkPadding (org.eclipse.elk.core.math.ElkPadding)3 KPolyline (de.cau.cs.kieler.klighd.krendering.KPolyline)2 KRendering (de.cau.cs.kieler.klighd.krendering.KRendering)2 KSpline (de.cau.cs.kieler.klighd.krendering.KSpline)2 KEdge (de.cau.cs.kieler.klighd.kgraph.KEdge)1 KNode (de.cau.cs.kieler.klighd.kgraph.KNode)1 KPort (de.cau.cs.kieler.klighd.kgraph.KPort)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 LayerConstraint (org.eclipse.elk.alg.layered.options.LayerConstraint)1 KVector (org.eclipse.elk.core.math.KVector)1 SizeConstraint (org.eclipse.elk.core.options.SizeConstraint)1