本文整理汇总了Java中com.kotcrab.vis.ui.widget.VisTable类的典型用法代码示例。如果您正苦于以下问题:Java VisTable类的具体用法?Java VisTable怎么用?Java VisTable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VisTable类属于com.kotcrab.vis.ui.widget包,在下文中一共展示了VisTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SelectDBItem
import com.kotcrab.vis.ui.widget.VisTable; //导入依赖的package包/类
public SelectDBItem(int listIndex, File file, String fileInfo, SelectDB_Activity.SelectDbStyle style) {
super(listIndex);
Label.LabelStyle nameStyle = new Label.LabelStyle();
nameStyle.font = style.nameFont;
nameStyle.fontColor = style.nameColor;
Label.LabelStyle infoStyle = new Label.LabelStyle();
infoStyle.font = style.infoFont;
infoStyle.fontColor = style.infoColor;
Table infoTable = new VisTable();
fileName = file.getName();
lblName = new VisLabel(fileName, nameStyle);
lblInfo = new VisLabel(fileInfo, infoStyle);
infoTable.add(lblName).left().fillX();
infoTable.row();
infoTable.add(lblInfo).left().fillX();
Image iconImage = new Image(CB.getSkin().getMenuIcon.manageDB, Scaling.none);
this.add(iconImage).center().padRight(CB.scaledSizes.MARGIN_HALF);
this.add(infoTable).expandX().fillX();
}
示例2: getNewInstanceOfActor
import com.kotcrab.vis.ui.widget.VisTable; //导入依赖的package包/类
@Override
protected Actor getNewInstanceOfActor(final LmlActorBuilder builder) {
tabbedPane = new TabbedPane(builder.getStyleName());
final Table mainTable = tabbedPane.getTable();
// TabbedPane will be accessible through LmlUserObject#getData(). This disables oneColumn attribute, though.
LmlUtilities.getLmlUserObject(mainTable).setData(tabbedPane);
if (tabbedPane.getTabsPane().isHorizontal()
|| tabbedPane.getTabsPane().getActor() instanceof HorizontalFlowGroup) {
mainTable.row();
}
// This will be the content table:
mainTable.add(new VisTable()).grow().row();
// There might be an expand+fill image in the second cell. We need to correct that:
normalizeSecondCell(mainTable);
return mainTable;
}
示例3: create
import com.kotcrab.vis.ui.widget.VisTable; //导入依赖的package包/类
@Override
public void create() {
stage = new Stage(new ScreenViewport());
Gdx.input.setInputProcessor(stage);
VisUI.load();
TabbedPane pane = new TabbedPane();
pane.add(new MapTab("Kbd & Mouse"));
pane.add(new MapTab("Controller"));
final VisTable contentTable = new VisTable();
stage.addActor(contentTable);
stage.addActor(pane.getTable());
pane.addListener(new TabbedPaneAdapter() {
@Override
public void switchedTab(Tab tab) {
contentTable.clearChildren();
contentTable.add(tab.getContentTable()).expand().fill();
}
});
}
示例4: createColorsPreviewTable
import com.kotcrab.vis.ui.widget.VisTable; //导入依赖的package包/类
private VisTable createColorsPreviewTable () {
VisTable table = new VisTable(false);
table.add(currentColorImg = new AlphaImage(commons, 5 * sizes.scaleFactor))
.height(25 * sizes.scaleFactor).width(80 * sizes.scaleFactor).expandX().fillX();
table.add(new Image(style.iconArrowRight)).pad(0, 2, 0, 2);
table.add(newColorImg = new AlphaImage(commons, 5 * sizes.scaleFactor))
.height(25 * sizes.scaleFactor).width(80 * sizes.scaleFactor).expandX().fillX();
currentColorImg.setColor(color);
newColorImg.setColor(color);
currentColorImg.addListener(new ClickListener() {
@Override
public void clicked (InputEvent event, float x, float y) {
restoreLastColor();
}
});
return table;
}
示例5: createHexTable
import com.kotcrab.vis.ui.widget.VisTable; //导入依赖的package包/类
private VisTable createHexTable () {
VisTable table = new VisTable(true);
table.add(new VisLabel(HEX.get()));
table.add(hexField = new VisValidatableTextField("00000000")).width(HEX_FIELD_WIDTH * sizes.scaleFactor);
table.row();
hexField.setMaxLength(HEX_COLOR_LENGTH);
hexField.setProgrammaticChangeEvents(false);
hexField.setTextFieldFilter(new TextFieldFilter() {
@Override
public boolean acceptChar (VisTextField textField, char c) {
return Character.isDigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}
});
hexField.addListener(new ChangeListener() {
@Override
public void changed (ChangeEvent event, Actor actor) {
if (hexField.getText().length() == (allowAlphaEdit ? HEX_COLOR_LENGTH_WITH_ALPHA : HEX_COLOR_LENGTH)) {
setColor(Color.valueOf(hexField.getText()), false);
}
}
});
return table;
}
示例6: createUI
import com.kotcrab.vis.ui.widget.VisTable; //导入依赖的package包/类
@Override
protected void createUI () {
super.createUI();
VisTable extendedTable = new VisTable(true); //displayed next to mainTable
extendedTable.add(hBar).row();
extendedTable.add(sBar).row();
extendedTable.add(vBar).row();
extendedTable.add();
extendedTable.row();
extendedTable.add(rBar).row();
extendedTable.add(gBar).row();
extendedTable.add(bBar).row();
extendedTable.add();
extendedTable.row();
extendedTable.add(aBar).row();
add(extendedTable).expand().left().top().pad(0, 9, 4, 4);
}
示例7: createTable
import com.kotcrab.vis.ui.widget.VisTable; //导入依赖的package包/类
private VisTable createTable (String order) {
ButtonBar buttonBar = new ButtonBar(order);
ChangeListener dummyListener = new ChangeListener() {
@Override
public void changed (ChangeEvent event, Actor actor) {
}
};
buttonBar.setButton(ButtonType.LEFT, dummyListener);
buttonBar.setButton(ButtonType.RIGHT, dummyListener);
buttonBar.setButton(ButtonType.HELP, dummyListener);
buttonBar.setButton(ButtonType.NO, dummyListener);
buttonBar.setButton(ButtonType.YES, dummyListener);
buttonBar.setButton(ButtonType.CANCEL, dummyListener);
buttonBar.setButton(ButtonType.BACK, dummyListener);
buttonBar.setButton(ButtonType.NEXT, dummyListener);
buttonBar.setButton(ButtonType.APPLY, dummyListener);
buttonBar.setButton(ButtonType.FINISH, dummyListener);
buttonBar.setButton(ButtonType.OK, dummyListener);
return buttonBar.createTable();
}
示例8: addNormalWidgets
import com.kotcrab.vis.ui.widget.VisTable; //导入依赖的package包/类
private void addNormalWidgets () {
ProgressBar progressbar = new ProgressBar(0, 100, 1, true, VisUI.getSkin());
Slider slider = new Slider(0, 100, 1, true, VisUI.getSkin());
Slider sliderDisabled = new Slider(0, 100, 1, true, VisUI.getSkin());
progressbar.setValue(50);
slider.setValue(50);
sliderDisabled.setValue(50);
sliderDisabled.setDisabled(true);
VisTable progressbarTable = new VisTable(true);
progressbarTable.add(progressbar);
progressbarTable.add(slider);
progressbarTable.add(sliderDisabled);
add(progressbarTable);
}
示例9: addVisWidgets
import com.kotcrab.vis.ui.widget.VisTable; //导入依赖的package包/类
private void addVisWidgets () {
VisProgressBar progressbar = new VisProgressBar(0, 100, 1, true);
VisSlider slider = new VisSlider(0, 100, 1, true);
VisSlider sliderDisabled = new VisSlider(0, 100, 1, true);
progressbar.setValue(50);
slider.setValue(50);
sliderDisabled.setValue(50);
sliderDisabled.setDisabled(true);
VisTable progressbarTable = new VisTable(true);
progressbarTable.add(progressbar);
progressbarTable.add(slider);
progressbarTable.add(sliderDisabled);
add(progressbarTable);
}
示例10: buildTable
import com.kotcrab.vis.ui.widget.VisTable; //导入依赖的package包/类
@Override
public void buildTable () {
VisTable sizeTable = new VisTable(true);
sizeTable.add(new VisLabel("Grid size: "));
sizeTable.add(gridSizeField = new VisValidatableTextField(Validators.FLOATS));
prepareTable();
settingsTable.add(drawGridCheck = new VisCheckBox("Draw grid", config.drawGrid)).left();
settingsTable.row();
settingsTable.add(sizeTable);
gridSizeField.setTextFieldFilter(new FloatDigitsOnlyFilter(false));
gridSizeField.addValidator(new Validators.GreaterThanValidator(0));
gridSizeField.setText(NumberUtils.floatToString(config.gridSize));
}
示例11: notifyUpdate
import com.kotcrab.vis.ui.widget.VisTable; //导入依赖的package包/类
private void notifyUpdate (UpdateChannelType updateChannel, String timestamp, String url) {
Log.info(TAG, "Editor update found: " + updateChannel.toPrettyString() + " " + timestamp);
Gdx.app.postRunnable(() -> {
VisTable table = new VisTable(true);
switch (updateChannel) {
case STABLE:
table.add("New stable build is available! (" + timestamp + ")");
break;
case EDGE:
table.add("New cutting edge build is available! (" + timestamp + ")");
break;
}
LinkLabel hide = new LinkLabel("Hide");
table.add(new LinkLabel("Download", url));
table.add(hide);
menuBar.setUpdateInfoTableContent(table);
hide.setListener(labelUrl -> menuBar.setUpdateInfoTableContent(null));
});
}
示例12: buildTable
import com.kotcrab.vis.ui.widget.VisTable; //导入依赖的package包/类
@Override
public void buildTable () {
prepareTable();
updateChannelSelectBox = new EnumSelectBox<>(UpdateChannelType.class, new PrettyEnumNameProvider<>());
updateChannelSelectBox.setSelectedEnum(config.updateChannel);
VisTable updateTable = new VisTable(true);
updateTable.add("Update channel:");
updateTable.add(updateChannelSelectBox);
VisImage updateHelpImage = new VisImage(Icons.QUESTION_BIG.drawable());
new Tooltip.Builder("Select update channel that will be used for update checking:\n" +
"Stable: The most stable builds, should be bug free in theory.\n" +
"Cutting Edge: Built after every single change, expect a lot of bugs and a lot of builds.", Align.left)
.target(updateHelpImage).build();
updateTable.add(updateHelpImage).size(22);
settingsTable.defaults().left();
settingsTable.add(confirmExitCheck = new VisCheckBox("Confirm exit", config.confirmExit)).row();
settingsTable.add(checkForUpdatesCheck = new VisCheckBox("Check for updates", config.checkForUpdates)).row();
settingsTable.add(updateTable).row();
}
示例13: 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));
}
示例14: createUI
import com.kotcrab.vis.ui.widget.VisTable; //导入依赖的package包/类
@Override
public void createUI (ATEnumProperty annotation, Field field, Class<?> fieldType) throws ReflectiveOperationException {
String fieldName = annotation.fieldName().equals("") ? field.getName() : annotation.fieldName();
Constructor<? extends EnumNameProvider> constructor = annotation.uiNameProvider().getConstructor();
EnumNameProvider nameProvider = constructor.newInstance();
AutoTableEnumSelectBox selectBox = new AutoTableEnumSelectBox(fieldType, nameProvider);
selectBox.getSelection().setProgrammaticChangeEvents(false);
selectBox.addListener(properties.getSharedSelectBoxChangeListener());
enumSelectBoxes.put(field, new EnumSelectBoxSet(selectBox, nameProvider));
if (field.isAnnotationPresent(ATUseGetterSetter.class)) {
propertyAccessors.put(field, new GetterSetterFieldAccessor(field));
} else {
propertyAccessors.put(field, new DirectFieldAccessor(field));
}
VisTable table = new VisTable(true);
table.add(fieldName);
table.add(selectBox).expandX().fillX().left();
uiTable.add(table).left().expandX().fillX().row();
}
示例15: createUI
import com.kotcrab.vis.ui.widget.VisTable; //导入依赖的package包/类
@Override
public void createUI (ATTextProperty annotation, Field field, Class<?> fieldType) throws ReflectiveOperationException {
if (fieldType.equals(CharSequence.class) == false) {
throw new UnsupportedOperationException("Field of this type is not supported by TextPropertyFragmentProvider: " + fieldType);
}
String fieldName = annotation.fieldName().equals("") ? field.getName() : annotation.fieldName();
IndeterminateTextField textField = new IndeterminateTextField();
properties.setupStdPropertiesTextField(textField.getTextField());
VisTable table = new VisTable(true);
table.add(new VisLabel(fieldName));
table.add(textField.getTextField()).expandX().fillX();
uiTable.add(table).width(230).row();
textFields.put(field, textField);
}