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

项目:cachebox3.0    文件:EditFilterSettings.java   
private void createOkCancel() {
    this.row();
    Table cancelOkTable = new Table();
    cancelOkTable.defaults().pad(CB.scaledSizes.MARGIN);

    CharSequenceButton btnOk = new CharSequenceButton(Translation.get("ok"));
    CharSequenceButton btnCancel = new CharSequenceButton(Translation.get("cancel"));

    btnOk.addListener(okListener);
    btnCancel.addListener(cancelListener);

    cancelOkTable.add(btnOk).expandX().fillX();
    cancelOkTable.add(btnCancel).expandX().fillX();

    this.add(cancelOkTable).width(new Value.Fixed(Gdx.graphics.getWidth() - CB.scaledSizes.MARGINx2));
}
项目:cachebox3.0    文件:ProjectionCoordinate.java   
private void createOkCancel() {
    this.row();
    Table cancelOkTable = new Table();

    CharSequenceButton btnOk = new CharSequenceButton(Translation.get("ok"));
    CharSequenceButton btnCancel = new CharSequenceButton(Translation.get("cancel"));

    btnOk.addListener(okListener);
    btnCancel.addListener(cancelListener);

    float btnWidth = (Gdx.graphics.getWidth() - CB.scaledSizes.MARGIN_HALF * 3) / 2;

    cancelOkTable.add(btnOk).width(new Value.Fixed(btnWidth));
    cancelOkTable.add(btnCancel).width(new Value.Fixed(btnWidth));

    this.add(cancelOkTable).bottom().width(new Value.Fixed(Gdx.graphics.getWidth() - CB.scaledSizes.MARGINx2));
}
项目:cachebox3.0    文件:CoordinateActivity.java   
private void createOkCancel() {
    this.row();
    Table cancelOkTable = new Table();

    CharSequenceButton btnOk = new CharSequenceButton(Translation.get("ok"));
    CharSequenceButton btnCancel = new CharSequenceButton(Translation.get("cancel"));

    btnOk.addListener(okListener);
    btnCancel.addListener(cancelListener);

    float btnWidth = (Gdx.graphics.getWidth() - CB.scaledSizes.MARGIN_HALF * 3) / 2;

    cancelOkTable.add(btnOk).width(new Value.Fixed(btnWidth));
    cancelOkTable.add(btnCancel).width(new Value.Fixed(btnWidth));

    this.add(cancelOkTable).bottom().width(new Value.Fixed(Gdx.graphics.getWidth() - CB.scaledSizes.MARGINx2));
}
项目:cachebox3.0    文件:Settings_Activity.java   
private ListViewItem getApiKeyButtonView(int listIndex, SettingsListGetApiButton<?> setting) {
    ListViewItem table = new ListViewItem(listIndex) {
        @Override
        public void dispose() {
        }
    };

    float buttonWidth = this.getWidth() - (CB.scaledSizes.MARGINx2 * 2);

    final ApiButton apiButton = new ApiButton();
    table.add(apiButton).width(new Value.Fixed(buttonWidth)).center();


    // add clickListener
    table.addListener(new ClickListener() {
        public void clicked(InputEvent event, float x, float y) {
            if (event.getType() == InputEvent.Type.touchUp) {
                apiButton.generateKey();
            }
        }
    });


    return table;
}
项目:Roguelike    文件:InventoryPanel.java   
public InventoryPanel( Skin skin, Stage stage )
{
    this.TileSize = 32;
    this.skin = skin;
    this.stage = stage;

    this.tileBackground = AssetManager.loadSprite( "GUI/TileBackground" );
    this.tileBorder = AssetManager.loadSprite( "GUI/TileBorder" );

    this.buttonUp = AssetManager.loadSprite( "GUI/Button" );
    this.buttonDown = AssetManager.loadSprite( "GUI/ButtonDown" );
    this.buttonBorder = AssetManager.loadSprite( "GUI/ButtonBorder" );

    header = new HeaderLine( skin, stage, buttonUp, tileBorder, TileSize );
    body = new InventoryBody( skin, stage, tileBackground, tileBorder, 32 );

    add( header ).width( Value.percentWidth( 1, this ) );
    row();
    add( body ).expand().fill().width( Value.percentWidth( 1, this ) );

    setTouchable( Touchable.childrenOnly );
}
项目:gdx-lml    文件:CellPadTopLmlAttribute.java   
@Override
protected void processForActor(final LmlParser parser, final LmlTag tag, final Actor actor,
        final String rawAttributeData) {
    // Parsed if actor is not in a cell:
    if (actor instanceof Table) {
        final Value verticalValue = LmlUtilities.parseVerticalValue(parser, tag.getParent(), actor,
                rawAttributeData);
        ((Table) actor).padTop(verticalValue);
    } else if (actor instanceof VerticalGroup) {
        ((VerticalGroup) actor).padTop(parser.parseFloat(rawAttributeData, actor));
    } else if (actor instanceof HorizontalGroup) {
        ((HorizontalGroup) actor).padTop(parser.parseFloat(rawAttributeData, actor));
    } else if (actor instanceof Container<?>) {
        ((Container<?>) actor)
                .padTop(LmlUtilities.parseVerticalValue(parser, tag.getParent(), actor, rawAttributeData));
    } else {
        // Exception:
        super.processForActor(parser, tag, actor, rawAttributeData);
    }
}
项目:gdx-lml    文件:CellPadLeftLmlAttribute.java   
@Override
protected void processForActor(final LmlParser parser, final LmlTag tag, final Actor actor,
        final String rawAttributeData) {
    // Parsed if actor is not in a cell:
    if (actor instanceof Table) {
        final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
                rawAttributeData);
        ((Table) actor).padLeft(horizontalValue);
    } else if (actor instanceof VerticalGroup) {
        ((VerticalGroup) actor).padLeft(parser.parseFloat(rawAttributeData, actor));
    } else if (actor instanceof HorizontalGroup) {
        ((HorizontalGroup) actor).padLeft(parser.parseFloat(rawAttributeData, actor));
    } else if (actor instanceof Container<?>) {
        ((Container<?>) actor)
                .padLeft(LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor, rawAttributeData));
    } else {
        // Exception:
        super.processForActor(parser, tag, actor, rawAttributeData);
    }
}
项目:gdx-lml    文件:CellPadRightLmlAttribute.java   
@Override
protected void processForActor(final LmlParser parser, final LmlTag tag, final Actor actor,
        final String rawAttributeData) {
    // Parsed if actor is not in a cell:
    if (actor instanceof Table) {
        final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
                rawAttributeData);
        ((Table) actor).padRight(horizontalValue);
    } else if (actor instanceof VerticalGroup) {
        ((VerticalGroup) actor).padRight(parser.parseFloat(rawAttributeData, actor));
    } else if (actor instanceof HorizontalGroup) {
        ((HorizontalGroup) actor).padRight(parser.parseFloat(rawAttributeData, actor));
    } else if (actor instanceof Container<?>) {
        ((Container<?>) actor)
                .padRight(LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor, rawAttributeData));
    } else {
        // Exception:
        super.processForActor(parser, tag, actor, rawAttributeData);
    }
}
项目:gdx-lml    文件:CellPadBottomLmlAttribute.java   
@Override
protected void processForActor(final LmlParser parser, final LmlTag tag, final Actor actor,
        final String rawAttributeData) {
    // Parsed if actor is not in a cell:
    if (actor instanceof Table) {
        final Value verticalValue = LmlUtilities.parseVerticalValue(parser, tag.getParent(), actor,
                rawAttributeData);
        ((Table) actor).padBottom(verticalValue);
    } else if (actor instanceof VerticalGroup) {
        ((VerticalGroup) actor).padBottom(parser.parseFloat(rawAttributeData, actor));
    } else if (actor instanceof HorizontalGroup) {
        ((HorizontalGroup) actor).padBottom(parser.parseFloat(rawAttributeData, actor));
    } else if (actor instanceof Container<?>) {
        ((Container<?>) actor)
                .padBottom(LmlUtilities.parseVerticalValue(parser, tag.getParent(), actor, rawAttributeData));
    } else {
        // Exception:
        super.processForActor(parser, tag, actor, rawAttributeData);
    }
}
项目:gdx-lml    文件:LmlUtilities.java   
private static Value determineVerticalValue(final LmlParser parser, final LmlTag parent, final Actor actor,
        final String valueToParse) {
    if (Strings.isFloat(valueToParse)) {
        return new Value.Fixed(parser.parseFloat(valueToParse, actor));
    } else if (Strings.endsWith(valueToParse, '%')) {
        return Value.percentHeight(parser.parseFloat(stripEnding(valueToParse), actor),
                getParentActorForValueParsing(parent, actor));
    } else if (Strings.startsWith(valueToParse, '%')) {
        return Value.percentHeight(parser.parseFloat(stripMarker(valueToParse), actor));
    }
    if (!STATIC_TABLE_VALUES.containsKey(valueToParse)) {
        parser.throwError(
                "Unable to determine Value object. Value has to be a float, float beginning or ending with '%' or static value reference. See LmlUtilities#parseVerticalValue(LmlParser, LmlTag, Actor, String). Received: "
                        + valueToParse);
    }
    return STATIC_TABLE_VALUES.get(valueToParse);
}
项目:gdx-lml    文件:LmlUtilities.java   
private static Value determineHorizontalValue(final LmlParser parser, final LmlTag parent, final Actor actor,
        final String valueToParse) {
    if (Strings.isFloat(valueToParse)) {
        return new Value.Fixed(parser.parseFloat(valueToParse, actor));
    } else if (Strings.endsWith(valueToParse, '%')) {
        return Value.percentWidth(parser.parseFloat(stripEnding(valueToParse), actor),
                getParentActorForValueParsing(parent, actor));
    } else if (Strings.startsWith(valueToParse, '%')) {
        return Value.percentWidth(parser.parseFloat(stripMarker(valueToParse), actor));
    }
    if (!STATIC_TABLE_VALUES.containsKey(valueToParse)) {
        parser.throwError(
                "Unable to determine Value object. Value has to be a float, float beginning or ending with '%' or static value reference. See LmlUtilities#parseHorizontalValue(LmlParser, LmlTag, Actor, String). Received: "
                        + valueToParse);
    }
    return STATIC_TABLE_VALUES.get(valueToParse);
}
项目:cachebox3.0    文件:EditFilterSettings.java   
private void createToggleBtn() {

        btnGroup = new ButtonGroup<>();

        VisTextButton.VisTextButtonStyle buttonStyle = VisUI.getSkin().get("toggle", VisTextButton.VisTextButtonStyle.class);

        buttonStyle.font = style.toggleButtonFont;
        buttonStyle.fontColor = style.toggleButtonFontColor;

        tglBtnPreset = new CharSequenceButton(Translation.get("preset"), buttonStyle);
        tglBtnSet = new CharSequenceButton(Translation.get("setting"), buttonStyle);
        tglBtnCategory = new CharSequenceButton(Translation.get("category"), buttonStyle);
        tglBtnText = new CharSequenceButton(Translation.get("text"), buttonStyle);

        tglBtnPreset.addListener(tglListener);
        tglBtnSet.addListener(tglListener);
        tglBtnCategory.addListener(tglListener);
        tglBtnText.addListener(tglListener);

        btnGroup.add(tglBtnPreset);
        btnGroup.add(tglBtnSet);
        btnGroup.add(tglBtnCategory);
        btnGroup.add(tglBtnText);


        Table tglTbl = new Table();
        tglTbl.defaults().space(CB.scaledSizes.MARGIN / 4);

        tglTbl.add(tglBtnPreset).expandX().fillX();
        tglTbl.add(tglBtnSet).expandX().fillX();

        //ISSUE (#167 implement Filter for Category)
//        tglTbl.add(tglBtnCategory).expandX().fillX();

        //ISSUE (#168 implement Filter for Text(CacheName/GcCode/OwnerName))
//        tglTbl.add(tglBtnText).expandX().fillX();

        this.add(tglTbl).width(new Value.Fixed(Gdx.graphics.getWidth() - CB.scaledSizes.MARGINx2));
    }
