Java 类net.sf.jasperreports.engine.type.LineDirectionEnum 实例源码

项目:jasperreports    文件:XlsxBorderInfo.java   
/**
 *
 */
public XlsxBorderInfo(JRLineBox box, LineDirectionEnum direction)
{
    if(direction != null)
    {
        setBorder(box.getPen(), DIAGONAL_BORDER);
    }
    else
    {
        setBorder(box.getTopPen(), TOP_BORDER);
        borderPadding[TOP_BORDER] = String.valueOf(LengthUtil.twip(box.getTopPadding().intValue()));
        setBorder(box.getLeftPen(), LEFT_BORDER);
        borderPadding[LEFT_BORDER] = String.valueOf(LengthUtil.twip(box.getLeftPadding().intValue()));
        setBorder(box.getBottomPen(), BOTTOM_BORDER);
        borderPadding[BOTTOM_BORDER] = String.valueOf(LengthUtil.twip(box.getBottomPadding().intValue()));
        setBorder(box.getRightPen(), RIGHT_BORDER);
        borderPadding[RIGHT_BORDER] = String.valueOf(LengthUtil.twip(box.getRightPadding().intValue()));
    }
    this.direction = direction;
}
项目:jasperreports    文件:XlsxBorderHelper.java   
/**
 *
 */
public int getBorder(JRExporterGridCell gridCell, JRXlsAbstractExporter.SheetInfo sheetInfo, LineDirectionEnum direction)
{
    if (Boolean.TRUE.equals(sheetInfo.ignoreCellBackground) || gridCell.getBox() == null)
    {
        return -1;          
    }

    XlsxBorderInfo borderInfo = new XlsxBorderInfo(gridCell.getBox(), direction);
    Integer borderIndex = borderCache.get(borderInfo.getId());
    if (borderIndex == null)
    {
        borderIndex = Integer.valueOf(borderCache.size());
        export(borderInfo);
        borderCache.put(borderInfo.getId(), borderIndex);
    }
    return borderIndex.intValue();
}
项目:jasperreports    文件:XlsxBorderHelper.java   
/**
     *
     */
    private void export(XlsxBorderInfo info)
    {
//      if(info.hasBorder())
        {
            write("<border");
            if(info.getDirection() != null)
            {
                write(info.getDirection().equals(LineDirectionEnum.TOP_DOWN) ? " diagonalDown=\"1\"" : " diagonalUp=\"1\"");
            }
            write(">");
            exportBorder(info, XlsxBorderInfo.LEFT_BORDER);
            exportBorder(info, XlsxBorderInfo.RIGHT_BORDER);
            exportBorder(info, XlsxBorderInfo.TOP_BORDER);
            exportBorder(info, XlsxBorderInfo.BOTTOM_BORDER);
            exportBorder(info, XlsxBorderInfo.DIAGONAL_BORDER);
            write("</border>\n");
        }
//      
//      write("      <w:tcMar>\n");
//      exportPadding(info, BorderInfo.TOP_BORDER);
//      exportPadding(info, BorderInfo.LEFT_BORDER);
//      exportPadding(info, BorderInfo.BOTTOM_BORDER);
//      exportPadding(info, BorderInfo.RIGHT_BORDER);
//      write("      </w:tcMar>\n");
    }
项目:PDFReporter-Studio    文件:MLine.java   
/**
 * Creates the property descriptors.
 * 
 * @param desc
 *          the desc
 */
