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


Java ToggleButton.setFocusTraversable方法代码示例

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


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

示例1: addTexture

import javafx.scene.control.ToggleButton; //导入方法依赖的package包/类
private void addTexture(final TerrainTexture tex, final boolean isGlobal) {
	final Canvas preview = new Canvas(64, 32);
	final GraphicsContext gc = preview.getGraphicsContext2D();
	gc.setFill(tex.samplePaint);
	gc.fillRect(0, 0, 64, 32);

	final ToggleButton t = new ToggleButton("", preview);
	t.setFocusTraversable(false);
	t.setToggleGroup(toolsGroup);
	t.setContextMenu(new ToolContextMenu(this, AssetType.TEXTURE, tex.id, isGlobal));

	t.setOnAction(event -> {
		if (t.isSelected()) canvas.setTool(new TerrainTextureTool(tex));
		else canvas.setTool(null);
	});

	if (isGlobal) {
		textures.global.getChildren().add(t);
		textureButtonsG.put(tex.id, t);
	} else {
		textures.local.getChildren().add(t);
		textureButtonsL.put(tex.id, t);
	}
}
 
开发者ID:CLowcay,项目名称:iso-game-engine,代码行数:25,代码来源:LibraryPane.java

示例2: makeSpriteButton

import javafx.scene.control.ToggleButton; //导入方法依赖的package包/类
private ToggleButton makeSpriteButton(
	final SpriteInfo sprite,
	final Canvas preview,
	final FacingDirection direction,
	final ToolContextMenu menu
) {
	final ToggleButton t = new ToggleButton("", preview);
	t.setFocusTraversable(false);
	t.setToggleGroup(toolsGroup);

	t.setOnAction(event -> {
		if (t.isSelected()) canvas.setTool(new SpriteTool(sprite, direction));
		else canvas.setTool(null);
	});

	if (menu != null) t.setContextMenu(menu);

	return t;
}
 
开发者ID:CLowcay,项目名称:iso-game-engine,代码行数:20,代码来源:LibraryPane.java

示例3: makeCliffButton

import javafx.scene.control.ToggleButton; //导入方法依赖的package包/类
private ToggleButton makeCliffButton(
	final CliffTexture tex, final Canvas canvas,
	final SlopeType slope, final int elevation, final ToolContextMenu menu
) {
	final GraphicsContext gc = canvas.getGraphicsContext2D();
	gc.translate(0, (1 - elevation) * 16);
	gc.scale(1.0d/4.0d, 1.0d/4.0d);
	try {
		(new Tile(elevation, slope, global.getTerrain("blank"), tex))
			.render(gc, CameraAngle.UL);
	} catch (CorruptDataException e) {
		throw new RuntimeException("Missing blank texture");
	}

	final ToggleButton t = new ToggleButton("", canvas);
	t.setFocusTraversable(false);
	t.setToggleGroup(toolsGroup);
	if (menu != null) t.setContextMenu(menu);

	return t;
}
 
开发者ID:CLowcay,项目名称:iso-game-engine,代码行数:22,代码来源:LibraryPane.java

示例4: initComponents

import javafx.scene.control.ToggleButton; //导入方法依赖的package包/类
private void initComponents() {
	// JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
	pane = new MigPane();
	findField = new CustomTextField();
	previousButton = new Button();
	nextButton = new Button();
	matchCaseButton = new ToggleButton();
	regexButton = new ToggleButton();
	findInfoLabel = new Label();
	closeButton = new Button();
	replacePane = new MigPane();
	replaceField = new CustomTextField();
	replaceButton = new Button();
	replaceAllButton = new Button();
	replaceInfoLabel = new Label();
	nOfHitCountLabel = new Label();

	//======== pane ========
	{
		pane.setLayout("insets 0,hidemode 3");
		pane.setCols("[shrink 0,fill][fill]0[fill][pref:n,fill]1px[pref:n,fill][grow,fill][fill]");
		pane.setRows("[fill]0[]");

		//---- findField ----
		findField.setPromptText(Messages.get("FindReplacePane.findField.promptText"));
		findField.setPrefColumnCount(15);
		pane.add(findField, "cell 0 0");

		//---- previousButton ----
		previousButton.setFocusTraversable(false);
		pane.add(previousButton, "cell 1 0");

		//---- nextButton ----
		nextButton.setFocusTraversable(false);
		pane.add(nextButton, "cell 2 0");

		//---- matchCaseButton ----
		matchCaseButton.setText("Aa");
		matchCaseButton.setFocusTraversable(false);
		pane.add(matchCaseButton, "cell 3 0");

		//---- regexButton ----
		regexButton.setText(".*");
		regexButton.setFocusTraversable(false);
		pane.add(regexButton, "cell 4 0");
		pane.add(findInfoLabel, "cell 5 0");

		//---- closeButton ----
		closeButton.setFocusTraversable(false);
		pane.add(closeButton, "cell 6 0");

		//======== replacePane ========
		{
			replacePane.setLayout("insets rel 0 0 0");
			replacePane.setCols("[shrink 0,fill][pref:n,fill][pref:n,fill][grow,fill]");
			replacePane.setRows("[]");

			//---- replaceField ----
			replaceField.setPromptText(Messages.get("FindReplacePane.replaceField.promptText"));
			replaceField.setPrefColumnCount(15);
			replacePane.add(replaceField, "cell 0 0");

			//---- replaceButton ----
			replaceButton.setText(Messages.get("FindReplacePane.replaceButton.text"));
			replaceButton.setFocusTraversable(false);
			replacePane.add(replaceButton, "cell 1 0");

			//---- replaceAllButton ----
			replaceAllButton.setText(Messages.get("FindReplacePane.replaceAllButton.text"));
			replaceAllButton.setFocusTraversable(false);
			replacePane.add(replaceAllButton, "cell 2 0");
			replacePane.add(replaceInfoLabel, "cell 3 0");
		}
		pane.add(replacePane, "cell 0 1 7 1");
	}

	//---- nOfHitCountLabel ----
	nOfHitCountLabel.setText(Messages.get("FindReplacePane.nOfHitCountLabel.text"));
	// JFormDesigner - End of component initialization  //GEN-END:initComponents
}
 
开发者ID:JFormDesigner,项目名称:markdown-writer-fx,代码行数:81,代码来源:FindReplacePane.java


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