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

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

    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_5_2)
    {
        splitType = isSplitAllowed ? SplitTypeEnum.STRETCH.getValueByte() : SplitTypeEnum.PREVENT.getValueByte();
    }

    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2)//FIXMEENUM check order of ifs for all
    {
        splitTypeValue = SplitTypeEnum.getByValue(splitType);

        splitType = null;
    }
}
项目:jasperreports    文件:JRVerifier.java   
private static int getBreakHeight(JRBand band)
{
    int breakHeight = 0;

    if (band != null)
    {
        breakHeight = band.getHeight();
        JRElement[] elements = band.getElements();
        if (
            SplitTypeEnum.IMMEDIATE == band.getSplitTypeValue()
            && elements != null && elements.length > 0
            )
        {
            for(int i = 0; i < elements.length; i++)
            {
                JRElement element = elements[i];
                int bottom = element.getY() + element.getHeight();
                breakHeight = bottom < breakHeight ? bottom : breakHeight;
            }
        }
    }

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

    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_5_2)
    {
        splitType = isSplitAllowed ? SplitTypeEnum.STRETCH.getValueByte() : SplitTypeEnum.PREVENT.getValueByte();
    }

    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2)//FIXMEENUM check order of ifs for all
    {
        splitTypeValue = SplitTypeEnum.getByValue(splitType);

        splitType = null;
    }
}
项目:jasperreports    文件:TableReport.java   
protected JRBand createDetailBand(List<FillColumn> fillColumns)
{
    final JRDesignBand detailBand = new JRDesignBand();
    detailBand.setSplitType(SplitTypeEnum.PREVENT);

    ReportBandInfo bandInfo = new ReportBandInfo(detailBand, BandTypeEnum.DETAIL.getName());
    int xOffset = 0;
    for (FillColumn subcolumn : fillColumns)
    {
        DetailBandCreator subVisitor = new DetailBandCreator(
                bandInfo, subcolumn, xOffset, 0, 0);
        subVisitor.visit();
        xOffset = subVisitor.xOffset;
    }

    setPdfTags(bandInfo, false);

    return detailBand;
}
项目:jasperreports    文件:TableReport.java   
protected JRDesignBand createColumnHeader(List<FillColumn> fillColumns)
{
    JRDesignBand columnHeader = new JRDesignBand();
    columnHeader.setSplitType(SplitTypeEnum.PREVENT);

    ReportBandInfo bandInfo = new ReportBandInfo(columnHeader, BandTypeEnum.COLUMN_HEADER.getName());
    int xOffset = 0;
    for (FillColumn subcolumn : fillColumns)
    {
        ColumnHeaderCreator subVisitor = new ColumnHeaderCreator(
                bandInfo, subcolumn, xOffset, 0, 0, headerHtmlBaseProperties,
                new AtomicBoolean());
        subVisitor.visit();
        xOffset = subVisitor.xOffset;
    }

    setPdfTags(bandInfo, true);

    if (columnHeader.getHeight() == 0)
    {
        columnHeader = null;
    }
    return columnHeader;
}
项目:jasperreports    文件:TableReport.java   
protected JRDesignBand createPageFooter(List<FillColumn> fillColumns)
{
    JRDesignBand pageFooter = new JRDesignBand();
    pageFooter.setSplitType(SplitTypeEnum.PREVENT);

    ReportBandInfo bandInfo = new ReportBandInfo(pageFooter, BandTypeEnum.PAGE_FOOTER.getName());
    int xOffset = 0;
    for (FillColumn subcolumn : fillColumns)
    {
        PageFooterCreator subVisitor = new PageFooterCreator(
                bandInfo, subcolumn, xOffset, 0, 0);
        subVisitor.visit();
        xOffset = subVisitor.xOffset;
    }

    setPdfTags(bandInfo, false);

    if (pageFooter.getHeight() == 0)
    {
        pageFooter = null;
    }
    return pageFooter;
}
项目:jasperreports    文件:TableReport.java   
protected JRDesignBand createTitle(List<FillColumn> fillColumns)
{
    JRDesignBand title = new JRDesignBand();
    title.setSplitType(SplitTypeEnum.PREVENT);

    ReportBandInfo bandInfo = new ReportBandInfo(title, BandTypeEnum.TITLE.getName());
    int xOffset = 0;
    for (FillColumn subcolumn : fillColumns)
    {
        TitleCreator subVisitor = new TitleCreator(
                bandInfo, subcolumn, xOffset, 0, 0);
        subVisitor.visit();
        xOffset = subVisitor.xOffset;
    }

    setPdfTags(bandInfo, false);

    if (title.getHeight() == 0) //FIXMETABLE not sure we actually need this; maybe check the section is truly empty; do the same for the other sections as well
    {
        title = null;
    }
    return title;
}
项目:jasperreports    文件:TableReport.java   
protected JRDesignBand createSummary(List<FillColumn> fillColumns)
{
    JRDesignBand summary = new JRDesignBand();
    summary.setSplitType(SplitTypeEnum.PREVENT);

    ReportBandInfo bandInfo = new ReportBandInfo(summary, BandTypeEnum.SUMMARY.getName());
    int xOffset = 0;
    for (FillColumn subcolumn : fillColumns)
    {
        SummaryCreator subVisitor = new SummaryCreator(
                bandInfo, subcolumn, xOffset, 0, 0);
        subVisitor.visit();
        xOffset = subVisitor.xOffset;
    }

    setPdfTags(bandInfo, false);

    if (summary.getHeight() == 0)
    {
        summary = null;
    }
    return summary;
}
项目:jasperreports    文件:TableReport.java   
protected JRBand createGroupHeader(String groupName, List<FillColumn> fillColumns)
{
    JRDesignBand header = new JRDesignBand();
    header.setSplitType(SplitTypeEnum.PREVENT);

    ReportBandInfo bandInfo = new ReportBandInfo(header, BandTypeEnum.GROUP_HEADER + "-" + groupName);
    int xOffset = 0;
    for (FillColumn subcolumn : fillColumns)
    {
        GroupHeaderCreator subVisitor = new GroupHeaderCreator(groupName,
                bandInfo, subcolumn, xOffset, 0, 0);
        subVisitor.visit();
        xOffset = subVisitor.xOffset;
    }

    setPdfTags(bandInfo, false);

    if (header.getHeight() == 0)
    {
        header = null;
    }
    return header;
}
项目:jasperreports    文件:TableReport.java   
protected JRBand createGroupFooter(String groupName, List<FillColumn> fillColumns)
{
    JRDesignBand footer = new JRDesignBand();
    footer.setSplitType(SplitTypeEnum.PREVENT);

    ReportBandInfo bandInfo = new ReportBandInfo(footer, BandTypeEnum.GROUP_FOOTER + "-" + groupName);
    int xOffset = 0;
    for (FillColumn subcolumn : fillColumns)
    {
        GroupFooterCreator subVisitor = new GroupFooterCreator(groupName,
                bandInfo, subcolumn, xOffset, 0, 0);
        subVisitor.visit();
        xOffset = subVisitor.xOffset;
    }

    setPdfTags(bandInfo, false);

    if (footer.getHeight() == 0)
    {
        footer = null;
    }
    return footer;
}
项目:PDFReporter-Studio    文件:MBand.java   
public void setPropertyValue(Object id, Object value) {
    JRDesignBand jrband = (JRDesignBand) getValue();
    if (jrband != null) {
        if (id.equals(JRDesignBand.PROPERTY_HEIGHT)) {
            jrband.setHeight(Math.max(0, (Integer) Misc.nvl(value, Integer.valueOf(0))));
        } else if (id.equals(JRDesignBand.PROPERTY_SPLIT_TYPE))
            jrband.setSplitType((SplitTypeEnum) splitStyleD.getEnumValue(value));
        else if (id.equals(JRDesignBand.PROPERTY_PRINT_WHEN_EXPRESSION))
            jrband.setPrintWhenExpression(ExprUtil.setValues(jrband.getPrintWhenExpression(), value, null));
        else if (id.equals(MGraphicElement.PROPERTY_MAP)) {
            JRPropertiesMap v = (JRPropertiesMap) value;
            String[] names = jrband.getPropertiesMap().getPropertyNames();
            for (int i = 0; i < names.length; i++) {
                jrband.getPropertiesMap().removeProperty(names[i]);
            }
            names = v.getPropertyNames();
            for (int i = 0; i < names.length; i++)
                jrband.getPropertiesMap().setProperty(names[i], v.getProperty(names[i]));
            this.getPropertyChangeSupport().firePropertyChange(MGraphicElement.PROPERTY_MAP, false, true);
        }
    }
}
项目:PDFReporter-Studio    文件:PreviewGenerator.java   
/**
 * Create a very minimal jasperdesign where the static text is placed. It is cached
 * since we don't need to create it everytime
 */
