com.badlogic.gdx.scenes.scene2d.ui.ScrollPane.ScrollPaneStyle Java Examples

The following examples show how to use com.badlogic.gdx.scenes.scene2d.ui.ScrollPane.ScrollPaneStyle. 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: MainListener.java    From skin-composer with MIT License 6 votes vote down vote up
@Override
public void stylePropertyChanged(StyleProperty styleProperty,
        Actor styleActor) {
    if (styleProperty.type == Drawable.class) {
        dialogFactory.showDialogDrawables(styleProperty, dialogListener);
    } else if (styleProperty.type == Color.class) {
        dialogFactory.showDialogColors(styleProperty, dialogListener);
    } else if (styleProperty.type == BitmapFont.class) {
        dialogFactory.showDialogFonts(styleProperty, dialogListener);
    } else if (styleProperty.type == Float.TYPE) {
        main.getUndoableManager().addUndoable(new UndoableManager.DoubleUndoable(main, styleProperty, ((Spinner) styleActor).getValue()), false);
    } else if (styleProperty.type == ScrollPaneStyle.class) {
        main.getUndoableManager().addUndoable(new UndoableManager.SelectBoxUndoable(root, styleProperty, (SelectBox) styleActor), true);
    } else if (styleProperty.type == LabelStyle.class) {
        main.getUndoableManager().addUndoable(new UndoableManager.SelectBoxUndoable(root, styleProperty, (SelectBox) styleActor), true);
    } else if (styleProperty.type == ListStyle.class) {
        main.getUndoableManager().addUndoable(new UndoableManager.SelectBoxUndoable(root, styleProperty, (SelectBox) styleActor), true);
    }
}
 
Example #2
Source File: FilteredSelectBox.java    From bladecoder-adventure-engine with Apache License 2.0 5 votes vote down vote up
public FilteredSelectBoxStyle(BitmapFont font, Color fontColor, Drawable background,
		ScrollPaneStyle scrollStyle, ListStyle listStyle, TextFieldStyle textFieldStyle) {
	this.font = font;
	this.fontColor.set(fontColor);
	this.background = background;
	this.scrollStyle = scrollStyle;
	this.listStyle = listStyle;
	this.textFieldStyle = textFieldStyle;
}
 
Example #3
Source File: FilteredSelectBox.java    From bladecoder-adventure-engine with Apache License 2.0 5 votes vote down vote up
public FilteredSelectBoxStyle(FilteredSelectBoxStyle style) {
	this.font = style.font;
	this.fontColor.set(style.fontColor);
	if (style.disabledFontColor != null)
		this.disabledFontColor = new Color(style.disabledFontColor);
	this.background = style.background;
	this.backgroundOver = style.backgroundOver;
	this.backgroundOpen = style.backgroundOpen;
	this.backgroundDisabled = style.backgroundDisabled;
	this.scrollStyle = new ScrollPaneStyle(style.scrollStyle);
	this.listStyle = new ListStyle(style.listStyle);
	this.textFieldStyle = new TextFieldStyle(style.textFieldStyle);
}
 
Example #4
Source File: LogMenu.java    From Cubes with MIT License 5 votes vote down vote up
public LogMenu() {
  label = new Label("", new LabelStyle(Fonts.smallHUD, Color.BLACK));
  label.setWrap(true);
  Drawable background = new TextureRegionDrawable(Assets.getTextureRegion("core:hud/LogBackground.png"));
  scrollPane = new ScrollPane(label, new ScrollPaneStyle(background, null, null, null, null));
  scrollPane.setScrollingDisabled(true, false);
  back = MenuTools.getBackButton(this);
  
  stage.addActor(scrollPane);
  stage.addActor(back);
  
  refresh();
}
 
