use of com.kotcrab.vis.ui.widget.VisTable in project HyperLap2D by rednblackgames.
the class UIRemovableProperties method crateHeaderTable.
@Override
public Table crateHeaderTable() {
VisTable header = new VisTable();
header.setTouchable(Touchable.enabled);
header.setBackground(VisUI.getSkin().getDrawable("expandable-properties-active-bg"));
VisImageButton collapseButton = StandardWidgetsFactory.createImageButton("expandable-properties-button");
VisImageButton closeButton = StandardWidgetsFactory.createImageButton("close-properties");
header.add(closeButton).left().padLeft(2);
header.add(StandardWidgetsFactory.createLabel(title)).left().expandX().padLeft(6);
header.add(collapseButton).right().padRight(8);
header.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
collapse(header);
}
});
closeButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
Dialogs.showConfirmDialog(Sandbox.getInstance().getUIStage(), "Delete Component", "Do you want to delete this component?", new String[] { "Cancel", "Delete" }, new Integer[] { 0, 1 }, r -> {
if (r == 1) {
onRemove();
remove();
}
}).padBottom(20).pack();
}
});
closeButton.addListener(new ClickListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
event.cancel();
return true;
}
});
return header;
}
use of com.kotcrab.vis.ui.widget.VisTable in project HyperLap2D by rednblackgames.
the class EditSpriteAnimationPanel method updateView.
public void updateView(Map<String, FrameRange> frameRangeMap) {
createNewAnimationTable(frameRangeMap.get("Default").endFrame);
animationsList.clear();
for (Map.Entry<String, FrameRange> entry : frameRangeMap.entrySet()) {
String animationName = entry.getKey();
FrameRange range = entry.getValue();
VisTable row = new VisTable();
VisImageButton trashBtn = new VisImageButton("trash-button");
row.add(StandardWidgetsFactory.createLabel(animationName)).width(120).left();
row.add(StandardWidgetsFactory.createLabel(range.startFrame + "")).width(50).left();
row.add(StandardWidgetsFactory.createLabel(range.endFrame + "")).width(50).left();
if (!animationName.equals("Default"))
row.add(trashBtn).padLeft(10);
row.row();
animationsList.add(row).left();
animationsList.row();
trashBtn.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
facade.sendNotification(DELETE_BUTTON_PRESSED, animationName);
}
});
}
invalidateHeight();
}
use of com.kotcrab.vis.ui.widget.VisTable in project HyperLap2D by rednblackgames.
the class TagsPanel method updateView.
public void updateView() {
mainTable.clear();
tagTable = new VisTable();
VisTable inputTable = new VisTable();
List<String> sorted = new LinkedList<>(tags);
Collections.sort(sorted);
for (String tag : sorted) {
tagTable.add(new TagItem(tag, tagItemListener)).pad(5).left().expandX().fillX();
tagTable.row();
}
VisTextField newTagField = StandardWidgetsFactory.createTextField();
VisTextButton createTagBtn = new VisTextButton("add");
inputTable.add(newTagField).width(200);
inputTable.add(createTagBtn).padLeft(5);
createTagBtn.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
String tag = newTagField.getText();
if (!tagExists(tag)) {
newTagField.setText("");
addTag(tag);
facade.sendNotification(ITEM_ADD, tag);
}
}
});
mainTable.add(inputTable);
mainTable.row();
mainTable.add(tagTable).expandX().fillX();
invalidateHeight();
}
use of com.kotcrab.vis.ui.widget.VisTable in project HyperLap2D by rednblackgames.
the class BoxItemResourceSelectionUIMediator method clearSelection.
/**
* Clears the selection.
*/
private void clearSelection() {
for (VisTable boxesTable : boxesTableSet) {
for (Cell<BoxItemResource> cell : boxesTable.getCells()) {
BoxItemResource imgResource = cell.getActor();
setSelected(imgResource, false);
}
}
boxResourceSelectedSet.clear();
}
use of com.kotcrab.vis.ui.widget.VisTable in project HyperLap2D by rednblackgames.
the class UIMainTable method initToolsPanel.
private void initToolsPanel() {
VisTable toolsPanel = new VisTable();
toolsPanel.background("toolbar-bg");
//
UIToolBoxMediator uiToolBoxMediator = facade.retrieveMediator(UIToolBoxMediator.NAME);
UIToolBox uiToolBox = uiToolBoxMediator.getViewComponent();
toolsPanel.add(uiToolBox).top().expandY().padTop(4);
//
middleTable.add(toolsPanel).top().left().width(40).fillY().expandY();
}
Aggregations