@Override
public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) {
    super.createPropertyDescriptors(desc, defaultsMap);

    directionD = new JSSEnumPropertyDescriptor(JRBaseLine.PROPERTY_DIRECTION, Messages.MLine_direction,
            LineDirectionEnum.class, NullEnum.NULL);
    directionD.setDescription(Messages.MLine_direction_description);
    directionD.setCategory(Messages.MLine_line_category);
    desc.add(directionD);

    /*
     * fillD = new JSSEnumPropertyDescriptor(JRBaseStyle.PROPERTY_FILL, Messages.common_fill, FillEnum.class,
     * NullEnum.INHERITED); fillD.setDescription(Messages.MLine_fill_description); desc.add(fillD);
     */

    defaultsMap.put(JRBaseLine.PROPERTY_DIRECTION, EnumHelper.getValue(LineDirectionEnum.TOP_DOWN, 1, true));
    defaultsMap.put(JRBaseStyle.PROPERTY_FILL, null);

    setHelpPrefix(desc, "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#line");
}
项目:jasperreports    文件:JRBaseLine.java   
@Override
public void setDirection(LineDirectionEnum directionValue)
{
    LineDirectionEnum old = this.directionValue;
    this.directionValue = directionValue;
    getEventSupport().firePropertyChange(PROPERTY_DIRECTION, old, this.directionValue);
}
项目:jasperreports    文件:JRBaseLine.java   
@SuppressWarnings("deprecation")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
    in.defaultReadObject();

    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2)
    {
        directionValue = LineDirectionEnum.getByValue(direction);
    }

}
项目:jasperreports    文件:JRBasePrintLine.java   
@SuppressWarnings("deprecation")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
    in.defaultReadObject();

    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2)
    {
        directionValue = LineDirectionEnum.getByValue(direction);
    }

}
项目:jasperreports    文件:JRPrintLineFactory.java   
@Override
public Object createObject(Attributes atts)
{
    JasperPrint jasperPrint = (JasperPrint)digester.peek(digester.getCount() - 2);

    JRBasePrintLine line = new JRBasePrintLine(jasperPrint.getDefaultStyleProvider());

    LineDirectionEnum direction = LineDirectionEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_direction));
    if (direction != null)
    {
        line.setDirection(direction);
    }

    return line;
}
项目:jasperreports    文件:JRXmlWriter.java   
/**
 *
 */
public void writeLine(JRLine line) throws IOException
{
    writer.startElement(JRXmlConstants.ELEMENT_line, getNamespace());
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_direction, line.getDirectionValue(), LineDirectionEnum.TOP_DOWN);

    writeReportElement(line);
    writeGraphicElement(line);

    writer.closeElement();
}
项目:jasperreports    文件:JRLineFactory.java   
@Override
public Object createObject(Attributes atts)
{
    JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2);

    JRDesignLine line = new JRDesignLine(jasperDesign);

    LineDirectionEnum direction = LineDirectionEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_direction));
    if (direction != null)
    {
        line.setDirection(direction);
    }

    return line;
}
项目:jasperreports    文件:JRApiWriter.java   
/**
 *
 */
public void writeLine( JRLine line, String lineName)
{
    if(line != null)
    {
        write( "JRDesignLine " + lineName + " = new JRDesignLine(jasperDesign);\n");
        write( lineName + ".setDirection({0});\n", line.getDirectionValue(), LineDirectionEnum.TOP_DOWN);
        writeReportElement( line, lineName);
        writeGraphicElement( line, lineName);
        flush();
    }
}
项目:jasperreports    文件:JRDesignLine.java   
@Override
public void setDirection(LineDirectionEnum directionValue)
{
    LineDirectionEnum old = this.directionValue;
    this.directionValue = directionValue;
    getEventSupport().firePropertyChange(JRBaseLine.PROPERTY_DIRECTION, old, this.directionValue);
}
项目:jasperreports    文件:JRDesignLine.java   
@SuppressWarnings("deprecation")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
    in.defaultReadObject();

    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2)
    {
        directionValue = LineDirectionEnum.getByValue(direction);
    }

}
项目:jasperreports    文件:TableBuilder.java   
/**
 *
 */
