Java 类net.sf.jasperreports.engine.JROrigin 实例源码

项目:jasperreports    文件:FillPartPrintOutput.java   
public FillPartPrintOutput(BaseReportFiller filler)
{
    parts = new TreeMap<Integer, PrintPart>();
    pages = new ArrayList<JRPrintPage>();

    delayedActions = new DelayedFillActions(filler);
    delayedActions.createDelayedEvaluationTime(JREvaluationTime.EVALUATION_TIME_MASTER);
    if (log.isDebugEnabled())
    {
        log.debug(this + " created delayed actions " + delayedActions.getId());
    }

    if (filler.getFillContext().isCollectingBookmarks())
    {
        bookmarkHelper = new BookmarkHelper(true);
    }

    styles = new LinkedHashMap<String, JRStyle>();
    origins = new LinkedHashSet<JROrigin>();
}
项目:jasperreports    文件:JROriginFactory.java   
@Override
public Object createObject(Attributes atts)
{
    return 
        new JROrigin(
            atts.getValue(JRXmlConstants.ATTRIBUTE_report),
            atts.getValue(JRXmlConstants.ATTRIBUTE_group),
            BandTypeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_band))
            );
}
项目:jasperreports    文件:JRDesignGroup.java   
protected void setSectionOrigin(JRSection section, BandTypeEnum type)
{
    if (section instanceof JRDesignSection)
    {
        JROrigin origin = new JROrigin(null, getName(), type);
        ((JRDesignSection) section).setOrigin(origin);
    }
}
项目:jasperreports    文件:JRDesignGroup.java   
protected void setBandOrigin(JRBand band, BandTypeEnum type)
{
    if (band instanceof JRDesignBand)
    {
        JROrigin origin = new JROrigin(null, getName(), type);
        ((JRDesignBand) band).setOrigin(origin);
    }
}
项目:jasperreports    文件:JRDesignSection.java   
/**
 *
 */
protected void setOrigin(JROrigin origin)
{
    this.origin = origin;

    if (bandsList != null && bandsList.size() > 0)
    {
        for (Iterator<JRBand> it = bandsList.iterator(); it.hasNext();)
        {
            JRDesignBand band = (JRDesignBand)it.next();
            band.setOrigin(origin);
        }
    }
}
项目:jasperreports    文件:JasperDesign.java   
@SuppressWarnings("deprecation")
public JasperDesign(JasperReportsContext context)
{
    setMainDataset(new JRDesignDataset(context, true));

    detailSection = new JRDesignSection(new JROrigin(BandTypeEnum.DETAIL));
}
项目:jasperreports    文件:JasperDesign.java   
protected void setBandOrigin(JRBand band, BandTypeEnum type)
{
    if (band instanceof JRDesignBand)
    {
        JROrigin origin = new JROrigin(type);
        ((JRDesignBand) band).setOrigin(origin);
    }
}
项目:jasperreports    文件:JasperDesign.java   
protected void setSectionOrigin(JRSection section, BandTypeEnum type)
{
    if (section instanceof JRDesignSection)
    {
        JROrigin origin = new JROrigin(type);
        ((JRDesignSection) section).setOrigin(origin);
    }
}
项目:jasperreports    文件:JRXmlExporter.java   
/**
 * @throws IOException 
 */
