com.dlsc.gemsfx.treeview.link.StraightLineLink Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gemsfx Show documentation
Show all versions of gemsfx Show documentation
A collection of JavaFX controls and utils.
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));
}
}