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

项目:enklave    文件:ScreenChat.java   
public void Addtogroup(){
    grchatfaction = new VerticalGroup();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd/HH:mm:ss");
    try {
        grchatfaction.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.BLUE,"Welcome Chat!"));
        grchatfaction.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.BLUE,"Faction!"));
        grchatfaction.addActor(labelTest1);
    } catch (ParseException e) {
        e.printStackTrace();
        Gdx.app.log("eroare","intra");
    }
    sp = new ScrollPane(grchatfaction);
    sp.layout();
    sp.setScrollingDisabled(true, false);
    sp.setFillParent(true);sp.setLayoutEnabled(true);
    ta = new Table();
    ta.setFillParent(false);
    ta.add(sp).fill().expand();
    ta.setBounds(WIDTH *0.05f,background1.getY(), WIDTH*0.9f,background1.getHeight() * 1.05f);
    ta.setVisible(false);
    groupbotttom.addActor(ta);
    sp.setScrollPercentY(200);
    sp.act(Gdx.graphics.getDeltaTime());
    sp.updateVisualScroll();
}
项目:Cubes_2    文件:ScrollInventoryActor.java   
public ScrollInventoryActor(Inventory inventory, int slots) {
    defaults().space(4f);

    add(new Label(inventory.getDisplayName(), new LabelStyle(Fonts.hud, Color.WHITE)));
    row();

    inner = new Table();
    inner.defaults().space(4f);
    for (int i = 0; i < inventory.itemStacks.length; i++) {
        SlotActor slotActor = new SlotActor(inventory, i);
        inner.add(slotActor);

        if ((i + 1) % inventory.width == 0) {
            inner.row();
        }
    }
    inner.pack();

    scrollPane = new ScrollPane(inner);
    scrollPane.setScrollingDisabled(true, false);
    add(scrollPane).height(slots * CALIBRATION_PER_ROW).fill();
    row();
    pack();
}
项目:enklave    文件:ScreenChat.java   
public void addchatlocation(){
    grchatlocation = new VerticalGroup();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd/HH:mm:ss");
    try {
        grchatlocation.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.RED,"Welcome Chat!"));
        grchatlocation.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.GREEN,"Location!"));
        grchatlocation.addActor(labelTest);
    } catch (ParseException e) {
        e.printStackTrace();
        Gdx.app.log("eroare","intra");
    }
    scrollchatpublic = new ScrollPane(grchatlocation);
    scrollchatpublic.layout();
    scrollchatpublic.setScrollingDisabled(true, false);
    scrollchatpublic.setFillParent(true);
    scrollchatpublic.setLayoutEnabled(true);
    tablechatpublic = new Table();
    tablechatpublic.setFillParent(false);
    tablechatpublic.add(scrollchatpublic).fill().expand();
    tablechatpublic.setBounds(WIDTH *0.05f,background1.getY(), WIDTH*0.9f,background1.getHeight() * 1.05f);
    groupbotttom.addActor(tablechatpublic);
    scrollchatpublic.setScrollPercentY(100);
    scrollchatpublic.act(Gdx.graphics.getDeltaTime());
    scrollchatpublic.updateVisualScroll();
}
项目:bobbybird    文件:ScrollerPane.java   
public ScrollerPane(TiledDrawable tiledDrawable, float xSpeed, float ySpeed) {
    this.tiledDrawable = tiledDrawable;
    this.xSpeed = xSpeed;
    this.ySpeed = ySpeed;
    xPosition = 0.0f;
    yPosition = 0.0f;

    Image image = new Image(tiledDrawable);

    innerTable = new Table();
    innerTable.add(image).width(5000);
    scrollPane = new ScrollPane(innerTable);
    scrollPane.setTouchable(Touchable.disabled);
    scrollPane.setSmoothScrolling(false);
    this.add(scrollPane).grow();
}
项目:Cubes    文件:ScrollInventoryActor.java   
public ScrollInventoryActor(Inventory inventory, int slots) {
  defaults().space(4f);

  add(new Label(inventory.getDisplayName(), new LabelStyle(Fonts.hud, Color.WHITE)));
  row();

  inner = new Table();
  inner.defaults().space(4f);
  for (int i = 0; i < inventory.itemStacks.length; i++) {
    SlotActor slotActor = new SlotActor(inventory, i);
    inner.add(slotActor);

    if ((i + 1) % inventory.width == 0) {
      inner.row();
    }
  }
  inner.pack();

  scrollPane = new ScrollPane(inner);
  scrollPane.setScrollingDisabled(true, false);
  add(scrollPane).height(slots * CALIBRATION_PER_ROW).fill();
  row();
  pack();
}
项目:Hexpert    文件:TutorialDialog.java   
public TutorialDialog(Hexpert hexpert, Skin skin, boolean useScrollPane) {
    super(hexpert, skin);
    scrollContent = new Table();
    if(useScrollPane) {
        scrollPane = new ScrollPane(scrollContent, skin);
        getContentTable().add(scrollPane);
    }

    getButtonTable().defaults().pad(15);
    I18NBundle i18N = hexpert.i18NBundle;

    TextButton textButtonOk = new TextButton(i18N.get("ok"), skin);
    getButtonTable().add(textButtonOk);

    setObject(textButtonOk, null);
}
项目:JavityEngine    文件:JXmlUi.java   
private void addHorizontalGroup(Table table, Element element) {
    Table horizontalGroup = new Table();
    ScrollPane scrollPane = new ScrollPane(horizontalGroup, skin);

    Cell<ScrollPane> cell = table.add(scrollPane);
    ObjectMap<String, String> atrributes = element.getAttributes();
    if (atrributes == null) {
        atrributes = new ObjectMap<String, String>();
    }

    for (String key : atrributes.keys()) {
        if (key.equalsIgnoreCase("name")) {
            horizontalGroup.setName(atrributes.get(key));
        }
    }
    cellPrepare(cell, atrributes);
    addChildrens(element, horizontalGroup);

    actorsMap.put(horizontalGroup.getName(), horizontalGroup);

}
项目:JavityEngine    文件:JXmlUi.java   
private void addVerticalGroup(Table table, Element element) {
        VerticalGroup verticalGroup = new VerticalGroup();
        ScrollPane scrollPane = new ScrollPane(verticalGroup, skin);

        Cell<ScrollPane> cell = table.add(scrollPane);
        ObjectMap<String, String> atrributes = element.getAttributes();
        if (atrributes == null) {
            atrributes = new ObjectMap<String, String>();
        }

        for (String key : atrributes.keys()) {
            if (key.equalsIgnoreCase("name")) {
                verticalGroup.setName(atrributes.get(key));
            }
        }
        cellPrepare(cell, atrributes);
//      addChildrens(element, horizontalGroup);

        actorsMap.put(verticalGroup.getName(), verticalGroup);      
    }
