Package com.volantis.mcs.protocols.trans

Examples of com.volantis.mcs.protocols.trans.TransCell


        ProtocolBuilder builder = new ProtocolBuilder();
        DOMProtocol protocol = (DOMProtocol) builder.build(
                new TestProtocolRegistry.TestDOMProtocolFactory(),
                internalDevice);

        TransCell cell = getFactory().getCell(null, null, 0, 0, protocol);

        assertEquals("unexpected class for cell instance",
                getCellClass().getName(),
                cell.getClass().getName());
    }
View Full Code Here


    }

    // Javadoc inherited.
    public TransCell getCell(Element row, Element cell, int startRow,
            int startCol, DOMProtocol protocol) {
        TransCell trans = new XHTMLBasicTransCell(row, cell, startRow,
                startCol, protocol);
        trans.setFactory(this);

        return trans;
    }
View Full Code Here

            // now that we have calculated the size of each column we can make a
            // second pass over the  TransTable to convert all percentages to
            // pixels
            for (int row = 0; row < table.getCellRows(); row++) {
                for (int col = 0; col < table.getCellCols(); col++) {
                  TransCell cell = table.getCell(row, col);
                  if (cell != null) {
                    Element element = cell.getElement();
                    processWidthAttribute(element, tableWidth);
                    // finally if the cell is represents a nested table then we
                    // need to process it
                    if (cell.getTable() != null) {
                      // calculation
                      transformPercentagesToPixels(cell.getTable(),
                          columnWidths[col]);
                    }
                  }
                }
            }
View Full Code Here

     */
    private int calculateCellWidth(TransTable table,
                                   int useableWidth,
                                   int row,
                                   int col) {
      TransCell cell = table.getCell(row, col);
      int width;
      if(cell == null){
        width = -1;
      } else {
        width = calculatePixelWidth(cell.getElement(), useableWidth);
        int colspan = cell.getColspan();
        if (width != -1 && colspan > 1) {
          width = width / colspan;
        }         
      }
      return width;
View Full Code Here

                    // "Promote" the nested tables, adding them to the end
                    // of the tables array so they can be processed in turn
                    // (they may be single column tables too)
                    for (row = 0; row < table.getRows(); row++) {
                        TransCell cell = table.getCell(row, 0);
                        TransTable nested = cell.getTable();

                        if ((nested != null) &&
                            (cell.getStartRow() == row)) {
                            nested.setParent(null);
                            tables.add(nested);
                            cell.setTable(null);
                        }
                    }

                    // Remove this table and release it. This will
                    // automatically move later tables down in index within
View Full Code Here

    // Javadoc inherited.
    public TransCell getCell(Element row, Element cell, int startRow,
            int startCol, DOMProtocol protocol) {
        // The TransCell class is abstract but is not missing any method
        // implementations. Use an anonymous derived class with no methods
        TransCell trans = new TransCell(row, cell, startRow, startCol,
                protocol) {
        };
        trans.setFactory(this);

        return trans;
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.trans.TransCell

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.