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


Java Text.setOnMouseClicked方法代码示例

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


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

示例1: getMessageBar

import javafx.scene.text.Text; //导入方法依赖的package包/类
private Node getMessageBar(VBox vbox) {
    HBox hb = new HBox(10);
    hb.setPrefHeight(32);
    hb.setStyle("-fx-padding: 0 5px 0 5px; -fx-background-color: " + _message_bg + ";");
    CheckBox cb = new CheckBox("Do Not Show Again");
    cb.setStyle("-fx-text-fill: " + _message_fg + ";-fx-fill: " + _message_fg + ";");
    Text b = FXUIUtils.getIconAsText("close");
    b.setOnMouseClicked((e) -> {
        JSONObject preferences = Preferences.instance().getSection("display");
        preferences.put("_doNotShowMessage", cb.isSelected());
        Preferences.instance().save("display");
        vbox.getChildren().remove(0);
    });
    Text t = new Text(_message);
    hb.setAlignment(Pos.CENTER_LEFT);
    HBox.setHgrow(t, Priority.ALWAYS);
    t.setStyle("-fx-fill: " + _message_fg + "; -fx-font-size: 14px; -fx-font-weight:bold; -fx-font-family: Tahoma;");
    b.setStyle("-fx-fill: " + _message_fg + "; -fx-font-size: 14px; -fx-font-weight:bold;");
    Region spacer = new Region();
    HBox.setHgrow(spacer, Priority.ALWAYS);
    hb.getChildren().addAll(t, spacer, b);
    return hb;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:24,代码来源:DisplayWindow.java

示例2: addToolBar

import javafx.scene.text.Text; //导入方法依赖的package包/类
private void addToolBar() {
    TextField textField = new TextField();
    textField.getStyleClass().add("search-field");
    textField.textProperty().bindBidirectional(getSkinnable().filterTextProperty());

    Text clearIcon = FontAwesomeIconFactory.get().createIcon(FontAwesomeIcon.TIMES_CIRCLE, "18");
    CustomTextField customTextField = new CustomTextField();
    customTextField.getStyleClass().add("search-field");
    customTextField.setLeft(FontAwesomeIconFactory.get().createIcon(FontAwesomeIcon.SEARCH, "18px"));
    customTextField.setRight(clearIcon);
    customTextField.textProperty().bindBidirectional(getSkinnable().filterTextProperty());
    clearIcon.setOnMouseClicked(evt -> customTextField.setText(""));

    FlipPanel searchFlipPanel = new FlipPanel();
    searchFlipPanel.setFlipDirection(Orientation.HORIZONTAL);
    searchFlipPanel.getFront().getChildren().add(textField);
    searchFlipPanel.getBack().getChildren().add(customTextField);
    searchFlipPanel.visibleProperty().bind(getSkinnable().enableSortingAndFilteringProperty());

    getSkinnable().useControlsFXProperty().addListener(it -> {
        if (getSkinnable().isUseControlsFX()) {
            searchFlipPanel.flipToBack();
        } else {
            searchFlipPanel.flipToFront();
        }
    });

    showTrailerButton = new Button("Show Trailer");
    showTrailerButton.getStyleClass().add("trailer-button");
    showTrailerButton.setMaxHeight(Double.MAX_VALUE);
    showTrailerButton.setOnAction(evt -> showTrailer());

    BorderPane toolBar = new BorderPane();
    toolBar.setLeft(showTrailerButton);
    toolBar.setRight(searchFlipPanel);
    toolBar.getStyleClass().add("movie-toolbar");

    container.add(toolBar, 1, 0);
}
 
开发者ID:hendrikebbers,项目名称:ExtremeGuiMakeover,代码行数:40,代码来源:MovieViewSkin.java


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