项目:JavityEngine    文件:JXmlUi.java   
private void addScrollPanel(Table table, Element element) {
    Table tableScroll = new Table(skin);
    ScrollPane scrollPane = new ScrollPane(tableScroll, skin);

    Cell<ScrollPane> cell = table.add(scrollPane);
    ObjectMap<String, String> atrributes = element.getAttributes();
    if (atrributes == null) {
        atrributes = new ObjectMap<String, String>();
    }

    for (String key : atrributes.keys()) {
        if (key.equalsIgnoreCase("name")) {
            tableScroll.setName(atrributes.get(key));
        }
    }
    cellPrepare(cell, atrributes);
    addChildrens(element, tableScroll);

    actorsMap.put(tableScroll.getName(), tableScroll);
}
项目:JavityEngine    文件:JXmlUi.java   
private void addList(Table table, Element element) {
    Gdx.app.log("JXmlUi", "addList");
    ObjectMap<String, String> atrributes = element.getAttributes();
    if (atrributes == null)
        atrributes = new ObjectMap<String, String>();

    List<String> list = new List<String>(skin);
    list.getSelection().setMultiple(false);

    ScrollPane scrollPane = new ScrollPane(list, skin);

    Cell<ScrollPane> cell = table.add(scrollPane);
    for (String key : atrributes.keys()) {
        if (key.equalsIgnoreCase("name")) {
            list.setName(atrributes.get(key));
            scrollPane.setName(atrributes.get(key) + "-scroll-panel");
        }
    }
    cellPrepare(cell, atrributes);

    actorsMap.put(list.getName(), list);
    actorsMap.put(scrollPane.getName(), scrollPane);

    addElementsInList(element, list);
}
项目:skin-composer    文件:RootTable.java   
private void addPreviewProperties(Table bottom, InputListener scrollPaneListener) {
    Label label = new Label("Preview Properties", getSkin(), "title");
    bottom.add(label);

    bottom.row();
    previewPropertiesTable = new Table();
    previewPropertiesTable.defaults().pad(5.0f);

    ScrollPane scrollPane = new ScrollPane(previewPropertiesTable, getSkin());
    scrollPane.setFadeScrollBars(false);
    scrollPane.setFlickScroll(false);
    scrollPane.addListener(scrollPaneListener);
    bottom.add(scrollPane).grow().padTop(10.0f).padBottom(10.0f);

    refreshPreviewProperties();
}
项目:space-travels-3    文件:DebugScreen.java   
private ScrollPane getButtonScrollPane()
{
    Table table = UIManager.getDefaultTable();

    table.add(getDebugDrawTextButton());
    table.row();
    table.add(getNoGravityTextButton());
    table.row();
    table.add(getInfiniteFuelTextButton());
    table.row();
    table.add(getForceCrashButton());
    table.row();
    table.add(getErrorButton());
    table.row();
    table.add(getSignOutButton());

    ScrollPane scrollPane = new ScrollPane(table);

    return scrollPane;
}
项目:cachebox3.0    文件:MainScreen.java   
public MainScreen(SkinEditorGame game) {
    this.game = game;

    barMenu = new MenuBar(game);
    barWidgets = new WidgetsBar(game);
    panePreview = new PreviewPane(game, this);
    paneOptions = new OptionsPane(game, panePreview);
    CB_SpriteBatch batch = new CB_SpriteBatch(CB_SpriteBatch.Mode.NORMAL);

    stage = new Stage(new ScreenViewport(),batch);

    Table table = new Table();
    table.setFillParent(true);

    table.top().left().add(barMenu).expandX().fillX().colspan(2).row();
    table.top().left().add(barWidgets).expandX().fillX().colspan(2).row();
    table.top().left().add(paneOptions).width(420).left().fill().expandY();
    ScrollPane scrollPane = new ScrollPane(panePreview);
    table.add(scrollPane).fill().expand();
    stage.addActor(table);
    barWidgets.initializeButtons();


}
项目:cachebox3.0    文件:EditTextBox.java   
public void setStyle(EditTextStyle style) {
    this.style = style;
    ScrollPane.ScrollPaneStyle sps = new ScrollPane.ScrollPaneStyle();
    sps.background = style.background;
    this.scrollPane.setStyle(sps);

    Label.LabelStyle ls = new Label.LabelStyle();
    ls.font = style.font;
    ls.fontColor = style.fontColor;
    this.textLabel.setStyle(ls);

    Button.ButtonStyle bs = new Button.ButtonStyle();
    bs.up = style.editIcon;
    bs.down = style.editIcon;
    editButton.setStyle(bs);
}
项目:fabulae    文件:GameObjectViewer.java   
public GameObjectViewer(GameObjectViewerStyle style) {
    super(Strings.getString(UIManager.STRING_TABLE, "goViewer"), style);

    goName = new Label("", style.headingStyle);
    goId = new Label("", style.headingStyle);
    goInternalId = new Label("", style.headingStyle);
    goDetails = new Label("", style.detailsStyle);
    goDetails.setWrap(true);
    goDetails.setAlignment(Align.topLeft);
    ScrollPane scrollPane = new ForcedScrollPane(goDetails, style.scrollPaneStyle);

    Table headingTable = new Table();
    headingTable.add(goName).fill();
    headingTable.add(goId).fill();
    headingTable.add(goInternalId).fill().expand();
    add(headingTable).left().width(style.scrollPaneWidth);
    row();
    add(scrollPane).width(style.scrollPaneWidth).height(style.scrollPaneHeight).fill().colspan(3);
    pack();
}
项目:cocos-ui-libgdx    文件:CCScrollView.java   
@Override
public Group groupChildrenParse(CocoStudioUIEditor editor,
                                ObjectData widget, Group parent, Actor actor) {
    ScrollPane scrollPane = (ScrollPane) actor;
    Table table = new Table();
    for (ObjectData childrenWidget : widget.getChildren()) {
        Actor childrenActor = editor.parseWidget(table, childrenWidget);
        if (childrenActor == null) {
            continue;
        }

        table.setSize(Math.max(table.getWidth(), childrenActor.getRight()),
            Math.max(table.getHeight(), childrenActor.getTop()));
        table.addActor(childrenActor);
    }
    sort(widget, table);
    //

    scrollPane.setWidget(table);

    return scrollPane;
}
项目:TheConsole_POC    文件:ConsoleView.java   
public ConsoleView(Skin skin) {
    this.skin = skin;
    entriesStack = new Table(skin);
    entriesStack.setFillParent(true);
    scrollPane = new ScrollPane(entriesStack, skin);
    scrollPane.setFadeScrollBars(false);
    scrollPane.setScrollbarsOnTop(false);
    scrollPane.setOverscroll(false, false);

    inputField = new TextField("", skin);

    this.add(scrollPane).expand().fill().pad(2).row();
    this.add(inputField).expandX().fillX().pad(4);

    setTouchable(Touchable.enabled);

    clearEntries();
}
项目:Alien-Ark    文件:ArkScreen.java   
private void createAlienInventory() {
    alienTable = new Table();
    alienTable.setWidth(INVENTORY_WIDTH);
    alienTable.padTop(6);
    alienTable.padRight(2);
    alienTable.padLeft(2);
    alienTable.padBottom(6);
    alienTable.top().left();

    ScrollPane alienScrollPane = new ScrollPane(alienTable);
    alienScrollPane.setX(Gdx.graphics.getWidth() - INVENTORY_OFFSET_X - INVENTORY_WIDTH);

    alienScrollPane.setY(INVENTORY_Y);
    alienScrollPane.setWidth(INVENTORY_WIDTH);
    alienScrollPane.setHeight(INVENTORY_HEIGHT);
    alienScrollPane.setScrollingDisabled(true, false);

    stage.addActor(alienScrollPane);

    alienCount = new Label("0", skin);
    alienCount.setStyle(Styles.LABEL_VALUE_ARTIFACT);
    alienCount.setX(Gdx.graphics.getWidth() - 120);
    alienCount.setY(560);

    stage.addActor(alienCount);
}
项目:Alien-Ark    文件:DirectionalLightsForm.java   
public DirectionalLightsForm(Skin skin, ReloadSceneListener reloadSceneListener) {
    setSkin(skin);
    addButton = new TextButton("add new light", skin);
    listener = reloadSceneListener;
    add(addButton);
    row();

    content = new Table();
    content.setBackground(DevelopmentWindow.INNER_BACKGROUND);
    content.pad(5);
    ScrollPane pane = new ScrollPane(content);
    pane.setScrollingDisabled(true, false);
    pane.setScrollBarPositions(false, true);
    pane.setScrollbarsOnTop(true);

    add(pane).height(300);
    row();

}
项目:Alien-Ark    文件:PlacedArtifactTable.java   
public PlacedArtifactTable() {
    setBackground(Styles.NINE_PATCH_POPUP_BG_01);

    selectBox = new SelectBox<ArtifactDefinitions.ConcreteArtifactType>(Styles.UI_SKIN);
    selectBox.setItems(ArtifactDefinitions.ConcreteArtifactType.values());
    add(selectBox);

    addButton = new TextButton("add artifact", Styles.UI_SKIN);
    add(addButton);
    row();

    artifactContent = new Table();
    scrollPane = new ScrollPane(artifactContent);
    scrollPane.setFadeScrollBars(false);
    add(scrollPane).colspan(2).height(200);

    pack();
}
项目:libgdxcn    文件:BaseG3dHudTest.java   
protected CollapsableWindow addListWindow (String title, List list, float x, float y) {
    CollapsableWindow window = new CollapsableWindow(title, skin);
    window.row();
    ScrollPane pane = new ScrollPane(list, skin);
    pane.setFadeScrollBars(false);
    window.add(pane);
    window.pack();
    window.pack();
    if (window.getHeight() > hudHeight) {
        window.setHeight(hudHeight);
    }
    window.setX(x < 0 ? hudWidth - (window.getWidth() - (x + 1)) : x);
    window.setY(y < 0 ? hudHeight - (window.getHeight() - (y + 1)) : y);
    window.layout();
    window.collapse();
    hud.addActor(window);
    pane.setScrollX(0);
    pane.setScrollY(0);
    return window;
}
项目:libgdxcn    文件:ControllersTest.java   
private void setupUi () {
    // setup a tiny ui with a console and a clear button.
    skin = new Skin(Gdx.files.internal("data/uiskin.json"));
    stage = new Stage();
    ui = new Table();
    ui.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    console = new List(skin);
    scrollPane = new ScrollPane(console);
    scrollPane.setScrollbarsOnTop(true);
    TextButton clear = new TextButton("Clear", skin);
    ui.add(scrollPane).expand(true, true).fill();
    ui.row();
    ui.add(clear).expand(true, false).fill();
    stage.addActor(ui);
    clear.addListener(new ClickListener() {
        @Override
        public void clicked (InputEvent event, float x, float y) {
            clear();
        }
    });
    Gdx.input.setInputProcessor(stage);
}
项目:libgdxcn    文件:GroupCullingTest.java   
public void create () {
    stage = new Stage();
    Gdx.input.setInputProcessor(stage);

    root = new Table();
    root.setFillParent(true);
    stage.addActor(root);

    skin = new Skin(Gdx.files.internal("data/uiskin.json"));

    Table labels = new Table();
    root.add(new ScrollPane(labels, skin)).expand().fill();
    root.row();
    root.add(drawnLabel = new Label("", skin));

    for (int i = 0; i < count; i++) {
        labels.add(new Label("Label: " + i, skin) {
            public void draw (Batch batch, float parentAlpha) {
                super.draw(batch, parentAlpha);
                drawn++;
            }
        });
        labels.row();
    }
}
项目:Terminkalender    文件:InteractionsDialog.java   
public InteractionsDialog(String title, Skin skin) {
    super(title, skin);

    center();
    setMovable(false);
    setResizable(false);
    setModal(true);
    pad(20);
    padTop(30);

    table = new Table(skin);
    ScrollPane scroll = new ScrollPane(table, skin, "window");
    TextButton acceptButton = new TextButton("OK", skin);
    Game game = AppMain.user.getGame();
    users = new Array<String>(game.getUsers());
    users.removeValue(AppMain.user.getUserName(), false);

    scroll.setFadeScrollBars(false);

    getButtonTable().defaults().width(175).height(100);
    getContentTable().padTop(20);
    getContentTable().padBottom(5);
    getContentTable().add(scroll).width(600).height(350);
    button(acceptButton);
}
项目:SaveUA    文件:ScrollMap.java   
/**
 *
 * @param tileMap ширина, высота и размер тайла берется из первого слоя:
 * TiledMapTileLayer bg = (TiledMapTileLayer) tileMap.getLayers().get(0);
 * cellSize = (int) bg.getTileHeight(); mapW = bg.getWidth(); mapH =
 * bg.getHeight();
 */
