Java Code Examples for com.kotcrab.vis.ui.widget.VisTable#add()

The following examples show how to use com.kotcrab.vis.ui.widget.VisTable#add() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BasicColorPicker.java    From vis-ui with Apache License 2.0 6 votes vote down vote up
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;
}
 
Example 2
Source File: ExtendedColorPicker.java    From vis-ui with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example 3
Source File: TestVertical.java    From vis-ui with Apache License 2.0 6 votes vote down vote up
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);
}
 
Example 4
Source File: TestVertical.java    From vis-ui with Apache License 2.0 6 votes vote down vote up
private void addVisWidgets () {
	VisProgressBar progressbar = new VisProgressBar(0, 100, 1, true);
	VisSlider slider = new VisSlider(0, 100, 1, true);
	VisSlider sliderDisabled = new VisSlider(0, 100, 1, true);

	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);
}
 
Example 5
Source File: SimpleListAdapter.java    From vis-ui with Apache License 2.0 5 votes vote down vote up
@Override
protected VisTable createView (ItemT item) {
	VisTable table = new VisTable();
	table.left();
	table.add(new VisLabel(item.toString()));
	return table;
}
 
Example 6
Source File: TestTabbedPane.java    From vis-ui with Apache License 2.0 5 votes vote down vote up
public TestTab (String title) {
	super(false, true);
	this.title = title;

	content = new VisTable();
	content.add(new VisLabel(title));
}
 
Example 7
Source File: TestSplitPane.java    From vis-ui with Apache License 2.0 5 votes vote down vote up
private void addVisWidgets () {
	VisLabel label = new VisLabel("Lorem \nipsum \ndolor \nsit \namet");
	VisLabel label2 = new VisLabel("Consectetur \nadipiscing \nelit");
	VisTable table = new VisTable(true);
	VisTable table2 = new VisTable(true);

	table.add(label);
	table2.add(label2);

	VisSplitPane splitPane = new VisSplitPane(table, table2, vertical);
	add(splitPane).fill().expand();
}
 
Example 8
Source File: TestSplitPane.java    From vis-ui with Apache License 2.0 5 votes vote down vote up
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();
}