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


Java MouseEvent.MOUSE_EXITED属性代码示例

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


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

示例1: handle

@Override
public void handle(Event e) {
    if (ignoreAnyInput) {
        return;
    }

    if (selected) {
        return;
    }

    if (e.getEventType() == MouseEvent.MOUSE_ENTERED || e.getEventType() == GazeEvent.GAZE_ENTERED) {
        onEntered();
    } else if (e.getEventType() == MouseEvent.MOUSE_EXITED || e.getEventType() == GazeEvent.GAZE_EXITED) {
        onExited();
    }

}
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:17,代码来源:WhereIsIt.java

示例2: HorizonChart

public HorizonChart(final int BANDS, final Series<T> SERIES, final boolean SMOOTHED) {
    series        = SERIES;
    scaleX        = 1;
    scaleY        = 1;
    smoothed      = SMOOTHED;
    referenceZero = true;
    noOfBands     = clamp(1, MAX_NO_OF_BANDS, BANDS);
    noOfItems     = SERIES.getNoOfItems();
    minY          = SERIES.getItems().stream().mapToDouble(Data::getY).min().getAsDouble();
    maxY          = SERIES.getItems().stream().mapToDouble(Data::getY).max().getAsDouble();
    bandWidth     = (maxY - minY) / noOfBands;
    tooltip       = new Tooltip();
    tooltip.setAnchorLocation(AnchorLocation.CONTENT_BOTTOM_LEFT);

    adjustColors();

    // Create list of points
    points = new ArrayList<>(noOfItems);
    prepareData();

    mouseListener           = mouseEvent -> {
        final EventType<? extends MouseEvent> TYPE = mouseEvent.getEventType();
        if (MouseEvent.MOUSE_CLICKED == TYPE) {
            Data<T> data = selectDataAt(mouseEvent.getX());
            tooltip.setText(createTooltipText(data));
            tooltip.setX(mouseEvent.getScreenX());
            tooltip.setY(mouseEvent.getScreenY());
            tooltip.show(getScene().getWindow());
            getSeries().fireSeriesEvent(new SeriesEvent(getSeries(), data, SeriesEventType.SELECT_DATA));
        } else if (MouseEvent.MOUSE_MOVED == TYPE) {
            tooltip.hide();
        } else if (MouseEvent.MOUSE_EXITED == TYPE) {
            tooltip.hide();
        }
    };
    seriesListener          = seriesEvent -> redraw();

    initGraphics();
    registerListeners();
}
 
开发者ID:HanSolo,项目名称:horizon,代码行数:40,代码来源:HorizonChart.java

示例3: buildEvent