private static void createDesign()
 {
      jasperDesign = new JasperDesign();
      JRDesignBand jrBand = new JRDesignBand();
         jasperDesign.setTitle(jrBand);
      textElement = new JRDesignStaticText();
      jasperDesign.setLeftMargin(0);
      jasperDesign.setRightMargin(0);
      jasperDesign.setTopMargin(0);
      jasperDesign.setBottomMargin(0);
      jrBand.addElement(textElement);
      jrBand.setSplitType(SplitTypeEnum.STRETCH);
      textElement.setStretchType(StretchTypeEnum.NO_STRETCH);
      textElement.setPrintRepeatedValues(false);
      textElement.setPrintWhenDetailOverflows(true);
  }
项目:ireport-fork    文件:BandNode.java   
public void setValue(Object val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {

            if (IReportManager.getPreferences().getBoolean("designer_debug_mode", false))
            {
                System.out.println(new java.util.Date() + ": setting SplitType to: " + val + ". If the value is unattended or null, please report this notification to http://jasperforge.org/plugins/mantis/view.php?id=4139");
                Thread.dumpStack();
            }

            if (val == null || val instanceof SplitTypeEnum) {

                SplitTypeEnum oldValue = band.getSplitTypeValue();
                SplitTypeEnum newValue = (SplitTypeEnum) val;
                band.setSplitType(newValue);
                ObjectPropertyUndoableEdit urob = new ObjectPropertyUndoableEdit(band, "SplitType", SplitTypeEnum.class, oldValue, newValue);
                IReportManager.getInstance().addUndoableEdit(urob);
            }
        }
项目:jasperreports    文件:JRBaseBand.java   
@Override
public void setSplitType(SplitTypeEnum splitTypeValue)
{
    SplitTypeEnum old = this.splitTypeValue;
    this.splitTypeValue = splitTypeValue;
    getEventSupport().firePropertyChange(JRBaseBand.PROPERTY_splitType, old, this.splitTypeValue);
}
项目:jasperreports    文件:JRBandFactory.java   
@Override
public Object createObject(Attributes atts)
{
    JRDesignBand band = new JRDesignBand();

    String height = atts.getValue(JRXmlConstants.ATTRIBUTE_height);
    if (height != null && height.length() > 0)
    {
        band.setHeight(Integer.parseInt(height));
    }

    String isSplitAllowed = atts.getValue(JRXmlConstants.ATTRIBUTE_isSplitAllowed);
    if (isSplitAllowed != null && isSplitAllowed.length() > 0)
    {
        if (log.isWarnEnabled())
        {
            log.warn("The 'isSplitAllowed' attribute is deprecated. Use the 'splitType' attribute instead.");
        }

        if (Boolean.valueOf(isSplitAllowed).booleanValue())
        {
            band.setSplitType(SplitTypeEnum.STRETCH);
        }
        else
        {
            band.setSplitType(SplitTypeEnum.PREVENT);
        }
    }

    SplitTypeEnum splitType = SplitTypeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_splitType));
    if (splitType != null)
    {
        band.setSplitType(splitType);
    }

    return band;
}
项目:jasperreports    文件:JRXmlWriter.java   
/**
 *
 */
