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

项目:skin-composer    文件:StyleData.java   
public void resetProperties() {
    properties.clear();

    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;
    }
}
项目:Missing_Words    文件:CategoryStatsScreen.java   
public CategoryStatsScreen(MissingWords missingWords) {
    super(missingWords);

    font = new BitmapFont(Gdx.files.internal("fonts/title.fnt"), Gdx.files.internal("fonts/title.png"), false); 
    fontList = new BitmapFont(Gdx.files.internal("fonts/listFont.fnt"), Gdx.files.internal("fonts/listFont.png"), false);

    /* Creamos el fondo de pantalla */
    background = new Background(MissingWords.myManager.get("background.png", Texture.class));
    stage.addActor(background);

    /* Creamos el bot�n de vuelta atr�s */
    backButton = new BackButton();
    backButton.addListener(new BackButtonListener(missingWords));

    /* Creamos la tabla que ocupar� todo el stage (pantalla) */
    stageTable = new Table();
    stageTable.setFillParent(true);

    /* Creamos la etiqueta de la categor�a */
    title = new Label(null, new LabelStyle(font, font.getColor()));

    /* Creamos el progreso de la categor�a */
    progress = new Label(null, new LabelStyle(font, font.getColor()));

    /* Creamos la lista de palabras de la categor�a */
    list = new List<String>(new ListStyle(
            fontList, 
            fontList.getColor(), 
            fontList.getColor(), 
            new TextureRegionDrawable(
                new TextureRegion(MissingWords.myManager.get("selection.png", Texture.class)))));

    /* Creamos el scroll para la lista de palabras */
    ScrollPane scroll = new ScrollPane(list, new ScrollPaneStyle(new TextureRegionDrawable(
            new TextureRegion(MissingWords.myManager.get("background.png", Texture.class))), 
                null, 
                null, 
                new TextureRegionDrawable(
                    new TextureRegion(MissingWords.myManager.get("verticalScroll.png", Texture.class))), 
                new TextureRegionDrawable(
                    new TextureRegion(MissingWords.myManager.get("squareBlue.png", Texture.class)))));

    /* Creamos la tabla izquierda del SplitPane */
    left = new Table();
    left.add(title).expand();
    left.row();
    left.add(progress).expand();
    left.row();
    left.add(backButton).align(Align.left).pad(10);

    /* Creamos la tabla derecha del SplitPane */
    right = new Table();
    right.add(scroll).fill().expand();

    /* Creamos el SplitPane */
    SplitPane split = new SplitPane(left, right, false, new SplitPaneStyle(
            new TextureRegionDrawable(
                    new TextureRegion(MissingWords.myManager.get("split.png", Texture.class)))));

    stageTable.add(split).fill().expand(); // A�adimos el SplitPane a la stageTable

    stage.addActor(stageTable); // A�adimos la stageTable al stage
}