Package javafx.scene.shape

Examples of javafx.scene.shape.Line


        setOnMousePressed(dragHandler);
        setOnMouseReleased(dragHandler);
        setOnMouseDragged(dragHandler);

        projectionMap.addListener((MapChangeListener.Change<? extends AggregateEventNode, ? extends Line> change) -> {
            final Line valueRemoved = change.getValueRemoved();
            if (valueRemoved != null) {
                getChartChildren().removeAll(valueRemoved);
            }
            final Line valueAdded = change.getValueAdded();
            if (valueAdded != null) {
                getChartChildren().add(valueAdded);
            }
        });

        this.selectedNodes = selectedNodes;
        this.selectedNodes.addListener((
                ListChangeListener.Change<? extends AggregateEventNode> c) -> {
                    while (c.next()) {
                        c.getRemoved().forEach((AggregateEventNode t) -> {
                            projectionMap.remove(t);
                        });
                        c.getAddedSubList().forEach((AggregateEventNode t) -> {
                            Line line = new Line(dateAxis.localToParent(dateAxis.getDisplayPosition(new DateTime(t.getEvent().getSpan().getStartMillis(), TimeLineController.getJodaTimeZone())), 0).getX(), dateAxis.getLayoutY() + PROJECTED_LINE_Y_OFFSET,
                                    dateAxis.localToParent(dateAxis.getDisplayPosition(new DateTime(t.getEvent().getSpan().getEndMillis(), TimeLineController.getJodaTimeZone())), 0).getX(), dateAxis.getLayoutY() + PROJECTED_LINE_Y_OFFSET
                            );
                            line.setStroke(t.getEvent().getType().getColor().deriveColor(0, 1, 1, .5));
                            line.setStrokeWidth(PROJECTED_LINE_STROKE_WIDTH);
                            line.setStrokeLineCap(StrokeLineCap.ROUND);
                            projectionMap.put(t, line);
                        });

                    }
View Full Code Here


    private static final int DEFAULT_ROW_HEIGHT = 24;

    private void layoutProjectionMap() {
        for (final Map.Entry<AggregateEventNode, Line> entry : projectionMap.entrySet()) {
            final AggregateEventNode aggNode = entry.getKey();
            final Line line = entry.getValue();

            line.setStartX(getParentXForValue(new DateTime(aggNode.getEvent().getSpan().getStartMillis(), TimeLineController.getJodaTimeZone())));
            line.setEndX(getParentXForValue(new DateTime(aggNode.getEvent().getSpan().getEndMillis(), TimeLineController.getJodaTimeZone())));
            line.setStartY(getXAxis().getLayoutY() + PROJECTED_LINE_Y_OFFSET);
            line.setEndY(getXAxis().getLayoutY() + PROJECTED_LINE_Y_OFFSET);
        }
    }
View Full Code Here

TOP

Related Classes of javafx.scene.shape.Line

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.