public ScrollMap(TiledMap tileMap) {
    mapCamera = new OrthographicCamera();
    mapRenderer = new OrthogonalTiledMapRenderer(tileMap, 1f/* / cellSize */);
    stageViewport = new ScreenViewport(new OrthographicCamera());
    TiledMapTileLayer bg = (TiledMapTileLayer) tileMap.getLayers().get(0);
    cellSize = (int) bg.getTileHeight();
    mapW = bg.getWidth() * cellSize;
    mapH = bg.getHeight() * cellSize;
    mapHolder = new Actor();
    mapHolder.setSize(mapW, mapH);
    scrollPane = new ScrollPane(mapHolder);
    scrollPane.setOverscroll(false, false);
    root = new Table();
    root.setFillParent(true);
    root.add(scrollPane).fill().expand();
    stage = new Stage(stageViewport);
    stage.addActor(root);
    im = new InputMultiplexer();
    gameBatch = mapRenderer.getSpriteBatch();
    sprites = new Array<Sprite>();
    gestureDetector = new GestureDetector(gestureListener);
}
项目:HAW-SE2-projecthorse    文件:CityPopup.java   
/**
 * Konstruktor.
 * 
 * @param cityObject
 *            CityInfos.
 */
public CityPopup(final CityObject cityObject) {
    Label label = createLabel(gennerateText(cityObject.getCityInfo()));
    ScrollPane scollContent = new DefaultScrollPane(label, height / 3, popupWidth * 0.8f);

    this.addActor(createLabel(cityObject.getCityName()));

    this.addActor(scollContent);
    Button btn = new ButtonLarge("Ok");
    btn.addListener(new ChangeListener() {

        @Override
        public void changed(final ChangeEvent event, final Actor actor) {
            getOverlay().disposePopup();
        }

    });
    this.addActor(btn);
}
项目:HAW-SE2-projecthorse    文件:TutorialPopup.java   
/**
 * Der default Konstruktor.
 */
