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


Java BorderPane.setOnMouseClicked方法代码示例

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


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

示例1: HoverButton

import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
public HoverButton (FXView v, String tipp, String targetView, String id) {
		myTipp = tipp;
		if (tooltipEnable == null) {
			/**
			 *  this all is to be more efficient when handling the event below
			 */
// TODO move to model
			tooltipEnable = v.getFXController().getModel("config").getDataList("tooltipp").get(0);
			isTooltipActif = true;
			if (tooltipEnable == null) {
				v.getFXController().getModel("config").doAction(Command.SET,"tooltipp","false");
			}
			if (tooltipEnable != null && tooltipEnable.equals("true")) {
				isTooltipActif = false;
			}
		}
	    BorderPane bp = new BorderPane();
	    bp.setOnMouseEntered( e -> {
				if (isTooltipActif && myTipp != null) {
					lernText.setText(myTipp);
				};
			}
		);
		bp.setOnMouseExited( e -> lernText.setText("") );
		if (targetView != null) {
			bp.setOnMouseClicked( e -> v.getFXController().showView(targetView) );
		}
	    bp.setMinSize(FXSettings.HoverButtonWidth,FXSettings.HoverButtonHeight);
	    if (id != null) bp.setId(id);
		getChildren().addAll(bp,lernText);
	    setAlignment(Pos.CENTER);
	}
 
开发者ID:CoffeeCodeSwitzerland,项目名称:Lernkartei_2017,代码行数:33,代码来源:HoverButton.java

示例2: constructContentPane

import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
@Override
public JFXMasonryPane constructContentPane()
{
    JFXMasonryPane pane = new JFXMasonryPane();

    for (Profile fav : curProfile.getAllFavourites())
    {
        BorderPane tile = new BorderPane();
        tile.setStyle("-fx-background-color: #d3ecff;");

        ImageView profilePicView = new ImageView(fav.getProfileImg());
        profilePicView.setFitHeight(GUIConstants.PROFILE_HEIGHT / 1.5);
        profilePicView.setFitWidth(GUIConstants.PROFILE_WIDTH / 1.5);

        Label label  = new Label(fav.getUsername());
        label.setStyle("-fx-font-weight: bold; -fx-font-size: 16pt;");

        tile.setCenter(profilePicView);
        tile.setBottom(new StackPane(label));

        tile.setOnMouseClicked( e -> {
            GUIController.getPrimaryStage().setScene(new Scene(new ProfileScene(dc,fav,curProfile).getPane(),
                    GUIConstants.SCENE_WIDTH, GUIConstants.SCENE_HEIGHT));
        });

        pane.getChildren().add(tile);
    }

    return pane;
}
 
开发者ID:hadalhw17,项目名称:Artatawe,代码行数:31,代码来源:FavouriteProfileScene.java


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