本文整理汇总了Java中com.kotcrab.vis.ui.widget.VisTable.row方法的典型用法代码示例。如果您正苦于以下问题:Java VisTable.row方法的具体用法?Java VisTable.row怎么用?Java VisTable.row使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.kotcrab.vis.ui.widget.VisTable
的用法示例。
在下文中一共展示了VisTable.row方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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);
}
示例3: MainPanel
import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
public MainPanel() {
super("Nine Patch");
addCloseButton();
closeOnEscape();
centerWindow();
mainTable = new VisTable();
add(mainTable).width(520).height(310).padBottom(7);
editingTable = new VisTable();
previewTable = new VisTable();
mainTable.add(editingTable).width(310).expandY();
mainTable.add(previewTable).expandX().expandY();
mainTable.row();
pack();
}
示例4: layout
import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
public synchronized void layout() {
// this.setDebug(true, false);
if (!needsLayout) {
super.layout();
return;
}
this.clear();
VisTable iconTable = new VisTable();
iconTable.add(type.getCacheWidget(style.typeStyle, null, null));
iconTable.pack();
iconTable.layout();
this.add(iconTable).left().top().padRight(CB.scaledSizes.MARGINx4);
Table contentTable = new Table();
contentTable.add(nameLabel).left().expandX().fillX();
contentTable.row();
contentTable.add(descriptionLabel).left().expandX().fillX();
contentTable.row();
contentTable.add(coordLabel).left().expandX().fillX();
this.add(contentTable).top().expandX().fillX();
VisTable arrowTable = new VisTable();
arrowImage.setOrigin(this.style.arrow.getMinWidth() / 2, this.style.arrow.getMinHeight() / 2);
arrowTable.add(arrowImage);
arrowTable.row();
arrowTable.add(distanceLabel).padTop(CB.scaledSizes.MARGIN);
this.add(arrowTable).right();
super.layout();
needsLayout = false;
}
示例5: fillTable
import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
@Override
public void fillTable (VisTable itemsTable) {
if (itemsComparator != null) sort(itemsComparator);
for (final ItemT item : iterable()) {
final ViewT view = getView(item);
prepareViewBeforeAddingToTable(item, view);
itemsTable.add(view).growX();
itemsTable.row();
}
}
示例6: init
import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
@Override
public void init () {
kryo = new Kryo();
kryo.setInstantiatorStrategy(new DefaultInstantiatorStrategy(new StdInstantiatorStrategy()));
kryo.register(Array.class, new ArraySerializer());
FileHandle apiCache = fileAccess.getCacheFolder().child("twitter");
apiCache.mkdirs();
twitterCacheFile = apiCache.child("viseditor.data");
if (twitterCacheFile.exists()) readCache();
containerTable = new VisTable(false);
statusesTable = new VisTable();
statusesTable.left().top();
scrollPane = new VisScrollPane(statusesTable);
scrollPane.setOverscroll(false, true);
scrollPane.setFlickScroll(false);
scrollPane.setFadeScrollBars(false);
scrollPane.setScrollingDisabled(true, false);
containerTable.add("@VisEditor");
containerTable.add().expandX().fillX();
containerTable.add(new LinkLabel("Open in Browser", URL)).row();
containerTable.addSeparator().colspan(3).spaceBottom(4);
containerTable.row();
statusesCell = containerTable.add(new VisLabel("Loading...", Align.center)).colspan(3).expand().fill();
if (twitterCache == null || twitterCache.isOutdated()) {
updateCache();
} else {
Log.debug("Twitter cache is up to date");
buildTwitterTable(twitterCache);
}
}
示例7: initShortCutTable
import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
private void initShortCutTable(){
VisTable shortcutTable = new VisTable();
VisImageButton alignLeftBtn = new VisImageButton(new TextureRegionDrawable(new TextureRegion(
EditorManager.getInstance().assetManager.get("icon/align_left.png",Texture.class)
)));
alignLeftBtn.setUserObject(Align.left);
VisImageButton alignRightBtn = new VisImageButton(new TextureRegionDrawable(new TextureRegion(
EditorManager.getInstance().assetManager.get("icon/align_right.png",Texture.class)
)));
alignRightBtn.setUserObject(Align.right);
VisImageButton alignCenterBtn = new VisImageButton(new TextureRegionDrawable(new TextureRegion(
EditorManager.getInstance().assetManager.get("icon/align_center.png",Texture.class)
)));
alignCenterBtn.setUserObject(Align.center);
VisImageButton alignHCenterBtn = new VisImageButton(new TextureRegionDrawable(new TextureRegion(
EditorManager.getInstance().assetManager.get("icon/align_h_center.png",Texture.class)
)));
alignHCenterBtn.setUserObject(Config.centerH);
VisImageButton alignTopButton = new VisImageButton(new TextureRegionDrawable(new TextureRegion(
EditorManager.getInstance().assetManager.get("icon/align_top.png",Texture.class)
)));
alignTopButton.setUserObject(Align.top);
VisImageButton alignBottomButton = new VisImageButton(new TextureRegionDrawable(new TextureRegion(
EditorManager.getInstance().assetManager.get("icon/align_bottom.png",Texture.class)
)));
alignBottomButton.setUserObject(Align.bottom);
alignLeftBtn.addListener(alignClickListener);
alignRightBtn.addListener(alignClickListener);
alignCenterBtn.addListener(alignClickListener);
alignHCenterBtn.addListener(alignClickListener);
alignBottomButton.addListener(alignClickListener);
alignTopButton.addListener(alignClickListener);
shortcutTable.add(alignLeftBtn);
shortcutTable.add(alignRightBtn).spaceLeft(5);
shortcutTable.row();
shortcutTable.add(alignCenterBtn).spaceTop(5);
shortcutTable.add(alignHCenterBtn).spaceLeft(5).spaceTop(5);
shortcutTable.row();
shortcutTable.add(alignTopButton).spaceTop(5);
shortcutTable.add(alignBottomButton).spaceLeft(5).spaceTop(5);
this.add(shortcutTable).expand().left().padLeft(10).top().padTop(10);
}
示例8: layout
import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
@Override
public synchronized void layout() {
// this.setDebug(true, false);
if (!needsLayout) {
super.layout();
return;
}
this.clear();
Label.LabelStyle headerLabelStyle = new Label.LabelStyle();
headerLabelStyle.font = this.style.headerFont;
headerLabelStyle.fontColor = this.style.headerFontColor;
Label.LabelStyle commentLabelStyle = new Label.LabelStyle();
commentLabelStyle.font = this.style.descriptionFont;
commentLabelStyle.fontColor = this.style.descriptionFontColor;
headerTable = new VisTable();
headerTable.add(new Image(this.entry.type.getDrawable(style.typeStyle)));
headerTable.add((Actor) null).left().padLeft(CB.scaledSizes.MARGINx4).expandX().fillX();
String foundNumber = "";
if (entry.foundNumber > 0) {
foundNumber = "#" + entry.foundNumber + " @ ";
}
VisLabel dateLabel = new VisLabel(foundNumber + postFormatter.format(entry.timestamp), headerLabelStyle);
headerTable.add(dateLabel).padRight(CB.scaledSizes.MARGINx4).right();
headerTable.pack();
headerTable.layout();
this.add(headerTable).left().expandX().fillX();
this.row().padTop(CB.scaledSizes.MARGINx4);
VisTable cacheTable = new VisTable();
VisTable iconTable = new VisTable();
iconTable.add(entry.cacheType.getCacheWidget(style.cacheTypeStyle, null, null));
iconTable.pack();
iconTable.layout();
cacheTable.add(iconTable).left().padRight(CB.scaledSizes.MARGINx4);
VisLabel nameLabel = new VisLabel(entry.CacheName, headerLabelStyle);
nameLabel.setWrap(true);
cacheTable.add(nameLabel).padRight(CB.scaledSizes.MARGIN).expandX().fillX();
cacheTable.row();
cacheTable.add((Actor) null).left().padRight(CB.scaledSizes.MARGINx4);
VisLabel gcLabel = new VisLabel(entry.gcCode, headerLabelStyle);
gcLabel.setWrap(true);
cacheTable.add(gcLabel).padRight(CB.scaledSizes.MARGIN).expandX().fillX();
this.add(cacheTable).top().expandX().fillX();
this.row().padTop(CB.scaledSizes.MARGINx4);
VisLabel commentLabel = new VisLabel(entry.comment, commentLabelStyle);
commentLabel.setWrap(true);
this.add(commentLabel).expand().fill();
super.layout();
needsLayout = false;
}
示例9: 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);
}
}));
}
示例10: LoadingAssetsFailedDialog
import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
public LoadingAssetsFailedDialog (ImmutableArray<FailedAssetDescriptor> descriptors) {
super("Failed Assets Details");
TableUtils.setSpacingDefaults(this);
addCloseButton();
closeOnEscape();
setModal(true);
VisTable list = new VisTable(true);
list.defaults().top();
list.top().left();
Array<VisAssetDescriptor> addedDescriptors = new Array<>();
for (FailedAssetDescriptor desc : descriptors) {
boolean alreadyAdded = false;
for (VisAssetDescriptor addedDesc : addedDescriptors) {
if (addedDesc.compare(desc.asset)) {
alreadyAdded = true;
break;
}
}
if (alreadyAdded) continue;
addedDescriptors.add(desc.asset);
VisTextButton detailsButton = new VisTextButton("Details");
detailsButton.addListener(new VisChangeListener((event, actor) -> getStage().addActor(new DetailsDialog(desc.throwable).fadeIn())));
list.add(desc.asset.toString()).left().expandX().fillX();
list.add(detailsButton).padRight(5);
list.row();
}
add("Following assets couldn't be loaded:").left().row();
VisScrollPane scrollPane = new VisScrollPane(list);
scrollPane.setOverscroll(false, true);
scrollPane.setFadeScrollBars(false);
add(scrollPane).top().size(500, 300);
pack();
centerWindow();
}