protected void exportOrigin(JROrigin origin) throws IOException
{
    xmlWriter.startElement(JRXmlConstants.ELEMENT_origin);
    xmlWriter.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_report, origin.getReportName());
    xmlWriter.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_group, origin.getGroupName());
    xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_band, origin.getBandTypeValue());
    xmlWriter.closeElement();
}
项目:jasperreports    文件:JROriginExporterFilter.java   
@Override
public boolean isToExport(JRPrintElement element)
{
    JROrigin origin = element.getOrigin();

    Boolean keepFirst = null;

    if (origin != null)
    {
        keepFirst = matchedOrigins.get(origin);

        if (keepFirst == null)
        {
            for (JROrigin originToExclude : originsToExclude.keySet())
            {
                if (match(originToExclude, origin))
                {
                    keepFirst = originsToExclude.get(originToExclude);
                    matchedOrigins.put(origin, keepFirst);
                    break;
                }
            }
        }
    }

    boolean originMatched = keepFirst != null;

    return
        !originMatched 
        || (keepFirst.booleanValue() 
            && isFirst(element));
}
项目:jasperreports    文件:JROriginExporterFilter.java   
public boolean match(JROrigin originToExclude, JROrigin origin)
{
    String groupName1 = originToExclude.getGroupName();
    String reportName1 = originToExclude.getReportName();
    String groupName2 = origin.getGroupName();
    String reportName2 = origin.getReportName();
    return (
        originToExclude.getBandTypeValue() == origin.getBandTypeValue()
        && (("*".equals(groupName1) && groupName2 != null) || (groupName1 == null ? groupName2 == null : groupName2 != null && groupName1.equals(groupName2)))
        && (("*".equals(reportName1) && reportName2 != null) || (reportName1 == null ? reportName2 == null : reportName2 != null && reportName1.equals(reportName2)))
        );
}
项目:jasperreports    文件:JROriginExporterFilter.java   
private static JROriginExporterFilter addOriginsToFilter(
    JasperReportsContext jasperReportsContext,
    JROriginExporterFilter filter, 
    JRPropertiesMap propertiesMap, 
    String originFilterPrefix,
    boolean keepFirst
    )
{
    JRPropertiesUtil propUtil = JRPropertiesUtil.getInstance(jasperReportsContext);
    List<PropertySuffix> properties = propUtil.getProperties(originFilterPrefix + BAND_PREFIX);
    properties.addAll(JRPropertiesUtil.getProperties(propertiesMap, originFilterPrefix + BAND_PREFIX));

    if (!properties.isEmpty())
    {
        filter = (filter == null ? new JROriginExporterFilter(): filter);

        for(Iterator<PropertySuffix> it = properties.iterator(); it.hasNext();)
        {
            PropertySuffix propertySuffix = it.next();
            String suffix = propertySuffix.getSuffix();
            String propValue = propUtil.getProperty(propertiesMap, propertySuffix.getKey());
            BandTypeEnum bandType = BandTypeEnum.getByName(propValue == null ? null : propValue.trim());
            if (bandType != null)
            {
                filter.addOrigin(
                    new JROrigin(
                        propUtil.getProperty(propertiesMap, originFilterPrefix + REPORT_PREFIX + suffix),
                        propUtil.getProperty(propertiesMap, originFilterPrefix + GROUP_PREFIX + suffix),
                        bandType
                        ),
                    keepFirst
                    );
            }
        }
    }

    return filter;
}
项目:jasperreports    文件:JRFillSection.java   
/**
 *
 */
protected void setOrigin(JROrigin origin)
{
    this.origin = origin;

    if (bands.length > 0)
    {
        for (int i = 0; i < bands.length; i++)
        {
            bands[i].setOrigin(origin);
        }
    }

    this.filler.getJasperPrint().addOrigin(origin);//FIXMESECTION detail origin appears even if empty
}
项目:jasperreports    文件:JRTemplateGraphicElement.java   
/**
 *
 */
protected JRTemplateGraphicElement(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRGraphicElement graphicElement)
{
    super(origin, defaultStyleProvider);

    setGraphicElement(graphicElement);
}
项目:jasperreports    文件:JRTemplateLine.java   
/**
 *
 */
protected JRTemplateLine(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRLine line)
{
    super(origin, defaultStyleProvider);

    setLine(line);
}
项目:jasperreports    文件:JRFillBand.java   
/**
 *
 */
protected void setOrigin(JROrigin origin)
{
    if (log.isDebugEnabled())
    {
        log.debug("Origin " + origin + " for band " + getId());
    }

    this.origin = origin;
    this.filler.getJasperPrint().addOrigin(origin);
}
项目:jasperreports    文件:JRTemplateElement.java   
/**
 *
 */
