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


Java HBox.getChildren方法代码示例

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


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

示例1: processSegments

import javafx.scene.layout.HBox; //导入方法依赖的package包/类
private void processSegments() {
	for (Map.Entry<HBox, List<List<DiffKind>>> e : lineToSegments.entrySet()) {
		final HBox line = e.getKey();
		final List<String> descriptions = segmentToDescription.get(line);
		final List<Node> children = line.getChildren();
		final List<List<DiffKind>> segments = e.getValue();
		int idx = 0;
		for (List<DiffKind> segment : segments) {
			if (segment == null) {
				final Rectangle rectangle = new Rectangle(WIDTH, 8, Color.TRANSPARENT);
				HBox.setMargin(rectangle, MARGIN_INSETS);
				children.add(rectangle);
			} else {
				DiffKind[] seg = new DiffKind[segment.size()];
				for (int i = 0; i < seg.length; i++) {
					seg[i] = segment.get(i);
				}
				final String description = descriptions.get(idx);
				final ValueView view = new ValueView(description, seg);
				HBox.setMargin(view, MARGIN_INSETS);
				children.add(view);
				idx++;
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:27,代码来源:TimelineDiffViewerRenderer.java

示例2: createTopBar

import javafx.scene.layout.HBox; //导入方法依赖的package包/类
public HBox createTopBar()
{
	HBox hbox = new HBox();
	hbox.setPadding(new Insets(15, 15, 15, 15));
	hbox.setSpacing(10);
	hbox.setStyle("-fx-background-color: lightsteelblue;");
	ObservableList<Node> buttons = hbox.getChildren();
	Set<Node> buttonEffectsSet = new HashSet<>();
	
	Node runButton = new ImageView("toolbar_run.png");
	runButton.setOnMouseClicked((event) -> {
		// TODO: Attach to Backend
		});
	buttons.add(runButton);
	buttonEffectsSet.add(runButton);
	
	Node stepButton = new ImageView("toolbar_step.png");
	runButton.setOnMouseClicked((event) -> {
		// TODO: Attach to Backend
		});
	buttons.add(stepButton);
	buttonEffectsSet.add(stepButton);
	
	Node resetButton = new ImageView("toolbar_reset.png");
	runButton.setOnMouseClicked((event) -> {
		// TODO: Attach to Backend
		});
	buttons.add(resetButton);
	buttonEffectsSet.add(resetButton);
	
	buttonEffectsSet.forEach(EmulationWindow::setButtonEffect);
	
	Label cycleLabel = new Label();
	cycleLabel.setText("Cycle: ");
	cycleLabel.setFont(Font.font("Arial", FontWeight.NORMAL, 18));
	buttons.add(cycleLabel);
	
	Label cycleLabelCount = new Label();
	cycleLabelCount.setText("0");
	cycleLabelCount.setFont(Font.font("Arial", FontWeight.NORMAL, 18));
	buttons.add(cycleLabelCount);
	
	Label stepLabel = new Label();
	stepLabel.setText("Step: ");
	stepLabel.setFont(Font.font("Arial", FontWeight.NORMAL, 18));
	buttons.add(stepLabel);
	
	Label stepLabelCount = new Label();
	stepLabelCount.setText("0");
	stepLabelCount.setFont(Font.font("Arial", FontWeight.NORMAL, 18));
	buttons.add(stepLabelCount);
	
	Label simModeState = new Label();
	simModeState.setText("Sim Mode");
	simModeState.setFont(Font.font("Arial", FontWeight.NORMAL, 16));
	buttons.add(simModeState);
	
	Node simModeImage = new ImageView("sim_mode_on.png");
	buttons.add(simModeImage);
	
	return hbox;
	
}
 
开发者ID:dhawal9035,项目名称:WebPLP,代码行数:64,代码来源:EmulationWindow.java


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