Search in sources :

Example 1 with TabOutlineMarker

use of org.develnext.jphp.ext.javafx.support.control.markers.TabOutlineMarker in project jphp by jphp-compiler.

the class DndTabPaneFactory method handleOutline.

private static MarkerFeedback handleOutline(Pane layoutNode, FeedbackData data) {
    TabOutlineMarker marker = null;
    for (Node n : layoutNode.getChildren()) {
        if (n instanceof TabOutlineMarker) {
            marker = (TabOutlineMarker) n;
        }
    }
    if (marker == null) {
        marker = new TabOutlineMarker(layoutNode.getBoundsInLocal(), new BoundingBox(data.bounds.getMinX(), data.bounds.getMinY(), data.bounds.getWidth(), data.bounds.getHeight()), data.dropType == DropType.BEFORE);
        marker.setManaged(false);
        marker.setMouseTransparent(true);
        layoutNode.getChildren().add(marker);
    } else {
        marker.updateBounds(layoutNode.getBoundsInLocal(), new BoundingBox(data.bounds.getMinX(), data.bounds.getMinY(), data.bounds.getWidth(), data.bounds.getHeight()), data.dropType == DropType.BEFORE);
        marker.setVisible(true);
    }
    final TabOutlineMarker fmarker = marker;
    return new MarkerFeedback(data) {

        @Override
        public void hide() {
            fmarker.setVisible(false);
        }
    };
}
Also used : Node(javafx.scene.Node) BoundingBox(javafx.geometry.BoundingBox) TabOutlineMarker(org.develnext.jphp.ext.javafx.support.control.markers.TabOutlineMarker)

Aggregations

BoundingBox (javafx.geometry.BoundingBox)1 Node (javafx.scene.Node)1 TabOutlineMarker (org.develnext.jphp.ext.javafx.support.control.markers.TabOutlineMarker)1