protected JRTemplateElement(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider)
{
    this.origin = origin;
    this.defaultStyleProvider = defaultStyleProvider;
    id = createId();
}
项目:jasperreports    文件:JRTemplateEllipse.java   
/**
 *
 */
protected JRTemplateEllipse(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JREllipse ellipse)
{
    super(origin, defaultStyleProvider);

    setEllipse(ellipse);
}
项目:jasperreports    文件:JRTemplateRectangle.java   
/**
 *
 */
protected JRTemplateRectangle(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRRectangle rectangle)
{
    super(origin, defaultStyleProvider);

    setRectangle(rectangle);
}
项目:jasperreports    文件:JRTemplateRectangle.java   
/**
 *
 */
protected JRTemplateRectangle(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRSubreport subreport)
{
    super(origin, defaultStyleProvider);

    setSubreport(subreport);
}
项目:jasperreports    文件:JRTemplateText.java   
/**
 *
 */
protected JRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRStaticText staticText)
{
    super(origin, defaultStyleProvider);

    setStaticText(staticText);
}
项目:jasperreports    文件:JRTemplateText.java   
/**
 *
 */
protected JRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRTextField textField)
{
    super(origin, defaultStyleProvider);

    setTextField(textField);
}
项目:jasperreports    文件:JRTemplateText.java   
/**
 * Creates a template text.
 * 
 * @param origin the origin of the elements that will use this template
 * @param defaultStyleProvider the default style provider to use for
 * this template
 */
public JRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider)
{
    super(origin, defaultStyleProvider);

    lineBox = new JRBaseLineBox(this);
    paragraph = new JRBaseParagraph(this);
}
项目:jasperreports    文件:JRTemplateGenericElement.java   
protected JRTemplateGenericElement(JROrigin origin, 
        JRDefaultStyleProvider defaultStyleProvider, JRGenericElement element)
{
    super(origin, defaultStyleProvider);

    setElement(element);
    setGenericType(element.getGenericType());
}
项目:jasperreports    文件:JRTemplateGenericElement.java   
/**
 * Creates a generic print element template.
 * 
 * @param origin the origin of the elements that will use the template
 * @param defaultStyleProvider the style provider to be used for the elements
 * @param genericType the type of the generic elements
 */
public JRTemplateGenericElement(JROrigin origin, 
        JRDefaultStyleProvider defaultStyleProvider,
        JRGenericElementType genericType)
{
    super(origin, defaultStyleProvider);

    setGenericType(genericType);
}
项目:jasperreports    文件:JRTemplateGenericElement.java   
/**
 * Creates a generic print element template.
 * 
 * @param origin the origin of the elements that will use the template
 * @param defaultStyleProvider the style provider to be used for the elements
 * @param element an element to copy basic elements from
 * @param genericType the type of the generic elements
 */
public JRTemplateGenericElement(JROrigin origin, 
        JRDefaultStyleProvider defaultStyleProvider,
        JRElement element,
        JRGenericElementType genericType)
{
    super(origin, defaultStyleProvider);

    setElement(element);
    setGenericType(genericType);
}
项目:jasperreports    文件:JRTemplateFrame.java   
/**
 * Creates a template frame for a crosstab cell.
 * 
 * @param cell the cell
 */
public JRTemplateFrame(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRFillCellContents cell)
{
    super(origin, defaultStyleProvider);

    //FIXME properties?
    parentStyle = cell.getStyle();

    setBackcolor(cell.getBackcolor());
    setMode(cell.getModeValue());
    copyBox(cell.getLineBox());
}
项目:jasperreports    文件:JRTemplateFrame.java   
/**
 * Creates a template frame for a frame.
 * 
 * @param frame the frame
 */
