Java 类com.badlogic.gdx.scenes.scene2d.ui.Widget 实例源码

项目:penguins-in-space    文件:NoClickZone.java   
public NoClickZone(Widget child, int margin) {
    super(child);
    this.child = child;
    this.margin = margin;
    setDebug(true);
    addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            event.handle();
            event.stop();
        }
    });

}
项目:gaiasky    文件:CustomInterface.java   
public CustomInterface(Stage ui, Skin skin, Object lock) {
    this.skin = skin;
    this.ui = ui;
    customElements = new HashMap<Integer, Widget>();

    initSizes(skin);

    this.lock = lock;
    EventManager.instance.subscribe(this, Events.ADD_CUSTOM_IMAGE, Events.ADD_CUSTOM_MESSAGE, Events.REMOVE_OBJECTS, Events.REMOVE_ALL_OBJECTS, Events.ADD_CUSTOM_TEXT);
}
项目:gaiasky    文件:CustomInterface.java   
private void removeObject(Integer id) {
    Widget toRemove = customElements.get(id);
    if (toRemove != null) {
        toRemove.remove();
        customElements.remove(id);
    }
}
项目:gaiasky    文件:MessagesInterface.java   
public MessagesInterface(Skin skin, Object lock) {
    super(skin);
    customElements = new HashMap<Integer, Widget>();

    headline = new OwnLabel("", skin, "headline");
    headline.setColor(1, 1, 0, 1);
    subhead = new OwnLabel("", skin, "subhead");
    this.add(headline).left();
    this.row();
    this.add(subhead).left();
    this.lock = lock;
    EventManager.instance.subscribe(this, Events.POST_HEADLINE_MESSAGE, Events.CLEAR_HEADLINE_MESSAGE, Events.POST_SUBHEAD_MESSAGE, Events.CLEAR_SUBHEAD_MESSAGE, Events.CLEAR_MESSAGES);
}
项目:bladecoder-adventure-engine    文件:EditDialog.java   
public EditDialog(String title, Skin skin) {
        super(title, skin);

        this.skin = skin;

        setResizable(false);
        setKeepWithinStage(false);

        infoLbl = new Label("", skin);
        infoLbl.setWrap(true);
        centerPanel = new Table(skin);
        infoCell = getContentTable().add((Widget) infoLbl).prefWidth(200);
        getContentTable().add(new ScrollPane(centerPanel, skin))
                .maxHeight(Gdx.graphics.getHeight() * 0.8f)
                .maxWidth(Gdx.graphics.getWidth() * 0.7f)
                .minHeight(Gdx.graphics.getHeight() * 0.5f)
                .minWidth(Gdx.graphics.getWidth() * 0.5f);

        centerPanel.addListener(new InputListener() {
            @Override
            public void enter(InputEvent event, float x, float y, int pointer,  com.badlogic.gdx.scenes.scene2d.Actor fromActor) {
//              EditorLogger.debug("ENTER - X: " + x + " Y: " + y);
                getStage().setScrollFocus(centerPanel);
            }
        });

        button("OK", true);
        button("Cancel", false);
        // DISABLE the enter key because conflicts when newline in TextFields
//      key(Keys.ENTER, true);
        key(Keys.ESCAPE, false);

        padBottom(10);
        padLeft(10);
        padRight(10);
    }
项目:vis-editor    文件:PrefHeightIfVisibleValue.java   
@Override
public float get (Actor actor) {
    if (actor instanceof Widget) {
        Widget widget = (Widget) actor;
        return widget.isVisible() ? widget.getPrefHeight() : 0;
    }

    if (actor instanceof Table) {
        Table table = (Table) actor;
        return table.isVisible() ? table.getPrefHeight() : 0;
    }

    throw new IllegalStateException("Unsupported actor type for PrefHeightIfVisibleValue: " + actor.getClass());
}
项目:vis-editor    文件:PrefWidthIfVisibleValue.java   
@Override
public float get (Actor actor) {
    if (actor instanceof Widget) {
        Widget widget = (Widget) actor;
        return widget.isVisible() ? widget.getPrefWidth() : 0;
    }

    if (actor instanceof Table) {
        Table table = (Table) actor;
        return table.isVisible() ? table.getPrefWidth() : 0;
    }

    throw new IllegalStateException("Unsupported actor type for PrefWidthIfVisibleValue: " + actor.getClass());
}
项目:vis-editor    文件:VisWidgetValue.java   
@Override
public float get (Actor context) {
    return getter.get((Widget) context);
}
项目:vis-editor    文件:VisWidgetValue.java   
float get (Widget context);