Example #5
Source File: StyleData.java    From skin-composer with MIT License 4 votes vote down vote up
public void resetProperties() {
    properties.clear();
    parent = null;
    
    if (clazz.equals(Button.class)) {
        newStyleProperties(ButtonStyle.class);
    } else if (clazz.equals(CheckBox.class)) {
        newStyleProperties(CheckBoxStyle.class);
        properties.get("checkboxOn").optional = false;
        properties.get("checkboxOff").optional = false;
        properties.get("font").optional = false;
    } else if (clazz.equals(ImageButton.class)) {
        newStyleProperties(ImageButtonStyle.class);
    } else if (clazz.equals(ImageTextButton.class)) {
        newStyleProperties(ImageTextButtonStyle.class);
        properties.get("font").optional = false;
    } else if (clazz.equals(Label.class)) {
        newStyleProperties(LabelStyle.class);
        properties.get("font").optional = false;
    } else if (clazz.equals(List.class)) {
        newStyleProperties(ListStyle.class);
        properties.get("font").optional = false;
        properties.get("fontColorSelected").optional = false;
        properties.get("fontColorUnselected").optional = false;
        properties.get("selection").optional = false;
    } else if (clazz.equals(ProgressBar.class)) {
        newStyleProperties(ProgressBarStyle.class);
        
        //Though specified as optional in the doc, there are bugs without "background" being mandatory
        properties.get("background").optional = false;
    } else if (clazz.equals(ScrollPane.class)) {
        newStyleProperties(ScrollPaneStyle.class);
    } else if (clazz.equals(SelectBox.class)) {
        newStyleProperties(SelectBoxStyle.class);
        properties.get("font").optional = false;
        properties.get("fontColor").optional = false;
        properties.get("scrollStyle").optional = false;
        properties.get("scrollStyle").value = "default";
        properties.get("listStyle").optional = false;
        properties.get("listStyle").value = "default";
    } else if (clazz.equals(Slider.class)) {
        newStyleProperties(SliderStyle.class);
        
        //Though specified as optional in the doc, there are bugs without "background" being mandatory
        properties.get("background").optional = false;
    } else if (clazz.equals(SplitPane.class)) {
        newStyleProperties(SplitPaneStyle.class);
        properties.get("handle").optional = false;
    } else if (clazz.equals(TextButton.class)) {
        newStyleProperties(TextButtonStyle.class);
        properties.get("font").optional = false;
    } else if (clazz.equals(TextField.class)) {
        newStyleProperties(TextFieldStyle.class);
        properties.get("font").optional = false;
        properties.get("fontColor").optional = false;
    } else if (clazz.equals(TextTooltip.class)) {
        newStyleProperties(TextTooltipStyle.class);
        properties.get("label").optional = false;
        properties.get("label").value = "default";
    } else if (clazz.equals(Touchpad.class)) {
        newStyleProperties(TouchpadStyle.class);
    } else if (clazz.equals(Tree.class)) {
        newStyleProperties(TreeStyle.class);
        properties.get("plus").optional = false;
        properties.get("minus").optional = false;
    } else if (clazz.equals(Window.class)) {
        newStyleProperties(WindowStyle.class);
        properties.get("titleFont").optional = false;
    }
}
 
Example #6
Source File: CCScrollView.java    From cocos-ui-libgdx with Apache License 2.0 4 votes vote down vote up
@Override
public Actor parse(CocoStudioUIEditor editor, ObjectData widget) {
    ScrollPaneStyle style = new ScrollPaneStyle();

    if (widget.getFileData() != null) {

        style.background = editor
            .findDrawable(widget, widget.getFileData());
    }

    ScrollPane scrollPane = new ScrollPane(null, style);

    if ("Vertical_Horizontal".equals(widget.getScrollDirectionType())) {
        scrollPane.setForceScroll(true, true);
    } else if ("Horizontal".equals(widget.getScrollDirectionType())) {
        scrollPane.setForceScroll(true, false);
    } else if ("Vertical".equals(widget.getScrollDirectionType())) {
        scrollPane.setForceScroll(false, true);
    }

    scrollPane.setClamp(widget.isClipAble());
    scrollPane.setFlickScroll(widget.isIsBounceEnabled());

    Table table = new Table();
    table.setSize(widget.getInnerNodeSize().getWidth(), widget
        .getInnerNodeSize().getHeight());

    if (widget.getComboBoxIndex() == 0) {// 无颜色

    } else if (widget.getComboBoxIndex() == 1) {// 单色

        Pixmap pixmap = new Pixmap((int) table.getWidth(),
            (int) table.getHeight(), Format.RGBA8888);
        Color color = editor.getColor(widget.getSingleColor(),
            widget.getBackColorAlpha());

        pixmap.setColor(color);

        pixmap.fill();

        Drawable drawable = new TextureRegionDrawable(new TextureRegion(
            new Texture(pixmap)));

        table.setBackground(drawable);
        pixmap.dispose();

    }
    scrollPane.setWidget(table);
    return scrollPane;
}