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


Java Grid.setCellSpacing方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.Grid.setCellSpacing方法的典型用法代码示例。如果您正苦于以下问题:Java Grid.setCellSpacing方法的具体用法?Java Grid.setCellSpacing怎么用?Java Grid.setCellSpacing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.Grid的用法示例。


在下文中一共展示了Grid.setCellSpacing方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: createProjectBannerPanel

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
 * Creates the project banner panel.
 *
 * @return The project banner panel.
 */
private Component createProjectBannerPanel() {

	// Main panel.
	projectBannerPanel = Panels.content(I18N.CONSTANTS.loading()); // Temporary title.

	// Main grid.
	projectBannerGrid = new Grid(1, 2);
	projectBannerGrid.addStyleName(STYLE_HEADER_BANNER);
	projectBannerGrid.setCellPadding(0);
	projectBannerGrid.setCellSpacing(0);
	projectBannerGrid.setWidth("100%");
	projectBannerGrid.setHeight("100%");

	// Logo cell style.
	projectBannerGrid.getCellFormatter().setStyleName(HEADER_BANNER_LOGO_CELL.left, HEADER_BANNER_LOGO_CELL.right, STYLE_HEADER_BANNER_LOGO);

	projectBannerPanel.add(projectBannerGrid);

	return projectBannerPanel;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:26,代码来源:ProjectView.java

示例4: createOrgUnitBannerPanel

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
 * Creates the OrgUnit banner panel.
 * 
 * @return The OrgUnit banner panel.
 */
private Component createOrgUnitBannerPanel() {

	// Main panel.
	orgUnitBannerPanel = Panels.content(I18N.CONSTANTS.orgunit()); // Temporary title.

	// Main grid.
	orgUnitBannerGrid = new Grid(1, 2);
	orgUnitBannerGrid.addStyleName(ProjectView.STYLE_HEADER_BANNER);
	orgUnitBannerGrid.setCellPadding(0);
	orgUnitBannerGrid.setCellSpacing(0);
	orgUnitBannerGrid.setWidth("100%");
	orgUnitBannerGrid.setHeight("100%");

	// Logo cell.
	orgUnitBannerGrid.getCellFormatter().setStyleName(HEADER_BANNER_LOGO_CELL.left, HEADER_BANNER_LOGO_CELL.right, ProjectView.STYLE_HEADER_BANNER_LOGO);
	orgUnitBannerGrid.setWidget(HEADER_BANNER_LOGO_CELL.left, HEADER_BANNER_LOGO_CELL.right, OrgUnitImageBundle.ICONS.orgUnitLarge().createImage());

	orgUnitBannerPanel.add(orgUnitBannerGrid);

	return orgUnitBannerPanel;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:27,代码来源:OrgUnitView.java

示例5: ClearableField

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
public ClearableField(final Field<T> field) {
	super(new Grid(1, 2));
	
	setLabelSeparator(field.getLabelSeparator());
	setFieldLabel(field.getFieldLabel());

	this.field = field;
	this.deleteIcon = IconImageBundle.ICONS.deleteIcon().createImage();
	
	Grid grid = (Grid) widget;
	grid.setWidget(0, 0, field);
	grid.setWidget(0, 1, deleteIcon);
	grid.setCellSpacing(1);

	grid.getCellFormatter().setWidth(0, 1, "5px");
	
	addClearHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			field.clear();
		}
	});
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:24,代码来源:ClearableField.java

示例6: buildStructure

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
private void buildStructure(Rendering rendering) {
    switch (rendering) {
        case HORIZONTAL:
            Grid g = new Grid(1, 2);
            g.setWidget(0, 0, tb);
            g.setWidget(0, 1, img);
            initWidget(g);

            g.setCellSpacing(0);
            g.setCellPadding(0);
            g.setBorderWidth(0);
            break;
        case VERTICAL:
        default:
            FlowPanel fp = new FlowPanel();
            fp.add(img);
            fp.add(tb);
            initWidget(fp);

            setPixelSize(150, 80);
            break;
    }
}
 
开发者ID:inepex,项目名称:ineform,代码行数:24,代码来源:CaptchaWidget.java

示例7: ProjectList

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
 * Creates a new ProjectList
 */
