当前位置: 首页>>代码示例>>Java>>正文


Java Cell类代码示例

本文整理汇总了Java中com.esotericsoftware.tablelayout.Cell的典型用法代码示例。如果您正苦于以下问题:Java Cell类的具体用法?Java Cell怎么用?Java Cell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Cell类属于com.esotericsoftware.tablelayout包,在下文中一共展示了Cell类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: layout

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
public void layout () {
	Table table = getTable();
	Insets insets = table.getInsets();
	super.layout(insets.left, insets.top, //
		table.getWidth() - insets.left - insets.right, //
		table.getHeight() - insets.top - insets.bottom);

	List<Cell> cells = getCells();
	for (int i = 0, n = cells.size(); i < n; i++) {
		Cell c = cells.get(i);
		if (c.getIgnore()) continue;
		Component component = (Component)c.getWidget();
		component.setLocation((int)c.getWidgetX(), (int)c.getWidgetY());
		component.setSize((int)c.getWidgetWidth(), (int)c.getWidgetHeight());
	}

	if (getDebug() != Debug.none) SwingToolkit.startDebugTimer();
}
 
开发者ID:emara-geek,项目名称:object-recognition-tensorflow,代码行数:19,代码来源:TableLayout.java

示例2: addRequirement

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addRequirement(Requirement requirement) {
	row().fillX().pad(12, 0, 12, 0);
	Label label = Roboto18.makeLabel(requirement.displayString());
	label.setWrap(true);
	add(label).expandX();

	Cell amountCell = add().center();
	if (requirement.getAmount() > 0) {
		Label amountValue = RobotoBold18.makeLabel(String.format("%d/%d", requirement.getCurrentWeight(), requirement.getAmount()));
		amountValue.setAlignment(Align.center);
		amountCell.setWidget(amountValue);
	}

	ProgressBar progressBar = new ProgressBar(requirement.getProgress());
	add(progressBar).width(200).right().center();

	row();
	add(new HorizontalRule(Color.DARK_GRAY, 1)).colspan(3);
}
 
开发者ID:frigidplanet,项目名称:droidtowers,代码行数:21,代码来源:RequirementsTable.java

示例3: draw

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
public void draw(ShapeRenderer shapeRender) {
	if (mTable != null) {
		Cell c = getSelectedCell(x, y);
		if (c != null) {
			Actor selected = (Actor) (c.getWidget());
			if (selected != null) {
				shapeRender.setColor(Blob.colors(mPlayer.id%Blob.COLORS.length));
				GLCommon gl = Gdx.graphics.getGLCommon();
				shapeRender.begin(ShapeType.Line);
				shapeRender.box(mTable.getX()+selected.getX(), mTable.getY()+selected.getY(), 0, selected.getWidth(),
						selected.getHeight(), 0);
				gl.glLineWidth(3);
				shapeRender.end();
				gl.glLineWidth(1);
			}
		}
	}
}
 
开发者ID:underclocker,项目名称:Blob-Game,代码行数:19,代码来源:CustomizeController.java

示例4: getCell

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
private Cell getCell(int x, int y) {
	if (mTable != null) {
		for (Cell c : mTable.getCells()) {
			if (c.getColumn() == x && c.getRow() == y) {
				Actor cellActor = (Actor) (c.getWidget());
				if (cellActor instanceof Button
						&& (((Button) cellActor).isDisabled() || !((Button) cellActor)
								.isVisible())) {
					return null;
				} else {
					return c;
				}
			}
		}
	}
	return null;
}
 
开发者ID:underclocker,项目名称:Blob-Game,代码行数:18,代码来源:MenuController.java

示例5: getTransCell

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
private Cell getTransCell(int x, int y) {
	if (mTable != null) {
		for (Cell c : mTable.getCells()) {
			if (c.getColumn() == x && c.getRow() == y) {
				Actor cellActor = (Actor) (c.getWidget());
				if (cellActor instanceof Button
						&& (((Button) cellActor).isDisabled()
								|| !((Button) cellActor).isVisible() || !((Button) cellActor)
									.isTransform())) {
					return null;
				} else {
					return c;
				}
			}
		}
	}
	return null;
}
 
开发者ID:underclocker,项目名称:Blob-Game,代码行数:19,代码来源:MenuController.java

示例6: enter

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
public void enter(InputEvent event, float x, float y, int pointer, Actor fromActor) {
	if (fromActor instanceof ImageButton && ((ImageButton) fromActor).isDisabled()) {
		return;
	} else if (event.getListenerActor() instanceof ImageButton
			&& ((ImageButton) event.getListenerActor()).isDisabled()) {
		return;
	}
	Cell selected = mTable.getCell(event.getListenerActor());
	if (selected != null && (mX != selected.getColumn() || mY != selected.getRow())) {
		Actor cellActor = (Actor) (selected.getWidget());
		if (cellActor instanceof Button
				&& (((Button) cellActor).isDisabled() || !((Button) cellActor).isVisible())) {
			// nothing don't navigate
		} else {
			Game.get().playTickSound();
			mX = selected.getColumn();
			mY = selected.getRow();
		}
	}
}
 
开发者ID:underclocker,项目名称:Blob-Game,代码行数:21,代码来源:MenuController.java

