本文整理汇总了Java中com.kotcrab.vis.ui.widget.VisTextButton类的典型用法代码示例。如果您正苦于以下问题:Java VisTextButton类的具体用法?Java VisTextButton怎么用?Java VisTextButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VisTextButton类属于com.kotcrab.vis.ui.widget包,在下文中一共展示了VisTextButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initPreView
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
private void initPreView(int[] nines) {
previewTable.clear();
previewWidget = new PreviewWidget();
previewWidget.setHeight(205);
previewTable.add(previewWidget).width(200).height(205).top();
previewTable.row();
previewWidget.update(texture, nines);
VisLabel label = new VisLabel("Note: after saving, your \n scene will reload to \n apply changes.");
label.setAlignment(Align.center);
previewTable.add(label).pad(10).fillY().expandY();
previewTable.row();
saveBtn = new VisTextButton("apply and save");
previewTable.add(saveBtn).pad(5);
previewTable.row();
}
示例2: initialize
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
@Override
protected void initialize() {
Table topButtonBar = new Table();
topButtonBar.setFillParent(true);
VisTextButton showEditorButton = new VisTextButton("Show Editor");
showEditorButton.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
showEditorClicked();
}
});
topButtonBar.top().left().add(showEditorButton).pad(7);
Table bottomButtonBar = new Table();
bottomButtonBar.setFillParent(true);
stage.addActor(topButtonBar);
}
示例3: clicked
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
@Override
public void clicked(InputEvent event, float x, float y) {
VisTextButton checkedButton = btnGroup.getChecked();
log.debug("Toggle to: " + checkedButton.getText());
if (checkedButton.equals(tglBtnPreset)) {
actViewTable = presetListView;
} else if (checkedButton.equals(tglBtnSet)) {
actViewTable = filterSetListView;
} else if (checkedButton.equals(tglBtnCategory)) {
actViewTable = categoriesListView;
} else if (checkedButton.equals(tglBtnText)) {
actViewTable = textFilterView;
}
viewCell.setActor(actViewTable);
EditFilterSettings.this.invalidate();
EditFilterSettings.this.layout();
((OnShow) actViewTable).onShow();
}
示例4: getValue
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
Coordinate getValue() {
StringBuilder sb = new StringBuilder();
SnapshotArray<Actor> childs = this.getChildren();
for (Actor actor : childs) {
if (actor == null) {
sb.append(" ");
} else {
if (actor instanceof VisTextButton) {
sb.append(((VisTextButton) actor).getText());
} else if (actor instanceof VisLabel) {
sb.append(((VisLabel) actor).getText());
}
}
}
return new Coordinate(sb.toString());
}
示例5: onFocusSet
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
@Override
protected void onFocusSet(VisTextButton button) {
// Enable/Disable numPad or keyPad
if (button == l3_4) {
//disable numPad
numPad.setVisible(false);
// enable keyPad
Gdx.input.setOnscreenKeyboardVisible(true);
((InputMultiplexer) Gdx.input.getInputProcessor()).addProcessor(keyboardListener);
} else {
//disable keyPad
Gdx.input.setOnscreenKeyboardVisible(false);
((InputMultiplexer) Gdx.input.getInputProcessor()).removeProcessor(keyboardListener);
// enable numPad
numPad.setVisible(true);
}
}
示例6: popupTitle
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
/** Adds a popup-style title to a table
* @param table the {@link Table} that gets the popup title
* @param title a {@link String} to display on the title
* @param closeListener the {@link Listener} to invoke when the close button
* is pressed */
public static void popupTitle(final Table table, final String title, final Listener closeListener) {
table.add(new Table() {
{
setBackground(Drawables.get("blue"));
add(new VisLabel(title)).expand().center();
add(new VisTextButton("X") {
{
addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (closeListener != null) {
closeListener.invoke();
}
};
});
}
});
}
}).expand().fillX().top().row();
}
示例7: AreaNodeWidget
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
public AreaNodeWidget(final AreaNodeDefinition root, final NodeClickHandler listener) {
this.root = root;
defaults().pad(10);
add(rootButton = new VisTextButton(root.getName()) {
{
addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
listener.onClick(root);
};
});
}
}).maxWidth(100).row();
add(new Table() {
{
if (root.children != null) {
for (AreaNodeDefinition child : root.children) {
final AreaNodeWidget widget = new AreaNodeWidget(child, listener);
add(widget);
childrenButtons.add(widget.getRootButton());
}
}
}
});
}
示例8: drawConnector
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
private void drawConnector(Batch batch) {
if (childrenButtons == null) {
return;
}
batch.end();
shapeRenderer.begin(ShapeType.Line);
shapeRenderer.setColor(1, 1, 0, 1);
tmp.set(rootButton.getWidth() / 2, 0);
src = rootButton.localToStageCoordinates(tmp);
for (VisTextButton button : childrenButtons) {
tmp2.set(button.getWidth() / 2, button.getHeight());
dst = button.localToStageCoordinates(tmp2);
shapeRenderer.line(src, dst);
}
shapeRenderer.end();
batch.begin();
}
示例9: topnav
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
private Table topnav() {
return new Table() {
{
setBackground(Drawables.get("black"));
add(new VisTextButton("Save") {
{
addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
for (Module<?> m : modules) {
m.save();
}
Editor.reloadDb();
};
});
}
});
}
};
}
示例10: HEToolbox
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
public HEToolbox() {
super(true);
ButtonGroup<Button> toolButtons = new ButtonGroup<>();
for (final ToolType type : ToolType.values()) {
Button button = new VisTextButton(type.toString(), "toggle");
button.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
if (((Button) actor).isChecked()) {
HelixEditor.getInstance().getToolbarState().setActiveTool(type);
}
}
});
toolButtons.add(button);
add(button).padBottom(-8);
row();
}
}
示例11: buildTable
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
@Override
public void buildTable () {
prepareTable();
exporterSelector = new VisSelectBox<>();
exporterSelector.setItems(exporters);
VisTextButton exporterSettingsButton = new VisTextButton("Settings");
settingsTable.defaults().left();
settingsTable.add(TableBuilder.build(new VisLabel("Exporter"), exporterSelector, exporterSettingsButton));
exporterSettingsButton.addListener(new VisChangeListener((event, actor) -> {
UUID uuid = getUUIDForName(exporterSelector.getSelected());
ExporterPlugin exporter = exportersManager.getExportersMap().get(uuid);
if (exporter.isSettingsUsed() == false)
Dialogs.showOKDialog(stage, "Message", "This exporter does not have any additional settings");
else
exporter.showSettings();
}));
}
示例12: createUI
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
@Override
protected void createUI () {
defaults().left();
left();
detailsTextArea = new VisTextArea();
add(new VisLabel("Internal exception occurred in VisEditor, would you like to send\nissue report to VisEditor team to help fix this problem?")).row();
add(new VisLabel("Describe what happened: (optional)")).row();
add(detailsTextArea).height(140).growX().row();
VisTextButton sendButton = new VisTextButton("Send");
add(sendButton).right();
sendButton.addListener(new VisChangeListener((event, actor) -> {
sendReport();
fadeOut();
}));
}
示例13: createUI
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
@Override
protected void createUI () {
defaults().left();
left();
hullTolerance = new VisSlider(100, 400, 10, false);
hullTolerance.setValue(250);
alphaTolerance = new VisSlider(0, 255, 5, false);
alphaTolerance.setValue(128);
add(new VisLabel("Hull Tolerance"));
add(hullTolerance);
add().growX().row();
add(new VisLabel("Alpha Tolerance"));
add(alphaTolerance);
add().growX().row();
add(new VisLabel("Auto tracer does not support multi-part images,\nnote that creating points manually will be more precise.")).colspan(3).row();
VisTextButton traceButton = new VisTextButton("Trace");
VisTextButton closeButton = new VisTextButton("Close");
add(TableBuilder.build(traceButton, closeButton)).colspan(3).right();
traceButton.addListener(new VisChangeListener((event, actor) -> tracePolygon()));
closeButton.addListener(new VisChangeListener((event, actor) -> fadeOut()));
}
示例14: init
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
@Override
public void init () {
VisTextButton importButton = new VisTextButton("Import", "blue");
importButton.addListener(new VisChangeListener((event, actor) -> stage.addActor(new SpriterImportDialog(animFolder, relativePath).fadeIn())));
importTable = new VisTable();
importTable.pad(3);
importTable.add(new VisLabel("Spriter animation requires importing before use")).padRight(4);
importTable.add(importButton);
importTable.add().expandX().fillX();
VisTextButton updateButton = new VisTextButton("Update", "blue");
updateButton.addListener(new VisChangeListener((event, actor) ->
Async.startTask(stage, "Updating Animation", new UpdateAnimationAsyncTask())));
updateTable = new VisTable();
updateTable.pad(3);
updateTable.add(new VisLabel("Apply animation update?")).padRight(4);
updateTable.add(updateButton);
updateTable.add().expandX().fillX();
}
示例15: show
import com.kotcrab.vis.ui.widget.VisTextButton; //导入依赖的package包/类
@Override
public void show() {
stage = new Stage();
Gdx.input.setInputProcessor(stage);
VisUI.load();
CenteredTableBuilder tableBuilder = new CenteredTableBuilder(new Padding(2, 3));
VisLabel heading = new VisLabel("Credits");
heading.setColor(Color.BLACK);
tableBuilder.append(heading).row();
stage.addActor(heading);
VisLabel temp = new VisLabel("To Be Implemented");
temp.setColor(Color.BLACK);
tableBuilder.append(temp).row();
stage.addActor(temp);
VisTextButton backButton = new VisTextButton("Back");
backButton.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
((Game) Gdx.app.getApplicationListener()).setScreen(new MainMenuScreen());
}
});
tableBuilder.append(backButton).row();
stage.addActor(backButton);
Table table = tableBuilder.build();
table.setFillParent(true);
stage.addActor(table);
}