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


Java Label.setOnMouseEntered方法代码示例

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


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

示例1: rotateHer

import javafx.scene.control.Label; //导入方法依赖的package包/类
public void rotateHer(Label labelHer, ImageView iv)
{
	RotateTransition rotation = new RotateTransition(Duration.seconds(2), iv);
	rotation.setCycleCount(Animation.INDEFINITE);
	rotation.setByAngle(360);

	iv.setTranslateZ(iv.getBoundsInLocal().getWidth() / 2.0);
	iv.setRotationAxis(Rotate.Y_AXIS);
	
	labelHer.setOnMouseEntered(e ->
	{ 
		rotation.play();
		iv.setRotate(180);
	});
	labelHer.setOnMouseExited(e ->
	{ 
		rotation.pause();
		iv.setRotate(0);
	});
}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:21,代码来源:MainWindow.java

示例2: rotateHer

import javafx.scene.control.Label; //导入方法依赖的package包/类
public void rotateHer(Label labelHer, ImageView iv)
{
	RotateTransition rotation = new RotateTransition(Duration.seconds(2.3), iv);
	rotation.setCycleCount(Animation.INDEFINITE);
	rotation.setByAngle(360);

	iv.setTranslateZ(iv.getBoundsInLocal().getWidth() / 2.0);
	iv.setRotationAxis(Rotate.Y_AXIS);
	
	labelHer.setOnMouseEntered(e ->
	{ 
		rotation.play();
		iv.setRotate(180);
	});
	labelHer.setOnMouseExited(e ->
	{ 
		rotation.pause();
		iv.setRotate(0);
	});
}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:21,代码来源:SysSettings.java

示例3: addListElement

import javafx.scene.control.Label; //导入方法依赖的package包/类
public void addListElement(final String s) {
    final Label label = new Label(s);

    label.setStyle("-fx-padding: 8 16 8 16;");
    label.getStyleClass().add("body2");
    label.setMinWidth(width);

    list.getChildren().add(label);

    label.setOnMouseEntered(event -> canIShowSubMenu.set(false));
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:12,代码来源:DropDownMenu.java

示例4: initializeHeadline

import javafx.scene.control.Label; //导入方法依赖的package包/类
private void initializeHeadline(final Component component) {
    final Label headline = (Label) lookup("#headline");
    final Circle indicator = (Circle) lookup("#indicator");
    final Line line = (Line) lookup("#line");

    line.setStroke(Color.GREY.getColor(Color.Intensity.I400));

    // This is an project wide message that is not specific to a component
    if(component == null) {
        headline.setText("Project");
        return;
    }

    headline.setText(component.getName());
    headline.textProperty().bind(component.nameProperty());

    final EventHandler<MouseEvent> onMouseEntered = event -> {
        setCursor(Cursor.HAND);
        headline.setStyle("-fx-underline: true;");
    };

    final EventHandler<MouseEvent> onMouseExited = event -> {
        setCursor(Cursor.DEFAULT);
        headline.setStyle("-fx-underline: false;");
    };

    final EventHandler<MouseEvent> onMousePressed = event -> {
        CanvasController.setActiveComponent(component);
    };

    headline.setOnMouseEntered(onMouseEntered);
    headline.setOnMouseExited(onMouseExited);
    headline.setOnMousePressed(onMousePressed);
    indicator.setOnMouseEntered(onMouseEntered);
    indicator.setOnMouseExited(onMouseExited);
    indicator.setOnMousePressed(onMousePressed);

    final BiConsumer<Color, Color.Intensity> updateColor = (color, intensity) -> {
        indicator.setFill(color.getColor(component.getColorIntensity()));
    };

    updateColor.accept(component.getColor(), component.getColorIntensity());
    component.colorProperty().addListener((observable, oldColor, newColor) -> updateColor.accept(newColor, component.getColorIntensity()));
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:45,代码来源:MessageCollectionPresentation.java


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