本文整理汇总了Java中javafx.scene.layout.HBox.setCursor方法的典型用法代码示例。如果您正苦于以下问题:Java HBox.setCursor方法的具体用法?Java HBox.setCursor怎么用?Java HBox.setCursor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.HBox
的用法示例。
在下文中一共展示了HBox.setCursor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupBox
import javafx.scene.layout.HBox; //导入方法依赖的package包/类
private void setupBox(VBox box, String labelString, VBox content) {
final HBox boxLabel = new HBox();
final Polygon arrow = new Polygon(2.5, 10, 10, 5, 2.5, 0);
final Label label = new Label(labelString);
boxLabel.setBackground(HEADER_BACKGROUND);
label.setFont(GROUP_FONT);
HBox.setMargin(arrow, HALF_MARGIN_INSETS);
boxLabel.setAlignment(Pos.CENTER_LEFT);
boxLabel.getChildren().addAll(arrow, label);
boxLabel.setCursor(Cursor.HAND);
box.getChildren().add(boxLabel);
boxLabel.setOnMouseClicked(e -> {
if (box.getChildren().size() > 1) {
box.getChildren().remove(content);
arrow.setRotate(0);
} else {
box.getChildren().add(content);
arrow.setRotate(90);
}
});
}
示例2: BaseDocument
import javafx.scene.layout.HBox; //导入方法依赖的package包/类
public BaseDocument() {
document = new Thumb2CodeArea();
IntFunction<Node> numberFunction = LineNumberFunction.applyTo(document);
IntFunction<Node> arrowFunction = new ArrowFunction(document.currentParagraphProperty());
IntFunction<Node> graphicFactory = line -> {
HBox hbox = new HBox(numberFunction.apply(line), arrowFunction.apply(line));
hbox.setCursor(Cursor.DEFAULT);
hbox.setAlignment(Pos.CENTER_LEFT);
return hbox;
};
document.setParagraphGraphicFactory(graphicFactory);
}
示例3: setupStatesPane
import javafx.scene.layout.HBox; //导入方法依赖的package包/类
private Pane setupStatesPane() {
final Label titleLabel = new Label("All execution states (0)");
nbStates.addListener((v, o, n) -> {
String s = "All execution states (" + n.intValue() + ")";
Platform.runLater(() -> {
titleLabel.setText(s);
titleLabel.setContentDisplay(ContentDisplay.RIGHT);
final ImageView nodeGraphic = new ImageView();
nodeGraphic.setImage(playGraphic);
titleLabel.setGraphic(nodeGraphic);
isInReplayMode.addListener((val, old, neu) -> {
if (old != neu) {
if (neu) {
nodeGraphic.setImage(replayGraphic);
} else {
nodeGraphic.setImage(playGraphic);
}
}
});
});
});
titleLabel.setFont(statesFont);
VBox.setMargin(titleLabel, HALF_MARGIN_INSETS);
titleLabel.setAlignment(Pos.CENTER);
final ScrollBar scrollBar = new ScrollBar();
scrollBar.setVisibleAmount(1);
scrollBar.setBlockIncrement(10);
scrollBar.setMin(0);
final IntegerBinding statesRange = visibleStatesRange.subtract(1);
scrollBar.disableProperty().bind(statesRange.lessThanOrEqualTo(0));
scrollBar.maxProperty().bind(statesRange);
scrollBar.valueProperty().addListener((v, o, n) -> {
if (o.intValue() != n.intValue() && n.intValue() != currentState.intValue()) {
currentState.set(n.intValue());
}
});
currentState.addListener((v, o, n) -> {
if (o.intValue() != n.intValue() && n.intValue() != scrollBar.valueProperty().intValue()) {
scrollBar.setValue(n.intValue());
}
});
final HBox hBox = new HBox();
final Polygon arrow = new Polygon(2.5, 10, 10, 5, 2.5, 0);
HBox.setMargin(arrow, HALF_MARGIN_INSETS);
final Label toggleValuesLabel = new Label("Timeline for dynamic information ");
toggleValuesLabel.setFont(statesFont);
hBox.setAlignment(Pos.CENTER_LEFT);
hBox.getChildren().addAll(arrow, toggleValuesLabel);
hBox.setCursor(Cursor.HAND);
hBox.setOnMouseClicked((e) -> {
if (bodyScrollPane.isVisible()) {
bodyScrollPane.setVisible(false);
arrow.setRotate(0);
} else {
bodyScrollPane.setVisible(true);
arrow.setRotate(90);
}
});
VBox.setMargin(hBox, HALF_MARGIN_INSETS);
headerPane.getChildren().addAll(scrollBar, titleLabel, statesPane, hBox);
VBox.setMargin(statesPane, MARGIN_INSETS);
return headerPane;
}