public void exportLine(JRPrintLine line, JRExporterGridCell gridCell)
{
    buildCellHeader(null, gridCell.getColSpan(), gridCell.getRowSpan());

    double x1, y1, x2, y2;

    if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN)
    {
        x1 = 0;
        y1 = 0;
        x2 = line.getWidth() - 1;
        y2 = line.getHeight() - 1;
    }
    else
    {
        x1 = 0;
        y1 = line.getHeight() - 1;
        x2 = line.getWidth() - 1;
        y2 = 0;
    }

    bodyWriter.write("<text:p>");
    documentBuilder.insertPageAnchor(this);
    bodyWriter.write(
            "<draw:line text:anchor-type=\"paragraph\" "
            + "draw:style-name=\"" + styleCache.getGraphicStyle(line) + "\" "
            + "svg:x1=\"" + LengthUtil.inchFloor4Dec(x1) + "in\" "
            + "svg:y1=\"" + LengthUtil.inchFloor4Dec(y1) + "in\" "
            + "svg:x2=\"" + LengthUtil.inchFloor4Dec(x2) + "in\" "
            + "svg:y2=\"" + LengthUtil.inchFloor4Dec(y2) + "in\">"
            //+ "</draw:line>"
            + "<text:p/></draw:line>"
            + "</text:p>"
            );
    buildCellFooter();
}
项目:jasperreports    文件:XlsxCellHelper.java   
/**
 *
 */
public void exportHeader(
    JRExporterGridCell gridCell,
    int rowIndex,
    int colIndex, 
    int maxColIndex,
    JRXlsAbstractExporter.SheetInfo sheetInfo,
    LineDirectionEnum direction
    ) 
{
    exportHeader(
            gridCell,
            rowIndex, 
            colIndex, 
            maxColIndex, 
            null, 
            null, 
            null, 
            true, 
            false, 
            false, 
            false, 
            false, 
            RotationEnum.NONE, 
            sheetInfo,
            direction);
}
项目:jasperreports    文件:XlsxStyleHelper.java   
/**
 * 
 */
public int getCellStyle(
    JRExporterGridCell gridCell, 
    String pattern, 
    Locale locale,
    boolean isWrapText, 
    boolean isHidden, 
    boolean isLocked,
    boolean  isShrinkToFit,
    boolean isIgnoreTextFormatting,
    RotationEnum rotation,
    JRXlsAbstractExporter.SheetInfo sheetInfo,
    LineDirectionEnum direction
    )
{
    XlsxStyleInfo styleInfo = 
        new XlsxStyleInfo(
            formatHelper.getFormat(pattern) + 1,
            fontHelper.getFont(gridCell, locale) + 1,
            borderHelper.getBorder(gridCell, sheetInfo, direction) + 1,
            gridCell,
            isWrapText,
            isHidden,
            isLocked,
            isShrinkToFit,
            isIgnoreTextFormatting, 
            getRotation(rotation),
            sheetInfo,
            direction
            );
    Integer styleIndex = styleCache.get(styleInfo.getId());
    if (styleIndex == null)
    {
        styleIndex = Integer.valueOf(styleCache.size() + 1);
        exportCellStyle(gridCell, styleInfo, styleIndex, sheetInfo);
        styleCache.put(styleInfo.getId(), styleIndex);
    }
    return styleIndex.intValue();
}
项目:jasperreports    文件:JRXmlExporter.java   
/**
 * @throws IOException 
 *
 */
