Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.Grid


      }
    });

    updateUIFromAlbum();

    Grid g = new Grid(5, 2);

    int row = 0;
    g.setText(row, 0, "Name:");
    g.setWidget(row, 1, name);

    row++;
    g.setText(row, 0, "Artist:");
    g.setWidget(row, 1, artist);

    row++;
    g.setText(row, 0, "Format:");
    g.setWidget(row, 1, format);

    row++;
    g.setText(row, 0, "Release Date:");
    g.setWidget(row, 1, releaseDate);

    row++;
    g.setWidget(row, 1, saveButton);

    initWidget(g);
  }
View Full Code Here


      public void onClick(ClickEvent event) {
        addMonths(+12);
      }
    });
    // Set up grid.
    grid = new Grid(1, 5);
    grid.setWidget(0, previousYearColumn, backwardsYear);
    grid.setWidget(0, previousMonthColumn, backwards);
    grid.setWidget(0, nextMonthColumn, forwards);
    grid.setWidget(0, nextYearColumn, forwardsYear);
    CellFormatter formatter = grid.getCellFormatter();
View Full Code Here

    }

    @PostConstruct
    public void init() {

        final Grid layout = new Grid( 1,
                                      2 );
        layout.setCellSpacing( 5 );
        layout.setCellPadding( 5 );

        layout.setWidget( 0,
                          0,
                          workItemBrowser );
        layout.setWidget( 0,
                          1,
                          workItemWidget );

        layout.getColumnFormatter().setWidth( 0, "10%" );
        layout.getColumnFormatter().setWidth( 1, "90%" );
        layout.getCellFormatter().setAlignment( 0,
                                                0,
                                                HasHorizontalAlignment.ALIGN_LEFT,
                                                HasVerticalAlignment.ALIGN_TOP );
        layout.getCellFormatter().setAlignment( 0,
                                                1,
                                                HasHorizontalAlignment.ALIGN_LEFT,
                                                HasVerticalAlignment.ALIGN_TOP );
        layout.setWidth( "95%" );

        initWidget( layout );
    }
View Full Code Here

     * @param scenario = the scenario to add/remove from
     */
    public VerifyRulesFiredWidget(final FixtureList rfl,
                                  final Scenario scenario,
                                  boolean showResults) {
        outer = new Grid( 2,
                1 );
        this.showResults = showResults;
        outer.getCellFormatter().setStyleName( 0,
                0,
                "modeller-fact-TypeHeader" ); //NON-NLS
View Full Code Here

    public VerifyFactWidget(final VerifyFact vf,
                            final Scenario sc,
                            final PackageDataModelOracle dmo,
                            ExecutionTrace executionTrace,
                            boolean showResults) {
        outer = new Grid( 2,
                1 );
        outer.getCellFormatter().setStyleName( 0,
                0,
                "modeller-fact-TypeHeader" ); //NON-NLS
        outer.getCellFormatter().setAlignment( 0,
View Full Code Here

      }
    });

    updateUIFromArtist();

    Grid g = new Grid(3, 2);

    int row = 0;
    g.setText(row, 0, "Name:");
    g.setWidget(row, 1, name);

    row++;
    g.setText(row, 0, "Genres:");
    g.setWidget(row, 1, genres);

    row++;
    g.setWidget(row, 1, saveButton);

    initWidget(g);
  }
