當前位置: 首頁>>代碼示例>>Java>>正文


Java Grid.getColumnCount方法代碼示例

本文整理匯總了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;
}
 
開發者ID:sigmah-dev,項目名稱:sigmah,代碼行數:20,代碼來源:ProjectView.java

示例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;
}
 
開發者ID:Peergos,項目名稱:Peergos,代碼行數:23,代碼來源:CwGrid.java


注:本文中的com.google.gwt.user.client.ui.Grid.getColumnCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。