示例7: onStatsTableCreated

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
public static void onStatsTableCreated(PortalUpgradeUi ui, Table t) {
    init(ui);

    Label.LabelStyle style = Mod.skin.get("portal-stats", Label.LabelStyle.class);
    final float den = Mod.displayMetrics.density;

    List<Cell> cells = new ArrayList<Cell>(t.getCells());
    t.clear();
    t.left();
    t.defaults().left();
    t.add((Actor) cells.get(1).getWidget()).padLeft(20 * den);
    t.add((Actor) cells.get(2).getWidget()).padLeft(8 * den);
    t.add((Actor) cells.get(3).getWidget()).padLeft(16 * den);
    t.add((Actor) cells.get(4).getWidget()).padLeft(8 * den);
    t.row();
    t.add((Actor) cells.get(7).getWidget()).padLeft(20 * den);
    t.add((Actor) cells.get(8).getWidget()).padLeft(8 * den);
    t.add(new Label("Dist.:", style)).padLeft(16 * den);
    t.add(distLabel = new Label("", style)).padLeft(8 * den);

    updateDistLabel(Mod.world.getPlayerModel().getPlayerLocation());
}
 
开发者ID:brutall,项目名称:ingress-apk-mod,代码行数:23,代码来源:PortalUpgradeMod.java

示例8: PortalInfoDialog_onStatsTableCreated

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
public static void PortalInfoDialog_onStatsTableCreated(PortalInfoDialog dialog, Table t) {
    Mod.portalInfoDialog = dialog;

    Label.LabelStyle style = Mod.skin.get("portal-stats", Label.LabelStyle.class);

    List<Cell> cells = new ArrayList<Cell>(t.getCells());
    t.clear();
    t.add((Actor) cells.get(0).getWidget()).left();
    t.add((Actor) cells.get(1).getWidget()).left().expandX();
    t.row();
    t.add((Actor) cells.get(3).getWidget()).left();
    t.add((Actor) cells.get(4).getWidget()).left().expandX();
    t.row();
    t.add(new Label("Keys:", style)).left();
    t.add(new Label(String.valueOf(InventoryUtils.getNumberOfPortalKeys(dialog.portalComponent)), style)).left().expandX();
    t.row();
    t.add(new Label("Dist.:", style)).left();
    t.add(portalInfoDistLabel = new Label("", style)).left().expandX();
}
 
开发者ID:brutall,项目名称:ingress-apk-mod,代码行数:20,代码来源:Entry.java

示例9: layout

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
public void layout() {
    layout.layout(getX(), getY(), getWidth(), getHeight());
    List<Cell<Widget, Table>> cells = layout.getCells();
    for (int i = 0, n = cells.size(); i < n; i++) {
        Cell<Widget, Table> c = cells.get(i);
        if (c.getIgnore()) {
            continue;
        }
        Widget cellWidget = c.getWidget();
        cellWidget.setX(c.getWidgetX());
        cellWidget.setY(c.getWidgetY());
        cellWidget.setWidth(c.getWidgetWidth());
        cellWidget.setHeight(c.getWidgetHeight());
    }
}
 
开发者ID:devnewton,项目名称:jnuit,代码行数:16,代码来源:Table.java

示例10: getSelectedCell

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
private Cell getSelectedCell(int x, int y){
	for (Cell c : mTable.getCells()) {
		if (c.getColumn() == x && c.getRow() == y) {
			return c;
		}
	}
	return null;
}
 
开发者ID:underclocker,项目名称:Blob-Game,代码行数:9,代码来源:CustomizeController.java

示例11: setIndex

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
public void setIndex(int i) {
	int j = 0;
	Cell target = null;
	for (Cell c : mTable.getCells()) {
		if (j == i) {
			target = c;
			break;
		}
		j++;
	}
	if (target != null) {
		mX = target.getColumn();
		mY = target.getRow();
	}
}
 
开发者ID:underclocker,项目名称:Blob-Game,代码行数:16,代码来源:MenuController.java

示例12: setTable

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
public void setTable(Table t) {
	mTable = t;
	if (t != null) {
		for (Cell c : t.getCells()) {
			Actor a = (Actor) c.getWidget();
			if (a != null) {
				a.addListener(hoverListener);
			}
		}
		selectFirstAvailable();
	}
}
 
开发者ID:underclocker,项目名称:Blob-Game,代码行数:13,代码来源:MenuController.java

示例13: setWidth

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
@Override
public void setWidth(float width) {
    super.setWidth(width);
    if (content != null) {
        for (Cell<?> cell : content.getCells()) {
            cell.width(width);
        }
        content.invalidate();
    }
}
 
开发者ID:Talon876,项目名称:explosions,代码行数:11,代码来源:PagedScrollPane.java

示例14: setPageSpacing

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
public void setPageSpacing(float pageSpacing) {
    if (content != null) {
        content.defaults().space(pageSpacing);
        for (Cell<?> cell : content.getCells()) {
            cell.space(pageSpacing);
        }
        content.invalidate();
    }
}
 
开发者ID:Talon876,项目名称:explosions,代码行数:10,代码来源:PagedScrollPane.java

示例15: obtainCell

import com.esotericsoftware.tablelayout.Cell; //导入依赖的package包/类
public Cell obtainCell (TableLayout layout) {
	Cell cell = new Cell();
	cell.setLayout(layout);
	return cell;
}
 
开发者ID:emara-geek,项目名称:object-recognition-tensorflow,代码行数:6,代码来源:SwingToolkit.java


注:本文中的com.esotericsoftware.tablelayout.Cell类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。