protected void exportLine(JRPrintLine line) throws IOException
{
    xmlWriter.startElement(JRXmlConstants.ELEMENT_line);
    xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_direction, line.getDirectionValue(), LineDirectionEnum.TOP_DOWN);

    exportReportElement(line);
    exportGraphicElement(line);

    xmlWriter.closeElement();
}
项目:jasperreports    文件:JRTemplateLine.java   
@SuppressWarnings("deprecation")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
    in.defaultReadObject();

    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2)
    {
        directionValue = LineDirectionEnum.getByValue(direction);
    }

}
项目:PDFReporter-Studio    文件:MLine.java   
@Override
public void setPropertyValue(Object id, Object value) {
    JRDesignLine jrElement = (JRDesignLine) getValue();
    if (id.equals(JRBaseLine.PROPERTY_DIRECTION))
        jrElement.setDirection((LineDirectionEnum) directionD.getEnumValue(value));
    if (id.equals(JRBaseStyle.PROPERTY_FILL))
        jrElement.setFill((FillEnum) fillD.getEnumValue(value));
    else
        super.setPropertyValue(id, value);
}
项目:ireport-fork    文件:LineDirectionProperty.java   
@Override
public List getTagList() 
{
    List tags = new java.util.ArrayList();
    tags.add(new Tag(LineDirectionEnum.TOP_DOWN, I18n.getString("Global.Property.TopDown")));
    tags.add(new Tag(LineDirectionEnum.BOTTOM_UP, I18n.getString("Global.Property.BottomUp")));
    return tags;
}
项目:jasperreports    文件:JRBaseLine.java   
@Override
public LineDirectionEnum getDirectionValue()
{
    return directionValue;
}
项目:jasperreports    文件:JRBasePrintLine.java   
@Override
public LineDirectionEnum getDirectionValue()
{
    return this.directionValue;
}
项目:jasperreports    文件:JRBasePrintLine.java   
@Override
public void setDirection(LineDirectionEnum directionValue)
{
    this.directionValue = directionValue;
}
项目:jasperreports    文件:JRDesignLine.java   
@Override
public LineDirectionEnum getDirectionValue()
{
    return directionValue;
}
项目:jasperreports    文件:JRXlsExporter.java   
@Override
protected void exportLine(JRPrintLine line, JRExporterGridCell gridCell, int colIndex, int rowIndex)
{
    short forecolor = getWorkbookColor(line.getLinePen().getLineColor()).getIndex();

    int side = BoxStyle.TOP;
    float ratio = line.getWidth() / line.getHeight();
    if (ratio > 1)
    {
        if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN)
        {
            side = BoxStyle.TOP;
        }
        else
        {
            side = BoxStyle.BOTTOM;
        }
    }
    else
    {
        if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN)
        {
            side = BoxStyle.LEFT;
        }
        else
        {
            side = BoxStyle.RIGHT;
        }
    }
    BoxStyle boxStyle = new BoxStyle(side, line.getLinePen());

    FillPatternType mode = backgroundMode;
    short backcolor = whiteIndex;
    if (!Boolean.TRUE.equals(sheetInfo.ignoreCellBackground) && gridCell.getCellBackcolor() != null)
    {
        mode = FillPatternType.SOLID_FOREGROUND;
        backcolor = getWorkbookColor(gridCell.getCellBackcolor()).getIndex();
    }

    HSSFCellStyle cellStyle =
        getLoadedCellStyle(
            mode,
            backcolor,
            HorizontalAlignment.LEFT,
            VerticalAlignment.TOP,
            (short)0,
            getLoadedFont(getDefaultFont(), forecolor, null, getLocale()),
            boxStyle,
            false,
            isCellLocked(line),
            isCellHidden(line),
            isShrinkToFit(line)
            );

    createMergeRegion(gridCell, colIndex, rowIndex, cellStyle);

    cell = row.createCell(colIndex);
    cell.setCellStyle(cellStyle);
}
项目:jasperreports    文件:JROdsExporter.java   
@Override
    protected void exportLine(
        JRPrintLine line, 
        JRExporterGridCell gridCell,
        int colIndex, 
        int rowIndex
        ) throws JRException 
    {
        JRLineBox box = new JRBaseLineBox(null);
        JRPen pen = null;
        float ratio = line.getWidth() / line.getHeight();
        if (ratio > 1)
        {
            if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN)
            {
                pen = box.getTopPen();
            }
            else
            {
                pen = box.getBottomPen();
            }
        }
        else
        {
            if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN)
            {
                pen = box.getLeftPen();
            }
            else
            {
                pen = box.getRightPen();
            }
        }
        pen.setLineColor(line.getLinePen().getLineColor());
        pen.setLineStyle(line.getLinePen().getLineStyleValue());
        pen.setLineWidth(line.getLinePen().getLineWidth());

        gridCell.setBox(box);//CAUTION: only some exporters set the cell box

        tableBuilder.buildCellHeader(styleCache.getCellStyle(gridCell), gridCell.getColSpan(), gridCell.getRowSpan());

