本文整理汇总了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));
}
示例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);
}
示例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();
}
示例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);
}
示例5: selectView
import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
@Override
protected void selectView (VisTable view) {
view.setBackground(style.selection);
}
示例6: deselectView
import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
@Override
protected void deselectView (VisTable view) {
view.setBackground(style.background);
}
示例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);
}
}));
}