public TutorialPopup() {

    Label label = createLabel(gennerateText());
    ScrollPane scollContent = new DefaultScrollPane(label,
            tutorialPopupHeight, popupWidth * 0.8f);

    this.addActor(createLabel("Anleitung :)"));

    this.addActor(scollContent);
    Button btn = new ButtonLarge("Los");
    btn.addListener(new ChangeListener() {

        @Override
        public void changed(final ChangeEvent event, final Actor actor) {
            getOverlay().disposePopup();
        }

    });
    this.addActor(btn);

}
项目:GdxStudio    文件:Serializer.java   
public static void setup(){
    registerSerializer(Actor.class, new ActorSerializer());
    registerSerializer(Scene.class, new SceneSerializer());
    registerSerializer(ImageJson.class, new ImageJson());
    registerSerializer(Label.class, new LabelSerializer());
    registerSerializer(Button.class, new ButtonSerializer());
    registerSerializer(TextButton.class, new TextButtonSerializer());
    registerSerializer(Table.class, new TableSerializer());
    registerSerializer(CheckBox.class, new CheckBoxSerializer());
    registerSerializer(SelectBox.class, new SelectBoxSerializer());
    registerSerializer(List.class, new ListSerializer());
    registerSerializer(Slider.class, new SliderSerializer());
    registerSerializer(TextField.class, new TextFieldSerializer());
    registerSerializer(Touchpad.class, new TouchpadSerializer());
    registerSerializer(Sprite.class, new SpriteSerializer());

    registerSerializer(Dialog.class, new DialogSerializer());
    registerSerializer(SplitPane.class, new SplitPaneSerializer());
    registerSerializer(ScrollPane.class, new ScrollPaneSerializer());
    registerSerializer(Stack.class, new StackSerializer());
    registerSerializer(Tree.class, new TreeSerializer());
    registerSerializer(Table.class, new TableSerializer());
    registerSerializer(ButtonGroup.class, new ButtonGroupSerializer());
    registerSerializer(HorizontalGroup.class, new HorizontalGroupSerializer());
    registerSerializer(VerticalGroup.class, new VerticalGroupSerializer());
}
项目:jaci    文件:LibGdxCliOutputBuffer.java   
/**
 * @param skin Skin to use for the lines.
 *             Must contain a {@link LabelStyle} called 'outputEntry' that will be used to style the lines.
 * @param maxBufferEntries Maximum amount of lines to store.
 */