public ProjectList() {
  projects = new ArrayList<Project>();
  selectedProjects = new ArrayList<Project>();
  projectWidgets = new HashMap<Project, ProjectWidgets>();

  sortField = SortField.DATE_MODIFIED;
  sortOrder = SortOrder.DESCENDING;

  // Initialize UI
  table = new Grid(1, 5); // The table initially contains just the header row.
  table.addStyleName("ode-ProjectTable");
  table.setWidth("100%");
  table.setCellSpacing(0);
  nameSortIndicator = new Label("");
  dateCreatedSortIndicator = new Label("");
  dateModifiedSortIndicator = new Label("");
  publishedSortIndicator = new Label("");
  refreshSortIndicators();
  setHeaderRow();

  VerticalPanel panel = new VerticalPanel();
  panel.setWidth("100%");

  panel.add(table);
  initWidget(panel);

  // It is important to listen to project manager events as soon as possible.
  Ode.getInstance().getProjectManager().addProjectManagerEventListener(this);

  gallery = GalleryClient.getInstance();
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:35,代码来源:ProjectList.java

示例8: SimpleColorPicker

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
 * Instantiates a new simple color picker.
 *
 * @param colopicker the colopicker
 */
public SimpleColorPicker(ComplexColorPicker colopicker) {
  super(colopicker);
  style.ensureInjected();

  final Grid grid = new Grid(ROWS, COLS);
  grid.setCellSpacing(0);
  grid.getRowFormatter().getElement(0).addClassName(style.firstRow());
  grid.getRowFormatter().getElement(1).addClassName(style.firstRow());
  int row;
  int col;
  int num = 0;
  for (final String c : COLORS) {
    row = num / COLS;
    col = num % COLS;
    grid.setWidget(row, col, createCell(c));
    num++;
  }
  grid.addClickHandler(new ClickHandler() {
        public void onClick(final ClickEvent event) {
          Cell cell = grid.getCellForEvent(event);
          if (cell != null) {
            String color = COLORS[cell.getRowIndex() * COLS + cell.getCellIndex()];
            onColorChoose(color);
          }
        }
      });
  grid.addStyleName(style.grid());
  initWidget(grid);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:35,代码来源:SimpleColorPicker.java

示例9: setProjectType

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void setProjectType(final ProjectModelType type) {

	final Grid iconGrid = new Grid(1, 2);
	iconGrid.setCellPadding(0);
	iconGrid.setCellSpacing(0);

	iconGrid.setWidget(0, 0, FundingIconProvider.getProjectTypeIcon(type, IconSize.MEDIUM).createImage());
	DOM.setStyleAttribute(iconGrid.getCellFormatter().getElement(0, 0), "paddingTop", "2px");
	iconGrid.setText(0, 1, ProjectModelType.getName(type));
	DOM.setStyleAttribute(iconGrid.getCellFormatter().getElement(0, 1), "paddingLeft", "5px");

	projectTypeField.setValue(iconGrid.getElement().getString());
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:18,代码来源:LinkedProjectView.java

示例10: MouseListBox

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
    * Used by {@link ListBoxDragController} to create a draggable listbox
    * containing the selected items.
    */
   MouseListBox(int size) {
grid = new Grid(size, 1);
initWidget(grid);
grid.setCellPadding(0);
grid.setCellSpacing(0);
addStyleName(CSS_DEMO_MOUSELISTBOX);
for (int i = 0; i < size; i++) {
    grid.getCellFormatter().addStyleName(i, 0, CSS_DEMO_DUAL_LIST_EXAMPLE_ITEM);
    setWidget(i, null);
}
   }
 
开发者ID:fhcampuswien,项目名称:atom,代码行数:16,代码来源:MouseListBox.java

示例11: SimpleColorPicker

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
 * Instantiates a new simple color picker.
 *
 * @param colopicker the colopicker
 */
public SimpleColorPicker(ComplexColorPicker colopicker) {
  super(colopicker);
  style.ensureInjected();

  final Grid grid = new Grid(ROWS, COLS);
  grid.setCellSpacing(0);
  grid.getRowFormatter().getElement(0).addClassName(style.firstRow());
  grid.getRowFormatter().getElement(1).addClassName(style.firstRow());
  int row;
  int col;
  int num = 0;
  for (final String c : COLORS) {
    row = num / COLS;
    col = num % COLS;
    grid.setWidget(row, col, createCell(c));
    num++;
  }
  grid.addClickHandler(new ClickHandler() {
    public void onClick(final ClickEvent event) {
      Cell cell = grid.getCellForEvent(event);
      if (cell != null) {
        String color = COLORS[cell.getRowIndex() * COLS + cell.getCellIndex()];
        onColorChoose(color);
      }
    }
  });
  grid.addStyleName(style.grid());
  initWidget(grid);
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:35,代码来源:SimpleColorPicker.java

示例12: FormPanelComponent

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
public FormPanelComponent() {
	Grid grid = new Grid(1,1);
	grid.setCellPadding(0);
	grid.setCellSpacing(0);
	setPanelWidget(grid);
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:7,代码来源:FormPanelComponent.java

示例13: onModuleLoad

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
public void onModuleLoad() {

        final Mediator mediator = new Mediator();

        final Header header = new Header(mediator);

        final MainWidget mainWidget = new MainWidget(mediator);

        final Grid majorLayoutPanel = new Grid(2, 1);
        majorLayoutPanel.setCellSpacing(0);

        majorLayoutPanel.setWidget(0, 0, header);
        majorLayoutPanel.getCellFormatter().setStyleName(0, 0, "headerCell");

        majorLayoutPanel.setWidget(1, 0, mainWidget);
        majorLayoutPanel.getCellFormatter().setStyleName(1, 0, "mainWidgetCell");

        majorLayoutPanel.setStylePrimaryName("majorLayout");

        mediator.setMajorLayoutPanel(majorLayoutPanel);

        History.addHistoryListener(new HistoryListener(mediator));

        RootPanel.get("client").add(majorLayoutPanel);
    }
 
开发者ID:halls,项目名称:wannatrak,代码行数:26,代码来源:Client.java

示例14: createAdvancedForm

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
 * Create a form that contains undisclosed advanced options.
 */
@ShowcaseSource
private Widget createAdvancedForm() {
  // Create a table to layout the form options
  FlexTable layout = new FlexTable();
  layout.setCellSpacing(6);
  layout.setWidth("300px");
  FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();

  // Add a title to the form
  layout.setHTML(0, 0, constants.cwDisclosurePanelFormTitle());
  cellFormatter.setColSpan(0, 0, 2);
  cellFormatter.setHorizontalAlignment(
      0, 0, HasHorizontalAlignment.ALIGN_CENTER);

  // Add some standard form options
  layout.setHTML(1, 0, constants.cwDisclosurePanelFormName());
  layout.setWidget(1, 1, new TextBox());
  layout.setHTML(2, 0, constants.cwDisclosurePanelFormDescription());
  layout.setWidget(2, 1, new TextBox());

  // Create some advanced options
  HorizontalPanel genderPanel = new HorizontalPanel();
  String[] genderOptions = constants.cwDisclosurePanelFormGenderOptions();
  for (int i = 0; i < genderOptions.length; i++) {
    genderPanel.add(new RadioButton("gender", genderOptions[i]));
  }
  Grid advancedOptions = new Grid(2, 2);
  advancedOptions.setCellSpacing(6);
  advancedOptions.setHTML(0, 0, constants.cwDisclosurePanelFormLocation());
  advancedOptions.setWidget(0, 1, new TextBox());
  advancedOptions.setHTML(1, 0, constants.cwDisclosurePanelFormGender());
  advancedOptions.setWidget(1, 1, genderPanel);

  // Add advanced options to form in a disclosure panel
  DisclosurePanel advancedDisclosure = new DisclosurePanel(
      constants.cwDisclosurePanelFormAdvancedCriteria());
  advancedDisclosure.setAnimationEnabled(true);
  advancedDisclosure.ensureDebugId("cwDisclosurePanel");
  advancedDisclosure.setContent(advancedOptions);
  layout.setWidget(3, 0, advancedDisclosure);
  cellFormatter.setColSpan(3, 0, 2);

  // Wrap the contents in a DecoratorPanel
  DecoratorPanel decPanel = new DecoratorPanel();
  decPanel.setWidget(layout);
  return decPanel;
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:51,代码来源:CwDisclosurePanel.java

示例15: Application

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
 * Constructor.
 */
public Application() {
  // Setup the main layout widget
  FlowPanel layout = new FlowPanel();
  initWidget(layout);

  // Setup the top panel with the title and links
  createTopPanel();
  layout.add(topPanel);

  // Add the main menu
  bottomPanel = new HorizontalPanel();
  bottomPanel.setWidth("100%");
  bottomPanel.setSpacing(0);
  bottomPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
  layout.add(bottomPanel);
  createMainMenu();
  bottomPanel.add(mainMenu);

  // Setup the content layout
  contentLayout = new Grid(2, 1);
  contentLayout.setCellPadding(0);
  contentLayout.setCellSpacing(0);
  contentDecorator = new DecoratorPanel();
  contentDecorator.setWidget(contentLayout);
  contentDecorator.addStyleName(DEFAULT_STYLE_NAME + "-content-decorator");
  bottomPanel.add(contentDecorator);
  if (LocaleInfo.getCurrentLocale().isRTL()) {
    bottomPanel.setCellHorizontalAlignment(contentDecorator,
        HasHorizontalAlignment.ALIGN_LEFT);
    contentDecorator.getElement().setAttribute("align", "LEFT");
  } else {
    bottomPanel.setCellHorizontalAlignment(contentDecorator,
        HasHorizontalAlignment.ALIGN_RIGHT);
    contentDecorator.getElement().setAttribute("align", "RIGHT");
  }
  CellFormatter formatter = contentLayout.getCellFormatter();
  formatter.setStyleName(0, 0, DEFAULT_STYLE_NAME + "-content-title");

  setContentTitle(new HTML("jCommerce Administation"));

  // Add the content wrapper
  contentWrapper = new SimplePanel();
  contentLayout.setWidget(1, 0, contentWrapper);
  formatter.setStyleName(1, 0, DEFAULT_STYLE_NAME + "-content-wrapper");
  setContent(null);
  
  rightButton.setVisible(false);
}
 
开发者ID:jbosschina,项目名称:jcommerce,代码行数:52,代码来源:Application.java


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