本文整理汇总了Java中com.google.gwt.user.client.ui.Grid.getColumnCount方法的典型用法代码示例。如果您正苦于以下问题:Java Grid.getColumnCount方法的具体用法?Java Grid.getColumnCount怎么用?Java Grid.getColumnCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Grid
的用法示例。
在下文中一共展示了Grid.getColumnCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ColourPickerTableView
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
public ColourPickerTableView() {
Grid grid = new Grid(50, 50);
grid.setBorderWidth(0);
grid.setCellPadding(0);
grid.setCellSpacing(0);
final double columnCount = grid.getColumnCount();
final double rowCount = grid.getRowCount();
for (int row = 0; row < rowCount; row++) {
for (int column = 0; column < columnCount; column++) {
final Element element = grid.getCellFormatter().getElement(row, column);
final int rowValue = 255 - (int) (row / (rowCount - 1) * 255);
final int columnValue = (int) (column / (columnCount - 1) * 255);
final int colourValue = (int) (columnValue * (1 - row / (rowCount - 1)));
element.setAttribute("style", "height:5px;width:5px;border:0px none;font-size:1px;color:#FFFFFF;background:rgb(" + colourValue + "," + rowValue + "," + rowValue + ")");
}
}
add(grid);
}
开发者ID:languageininteraction,项目名称:GraphemeColourSynaesthesiaApp,代码行数:19,代码来源:ColourPickerTableView.java
示例2: buildBannerTable
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public HTMLTable buildBannerTable(final int rows, final int cols) {
final Grid gridLayout = new Grid(rows, cols);
gridLayout.addStyleName(ProjectView.STYLE_HEADER_BANNER_FLEX);
gridLayout.setCellPadding(0);
gridLayout.setCellSpacing(0);
gridLayout.setWidth("100%");
gridLayout.setHeight("100%");
for (int i = 0; i < gridLayout.getColumnCount() - 1; i++) {
gridLayout.getColumnFormatter().setWidth(i, "325px");
}
return gridLayout;
}
示例3: onInitialize
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* Initialize this example.
*/
@ShowcaseSource
@Override
public Widget onInitialize() {
// Create a grid
Grid grid = new Grid(4, 4);
// Add images to the grid
int numRows = grid.getRowCount();
int numColumns = grid.getColumnCount();
for (int row = 0; row < numRows; row++) {
for (int col = 0; col < numColumns; col++) {
grid.setWidget(row, col, new Image(Showcase.images.gwtLogo()));
}
}
// Return the panel
grid.ensureDebugId("cwGrid");
return grid;
}