//      double x1, y1, x2, y2;
//
//      if (line.getDirection() == JRLine.DIRECTION_TOP_DOWN)
//      {
//          x1 = Utility.translatePixelsToInches(0);
//          y1 = Utility.translatePixelsToInches(0);
//          x2 = Utility.translatePixelsToInches(line.getWidth() - 1);
//          y2 = Utility.translatePixelsToInches(line.getHeight() - 1);
//      }
//      else
//      {
//          x1 = Utility.translatePixelsToInches(0);
//          y1 = Utility.translatePixelsToInches(line.getHeight() - 1);
//          x2 = Utility.translatePixelsToInches(line.getWidth() - 1);
//          y2 = Utility.translatePixelsToInches(0);
//      }

        tempBodyWriter.write("<text:p>");
//FIXMEODS      insertPageAnchor();
//      tempBodyWriter.write(
//              "<draw:line text:anchor-type=\"paragraph\" "
//              + "draw:style-name=\"" + styleCache.getGraphicStyle(line) + "\" "
//              + "svg:x1=\"" + x1 + "in\" "
//              + "svg:y1=\"" + y1 + "in\" "
//              + "svg:x2=\"" + x2 + "in\" "
//              + "svg:y2=\"" + y2 + "in\">"
//              //+ "</draw:line>"
//              + "<text:p/></draw:line>"
//              );
        tempBodyWriter.write("</text:p>");
        tableBuilder.buildCellFooter();
    }
项目:jasperreports    文件:HtmlExporter.java   
protected void writeLine(JRPrintLine line, TableCell cell)
        throws IOException
{       
    startCell(line, cell);
    if(isOblique(line))
    {
        finishStartCell();

        int width = line.getWidth();
        int height = line.getHeight();
        LineDirectionEnum lineDirection = line.getDirectionValue();
        int y1 = lineDirection == LineDirectionEnum.BOTTOM_UP ? height : 0;
        int y2 = lineDirection == LineDirectionEnum.BOTTOM_UP ? 0 : height;

        writer.write("<svg height=\"" + height + "\" width=\"" + width + "\">");
        writer.write("<line x1=\"0\" y1=\"" + y1 +"\" x2=\"" + width + "\" y2=\"" + y2 + "\" ");
        writeSvgStyle(line);
        writer.write("\"/></svg>");
    }
    else
    {
        StringBuilder styleBuffer = new StringBuilder();

        appendElementCellGenericStyle(cell, styleBuffer);
        appendBackcolorStyle(cell, styleBuffer);

        String side = null;
        float ratio = line.getWidth() / line.getHeight();
        if (ratio > 1)
        {
            if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN)
            {
                side = "top";
            }
            else
            {
                side = "bottom";
            }
        }
        else
        {
            if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN)
            {
                side = "left";
            }
            else
            {
                side = "right";
            }
        }

        appendPen(
            styleBuffer,
            line.getLinePen(),
            side
            );

        writeStyle(styleBuffer);

        finishStartCell();          
    }

    endCell();
}
项目:jasperreports    文件:JRXlsMetadataExporter.java   
@Override
protected void exportLine(JRPrintLine line) throws JRException {
    String currentColumnName = line.getPropertiesMap().getProperty(JRXlsAbstractMetadataExporter.PROPERTY_COLUMN_NAME);

    if (currentColumnName != null && currentColumnName.length() > 0) {
        boolean repeatValue = getPropertiesUtil().getBooleanProperty(line, JRXlsAbstractMetadataExporter.PROPERTY_REPEAT_VALUE, false);

        setColumnName(currentColumnName);
        adjustColumnWidth(currentColumnName, line.getWidth(), ((JRXlsExporterNature)nature).getColumnAutoFit(line));
        adjustRowHeight(line.getHeight(), ((JRXlsExporterNature)nature).getRowAutoFit(line));

        short forecolor = getWorkbookColor(line.getLinePen().getLineColor()).getIndex();

        int side = BoxStyle.TOP;
        float ratio = line.getWidth() / line.getHeight();
        if (ratio > 1) {
            if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN) {
                side = BoxStyle.TOP;
            } else {
                side = BoxStyle.BOTTOM;
            }
        } else {
            if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN) {
                side = BoxStyle.LEFT;
            } else {
                side = BoxStyle.RIGHT;
            }
        }
        BoxStyle boxStyle = new BoxStyle(side, line.getLinePen());

        FillPatternType mode = backgroundMode;
        short backcolor = whiteIndex;
        if (!Boolean.TRUE.equals(sheetInfo.ignoreCellBackground) && line.getBackcolor() != null) {
            mode = FillPatternType.SOLID_FOREGROUND;
            backcolor = getWorkbookColor(line.getBackcolor()).getIndex();
        }

        HSSFCellStyle cellStyle =
            getLoadedCellStyle(
                mode,
                backcolor,
                HorizontalAlignment.LEFT,
                VerticalAlignment.TOP,
                (short)0,
                getLoadedFont(getDefaultFont(), forecolor, null, getLocale()),
                boxStyle,
                isCellLocked(line),
                isCellHidden(line),
                isShrinkToFit(line)
                );
        addBlankElement(cellStyle, repeatValue, currentColumnName);
    }
}
项目:jasperreports    文件:JRRtfExporter.java   
/**
 * Draw a line object
 * @param line JasperReports line object - JRPrintLine
 * @throws IOException
 */
