Example usage for com.badlogic.gdx.scenes.scene2d.ui Container right

List of usage examples for com.badlogic.gdx.scenes.scene2d.ui Container right

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d.ui Container right.

Prototype

public Container<T> right() 

Source Link

Document

Sets Align#right and clears Align#left for the alignment of the actor within the container.

Usage

From source file:es.eucm.ead.editor.view.widgets.galleries.gallerieswithcategories.MyLibraryGallery.java

License:Open Source License

private void addCategoryLabel() {
    int toFill = columns - gallery.getGrid().getChildren().size % columns;
    for (int i = 0; i < toFill; i++) {
        gallery.addSpace();/*from w  w w  . j  a  v  a  2  s.  c o m*/
    }
    CategoryButton aux = categories.get(count);
    Label cat = new Label(aux.getButtonText(), skin, SkinConstants.STYLE_BIG);
    gallery.addOriginal(cat);
    gallery.addSpace();
    Container<TextButton> more = new Container<TextButton>();
    TextButton button = new TextButton(i18N.m("more").toUpperCase(), skin, SkinConstants.STYLE_CATEGORY);
    Color color = aux.getColor();
    color.a = 1;
    button.setColor(color);
    more.setActor(button);
    for (EventListener listener : aux.getListeners()) {
        button.addListener(listener);
    }
    more.right();
    gallery.addOriginal(more);
}

From source file:es.eucm.gleaner.viewer.TraceViewer.java

License:Apache License

public TraceViewer(Skin skin, AbstractTracker tracker) {
    this.skin = skin;
    this.tracker = tracker;

    ButtonStyle style = skin.get("trace", ButtonStyle.class);
    if (style == null) {
        throw new GdxRuntimeException("TraceViewer needs a ButtonStyle named 'trace'");
    }/*from  w  ww . java2 s  .c o m*/

    Stack stack = new Stack();

    ScrollPaneStyle scrollPaneStyle = new ScrollPaneStyle();
    scrollPaneStyle.background = skin.getDrawable("blank");
    detailedScroll = new ScrollPane(detailed = new VerticalGroup(), scrollPaneStyle);
    detailed.fill();
    detailed.left();

    detailedScroll.setScrollingDisabled(true, false);

    stack.addActor(detailedScroll);
    detailedScroll.setVisible(false);

    Button showDetail = new Button(style);
    showDetail.addListener(new ClickListener() {

        boolean visible = false;

        @Override
        public void clicked(InputEvent event, float x, float y) {
            visible = !visible;
            detailedScroll.setVisible(visible);
            feed.setVisible(!visible);
        }
    });
    Container<Actor> showDetailContainer = new Container<Actor>(showDetail);
    showDetailContainer.right().top();
    stack.addActor(showDetailContainer);

    stack.addActor(feed = new VerticalGroup());
    feed.right();
    feed.addActor(new Container<Actor>().minHeight(80));

    add(stack).expand().right().top();
    row();

    traceStyle = skin.get("trace", LabelStyle.class);
    if (traceStyle == null) {
        throw new GdxRuntimeException("TraceViewer needs a LabelStyle named 'trace'");
    }

    tracker.addTraceListener(this);
}