use of com.kotcrab.vis.ui.widget.VisTable in project gdx-graph by MarcinSc.
the class ValueColorBoxProducer method createValuePart.
private GraphBoxPartImpl createValuePart(String value) {
Color color = Color.valueOf(value);
final TextureRegionDrawable drawable = new TextureRegionDrawable(WhitePixel.sharedInstance.texture);
BaseDrawable baseDrawable = new BaseDrawable(drawable) {
@Override
public void draw(Batch batch, float x, float y, float width, float height) {
drawable.draw(batch, x, y, width, height);
}
};
baseDrawable.setMinSize(20, 20);
final VisImage image = new VisImage(baseDrawable);
image.setColor(color);
final ColorPicker picker = new ColorPicker(new ColorPickerAdapter() {
@Override
public void finished(Color newColor) {
image.setColor(newColor);
image.fire(new GraphChangedEvent(false, true));
}
});
picker.setColor(color);
image.addListener(new ClickListener(Input.Buttons.LEFT) {
@Override
public void clicked(InputEvent event, float x, float y) {
// displaying picker with fade in animation
image.getStage().addActor(picker.fadeIn());
}
});
VisTable table = new VisTable();
table.add(new VisLabel("Color")).growX();
table.add(image);
table.row();
GraphBoxPartImpl colorPart = new GraphBoxPartImpl(table, new GraphBoxPartImpl.Callback() {
@Override
public void serialize(JsonValue object) {
object.addChild("color", new JsonValue(image.getColor().toString()));
}
}) {
@Override
public void dispose() {
picker.dispose();
}
};
colorPart.setOutputConnector(GraphBoxOutputConnector.Side.Right, configuration.getNodeOutputs().get("value"));
return colorPart;
}
use of com.kotcrab.vis.ui.widget.VisTable in project vis-ui by kotcrab.
the class ExtendedColorPicker method createUI.
@Override
protected void createUI() {
super.createUI();
// displayed next to mainTable
VisTable extendedTable = new VisTable(true);
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);
}
use of com.kotcrab.vis.ui.widget.VisTable in project vis-ui by kotcrab.
the class ToastManager method show.
/**
* Displays basic toast with provided text as message. Toast will be displayed for given amount of seconds.
*/
public void show(String text, float timeSec) {
VisTable table = new VisTable();
table.add(text).grow();
show(table, timeSec);
}
use of com.kotcrab.vis.ui.widget.VisTable in project vis-ui by kotcrab.
the class TestSplitPane method addNormalWidgets.
private void addNormalWidgets() {
Skin skin = VisUI.getSkin();
Label label = new Label("Lorem \nipsum \ndolor \nsit \namet", skin);
Label label2 = new Label("Consectetur \nadipiscing \nelit", skin);
VisTable table = new VisTable(true);
VisTable table2 = new VisTable(true);
table.add(label);
table2.add(label2);
SplitPane splitPane = new SplitPane(table, table2, false, skin);
add(splitPane).fill().expand();
}
use of com.kotcrab.vis.ui.widget.VisTable in project vis-ui by kotcrab.
the class TestVertical method addNormalWidgets.
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);
}
Aggregations