private void writeBand(JRBand band) throws IOException
{
    writer.startElement(JRXmlConstants.ELEMENT_band);
    writer.addAttributePositive(JRXmlConstants.ATTRIBUTE_height, band.getHeight());
    if(isNewerVersionOrEqual(JRConstants.VERSION_3_5_2))
    {
        writer.addAttribute(JRXmlConstants.ATTRIBUTE_splitType, band.getSplitTypeValue());
    }
    else
    {
        writer.addAttribute(JRXmlConstants.ATTRIBUTE_isSplitAllowed, band.getSplitTypeValue() != SplitTypeEnum.PREVENT, true);
    }

    if(isNewerVersionOrEqual(JRConstants.VERSION_4_8_0))
    {
        writeProperties(band);
    }
    writeExpression(JRXmlConstants.ELEMENT_printWhenExpression, band.getPrintWhenExpression(), false);

    writeChildElements(band);

    if (isNewerVersionOrEqual(JRConstants.VERSION_6_1_1))
    {
        List<ExpressionReturnValue> returnValues = band.getReturnValues();
        if (returnValues != null && !returnValues.isEmpty())
        {
            for (ExpressionReturnValue returnValue : returnValues)
            {
                writeReturnValue(returnValue);
            }
        }
    }

    writer.closeElement();
}
项目:jasperreports    文件:JRDesignBand.java   
@Override
public void setSplitType(SplitTypeEnum splitTypeValue)
{
    SplitTypeEnum old = this.splitTypeValue;
    this.splitTypeValue = splitTypeValue;
    getEventSupport().firePropertyChange(JRBaseBand.PROPERTY_splitType, old, this.splitTypeValue);
}
项目:PDFReporter-Studio    文件:MBand.java   
/**
 * Creates the property descriptors.
 * 
 * @param desc
 *          the desc
 */
