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


Java VisTable.setBackground方法代码示例

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


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

示例1: ToolbarModule

import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
public ToolbarModule () {
	toolsGroup = new ButtonGroup<>();

	table = new VisTable(false);
	table.defaults().pad(4, 0, 4, 3);
	table.setBackground(VisUI.getSkin().getDrawable("button"));

	table.add(new ToolbarButtonBuilder().icon(Icons.SAVE)
			.text("Save (" + OsUtils.getShortcutFor(Keys.CONTROL_LEFT, Keys.S) + ")").eventToolbar(ToolbarEventType.FILE_SAVE)
			.policy(ControllerPolicy.SAVABLE).build());

	table.addSeparator(true);
	table.add(new ToolbarButtonBuilder().icon(Icons.TOOL_MOVE).text("Select and move entities (F1)").eventTool(SelectionTool.TOOL_ID).build());
	table.add(new ToolbarButtonBuilder().icon(Icons.TOOL_ROTATE).text("Rotate entities (F2)").eventTool(RotateTool.TOOL_ID).build());
	table.add(new ToolbarButtonBuilder().icon(Icons.TOOL_SCALE).text("Scale entities (F3)").eventTool(ScaleTool.TOOL_ID).build());
	table.add(new ToolbarButtonBuilder().icon(Icons.POLYGON).text("Edit polygons (F4)").eventTool(PolygonTool.TOOL_ID).build());

	table.addSeparator(true);
	table.add(new ToolbarButtonBuilder().icon(Icons.SETTINGS_VIEW).text("Enable grid snapping (%)").eventToolbar(ToolbarEventType.GRID_SNAP_SETTING_CHANGED).toggle().build());

	table.add().expand().fill();

	savableScope.forEach(button -> button.setDisabled(true));
	sceneScope.forEach(button -> button.setDisabled(true));
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:26,代码来源:ToolbarModule.java

示例2: DeleteMultipleFilesTab

import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
public DeleteMultipleFilesTab (ModuleInjector injector, Array<FileItem> items) {
	super(false, true);
	this.injector = injector;
	this.items = items;
	injector.injectModules(this);

	table = new VisTable();
	table.setBackground(VisUI.getSkin().getDrawable("window-bg"));
	table.defaults().left();

	usagesTable = new VisTable(true);
	rebuildUsagesTable();

	VisScrollPane scrollPane = new VisScrollPane(usagesTable);
	scrollPane.setFadeScrollBars(false);

	table.add(scrollPane).expandX().fillX().pad(3).row();
	table.add().expand().fill().row();
	table.addSeparator();
	table.add(createButtonPane()).pad(3);
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:22,代码来源:DeleteMultipleFilesTab.java

示例3: createMainTable

import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
protected void createMainTable () {
	mainTable = new VisTable();
	mainTable.setBackground(style.background);

	VisImageButton closeButton = new VisImageButton(style.closeButtonStyle);
	closeButton.addListener(new ChangeListener() {
		@Override
		public void changed (ChangeEvent event, Actor actor) {
			close();
		}
	});

	mainTable.add(contentTable).pad(3).fill().expand();
	mainTable.add(closeButton).top();
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:16,代码来源:Toast.java

示例4: StatusBarModule

import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
public StatusBarModule () {
	timer = new Timer();

	statusLabel = new VisLabel("");
	infoLabel = new VisLabel("");

	table = new VisTable();
	table.setBackground(VisUI.getSkin().getDrawable("button"));
	table.add(statusLabel);
	table.add().expand().fill();
	table.add(infoLabel);
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:13,代码来源:StatusBarModule.java

示例5: selectView

import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
@Override
protected void selectView (VisTable view) {
	view.setBackground(style.selection);
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:5,代码来源:SimpleListAdapter.java

示例6: deselectView

import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
@Override
protected void deselectView (VisTable view) {
	view.setBackground(style.background);
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:5,代码来源:SimpleListAdapter.java

示例7: initUI

import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
private void initUI () {
	uiTable = new VisTable(true) {
		@Override
		public float getPrefHeight () {
			return 120;
		}
	};

	uiTable.setBackground(VisUI.getSkin().getDrawable("window-bg"));
	uiTable.setTouchable(Touchable.enabled);

	uiTable.top().left();
	uiTable.defaults().expandX().fillX().left();

	uiTable.add(new VisLabel("Polygon Tool", Align.center)).expandX().fillX().top();
	uiTable.row();

	statusLabel = new VisLabel();
	statusLabel.setWrap(true);
	statusLabel.setAlignment(Align.center);

	buttonTable = new VisTable(true) {
		@Override
		public float getPrefHeight () {
			if (isVisible())
				return super.getPrefHeight();
			else
				return 0;
		}

		@Override
		public void setVisible (boolean visible) {
			super.setVisible(visible);
			invalidateHierarchy();
		}
	};
	VisTextButton makeDefaultButton;

	buttonTable.setVisible(false);
	buttonTable.add(makeDefaultButton = new VisTextButton("Set From Bounds")).row();
	buttonTable.add(traceButton = new VisTextButton("Auto Trace")).row();

	dynamicUpdateCheck = new VisCheckBox("Dynamic faces update", true);

	uiTable.add(statusLabel).pad(0, 3, 0, 3).height(new VisValue(context -> statusLabel.isVisible() ? statusLabel.getPrefHeight() : 0)).spaceBottom(0).row();
	uiTable.add(buttonTable).height(new VisValue(context -> buttonTable.isVisible() ? buttonTable.getPrefHeight() : 0)).spaceBottom(0).row();
	uiTable.add().expand().fill().row();
	uiTable.add(dynamicUpdateCheck).expand(false, false).fill(false, false).center().padBottom(3);

	makeDefaultButton.addListener(new VisChangeListener((event, actor) -> makeDefaultPolygon()));

	traceButton.addListener(new VisChangeListener((event, actor) -> {
		EntityProxy entity = entityManipulator.getSelectedEntities().first();
		VisAssetDescriptor assetDescriptor = entity.getComponent(AssetReference.class).getAsset();
		if (assetDescriptor instanceof TextureAssetDescriptor == false) {
			Dialogs.showOKDialog(stage, "Message", "Auto Trace can only be used with sprite entities");
			return;
		}

		if (entity.getRotation() != 0) {
			Optional<DisableableOptionDialog> dialog = disableableDialogs.showOptionDialog(DisableableDialogsModule.POLYGON_TOOL_ROTATED_UNSUPPORTED, DefaultDialogOption.YES, stage, "Warning",
					"Auto tracer does not support rotated entities",
					OptionDialogType.YES_CANCEL, new OptionDialogAdapter() {
						@Override
						public void yes () {
							showAutoTracerDialog(entity, assetDescriptor);
						}
					});

			dialog.ifPresent(optDialog -> optDialog.setYesButtonText("Continue Anyway"));
		} else {
			showAutoTracerDialog(entity, assetDescriptor);
		}
	}));
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:76,代码来源:PolygonTool.java


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