protected void exportLine(JRPrintLine line) throws IOException 
{
    int x = line.getX() + getOffsetX();
    int y = line.getY() + getOffsetY();
    int height = line.getHeight();
    int width = line.getWidth();

    if (width <= 1 || height <= 1)
    {
        if (width > 1)
        {
            height = 0;
        }
        else
        {
            width = 0;
        }
    }

    contentWriter.write("{\\shp\\shpbxpage\\shpbypage\\shpwr5\\shpfhdr0\\shpz");
    contentWriter.write(String.valueOf(zorder++));
    contentWriter.write("\\shpleft");
    contentWriter.write(String.valueOf(LengthUtil.twip(x)));
    contentWriter.write("\\shpright");
    contentWriter.write(String.valueOf(LengthUtil.twip(x + width)));
    contentWriter.write("\\shptop");
    contentWriter.write(String.valueOf(LengthUtil.twip(y)));
    contentWriter.write("\\shpbottom");
    contentWriter.write(String.valueOf(LengthUtil.twip(y + height)));

    contentWriter.write("{\\shpinst");

    contentWriter.write("{\\sp{\\sn shapeType}{\\sv 20}}");

    exportPen(line.getLinePen());

    if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN)
    {
        contentWriter.write("{\\sp{\\sn fFlipV}{\\sv 0}}");
    }
    else
    {
        contentWriter.write("{\\sp{\\sn fFlipV}{\\sv 1}}");
    }

    contentWriter.write("}}\n");
}
项目:jasperreports    文件:JRDocxExporter.java   
/**
 *
 */
