本文整理汇总了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);
}
示例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;
}