@Override
public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) {
    PixelPropertyDescriptor heightD = new PixelPropertyDescriptor(JRDesignBand.PROPERTY_HEIGHT, Messages.common_height);
    heightD.setDescription(Messages.MBand_height_description);
    desc.add(heightD);

    splitStyleD = new JSSEnumPropertyDescriptor(JRDesignBand.PROPERTY_SPLIT_TYPE, Messages.common_split_type,
            SplitTypeEnum.class, NullEnum.NULL);
    splitStyleD.setDescription(Messages.MBand_split_type_dscription);
    desc.add(splitStyleD);
    splitStyleD.setHelpRefBuilder(new HelpReferenceBuilder(
            "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#band_splitType")); //$NON-NLS-1$

    JRExpressionPropertyDescriptor printWhenExpD = new JRExpressionPropertyDescriptor(
            JRDesignBand.PROPERTY_PRINT_WHEN_EXPRESSION, Messages.common_print_when_expression);
    printWhenExpD.setDescription(Messages.MBand_print_when_expression_description);
    desc.add(printWhenExpD);

    printWhenExpD.setHelpRefBuilder(new HelpReferenceBuilder(
            "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#printWhenExpression")); //$NON-NLS-1$

    JPropertiesPropertyDescriptor propertiesMapD = new JPropertiesPropertyDescriptor(MGraphicElement.PROPERTY_MAP,
            Messages.common_properties);
    propertiesMapD.setDescription(Messages.common_properties);
    desc.add(propertiesMapD);

    defaultsMap.put(JRDesignBand.PROPERTY_HEIGHT, CONST_HEIGHT);
    defaultsMap.put(JRDesignBand.PROPERTY_SPLIT_TYPE, null);
    defaultsMap.put(JRDesignBand.PROPERTY_PRINT_WHEN_EXPRESSION, null);

    setHelpPrefix(desc, "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#band"); //$NON-NLS-1$
}
项目:ireport-fork    文件:BandNode.java   
@Override
@SuppressWarnings(value = "unchecked")
public PropertyEditor getPropertyEditor() {
    if (editor == null) {
        ArrayList l = new ArrayList();
        l.add(new Tag(null, "<Default>"));
        l.add(new Tag(SplitTypeEnum.IMMEDIATE, I18n.getString("band.property.splitType.immediate")));
        l.add(new Tag(SplitTypeEnum.PREVENT, I18n.getString("band.property.splitType.prevent")));
        l.add(new Tag(SplitTypeEnum.STRETCH, I18n.getString("band.property.splitType.stretch")));
        editor = new ComboBoxPropertyEditor(false, l);
    }
    return editor;
}
项目:jasperreports    文件:JRBaseBand.java   
@Override
public SplitTypeEnum getSplitTypeValue()
{
    return splitTypeValue;
}
项目:jasperreports    文件:JRDesignBand.java   
@Override
public SplitTypeEnum getSplitTypeValue()
{
    return splitTypeValue;
}
项目:jasperreports    文件:JRFillBand.java   
/**
 *
 */