protected void exportLine(DocxTableHelper tableHelper, JRPrintLine line, JRExporterGridCell gridCell)
{
    JRLineBox box = new JRBaseLineBox(null);
    JRPen pen = null;
    float ratio = line.getWidth() / line.getHeight();
    if (ratio > 1)
    {
        if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN)
        {
            pen = box.getTopPen();
        }
        else
        {
            pen = box.getBottomPen();
        }
    }
    else
    {
        if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN)
        {
            pen = box.getLeftPen();
        }
        else
        {
            pen = box.getRightPen();
        }
    }
    pen.setLineColor(line.getLinePen().getLineColor());
    pen.setLineStyle(line.getLinePen().getLineStyleValue());
    pen.setLineWidth(line.getLinePen().getLineWidth());

    gridCell.setBox(box);//CAUTION: only some exporters set the cell box

    tableHelper.getCellHelper().exportHeader(line, gridCell);
    tableHelper.getParagraphHelper().exportEmptyParagraph(startPage, bookmarkIndex, pageAnchor);
    if (startPage)
    {
        // increment the bookmarkIndex for the first cell in the sheet, due to page anchor creation
        bookmarkIndex++;
    }
    tableHelper.getCellHelper().exportFooter();
}
项目:jasperreports    文件:XlsxCellHelper.java   
/**
 *
 */
public void exportHeader(
    JRExporterGridCell gridCell,
    int rowIndex,
    int colIndex, 
    int maxColIndex, 
    TextValue textValue,
    String pattern,
    Locale locale,
    boolean isWrapText,
    boolean isHidden,
    boolean isLocked,
    boolean isShrinkToFit,
    boolean isIgnoreTextFormatting, 
    RotationEnum rotation,
    JRXlsAbstractExporter.SheetInfo sheetInfo,
    LineDirectionEnum direction
    ) 
{
    try
    {
        if (textValue != null)
        {
            textValue.handle(textValueHandler);
        }
        else
        {
            textValueHandler.handle((StringTextValue)null);
        }
    }
    catch (JRException e)
    {
        throw new JRRuntimeException(e);
    }

    Integer styleIndex = null;

    if (gridCell.getType() == JRExporterGridCell.TYPE_OCCUPIED_CELL)
    {
        styleIndex = ((ElementGridCell)((OccupiedGridCell)gridCell).getOccupier()).getStyleIndex();
    }

    if (styleIndex == null)
    {
        styleIndex = 
            styleHelper.getCellStyle(
                gridCell, 
                pattern, 
                locale, 
                isWrapText, 
                isHidden, 
                isLocked, 
                isShrinkToFit, 
                isIgnoreTextFormatting,
                rotation,
                sheetInfo,
                direction
                );
        if (
            gridCell.getType() == JRExporterGridCell.TYPE_ELEMENT_CELL
            && gridCell instanceof ElementGridCell
            )
        {
            ((ElementGridCell)gridCell).setStyleIndex(styleIndex);
        }
    }

    write("  <c r=\"" 
        + JRXlsAbstractExporter.getColumIndexName(colIndex, maxColIndex) 
        + (rowIndex + 1) 
        + "\" s=\"" + styleIndex + "\""
        );
    String type = textValueHandler.getType();
    if (type != null)
    {
        write(" t=\"" + type + "\"");
    }
    write(">");
}
项目:jasperreports    文件:XlsxStyleInfo.java   
/**
 *
 */