View Full Code Here

    public VerifyFactWidget( final VerifyFact vf,
                             final Scenario sc,
                             final AsyncPackageDataModelOracle oracle,
                             final ExecutionTrace executionTrace,
                             final boolean showResults ) {
        outer = new Grid( 2,
                          1 );
        outer.getCellFormatter().setStyleName( 0,
                                               0,
                                               "modeller-fact-TypeHeader" ); //NON-NLS
        outer.getCellFormatter().setAlignment( 0,
View Full Code Here

      + getY2Axis().getTickSpace()
      + getY2Axis().getTickLabelPadding()
      + getY2Axis().getAxisLabelThickness()/2);

    // legend
    Grid legend = null;
    if (isLegendVisible() && 0 < getNVisibleCurvesOnLegend())
      legend = createLegend(plotPanel);
    getSystemCurve(LEGEND_ID).getPoint(0).setAnnotationWidget(
       legend, getLegendThickness(), getYChartSize());
    getSystemCurve(LEGEND_ID).getPoint(0).setAnnotationXShift(
View Full Code Here

    
      }
    }    
    // create a Grid representing the chart legend.
    private Grid createLegend(PlotPanel pp) {
       Grid result = new Grid(getNVisibleCurvesOnLegend(), 2);
       int iVisible = 0;
/*
* Simply eliminating the border entirely is a valid transparency
* emulation for the legend (no positional shifting is needed as is
* needed for the images used to draw the main chart's curves) because
* the legend is always positioned by its center point, and the border
* extends around the entire legend key, so removing it does not result
* in any change to the legend key's center position.  <p>
*
* If multiple legend locations (beyond the current "always centered in
* a band along the right edge" option) were ever supported, appropriate
* positional shifts would then have to be introduced to emulate
* transparent borders.
*
*/
       GChart.setBorderWidth(result,
         TRANSPARENT_BORDER_COLOR == getLegendBorderColor() ? 0 :
                             Math.abs(getLegendBorderWidth()));
       GChart.setBorderColor(result,
          TRANSPARENT_BORDER_COLOR == getLegendBorderColor() ?
                             "transparent" :
                             getLegendBorderColor());
       GChart.setBorderStyle(result, getLegendBorderStyle());
       GChart.setBackgroundColor(result, getLegendBackgroundColor());
       int nCurves = getNCurves();
       for (int i = 0; i < nCurves; i++) {
          Curve c = getSystemCurve(i);
          if (c.isVisible() && c.getLegendLabel()!=null) {
             double symBorderFraction =
               c.getSymbol().getBorderWidth()/
                Math.max(
                  Math.max(1.0,c.getSymbol().getFillThickness()),
                  Math.max(c.getSymbol().getWidth(pp),
                           c.getSymbol().getHeight(pp, c.onY2())));
             Image icon =
               c.getSymbol().getSymbolType().createIconImage(
                c.getSymbol(), getLegendFontSize(),
                symBorderFraction);
                 
             result.setWidget(iVisible, 0, icon);
             result.getCellFormatter().setAlignment(iVisible, 0,
                HasHorizontalAlignment.ALIGN_CENTER,
                HasVerticalAlignment.ALIGN_MIDDLE);
            
             HTML label = new HTML(c.getLegendLabel());
             GChart.setFontWeight(label, getLegendFontWeight());
             GChart.setFontStyle(label, getLegendFontStyle());
             GChart.setColor(label, getLegendFontColor());
             GChart.setFontSize(label, getLegendFontSize());
                          
             result.setWidget(iVisible, 1, label);
             result.getCellFormatter().setAlignment(iVisible, 1,
                HasHorizontalAlignment.ALIGN_LEFT,
                HasVerticalAlignment.ALIGN_MIDDLE);

             iVisible++;
          }
View Full Code Here

  protected void onRender(Element target, int index) {
    setElement(DOM.createDiv(), target, index);
    super.onRender(target, index);

    rowCount = (int) Math.ceil(colors.length / ((double) columnCount));
    Grid grid = new Grid(rowCount, columnCount);
    grid.getElement().setAttribute("role", "presentation");
    grid.setCellPadding(0);
    grid.setCellSpacing(0);
    int mark = 0;

    for (int i = 0; i < rowCount; i++) {
      for (int j = 0; j < columnCount && mark < colors.length; j++) {
        String c = colors[mark];
        String name = colorNames.get(c);
        String lbl = name == null ? c : name;
        grid.setHTML(i, j, "<a aria-label=" + lbl + " id=" + XDOM.getUniqueId() + " role=gridcell row=" + i + " col="
            + j + " class=\"color-" + c + "\"><em role=presentation><span role=presentation style=\"background:#" + c
            + "\" unselectable=\"on\">&#160;</span></em></a>");
        mark++;
      }
    }
    getElement().appendChild(grid.getElement());

    if (GXT.isAriaEnabled()) {
      NodeList<Element> trs = el().select("tr");
      for (int i = 0; i < trs.getLength(); i++) {
        trs.getItem(i).setAttribute("role", "row");
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.Grid

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.