protected JRFillBand(
    JRBaseFiller filler,
    JRBand band,
    JRFillObjectFactory factory
    )
{
    super(filler, band, factory);

    parent = band;

    // we need to do this before setBand()
    returnValuesSet = new LinkedHashSet<FillReturnValues>();

    if (deepElements.length > 0)
    {
        for(int i = 0; i < deepElements.length; i++)
        {
            deepElements[i].setBand(this);
        }
    }

    List<ExpressionReturnValue> expRetValues = getReturnValues();
    returnValues = 
        new FillReturnValues(
            expRetValues == null ? null : (ExpressionReturnValue[]) expRetValues.toArray(new ExpressionReturnValue[expRetValues.size()]), //FIXMERETURN make special class for constructor differentiation
            factory, 
            filler
            );
    registerReturnValues(returnValues);

    splitType = (parent == null ? null : parent.getSplitTypeValue());
    if (splitType == null)
    {
        splitType = 
            SplitTypeEnum.getByName(
                filler.getPropertiesUtil().getProperty(filler.getMainDataset(), JRBand.PROPERTY_SPLIT_TYPE)
                );
    }

    breakHeight = getHeight();
    if (
        SplitTypeEnum.IMMEDIATE == getSplitTypeValue()
        && elements != null && elements.length > 0
        )
    {
        for(int i = 0; i < elements.length; i++)
        {
            JRElement element = elements[i];
            int bottom = element.getY() + element.getHeight();
            breakHeight = bottom < breakHeight ? bottom : breakHeight;
        }
    }

    initElements();

    initConditionalStyles();

    nowEvaluationTimes = new HashSet<JREvaluationTime>();
}
项目:jasperreports    文件:JRFillBand.java   
@Override
public SplitTypeEnum getSplitTypeValue()
{
    return splitType;
}
项目:jasperreports    文件:JRFillBand.java   
@Override
public void setSplitType(SplitTypeEnum splitType)
{
    throw new UnsupportedOperationException();
}
项目:jasperreports    文件:JRFillBand.java   
/**
 *
 */
protected boolean isSplitPrevented()
{
    return SplitTypeEnum.PREVENT == getSplitTypeValue();
}
项目:jasperreports    文件:TableReport.java   
protected void addSummaryGroup(List<FillColumn> fillColumns)
{
    JRDesignGroup summaryGroup = new JRDesignGroup();
    summaryGroup.setName(SUMMARY_GROUP_NAME);//TODO check for uniqueness

    JRDesignBand groupFooter = new JRDesignBand();
    groupFooter.setSplitType(SplitTypeEnum.PREVENT);
    groupFooter.setHeight(pageFooter.getHeight());

    // we need to put everything in a frame so that we can tell the frame
    // not to print when there are no detail bands on the current page
    // 
    // we can't do that directly to the band since its print when expression
    // is evaluated too soon
    JRDesignFrame footerFrame = new JRDesignFrame();
    UUID uuid = DigestUtils.instance().deriveUUID(
            fillContext.getComponentElement().getUUID(), 
            BandTypeEnum.GROUP_FOOTER + "-" + SUMMARY_GROUP_NAME);
    footerFrame.setUUID(uuid);
    footerFrame.setX(0);
    footerFrame.setY(0);
    footerFrame.setWidth(computeTableWidth(fillColumns));
    footerFrame.setHeight(pageFooter.getHeight());
    footerFrame.getLineBox().setPadding(0);
    footerFrame.getLineBox().getPen().setLineWidth(0f);
    footerFrame.setRemoveLineWhenBlank(true);

    JRDesignExpression footerPrintWhen = builtinEvaluatorFactory.createExpression(new SummaryGroupFooterPrintWhenEvaluator());
    footerFrame.setPrintWhenExpression(footerPrintWhen);

    // clone the contents of the page footer in the frame
    List<JRChild> footerElements = pageFooter.getChildren();
    for (Iterator<JRChild> iterator = footerElements.iterator(); iterator
            .hasNext();)
    {
        JRChild child = iterator.next();
        JRChild childClone = (JRChild) child.clone(footerFrame);
        if (childClone instanceof JRElement)
        {
            footerFrame.addElement((JRElement) childClone);
        }
        else if (childClone instanceof JRElementGroup)
        {
            footerFrame.addElementGroup((JRElementGroup) childClone);
        }
        else
        {
            throw 
                new JRRuntimeException(
                    EXCEPTION_MESSAGE_KEY_UNKNOWN_CHILD_TYPE,  
                    new Object[]{childClone.getClass().getName()} 
                    );
        }
    }

    groupFooter.addElement(footerFrame);
    ((JRDesignSection) summaryGroup.getGroupFooterSection()).addBand(groupFooter);

    mainDataset.addScriptlet(TABLE_SCRIPTLET_NAME, TableReportScriptlet.class);
    mainDataset.addFirstGroup(summaryGroup);
}
项目:jasperreports    文件:JRBand.java   
/**
 * Specifies the band split behavior.
 */
public SplitTypeEnum getSplitTypeValue();
项目:jasperreports    文件:JRBand.java   
/**
 *
 */
public void setSplitType(SplitTypeEnum splitType);