当前位置: 首页>>代码示例>>Java>>正文


Java Line.setMouseTransparent方法代码示例

本文整理汇总了Java中javafx.scene.shape.Line.setMouseTransparent方法的典型用法代码示例。如果您正苦于以下问题:Java Line.setMouseTransparent方法的具体用法?Java Line.setMouseTransparent怎么用?Java Line.setMouseTransparent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.shape.Line的用法示例。


在下文中一共展示了Line.setMouseTransparent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createLine

import javafx.scene.shape.Line; //导入方法依赖的package包/类
private void createLine(String styleClass) {
    Line line = new Line();
    line.setManaged(false);
    line.getStyleClass().add(styleClass);
    line.setMouseTransparent(true);
    lines.add(line);
    getChildren().add(line);
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:9,代码来源:DayViewSkin.java

示例2: DayViewSkin

import javafx.scene.shape.Line; //导入方法依赖的package包/类
public DayViewSkin(T view) {
    super(view);

    earlyHoursRegion = new Region();
    earlyHoursRegion.setMouseTransparent(true);
    earlyHoursRegion.getStyleClass().add("early-hours-region"); //$NON-NLS-1$
    earlyHoursRegion.setManaged(false);
    getChildren().add(earlyHoursRegion);

    lateHoursRegion = new Region();
    lateHoursRegion.setMouseTransparent(true);
    lateHoursRegion.getStyleClass().add("late-hours-region"); //$NON-NLS-1$
    lateHoursRegion.setManaged(false);
    getChildren().add(lateHoursRegion);

    for (int i = 1; i < 24; i++) {
        createLine("half-hour-line"); //$NON-NLS-1$
        createLine("full-hour-line"); //$NON-NLS-1$
    }

    createLine("half-hour-line"); //$NON-NLS-1$

    currentTimeCircle = new Circle(4);
    currentTimeCircle.getStyleClass().add("current-time-circle"); //$NON-NLS-1$
    currentTimeCircle.setManaged(false);
    currentTimeCircle.setMouseTransparent(true);
    currentTimeCircle.setOpacity(0);
    currentTimeCircle.visibleProperty().bind(view.enableCurrentTimeMarkerProperty());
    getChildren().add(currentTimeCircle);

    currentTimeLine = new Line();
    currentTimeLine.getStyleClass().add("current-time-line"); //$NON-NLS-1$
    currentTimeLine.setManaged(false);
    currentTimeLine.setMouseTransparent(true);
    currentTimeLine.setOpacity(0);
    currentTimeLine.visibleProperty().bind(view.enableCurrentTimeMarkerProperty());
    getChildren().add(currentTimeLine);

    if (!(this instanceof WeekDayViewSkin)) {
        /*
         * Dragging inside week day views will be handled by a drag controller
         * installed on the week view, not on the individual days.
         */
        new DayViewEditController(view);
    }

    setupCurrentTimeMarkerSupport();

    view.draggedEntryProperty().addListener(it -> addOrRemoveDraggedEntryView());

    view.showCurrentTimeMarkerProperty().addListener(it -> updateTimelineVisibility());
    view.showCurrentTimeTodayMarkerProperty().addListener(it -> updateTimelineVisibility());

    view.layoutProperty().addListener(it -> view.requestLayout());

    updateShowMarkers();
    updateTimelineVisibility();

    view.dateProperty().addListener(it -> {
        if (displayedDate == null || !displayedDate.equals(view.getDate())) {
            loadData("date changed");
        }
    });

    view.suspendUpdatesProperty().addListener(evt -> loadData("suspend updates was set to false"));
    view.getCalendars().addListener((javafx.beans.Observable obs) -> loadData("list of calendars changed"));

    updateLineStyling();

    final InvalidationListener styleLinesListener = it -> updateLineStyling();
    view.startTimeProperty().addListener(styleLinesListener);
    view.endTimeProperty().addListener(styleLinesListener);
    view.earlyLateHoursStrategyProperty().addListener(styleLinesListener);

    loadData("initial data loading");
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:77,代码来源:DayViewSkin.java

示例3: initNode

import javafx.scene.shape.Line; //导入方法依赖的package包/类
@Override
protected void initNode() {
    node.setMouseTransparent(true);
    Line line = (Line) node;
    line.setMouseTransparent(true);
    line.endXProperty().bind(x2.add(x));
    line.endYProperty().bind(y2.add(y));
    line.startXProperty().bind(x1.add(x));
    line.startYProperty().bind(y1.add(y));

    line.setOnMouseDragged(this::switchDrag);

    line.setOnMouseMoved(this::switchPoint);

    line.setOnMousePressed(event -> {
        if (chooseListener != null) {
            chooseListener.request(this);
        }
        deltaX = event.getX()-x.get();
        deltaY = event.getY()-y.get();
        chooseListener.request(this);
        isMousePress = true;
        drawConner();
        event.consume();
    });


    line.setOnMouseReleased(event -> {
        isMousePress = false;
        clearConner();
        drawConner();
        switchPoint(event);
        event.consume();
    });


    X.set(0);
    Y.set(0);
    setPrefHeight(600);
    setPrefWidth(900);
}
 
开发者ID:xfangfang,项目名称:PhotoScript,代码行数:42,代码来源:DragBoxWithLine.java


注:本文中的javafx.scene.shape.Line.setMouseTransparent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。