项目:cachebox3.0    文件:CheckStateActivity.java   
@Override
public void layout() {
    if (!needLayout) {
        super.layout();
        return;
    }

    SnapshotArray<Actor> actors = this.getChildren();
    for (Actor actor : actors)
        this.removeActor(actor);

    this.setFillParent(true);
    this.defaults().pad(CB.scaledSizes.MARGIN);

    this.add(lblTitle).colspan(3).center();
    this.add(gsLogo).colspan(2).center();
    this.row().padTop(new Value.Fixed(CB.scaledSizes.MARGINx2 * 2));


    this.add(workAnimation).colspan(5).center();
    this.row();
    this.add();
    this.add(progressBar).colspan(3).center().expandX().fillX();
    this.row();
    Table nestedTable2 = new Table();
    nestedTable2.defaults().pad(CB.scaledSizes.MARGIN).bottom();
    nestedTable2.add(bCancel).bottom();
    this.add(nestedTable2).colspan(5);

    super.layout();
    needLayout = false;
}
项目:cachebox3.0    文件:ReloadCacheActivity.java   
@Override
public void layout() {
    if (!needLayout) {
        super.layout();
        return;
    }

    SnapshotArray<Actor> actors = this.getChildren();
    for (Actor actor : actors)
        this.removeActor(actor);

    this.setFillParent(true);
    this.defaults().pad(CB.scaledSizes.MARGIN);

    this.add(lblTitle).colspan(3).center();
    this.add(gsLogo).colspan(2).center();
    this.row().padTop(new Value.Fixed(CB.scaledSizes.MARGINx2 * 2));


    this.add(workAnimation).colspan(5).center();
    this.row();
    this.add();
    this.add(progressBar).colspan(3).center().expandX().fillX();
    this.row();
    Table nestedTable2 = new Table();
    nestedTable2.defaults().pad(CB.scaledSizes.MARGIN).bottom();
    nestedTable2.add(bCancel).bottom();
    this.add(nestedTable2).colspan(5);

    super.layout();
    needLayout = false;
}
项目:cachebox3.0    文件:CoordinateActivity.java   
private Cell createValues() {
    this.row();
    Group group = new Group();
    group.addActor(decValues);
    float height = (CB.scaledSizes.BUTTON_HEIGHT * 2) + CB.scaledSizes.MARGIN * 4;
    return this.add(group).height(new Value.Fixed(height));
}
项目:cachebox3.0    文件:CoordinateActivity.java   
private void createToggleBtn() {

        btnGroup = new ButtonGroup<VisTextButton>();

        tglBtnDec = new VisTextButton("Dec", "toggle");
        tglBtnMin = new VisTextButton("Min", "toggle");
        tglBtnSec = new VisTextButton("Sec", "toggle");
        tglBtnUtm = new VisTextButton("UTM", "toggle");

        tglBtnDec.addListener(tglListener);
        tglBtnMin.addListener(tglListener);
        tglBtnSec.addListener(tglListener);
        tglBtnUtm.addListener(tglListener);

        btnGroup.add(tglBtnDec);
        btnGroup.add(tglBtnMin);
        btnGroup.add(tglBtnSec);
        btnGroup.add(tglBtnUtm);


        Table tglTbl = new Table();
        tglTbl.defaults().space(CB.scaledSizes.MARGIN / 4);

        float btnWidth = (Gdx.graphics.getWidth() - CB.scaledSizes.MARGIN * 3) / 4;


        tglTbl.add(tglBtnDec).width(new Value.Fixed(btnWidth));
        tglTbl.add(tglBtnMin).width(new Value.Fixed(btnWidth));
        tglTbl.add(tglBtnSec).width(new Value.Fixed(btnWidth));
        tglTbl.add(tglBtnUtm).width(new Value.Fixed(btnWidth));

        this.add(tglTbl).top().width(new Value.Fixed(Gdx.graphics.getWidth() - CB.scaledSizes.MARGINx2));
    }