private EventHandler<Event> buildEvent() {
    return new EventHandler<Event>() {
        @Override
        public void handle(Event e) {

            if (turned)
                return;

            if (e.getEventType() == MouseEvent.MOUSE_ENTERED || e.getEventType() == GazeEvent.GAZE_ENTERED) {

                progressIndicator.setOpacity(1);
                progressIndicator.setProgress(0);

                Timeline timelineCard = new Timeline();

                timelineCard.getKeyFrames().add(new KeyFrame(new Duration(1),
                        new KeyValue(card.xProperty(), card.getX() - (initWidth * zoom_factor - initWidth) / 2)));
                timelineCard.getKeyFrames().add(new KeyFrame(new Duration(1),
                        new KeyValue(card.yProperty(), card.getY() - (initHeight * zoom_factor - initHeight) / 2)));
                timelineCard.getKeyFrames().add(
                        new KeyFrame(new Duration(1), new KeyValue(card.widthProperty(), initWidth * zoom_factor)));
                timelineCard.getKeyFrames().add(new KeyFrame(new Duration(1),
                        new KeyValue(card.heightProperty(), initHeight * zoom_factor)));

                timelineProgressBar = new Timeline();

                timelineProgressBar.getKeyFrames().add(new KeyFrame(new Duration(fixationlength),
                        new KeyValue(progressIndicator.progressProperty(), 1)));

                timelineCard.play();

                timelineProgressBar.play();

                timelineProgressBar.setOnFinished(new EventHandler<ActionEvent>() {

                    @Override
                    public void handle(ActionEvent actionEvent) {

                        turned = true;

                        card.setFill(new ImagePattern(image, 0, 0, 1, 1, true));

                        card.removeEventFilter(MouseEvent.ANY, enterEvent);
                        card.removeEventFilter(GazeEvent.ANY, enterEvent);

                        if (winner) {
                            onCorrectCardSelected();
                        } else {// bad card
                            onWrongCardSelected();
                        }
                    }
                });
            } else if (e.getEventType() == MouseEvent.MOUSE_EXITED || e.getEventType() == GazeEvent.GAZE_EXITED) {

                Timeline timeline = new Timeline();

                timeline.getKeyFrames().add(new KeyFrame(new Duration(1),
                        new KeyValue(card.xProperty(), card.getX() + (initWidth * zoom_factor - initWidth) / 2)));
                timeline.getKeyFrames().add(new KeyFrame(new Duration(1),
                        new KeyValue(card.yProperty(), card.getY() + (initHeight * zoom_factor - initHeight) / 2)));
                timeline.getKeyFrames()
                        .add(new KeyFrame(new Duration(1), new KeyValue(card.widthProperty(), initWidth)));
                timeline.getKeyFrames()
                        .add(new KeyFrame(new Duration(1), new KeyValue(card.heightProperty(), initHeight)));

                timeline.play();

                timelineProgressBar.stop();

                progressIndicator.setOpacity(0);
                progressIndicator.setProgress(0);
            }
        }
    };
}
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:75,代码来源:Card.java

示例4: buildEvent

private  EventHandler<Event> buildEvent() {
    return new EventHandler<Event>() {
        @Override
        public void handle(Event e) {



            if (e.getEventType() == MouseEvent.MOUSE_ENTERED || e.getEventType() == GazeEvent.GAZE_ENTERED) {

                System.out.println("I eggcited");
                entry = (new Date()).getTime();
                indicator.setVisible(true);
                indicator.setOpacity(1);
                circle.setOpacity(0.5);

            }
            else if (e.getEventType() == MouseEvent.MOUSE_MOVED || e.getEventType() == GazeEvent.GAZE_MOVED) {

                System.out.println("I moved");
                indicator.setVisible(true);
                indicator.setOpacity(1);
                circle.setOpacity(0.5);
                long now = (new Date()).getTime();
                indicator.setProgress((now - entry)/min_time);
                System.out.println((now - entry)/min_time);
                if((now - entry)>min_time && entry != -1){
                    createAnimation();
                }

            } else if (e.getEventType() == MouseEvent.MOUSE_EXITED || e.getEventType() == GazeEvent.GAZE_EXITED) {

                entry = -1;
                indicator.setOpacity(1);
                circle.setOpacity(1);

            }
        }
    };

}
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:40,代码来源:Circles_handler.java

示例5: buildEvent

private EventHandler<Event> buildEvent () {

            return new EventHandler<Event>() {


                @Override
                public void handle(Event e) {
                    int row=0, col =0, j=0;
                    Object source = e.getSource();
                    ImageView x = (ImageView)source;
                    int y =Integer.parseInt(x.getId());
                    row =  y/ 13;
                    col =  y% 13;


                    if (e.getEventType() == MouseEvent.MOUSE_ENTERED || e.getEventType() == GazeEvent.GAZE_ENTERED) {

                        System.out.println("I entered");
                        count[row][col]++;
                        //System.out.println("count["+row+"]["+col+"] = "+count[row][col]);

                    } else if (e.getEventType() == MouseEvent.MOUSE_MOVED || e.getEventType() == GazeEvent.GAZE_MOVED) {

                        System.out.println("I moved");
                        count[row][col]++;
                        //System.out.println("count["+row+"]["+col+"] = "+count[row][col]);

                    } else if (e.getEventType() == MouseEvent.MOUSE_EXITED || e.getEventType() == GazeEvent.GAZE_EXITED) {

                        //nothing happens with the count
                        //what to put?

                    }

                }

            };

        }
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:39,代码来源:HeatMap.java


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