Package bg.smoc.model.web

Examples of bg.smoc.model.web.ResultsStyle


        loadTableData();
    }

    private void loadHeaderList() {
        ResultsRow headerRow = resultsTable.addHeader();
        ResultsStyle styleHeader = new ResultsStyle();
        styleHeader.setBold(true);

        headerRow.addCell("Rank", styleHeader);
        headerRow.addCell("Names", styleHeader);
        headerRow.addCell("Team", styleHeader);
        for (Contest contest : selectedContests) {
View Full Code Here


        request.setAttribute("autoreload", Boolean.parseBoolean(autoReload));
    }

    private void loadHeaderList(ResultsRow headerRow, Vector<Contest> selectedContests)
            throws RemoteException {
        ResultsStyle styleHeader = new ResultsStyle();
        styleHeader.setBold(true);

        headerRow.addCell("Rank", styleHeader);
        headerRow.addCell("Names", styleHeader);
        headerRow.addCell("Town", styleHeader);
        headerRow.addCell("School", styleHeader);
View Full Code Here

        HSSFRow row = sheet.createRow((short) 0);
        for (int i = 0; i < table.getHeader().getCells().size(); i++) {
            HSSFCell cell = row.createCell((short) i);

            ResultsStyle style = table.getHeader().getCells().get(i).getStyle();

            cell.setCellStyle(style.getStyleHSSF(wb));

            String title = table.getHeader().getCells().get(i).getValue();

            cell.setCellValue(new HSSFRichTextString(title));

            sheet.setColumnWidth((short) i,
                    (short) ((title.length() * MAGICWIDTH + MAGICPADDING) * style.getFontSize()));
        }

        for (int r = 0; r < table.getRows().size(); r++) {

            row = sheet.createRow((short) r + 1);

            for (int i = 0; i < table.getRows().get(r).getCells().size(); i++) {
                HSSFCell cell = row.createCell((short) i);

                ResultsStyle style = table.getRows().get(r).getCells().get(i).getStyle();

                cell.setCellStyle(style.getStyleHSSF(wb));

                String value = table.getRows().get(r).getCells().get(i).getValue();
                if (value != null) {
                    try {
                        cell.setCellValue(Double.parseDouble(value));
                    } catch (NumberFormatException e) {
                        cell.setCellValue(new HSSFRichTextString(value));
                    }

                    sheet.setColumnWidth((short) i, (short) Math.max(sheet
                            .getColumnWidth((short) i),
                            (short) ((value.length() * MAGICWIDTH + MAGICPADDING) * style
                                    .getFontSize())));
                    columnWidth[i] = Math.max(columnWidth[i], value.length());
                }
            }
        }
View Full Code Here

        HSSFRow row = sheet.createRow((short) 0);
        for (int i = 0; i < table.getHeader().getCells().size(); i++) {
            HSSFCell cell = row.createCell((short) i);

            ResultsStyle style = table.getHeader().getCells().get(i).getStyle();

            if (!cellStyleHash.containsKey(style))
                cellStyleHash.put(style, style.getStyleHSSF(wb));

            cell.setCellStyle(cellStyleHash.get(style));

            String title = table.getHeader().getCells().get(i).getValue();

            cell.setCellValue(new HSSFRichTextString(title));

            sheet.setColumnWidth((short) i,
                    (short) ((title.length() * MAGICWIDTH + MAGICPADDING) * style.getFontSize()));
        }

        for (int r = 0; r < table.getRows().size(); r++) {

            row = sheet.createRow((short) r + 1);

            for (int i = 0; i < table.getRows().get(r).getCells().size(); i++) {
                HSSFCell cell = row.createCell((short) i);

                ResultsStyle style = table.getRows().get(r).getCells().get(i).getStyle();

                if (!cellStyleHash.containsKey(style))
                    cellStyleHash.put(style, style.getStyleHSSF(wb));

                cell.setCellStyle(cellStyleHash.get(style));

                String value = table.getRows().get(r).getCells().get(i).getValue();
                if (value != null) {
                    try {
                        cell.setCellValue(Double.parseDouble(value));
                    } catch (NumberFormatException e) {
                        cell.setCellValue(new HSSFRichTextString(value));
                    }

                    sheet.setColumnWidth((short) i, (short) Math.max(sheet
                            .getColumnWidth((short) i),
                            (short) ((value.length() * MAGICWIDTH + MAGICPADDING) * style
                                    .getFontSize())));
                    columnWidth[i] = Math.max(columnWidth[i], value.length());
                }
            }
        }
View Full Code Here

TOP

Related Classes of bg.smoc.model.web.ResultsStyle

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.