Exemplo n.º 1
0
 @Override
 public void onClick(View arg0) {
   // TODO Auto-generated method stub
   if (((Cell) arg0).getSelectVal()) ((Cell) arg0).setBackgroundColor(Color.RED);
   else ((Cell) arg0).setBackgroundColor(Color.YELLOW);
   ((Cell) arg0).setSelectVal();
 }
Exemplo n.º 2
0
 /**
  * Adds a <CODE>Cell</CODE> to the <CODE>Table</CODE>.
  *
  * <p>This is a shortcut for <CODE>addCell(Cell cell, Point location)</CODE>. The <CODE>Phrase
  * </CODE> will be converted to a <CODE>Cell</CODE>.
  *
  * @param content a <CODE>Phrase</CODE>
  * @param location a <CODE>Point</CODE>
  * @throws BadElementException this should never happen
  */
 public void addCell(Phrase content, Point location) throws BadElementException {
   Cell cell = new Cell(content);
   cell.setBorder(defaultCell.getBorder());
   cell.setBorderWidth(defaultCell.getBorderWidth());
   cell.setBorderColor(defaultCell.getBorderColor());
   cell.setBackgroundColor(defaultCell.getBackgroundColor());
   cell.setHorizontalAlignment(defaultCell.getHorizontalAlignment());
   cell.setVerticalAlignment(defaultCell.getVerticalAlignment());
   cell.setColspan(defaultCell.getColspan());
   cell.setRowspan(defaultCell.getRowspan());
   addCell(cell, location);
 }
Exemplo n.º 3
0
  /**
   * Sets the unset cell properties to be the table defaults.
   *
   * @param aCell The cell to set to table defaults as necessary.
   */
  private void assumeTableDefaults(Cell aCell) {

    if (aCell.getBorder() == Rectangle.UNDEFINED) {
      aCell.setBorder(defaultCell.getBorder());
    }
    if (aCell.getBorderWidth() == Rectangle.UNDEFINED) {
      aCell.setBorderWidth(defaultCell.getBorderWidth());
    }
    if (aCell.getBorderColor() == null) {
      aCell.setBorderColor(defaultCell.getBorderColor());
    }
    if (aCell.getBackgroundColor() == null) {
      aCell.setBackgroundColor(defaultCell.getBackgroundColor());
    }
    if (aCell.getHorizontalAlignment() == Element.ALIGN_UNDEFINED) {
      aCell.setHorizontalAlignment(defaultCell.getHorizontalAlignment());
    }
    if (aCell.getVerticalAlignment() == Element.ALIGN_UNDEFINED) {
      aCell.setVerticalAlignment(defaultCell.getVerticalAlignment());
    }
  }