public LibGdxCliOutputBuffer(Skin skin, int maxBufferEntries) {
    this.skin = Objects.requireNonNull(skin, "skin");
    this.maxBufferEntries = maxBufferEntries;

    // Create a buffer to hold out text labels.
    this.buffer = new Table();
    buffer.setName("outputBuffer");
    buffer.bottom().left();

    // Wrap the buffer in a scrollpane.
    scrollPane = new ScrollPane(buffer);
    scrollPane.setName("outputBufferScrollPane");
    scrollPane.setScrollingDisabled(true, false);
    scrollPane.setupOverscroll(0, 0, 0);
    scrollPane.setFillParent(true);
    updateScroll();

    // Buffer history.
    this.bufferEntries = new LinkedList<>();

    add(scrollPane);
}
项目:gdx-ai    文件:PathFinderTests.java   
protected CollapsableWindow addBehaviorSelectionWindow (String title, List<String> testList, float x, float y) {

        CollapsableWindow window = new CollapsableWindow(title, skin);
        window.row();

        ScrollPane pane = new ScrollPane(testList, skin);
        pane.setFadeScrollBars(false);
        pane.setScrollX(0);
        pane.setScrollY(0);

        window.add(pane);
        window.pack();
        window.pack();
        if (window.getHeight() > stage.getHeight()) {
            window.setHeight(stage.getHeight());
        }
        window.setX(x < 0 ? stage.getWidth() - (window.getWidth() - (x + 1)) : x);
        window.setY(y < 0 ? stage.getHeight() - (window.getHeight() - (y + 1)) : y);
        window.layout();
        window.collapse();
        stage.addActor(window);

        return window;
    }
