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


Java HBox.setCursor方法代码示例

本文整理汇总了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);
		}
	});
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:22,代码来源:TimelineDiffViewerRenderer.java

示例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);
}
 
开发者ID:kasirgalabs,项目名称:ETUmulator,代码行数:13,代码来源:BaseDocument.java

示例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;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:65,代码来源:MultidimensionalTimelineRenderer.java


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