亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? itexttablewriter.java

?? dispalytag的源碼
?? JAVA
字號:
/** * Licensed under the Artistic License; you may not use this file * except in compliance with the License. * You may obtain a copy of the License at * *      http://displaytag.sourceforge.net/license.html * * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */package org.displaytag.render;import java.awt.Color;import java.util.Iterator;import org.apache.commons.lang.ObjectUtils;import org.apache.commons.lang.StringUtils;import org.displaytag.decorator.TableDecorator;import org.displaytag.exception.DecoratorException;import org.displaytag.exception.ObjectLookupException;import org.displaytag.model.Column;import org.displaytag.model.HeaderCell;import org.displaytag.model.TableModel;import com.lowagie.text.BadElementException;import com.lowagie.text.Cell;import com.lowagie.text.Chunk;import com.lowagie.text.Document;import com.lowagie.text.DocumentException;import com.lowagie.text.Element;import com.lowagie.text.Font;import com.lowagie.text.FontFactory;import com.lowagie.text.Paragraph;import com.lowagie.text.Rectangle;import com.lowagie.text.Table;/** * A table writer that formats table as and writes it to an iText document. * @author Jorge L. Barroso * @version $Id$ * @see org.displaytag.render.TableWriterTemplate */public class ItextTableWriter extends TableWriterAdapter{    /**     * iText representation of the table.     */    private Table table;    /**     * iText document to which the table is written.     */    private Document document;    /**     * The default font used in the document.     */    private Font defaultFont;    /**     * This table writer uses an iText table and document to do its work.     * @param table iText representation of the table.     * @param document iText document to which the table is written.     */    public ItextTableWriter(Table table, Document document)    {        this.table = table;        this.document = document;    }    /**     * Initialize the main info holder table, like the appropriate number of columns.     * @param model The table being represented as iText.     * @see org.displaytag.render.TableWriterTemplate#writeTableOpener(org.displaytag.model.TableModel)     */    protected void writeTableOpener(TableModel model)    {        this.table.setDefaultVerticalAlignment(Element.ALIGN_TOP);        this.table.setCellsFitPage(true);        this.table.setWidth(100);        this.table.setPadding(2);        this.table.setSpacing(0);        this.table.setBorder(Rectangle.NO_BORDER);        this.defaultFont = this.getTableFont();    }    /**     * Obtain the font used to render text in the table; Meant to be overriden if a different font is desired.     * @return The font used to render text in the table.     */    protected Font getTableFont()    {        return FontFactory.getFont(FontFactory.HELVETICA, 10, Font.NORMAL, new Color(0x00, 0x00, 0x00));    }    /**     * Write the table's caption to a iText document.     * @see org.displaytag.render.TableWriterTemplate#writeCaption(org.displaytag.model.TableModel)     */    protected void writeCaption(TableModel model) throws Exception    {        this.decorateCaption(model);    }    /**     * Writes the table caption according to a set style.     * @param model The table model containing the caption.     * @throws DocumentException If an error occurrs while decorating the caption.     */    private void decorateCaption(TableModel model) throws DocumentException    {        Paragraph caption = new Paragraph(new Chunk(model.getCaption(), this.getCaptionFont()));        caption.setAlignment(this.getCaptionHorizontalAlignment());        this.document.add(caption);    }    /**     * Obtain the caption font; Meant to be overriden if a different style is desired.     * @return The caption font.     */    protected Font getCaptionFont()    {        return FontFactory.getFont(FontFactory.HELVETICA, 17, Font.BOLD, new Color(0x00, 0x00, 0x00));    }    /**     * Obtain the caption horizontal alignment; Meant to be overriden if a different style is desired.     * @return The caption horizontal alignment.     */    protected int getCaptionHorizontalAlignment()    {        return Element.ALIGN_CENTER;    }    /**     * Write the table's header columns to an iText document.     * @see org.displaytag.render.TableWriterTemplate#writeTableHeader(org.displaytag.model.TableModel)     * @throws BadElementException if an error occurs while writing header.     */    protected void writeTableHeader(TableModel model) throws BadElementException    {        Iterator iterator = model.getHeaderCellList().iterator();        float[] widths = new float[model.getNumberOfColumns()];        for (int i = 0; iterator.hasNext(); i++)        {            HeaderCell headerCell = (HeaderCell) iterator.next();            widths[i] = this.getCellWidth(headerCell);            String columnHeader = headerCell.getTitle();            if (columnHeader == null)            {                columnHeader = StringUtils.capitalize(headerCell.getBeanPropertyName());            }            Cell hdrCell = this.getHeaderCell(columnHeader);            this.table.addCell(hdrCell);        }        this.table.setWidths(widths);        this.table.endHeaders();    }    /**     * Returns the maximum size of all values in this column.     * @param headerCell Header cell for this column.     * @return The maximum size of all values in this column.     */    private float getCellWidth(HeaderCell headerCell)    {        int maxWidth = headerCell.getMaxLength();        return (maxWidth > 0) ? maxWidth : headerCell.getTitle().length();    }    /**     * @see org.displaytag.render.TableWriterTemplate#writePostBodyFooter(org.displaytag.model.TableModel)     * @throws DocumentException if an error occurs while writing post-body footer.     */    protected void writePostBodyFooter(TableModel model) throws DocumentException    {        Chunk cellContent = new Chunk(model.getFooter(), this.getFooterFont());        this.setFooterFontStyle(cellContent);        Cell cell = new Cell(cellContent);        cell.setLeading(8);        cell.setBackgroundColor(this.getFooterBackgroundColor());        cell.setHorizontalAlignment(this.getFooterHorizontalAlignment());        cell.setColspan(model.getNumberOfColumns());        table.addCell(cell);    }    /**     * Obtain the footer background color; Meant to be overriden if a different style is desired.     * @return The footer background color.     */    protected Color getFooterBackgroundColor()    {        return new Color(0xce, 0xcf, 0xce);    }    /**     * Obtain the footer horizontal alignment; Meant to be overriden if a different style is desired.     * @return The footer horizontal alignment.     */    protected int getFooterHorizontalAlignment()    {        return Element.ALIGN_LEFT;    }    /**     * Set the font style used to render the header text; Meant to be overridden if a different header style is desired.     * @param cellContent The header content whose font will be modified.     */    protected void setFooterFontStyle(Chunk cellContent)    {        this.setBoldStyle(cellContent, this.getFooterFontColor());    }    /**     * Obtain the footer font color; Meant to be overriden if a different style is desired.     * @return The footer font color.     */    protected Color getFooterFontColor()    {        return new Color(0x00, 0x00, 0x00);    }    /**     * Obtain the footer font; Meant to be overriden if a different style is desired.     * @return The footer font.     */    protected Font getFooterFont()    {        return FontFactory.getFont(FontFactory.HELVETICA, 10);    }    /**     * Decorators that help render the table to an iText document must implement ItextDecorator.     * @see org.displaytag.render.TableWriterTemplate#writeDecoratedRowStart(org.displaytag.model.TableModel)     */    protected void writeDecoratedRowStart(TableModel model)    {        TableDecorator decorator =  model.getTableDecorator();        if (decorator instanceof ItextDecorator)        {        	ItextDecorator idecorator = (ItextDecorator) decorator;            idecorator.setTable(this.table);            idecorator.setFont(this.defaultFont);        }        decorator.startRow();    }    /**     * @see org.displaytag.render.TableWriterTemplate#writeDecoratedRowFinish(org.displaytag.model.TableModel)     */    protected void writeDecoratedRowFinish(TableModel model) throws Exception    {        model.getTableDecorator().finishRow();    }    /**     * Write a column's opening structure to an iText document.     * @see org.displaytag.render.TableWriterTemplate#writeColumnOpener(org.displaytag.model.Column)     */    protected void writeColumnOpener(Column column) throws ObjectLookupException, DecoratorException    {        column.initialize(); // has side effect, setting its stringValue, which affects grouping logic.    }    /**     * Write a column's value to a iText document.     * @see org.displaytag.render.TableWriterTemplate#writeColumnValue(Object,org.displaytag.model.Column)     */    protected void writeColumnValue(Object value, Column column) throws BadElementException    {        this.table.addCell(getCell(value));    }    /**     * @see org.displaytag.render.TableWriterTemplate#writeDecoratedTableFinish(org.displaytag.model.TableModel)     */    protected void writeDecoratedTableFinish(TableModel model)    {        model.getTableDecorator().finish();    }    /**     * Returns a formatted cell for the given value.     * @param value cell value     * @return Cell     * @throws BadElementException if errors occurs while generating content.     */    private Cell getCell(Object value) throws BadElementException    {        Cell cell = new Cell(new Chunk(StringUtils.trimToEmpty(ObjectUtils.toString(value)), this.defaultFont));        cell.setVerticalAlignment(Element.ALIGN_TOP);        cell.setLeading(8);        return cell;    }    /**     * Obtain a header cell.     * @param value Cell content.     * @return A header cell with the given content.     * @throws BadElementException if errors occurs while generating content.     */    private Cell getHeaderCell(String value) throws BadElementException    {        Chunk cellContent = new Chunk(value, this.getHeaderFont());        setHeaderFontStyle(cellContent);        Cell cell = new Cell(cellContent);        cell.setLeading(8);        cell.setHeader(true);        cell.setHorizontalAlignment(this.getHeaderHorizontalAlignment());        cell.setBackgroundColor(this.getHeaderBackgroundColor());        return cell;    }    /**     * Obtain the font used to render the header text; Meant to be overridden if a different header font is desired.     * @return The font used to render the header text.     */    protected Font getHeaderFont()    {        return this.defaultFont;    }    /**     * Obtain the background color used to render the header; Meant to be overridden if a different header background     * color is desired.     * @return The backgrounc color used to render the header.     */    protected Color getHeaderBackgroundColor()    {        return new Color(0xee, 0xee, 0xee);    }    /**     * Set the font style used to render the header text; Meant to be overridden if a different header style is desired.     * @param cellContent The header content whose font will be modified.     */    protected void setHeaderFontStyle(Chunk cellContent)    {        setBoldStyle(cellContent, this.getHeaderFontColor());    }    /**     * Set the font color used to render the header text; Meant to be overridden if a different header style is desired.     * @return The font color used to render the header text.     */    protected Color getHeaderFontColor()    {        return new Color(0x00, 0x00, 0x00);    }    /**     * Obtain the horizontal alignment used to render header text; Meant to be overridden if a different alignment is     * desired.     * @return The horizontal alignment used to render header text;     */    protected int getHeaderHorizontalAlignment()    {        return Element.ALIGN_CENTER;    }    /**     * Makes chunk content bold.     * @param chunk The chunk whose content is to be rendered bold.     * @param color The font color desired.     */    private void setBoldStyle(Chunk chunk, Color color)    {        Font font = chunk.font();        chunk.setFont(FontFactory.getFont(font.getFamilyname(), font.size(), Font.BOLD, color));    }    /**     * An implementor of this interface decorates tables and columns appearing in iText documents.     * @author Jorge L. Barroso     * @version $Revision$ ($Author$)     */    public interface ItextDecorator    {        /**         * Set the iText table used to render a table model.         * @param table The iText table used to render a table model.         */        void setTable(Table table);        /**         * Set the font used to render a table's content.         * @param font The font used to render a table's content.         */        void setFont(Font font);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美zozozo| 麻豆国产精品官网| 亚洲色图丝袜美腿| 国产精品无码永久免费888| 亚洲精品一区在线观看| 日韩女优视频免费观看| 日韩三级精品电影久久久 | 在线综合视频播放| 欧亚洲嫩模精品一区三区| 在线这里只有精品| 欧美日韩国产另类不卡| 在线不卡的av| 欧美成人猛片aaaaaaa| 欧美精品一区二区在线观看| 久久欧美一区二区| 国产欧美1区2区3区| 亚洲欧美综合色| 夜夜嗨av一区二区三区中文字幕 | 日韩国产在线观看| 青青草原综合久久大伊人精品优势| 日本视频一区二区三区| 久久狠狠亚洲综合| 国产精品中文字幕欧美| 99精品久久只有精品| 色综合天天性综合| 欧美三级日韩三级国产三级| 91精品国产色综合久久不卡电影| 日韩免费视频一区二区| 中文字幕第一页久久| 亚洲专区一二三| 青青国产91久久久久久| 国产电影精品久久禁18| 91论坛在线播放| 91精品国产手机| 国产色产综合产在线视频| 亚洲欧美日韩一区二区| 天天色综合天天| 高清在线观看日韩| 欧美日韩精品一区二区三区| 久久人人超碰精品| 亚洲精品国产精品乱码不99| 免费的国产精品| 风间由美性色一区二区三区| 欧美日韩免费一区二区三区| 精品三级在线观看| 尤物在线观看一区| 久久成人av少妇免费| 99久久精品费精品国产一区二区| 欧美妇女性影城| 国产精品久久久久久久久图文区 | 成人av在线资源| 欧美久久久久中文字幕| 国产精品视频一二三区| 日韩精品国产精品| 91在线免费视频观看| 日韩欧美成人激情| 亚洲麻豆国产自偷在线| 国产一区二区看久久| 欧美视频一区在线| 国产精品天干天干在观线| 五月激情六月综合| 成人h动漫精品一区二区| 69久久夜色精品国产69蝌蚪网| 国产精品国产精品国产专区不蜜| 日本成人在线视频网站| 91网页版在线| 久久久精品天堂| 天天亚洲美女在线视频| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 日韩一区二区中文字幕| 成人免费视频在线观看| 激情综合亚洲精品| 欧美日韩精品一区二区天天拍小说 | 欧美性xxxxx极品少妇| 中文字幕不卡三区| 蜜臀久久99精品久久久画质超高清 | 日韩影院免费视频| 91久久精品国产91性色tv| 久久久久久久久久久久久久久99| 日韩电影在线免费看| 91久久线看在观草草青青| 国产亚洲精品久| 黄一区二区三区| 欧美日韩大陆一区二区| 夜色激情一区二区| 91麻豆文化传媒在线观看| 国产性色一区二区| 老汉av免费一区二区三区| 欧美日韩亚洲高清一区二区| 亚洲综合色成人| 99re66热这里只有精品3直播 | 经典一区二区三区| 欧美一区二区三区在线观看视频 | 国产成人精品影视| 精品欧美乱码久久久久久 | 蜜乳av一区二区| 欧美性感一类影片在线播放| 一区二区三区欧美久久| 99精品桃花视频在线观看| 国产精品蜜臀在线观看| 高清av一区二区| 国产精品久久久一区麻豆最新章节| 国产成人高清视频| 久久在线观看免费| 国产一区二三区| 国产亚洲精品免费| 成人少妇影院yyyy| 国产精品久久久久久亚洲毛片| 波多野结衣的一区二区三区| 国产精品视频你懂的| av不卡免费在线观看| 亚洲色图丝袜美腿| 精品婷婷伊人一区三区三| 亚洲国产一区二区视频| 欧美日韩一区二区三区不卡| 亚洲成人久久影院| 欧美精品 国产精品| 久久国产精品免费| 国产欧美久久久精品影院| 成人亚洲一区二区一| **性色生活片久久毛片| 在线一区二区三区| 石原莉奈在线亚洲二区| 欧美日韩aaaaaa| 精品中文av资源站在线观看| 久久久久久久久一| 99精品视频中文字幕| 亚洲午夜精品一区二区三区他趣| 91精品国产综合久久福利软件| 久久精品国产成人一区二区三区| 国产欧美一区二区在线| 一本久久综合亚洲鲁鲁五月天| 亚洲韩国精品一区| 日韩免费观看高清完整版在线观看| 国产伦精品一区二区三区免费 | 中文久久乱码一区二区| 色又黄又爽网站www久久| 天天综合天天综合色| 久久综合丝袜日本网| 91丨porny丨在线| 偷拍与自拍一区| 久久精品视频一区二区三区| 91麻豆免费看| 美女诱惑一区二区| 日韩毛片精品高清免费| 欧美一区二区三区免费观看视频| 高清不卡一二三区| 午夜av区久久| 国产精品婷婷午夜在线观看| 欧美性欧美巨大黑白大战| 极品少妇xxxx精品少妇偷拍| 亚洲精选视频免费看| 欧美一区二区三区免费| 99久久精品99国产精品| 另类小说欧美激情| 亚洲视频一区二区在线| 91精品国产全国免费观看| 成人av网站在线观看免费| 午夜精品久久久久久不卡8050| 国产欧美精品一区二区三区四区 | 91黄色免费版| 国产麻豆成人精品| 午夜精品影院在线观看| 国产欧美精品日韩区二区麻豆天美| 欧美日韩综合一区| 岛国精品一区二区| 麻豆精品视频在线观看视频| 亚洲在线观看免费| 日本一区二区三区免费乱视频| 91精品国产综合久久香蕉麻豆| 99热这里都是精品| 国产一区二区三区四区五区入口| 亚洲大片一区二区三区| 成人免费在线观看入口| 欧美大胆人体bbbb| 精品视频在线免费| 不卡免费追剧大全电视剧网站| 精品一区二区三区在线观看国产| 一区二区免费看| 欧美高清在线一区| www国产亚洲精品久久麻豆| 欧美精品 国产精品| 欧洲国产伦久久久久久久| av在线免费不卡| 成人性视频网站| 国产精品一区二区在线播放| 久久99精品一区二区三区| 婷婷综合五月天| 亚洲444eee在线观看| 一区二区三区在线免费| 国产精品视频线看| 欧美激情综合在线| 精品1区2区在线观看| 欧美v国产在线一区二区三区| 91精品在线观看入口| 欧美一区二区三区啪啪| 69av一区二区三区| 制服视频三区第一页精品| 欧美二区三区的天堂| 欧美久久婷婷综合色|