public JRTemplateFrame(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRFillFrame frame)
{
    super(origin, defaultStyleProvider);

    setElement(frame);

    copyBox(frame.getLineBox());
}
项目:jasperreports    文件:JRBaseFiller.java   
private JRFillBand createFillBand(JRBand reportBand, String reportName, BandTypeEnum bandType)
{
    JRFillBand fillBand = factory.getBand(reportBand);
    if (fillBand != missingFillBand)
    {
        JROrigin origin = new JROrigin(reportName, bandType);
        fillBand.setOrigin(origin);
    }
    return fillBand;
}
项目:jasperreports    文件:JRTemplateImage.java   
/**
 *
 */
protected JRTemplateImage(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRImage image)
{
    super(origin, defaultStyleProvider);

    setImage(image);
}
项目:jasperreports    文件:JRTemplateImage.java   
/**
 *
 */
protected JRTemplateImage(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRChart chart)
{
    super(origin, defaultStyleProvider);

    setChart(chart);
}
项目:jasperreports    文件:JRTemplateImage.java   
/**
 * Creates a template image.
 * 
 * @param origin the origin of the elements that will use this template
 * @param defaultStyleProvider the default style provider to use for
 * this template
 */
public JRTemplateImage(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider)
{
    super(origin, defaultStyleProvider);

    this.lineBox = new JRBaseLineBox(this);
    this.linePen = new JRBasePen(this);
}
项目:jasperreports    文件:PartReportFiller.java   
@Override
public void addOrigins(Collection<JROrigin> origins)
{
    for (JROrigin origin : origins)
    {
        jasperPrint.addOrigin(origin);
    }
}
项目:jasperreports    文件:JRFillElement.java   
protected JROrigin getElementOrigin()
{
    JROrigin elementOrigin = null;
    if (originProvider != null)
    {
        elementOrigin = originProvider.getOrigin();
    }
    return elementOrigin;
}
项目:jasperreports    文件:TableReportGroup.java   
protected JRSection wrapBand(JRBand band, BandTypeEnum bandType)
{
    if (band == null)
    {
        return null;
    }

    JROrigin origin = new JROrigin(null, getName(), bandType);
    JRDesignSection section = new JRDesignSection(origin);
    section.addBand(band);
    return section;
}
项目:ireport-fork    文件:ModelUtils.java   
public static String nameOf(JROrigin origin) {
    if (origin != null)
    {
        switch (origin.getBandTypeValue())
        {
            case BACKGROUND: return I18n.getString("band.name.background");
            case TITLE: return I18n.getString("band.name.title");
            case PAGE_HEADER: return I18n.getString("band.name.pageHeader");
            case COLUMN_HEADER: return I18n.getString("band.name.columnHeader");
            case DETAIL: return I18n.getString("band.name.detail");
            case COLUMN_FOOTER: return I18n.getString("band.name.columnFooter");
            case PAGE_FOOTER: return I18n.getString("band.name.pageFooter");
            case LAST_PAGE_FOOTER: return I18n.getString("band.name.lastPageFooter");
            case SUMMARY: return I18n.getString("band.name.summary");
            case NO_DATA: return I18n.getString("band.name.noData");
            case GROUP_HEADER:
            {
                // Find the section number
                return  I18n.getString("band.name.GroupHeader", origin.getGroupName());
            }
            case GROUP_FOOTER:
            {
                return  I18n.getString("band.name.GroupFooter", origin.getGroupName());
            }
        }
    }

    return I18n.getString("ModelUtils.Title.unknow");

}
项目:jasperreports    文件:JRBasePrintElement.java   
@Override
public JROrigin getOrigin()
{
    return origin;
}
项目:jasperreports    文件:JRBasePrintElement.java   
/**
 *
 */
public void setOrigin(JROrigin origin)
{
    this.origin = origin;
}
项目:jasperreports    文件:FillPartPrintOutput.java   
@Override
public void addOrigins(Collection<JROrigin> origins)
{
    this.origins.addAll(origins);
}
项目:jasperreports    文件:FillPartPrintOutput.java   
public Collection<JROrigin> getOrigins()
{
    return origins;
}