项目:gdx-ai    文件:MessageTests.java   
protected CollapsableWindow addTestSelectionWindow (String title, List<String> testList, float x, float y) {
    CollapsableWindow window = new CollapsableWindow(title, skin);
    window.row();

    ScrollPane pane = new ScrollPane(testList, skin);
    pane.setFadeScrollBars(false);
    pane.setScrollX(0);
    pane.setScrollY(0);

    window.add(pane);
    window.pack();
    window.pack();
    if (window.getHeight() > stage.getHeight()) {
        window.setHeight(stage.getHeight());
    }
    window.setX(x < 0 ? stage.getWidth() - (window.getWidth() - (x + 1)) : x);
    window.setY(y < 0 ? stage.getHeight() - (window.getHeight() - (y + 1)) : y);
    window.layout();
    window.collapse();
    stage.addActor(window);

    return window;
}
项目:gdx-ai    文件:SemaphoreGuardTest.java   
@Override
public Actor createActor (Skin skin) {
    // Create the semaphore
    NonBlockingSemaphoreRepository.clear();
    NonBlockingSemaphoreRepository.addSemaphore("dogSemaphore", 1);

    Reader reader = null;
    try {
        // Parse Buddy's tree
        reader = Gdx.files.internal("data/dogSemaphore.tree").reader();
        BehaviorTreeParser<Dog> parser = new BehaviorTreeParser<Dog>(BehaviorTreeParser.DEBUG_HIGH);
        BehaviorTree<Dog> buddyTree = parser.parse(reader, new Dog("Buddy"));

        // Clone Buddy's tree for Snoopy
        BehaviorTree<Dog> snoopyTree = (BehaviorTree<Dog>)buddyTree.cloneTask();
        snoopyTree.setObject(new Dog("Snoopy"));

        // Create split pane
        BehaviorTreeViewer<?> buddyTreeViewer = createTreeViewer(buddyTree.getObject().name, buddyTree, false, skin);
        BehaviorTreeViewer<?> snoopyTreeViewer = createTreeViewer(snoopyTree.getObject().name, snoopyTree, false, skin);
        return new SplitPane(new ScrollPane(buddyTreeViewer, skin), new ScrollPane(snoopyTreeViewer, skin), true, skin,
            "default-horizontal");
    } finally {
        StreamUtils.closeQuietly(reader);
    }
}
项目:gdx-skineditor    文件:MainScreen.java   
public MainScreen(SkinEditorGame game) {
    this.game = game;

    barMenu = new MenuBar(game);
    barWidgets = new WidgetsBar(game);
    panePreview = new PreviewPane(game);
    paneOptions = new OptionsPane(game);
    stage = new Stage(new ScreenViewport());

    Table table = new Table();
    table.setFillParent(true);

    table.top().left().add(barMenu).expandX().fillX().colspan(2).row();
    table.top().left().add(barWidgets).expandX().fillX().colspan(2).row();
    table.top().left().add(paneOptions).width(420).left().fill().expandY();
    ScrollPane scrollPane = new ScrollPane(panePreview);
    table.add(scrollPane).fill().expand();
    stage.addActor(table);
    barWidgets.initializeButtons();



}
项目:amatsukaze    文件:BaseG3dHudTest.java   
protected CollapsableWindow addListWindow (String title, List list, float x, float y) {
    CollapsableWindow window = new CollapsableWindow(title, skin);
    window.row();
    ScrollPane pane = new ScrollPane(list, skin);
    pane.setFadeScrollBars(false);
    window.add(pane);
    window.pack();
    window.pack();
    if (window.getHeight() > hudHeight) {
        window.setHeight(hudHeight);
    }
    window.setX(x < 0 ? hudWidth - (window.getWidth() - (x + 1)) : x);
    window.setY(y < 0 ? hudHeight - (window.getHeight() - (y + 1)) : y);
    window.layout();
    window.collapse();
    hud.addActor(window);
    pane.setScrollX(0);
    pane.setScrollY(0);
    return window;
}
项目:spezi-gdx    文件:VerticalListWidget.java   
@Override
protected void onCreateView(Skin skin) {
    this.skin = skin;
    scrollPane = new ScrollPane(null, skin) {

        @Override
        public void scrollY(float pixels) {
            super.scrollY(pixels);
            model.setRelativePosition(scrollPane.getScrollPercentY());
        }

    };

    refresh();
    scrollPane.setWidth(getWidth() - getPadLeft() - getPadRight());
    scrollPane.setHeight(getHeight() - getPadTop() - getPadBottom());
    RelativeLayout.marginLeft(
            RelativeLayout.marginBottom(scrollPane, getPadBottom()),
            getPadLeft());
    scrollPane.setScrollingDisabled(true, false);
    addActor(scrollPane);
}
项目:spezi-gdx    文件:HorizontalListWidget.java   
@Override
protected void onCreateView(Skin skin) {
    this.skin = skin;
    scrollPane = new ScrollPane(null, skin) {
        @Override
        protected void scrollX(float pixelsX) {
            super.scrollX(pixelsX);
            model.setRelativePosition(scrollPane.getScrollPercentX());
        }
    };

    refresh();
    scrollPane.setWidth(getWidth() - getPadLeft() - getPadRight());
    scrollPane.setHeight(getHeight() - getPadTop() - getPadBottom());
    RelativeLayout.marginLeft(
            RelativeLayout.marginBottom(scrollPane, getPadBottom()),
            getPadLeft());

    scrollPane.setScrollingDisabled(false, true);
    addActor(scrollPane);
}
项目:Wisper    文件:WisperChooseMenu.java   
private void createTable() {
    list = new List<String>(skin);
    list.setItems(new String[] {"Thanatos", "Spark", "Bloody"});
    list.addListener(new ListListener());

    ScrollPane scrollPane = new ScrollPane(list, skin);

    TextButton start = new TextButton("Start", skin, "medium");
    start.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            fadeTo(new GameScreen(list.getSelectedIndex()));
        }
    });
    start.pad(10);

    table.padTop(50);
    table.add(new Label("Select your Wisper", skin, "big-bold")).colspan(2).expandX().spaceBottom(125).row();
    table.add(scrollPane).padLeft(10).minWidth(250).top().left();
    table.add(wisper).uniformX().expandX().expandY().center().row();
    table.add(start).colspan(2).expandX().bottom();
    table.padBottom(50);

    stage.addActor(table);
}
项目:ingress-indonesia-dev    文件:O.java   
public final void a(Skin paramSkin, Stage paramStage)
{
  N.a(this.a, new TextButton.TextButtonStyle());
  N.a(this.a).down = paramSkin.getDrawable("nav-button-clear-down");
  N.a(this.a).up = paramSkin.getDrawable("nav-button-clear");
  N.a(this.a).font = paramSkin.getFont("default-font");
  Table localTable1 = new Table(paramSkin);
  localTable1.top().pad(6.6F * this.a.a);
  localTable1.row();
  localTable1.add(N.a(this.a, new Label("", paramSkin)));
  a(paramSkin, localTable1);
  Table localTable2 = new Table();
  localTable2.setFillParent(true);
  N.a(this.a, new aa(paramSkin, (int)paramStage.getWidth(), J.a, ag.MOD_ITEMS));
  N.a(this.a).a();
  localTable2.add(N.a(this.a));
  localTable2.row();
  localTable2.add(new ScrollPane(localTable1)).n().f().e(2.0F);
  paramStage.addActor(localTable2);
}
项目:ingress-indonesia-dev    文件:cf.java   
public final void a(Skin paramSkin, Stage paramStage)
{
  this.k = ((Label.LabelStyle)paramSkin.get("mission-list", Label.LabelStyle.class));
  this.l = ((Label.LabelStyle)paramSkin.get("mission-list-disabled", Label.LabelStyle.class));
  this.d = ((TextButton.TextButtonStyle)paramSkin.get("mission-list", TextButton.TextButtonStyle.class));
  this.e = ((TextButton.TextButtonStyle)paramSkin.get("mission-list-completed", TextButton.TextButtonStyle.class));
  this.f = ((TextButton.TextButtonStyle)paramSkin.get("mission-list-selected", TextButton.TextButtonStyle.class));
  this.g = ((Button.ButtonStyle)paramSkin.get("default", TextButton.TextButtonStyle.class));
  this.h = ((Button.ButtonStyle)paramSkin.get("disabled", Button.ButtonStyle.class));
  this.o = paramSkin.getDrawable("nav-button-clear");
  this.b = new Table();
  this.b.setWidth(paramStage.getWidth());
  this.b.setHeight(paramStage.getHeight());
  cc.a(this.a, new aa(paramSkin, (int)paramStage.getWidth(), cc.b(this.a), com.nianticproject.ingress.common.ui.widget.ag.c));
  this.b.add(cc.c(this.a));
  this.b.row();
  this.c = new Table();
  this.c.setWidth(-10 + (int)paramStage.getWidth());
  ScrollPane localScrollPane = new ScrollPane(this.c, new ScrollPane.ScrollPaneStyle());
  localScrollPane.setScrollY(0.0F);
  localScrollPane.setScrollingDisabled(true, false);
  this.b.add(localScrollPane).g().o().p().j().a(5.0F, 5.0F, 5.0F, 5.0F);
  paramStage.addActor(this.b);
}
项目:feup-lpoo-armadillo    文件:CustomizeMenuScreen.java   
/**
 * Function responsible for creating the static Elements of the Stage (Scroller and Back Button), and organize them.
 * Also adds Listeners to its Elements.
 *
 * @param table      Table where the static elements will be organized.
 * @param skinsTable Table containing the level buttons, that will be associated to the scroller.
 */
private void createStaticElements(Table table, Table skinsTable) {
    TextButton back = addBackBtn(true);

    //Creating and setting the Scroller
    ScrollPane scroller = new ScrollPane(skinsTable, skin1);
    scroller.getStyle().background = null;

    table.add(back).size(DEFAULT_BUTTON_SIZE, DEFAULT_BUTTON_SIZE).top().left()     .padLeft(SIDE_DISTANCE).padTop(TOP_EDGE / 3).row();
    table.add(scroller).fill().expand().padBottom(SCROLLER_DISTANCE);
}