Package com.lowagie.text

Examples of com.lowagie.text.Cell


    public static Table newRuleTable(DrlRuleParser drl) throws BadElementException,
                                                     DocumentException {
        Table table = newTable();

        Cell headerCell = newHeaderCell( "Attributes",
                                         CATEGORIES_TEXT );
        table.addCell( headerCell );

        for ( String s : drl.getHeader() ) {
            table.addCell( newCell( INDENT + s.trim() ) );
View Full Code Here


    public static Table newTable(final String topic,
                                 Collection<String> items) throws BadElementException,
                                                          DocumentException {
        Table table = newTable();

        Cell headerCell = newHeaderCell( topic,
                                         CATEGORIES_TEXT );
        table.addCell( headerCell );

        if ( items.isEmpty() ) {
            table.addCell( newCell( " - " ) );
View Full Code Here

        return index;
    }

    private static Cell newHeaderCell(String text,
                                      Font font) throws BadElementException {
        Cell c = new Cell( new Phrase( text,
                                       font ) );
        c.setBackgroundColor( Color.decode( "#CCCCFF" ) );
        c.setLeading( 10 );
        c.setBorder( 1 );

        return c;
    }
View Full Code Here

        return c;
    }

    private static Cell newCell(String text) throws BadElementException {
        Cell c = new Cell( new Phrase( text,
                                       BODY_TEXT ) );
        c.setLeading( 10 );
        c.setBorder( 0 );
        c.setBorderWidthBottom( 1 );

        return c;
    }
View Full Code Here

        Table peopleTable = null;

        if (PRE_validationSetPercentage > 0){peopleTable = new Table(PRE_instances_hold_byClass.length+1,3);} else
        {peopleTable = new Table(PRE_instances_hold_byClass.length+1,2);}
        peopleTable.addCell(new Cell("Subjects/Classifications"), 0, 0);
        peopleTable.addCell(new Cell("Dataset"), 0, 1);
        if (PRE_validationSetPercentage > 0){peopleTable.addCell(new Cell("Validation Dataset"), 0, 2);}


        for (int xx_counter = 0; xx_counter<PRE_instances_hold_byClass.length; xx_counter++){
        peopleTable.addCell(new Cell(PRE_instances_class_names[xx_counter]), xx_counter+1, 0);
        peopleTable.addCell(new Cell(String.valueOf(PRE_instances_learn_byClass[xx_counter])), xx_counter+1, 1);
        if (PRE_validationSetPercentage > 0){peopleTable.addCell(new Cell(String.valueOf(PRE_instances_hold_byClass[xx_counter])), xx_counter+1, 2);}
        }

                            long learn_total_inst =0; long hold_total_inst =0;
                            for (int i = 0; i < PRE_instances_learn_byClass.length; i++) {
                                learn_total_inst += PRE_instances_learn_byClass[i];
                                hold_total_inst += PRE_instances_hold_byClass[i];
                            }

        //Totals row
        peopleTable.addCell(new Cell("Total"), PRE_instances_hold_byClass.length+1,0);
        peopleTable.addCell(new Cell(String.valueOf(learn_total_inst)), PRE_instances_hold_byClass.length+1 ,1);
        if (PRE_validationSetPercentage > 0){peopleTable.addCell(new Cell(String.valueOf(hold_total_inst)), PRE_instances_hold_byClass.length+1 ,2);}

        int[] ee = {220,180,180};
        peopleTable.setWidths(ee);

View Full Code Here

            p2.setAlignment(Paragraph.ALIGN_JUSTIFIED_ALL);
            p2.add(new Chunk(String.format("Figure %d shows the performance of the classifier when compared to common alternatives:",current_figureNumber++),dFont));
            doc.add(p2);
           
            Table compsTable = new Table(5);
            compsTable.addCell(new Cell("Classifier"), 0, 0);
            compsTable.addCell(new Cell("In-Sample Accuracy"), 0, 1);
            compsTable.addCell(new Cell("In-Sample ROC"), 0, 2);
            compsTable.addCell(new Cell("Validation Set Accuracy"), 0, 3);
            compsTable.addCell(new Cell("Validation Set ROC"), 0, 4);
           
            compsTable.addCell(new Cell("Bayesian Network"), 1, 0);
            compsTable.addCell(new Cell(String.valueOf(toDecimal2(res_pctCorrect_inSample))), 1, 1);
            compsTable.addCell(new Cell(String.valueOf(toDecimal2(100*res_ROC_inSample))), 1, 2);
            compsTable.addCell(new Cell(String.valueOf(toDecimal2(res_pctCorrect_valid))), 1, 3);
            compsTable.addCell(new Cell(String.valueOf(toDecimal2(100*res_ROC_valid))), 1, 4);
           
           
            for (int i = 0; i < comp_names.length; i++){
            compsTable.addCell(new Cell(comp_names[i]), i+2, 0);
            compsTable.addCell(new Cell(String.valueOf(toDecimal2(comp_insample_ACC[i]))), i+2, 1);
            compsTable.addCell(new Cell(String.valueOf(toDecimal2(100*comp_insample_ROC[i]))), i+2, 2);
            compsTable.addCell(new Cell(String.valueOf(toDecimal2(comp_validation_ACC[i]))), i+2, 3);
            compsTable.addCell(new Cell(String.valueOf(toDecimal2(100*comp_validation_ROC[i]))), i+2, 4);
            }
           
            Font ital = new Font();
            ital.setStyle(Font.ITALIC);
            doc.add(new Paragraph("Figure ".concat(String.valueOf(current_figureNumber-1)), ital));
View Full Code Here

           
            doc.add(p2);

            Table davidTable = new Table(4);

            davidTable.addCell(new Cell("Enrichment Term"), 0, 0);
            davidTable.addCell(new Cell("P-Value"), 0, 1);
            davidTable.addCell(new Cell("Count"), 0, 2);
            davidTable.addCell(new Cell("Percentage"), 0, 3);

           
           
            for (int i = 0; i < Math.min(10,enrArray.length); i++) {
                davidTable.addCell(new Cell(uppercaseLetter(enrArray[i].termName)), i, 0);
                Phrase pval = new Phrase("");
                pval.add(p_valuer_A(String.format("%.2e",enrArray[i].p_value)));
                pval.add(p_valuer_B(String.format("%.2e",enrArray[i].p_value)));
                davidTable.addCell(new Cell(pval), i, 1);
                davidTable.addCell(new Cell(enrArray[i].count), i, 2);
                davidTable.addCell(new Cell(toDecimal2(enrArray[i].percentage)), i, 3);
            }

            Font ital = new Font();
            ital.setStyle(Font.ITALIC);
            doc.add(new Paragraph("Figure ".concat(String.valueOf(current_figureNumber-1)), ital));
View Full Code Here

           
            Font bo = new Font();
            bo.setStyle(Font.BOLD);
           
            Table pvalTable = new Table(6);
            pvalTable.addCell(new Cell(new Chunk("Name",bo)), 0, 0);
            pvalTable.addCell(new Cell(new Chunk("Entrez",bo)), 0, 1);
            pvalTable.addCell(new Cell(new Chunk("Gene Symbol",bo)), 0, 2);
            pvalTable.addCell(new Cell(new Chunk("P-Value",bo)), 0, 3);
            pvalTable.addCell(new Cell(new Chunk("Fold Change",bo)), 0, 4);
            pvalTable.addCell(new Cell(new Chunk("In Network?",bo)), 0, 5);
           
            for (int i = TTEST_univariate_names.length-1; i > 0; i--) {
                pvalTable.addCell(new Cell(TTEST_univariate_names[i]), i, 0);
                pvalTable.addCell(new Cell(util_lookupFileConvert.tradeProbeIDforEntrez(lookupFileName,TTEST_univariate_names[i])), i, 1);
                pvalTable.addCell(new Cell(util_lookupFileConvert.tradeProbeIDforSymbol(lookupFileName,TTEST_univariate_names[i])), i, 2);
                Phrase pval = new Phrase("");
                pval.add(p_valuer_A(String.format("%.2e",TTEST_univariate_p_value_raw[i])));
                pval.add(p_valuer_B(String.format("%.2e",TTEST_univariate_p_value_raw[i])));
                pvalTable.addCell(new Cell(pval), i, 3);   
                if (TTEST_univariate_fold_change_raw[i]>= 1){
                    pvalTable.addCell(new Cell(String.format("%.2f",TTEST_univariate_fold_change_raw[i])), i, 4);
                } else {
                    pvalTable.addCell(new Cell(String.format("%.2f",-1.00/TTEST_univariate_fold_change_raw[i])), i, 4);
                }
                if (TTEST_univariate_p_value_raw[i]< TTEST_p_value_threshold){
                    pvalTable.addCell(new Cell("In network"), i, 5);
                } else {
                    pvalTable.addCell(new Cell("No"), i, 5);
                }
            }
           
            pvalTable.setCellsFitPage(attSel);
           
View Full Code Here

            String columnHeader = headerCell.getTitle();
            if (columnHeader == null) {
                columnHeader = StringUtils.capitalize(headerCell.getBeanPropertyName());
            }

            Cell hdrCell = getCell(columnHeader);
            hdrCell.setBackgroundColor(new Color(210, 221, 231));
            hdrCell.setHeader(true);
            tablePDF.addCell(hdrCell);

        }
    }
View Full Code Here

        // get the correct iterator (full or partial list according to the exportFull field)
        RowIterator rowIterator = this.model.getRowIterator(this.exportFull);
        int rowCnt = 0;
        Column column = null;
        Object value = null;
        Cell cell = null;
        while (rowIterator.hasNext()) {
            Row row = rowIterator.next();

            // iterator on columns
            ColumnIterator columnIterator = row.getColumnIterator(this.model.getHeaderCellList());

            while (columnIterator.hasNext()) {
                column = columnIterator.nextColumn();

                // Get the value to be displayed for the column
                value = column.getValue(this.decorated);
                cell = getCell(ObjectUtils.toString(value));

                /* some eyecandy stuff */
                if (rowCnt % 2 == 1) {
                    cell.setBackgroundColor(new Color(220, 223, 225));
                }
                tablePDF.addCell(cell);
            }

            /* split up the pdf document to prevent OutOfMemoryExceptions */
 
View Full Code Here

TOP

Related Classes of com.lowagie.text.Cell

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.