Examples of Cell


Examples of org.librebiz.pureport.definition.Cell

    private void endColumn() {
       
    }

    private void startCell(Attributes attrs) {
        cell = new Cell();
        setBoxAttributes(cell, attrs);
        cell.setRow(row);
        cell.setColumn(column);
        cell.setRowSpan(toInt(attrs.getValue("row-span"), 1));
        cell.setColumnSpan(toInt(attrs.getValue("column-span"), 1));
View Full Code Here

Examples of org.miv.pherd.ntree.Cell

     
      if( totpop > 0 )
      {
        for( int i=0; i<subcnt; ++i )
        {
          Cell          subcell = cell.getSub( i );
          GraphCellData data    = (GraphCellData) subcell.getData();
          double        pop     = subcell.getPopulation();
   
          verif += pop;
         
          x += data.center.x * pop;
          y += data.center.y * pop;
 
View Full Code Here

Examples of org.odftoolkit.simple.table.Cell

    }

    private static String parseTableRow(Row row) {
        String line = "|";
        for (int i = 0; i < row.getCellCount(); i++) {
            Cell cell = row.getCellByIndex(i);
            line += cell.getDisplayText() + "|";
        }
        return line;
    }
View Full Code Here

Examples of org.olap4j.Cell

      result[i++] = columnName;
    }

    // add col axis
    for (Position colPos : cols) {
      Cell cell = cellSet.getCell(colPos, nextRow);
      result[i++] = cell.getValue();
   
    ArrayList<Object[]> results = new ArrayList<Object[]>();
    results.add(result);
    return results;
   
View Full Code Here

Examples of org.openfaces.component.table.Cell

        return getExplicitlyAssociatedDataTable().getRowGrouping().getGroupFooterRowClass();
    }

    @Override
    protected Cell createDefaultCell(DataTable dataTable) {
        Cell defaultCell = super.createDefaultCell(dataTable);
        defaultCell.getAttributes().put(SYNTHETIC_GROUP_HEADER_CELL_MARKER, true);
        return defaultCell;
    }
View Full Code Here

Examples of org.openpixi.pixi.physics.grid.Cell

    for (int x = -Grid.INTERPOLATION_RADIUS;
         x < expectedGrid.getNumCellsX() + Grid.INTERPOLATION_RADIUS; ++x) {
      for (int y = -Grid.INTERPOLATION_RADIUS;
           y < expectedGrid.getNumCellsY() + Grid.INTERPOLATION_RADIUS; ++y) {

        Cell expectedCell = expectedGrid.getCell(x,y);
        Cell actualCell = actualGrid.getCell(x,y);
        if (!compareCells(expectedCell, actualCell, tolerance)) {
          ++differences;
          System.out.println(" -> differences in cell: " + x + "," + y);
        }
      }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.process.CleanTableRowsPreparationStep.Cell

  }

  public void testNonSpan()
  {
    GenericObjectTable<Cell> cells = new GenericObjectTable<Cell>();
    cells.setObject(0, 0, new Cell(0, 0, 1, 0));
    cells.setObject(1, 0, new Cell(1, 0, 1, 10));
    cells.setObject(2, 0, new Cell(2, 0, 1, 20));
    cells.setObject(3, 0, new Cell(3, 0, 1, 30));

    int pageOffset = 0;
    assertEquals(0, CleanTableRowsPreparationStep.computeSafeCut(pageOffset, cells, 4));
  }
View Full Code Here

Examples of org.primefaces.model.Cell

    UIComponent columnChild = column.getChildren().get(0);
    if(columnChild instanceof ValueHolder) {
      cellValue = ((ValueHolder) columnChild).getValue();
    }
   
    return new Cell(rowData, columnId, cellValue);
  }
View Full Code Here

