當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。