com.kotcrab.vis.ui.widget.VisTextButton Java Examples

The following examples show how to use com.kotcrab.vis.ui.widget.VisTextButton. 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: TabbedPane.java    From riiablo with Apache License 2.0 6 votes vote down vote up
public void addTab(String text, VisTable content) {
  VisTextButton button = new VisTextButton(text) {{
    setName(getText().toString());
    setStyle(new TextButtonStyle(getStyle()) {{
      checked = down;
    }});
    setProgrammaticChangeEvents(false);
    setFocusBorderEnabled(false);
    addListener(clickListener);
  }};
  if (buttons.getCheckedIndex() == -1) {
    contentPanel.setActor(content);
    notifyTabSwitched(null, button.getName());
  }
  buttons.add(button);
  tabs.add(button).growX();
  map.put(button.getName(), content);
}
 
Example #2
Source File: FileChooserField.java    From Mundus with Apache License 2.0 5 votes vote down vote up
public FileChooserField(int width) {
    super();
    this.width = width;
    textField = new VisTextField();
    fcBtn = new VisTextButton("Select");

    setupUI();
    setupListeners();
}
 
Example #3
Source File: ImageChooserField.java    From Mundus with Apache License 2.0 5 votes vote down vote up
public ImageChooserField(int width) {
    super();
    this.width = width;
    fcBtn = new VisTextButton("Select");
    img = new Image(PLACEHOLDER_IMG);

    setupUI();
    setupListeners();
}
 
Example #4
Source File: TabbedPane.java    From vis-ui with Apache License 2.0 5 votes vote down vote up
public TabButtonTable (Tab tab) {
	this.tab = tab;
	button = new VisTextButton(getTabTitle(tab), style.buttonStyle) {
		@Override
		public void setDisabled (boolean isDisabled) {
			super.setDisabled(isDisabled);
			closeButton.setDisabled(isDisabled);
			deselect();
		}
	};
	button.setFocusBorderEnabled(false);
	button.setProgrammaticChangeEvents(false);

	closeButtonStyle = new VisImageButtonStyle(VisUI.getSkin().get("close", VisImageButtonStyle.class));

	closeButton = new VisImageButton(closeButtonStyle);
	closeButton.setGenerateDisabledImage(true);
	closeButton.getImage().setScaling(Scaling.fill);
	closeButton.getImage().setColor(Color.RED);

	addListeners();

	buttonStyle = new VisTextButtonStyle((VisTextButtonStyle) button.getStyle());
	button.setStyle(buttonStyle);
	closeButtonStyle = closeButton.getStyle();
	up = buttonStyle.up;

	add(button);
	if (tab.isCloseableByUser()) {
		add(closeButton).size(14 * sizes.scaleFactor, button.getHeight());
	}
}
 
Example #5
Source File: ColorPicker.java    From vis-ui with Apache License 2.0 5 votes vote down vote up
private VisTable createButtons () {
	ButtonBar buttonBar = new ButtonBar();
	buttonBar.setIgnoreSpacing(true);
	buttonBar.setButton(ButtonType.LEFT, restoreButton = new VisTextButton(RESTORE.get()));
	buttonBar.setButton(ButtonType.OK, okButton = new VisTextButton(OK.get()));
	buttonBar.setButton(ButtonType.CANCEL, cancelButton = new VisTextButton(CANCEL.get()));
	return buttonBar.createTable();
}
 
Example #6
Source File: TestColorPicker.java    From vis-ui with Apache License 2.0 5 votes vote down vote up
public TestColorPicker () {
	super("color picker");

	final Image image = new Image(white);

	picker = new ColorPicker("color picker", new ColorPickerAdapter() {
		@Override
		public void finished (Color newColor) {
			image.setColor(newColor);
		}
	});

	VisTextButton showPickerButton = new VisTextButton("show color picker");
	showPickerButton.addListener(new ChangeListener() {
		@Override
		public void changed (ChangeEvent event, Actor actor) {
			getStage().addActor(picker.fadeIn());
		}
	});

	Color c = new Color(27 / 255.0f, 161 / 255.0f, 226 / 255.0f, 1);
	picker.setColor(c);
	image.setColor(c);

	TableUtils.setSpacingDefaults(this);

	add(showPickerButton);
	add(image).size(32).pad(3);

	pack();
	setPosition(948, 148);
}