All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dlsc.gemsfx.treeview.link.StraightLineLink Maven / Gradle / Ivy

There is a newer version: 2.67.0
Show newest version
package com.dlsc.gemsfx.treeview.link;

import com.dlsc.gemsfx.treeview.TreeNodeView;
import javafx.scene.Node;
import javafx.scene.shape.Line;

import java.util.ArrayList;
import java.util.List;

public class StraightLineLink extends AbstractLinkStrategy {

    @Override
    protected ArrayList drawLink(TreeNodeView.LayoutDirection direction, double maxDimensionInLine, double startX, double startY, double endX, double endY, double vgap, double hgap) {
        Line line = new Line(startX, startY, endX, endY);
        line.getStyleClass().add("link-line");

        Node arrow = createSimpleArrow();
        arrow.setRotate(calculateAngle());

        return new ArrayList<>(List.of(line, arrow));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy