本文整理汇总了Java中com.kotcrab.vis.ui.widget.VisLabel类的典型用法代码示例。如果您正苦于以下问题:Java VisLabel类的具体用法?Java VisLabel怎么用?Java VisLabel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VisLabel类属于com.kotcrab.vis.ui.widget包,在下文中一共展示了VisLabel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initPreView
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的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: CheckStateActivity
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的package包/类
public CheckStateActivity() {
super("CheckStateActivity");
bCancel = new CharSequenceButton(Translation.get("cancel"));
gsLogo = new Image(CB.getSkin().getIcon.GC_Live);
lblTitle = new VisLabel(Translation.get("chkApiState"));
Label.LabelStyle style = new Label.LabelStyle(lblTitle.getStyle());
style.fontColor.set(Color.WHITE);
lblTitle.setStyle(style);
Drawable animationDrawable = VisUI.getSkin().getDrawable("download-animation");
workAnimation = new Image(animationDrawable);
progressBar = new VisProgressBar(0, 100, 1, false, "default");
createOkCancelBtn();
setWorkAnimationVisible(false);
this.setStageBackground(new ColorDrawable(VisUI.getSkin().getColor("dialog_background")));
// this.setDebug(true, true);
}
示例3: BlockUiProgress_Activity
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的package包/类
public BlockUiProgress_Activity(CharSequence msg) {
super("BlockUiActivity");
// this.setDebug(true);
msgLabel = new VisLabel(msg);
Label.LabelStyle msgDefaultStyle = msgLabel.getStyle();
Label.LabelStyle newStyle = new Label.LabelStyle();
newStyle.fontColor = Color.WHITE;
newStyle.font = msgDefaultStyle.font;
msgLabel.setStyle(newStyle);
msgLabel.setAlignment(Align.center);
this.add(msgLabel).expandX().fillX().pad(CB.scaledSizes.MARGINx4);
this.row();
this.add(progress);
this.setBackground((Drawable) null);
}
示例4: SelectDBItem
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的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();
}
示例5: ReloadCacheActivity
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的package包/类
public ReloadCacheActivity() {
super("CheckStateActivity");
bCancel = new CharSequenceButton(Translation.get("cancel"));
gsLogo = new Image(CB.getSkin().getIcon.GC_Live);
lblTitle = new VisLabel(Translation.get("ReloadCacheAPI"));
Label.LabelStyle style = new Label.LabelStyle(lblTitle.getStyle());
style.fontColor.set(Color.WHITE);
lblTitle.setStyle(style);
Drawable animationDrawable = VisUI.getSkin().getDrawable("download-animation");
workAnimation = new Image(animationDrawable);
progressBar = new VisProgressBar(0, 100, 1, false, "default");
createOkCancelBtn();
setWorkAnimationVisible(false);
this.setStageBackground(new ColorDrawable(VisUI.getSkin().getColor("dialog_background")));
// this.setDebug(true, true);
}
示例6: getValue
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的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());
}
示例7: doBeforeShow
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的package包/类
@Override
public void doBeforeShow(final Window dialog) {
// Too lazy to implement in LML. I'm tired.
scoresTable.clear();
final Array<Control> controls = controlsService.getControls();
for (int index = 0; index < controls.size; index++) {
final Control control = controls.get(index);
if (control.isActive() && control.isHumanControlled()) {
final VisLabel name = new VisLabel(
localeService.getI18nBundle().get(playerService.getSpriteType(index).name()),
VisUI.getSkin().getColor("vis-blue"));
scoresTable.add(name).expand().align(Align.left).padRight(5f);
scoresTable.add(String.valueOf(box2dService.getPoints(index))).expand().align(Align.right).padLeft(5f)
.row();
}
}
}
示例8: ExpandEditTextButton
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的package包/类
public ExpandEditTextButton(String text, Style style) {
super(style);
this.style = style;
label = new VisLabel(text, style.labelStyle);
label.setAlignment(Align.left);
label.setEllipsis(true);
labelCell = add(label).growX().left().width(new LabelCellWidthValue());
if (style.expandIcon != null) {
Image image = new Image(style.expandIcon);
image.setScaling(Scaling.none);
expandIconCell = add(image).padLeft(4f);
}
}
示例9: process
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final String rawAttributeData) {
VisLabel lblText = new VisLabel(parser.parseString(rawAttributeData, actor));
lblText.setAlignment(Align.center);
boolean needLineWrap = lblText.getPrefWidth() > LINE_WRAP_THRESHOLD;
if (needLineWrap) {
lblText.setWrap(true);
}
final Tooltip tooltip = new Tooltip();
tooltip.clearChildren(); // Removing empty cell with predefined paddings.
Cell<VisLabel> tooltipCell = tooltip.add(lblText).center().pad(0f, 4f, 2f, 4f);
if (needLineWrap) { tooltipCell.width(LINE_WRAP_THRESHOLD); }
tooltip.pack();
tooltip.setTarget(actor);
}
示例10: createPopup
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的package包/类
private void createPopup(final String title, final String defCommand) {
popup.setVisible(true);
popup.clear();
popupFields.clear();
popup.setBackground(Drawables.get("black"));
WidgetUtils.popupTitle(popup, title, closePopup());
suggestionsWidget = new SuggestionWidget(Commands.getAll(), 130, true);
popup.add(new Table() {
{
add(new VisLabel("Enter Command:"));
add(suggestionsWidget.getActor());
if (defCommand != null) {
suggestionsWidget.getTextField().setText(defCommand);
}
if (title.contains("Edit")) { // lol dw bout it
suggestionsWidget.getTextField().setDisabled(true);
}
}
}).row();
suggestionsWidget.addSelectListener(createPopupFields(suggestionsWidget.getTextField()));
suggestionsWidget.setGenericPopulate(createPopupFields(suggestionsWidget.getTextField()));
popup.add(popupFields).expand().fill().row();
popup.add(buttonTable);
}
示例11: update
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的package包/类
public void update() {
root.clear();
WidgetUtils.divider(root, "blue");
root.add(new Table() {
{
add(WidgetUtils.tooltip("Enter the name of a map to get a top-down preview. Click to get coordinates."));
add(new VisLabel("Map Preview:")).padRight(10);
SuggestionWidget suggestions = new SuggestionWidget(Editor.db().list(MapDefinition.class, DefinitionReference.MAPS).keys(), 200, true);
add(suggestions.getActor()).row();
suggestions.addSelectListener(updateMapListener(suggestions.getTextField()));
suggestions.setGenericPopulate(updateMapListener(suggestions.getTextField()));
}
}).row();
root.add(mapTable = new Table()).row();
root.add(coords = new VisLabel());
}
示例12: popupTitle
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的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();
}
示例13: setPage
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的package包/类
public void setPage(ScriptPageDefinition page) {
this.page = page;
content.clear();
content.setBackground(Drawables.get("blue"));
content.add(new VisLabel("State Properties")).row();
WidgetUtils.divider(content, "yellow");
PopulateConfig config = new PopulateConfig();
config.cols = 1;
config.suggestions = new ObjectMap<String, Array<String>>() {
{
put("animation", Editor.db().anims().keys().toArray());
put("animationGroup", Editor.db().animGroups().keys());
put("animationCollection", Editor.db().animCollections().keys());
put("precondition", Editor.db().flags().keys());
}
};
populate(content, ScriptPageDefinition.class, page, config);
}
示例14: create
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的package包/类
@Override
public void create(EnemyGroupDefinition definition, Table content) {
final PopulateConfig config = new PopulateConfig();
config.cols = 3;
config.textFieldWidth = 200;
populate(content, EnemyGroupDefinition.class, definition, config);
content.row();
content.add(new Table() {
{
add(WidgetUtils.tooltip("All enemies."));
add(new VisLabel("Enemies:"));
}
}).row();
WidgetUtils.divider(content, "blue");
WidgetUtils.modifiableList(content, definition.enemies, new Array<String>(Editor.db().enemies().keys()));
}
示例15: createHexTable
import com.kotcrab.vis.ui.widget.VisLabel; //导入依赖的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;
}