Examples of org.saiku.web.rest.objects.resultset.Cell

      while (rs.next() && (limit == 0 || height < limit)) {
        if (height == 0) {
          width = rs.getMetaData().getColumnCount();
          header = new Cell[width];
          for (int s = 0; s < width; s++) {
            header[s] = new Cell(rs.getMetaData().getColumnName(s + 1), Cell.Type.COLUMN_HEADER);
          }
          if (width > 0) {
            rows.add(header);
            // System.out.println(" |");
          }
        }
        Cell[] row = new Cell[width];
        for (int i = 0; i < width; i++) {
          int colType = rs.getMetaData().getColumnType(i + 1);
          String content = rsch.getValue(rs, colType, i + 1);
          if (content == null) {
            content = "";
          }
          row[i] = new Cell(content, Cell.Type.DATA_CELL);
        }
        rows.add(row);
        height++;
      }
    } catch (SQLException e) {
View Full Code Here

Examples of org.stathissideris.ascii2image.text.TextGrid.Cell

           
            TextGrid copyGrid = new AbstractionGrid(workGrid, set).getCopyOfInternalBuffer();

            CellSet boundaries =
              copyGrid
              .findBoundariesExpandingFrom(copyGrid.new Cell(xi, yi));
            if(boundaries.size() == 0) continue; //i'm not sure why these occur
            boundarySetsStep2.add(boundaries.makeScaledOneThirdEquivalent());
         
            copyGrid = new AbstractionGrid(workGrid, set).getCopyOfInternalBuffer();
            CellSet filled =
              copyGrid
              .fillContinuousArea(copyGrid.new Cell(xi, yi), '*');
            fillBuffer.fillCellsWith(filled, '*');
            fillBuffer.fillCellsWith(boundaries, '-');
           
            if(DEBUG){
              //System.out.println("Fill buffer:");
              //fillBuffer.printDebug();
              boundaries.makeScaledOneThirdEquivalent().printAsGrid();
              System.out.println("-----------------------------------");
            }
           
          }
        }
      }
    }

    if (DEBUG)
      System.out.println("******* Removed duplicates *******");

    boundarySetsStep2 = CellSet.removeDuplicateSets(boundarySetsStep2);

    if(DEBUG){
      Iterator<CellSet> dit = boundarySetsStep2.iterator();
      while (dit.hasNext()) {
        CellSet set = dit.next();
        set.printAsGrid();
      }
    }

    int originalSize = boundarySetsStep2.size();
    boundarySetsStep2 = CellSet.removeDuplicateSets(boundarySetsStep2);
    if(DEBUG) {
      System.out.println(
        "******* Removed duplicates: there were "
        +originalSize
        +" shapes and now there are "
        +boundarySetsStep2.size());
    }
   

    //split boundaries to open, closed and mixed
   
    if (DEBUG)
      System.out.println("******* First evaluation of openess *******");
   
    ArrayList<CellSet> open = new ArrayList<CellSet>();
    ArrayList<CellSet> closed = new ArrayList<CellSet>();
    ArrayList<CellSet> mixed = new ArrayList<CellSet>();
   
    Iterator<CellSet> sets = boundarySetsStep2.iterator();
    while(sets.hasNext()){
      CellSet set = (CellSet) sets.next();
      int type = set.getType(workGrid);
      if(type == CellSet.TYPE_CLOSED) closed.add(set);
      else if(type == CellSet.TYPE_OPEN) open.add(set);
      else if(type == CellSet.TYPE_MIXED) mixed.add(set);
      if(DEBUG){
        if(type == CellSet.TYPE_CLOSED) System.out.println("Closed boundaries:");
        else if(type == CellSet.TYPE_OPEN) System.out.println("Open boundaries:");
        else if(type == CellSet.TYPE_MIXED) System.out.println("Mixed boundaries:");
        set.printAsGrid();
      }
    }
   
    boolean hadToEliminateMixed = false;
   
    if(mixed.size() > 0 && closed.size() > 0) {
              // mixed shapes can be eliminated by
              // subtracting all the closed shapes from them
      if (DEBUG)
        System.out.println("******* Eliminating mixed shapes (basic algorithm) *******");
   
      hadToEliminateMixed = true;
     
      //subtract from each of the mixed sets all the closed sets
      sets = mixed.iterator();
      while(sets.hasNext()){
        CellSet set = (CellSet) sets.next();
        Iterator<CellSet> closedSets = closed.iterator();
        while(closedSets.hasNext()){
          CellSet closedSet = closedSets.next();
          set.subtractSet(closedSet);
        }
        // this is necessary because some mixed sets produce
        // several distinct open sets after you subtract the
        // closed sets from them
        if(set.getType(workGrid) == CellSet.TYPE_OPEN) {
          boundarySetsStep2.remove(set);
          boundarySetsStep2.addAll(set.breakIntoDistinctBoundaries(workGrid));
        }
      }

    } else if(mixed.size() > 0 && closed.size() == 0) {
              // no closed shape exists, will have to
              // handle mixed shape on its own
      // an example of this case is the following:
      // +-----+
      // |  A  |C                 B
      // +  ---+-------------------
      // |     |
      // +-----+

      hadToEliminateMixed = true;

      if (DEBUG)
        System.out.println("******* Eliminating mixed shapes (advanced algorithm for truly mixed shapes) *******");
       
      sets = mixed.iterator();
      while(sets.hasNext()){
        CellSet set = (CellSet) sets.next();
        boundarySetsStep2.remove(set);
        boundarySetsStep2.addAll(set.breakTrulyMixedBoundaries(workGrid));
      }

    } else {
      if (DEBUG)
        System.out.println("No mixed shapes found. Skipped mixed shape elimination step");
    }
   
   
    if(hadToEliminateMixed){
      if (DEBUG)
        System.out.println("******* Second evaluation of openess *******");
   
      //split boundaries again to open, closed and mixed
      open = new ArrayList<CellSet>();
      closed = new ArrayList<CellSet>();
      mixed = new ArrayList<CellSet>();
   
      sets = boundarySetsStep2.iterator();
      while(sets.hasNext()){
        CellSet set = (CellSet) sets.next();
        int type = set.getType(workGrid);
        if(type == CellSet.TYPE_CLOSED) closed.add(set);
        else if(type == CellSet.TYPE_OPEN) open.add(set);
        else if(type == CellSet.TYPE_MIXED) mixed.add(set);
        if(DEBUG){
          if(type == CellSet.TYPE_CLOSED) System.out.println("Closed boundaries:");
          else if(type == CellSet.TYPE_OPEN) System.out.println("Open boundaries:");
          else if(type == CellSet.TYPE_MIXED) System.out.println("Mixed boundaries:");
          set.printAsGrid();
        }
      }
    }

    boolean removedAnyObsolete = removeObsoleteShapes(workGrid, closed);
   
    boolean allCornersRound = false;
    if(options.processingOptions.areAllCornersRound()) allCornersRound = true;
   
    //make shapes from the boundary sets
    //make closed shapes
    if(DEBUG_MAKE_SHAPES) {
      System.out.println("***** MAKING SHAPES FROM BOUNDARY SETS *****");
      System.out.println("***** CLOSED: *****");
    }
   
    ArrayList<DiagramComponent> closedShapes = new ArrayList<DiagramComponent>();
    sets = closed.iterator();
    while(sets.hasNext()){
      CellSet set = (CellSet) sets.next();
     
      if(DEBUG_MAKE_SHAPES) {
        set.printAsGrid();
      }
     
      DiagramComponent shape = DiagramComponent.createClosedFromBoundaryCells(workGrid, set, cellWidth, cellHeight, allCornersRound);
      if(shape != null){
        if(shape instanceof DiagramShape){
          addToShapes((DiagramShape) shape);
          closedShapes.add(shape);
        } else if(shape instanceof CompositeDiagramShape)
          addToCompositeShapes((CompositeDiagramShape) shape);
      }
    }

    if(options.processingOptions.performSeparationOfCommonEdges())
      separateCommonEdges(closedShapes);

    //make open shapes
    sets = open.iterator();
    while(sets.hasNext()){
      CellSet set = (CellSet) sets.next();
      if(set.size() == 1){ //single cell "shape"
        TextGrid.Cell cell = (TextGrid.Cell) set.getFirst();
        if(!grid.cellContainsDashedLineChar(cell)) {
          DiagramShape shape = DiagramShape.createSmallLine(workGrid, cell, cellWidth, cellHeight);
          if(shape != null) {
            addToShapes(shape);
            shape.connectEndsToAnchors(workGrid, this);
          }
        }
      } else { //normal shape
                if (DEBUG)
                    System.out.println(set.getCellsAsString());       
       
        DiagramComponent shape =
          CompositeDiagramShape
            .createOpenFromBoundaryCells(
                workGrid, set, cellWidth, cellHeight, allCornersRound);

        if(shape != null){
          if(shape instanceof CompositeDiagramShape){
            addToCompositeShapes((CompositeDiagramShape) shape);
            ((CompositeDiagramShape) shape).connectEndsToAnchors(workGrid, this);
          } else if(shape instanceof DiagramShape) {
            addToShapes((DiagramShape) shape);
            ((DiagramShape) shape).connectEndsToAnchors(workGrid, this);
            ((DiagramShape) shape).moveEndsToCellEdges(grid, this);
          }
        }
         
      }
    }

    //assign color codes to shapes
    //TODO: text on line should not change its color
   
    Iterator<CellColorPair> cellColorPairs = grid.findColorCodes().iterator();
    while(cellColorPairs.hasNext()){
      TextGrid.CellColorPair pair =
        (TextGrid.CellColorPair) cellColorPairs.next();
     
      ShapePoint point =
        new ShapePoint(getCellMidX(pair.cell), getCellMidY(pair.cell));
      DiagramShape containingShape = findSmallestShapeContaining(point);
     
      if(containingShape != null)
        containingShape.setFillColor(pair.color);
    }

    //assign markup to shapes
    Iterator<CellTagPair> cellTagPairs = grid.findMarkupTags().iterator();
    while(cellTagPairs.hasNext()){
      TextGrid.CellTagPair pair =
        (TextGrid.CellTagPair) cellTagPairs.next();
     
      ShapePoint point =
        new ShapePoint(getCellMidX(pair.cell), getCellMidY(pair.cell));
     
      DiagramShape containingShape = findSmallestShapeContaining(point);
     
      //this tag is not within a shape, skip
      if(containingShape == null) continue;
     
      //TODO: the code below could be a lot more concise
      if(pair.tag.equals("d")){
        CustomShapeDefinition def =
          options.processingOptions.getFromCustomShapes("d");
        if(def == null)
          containingShape.setType(DiagramShape.TYPE_DOCUMENT);
        else {
          containingShape.setType(DiagramShape.TYPE_CUSTOM);
          containingShape.setDefinition(def);
        }
      } else if(pair.tag.equals("s")){
        CustomShapeDefinition def =
          options.processingOptions.getFromCustomShapes("s");
        if(def == null)
          containingShape.setType(DiagramShape.TYPE_STORAGE);
        else {
          containingShape.setType(DiagramShape.TYPE_CUSTOM);
          containingShape.setDefinition(def);
        }
      } else if(pair.tag.equals("io")){
        CustomShapeDefinition def =
          options.processingOptions.getFromCustomShapes("io");
        if(def == null)
          containingShape.setType(DiagramShape.TYPE_IO);
        else {
          containingShape.setType(DiagramShape.TYPE_CUSTOM);
          containingShape.setDefinition(def);
        }
      } else if(pair.tag.equals("c")){
        CustomShapeDefinition def =
          options.processingOptions.getFromCustomShapes("c");
        if(def == null)
          containingShape.setType(DiagramShape.TYPE_DECISION);
        else {
          containingShape.setType(DiagramShape.TYPE_CUSTOM);
          containingShape.setDefinition(def);
        }
      } else if(pair.tag.equals("mo")){
        CustomShapeDefinition def =
          options.processingOptions.getFromCustomShapes("mo");
        if(def == null)
          containingShape.setType(DiagramShape.TYPE_MANUAL_OPERATION);
        else {
          containingShape.setType(DiagramShape.TYPE_CUSTOM);
          containingShape.setDefinition(def);
        }
      } else if(pair.tag.equals("tr")){
        CustomShapeDefinition def =
          options.processingOptions.getFromCustomShapes("tr");
        if(def == null)
          containingShape.setType(DiagramShape.TYPE_TRAPEZOID);
        else {
          containingShape.setType(DiagramShape.TYPE_CUSTOM);
          containingShape.setDefinition(def);
        }
      } else if(pair.tag.equals("o")){
        CustomShapeDefinition def =
          options.processingOptions.getFromCustomShapes("o");
        if(def == null)
          containingShape.setType(DiagramShape.TYPE_ELLIPSE);
        else {
          containingShape.setType(DiagramShape.TYPE_CUSTOM);
          containingShape.setDefinition(def);
        }
      } else {
        CustomShapeDefinition def =
          options.processingOptions.getFromCustomShapes(pair.tag);
        containingShape.setType(DiagramShape.TYPE_CUSTOM);
        containingShape.setDefinition(def);           
      }
    }
   
    //make arrowheads
    Iterator<Cell> arrowheadCells = workGrid.findArrowheads().iterator();
    while(arrowheadCells.hasNext()){
      TextGrid.Cell cell = arrowheadCells.next();
      DiagramShape arrowhead = DiagramShape.createArrowhead(workGrid, cell, cellWidth, cellHeight);
      if(arrowhead != null) addToShapes(arrowhead);
      else System.err.println("Could not create arrowhead shape. Unexpected error.");
    }
   
    //make point markers
    Iterator<TextGrid.Cell> markersIt = grid.getPointMarkersOnLine().iterator();
    while (markersIt.hasNext()) {
      TextGrid.Cell cell = markersIt.next();

      DiagramShape mark = new DiagramShape();
      mark.addToPoints(new ShapePoint(
          getCellMidX(cell),
          getCellMidY(cell)
        ));
      mark.setType(DiagramShape.TYPE_POINT_MARKER);
      mark.setFillColor(Color.white);
      shapes.add(mark);
    }

    removeDuplicateShapes();
   
    if(DEBUG) System.out.println("Shape count: "+shapes.size());
    if(DEBUG) System.out.println("Composite shape count: "+compositeShapes.size());
   
    //copy again
    workGrid = new TextGrid(grid);
    workGrid.removeNonText();
   
   
    // ****** handle text *******
    //break up text into groups
    TextGrid textGroupGrid = new TextGrid(workGrid);
    CellSet gaps = textGroupGrid.getAllBlanksBetweenCharacters();
    //kludge
    textGroupGrid.fillCellsWith(gaps, '|');
    CellSet nonBlank = textGroupGrid.getAllNonBlank();
    ArrayList<CellSet> textGroups = nonBlank.breakIntoDistinctBoundaries();
    if(DEBUG) System.out.println(textGroups.size()+" text groups found");
   
    Font font = FontMeasurer.instance().getFontFor(cellHeight);
   
    Iterator<CellSet> textGroupIt = textGroups.iterator();
    while(textGroupIt.hasNext()){
      CellSet textGroupCellSet = (CellSet) textGroupIt.next();
     
      TextGrid isolationGrid = new TextGrid(width, height);
      workGrid.copyCellsTo(textGroupCellSet, isolationGrid);
      
      ArrayList<CellStringPair> strings = isolationGrid.findStrings();
      Iterator<CellStringPair> it = strings.iterator();
      while(it.hasNext()){
        TextGrid.CellStringPair pair = it.next();
        TextGrid.Cell cell = pair.cell;
        String string = pair.string;
        if (DEBUG)
          System.out.println("Found string "+string);
        TextGrid.Cell lastCell = isolationGrid.new Cell(cell.x + string.length() - 1, cell.y);
     
        int minX = getCellMinX(cell);
        int y = getCellMaxY(cell);
        int maxX = getCellMaxX(lastCell);
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.