public XlsxStyleInfo(
    int formatIndex, 
    int fontIndex, 
    int borderIndex, 
    JRExporterGridCell gridCell, 
    boolean isWrapText,
    boolean isHidden,
    boolean isLocked,
    boolean isShrinkToFit,
    boolean isIgnoreTextFormatting,
    int rotation,
    JRXlsAbstractExporter.SheetInfo sheetInfo,
    LineDirectionEnum direction
    )
{
    this.formatIndex = formatIndex;
    this.fontIndex = isIgnoreTextFormatting ? -1 : fontIndex;
    this.borderIndex = isIgnoreTextFormatting ? -1 : borderIndex;

    JRPrintElement element = gridCell.getElement();

    if (!isIgnoreTextFormatting)
    {
        if (element != null && element.getModeValue() == ModeEnum.OPAQUE)
        {
            this.backcolor = JRColorUtil.getColorHexa(element.getBackcolor());
        }
        else if (gridCell.getBackcolor() != null)
        {
            this.backcolor = JRColorUtil.getColorHexa(gridCell.getBackcolor());
        }
    }

    JRTextAlignment align = element instanceof JRTextAlignment ? (JRTextAlignment)element : null;
    if (align != null)
    {
        this.horizontalAlign = getHorizontalAlignment(align.getHorizontalTextAlign(), align.getVerticalTextAlign(), rotation);//FIXMEXLSX use common util
        this.verticalAlign = getVerticalAlignment(align.getHorizontalTextAlign(), align.getVerticalTextAlign(), rotation);//FIXMEXLSX use common util
    }

    this.isWrapText = isShrinkToFit ? false : isWrapText;
    this.isHidden = isHidden;
    this.isLocked = isLocked;
    this.isShrinkToFit = isShrinkToFit;
    this.rotation = rotation;
    if(sheetInfo.whitePageBackground != null)
    {
        this.whitePageBackground = sheetInfo.whitePageBackground;
    }
    if(sheetInfo.ignoreCellBackground != null)
    {
        this.ignoreCellBackground = sheetInfo.ignoreCellBackground;
    }
    if(sheetInfo.ignoreCellBorder != null)
    {
        this.ignoreCellBorder = sheetInfo.ignoreCellBorder;
    }
    this.direction = direction;
}
项目:jasperreports    文件:JRXlsxExporter.java   
@Override
protected void exportLine(
    JRPrintLine line, 
    JRExporterGridCell gridCell,
    int colIndex, 
    int rowIndex
    ) throws JRException 
{
    JRLineBox box = new JRBaseLineBox(null);
    JRPen pen = null;
    LineDirectionEnum direction = null;
    float ratio = line.getWidth() / line.getHeight();
    if (ratio > 1)
    {
        if(line.getHeight() > 1)
        {
            direction = line.getDirectionValue();
            pen = box.getPen();
        }
        else if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN)
        {
            pen = box.getTopPen();
        }
        else
        {
            pen = box.getBottomPen();
        }
    }
    else
    {
        if(line.getWidth() > 1)
        {
            direction = line.getDirectionValue();
            pen = box.getPen();
        }
        else if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN)
        {
            pen = box.getLeftPen();
        }
        else
        {
            pen = box.getRightPen();
        }
    }
    pen.setLineColor(line.getLinePen().getLineColor());
    pen.setLineStyle(line.getLinePen().getLineStyleValue());
    pen.setLineWidth(line.getLinePen().getLineWidth());

    gridCell.setBox(box);//CAUTION: only some exporters set the cell box

    cellHelper.exportHeader(gridCell, rowIndex, colIndex, maxColumnIndex, sheetInfo, direction);
    sheetHelper.exportMergedCells(rowIndex, colIndex, maxColumnIndex, gridCell.getRowSpan(), gridCell.getColSpan());
    cellHelper.exportFooter();
}
项目:jasperreports    文件:XlsxBorderInfo.java   
public LineDirectionEnum getDirection() 
{
    return this.direction;
}
项目:jasperreports    文件:JRTemplateLine.java   
/**
 * 
 */
public LineDirectionEnum getDirectionValue()
{
    return this.directionValue;
}
项目:jasperreports    文件:JRTemplateLine.java   
/**
 * 
 */
public void setDirection(LineDirectionEnum directionValue)
{
    this.directionValue = directionValue;
}
项目:jasperreports    文件:JRFillLine.java   
@Override
public LineDirectionEnum getDirectionValue()
{
    return ((JRLine)this.parent).getDirectionValue();
}
项目:jasperreports    文件:JRFillLine.java   
@Override
public void setDirection(LineDirectionEnum direction)
{
    throw new UnsupportedOperationException();
}
项目:jasperreports    文件:JRTemplatePrintLine.java   
@Override
public LineDirectionEnum getDirectionValue()
{
    return ((JRTemplateLine)this.template).getDirectionValue();
}
项目:jasperreports    文件:JRTemplatePrintLine.java   
@Override
public void setDirection(LineDirectionEnum direction)
{
}