项目:cachebox3.0    文件:CancelProgressDialog.java   
private static Table getProgressContentTable() {

        ProgressTable contentTable = new ProgressTable();
        float contentWidth = (Gdx.graphics.getWidth() * 0.75f);

        contentTable.label = new VisLabel();
        contentTable.add(contentTable.label).width(new Value.Fixed(contentWidth)).pad(20);
        contentTable.row();

        contentTable.progress = new ProgressBar(0, 100, 1, false, "default");
        contentTable.add(contentTable.progress).width(new Value.Fixed(contentWidth)).pad(20);
        contentTable.row();

        return contentTable;
    }
项目:Roguelike    文件:InventoryPanel.java   
@Override
public Table getToolTipForData( Object data )
{
    Table table = new Table();
    table.add( new Label( data.toString(), skin, "title" ) ).width( Value.percentWidth( 1, table ) );

    return table;
}
项目:gdx-lml    文件:CellPrefSizeLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    final Value verticalValue = LmlUtilities.parseVerticalValue(parser, tag.getParent(), actor, rawAttributeData);
    cell.prefSize(horizontalValue, verticalValue);
}
项目:gdx-lml    文件:CellMaxWidthLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    cell.maxWidth(horizontalValue);
}
项目:gdx-lml    文件:CellPadLeftLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    cell.padLeft(horizontalValue);
}
项目:gdx-lml    文件:CellMaxSizeLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    final Value verticalValue = LmlUtilities.parseVerticalValue(parser, tag.getParent(), actor, rawAttributeData);
    cell.maxSize(horizontalValue, verticalValue);
}
项目:gdx-lml    文件:CellSpaceRightLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    cell.spaceRight(horizontalValue);
}
项目:gdx-lml    文件:CellPadRightLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    cell.padRight(horizontalValue);
}
项目:gdx-lml    文件:CellMinSizeLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    final Value verticalValue = LmlUtilities.parseVerticalValue(parser, tag.getParent(), actor, rawAttributeData);
    cell.minSize(horizontalValue, verticalValue);
}
项目:gdx-lml    文件:CellMinWidthLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    cell.minWidth(horizontalValue);
}
项目:gdx-lml    文件:CellPrefWidthLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    cell.prefWidth(horizontalValue);
}
项目:gdx-lml    文件:CellPadLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    final Value verticalValue = LmlUtilities.parseVerticalValue(parser, tag.getParent(), actor, rawAttributeData);
    cell.pad(verticalValue, horizontalValue, verticalValue, horizontalValue);
}
项目:gdx-lml    文件:CellSizeLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    final Value verticalValue = LmlUtilities.parseVerticalValue(parser, tag.getParent(), actor, rawAttributeData);
    cell.size(horizontalValue, verticalValue);
}
项目:gdx-lml    文件:CellSpaceLeftLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    cell.spaceLeft(horizontalValue);
}
项目:gdx-lml    文件:CellSpaceLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    final Value verticalValue = LmlUtilities.parseVerticalValue(parser, tag.getParent(), actor, rawAttributeData);
    cell.space(verticalValue, horizontalValue, verticalValue, horizontalValue);
}
项目:gdx-lml    文件:CellWidthLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    cell.width(horizontalValue);
}
项目:gdx-lml    文件:ContainerMinWidthLmlAttribute.java   
@Override
public final void process(final LmlParser parser, final LmlTag tag, final Container<?> actor,
        final String rawAttributeData) {
    final Value value = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor, rawAttributeData);
    actor.minWidth(value);
    final Cell<?> cell = LmlUtilities.getCell(actor, tag.getParent());
    if (cell != null) {
        cell.minWidth(value);
    }
}
项目:gdx-lml    文件:ContainerMinSizeLmlAttribute.java   
@Override
public final void process(final LmlParser parser, final LmlTag tag, final Container<?> actor,
        final String rawAttributeData) {
    final Value xValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor, rawAttributeData);
    final Value yValue = LmlUtilities.parseVerticalValue(parser, tag.getParent(), actor, rawAttributeData);
    actor.minWidth(xValue);
    actor.minHeight(yValue);
    final Cell<?> cell = LmlUtilities.getCell(actor, tag.getParent());
    if (cell != null) {
        cell.minWidth(xValue);
        cell.minHeight(yValue);
    }
}
项目:gdx-lml    文件:PrefSizeLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    final Value verticalValue = LmlUtilities.parseVerticalValue(parser, tag.getParent(), actor, rawAttributeData);
    cell.prefSize(horizontalValue, verticalValue);
    if (actor instanceof FloatingGroup) {
        ((FloatingGroup) actor).setPrefWidth(horizontalValue.get(actor));
        ((FloatingGroup) actor).setPrefHeight(verticalValue.get(actor));
    }
}
项目:gdx-lml    文件:PrefWidthLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value horizontalValue = LmlUtilities.parseHorizontalValue(parser, tag.getParent(), actor,
            rawAttributeData);
    cell.prefWidth(horizontalValue);
    if (actor instanceof FloatingGroup) {
        ((FloatingGroup) actor).setPrefWidth(horizontalValue.get(actor));
    }
}
项目:gdx-lml    文件:PrefHeightLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final Cell<?> cell,
        final String rawAttributeData) {
    final Value verticalValue = LmlUtilities.parseVerticalValue(parser, tag.getParent(), actor, rawAttributeData);
    cell.prefHeight(verticalValue);
    if (actor instanceof FloatingGroup) {
        ((FloatingGroup) actor).setPrefHeight(verticalValue.get(actor));
    }
}
项目:cachebox3.0    文件:ImportGcPos.java   
@Override
public void layout() {
    if (!needLayout) {
        super.layout();
        return;
    }

    //check if map position actual
    Coordinate mapCenter = MapView.getLastCenterPos();
    if (mapCenter == null || mapCenter.isZero() || !mapCenter.isValid()) {
        tglBtnMap.setDisabled(true);
    }


    SnapshotArray<Actor> actors = this.getChildren();
    for (Actor actor : actors)
        this.removeActor(actor);

    this.setFillParent(true);
    this.defaults().pad(CB.scaledSizes.MARGIN);

    this.add(lblTitle).colspan(3).center();
    this.add(gsLogo).colspan(2).center();
    this.row().padTop(new Value.Fixed(CB.scaledSizes.MARGINx2 * 2));
    this.add(lblRadius);
    this.add(textAreaRadius).height(new Value.Fixed((textAreaRadius.getStyle().font.getLineHeight() + CB.scaledSizes.MARGINx4) * 1.3f));
    this.add(lblRadiusUnit).left();
    this.add(btnMinus).width(new Value.Fixed(textAreaRadius.getPrefHeight()));
    this.add(btnPlus).width(new Value.Fixed(textAreaRadius.getPrefHeight()));
    this.row().left();
    this.add(checkBoxOnlyAvailable).colspan(5).left();
    this.row();
    this.add(checkBoxExcludeHides).colspan(5).left();
    this.row();
    this.add(checkBoxExcludeFounds).colspan(5).left();
    this.row();
    Table nestedTable1 = new Table();
    nestedTable1.defaults().pad(CB.scaledSizes.MARGIN);
    nestedTable1.add(tglBtnGPS);
    nestedTable1.add(tglBtnMap);
    this.add(nestedTable1).colspan(5).expandX().fillX();
    this.row();
    this.add(workAnimation).colspan(5).center();
    this.row();
    this.add();
    this.add(progressBar).colspan(3).center().expandX().fillX();
    this.row();
    this.add(lblCaches).colspan(5).left();
    this.row();
    this.add(lblWaypoints).colspan(5).left();
    this.row();
    this.add(lblLogs).colspan(5).left();
    this.row();
    this.add(lblImages).colspan(5).left();
    this.row().expandY().fillY().bottom();
    this.add();
    this.row();
    Table nestedTable2 = new Table();
    nestedTable2.defaults().pad(CB.scaledSizes.MARGIN).bottom();
    nestedTable2.add(bOK).bottom();
    nestedTable2.add(bCancel).bottom();
    this.add(nestedTable2).colspan(5);

    super.layout();
    needLayout = false;
}
项目:cachebox3.0    文件:CoordinateActivity.java   
UtmValues() {

            this.defaults().padLeft(CB.scaledSizes.MARGIN_HALF / 2).padBottom(CB.scaledSizes.MARGIN_HALF);

            float minBtnWidth = ((Gdx.graphics.getWidth() - CB.scaledSizes.MARGIN * 3) / 11);

            this.add(l1_1);
            this.add(l1_2).width(new Value.Fixed(minBtnWidth));
            this.add(l1_3).width(new Value.Fixed(minBtnWidth));
            this.add(l1_4).width(new Value.Fixed(minBtnWidth));
            this.add(l1_5).width(new Value.Fixed(minBtnWidth));
            this.add(l1_6).width(new Value.Fixed(minBtnWidth));
            this.add(l1_7).width(new Value.Fixed(minBtnWidth));
            this.add(l1_8).width(new Value.Fixed(minBtnWidth));
            this.add(l1_9).width(new Value.Fixed(minBtnWidth));

            this.row();

            this.add(l2_1);
            this.add(l2_2).width(new Value.Fixed(minBtnWidth));
            this.add(l2_3).width(new Value.Fixed(minBtnWidth));
            this.add(l2_4).width(new Value.Fixed(minBtnWidth));
            this.add(l2_5).width(new Value.Fixed(minBtnWidth));
            this.add(l2_6).width(new Value.Fixed(minBtnWidth));
            this.add(l2_7).width(new Value.Fixed(minBtnWidth));
            this.add(l2_8).width(new Value.Fixed(minBtnWidth));
            this.add(l2_9).width(new Value.Fixed(minBtnWidth));

            this.row();

            this.add(l3_1);
            this.add(l3_2).width(new Value.Fixed(minBtnWidth));
            this.add(l3_3).width(new Value.Fixed(minBtnWidth));
            this.add(l3_4).width(new Value.Fixed(minBtnWidth));

            focusSequence = new VisTextButton[]{l1_2, l1_3, l1_4, l1_5, l1_6, l1_7, l2_2, l2_3, l2_4, l2_5, l2_6, l2_7, l2_8, l3_2, l3_3, l3_4};
            focusBegin = 0;
            focusLineEnd = -1;
            focusNextLineBegin = 0;

            //add clickListener
            l1_2.addListener(clickListener);
            l1_3.addListener(clickListener);
            l1_4.addListener(clickListener);
            l1_5.addListener(clickListener);
            l1_6.addListener(clickListener);
            l1_7.addListener(clickListener);
            l2_2.addListener(clickListener);
            l2_3.addListener(clickListener);
            l2_4.addListener(clickListener);
            l2_5.addListener(clickListener);
            l2_6.addListener(clickListener);
            l2_7.addListener(clickListener);
            l2_8.addListener(clickListener);
            l3_2.addListener(clickListener);
            l3_3.addListener(clickListener);
            l3_4.addListener(clickListener);
        }
项目:gdx-lml    文件:TablePadLeftLmlAttribute.java   
@Override
public void process(final LmlParser parser, final LmlTag tag, final Table actor, final String rawAttributeData) {
    final Value horizontalPad = LmlUtilities.parseHorizontalValue(parser, tag, actor, rawAttributeData);
    actor.padLeft(horizontalPad);
}