DRDesignBand class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignBand implements DRIDesignBand { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + private SplitType splitType; + private DRDesignList list; + private DRDesignComponent bandComponent; + private Integer height; + private DRIDesignExpression printWhenExpression; + + /** + *Constructor for DRDesignBand.
+ * + * @param name a {@link java.lang.String} object. + */ + public DRDesignBand(String name) { + this.name = name; + } + + /** {@inheritDoc} */ + @Override + public String getName() { + return name; + } + + /** {@inheritDoc} */ + @Override + public SplitType getSplitType() { + return splitType; + } + + /** + *Setter for the field splitType
.
Setter for the field list
.
addComponent.
+ * + * @param component a {@link software.xdev.dynamicreports.design.base.component.DRDesignComponent} object. + */ + public void addComponent(DRDesignComponent component) { + list.addComponent(component); + } + + /** + *addComponent.
+ * + * @param index a int. + * @param component a {@link software.xdev.dynamicreports.design.base.component.DRDesignComponent} object. + */ + public void addComponent(int index, DRDesignComponent component) { + list.addComponent(index, component); + } + + /** {@inheritDoc} */ + @Override + public DRDesignComponent getBandComponent() { + return bandComponent; + } + + /** + *Setter for the field bandComponent
.
Setter for the field height
.
Setter for the field printWhenExpression
.
DRDesignDataset class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignDataset implements DRIDesignDataset { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + private DatasetExpressionTransform datasetExpressionTransform; + private DRDesignQuery query; + private DRIDesignExpression connectionExpression; + private DRIDesignExpression dataSourceExpression; + private DRIDesignExpression filterExpression; + + /** + *Constructor for DRDesignDataset.
+ * + * @param datasetExpressionTransform a {@link software.xdev.dynamicreports.design.transformation.DatasetExpressionTransform} object. + */ + public DRDesignDataset(DatasetExpressionTransform datasetExpressionTransform) { + this.datasetExpressionTransform = datasetExpressionTransform; + this.name = ReportUtils.generateUniqueName("dataset"); + } + + /** {@inheritDoc} */ + @Override + public String getName() { + return name; + } + + /** + *Getter for the field datasetExpressionTransform
.
Setter for the field query
.
Setter for the field connectionExpression
.
Setter for the field dataSourceExpression
.
Setter for the field filterExpression
.
DRDesignField class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignField implements DRIDesignField { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + private Class> valueClass; + private boolean external; + private String description; + + /** + *Constructor for DRDesignField.
+ */ + public DRDesignField() { + this.external = false; + } + + /** {@inheritDoc} */ + @Override + public String getName() { + return name; + } + + /** + *Setter for the field name
.
Setter for the field valueClass
.
Setter for the field external
.
Setter for the field description
.
DRDesignGroup class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignGroup implements DRIDesignGroup { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + private DRIDesignExpression groupExpression; + private ListConstructor for DRDesignGroup.
+ * + * @param name a {@link java.lang.String} object. + */ + public DRDesignGroup(String name) { + this.name = name; + init(); + } + + private void init() { + headerBands = new ArrayListSetter for the field groupExpression
.
Setter for the field headerBands
.
addHeaderBand.
+ * + * @param headerBand a {@link software.xdev.dynamicreports.design.base.DRDesignBand} object. + */ + public void addHeaderBand(DRDesignBand headerBand) { + this.headerBands.add(headerBand); + } + + /** {@inheritDoc} */ + @Override + public ListSetter for the field footerBands
.
addFooterBand.
+ * + * @param footerBand a {@link software.xdev.dynamicreports.design.base.DRDesignBand} object. + */ + public void addFooterBand(DRDesignBand footerBand) { + this.footerBands.add(footerBand); + } + + /** + *addFooterBand.
+ * + * @param index a int. + * @param footerBand a {@link software.xdev.dynamicreports.design.base.DRDesignBand} object. + */ + public void addFooterBand(int index, DRDesignBand footerBand) { + this.footerBands.add(index, footerBand); + } + + /** {@inheritDoc} */ + @Override + public boolean isStartInNewPage() { + return startInNewPage; + } + + /** + *Setter for the field startInNewPage
.
Setter for the field startInNewColumn
.
Setter for the field reprintHeaderOnEachPage
.
Setter for the field resetPageNumber
.
Setter for the field minHeightToStartNewPage
.
Setter for the field footerPosition
.
Setter for the field keepTogether
.
Setter for the field headerWithSubtotal
.
DRDesignHyperLink class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignHyperLink implements DRIDesignHyperLink { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRIDesignExpression anchorExpression; + private DRIDesignExpression pageExpression; + private DRIDesignExpression referenceExpression; + private DRIDesignExpression tooltipExpression; + private String hyperLinkType; + private String hyperLinkTarget; + + /** {@inheritDoc} */ + @Override + public DRIDesignExpression getAnchorExpression() { + return anchorExpression; + } + + /** + *Setter for the field anchorExpression
.
Setter for the field pageExpression
.
Setter for the field referenceExpression
.
Setter for the field tooltipExpression
.
setType.
+ * + * @param hyperLinkType a {@link java.lang.String} object. + */ + public void setType(String hyperLinkType) { + this.hyperLinkType = hyperLinkType; + } + + /** {@inheritDoc} */ + @Override + public String getTarget() { + return hyperLinkTarget; + } + + /** + *setTarget.
+ * + * @param hyperLinkTarget a {@link java.lang.String} object. + */ + public void setTarget(String hyperLinkTarget) { + this.hyperLinkTarget = hyperLinkTarget; + } + +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/DRDesignMargin.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/DRDesignMargin.java new file mode 100644 index 0000000..b4bf8f0 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/DRDesignMargin.java @@ -0,0 +1,96 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRDesignMargin class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignMargin implements DRIDesignMargin { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private int top; + private int left; + private int bottom; + private int right; + + /** {@inheritDoc} */ + @Override + public int getTop() { + return top; + } + + /** + *Setter for the field top
.
Setter for the field left
.
Setter for the field bottom
.
Setter for the field right
.
DRDesignPage class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignPage implements DRIDesignPage { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private int width; + private int height; + private PageOrientation orientation; + private DRDesignMargin margin; + private int columnsPerPage; + private int columnSpace; + private int columnWidth; + + /** {@inheritDoc} */ + @Override + public int getWidth() { + return width; + } + + /** + *Setter for the field width
.
Setter for the field height
.
Setter for the field orientation
.
Setter for the field margin
.
Setter for the field columnsPerPage
.
Setter for the field columnSpace
.
Setter for the field columnWidth
.
DRDesignParameter class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignParameter implements DRIDesignParameter { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + private Class> valueClass; + private Object value; + private boolean external; + + /** {@inheritDoc} */ + @Override + public String getName() { + return name; + } + + /** + *Setter for the field name
.
Setter for the field valueClass
.
Setter for the field value
.
Setter for the field external
.
DRDesignQuery class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignQuery implements DRIDesignQuery { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String text; + private String language; + + /** {@inheritDoc} */ + @Override + public String getText() { + return text; + } + + /** + *Setter for the field text
.
Setter for the field language
.
DRDesignReport class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignReport implements DesignTransformAccessor, DRIDesignReport { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private final DRIReport report; + private final Integer pageWidth; + private final MapConstructor for DRDesignReport.
+ * + * @param report a {@link software.xdev.dynamicreports.report.definition.DRIReport} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public DRDesignReport(final DRIReport report) throws DRException { + this(report, null, null); + } + + /** + *Constructor for DRDesignReport.
+ * + * @param report a {@link software.xdev.dynamicreports.report.definition.DRIReport} object. + * @param pageWidth a {@link java.lang.Integer} object. + * @param tocHeadings a {@link java.util.Map} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public DRDesignReport(final DRIReport report, final Integer pageWidth, final MapDRDesignSort class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignSort implements DRIDesignSort { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRIDesignExpression expression; + private OrderType orderType; + + /** {@inheritDoc} */ + @Override + public DRIDesignExpression getExpression() { + return expression; + } + + /** + *Setter for the field expression
.
Setter for the field orderType
.
DRDesignTableOfContentsHeading class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignTableOfContentsHeading implements DRIDesignTableOfContentsHeading { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRDesignTextField referenceField; + + /** {@inheritDoc} */ + @Override + public DRDesignTextField getReferenceField() { + return referenceField; + } + + /** + *Setter for the field referenceField
.
DRDesignTemplateDesign class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignTemplateDesign implements DRIDesignTemplateDesign { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRITemplateDesign> templateDesign; + + /** + *Constructor for DRDesignTemplateDesign.
+ * + * @param templateDesign a {@link software.xdev.dynamicreports.report.definition.DRITemplateDesign} object. + */ + public DRDesignTemplateDesign(DRITemplateDesign> templateDesign) { + this.templateDesign = templateDesign; + } + + /** {@inheritDoc} */ + @Override + public int getTitleComponentsCount() { + return templateDesign.getTitleComponentsCount(); + } + + /** {@inheritDoc} */ + @Override + public int getPageHeaderComponentsCount() { + return templateDesign.getPageHeaderComponentsCount(); + } + + /** {@inheritDoc} */ + @Override + public int getPageFooterComponentsCount() { + return templateDesign.getPageFooterComponentsCount(); + } + + /** {@inheritDoc} */ + @Override + public int getColumnHeaderComponentsCount() { + return templateDesign.getColumnHeaderComponentsCount(); + } + + /** {@inheritDoc} */ + @Override + public int getColumnFooterComponentsCount() { + return templateDesign.getColumnFooterComponentsCount(); + } + + /** {@inheritDoc} */ + @Override + public int getLastPageFooterComponentsCount() { + return templateDesign.getLastPageFooterComponentsCount(); + } + + /** {@inheritDoc} */ + @Override + public int getSummaryComponentsCount() { + return templateDesign.getSummaryComponentsCount(); + } + + /** {@inheritDoc} */ + @Override + public int getNoDataComponentsCount() { + return templateDesign.getNoDataComponentsCount(); + } + + /** {@inheritDoc} */ + @Override + public int getBackgroundComponentsCount() { + return templateDesign.getBackgroundComponentsCount(); + } + + /** {@inheritDoc} */ + @Override + public Object getDesign() throws DRException { + return templateDesign.getDesign(); + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/DRDesignVariable.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/DRDesignVariable.java new file mode 100644 index 0000000..0372080 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/DRDesignVariable.java @@ -0,0 +1,145 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRDesignVariable class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignVariable implements DRIDesignVariable { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + private DRIDesignExpression valueExpression; + private DRIDesignExpression initialValueExpression; + private Calculation calculation; + private ResetType resetType; + private DRDesignGroup resetGroup; + + /** + *Constructor for DRDesignVariable.
+ */ + public DRDesignVariable() { + this.name = ReportUtils.generateUniqueName("variable"); + } + + /** + *Constructor for DRDesignVariable.
+ * + * @param name a {@link java.lang.String} object. + */ + public DRDesignVariable(String name) { + this.name = name; + } + + /** {@inheritDoc} */ + @Override + public String getName() { + return name; + } + + /** {@inheritDoc} */ + @Override + public DRIDesignExpression getValueExpression() { + return valueExpression; + } + + /** + *Setter for the field valueExpression
.
Setter for the field initialValueExpression
.
Setter for the field calculation
.
Setter for the field resetType
.
Setter for the field resetGroup
.
DRDesignBreak class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignBreak extends DRDesignComponent implements DRIDesignBreak { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private BreakType breakType; + + /** + *Constructor for DRDesignBreak.
+ */ + public DRDesignBreak() { + super("break"); + } + + /** {@inheritDoc} */ + @Override + public BreakType getType() { + return breakType; + } + + /** + *setType.
+ * + * @param breakType a {@link software.xdev.dynamicreports.report.constant.BreakType} object. + */ + public void setType(BreakType breakType) { + this.breakType = breakType; + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/component/DRDesignComponent.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/component/DRDesignComponent.java new file mode 100644 index 0000000..4b36819 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/component/DRDesignComponent.java @@ -0,0 +1,308 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeAbstract DRDesignComponent class.
+ * + * @author Ricardo Mariaca + * + */ +public abstract class DRDesignComponent implements DRIDesignComponent { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + private String uniqueName; + private DRDesignStyle style; + private Integer x; + private Integer y; + private Integer width; + private Integer height; + private DRIDesignExpression printWhenExpression; + private boolean isRemoveLineWhenBlank; + private ListConstructor for DRDesignComponent.
+ * + * @param name a {@link java.lang.String} object. + */ + protected DRDesignComponent(String name) { + this.name = name; + this.uniqueName = name; + init(); + } + + /** + *init.
+ */ + protected void init() { + propertyExpressions = new ArrayListSetter for the field uniqueName
.
Setter for the field style
.
Setter for the field x
.
Setter for the field y
.
Setter for the field width
.
Setter for the field height
.
Setter for the field printWhenExpression
.
setRemoveLineWhenBlank.
+ * + * @param isRemoveLineWhenBlank a boolean. + */ + public void setRemoveLineWhenBlank(boolean isRemoveLineWhenBlank) { + this.isRemoveLineWhenBlank = isRemoveLineWhenBlank; + } + + /** {@inheritDoc} */ + @Override + public ListSetter for the field propertyExpressions
.
Setter for the field positionType
.
Setter for the field stretchType
.
Setter for the field printInFirstWholeBand
.
Setter for the field printWhenDetailOverflows
.
Setter for the field printWhenGroupChanges
.
Setter for the field tableOfContentsHeading
.
DRDesignEllipse class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignEllipse extends DRDesignComponent implements DRIDesignEllipse { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRDesignPen pen; + + /** + *Constructor for DRDesignEllipse.
+ */ + public DRDesignEllipse() { + super("ellipse"); + } + + /** {@inheritDoc} */ + @Override + public DRDesignPen getPen() { + return pen; + } + + /** + *Setter for the field pen
.
DRDesignFiller class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignFiller extends DRDesignComponent implements DRIDesignFiller { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + /** + *Constructor for DRDesignFiller.
+ */ + public DRDesignFiller() { + super("filler"); + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/component/DRDesignGenericElement.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/component/DRDesignGenericElement.java new file mode 100644 index 0000000..2c274dc --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/component/DRDesignGenericElement.java @@ -0,0 +1,132 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRDesignGenericElement class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignGenericElement extends DRDesignComponent implements DRIDesignGenericElement { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String genericElementNamespace; + private String genericElementName; + private EvaluationTime evaluationTime; + private DRDesignGroup evaluationGroup; + private ListConstructor for DRDesignGenericElement.
+ */ + public DRDesignGenericElement() { + super("genericElement"); + } + + /** {@inheritDoc} */ + @Override + protected void init() { + super.init(); + parameterExpressions = new ArrayListSetter for the field genericElementNamespace
.
Setter for the field genericElementName
.
Setter for the field evaluationTime
.
Setter for the field evaluationGroup
.
Setter for the field parameterExpressions
.
Abstract DRDesignHyperlinkComponent class.
+ * + * @author Ricardo Mariaca + * + */ +public abstract class DRDesignHyperlinkComponent extends DRDesignComponent implements DRIDesignHyperLinkComponent { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRIDesignExpression anchorNameExpression; + private Integer bookmarkLevel; + private DRDesignHyperLink hyperLink; + + /** + *Constructor for DRDesignHyperlinkComponent.
+ * + * @param name a {@link java.lang.String} object. + */ + public DRDesignHyperlinkComponent(String name) { + super(name); + } + + /** {@inheritDoc} */ + @Override + public DRIDesignExpression getAnchorNameExpression() { + return anchorNameExpression; + } + + /** + *Setter for the field anchorNameExpression
.
Setter for the field bookmarkLevel
.
Setter for the field hyperLink
.
DRDesignImage class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignImage extends DRDesignHyperlinkComponent implements DRIDesignImage { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private ImageScale imageScale; + private DRIDesignExpression imageExpression; + private Boolean usingCache; + private Boolean lazy; + private HorizontalImageAlignment horizontalImageAlignment; + + /** + *Constructor for DRDesignImage.
+ */ + public DRDesignImage() { + super("image"); + } + + /** {@inheritDoc} */ + @Override + public DRIDesignExpression getImageExpression() { + return imageExpression; + } + + /** + *Setter for the field imageExpression
.
Setter for the field imageScale
.
Setter for the field usingCache
.
Setter for the field lazy
.
Setter for the field horizontalImageAlignment
.
DRDesignLine class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignLine extends DRDesignComponent implements DRIDesignLine { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private LineDirection direction; + private DRDesignPen pen; + + /** + *Constructor for DRDesignLine.
+ */ + public DRDesignLine() { + super("line"); + } + + /** {@inheritDoc} */ + @Override + public LineDirection getDirection() { + return direction; + } + + /** + *Setter for the field direction
.
Setter for the field pen
.
DRDesignList class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignList extends DRDesignComponent implements DRIDesignList { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private ListConstructor for DRDesignList.
+ */ + public DRDesignList() { + this(ListType.HORIZONTAL); + } + + /** + *Constructor for DRDesignList.
+ * + * @param type a {@link software.xdev.dynamicreports.report.constant.ListType} object. + */ + public DRDesignList(ListType type) { + super("list"); + this.type = type; + this.calculateComponents = true; + } + + /** {@inheritDoc} */ + @Override + protected void init() { + super.init(); + this.listCells = new ArrayListaddComponent.
+ * + * @param component a {@link software.xdev.dynamicreports.design.base.component.DRDesignComponent} object. + */ + public void addComponent(DRDesignComponent component) { + components.add(component); + listCells.add(new DRDesignListCell(component)); + } + + /** + *addComponent.
+ * + * @param index a int. + * @param component a {@link software.xdev.dynamicreports.design.base.component.DRDesignComponent} object. + */ + public void addComponent(int index, DRDesignComponent component) { + components.add(index, component); + listCells.add(index, new DRDesignListCell(component)); + } + + /** + *addComponent.
+ * + * @param index a int. + * @param horizontalAlignment a {@link software.xdev.dynamicreports.report.constant.HorizontalCellComponentAlignment} object. + * @param verticalAlignment a {@link software.xdev.dynamicreports.report.constant.VerticalCellComponentAlignment} object. + * @param component a {@link software.xdev.dynamicreports.design.base.component.DRDesignComponent} object. + */ + public void addComponent(int index, HorizontalCellComponentAlignment horizontalAlignment, VerticalCellComponentAlignment verticalAlignment, DRDesignComponent component) { + components.add(index, component); + listCells.add(index, new DRDesignListCell(horizontalAlignment, verticalAlignment, component)); + } + + /** + *addComponent.
+ * + * @param horizontalAlignment a {@link software.xdev.dynamicreports.report.constant.HorizontalCellComponentAlignment} object. + * @param verticalAlignment a {@link software.xdev.dynamicreports.report.constant.VerticalCellComponentAlignment} object. + * @param component a {@link software.xdev.dynamicreports.design.base.component.DRDesignComponent} object. + */ + public void addComponent(HorizontalCellComponentAlignment horizontalAlignment, VerticalCellComponentAlignment verticalAlignment, DRDesignComponent component) { + components.add(component); + listCells.add(new DRDesignListCell(horizontalAlignment, verticalAlignment, component)); + } + + /** + *Getter for the field listCells
.
isEmpty.
+ * + * @return a boolean. + */ + public boolean isEmpty() { + return components.isEmpty(); + } + + /** {@inheritDoc} */ + @Override + public ListType getType() { + return type; + } + + /** + *Setter for the field type
.
Setter for the field componentGroupType
.
Getter for the field gap
.
Setter for the field gap
.
isCalculateComponents.
+ * + * @return a boolean. + */ + public boolean isCalculateComponents() { + return calculateComponents; + } + + /** + *Setter for the field calculateComponents
.
isRemovable.
+ * + * @return a boolean. + */ + public boolean isRemovable() { + if (removable != null) { + return removable; + } else { + return ListType.VERTICAL.equals(type); + } + } + + /** + *Setter for the field removable
.
Setter for the field backgroundComponent
.
DRDesignListCell class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignListCell implements Serializable { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private HorizontalCellComponentAlignment horizontalAlignment; + private VerticalCellComponentAlignment verticalAlignment; + private DRDesignComponent component; + private Integer x; + private Integer y; + private Integer width; + private Integer height; + + /** + *Constructor for DRDesignListCell.
+ * + * @param component a {@link software.xdev.dynamicreports.design.base.component.DRDesignComponent} object. + */ + protected DRDesignListCell(DRDesignComponent component) { + this(null, null, component); + } + + /** + *Constructor for DRDesignListCell.
+ * + * @param horizontalAlignment a {@link software.xdev.dynamicreports.report.constant.HorizontalCellComponentAlignment} object. + * @param verticalAlignment a {@link software.xdev.dynamicreports.report.constant.VerticalCellComponentAlignment} object. + * @param component a {@link software.xdev.dynamicreports.design.base.component.DRDesignComponent} object. + */ + protected DRDesignListCell(HorizontalCellComponentAlignment horizontalAlignment, VerticalCellComponentAlignment verticalAlignment, DRDesignComponent component) { + this.horizontalAlignment = horizontalAlignment; + this.verticalAlignment = verticalAlignment; + this.component = component; + } + + /** + *Getter for the field horizontalAlignment
.
Setter for the field horizontalAlignment
.
Getter for the field verticalAlignment
.
Setter for the field verticalAlignment
.
Getter for the field component
.
Getter for the field x
.
Setter for the field x
.
Getter for the field y
.
Setter for the field y
.
Getter for the field width
.
Setter for the field width
.
Getter for the field height
.
Setter for the field height
.
DRDesignMap class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignMap extends DRDesignComponent implements DRIDesignMap { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private EvaluationTime evaluationTime; + private DRDesignGroup evaluationGroup; + private DRIDesignExpression latitudeExpression; + private DRIDesignExpression longitudeExpression; + private DRIDesignExpression zoomExpression; + + /** + *Constructor for DRDesignMap.
+ */ + public DRDesignMap() { + super("map"); + } + + /** {@inheritDoc} */ + @Override + public EvaluationTime getEvaluationTime() { + return evaluationTime; + } + + /** + *Setter for the field evaluationTime
.
Setter for the field evaluationGroup
.
Setter for the field latitudeExpression
.
Setter for the field longitudeExpression
.
Setter for the field zoomExpression
.
DRDesignRectangle class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignRectangle extends DRDesignComponent implements DRIDesignRectangle { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private Integer radius; + private DRDesignPen pen; + + /** + *Constructor for DRDesignRectangle.
+ */ + public DRDesignRectangle() { + super("rectangle"); + } + + /** {@inheritDoc} */ + @Override + public Integer getRadius() { + return radius; + } + + /** + *Setter for the field radius
.
Setter for the field pen
.
DRDesignSubreport class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignSubreport extends DRDesignComponent implements DRIDesignSubreport { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRIDesignExpression reportExpression; + private DRIDesignExpression parametersExpression; + private DRIDesignExpression connectionExpression; + private DRIDesignExpression dataSourceExpression; + private Boolean runToBottom; + + /** + *Constructor for DRDesignSubreport.
+ */ + public DRDesignSubreport() { + super("subreport"); + } + + /** {@inheritDoc} */ + @Override + public DRIDesignExpression getReportExpression() { + return reportExpression; + } + + /** + *Setter for the field reportExpression
.
Setter for the field parametersExpression
.
Setter for the field connectionExpression
.
Setter for the field dataSourceExpression
.
Setter for the field runToBottom
.
DRDesignTextField class.
+ * + * @author Ricardo Mariaca, Jan Moxter + * + */ +public class DRDesignTextField extends DRDesignHyperlinkComponent implements DRIDesignTextField { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String pattern; + private DRIDesignExpression patternExpression; + private HorizontalTextAlignment horizontalTextAlignment; + private DRIDesignExpression valueExpression; + private boolean printRepeatedValues; + private EvaluationTime evaluationTime; + private DRDesignGroup evaluationGroup; + private Markup markup; + private boolean stretchWithOverflow; + private TextAdjust textAdjust; + + + /** + *Constructor for DRDesignTextField.
+ */ + public DRDesignTextField() { + super("textField"); + } + + /** {@inheritDoc} */ + @Override + public String getPattern() { + return pattern; + } + + /** + *Setter for the field pattern
.
Setter for the field patternExpression
.
Setter for the field horizontalTextAlignment
.
Setter for the field valueExpression
.
Setter for the field printRepeatedValues
.
Setter for the field evaluationTime
.
Setter for the field evaluationGroup
.
Setter for the field markup
.
Setter for the field stretchWithOverflow
.
Setter for the field textAdjust
.
DRDesignCrosstab class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignCrosstab extends DRDesignComponent implements DRIDesignCrosstab { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRDesignCrosstabDataset dataset; + private Boolean repeatColumnHeaders; + private Boolean repeatRowHeaders; + private Integer columnBreakOffset; + private Boolean ignoreWidth; + private RunDirection runDirection; + private DRDesignCrosstabCellContent whenNoDataCell; + private DRDesignCrosstabCellContent headerCell; + private ListConstructor for DRDesignCrosstab.
+ */ + public DRDesignCrosstab() { + super("crosstab"); + } + + /** {@inheritDoc} */ + @Override + protected void init() { + super.init(); + columnGroups = new ArrayListSetter for the field dataset
.
Setter for the field repeatColumnHeaders
.
Setter for the field repeatRowHeaders
.
Setter for the field columnBreakOffset
.
Setter for the field ignoreWidth
.
Setter for the field runDirection
.
Setter for the field whenNoDataCell
.
Setter for the field headerCell
.
Setter for the field columnGroups
.
Setter for the field rowGroups
.
Setter for the field cells
.
Setter for the field measures
.
DRDesignCrosstabCell class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignCrosstabCell implements DRIDesignCrosstabCell { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + private String rowTotalGroup; + private String columnTotalGroup; + private DRDesignCrosstabCellContent content; + + /** {@inheritDoc} */ + @Override + public String getName() { + return name; + } + + /** + *Setter for the field name
.
Setter for the field rowTotalGroup
.
Setter for the field columnTotalGroup
.
Setter for the field content
.
DRDesignCrosstabCellContent class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignCrosstabCellContent implements DRIDesignCrosstabCellContent { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private int width; + private int height; + private DRDesignList list; + private DRDesignComponent component; + private DRIDesignStyle style; + + /** {@inheritDoc} */ + @Override + public int getWidth() { + return width; + } + + /** + *Setter for the field width
.
Setter for the field height
.
Getter for the field list
.
Setter for the field list
.
Setter for the field component
.
Setter for the field style
.
DRDesignCrosstabColumnGroup class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignCrosstabColumnGroup extends DRDesignCrosstabGroup implements DRIDesignCrosstabColumnGroup { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private int height; + + /** {@inheritDoc} */ + @Override + public int getHeight() { + return height; + } + + /** + *Setter for the field height
.
DRDesignCrosstabDataset class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignCrosstabDataset implements DRIDesignCrosstabDataset { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRDesignDataset subDataset; + private Boolean dataPreSorted; + private ResetType resetType; + private DRDesignGroup resetGroup; + + /** {@inheritDoc} */ + @Override + public DRDesignDataset getSubDataset() { + return subDataset; + } + + /** + *Setter for the field subDataset
.
Setter for the field dataPreSorted
.
Setter for the field resetType
.
Setter for the field resetGroup
.
Abstract DRDesignCrosstabGroup class.
+ * + * @author Ricardo Mariaca + * + */ +public abstract class DRDesignCrosstabGroup implements DRIDesignCrosstabGroup { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + private CrosstabTotalPosition totalPosition; + private OrderType orderType; + private DRIDesignExpression expression; + private DRIDesignExpression orderByExpression; + private DRIDesignExpression comparatorExpression; + private DRDesignCrosstabCellContent header; + private DRDesignCrosstabCellContent totalHeader; + + /** {@inheritDoc} */ + @Override + public String getName() { + return name; + } + + /** + *Setter for the field name
.
Setter for the field totalPosition
.
Setter for the field orderType
.
Setter for the field expression
.
Setter for the field orderByExpression
.
Setter for the field comparatorExpression
.
Setter for the field header
.
Setter for the field totalHeader
.
DRDesignCrosstabMeasure class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignCrosstabMeasure implements DRIDesignCrosstabMeasure { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + private DRIDesignExpression valueExpression; + private Calculation calculation; + private CrosstabPercentageType percentageType; + + /** {@inheritDoc} */ + @Override + public String getName() { + return name; + } + + /** + *Setter for the field name
.
Setter for the field valueExpression
.
Setter for the field calculation
.
Setter for the field percentageType
.
DRDesignCrosstabRowGroup class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignCrosstabRowGroup extends DRDesignCrosstabGroup implements DRIDesignCrosstabRowGroup { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private int width; + + /** {@inheritDoc} */ + @Override + public int getWidth() { + return width; + } + + /** + *Setter for the field width
.
Abstract AbstractDesignComplexExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public abstract class AbstractDesignComplexExpression implements DRIDesignComplexExpression { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + private ListConstructor for AbstractDesignComplexExpression.
+ */ + protected AbstractDesignComplexExpression() { + this(ReportUtils.generateUniqueName("complexExpression")); + } + + /** + *Constructor for AbstractDesignComplexExpression.
+ * + * @param name a {@link java.lang.String} object. + */ + protected AbstractDesignComplexExpression(String name) { + this.name = name; + this.expressions = new ArrayListaddExpression.
+ * + * @param expression a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public void addExpression(DRIDesignExpression expression) { + this.expressions.add(expression); + } + + /** {@inheritDoc} */ + @Override + public ListSetter for the field expressions
.
Abstract AbstractDesignSimpleExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public abstract class AbstractDesignSimpleExpression implements DRIDesignSimpleExpression { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + + /** + *Constructor for AbstractDesignSimpleExpression.
+ */ + protected AbstractDesignSimpleExpression() { + this(ReportUtils.generateUniqueName("simpleExpression")); + } + + /** + *Constructor for AbstractDesignSimpleExpression.
+ * + * @param name a {@link java.lang.String} object. + */ + protected AbstractDesignSimpleExpression(String name) { + this.name = name; + } + + /** {@inheritDoc} */ + @Override + public String getName() { + return name; + } + + /** {@inheritDoc} */ + @Override + public String getParameterName() { + return null; + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignComplexExpression.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignComplexExpression.java new file mode 100644 index 0000000..2596bd9 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignComplexExpression.java @@ -0,0 +1,72 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRDesignComplexExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignComplexExpression extends AbstractDesignComplexExpression { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRIComplexExpression> complexExpression; + private String parameterName; + + /** + *Constructor for DRDesignComplexExpression.
+ * + * @param complexExpression a {@link software.xdev.dynamicreports.report.definition.expression.DRIComplexExpression} object. + * @param parameterName a {@link java.lang.String} object. + */ + public DRDesignComplexExpression(DRIComplexExpression> complexExpression, String parameterName) { + this.complexExpression = complexExpression; + this.parameterName = parameterName; + } + + /** {@inheritDoc} */ + @Override + public Object evaluate(List> values, ReportParameters reportParameters) { + return complexExpression.evaluate(values, reportParameters); + } + + /** {@inheritDoc} */ + @Override + public Class> getValueClass() { + return complexExpression.getValueClass(); + } + + /** {@inheritDoc} */ + @Override + public String getName() { + return complexExpression.getName(); + } + + /** {@inheritDoc} */ + @Override + public String getParameterName() { + return parameterName; + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignJasperExpression.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignJasperExpression.java new file mode 100644 index 0000000..0626940 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignJasperExpression.java @@ -0,0 +1,61 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRDesignJasperExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignJasperExpression implements DRIDesignJasperExpression { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRIJasperExpression> jasperExpression; + + /** + *Constructor for DRDesignJasperExpression.
+ * + * @param jasperExpression a {@link software.xdev.dynamicreports.report.definition.expression.DRIJasperExpression} object. + */ + public DRDesignJasperExpression(DRIJasperExpression> jasperExpression) { + this.jasperExpression = jasperExpression; + } + + /** {@inheritDoc} */ + @Override + public String getExpression() { + return jasperExpression.getExpression(); + } + + /** {@inheritDoc} */ + @Override + public Class> getValueClass() { + return jasperExpression.getValueClass(); + } + + /** {@inheritDoc} */ + @Override + public String getName() { + return jasperExpression.getName(); + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignParameterExpression.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignParameterExpression.java new file mode 100644 index 0000000..4a0ea5a --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignParameterExpression.java @@ -0,0 +1,65 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRDesignParameterExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignParameterExpression implements DRIDesignParameterExpression { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + private DRIDesignExpression valueExpression; + + /** {@inheritDoc} */ + @Override + public String getName() { + return name; + } + + /** + *Setter for the field name
.
Setter for the field valueExpression
.
DRDesignPropertyExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignPropertyExpression implements DRIDesignPropertyExpression { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + private DRIDesignExpression valueExpression; + + /** {@inheritDoc} */ + @Override + public String getName() { + return name; + } + + /** + *Setter for the field name
.
Setter for the field valueExpression
.
DRDesignSimpleExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignSimpleExpression extends AbstractDesignSimpleExpression { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRISimpleExpression> simpleExpression; + private String parameterName; + + /** + *Constructor for DRDesignSimpleExpression.
+ * + * @param simpleExpression a {@link software.xdev.dynamicreports.report.definition.expression.DRISimpleExpression} object. + * @param parameterName a {@link java.lang.String} object. + */ + public DRDesignSimpleExpression(DRISimpleExpression> simpleExpression, String parameterName) { + this.simpleExpression = simpleExpression; + this.parameterName = parameterName; + } + + /** {@inheritDoc} */ + @Override + public Object evaluate(ReportParameters reportParameters) { + return simpleExpression.evaluate(reportParameters); + } + + /** {@inheritDoc} */ + @Override + public Class> getValueClass() { + return simpleExpression.getValueClass(); + } + + /** {@inheritDoc} */ + @Override + public String getName() { + return simpleExpression.getName(); + } + + /** {@inheritDoc} */ + @Override + public String getParameterName() { + return parameterName; + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignSystemExpression.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignSystemExpression.java new file mode 100644 index 0000000..844c3a5 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignSystemExpression.java @@ -0,0 +1,55 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRDesignSystemExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignSystemExpression implements DRIDesignSystemExpression { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRISystemExpression> systemExpression; + + /** + *Constructor for DRDesignSystemExpression.
+ * + * @param systemExpression a {@link software.xdev.dynamicreports.report.definition.expression.DRISystemExpression} object. + */ + public DRDesignSystemExpression(DRISystemExpression> systemExpression) { + this.systemExpression = systemExpression; + } + + /** {@inheritDoc} */ + @Override + public Class> getValueClass() { + return systemExpression.getValueClass(); + } + + /** {@inheritDoc} */ + @Override + public String getName() { + return systemExpression.getName(); + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignValueFormatter.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignValueFormatter.java new file mode 100644 index 0000000..52a2678 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/expression/DRDesignValueFormatter.java @@ -0,0 +1,61 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRDesignValueFormatter class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignValueFormatter extends AbstractDesignComplexExpression { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRIValueFormatter, Object> valueFormatter; + + @SuppressWarnings("unchecked") + /** + * Constructor for DRDesignValueFormatter. + * + * @param valueFormatter a {@link software.xdev.dynamicreports.report.definition.expression.DRIValueFormatter} object. + * @param valueExpression a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRDesignValueFormatter(DRIValueFormatter, ?> valueFormatter, DRIDesignExpression valueExpression) { + this.valueFormatter = (DRIValueFormatter, Object>) valueFormatter; + addExpression(valueExpression); + } + + /** {@inheritDoc} */ + @Override + public Object evaluate(List> values, ReportParameters reportParameters) { + return valueFormatter.format(values.get(0), reportParameters); + } + + /** {@inheritDoc} */ + @Override + public Class> getValueClass() { + return valueFormatter.getValueClass(); + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/style/DRDesignBaseStyle.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/style/DRDesignBaseStyle.java new file mode 100644 index 0000000..1572013 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/style/DRDesignBaseStyle.java @@ -0,0 +1,332 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeAbstract DRDesignBaseStyle class.
+ * + * @author Ricardo Mariaca + * + */ +public abstract class DRDesignBaseStyle implements DRIDesignBaseStyle { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private Color foregroundColor; + private Color backgroundColor; + private Integer radius; + private ImageScale imageScale; + private HorizontalTextAlignment horizontalTextAlignment; + private VerticalTextAlignment verticalTextAlignment; + private HorizontalImageAlignment horizontalImageAlignment; + private VerticalImageAlignment verticalImageAlignment; + private DRDesignBorder border; + private DRDesignPadding padding; + private DRDesignFont font; + private Rotation rotation; + private String pattern; + private Markup markup; + private DRDesignParagraph paragraph; + private DRDesignPen linePen; + + /** {@inheritDoc} */ + @Override + public Color getForegroundColor() { + return foregroundColor; + } + + /** + *Setter for the field foregroundColor
.
Setter for the field backgroundColor
.
Setter for the field radius
.
Setter for the field imageScale
.
Setter for the field horizontalTextAlignment
.
Setter for the field verticalTextAlignment
.
Setter for the field horizontalImageAlignment
.
Setter for the field verticalImageAlignment
.
Setter for the field border
.
Setter for the field padding
.
Setter for the field font
.
Setter for the field rotation
.
Setter for the field pattern
.
Setter for the field markup
.
Setter for the field paragraph
.
Setter for the field linePen
.
DRDesignBorder class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignBorder implements DRIDesignBorder { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRDesignPen topPen; + private DRDesignPen leftPen; + private DRDesignPen bottomPen; + private DRDesignPen rightPen; + + /** {@inheritDoc} */ + @Override + public DRDesignPen getTopPen() { + return topPen; + } + + /** + *Setter for the field topPen
.
Setter for the field leftPen
.
Setter for the field bottomPen
.
Setter for the field rightPen
.
DRDesignConditionalStyle class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignConditionalStyle extends DRDesignBaseStyle implements DRIDesignConditionalStyle { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private DRIDesignExpression conditionExpression; + private DRIDesignDataset dataset; + + /** {@inheritDoc} */ + @Override + public DRIDesignExpression getConditionExpression() { + return conditionExpression; + } + + /** + *Setter for the field conditionExpression
.
Setter for the field dataset
.
DRDesignFont class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignFont implements DRIDesignFont { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String fontName; + private Integer fontSize; + private Boolean bold; + private Boolean italic; + private Boolean underline; + private Boolean strikeThrough; + private String pdfFontName; + private String pdfEncoding; + private Boolean pdfEmbedded; + + /** {@inheritDoc} */ + @Override + public String getFontName() { + return fontName; + } + + /** + *Setter for the field fontName
.
Setter for the field bold
.
Setter for the field italic
.
Setter for the field underline
.
Setter for the field strikeThrough
.
Setter for the field fontSize
.
Setter for the field pdfFontName
.
Setter for the field pdfEncoding
.
Setter for the field pdfEmbedded
.
DRDesignPadding class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignPadding implements DRIDesignPadding { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private Integer top; + private Integer left; + private Integer bottom; + private Integer right; + + /** {@inheritDoc} */ + @Override + public Integer getTop() { + return top; + } + + /** + *Setter for the field top
.
Setter for the field left
.
Setter for the field bottom
.
Setter for the field right
.
DRDesignParagraph class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignParagraph implements DRIDesignParagraph { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private LineSpacing lineSpacing; + private Float lineSpacingSize; + private Integer firstLineIndent; + private Integer leftIndent; + private Integer rightIndent; + private Integer spacingBefore; + private Integer spacingAfter; + private Integer tabStopWidth; + private ListSetter for the field lineSpacing
.
Setter for the field lineSpacingSize
.
Setter for the field firstLineIndent
.
Setter for the field leftIndent
.
Setter for the field rightIndent
.
Setter for the field spacingBefore
.
Setter for the field spacingAfter
.
Setter for the field tabStopWidth
.
Setter for the field tabStops
.
DRDesignPen class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignPen implements DRIDesignPen { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private Float lineWidth; + private LineStyle lineStyle; + private Color lineColor; + + /** {@inheritDoc} */ + @Override + public Float getLineWidth() { + return lineWidth; + } + + /** + *Setter for the field lineWidth
.
Setter for the field lineStyle
.
Setter for the field lineColor
.
DRDesignStyle class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignStyle extends DRDesignBaseStyle implements DRIDesignStyle { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private String name; + private DRDesignStyle parentStyle; + private ListConstructor for DRDesignStyle.
+ */ + public DRDesignStyle() { + this(ReportUtils.generateUniqueName("style")); + } + + /** + *Constructor for DRDesignStyle.
+ * + * @param name a {@link java.lang.String} object. + */ + public DRDesignStyle(String name) { + this.name = Validate.notBlank(name); + this.conditionalStyles = new ArrayListSetter for the field parentStyle
.
Setter for the field conditionalStyles
.
addConditionalStyle.
+ * + * @param conditionalStyle a {@link software.xdev.dynamicreports.design.base.style.DRDesignConditionalStyle} object. + */ + public void addConditionalStyle(DRDesignConditionalStyle conditionalStyle) { + this.conditionalStyles.add(conditionalStyle); + } + + /** {@inheritDoc} */ + @Override + public boolean equals(Object obj) { + EqualsBuilder equalsBuilder = new EqualsBuilder().appendSuper(super.equals(obj)); + if (equalsBuilder.isEquals()) { + DRDesignStyle o = (DRDesignStyle) obj; + if (!(parentStyle == null ? o.getParentStyle() == null : parentStyle.getName().equals(o.getParentStyle().getName()))) { + return false; + } + equalsBuilder.append(name, o.name).append(conditionalStyles, o.conditionalStyles); + } + return equalsBuilder.isEquals(); + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/style/DRDesignTabStop.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/style/DRDesignTabStop.java new file mode 100644 index 0000000..5399d39 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/base/style/DRDesignTabStop.java @@ -0,0 +1,84 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRDesignTabStop class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignTabStop implements DRIDesignTabStop { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + private int position; + private TabStopAlignment alignment; + + /** {@inheritDoc} */ + @Override + public int getPosition() { + return position; + } + + /** + *Setter for the field position
.
Setter for the field alignment
.
ComponentGroupType class.
+ * + * @author Ricardo Mariaca + * + */ +public enum ComponentGroupType { + FRAME, NONE +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/constant/DefaultStyleType.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/constant/DefaultStyleType.java new file mode 100644 index 0000000..d93750f --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/constant/DefaultStyleType.java @@ -0,0 +1,28 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDefaultStyleType class.
+ * + * @author Ricardo Mariaca + * + */ +public enum DefaultStyleType { + NONE, TEXT, COLUMN, COLUMN_TITLE, GROUP, GROUP_TITLE, SUBTOTAL, IMAGE +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/constant/EvaluationTime.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/constant/EvaluationTime.java new file mode 100644 index 0000000..96e902d --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/constant/EvaluationTime.java @@ -0,0 +1,28 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeEvaluationTime class.
+ * + * @author Ricardo Mariaca + * + */ +public enum EvaluationTime { + NOW, REPORT, PAGE, COLUMN, GROUP, BAND, AUTO +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/constant/ResetType.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/constant/ResetType.java new file mode 100644 index 0000000..e2f40ca --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/constant/ResetType.java @@ -0,0 +1,28 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeResetType class.
+ * + * @author Ricardo Mariaca + * + */ +public enum ResetType { + NONE, REPORT, PAGE, COLUMN, GROUP +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignBand.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignBand.java new file mode 100644 index 0000000..01f28f2 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignBand.java @@ -0,0 +1,76 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignBand interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignBand extends Serializable { + + /** + *getName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getName(); + + /** + *getSplitType.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + public SplitType getSplitType(); + + /** + *getBandComponent.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.component.DRIDesignComponent} object. + */ + public DRIDesignComponent getBandComponent(); + + /** + *getList.
+ * + * @return a {@link software.xdev.dynamicreports.design.base.component.DRDesignList} object. + */ + public DRDesignList getList(); + + /** + *getHeight.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getHeight(); + + /** + *getPrintWhenExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getPrintWhenExpression(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignDataset.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignDataset.java new file mode 100644 index 0000000..e435f7b --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignDataset.java @@ -0,0 +1,120 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignDataset interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignDataset extends Serializable { + + /** + *getName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getName(); + + /** + *getFields.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetVariables.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetSystemExpressions.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetJasperExpressions.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetSimpleExpressions.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetComplexExpressions.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetSorts.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetQuery.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignQuery} object. + */ + public DRIDesignQuery getQuery(); + + /** + *getConnectionExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getConnectionExpression(); + + /** + *getDataSourceExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getDataSourceExpression(); + + /** + *getFilterExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getFilterExpression(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignField.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignField.java new file mode 100644 index 0000000..7f341bb --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignField.java @@ -0,0 +1,43 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignField interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignField extends DRIDesignExpression { + + /** + *isExternal.
+ * + * @return a boolean. + */ + public boolean isExternal(); + + /** + *getDescription.
+ * + * @return a {@link java.lang.String} object. + */ + public String getDescription(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignGroup.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignGroup.java new file mode 100644 index 0000000..6cc0cba --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignGroup.java @@ -0,0 +1,117 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignGroup interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignGroup extends Serializable { + + /** + *getName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getName(); + + /** + *getGroupExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getGroupExpression(); + + /** + *getHeaderBands.
+ * + * @return a {@link java.util.List} object. + */ + public List extends DRIDesignBand> getHeaderBands(); + + /** + *getFooterBands.
+ * + * @return a {@link java.util.List} object. + */ + public List extends DRIDesignBand> getFooterBands(); + + /** + *isStartInNewPage.
+ * + * @return a boolean. + */ + public boolean isStartInNewPage(); + + /** + *isStartInNewColumn.
+ * + * @return a boolean. + */ + public boolean isStartInNewColumn(); + + /** + *isReprintHeaderOnEachPage.
+ * + * @return a boolean. + */ + public boolean isReprintHeaderOnEachPage(); + + /** + *isResetPageNumber.
+ * + * @return a boolean. + */ + public boolean isResetPageNumber(); + + /** + *getMinHeightToStartNewPage.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getMinHeightToStartNewPage(); + + /** + *getFooterPosition.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.GroupFooterPosition} object. + */ + public GroupFooterPosition getFooterPosition(); + + /** + *isKeepTogether.
+ * + * @return a boolean. + */ + public boolean isKeepTogether(); + + /** + *isHeaderWithSubtotal.
+ * + * @return a boolean. + */ + public boolean isHeaderWithSubtotal(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignHyperLink.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignHyperLink.java new file mode 100644 index 0000000..87243da --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignHyperLink.java @@ -0,0 +1,73 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignHyperLink interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignHyperLink extends Serializable { + + /** + *getAnchorExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getAnchorExpression(); + + /** + *getPageExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getPageExpression(); + + /** + *getReferenceExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getReferenceExpression(); + + /** + *getTooltipExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getTooltipExpression(); + + /** + *getType.
+ * + * @return a {@link java.lang.String} object. + */ + public String getType(); + + /** + *getTarget.
+ * + * @return a {@link java.lang.String} object. + */ + public String getTarget(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignMargin.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignMargin.java new file mode 100644 index 0000000..aecc420 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignMargin.java @@ -0,0 +1,57 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignMargin interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignMargin extends Serializable { + + /** + *getTop.
+ * + * @return a int. + */ + public int getTop(); + + /** + *getLeft.
+ * + * @return a int. + */ + public int getLeft(); + + /** + *getBottom.
+ * + * @return a int. + */ + public int getBottom(); + + /** + *getRight.
+ * + * @return a int. + */ + public int getRight(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignPage.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignPage.java new file mode 100644 index 0000000..e40b9f1 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignPage.java @@ -0,0 +1,80 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignPage interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignPage extends Serializable { + + /** + *getWidth.
+ * + * @return a int. + */ + public int getWidth(); + + /** + *getHeight.
+ * + * @return a int. + */ + public int getHeight(); + + /** + *getOrientation.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.PageOrientation} object. + */ + public PageOrientation getOrientation(); + + /** + *getMargin.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignMargin} object. + */ + public DRIDesignMargin getMargin(); + + /** + *getColumnsPerPage.
+ * + * @return a int. + */ + public int getColumnsPerPage(); + + /** + *getColumnSpace.
+ * + * @return a int. + */ + public int getColumnSpace(); + + /** + *getColumnWidth.
+ * + * @return a int. + */ + public int getColumnWidth(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignParameter.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignParameter.java new file mode 100644 index 0000000..086dd37 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignParameter.java @@ -0,0 +1,57 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignParameter interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignParameter extends Serializable { + + /** + *getName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getName(); + + /** + *getValueClass.
+ * + * @return a {@link java.lang.Class} object. + */ + public Class> getValueClass(); + + /** + *getValue.
+ * + * @return a {@link java.lang.Object} object. + */ + public Object getValue(); + + /** + *isExternal.
+ * + * @return a boolean. + */ + public boolean isExternal(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignQuery.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignQuery.java new file mode 100644 index 0000000..7a46c7f --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignQuery.java @@ -0,0 +1,43 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignQuery interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignQuery extends Serializable { + + /** + *getText.
+ * + * @return a {@link java.lang.String} object. + */ + public String getText(); + + /** + *getLanguage.
+ * + * @return a {@link java.lang.String} object. + */ + public String getLanguage(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignReport.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignReport.java new file mode 100644 index 0000000..980fbc9 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignReport.java @@ -0,0 +1,364 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignReport interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignReport extends Serializable { + + /** + *getTemplateDesign.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignTemplateDesign} object. + */ + public DRIDesignTemplateDesign getTemplateDesign(); + + /** + *getReportName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getReportName(); + + /** + *getLocale.
+ * + * @return a {@link java.util.Locale} object. + */ + public Locale getLocale(); + + /** + *getResourceBundle.
+ * + * @return a {@link java.util.ResourceBundle} object. + */ + public ResourceBundle getResourceBundle(); + + /** + *getResourceBundleName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getResourceBundleName(); + + /** + *isIgnorePagination.
+ * + * @return a boolean. + */ + public boolean isIgnorePagination(); + + /** + *getProperties.
+ * + * @return a {@link java.util.Properties} object. + */ + public Properties getProperties(); + + /** + *getQuery.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignQuery} object. + */ + public DRIDesignQuery getQuery(); + + /** + *getPage.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignPage} object. + */ + public DRIDesignPage getPage(); + + /** + *getWhenNoDataType.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.WhenNoDataType} object. + */ + public WhenNoDataType getWhenNoDataType(); + + /** + *getWhenResourceMissingType.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.WhenResourceMissingType} object. + */ + public WhenResourceMissingType getWhenResourceMissingType(); + + /** + *isTitleOnANewPage.
+ * + * @return a boolean. + */ + public boolean isTitleOnANewPage(); + + /** + *isSummaryOnANewPage.
+ * + * @return a boolean. + */ + public boolean isSummaryOnANewPage(); + + /** + *isSummaryWithPageHeaderAndFooter.
+ * + * @return a boolean. + */ + public boolean isSummaryWithPageHeaderAndFooter(); + + /** + *isFloatColumnFooter.
+ * + * @return a boolean. + */ + public boolean isFloatColumnFooter(); + + /** + *getPrintOrder.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.Orientation} object. + */ + public Orientation getPrintOrder(); + + /** + *getColumnDirection.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.RunDirection} object. + */ + public RunDirection getColumnDirection(); + + /** + *getLanguage.
+ * + * @return a {@link java.lang.String} object. + */ + public String getLanguage(); + + /** + *isTableOfContents.
+ * + * @return a boolean. + */ + public boolean isTableOfContents(); + + /** + *getTableOfContentsHeadings.
+ * + * @return a {@link java.util.Map} object. + */ + public MapgetTableOfContentsCustomizer.
+ * + * @return a {@link software.xdev.dynamicreports.report.definition.DRITableOfContentsCustomizer} object. + */ + public DRITableOfContentsCustomizer getTableOfContentsCustomizer(); + + /** + *getFilterExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getFilterExpression(); + + /** + *getParameters.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetParameterValues.
+ * + * @return a {@link java.util.Map} object. + */ + public MapgetScriptlets.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetFields.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetSystemExpressions.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetJasperExpressions.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetSimpleExpressions.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetStyles.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetGroups.
+ * + * @return a {@link java.util.Collection} object. + */ + public Collection extends DRIDesignGroup> getGroups(); + + /** + *getVariables.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetComplexExpressions.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetSorts.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetDatasets.
+ * + * @return a {@link java.util.Collection} object. + */ + public CollectiongetTitleBand.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignBand} object. + */ + public DRIDesignBand getTitleBand(); + + /** + *getPageHeaderBand.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignBand} object. + */ + public DRIDesignBand getPageHeaderBand(); + + /** + *getPageFooterBand.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignBand} object. + */ + public DRIDesignBand getPageFooterBand(); + + /** + *getColumnHeaderBand.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignBand} object. + */ + public DRIDesignBand getColumnHeaderBand(); + + /** + *getColumnFooterBand.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignBand} object. + */ + public DRIDesignBand getColumnFooterBand(); + + /** + *getDetailBands.
+ * + * @return a {@link java.util.List} object. + */ + public List extends DRIDesignBand> getDetailBands(); + + /** + *getLastPageFooterBand.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignBand} object. + */ + public DRIDesignBand getLastPageFooterBand(); + + /** + *getSummaryBand.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignBand} object. + */ + public DRIDesignBand getSummaryBand(); + + /** + *getNoDataBand.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignBand} object. + */ + public DRIDesignBand getNoDataBand(); + + /** + *getBackgroundBand.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignBand} object. + */ + public DRIDesignBand getBackgroundBand(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignSort.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignSort.java new file mode 100644 index 0000000..e355151 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignSort.java @@ -0,0 +1,46 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignSort interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignSort extends Serializable { + + /** + *getExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getExpression(); + + /** + *getOrderType.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.OrderType} object. + */ + public OrderType getOrderType(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignTableOfContentsHeading.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignTableOfContentsHeading.java new file mode 100644 index 0000000..bda7e33 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignTableOfContentsHeading.java @@ -0,0 +1,39 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignTableOfContentsHeading interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignTableOfContentsHeading extends Serializable { + + /** + *getReferenceField.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.component.DRIDesignTextField} object. + */ + public DRIDesignTextField getReferenceField(); + +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignTemplateDesign.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignTemplateDesign.java new file mode 100644 index 0000000..e1dee4f --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignTemplateDesign.java @@ -0,0 +1,102 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignTemplateDesign interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignTemplateDesign extends Serializable { + + /** + *getTitleComponentsCount.
+ * + * @return a int. + */ + public int getTitleComponentsCount(); + + /** + *getPageHeaderComponentsCount.
+ * + * @return a int. + */ + public int getPageHeaderComponentsCount(); + + /** + *getPageFooterComponentsCount.
+ * + * @return a int. + */ + public int getPageFooterComponentsCount(); + + /** + *getColumnHeaderComponentsCount.
+ * + * @return a int. + */ + public int getColumnHeaderComponentsCount(); + + /** + *getColumnFooterComponentsCount.
+ * + * @return a int. + */ + public int getColumnFooterComponentsCount(); + + /** + *getLastPageFooterComponentsCount.
+ * + * @return a int. + */ + public int getLastPageFooterComponentsCount(); + + /** + *getSummaryComponentsCount.
+ * + * @return a int. + */ + public int getSummaryComponentsCount(); + + /** + *getNoDataComponentsCount.
+ * + * @return a int. + */ + public int getNoDataComponentsCount(); + + /** + *getBackgroundComponentsCount.
+ * + * @return a int. + */ + public int getBackgroundComponentsCount(); + + /** + *getDesign.
+ * + * @return a {@link java.lang.Object} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public Object getDesign() throws DRException; +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignVariable.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignVariable.java new file mode 100644 index 0000000..a7d736a --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/DRIDesignVariable.java @@ -0,0 +1,66 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignVariable interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignVariable extends DRIDesignExpression { + + /** + *getValueExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getValueExpression(); + + /** + *getInitialValueExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getInitialValueExpression(); + + /** + *getCalculation.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.Calculation} object. + */ + public Calculation getCalculation(); + + /** + *getResetType.
+ * + * @return a {@link software.xdev.dynamicreports.design.constant.ResetType} object. + */ + public ResetType getResetType(); + + /** + *getResetGroup.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignGroup} object. + */ + public DRIDesignGroup getResetGroup(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignBreak.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignBreak.java new file mode 100644 index 0000000..0870add --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignBreak.java @@ -0,0 +1,37 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignBreak interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignBreak extends DRIDesignComponent { + + /** + *getType.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.BreakType} object. + */ + public BreakType getType(); + +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignComponent.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignComponent.java new file mode 100644 index 0000000..362046f --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignComponent.java @@ -0,0 +1,149 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignComponent interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignComponent extends Serializable { + /** + *getName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getName(); + + /** + *getUniqueName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getUniqueName(); + + /** + *getStyle.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignStyle} object. + */ + public DRIDesignStyle getStyle(); + + /** + *getX.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getX(); + + /** + *getY.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getY(); + + /** + *getWidth.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getWidth(); + + /** + *getHeight.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getHeight(); + + /** + *getPrintWhenExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getPrintWhenExpression(); + + /** + *isRemoveLineWhenBlank.
+ * + * @return a boolean. + */ + public boolean isRemoveLineWhenBlank(); + + /** + *getPropertyExpressions.
+ * + * @return a {@link java.util.List} object. + */ + public ListgetPositionType.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.ComponentPositionType} object. + */ + public ComponentPositionType getPositionType(); + + /** + *getStretchType.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.StretchType} object. + */ + public StretchType getStretchType(); + + /** + *isPrintInFirstWholeBand.
+ * + * @return a boolean. + */ + public boolean isPrintInFirstWholeBand(); + + /** + *isPrintWhenDetailOverflows.
+ * + * @return a boolean. + */ + public boolean isPrintWhenDetailOverflows(); + + /** + *getPrintWhenGroupChanges.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignGroup} object. + */ + public DRIDesignGroup getPrintWhenGroupChanges(); + + /** + *getTableOfContentsHeading.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignTableOfContentsHeading} object. + */ + public DRIDesignTableOfContentsHeading getTableOfContentsHeading(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignEllipse.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignEllipse.java new file mode 100644 index 0000000..1a7b90d --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignEllipse.java @@ -0,0 +1,37 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignEllipse interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignEllipse extends DRIDesignComponent { + + /** + *getPen.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignPen} object. + */ + public DRIDesignPen getPen(); + +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignFiller.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignFiller.java new file mode 100644 index 0000000..7d56efc --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignFiller.java @@ -0,0 +1,28 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignFiller interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignFiller extends DRIDesignComponent { + +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignGenericElement.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignGenericElement.java new file mode 100644 index 0000000..e032b67 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignGenericElement.java @@ -0,0 +1,69 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignGenericElement interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignGenericElement extends DRIDesignComponent { + + /** + *getGenericElementNamespace.
+ * + * @return a {@link java.lang.String} object. + */ + public String getGenericElementNamespace(); + + /** + *getGenericElementName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getGenericElementName(); + + /** + *getEvaluationTime.
+ * + * @return a {@link software.xdev.dynamicreports.design.constant.EvaluationTime} object. + */ + public EvaluationTime getEvaluationTime(); + + /** + *getEvaluationGroup.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignGroup} object. + */ + public DRIDesignGroup getEvaluationGroup(); + + /** + *getParameterExpressions.
+ * + * @return a {@link java.util.List} object. + */ + public ListDRIDesignHyperLinkComponent interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignHyperLinkComponent extends DRIDesignComponent { + + /** + *getAnchorNameExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getAnchorNameExpression(); + + /** + *getBookmarkLevel.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getBookmarkLevel(); + + /** + *getHyperLink.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignHyperLink} object. + */ + public DRIDesignHyperLink getHyperLink(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignImage.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignImage.java new file mode 100644 index 0000000..f5476d5 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignImage.java @@ -0,0 +1,66 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignImage interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignImage extends DRIDesignHyperLinkComponent { + + /** + *getImageExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getImageExpression(); + + /** + *getImageScale.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.ImageScale} object. + */ + public ImageScale getImageScale(); + + /** + *getUsingCache.
+ * + * @return a {@link java.lang.Boolean} object. + */ + public Boolean getUsingCache(); + + /** + *getLazy.
+ * + * @return a {@link java.lang.Boolean} object. + */ + public Boolean getLazy(); + + /** + *getHorizontalImageAlignment.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.HorizontalImageAlignment} object. + */ + public HorizontalImageAlignment getHorizontalImageAlignment(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignLine.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignLine.java new file mode 100644 index 0000000..7e04475 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignLine.java @@ -0,0 +1,45 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignLine interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignLine extends DRIDesignComponent { + + /** + *getDirection.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.LineDirection} object. + */ + public LineDirection getDirection(); + + /** + *getPen.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignPen} object. + */ + public DRIDesignPen getPen(); + +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignList.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignList.java new file mode 100644 index 0000000..d55c66c --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignList.java @@ -0,0 +1,60 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignList interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignList extends DRIDesignComponent { + + /** + *getComponents.
+ * + * @return a {@link java.util.List} object. + */ + public List extends DRIDesignComponent> getComponents(); + + /** + *getType.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.ListType} object. + */ + public ListType getType(); + + /** + *getComponentGroupType.
+ * + * @return a {@link software.xdev.dynamicreports.design.constant.ComponentGroupType} object. + */ + public ComponentGroupType getComponentGroupType(); + + /** + *getBackgroundComponent.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.component.DRIDesignComponent} object. + */ + public DRIDesignComponent getBackgroundComponent(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignMap.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignMap.java new file mode 100644 index 0000000..e18491a --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignMap.java @@ -0,0 +1,66 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignMap interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignMap extends DRIDesignComponent { + + /** + *getEvaluationTime.
+ * + * @return a {@link software.xdev.dynamicreports.design.constant.EvaluationTime} object. + */ + public EvaluationTime getEvaluationTime(); + + /** + *getEvaluationGroup.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignGroup} object. + */ + public DRIDesignGroup getEvaluationGroup(); + + /** + *getLatitudeExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getLatitudeExpression(); + + /** + *getLongitudeExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getLongitudeExpression(); + + /** + *getZoomExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getZoomExpression(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignRectangle.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignRectangle.java new file mode 100644 index 0000000..311aab2 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignRectangle.java @@ -0,0 +1,44 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignRectangle interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignRectangle extends DRIDesignComponent { + + /** + *getRadius.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getRadius(); + + /** + *getPen.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignPen} object. + */ + public DRIDesignPen getPen(); + +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignSubreport.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignSubreport.java new file mode 100644 index 0000000..6ef679f --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignSubreport.java @@ -0,0 +1,64 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignSubreport interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignSubreport extends DRIDesignComponent { + + /** + *getReportExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getReportExpression(); + + /** + *getParametersExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getParametersExpression(); + + /** + *getConnectionExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getConnectionExpression(); + + /** + *getDataSourceExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getDataSourceExpression(); + + /** + *getRunToBottom.
+ * + * @return a {@link java.lang.Boolean} object. + */ + public Boolean getRunToBottom(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignTextField.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignTextField.java new file mode 100644 index 0000000..9137b87 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/component/DRIDesignTextField.java @@ -0,0 +1,104 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignTextField interface.
+ * + * @author Ricardo Mariaca, Jan Moxter + * + */ +public interface DRIDesignTextField extends DRIDesignHyperLinkComponent { + + /** + *getPattern.
+ * + * @return a {@link java.lang.String} object. + */ + String getPattern(); + + /** + *getPatternExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + DRIDesignExpression getPatternExpression(); + + /** + *getHorizontalTextAlignment.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.HorizontalTextAlignment} object. + */ + HorizontalTextAlignment getHorizontalTextAlignment(); + + /** + *getValueExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + DRIDesignExpression getValueExpression(); + + /** + *isPrintRepeatedValues.
+ * + * @return a boolean. + */ + boolean isPrintRepeatedValues(); + + /** + *getEvaluationTime.
+ * + * @return a {@link software.xdev.dynamicreports.design.constant.EvaluationTime} object. + */ + EvaluationTime getEvaluationTime(); + + /** + *getEvaluationGroup.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignGroup} object. + */ + DRIDesignGroup getEvaluationGroup(); + + /** + *getMarkup.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.Markup} object. + */ + Markup getMarkup(); + + /** + *isStretchWithOverflow.
+ * + * @return a boolean. + * @deprecated Replaced by {@link #getTextAdjust()}. + */ + @Deprecated + boolean isStretchWithOverflow(); + + /** + * @return a {@link software.xdev.dynamicreports.report.constant.TextAdjust} object. + */ + TextAdjust getTextAdjust(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstab.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstab.java new file mode 100644 index 0000000..a861fa2 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstab.java @@ -0,0 +1,116 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignCrosstab interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignCrosstab extends DRIDesignComponent { + + /** + *getDataset.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.crosstab.DRIDesignCrosstabDataset} object. + */ + public DRIDesignCrosstabDataset getDataset(); + + /** + *isRepeatColumnHeaders.
+ * + * @return a {@link java.lang.Boolean} object. + */ + public Boolean isRepeatColumnHeaders(); + + /** + *isRepeatRowHeaders.
+ * + * @return a {@link java.lang.Boolean} object. + */ + public Boolean isRepeatRowHeaders(); + + /** + *getColumnBreakOffset.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getColumnBreakOffset(); + + /** + *getIgnoreWidth.
+ * + * @return a {@link java.lang.Boolean} object. + */ + public Boolean getIgnoreWidth(); + + /** + *getRunDirection.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.RunDirection} object. + */ + public RunDirection getRunDirection(); + + /** + *getWhenNoDataCell.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.crosstab.DRIDesignCrosstabCellContent} object. + */ + public DRIDesignCrosstabCellContent getWhenNoDataCell(); + + /** + *getHeaderCell.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.crosstab.DRIDesignCrosstabCellContent} object. + */ + public DRIDesignCrosstabCellContent getHeaderCell(); + + /** + *getColumnGroups.
+ * + * @return a {@link java.util.List} object. + */ + public List extends DRIDesignCrosstabColumnGroup> getColumnGroups(); + + /** + *getRowGroups.
+ * + * @return a {@link java.util.List} object. + */ + public List extends DRIDesignCrosstabRowGroup> getRowGroups(); + + /** + *getCells.
+ * + * @return a {@link java.util.List} object. + */ + public List extends DRIDesignCrosstabCell> getCells(); + + /** + *getMeasures.
+ * + * @return a {@link java.util.List} object. + */ + public ListDRIDesignCrosstabCell interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignCrosstabCell extends Serializable { + + /** + *getName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getName(); + + /** + *getRowTotalGroup.
+ * + * @return a {@link java.lang.String} object. + */ + public String getRowTotalGroup(); + + /** + *getColumnTotalGroup.
+ * + * @return a {@link java.lang.String} object. + */ + public String getColumnTotalGroup(); + + /** + *getContent.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.crosstab.DRIDesignCrosstabCellContent} object. + */ + public DRIDesignCrosstabCellContent getContent(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabCellContent.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabCellContent.java new file mode 100644 index 0000000..8c0d275 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabCellContent.java @@ -0,0 +1,60 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignCrosstabCellContent interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignCrosstabCellContent extends Serializable { + + /** + *getWidth.
+ * + * @return a int. + */ + public int getWidth(); + + /** + *getHeight.
+ * + * @return a int. + */ + public int getHeight(); + + /** + *getComponent.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.component.DRIDesignComponent} object. + */ + public DRIDesignComponent getComponent(); + + /** + *getStyle.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignStyle} object. + */ + public DRIDesignStyle getStyle(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabColumnGroup.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabColumnGroup.java new file mode 100644 index 0000000..fbc8b1e --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabColumnGroup.java @@ -0,0 +1,34 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignCrosstabColumnGroup interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignCrosstabColumnGroup extends DRIDesignCrosstabGroup { + + /** + *getHeight.
+ * + * @return a int. + */ + public int getHeight(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabDataset.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabDataset.java new file mode 100644 index 0000000..79cc1c4 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabDataset.java @@ -0,0 +1,61 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignCrosstabDataset interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignCrosstabDataset extends Serializable { + + /** + *getSubDataset.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignDataset} object. + */ + public DRIDesignDataset getSubDataset(); + + /** + *getDataPreSorted.
+ * + * @return a {@link java.lang.Boolean} object. + */ + public Boolean getDataPreSorted(); + + /** + *getResetType.
+ * + * @return a {@link software.xdev.dynamicreports.design.constant.ResetType} object. + */ + public ResetType getResetType(); + + /** + *getResetGroup.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignGroup} object. + */ + public DRIDesignGroup getResetGroup(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabGroup.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabGroup.java new file mode 100644 index 0000000..d7b3d5a --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabGroup.java @@ -0,0 +1,89 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignCrosstabGroup interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignCrosstabGroup extends Serializable { + + /** + *getName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getName(); + + /** + *getTotalPosition.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.CrosstabTotalPosition} object. + */ + public CrosstabTotalPosition getTotalPosition(); + + /** + *getOrderType.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.OrderType} object. + */ + public OrderType getOrderType(); + + /** + *getExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getExpression(); + + /** + *getOrderByExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getOrderByExpression(); + + /** + *getComparatorExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getComparatorExpression(); + + /** + *getHeader.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.crosstab.DRIDesignCrosstabCellContent} object. + */ + public DRIDesignCrosstabCellContent getHeader(); + + /** + *getTotalHeader.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.crosstab.DRIDesignCrosstabCellContent} object. + */ + public DRIDesignCrosstabCellContent getTotalHeader(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabMeasure.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabMeasure.java new file mode 100644 index 0000000..b07bddc --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabMeasure.java @@ -0,0 +1,68 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignCrosstabMeasure interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignCrosstabMeasure extends Serializable { + + /** + *getName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getName(); + + /** + *getValueClass.
+ * + * @return a {@link java.lang.Class} object. + */ + public Class> getValueClass(); + + /** + *getValueExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getValueExpression(); + + /** + *getCalculation.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.Calculation} object. + */ + public Calculation getCalculation(); + + /** + *getPercentageType.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.CrosstabPercentageType} object. + */ + public CrosstabPercentageType getPercentageType(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabRowGroup.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabRowGroup.java new file mode 100644 index 0000000..cce6190 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/crosstab/DRIDesignCrosstabRowGroup.java @@ -0,0 +1,34 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignCrosstabRowGroup interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignCrosstabRowGroup extends DRIDesignCrosstabGroup { + + /** + *getWidth.
+ * + * @return a int. + */ + public int getWidth(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignComplexExpression.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignComplexExpression.java new file mode 100644 index 0000000..6ed3d19 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignComplexExpression.java @@ -0,0 +1,54 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignComplexExpression interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignComplexExpression extends DRIDesignExpression { + + /** + *getExpressions.
+ * + * @return a {@link java.util.List} object. + */ + public Listevaluate.
+ * + * @param values a {@link java.util.List} object. + * @param reportParameters a {@link software.xdev.dynamicreports.report.definition.ReportParameters} object. + * @return a {@link java.lang.Object} object. + */ + public Object evaluate(List> values, ReportParameters reportParameters); + + /** + *getParameterName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getParameterName(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignExpression.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignExpression.java new file mode 100644 index 0000000..2c9bed7 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignExpression.java @@ -0,0 +1,43 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignExpression interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignExpression extends Serializable { + + /** + *getName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getName(); + + /** + *getValueClass.
+ * + * @return a {@link java.lang.Class} object. + */ + public Class> getValueClass(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignJasperExpression.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignJasperExpression.java new file mode 100644 index 0000000..82b5617 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignJasperExpression.java @@ -0,0 +1,34 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignJasperExpression interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignJasperExpression extends DRIDesignExpression { + + /** + *getExpression.
+ * + * @return a {@link java.lang.String} object. + */ + public String getExpression(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignParameterExpression.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignParameterExpression.java new file mode 100644 index 0000000..65dd9f6 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignParameterExpression.java @@ -0,0 +1,43 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignParameterExpression interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignParameterExpression extends Serializable { + + /** + *getName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getName(); + + /** + *getValueExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getValueExpression(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignPropertyExpression.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignPropertyExpression.java new file mode 100644 index 0000000..dd7a962 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignPropertyExpression.java @@ -0,0 +1,43 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignPropertyExpression interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignPropertyExpression extends Serializable { + + /** + *getName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getName(); + + /** + *getValueExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getValueExpression(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignSimpleExpression.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignSimpleExpression.java new file mode 100644 index 0000000..9664e67 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignSimpleExpression.java @@ -0,0 +1,44 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignSimpleExpression interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignSimpleExpression extends DRIDesignExpression { + + /** + *evaluate.
+ * + * @param reportParameters a {@link software.xdev.dynamicreports.report.definition.ReportParameters} object. + * @return a {@link java.lang.Object} object. + */ + public Object evaluate(ReportParameters reportParameters); + + /** + *getParameterName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getParameterName(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignSystemExpression.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignSystemExpression.java new file mode 100644 index 0000000..39f6ccb --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/expression/DRIDesignSystemExpression.java @@ -0,0 +1,27 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignSystemExpression interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignSystemExpression extends DRIDesignExpression { +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignBaseStyle.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignBaseStyle.java new file mode 100644 index 0000000..26953d3 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignBaseStyle.java @@ -0,0 +1,151 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignBaseStyle interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignBaseStyle extends Serializable { + + /** + *getForegroundColor.
+ * + * @return a {@link java.awt.Color} object. + */ + public Color getForegroundColor(); + + /** + *getBackgroundColor.
+ * + * @return a {@link java.awt.Color} object. + */ + public Color getBackgroundColor(); + + /** + *getRadius.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getRadius(); + + /** + *getImageScale.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.ImageScale} object. + */ + public ImageScale getImageScale(); + + /** + *getHorizontalTextAlignment.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.HorizontalTextAlignment} object. + */ + public HorizontalTextAlignment getHorizontalTextAlignment(); + + /** + *getVerticalTextAlignment.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.VerticalTextAlignment} object. + */ + public VerticalTextAlignment getVerticalTextAlignment(); + + /** + *getHorizontalImageAlignment.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.HorizontalImageAlignment} object. + */ + public HorizontalImageAlignment getHorizontalImageAlignment(); + + /** + *getVerticalImageAlignment.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.VerticalImageAlignment} object. + */ + public VerticalImageAlignment getVerticalImageAlignment(); + + /** + *getBorder.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignBorder} object. + */ + public DRIDesignBorder getBorder(); + + /** + *getPadding.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignPadding} object. + */ + public DRIDesignPadding getPadding(); + + /** + *getFont.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignFont} object. + */ + public DRIDesignFont getFont(); + + /** + *getRotation.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.Rotation} object. + */ + public Rotation getRotation(); + + /** + *getPattern.
+ * + * @return a {@link java.lang.String} object. + */ + public String getPattern(); + + /** + *getMarkup.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.Markup} object. + */ + public Markup getMarkup(); + + /** + *getParagraph.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignParagraph} object. + */ + public DRIDesignParagraph getParagraph(); + + /** + *getLinePen.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignPen} object. + */ + public DRIDesignPen getLinePen(); + +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignBorder.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignBorder.java new file mode 100644 index 0000000..e5945a1 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignBorder.java @@ -0,0 +1,57 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignBorder interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignBorder extends Serializable { + + /** + *getTopPen.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignPen} object. + */ + public DRIDesignPen getTopPen(); + + /** + *getLeftPen.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignPen} object. + */ + public DRIDesignPen getLeftPen(); + + /** + *getBottomPen.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignPen} object. + */ + public DRIDesignPen getBottomPen(); + + /** + *getRightPen.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignPen} object. + */ + public DRIDesignPen getRightPen(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignConditionalStyle.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignConditionalStyle.java new file mode 100644 index 0000000..9b880f6 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignConditionalStyle.java @@ -0,0 +1,44 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignConditionalStyle interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignConditionalStyle extends DRIDesignBaseStyle { + + /** + *getConditionExpression.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + */ + public DRIDesignExpression getConditionExpression(); + + /** + *getDataset.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignDataset} object. + */ + public DRIDesignDataset getDataset(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignFont.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignFont.java new file mode 100644 index 0000000..35789c3 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignFont.java @@ -0,0 +1,92 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignFont interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignFont extends Serializable { + + /** + *getFontName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getFontName(); + + /** + *getBold.
+ * + * @return a {@link java.lang.Boolean} object. + */ + public Boolean getBold(); + + /** + *getItalic.
+ * + * @return a {@link java.lang.Boolean} object. + */ + public Boolean getItalic(); + + /** + *getUnderline.
+ * + * @return a {@link java.lang.Boolean} object. + */ + public Boolean getUnderline(); + + /** + *getStrikeThrough.
+ * + * @return a {@link java.lang.Boolean} object. + */ + public Boolean getStrikeThrough(); + + /** + *getFontSize.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getFontSize(); + + /** + *getPdfFontName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getPdfFontName(); + + /** + *getPdfEncoding.
+ * + * @return a {@link java.lang.String} object. + */ + public String getPdfEncoding(); + + /** + *getPdfEmbedded.
+ * + * @return a {@link java.lang.Boolean} object. + */ + public Boolean getPdfEmbedded(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignPadding.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignPadding.java new file mode 100644 index 0000000..3d64ced --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignPadding.java @@ -0,0 +1,57 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignPadding interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignPadding extends Serializable { + + /** + *getTop.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getTop(); + + /** + *getLeft.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getLeft(); + + /** + *getBottom.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getBottom(); + + /** + *getRight.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getRight(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignParagraph.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignParagraph.java new file mode 100644 index 0000000..764f5bb --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignParagraph.java @@ -0,0 +1,95 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignParagraph interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignParagraph extends Serializable { + + /** + *getLineSpacing.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.LineSpacing} object. + */ + public LineSpacing getLineSpacing(); + + /** + *getLineSpacingSize.
+ * + * @return a {@link java.lang.Float} object. + */ + public Float getLineSpacingSize(); + + /** + *getFirstLineIndent.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getFirstLineIndent(); + + /** + *getLeftIndent.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getLeftIndent(); + + /** + *getRightIndent.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getRightIndent(); + + /** + *getSpacingBefore.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getSpacingBefore(); + + /** + *getSpacingAfter.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getSpacingAfter(); + + /** + *getTabStopWidth.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getTabStopWidth(); + + /** + *getTabStops.
+ * + * @return a {@link java.util.List} object. + */ + public ListDRIDesignPen interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignPen extends Serializable { + + /** + *getLineWidth.
+ * + * @return a {@link java.lang.Float} object. + */ + public Float getLineWidth(); + + /** + *getLineStyle.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.LineStyle} object. + */ + public LineStyle getLineStyle(); + + /** + *getLineColor.
+ * + * @return a {@link java.awt.Color} object. + */ + public Color getLineColor(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignStyle.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignStyle.java new file mode 100644 index 0000000..ce5531b --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignStyle.java @@ -0,0 +1,50 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignStyle interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignStyle extends DRIDesignBaseStyle { + + /** + *getName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getName(); + + /** + *getParentStyle.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignStyle} object. + */ + public DRIDesignStyle getParentStyle(); + + /** + *getConditionalStyles.
+ * + * @return a {@link java.util.List} object. + */ + public List extends DRIDesignConditionalStyle> getConditionalStyles(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignTabStop.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignTabStop.java new file mode 100644 index 0000000..29b78c1 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/definition/style/DRIDesignTabStop.java @@ -0,0 +1,45 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRIDesignTabStop interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DRIDesignTabStop extends Serializable { + + /** + *getPosition.
+ * + * @return a int. + */ + public int getPosition(); + + /** + *getAlignment.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.TabStopAlignment} object. + */ + public TabStopAlignment getAlignment(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/exception/DRDesignReportException.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/exception/DRDesignReportException.java new file mode 100644 index 0000000..131455c --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/exception/DRDesignReportException.java @@ -0,0 +1,49 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDRDesignReportException class.
+ * + * @author Ricardo Mariaca + * + */ +public class DRDesignReportException extends RuntimeException { + private static final long serialVersionUID = Constants.SERIAL_VERSION_UID; + + /** + *Constructor for DRDesignReportException.
+ * + * @param message a {@link java.lang.String} object. + */ + public DRDesignReportException(String message) { + super(message); + } + + /** + *Constructor for DRDesignReportException.
+ * + * @param message a {@link java.lang.String} object. + * @param cause a {@link java.lang.Throwable} object. + */ + public DRDesignReportException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/AbstractExpressionTransform.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/AbstractExpressionTransform.java new file mode 100644 index 0000000..94bfb02 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/AbstractExpressionTransform.java @@ -0,0 +1,459 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeAbstract AbstractExpressionTransform class.
+ * + * @author Ricardo Mariaca + * + */ +public abstract class AbstractExpressionTransform { + protected DesignTransformAccessor accessor; + private MapConstructor for AbstractExpressionTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public AbstractExpressionTransform(DesignTransformAccessor accessor) { + this.accessor = accessor; + init(); + } + + private void init() { + fields = new LinkedHashMaptransform.
+ * + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public void transform() throws DRException { + for (DRIField> field : transformFields()) { + transformExpression(field); + } + for (DRIVariable> variable : transformVariables()) { + transformExpression(variable); + } + for (DRISort sort : transformSorts()) { + transformSort(sort); + } + } + + /** + *transformExpression.
+ * + * @param expression a {@link software.xdev.dynamicreports.report.definition.expression.DRIExpression} object. + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public DRIDesignExpression transformExpression(DRIExpression> expression) throws DRException { + return transformExpression(expression, null, null); + } + + /** + *transformExpression.
+ * + * @param expression a {@link software.xdev.dynamicreports.report.definition.expression.DRIExpression} object. + * @param parameterName a {@link java.lang.String} object. + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRIDesignExpression transformExpression(DRIExpression> expression, String parameterName) throws DRException { + return transformExpression(expression, null, parameterName); + } + + /** + *transformExpression.
+ * + * @param expression a {@link software.xdev.dynamicreports.report.definition.expression.DRIExpression} object. + * @param valueFormatter a {@link software.xdev.dynamicreports.report.definition.expression.DRIValueFormatter} object. + * @param parameterName a {@link java.lang.String} object. + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRIDesignExpression transformExpression(DRIExpression> expression, DRIValueFormatter, ?> valueFormatter, String parameterName) throws DRException { + if (expression == null) { + return null; + } + + if (valueFormatter != null) { + return addExpression(new DRDesignValueFormatter(valueFormatter, transformExpression(expression))); + } + if (expressions.containsKey(expression)) { + return expressions.get(expression); + } + + DRIDesignExpression express; + if (expression instanceof DRISystemExpression>) { + express = new DRDesignSystemExpression((DRISystemExpression>) expression); + } else if (expression instanceof DRIJasperExpression>) { + express = new DRDesignJasperExpression((DRIJasperExpression>) expression); + } else if (expression instanceof DRISimpleExpression>) { + express = new DRDesignSimpleExpression((DRISimpleExpression>) expression, parameterName); + } else if (expression instanceof DRIComplexExpression>) { + express = transformComplexExpression((DRIComplexExpression>) expression, parameterName); + } else if (expression instanceof DRIField>) { + express = transformField((DRIField>) expression); + } else if (expression instanceof DRIVariable>) { + express = transformVariable((DRIVariable>) expression); + } else if (expression instanceof DRIValueColumn>) { + express = transformExpression(((DRIValueColumn>) expression).getComponent().getValueExpression()); + } else if (expression instanceof DRIBooleanColumn) { + express = transformExpression(((DRIBooleanColumn) expression).getComponent().getValueExpression()); + } else if (expression instanceof DRISubtotal>) { + express = transformExpression(((DRISubtotal>) expression).getValueField().getValueExpression()); + } else { + throw new DRDesignReportException("Expression " + expression.getClass().getName() + " not supported"); + } + express = addExpression(express); + if (valueFormatter == null) { + expressions.put(expression, express); + } + return express; + } + + private DRDesignField transformField(DRIField> field) { + DRDesignField designField = new DRDesignField(); + designField.setName(field.getName()); + designField.setValueClass(field.getValueClass()); + designField.setDescription(accessor.getTemplateTransform().getFieldDescription(field)); + return designField; + } + + private DRIDesignExpression transformComplexExpression(DRIComplexExpression> complexExpression, String parameterName) throws DRException { + DRDesignComplexExpression designComplexExpression = new DRDesignComplexExpression(complexExpression, parameterName); + for (DRIExpression> expression : complexExpression.getExpressions()) { + designComplexExpression.addExpression(transformExpression(expression)); + } + return designComplexExpression; + } + + private DRIDesignExpression transformVariable(DRIVariable> variable) throws DRException { + DRDesignVariable designVariable = new DRDesignVariable(variable.getName()); + designVariable.setValueExpression(transformExpression(variable.getValueExpression())); + designVariable.setInitialValueExpression(transformExpression(variable.getInitialValueExpression())); + designVariable.setCalculation(variable.getCalculation()); + designVariable.setResetType(getVariableResetType(variable)); + designVariable.setResetGroup(getVariableResetGroup(variable)); + return designVariable; + } + + /** + *getVariableResetType.
+ * + * @param variable a {@link software.xdev.dynamicreports.report.definition.DRIVariable} object. + * @return a {@link software.xdev.dynamicreports.design.constant.ResetType} object. + */ + protected ResetType getVariableResetType(DRIVariable> variable) { + return null; + } + + /** + *getVariableResetGroup.
+ * + * @param variable a {@link software.xdev.dynamicreports.report.definition.DRIVariable} object. + * @return a {@link software.xdev.dynamicreports.design.base.DRDesignGroup} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignGroup getVariableResetGroup(DRIVariable> variable) throws DRException { + return null; + } + + private void transformSort(DRISort sort) throws DRException { + DRIDesignExpression expression = transformExpression(sort.getExpression()); + DRIDesignExpression sortExpression; + if (expression instanceof DRIDesignField || expression instanceof DRIDesignVariable) { + sortExpression = expression; + } else { + @SuppressWarnings( {"rawtypes", "unchecked"}) DRVariable variable = new DRVariable(sort.getExpression(), Calculation.NOTHING); + variable.setResetType(Evaluation.NONE); + sortExpression = transformExpression(variable); + } + + DRDesignSort designSort = new DRDesignSort(); + designSort.setExpression(sortExpression); + designSort.setOrderType(sort.getOrderType()); + + sorts.add(designSort); + } + + /** + *transformPropertyExpression.
+ * + * @param propertyExpression a {@link software.xdev.dynamicreports.report.definition.expression.DRIPropertyExpression} object. + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignPropertyExpression} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRIDesignPropertyExpression transformPropertyExpression(DRIPropertyExpression propertyExpression) throws DRException { + DRDesignPropertyExpression designPropertyExpression = new DRDesignPropertyExpression(); + designPropertyExpression.setName(propertyExpression.getName()); + designPropertyExpression.setValueExpression(transformExpression(propertyExpression.getValueExpression())); + return designPropertyExpression; + } + + /** + *transformParameterExpression.
+ * + * @param parameterExpression a {@link software.xdev.dynamicreports.report.definition.expression.DRIParameterExpression} object. + * @return a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignParameterExpression} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRIDesignParameterExpression transformParameterExpression(DRIParameterExpression parameterExpression) throws DRException { + DRDesignParameterExpression designParameterExpression = new DRDesignParameterExpression(); + designParameterExpression.setName(parameterExpression.getName()); + designParameterExpression.setValueExpression(transformExpression(parameterExpression.getValueExpression())); + return designParameterExpression; + } + + private DRIDesignExpression addExpression(DRIDesignExpression expression) { + if (expression == null) { + return null; + } + if (expression instanceof DRIDesignField) { + return addField((DRIDesignField) expression); + } else if (expression instanceof DRIDesignVariable) { + addVariable((DRDesignVariable) expression); + } else if (expression instanceof DRIDesignSystemExpression) { + addSystemExpression((DRIDesignSystemExpression) expression); + } else if (expression instanceof DRIDesignJasperExpression) { + addJasperExpression((DRIDesignJasperExpression) expression); + } else if (expression instanceof DRIDesignSimpleExpression) { + addSimpleExpression((DRIDesignSimpleExpression) expression); + } else if (expression instanceof DRIDesignComplexExpression) { + addComplexExpression((DRIDesignComplexExpression) expression); + } else { + throw new DRDesignReportException("Expression " + expression.getClass().getName() + " not supported"); + } + return expression; + } + + private void addVariable(DRDesignVariable variable) { + if (variables.containsKey(variable.getName())) { + if (!variables.get(variable.getName()).equals(variable)) { + throw new DRDesignReportException("Duplicate declaration of variable \"" + variable.getName() + "\""); + } + return; + } + variables.put(variable.getName(), variable); + } + + private DRIDesignField addField(DRIDesignField field) { + if (fields.containsKey(field.getName())) { + DRIDesignField fld = fields.get(field.getName()); + if (!fld.getValueClass().equals(field.getValueClass())) { + throw new DRDesignReportException("Duplicate declaration of field \"" + field.getName() + "\""); + } + return fld; + } + fields.put(field.getName(), field); + return field; + } + + private void addSystemExpression(DRIDesignSystemExpression systemExpression) { + if (systemExpressions.containsKey(systemExpression.getName())) { + return; + } + systemExpressions.put(systemExpression.getName(), systemExpression); + } + + private void addJasperExpression(DRIDesignJasperExpression jasperExpression) { + if (jasperExpressions.containsKey(jasperExpression.getName())) { + return; + } + jasperExpressions.put(jasperExpression.getName(), jasperExpression); + } + + private void addSimpleExpression(DRIDesignSimpleExpression simpleExpression) { + if (simpleExpressions.containsKey(simpleExpression.getName())) { + if (!simpleExpressions.get(simpleExpression.getName()).equals(simpleExpression)) { + throw new DRDesignReportException("Duplicate declaration of simple expression \"" + simpleExpression.getName() + "\""); + } + return; + } + simpleExpressions.put(simpleExpression.getName(), simpleExpression); + } + + private void addComplexExpression(DRIDesignComplexExpression complexExpression) { + if (complexExpressions.containsKey(complexExpression.getName())) { + if (!complexExpressions.get(complexExpression.getName()).equals(complexExpression)) { + throw new DRDesignReportException("Duplicate declaration of complex expression \"" + complexExpression.getName() + "\""); + } + return; + } + complexExpressions.put(complexExpression.getName(), complexExpression); + } + + /** + *Getter for the field fields
.
Getter for the field variables
.
Getter for the field systemExpressions
.
Getter for the field jasperExpressions
.
Getter for the field simpleExpressions
.
Getter for the field complexExpressions
.
Getter for the field sorts
.
transformFields.
+ * + * @return a {@link java.util.List} object. + */ + protected abstract List extends DRIField>> transformFields(); + + /** + *transformVariables.
+ * + * @return a {@link java.util.List} object. + */ + protected abstract List extends DRIVariable>> transformVariables(); + + /** + *transformSorts.
+ * + * @return a {@link java.util.List} object. + */ + protected abstract List extends DRISort> transformSorts(); + + /** + *getDataset.
+ * + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignDataset} object. + */ + protected abstract DRIDesignDataset getDataset(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/BandComponentsTransform.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/BandComponentsTransform.java new file mode 100644 index 0000000..e0076f1 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/BandComponentsTransform.java @@ -0,0 +1,454 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeConstructor for BandComponentsTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public BandComponentsTransform(DesignTransformAccessor accessor) { + this.accessor = accessor; + componentNames = new HashMapprepareBand.
+ * + * @param band a {@link software.xdev.dynamicreports.design.base.DRDesignBand} object. + * @param maxWidth a int. + * @param templateDesignComponents a int. + * @return a {@link software.xdev.dynamicreports.design.base.DRDesignBand} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public DRDesignBand prepareBand(DRDesignBand band, int maxWidth, int templateDesignComponents) throws DRException { + if (band == null) { + return null; + } + if (band.getBandComponent() != null) { + return band; + } + + DRDesignComponent component = prepareList(band.getName(), band.getList(), maxWidth); + if (component == null) { + if (band.getList() == null || band.getList().getHeight() == null || band.getList().getHeight() == 0) { + return null; + } + } + band.setHeight(band.getList().getHeight()); + band.setBandComponent(component); + + if (band.getBandComponent() != null && templateDesignComponents > 0) { + throw new DRException("Band " + band.getName() + " must not be defined at once in jrxml template design and in dynamic design"); + } + + prepareListBackgroundComponents(component); + prepareCrosstabs(component); + + return band; + } + + private DRDesignComponent prepareList(String name, DRDesignList list, int maxWidth) throws DRException { + return prepareList(name, list, maxWidth, -1); + } + + private DRDesignComponent prepareList(String name, DRDesignList list, int maxWidth, int maxHeight) throws DRException { + if (list == null) { + return null; + } + if (list.isEmpty()) { + return null; + } + + ComponentPosition.component(name, list, maxWidth, maxHeight); + + DRDesignComponent component = removeEmptyComponents(list); + if (component == null) { + return null; + } + componentGroupType(component); + + generateComponentNames(component, name); + + return component; + } + + private void generateComponentNames(DRDesignComponent component, String bandName) { + String componentName = bandName + "." + component.getUniqueName(); + if (!componentNames.containsKey(componentName)) { + componentNames.put(componentName, 1); + } else { + componentNames.put(componentName, componentNames.get(componentName) + 1); + } + component.setUniqueName(componentName + componentNames.get(componentName)); + if (component instanceof DRDesignList) { + DRDesignList list = (DRDesignList) component; + for (DRDesignComponent lComponent : list.getComponents()) { + generateComponentNames(lComponent, bandName); + } + if (list.getBackgroundComponent() != null) { + list.getBackgroundComponent().setUniqueName(component.getUniqueName() + ".background"); + } + } + } + + private DRDesignComponent removeEmptyComponents(DRDesignComponent component) { + if (component instanceof DRDesignList) { + DRDesignList list = (DRDesignList) component; + if (list.getComponents().isEmpty()) { + return null; + } else if (list.getComponents().size() == 1) { + DRDesignComponent lComponent = list.getComponents().get(0); + DRDesignComponent elm = removeEmptyComponents(lComponent); + if (elm == null) { + if (list.getWidth() > 0 && list.getHeight() > 0 && (list.getStyle() != null || list.getBackgroundComponent() != null)) { + list.getComponents().clear(); + return list; + } + return null; + } + if (lComponent != elm && (!(lComponent instanceof DRDesignList) || lComponent instanceof DRDesignList && + !(lComponent.getStyle() == null && lComponent.getPrintWhenExpression() == null && ((DRDesignList) lComponent).getBackgroundComponent() == null))) { + elm.setX(lComponent.getX() + elm.getX()); + elm.setY(lComponent.getY() + elm.getY()); + } + + if (list.getStyle() == null && list.getPrintWhenExpression() == null && list.getBackgroundComponent() == null) { + elm.setX(list.getX() + elm.getX()); + elm.setY(list.getY() + elm.getY()); + return elm; + } else { + list.getComponents().clear(); + list.getComponents().add(elm); + return list; + } + } else { + ListBandTransform class.
+ * + * @author Ricardo Mariaca + * + */ +public class BandTransform { + private DesignTransformAccessor accessor; + + private DRDesignBand titleBand; + private DRDesignBand pageHeaderBand; + private DRDesignBand pageFooterBand; + private DRDesignBand columnHeaderBand; + private DRDesignBand columnHeaderForGroupBand; + private DRDesignBand columnFooterBand; + private ListConstructor for BandTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public BandTransform(DesignTransformAccessor accessor) { + this.accessor = accessor; + this.detailBands = new ArrayListtransform.
+ * + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public void transform() throws DRException { + TemplateTransform templateTransform = accessor.getTemplateTransform(); + + DRIReport report = accessor.getReport(); + + DRIBand band = report.getTitleBand(); + titleBand = band("title", band, templateTransform.getTitleSplitType(band), templateTransform.getTitleStyle(band), templateTransform.getTitleBackgroundComponent(band), ResetType.REPORT, null); + + band = report.getPageHeaderBand(); + pageHeaderBand = band("pageHeader", band, templateTransform.getPageHeaderSplitType(band), templateTransform.getPageHeaderStyle(band), templateTransform.getPageHeaderBackgroundComponent(band), + ResetType.PAGE, null); + + band = report.getPageFooterBand(); + pageFooterBand = band("pageFooter", band, templateTransform.getPageFooterSplitType(band), templateTransform.getPageFooterStyle(band), templateTransform.getPageFooterBackgroundComponent(band), + ResetType.PAGE, null); + + band = report.getColumnHeaderBand(); + columnHeaderBand = + band("columnHeader", band, templateTransform.getColumnHeaderSplitType(band), templateTransform.getColumnHeaderStyle(band), templateTransform.getColumnHeaderBackgroundComponent(band), + ResetType.COLUMN, null); + + for (DRIGroup group : report.getGroups()) { + if (templateTransform.isGroupShowColumnHeaderAndFooter(group)) { + band = report.getColumnHeaderBand(); + columnHeaderForGroupBand = band("columnHeaderForGroup", band, templateTransform.getColumnHeaderSplitType(band), templateTransform.getColumnHeaderStyle(band), + templateTransform.getColumnHeaderBackgroundComponent(band), ResetType.COLUMN, null); + break; + } + } + + band = report.getColumnFooterBand(); + columnFooterBand = + band("columnFooter", band, templateTransform.getColumnFooterSplitType(band), templateTransform.getColumnFooterStyle(band), templateTransform.getColumnFooterBackgroundComponent(band), + ResetType.COLUMN, null); + + band = report.getDetailHeaderBand(); + detailBands.add( + band("detailHeader", band, templateTransform.getDetailHeaderSplitType(band), templateTransform.getDetailHeaderStyle(band), templateTransform.getDetailHeaderBackgroundComponent(band), + ResetType.REPORT, null)); + + band = report.getDetailBand(); + detailBand = + band("detail", band, templateTransform.getDetailSplitType(band), templateTransform.getDetailStyle(band), templateTransform.getDetailBackgroundComponent(band), ResetType.REPORT, null); + detailBands.add(detailBand); + + band = report.getDetailFooterBand(); + detailBands.add( + band("detailFooter", band, templateTransform.getDetailFooterSplitType(band), templateTransform.getDetailFooterStyle(band), templateTransform.getDetailFooterBackgroundComponent(band), + ResetType.REPORT, null)); + + band = report.getLastPageFooterBand(); + lastPageFooterBand = band("lastPageFooter", band, templateTransform.getLastPageFooterSplitType(band), templateTransform.getLastPageFooterStyle(band), + templateTransform.getLastPageFooterBackgroundComponent(band), ResetType.PAGE, null); + + band = report.getSummaryBand(); + summaryBand = + band("summary", band, templateTransform.getSummarySplitType(band), templateTransform.getSummaryStyle(band), templateTransform.getSummaryBackgroundComponent(band), ResetType.NONE, null); + + band = report.getNoDataBand(); + noDataBand = + band("noData", band, templateTransform.getNoDataSplitType(band), templateTransform.getNoDataStyle(band), templateTransform.getNoDataBackgroundComponent(band), ResetType.NONE, null); + + band = report.getBackgroundBand(); + backgroundBand = band("background", band, templateTransform.getBackgroundSplitType(band), templateTransform.getBackgroundStyle(band), templateTransform.getBackgroundBackgroundComponent(band), + ResetType.NONE, null); + } + + /** + *prepareBands.
+ * + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public void prepareBands() throws DRException { + BandComponentsTransform bandComponents = new BandComponentsTransform(accessor); + DRITemplateDesign> templateDesign = accessor.getReport().getTemplateDesign(); + int maxWidth = accessor.getPageTransform().getMaxBandWidth(); + int maxColumnWidth = accessor.getPageTransform().getPage().getColumnWidth(); + + titleBand = bandComponents.prepareBand(titleBand, maxWidth, templateDesign.getTitleComponentsCount()); + pageHeaderBand = bandComponents.prepareBand(pageHeaderBand, maxWidth, templateDesign.getPageHeaderComponentsCount()); + pageFooterBand = bandComponents.prepareBand(pageFooterBand, maxWidth, templateDesign.getPageFooterComponentsCount()); + columnHeaderBand = bandComponents.prepareBand(columnHeaderBand, maxColumnWidth, templateDesign.getColumnHeaderComponentsCount()); + columnFooterBand = bandComponents.prepareBand(columnFooterBand, maxColumnWidth, templateDesign.getColumnFooterComponentsCount()); + Listband.
+ * + * @param bandName a {@link java.lang.String} object. + * @param bandName a {@link java.lang.String} object. + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @param splitType a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + * @param defaultStyle a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + * @param defaultBackgroundComponent a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + * @param resetType a {@link software.xdev.dynamicreports.design.constant.ResetType} object. + * @param resetGroup a {@link software.xdev.dynamicreports.design.base.DRDesignGroup} object. + * @return a {@link software.xdev.dynamicreports.design.base.DRDesignBand} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignBand band(String bandName, DRIBand band, SplitType splitType, DRIReportStyle defaultStyle, DRIComponent defaultBackgroundComponent, ResetType resetType, DRDesignGroup resetGroup) + throws DRException { + DRDesignBand designBand = new DRDesignBand(bandName); + designBand.setSplitType(splitType); + designBand.setList(accessor.getComponentTransform().list(band.getList(), DefaultStyleType.TEXT, resetType, resetGroup)); + designBand.setPrintWhenExpression(accessor.getExpressionTransform().transformExpression(band.getPrintWhenExpression())); + + if (designBand.getList().getStyle() == null && defaultStyle != null) { + designBand.getList().setStyle(accessor.getStyleTransform().transformStyle(defaultStyle, false, DefaultStyleType.NONE)); + } + if (designBand.getList().getBackgroundComponent() == null && defaultBackgroundComponent != null) { + designBand.getList().setBackgroundComponent(accessor.getComponentTransform().listBackgroundComponent(defaultBackgroundComponent, DefaultStyleType.TEXT, resetType, resetGroup)); + } + + return designBand; + } + + /** + *band.
+ * + * @param bandName a {@link java.lang.String} object. + * @param bandName a {@link java.lang.String} object. + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @param splitType a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + * @param defaultStyle a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + * @param defaultBackgroundComponent a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + * @return a {@link software.xdev.dynamicreports.design.base.DRDesignBand} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignBand band(String bandName, DRIBand band, SplitType splitType, DRIReportStyle defaultStyle, DRIComponent defaultBackgroundComponent) throws DRException { + DRDesignBand designBand = new DRDesignBand(bandName); + designBand.setSplitType(splitType); + DRDesignList list = new DRDesignList(); + list.setType(band.getList().getType()); + list.setGap(accessor.getTemplateTransform().getListGap(band.getList())); + list.setStretchType(accessor.getTemplateTransform().getStretchType(band.getList())); + list.setPrintWhenExpression(accessor.getExpressionTransform().transformExpression(band.getList().getPrintWhenExpression())); + list.setStyle(accessor.getStyleTransform().transformStyle(band.getList().getStyle(), false, DefaultStyleType.NONE)); + designBand.setList(list); + + if (list.getStyle() == null && defaultStyle != null) { + list.setStyle(accessor.getStyleTransform().transformStyle(defaultStyle, false, DefaultStyleType.NONE)); + } + if (designBand.getList().getBackgroundComponent() == null && defaultBackgroundComponent != null) { + designBand.getList().setBackgroundComponent(accessor.getComponentTransform().listBackgroundComponent(defaultBackgroundComponent, DefaultStyleType.TEXT, ResetType.NONE, null)); + } + + return designBand; + } + + /** + *Getter for the field titleBand
.
Getter for the field pageHeaderBand
.
Getter for the field pageFooterBand
.
Getter for the field columnHeaderBand
.
Getter for the field columnHeaderForGroupBand
.
Getter for the field columnFooterBand
.
Getter for the field detailBands
.
Getter for the field detailBand
.
Getter for the field lastPageFooterBand
.
Getter for the field summaryBand
.
Getter for the field noDataBand
.
Getter for the field backgroundBand
.
Constructor for ColumnGrid.
+ */ + public ColumnGrid() { + columnsLists = new HashMapaddList.
+ * + * @param column a {@link software.xdev.dynamicreports.report.definition.column.DRIColumn} object. + * @param list a {@link software.xdev.dynamicreports.design.base.component.DRDesignList} object. + */ + public void addList(DRIColumn> column, DRDesignList list) { + columnsLists.put(column, list); + } + + /** + *addComponent.
+ * + * @param column a {@link software.xdev.dynamicreports.report.definition.column.DRIColumn} object. + * @param component a {@link software.xdev.dynamicreports.design.base.component.DRDesignComponent} object. + */ + public void addComponent(DRIColumn> column, DRDesignComponent component) { + if (columnsLists.containsKey(column)) { + columnsLists.get(column).addComponent(component); + } + } + + /** + *addComponent.
+ * + * @param column a {@link software.xdev.dynamicreports.report.definition.column.DRIColumn} object. + * @param horizontalAlignment a {@link software.xdev.dynamicreports.report.constant.HorizontalCellComponentAlignment} object. + * @param verticalAlignment a {@link software.xdev.dynamicreports.report.constant.VerticalCellComponentAlignment} object. + * @param component a {@link software.xdev.dynamicreports.design.base.component.DRDesignComponent} object. + */ + public void addComponent(DRIColumn> column, HorizontalCellComponentAlignment horizontalAlignment, VerticalCellComponentAlignment verticalAlignment, DRDesignComponent component) { + if (columnsLists.containsKey(column)) { + columnsLists.get(column).addComponent(horizontalAlignment, verticalAlignment, component); + } + } + + /** + *Getter for the field list
.
Setter for the field list
.
isEmpty.
+ * + * @return a boolean. + */ + public boolean isEmpty() { + for (DRDesignList list : columnsLists.values()) { + if (!list.isEmpty()) { + return false; + } + } + return isEmpty; + } + + /** + *setEmpty.
+ * + * @param isEmpty a boolean. + */ + public void setEmpty(boolean isEmpty) { + this.isEmpty = isEmpty; + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ColumnGridTransform.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ColumnGridTransform.java new file mode 100644 index 0000000..a1b05d8 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ColumnGridTransform.java @@ -0,0 +1,273 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeColumnGridTransform class.
+ * + * @author Ricardo Mariaca, Jan Moxter + * + */ +public class ColumnGridTransform { + private final DesignTransformAccessor accessor; + private DRIColumnGridList columnGridList; + + /** + *Constructor for ColumnGridTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public ColumnGridTransform(final DesignTransformAccessor accessor) { + this.accessor = accessor; + } + + /** + *transform.
+ */ + public void transform() { + final DRIReport report = accessor.getReport(); + final DRIColumnGrid columnGrid = report.getColumnGrid(); + if (columnGrid != null && !columnGrid.getList().getListCells().isEmpty()) { + this.columnGridList = columnGrid.getList(); + return; + } + + final DRColumnGridList columnGridList = new DRColumnGridList(); + if (columnGrid != null) { + columnGridList.setGap(columnGrid.getList().getGap()); + columnGridList.setType(columnGrid.getList().getType()); + } + addColumnsToGridList(columnGridList); + this.columnGridList = columnGridList; + } + + private void addColumnsToGridList(final DRColumnGridList columnGridList) { + final DRIReport report = accessor.getReport(); + for (final DRIColumn> column : report.getColumns()) { + if (!accessor.getGroupTransform().getHideGroupColumns().contains(column)) { + columnGridList.addComponent(column); + } + } + } + + /** + *createColumnGrid.
+ * + * @return a {@link software.xdev.dynamicreports.design.transformation.ColumnGrid} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected ColumnGrid createColumnGrid() throws DRException { + return createColumnGrid(columnGridList, null, false); + } + + /** + *createColumnTitleGrid.
+ * + * @param groupPaddingStyle a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link software.xdev.dynamicreports.design.transformation.ColumnGrid} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected ColumnGrid createColumnTitleGrid(final DRDesignStyle groupPaddingStyle) throws DRException { + return createColumnGrid(columnGridList, groupPaddingStyle, true); + } + + private ColumnGrid createColumnGrid(final DRIColumnGridList columnGridList, final DRDesignStyle groupPaddingStyle, final boolean titleGroup) throws DRException { + final ColumnGrid columnGrid = new ColumnGrid(); + final DRDesignList list = list(columnGridList, columnGrid, titleGroup).getList(); + final int groupPadding = accessor.getGroupTransform().getGroupPadding(); + if (groupPadding > 0) { + final DRDesignFiller filler = new DRDesignFiller(); + filler.setStyle(groupPaddingStyle); + filler.setWidth(groupPadding); + filler.setHeight(0); + list.addComponent(0, HorizontalCellComponentAlignment.CENTER, null, filler); + } + columnGrid.setList(list); + return columnGrid; + } + + private GridList list(final DRIColumnGridComponent columnGridComponent, final ColumnGrid columnGrid, final boolean titleGroup) throws DRException { + if (columnGridComponent instanceof DRIColumn>) { + final DRDesignList list = new DRDesignList(ListType.VERTICAL); + final DRIColumn> column = (DRIColumn>) columnGridComponent; + list.setWidth(accessor.getTemplateTransform().getColumnWidth(column, accessor.getStyleTransform().getDefaultStyle(DefaultStyleType.COLUMN))); + columnGrid.addList(column, list); + return new GridList(list, null); + } else if (columnGridComponent instanceof DRIColumnGridList) { + return new GridList(columnGridList((DRIColumnGridList) columnGridComponent, columnGrid, titleGroup), null); + } else if (columnGridComponent instanceof DRIColumnTitleGroup) { + return columnGridTitleGroup((DRIColumnTitleGroup) columnGridComponent, columnGrid, titleGroup); + } else { + throw new DRDesignReportException("Column grid component " + columnGridComponent.getClass().getName() + " not supported"); + } + } + + private DRDesignList columnGridList(final DRIColumnGridList columnGridList, final ColumnGrid columnGrid, final boolean titleGroup) throws DRException { + final DRDesignList list = new DRDesignList(); + list.setType(columnGridList.getType()); + list.setGap(columnGridList.getGap()); + for (final DRIColumnGridListCell cell : columnGridList.getListCells()) { + final DRIColumnGridComponent component = cell.getComponent(); + HorizontalCellComponentAlignment horizontalAlignment = cell.getHorizontalAlignment(); + VerticalCellComponentAlignment verticalAlignment = cell.getVerticalAlignment(); + if (component instanceof DRIColumn>) { + final DRIColumn> column = (DRIColumn>) component; + if (column instanceof DRIBooleanColumn) { + if (horizontalAlignment == null) { + horizontalAlignment = ConstantTransform.toHorizontalCellComponentAlignment(((DRIBooleanColumn) column).getComponent().getWidthType()); + } + if (verticalAlignment == null) { + verticalAlignment = ConstantTransform.toVerticalCellComponentAlignment(((DRIBooleanColumn) column).getComponent().getHeightType()); + } + } else { + final DRIComponent columnComponent = accessor.getColumnTransform().getColumnComponent(column); + if (columnComponent instanceof DRIDimensionComponent) { + if (horizontalAlignment == null) { + horizontalAlignment = ConstantTransform.toHorizontalCellComponentAlignment(((DRIDimensionComponent) columnComponent).getWidthType()); + } + if (verticalAlignment == null) { + verticalAlignment = ConstantTransform.toVerticalCellComponentAlignment(((DRIDimensionComponent) columnComponent).getHeightType()); + } + } + } + } + final GridList gridList = list(component, columnGrid, titleGroup); + if (gridList.getHorizontalCellAlignment() != null) { + list.addComponent(gridList.getHorizontalCellAlignment(), cell.getVerticalAlignment(), gridList.getList()); + } else { + list.addComponent(horizontalAlignment, cell.getVerticalAlignment(), gridList.getList()); + } + } + return list; + } + + @SuppressWarnings("unchecked") + private GridList columnGridTitleGroup(final DRIColumnTitleGroup columnGridTitleGroup, final ColumnGrid columnGrid, final boolean titleGroup) throws DRException { + final DRDesignList columnList = list(columnGridTitleGroup.getList(), columnGrid, titleGroup).getList(); + + @SuppressWarnings("rawtypes") final DRTextField titleGroupField = new DRTextField(); + titleGroupField.setValueExpression(columnGridTitleGroup.getTitleExpression()); + titleGroupField.setStyle(columnGridTitleGroup.getTitleStyle()); + titleGroupField.setHeight(columnGridTitleGroup.getTitleHeight()); + titleGroupField.setHeightType(columnGridTitleGroup.getTitleHeightType()); + titleGroupField.setRows(columnGridTitleGroup.getTitleRows()); + titleGroupField.setStretchWithOverflow(columnGridTitleGroup.getTitleStretchWithOverflow()); + titleGroupField.setTextAdjust(columnGridTitleGroup.getTitleTextAdjust()); + titleGroupField.setPropertyExpressions(columnGridTitleGroup.getTitlePropertyExpressions()); + + HorizontalCellComponentAlignment hCellAlignment = null; + if (columnGridTitleGroup.getTitleWidth() == null && columnGridTitleGroup.getTitleColumns() == null) { + int totalWidth = 0; + for (final DRDesignListCell cell : columnList.getListCells()) { + final Integer width = cell.getComponent().getWidth(); + final HorizontalCellComponentAlignment horizontalAlignment = cell.getHorizontalAlignment(); + if (horizontalAlignment == null || horizontalAlignment.equals(HorizontalCellComponentAlignment.EXPAND) || horizontalAlignment.equals(HorizontalCellComponentAlignment.FLOAT)) { + totalWidth = 0; + break; + } + if (width != null) { + totalWidth += width; + } + } + if (totalWidth > 0) { + titleGroupField.setWidth(totalWidth); + hCellAlignment = HorizontalCellComponentAlignment.LEFT; + } + } else { + if (columnGridTitleGroup.getTitleWidth() != null) { + titleGroupField.setWidth(columnGridTitleGroup.getTitleWidth()); + } + if (columnGridTitleGroup.getTitleColumns() != null) { + titleGroupField.setColumns(columnGridTitleGroup.getTitleColumns()); + } + hCellAlignment = ConstantTransform.toHorizontalCellComponentAlignment(columnGridTitleGroup.getTitleWidthType()); + } + + final DRDesignTextField designTitleGroupField = accessor.getComponentTransform().textField(titleGroupField, DefaultStyleType.COLUMN_TITLE); + designTitleGroupField.setUniqueName("columngroup.title"); + + if (!titleGroup || columnGridTitleGroup.getTitleExpression() == null) { + columnList.setRemovable(true); + if (hCellAlignment != null) { + final DRDesignList list = new DRDesignList(); + list.setType(ListType.VERTICAL); + list.addComponent(columnList); + list.setWidth(designTitleGroupField.getWidth()); + return new GridList(list, hCellAlignment); + } + return new GridList(columnList, null); + } + + columnGrid.setEmpty(!titleGroup); + + final DRDesignList list = new DRDesignList(); + list.setType(ListType.VERTICAL); + if (hCellAlignment != null) { + list.addComponent(hCellAlignment, null, designTitleGroupField); + list.addComponent(columnList); + list.setWidth(designTitleGroupField.getWidth()); + return new GridList(list, hCellAlignment); + } else { + list.addComponent(designTitleGroupField); + list.addComponent(columnList); + return new GridList(list, null); + } + } + + private class GridList { + private final HorizontalCellComponentAlignment horizontalCellAlignment; + private final DRDesignList list; + + private GridList(final DRDesignList list, final HorizontalCellComponentAlignment horizontalCellAlignment) { + this.list = list; + this.horizontalCellAlignment = horizontalCellAlignment; + } + + public HorizontalCellComponentAlignment getHorizontalCellAlignment() { + return horizontalCellAlignment; + } + + public DRDesignList getList() { + return list; + } + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ColumnTransform.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ColumnTransform.java new file mode 100644 index 0000000..b5f9233 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ColumnTransform.java @@ -0,0 +1,272 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeColumnTransform class.
+ * + * @author Ricardo Mariaca, Jan Moxter + * + */ +public class ColumnTransform { + private final DesignTransformAccessor accessor; + private MapConstructor for ColumnTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public ColumnTransform(final DesignTransformAccessor accessor) { + this.accessor = accessor; + } + + // columns + + /** + *transform.
+ * + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public void transform() throws DRException { + columnComponents = getColumnComponents(); + final boolean showColumnTitle = accessor.getTemplateTransform().isShowColumnTitle(); + final boolean showColumnValues = accessor.getTemplateTransform().isShowColumnValues(); + final boolean showColumnTitleForGroup = accessor.getBandTransform().getColumnHeaderForGroupBand() != null; + + ColumnGrid columnTitle = null; + if (showColumnTitle) { + columnTitle = accessor.getColumnGridTransform().createColumnTitleGrid(accessor.getStyleTransform().getDefaultStyle(DefaultStyleType.COLUMN_TITLE)); + } + ColumnGrid columnTitleForGroup = null; + if (showColumnTitleForGroup) { + columnTitleForGroup = accessor.getColumnGridTransform().createColumnTitleGrid(accessor.getStyleTransform().getDefaultStyle(DefaultStyleType.COLUMN_TITLE)); + } + final ColumnGrid detail = accessor.getColumnGridTransform().createColumnGrid(); + + for (final DRIColumn> column : accessor.getReport().getColumns()) { + if (!accessor.getGroupTransform().getHideGroupColumns().contains(column)) { + if (column.getTitleExpression() != null) { + if (showColumnTitle) { + columnTitle.addComponent(column, titleComponent(column)); + } + if (showColumnTitleForGroup) { + columnTitleForGroup.addComponent(column, titleComponent(column)); + } + } + DRDesignComponent detailComponent = null; + if (column instanceof DRIValueColumn>) { + detailComponent = detailValueComponent((DRIValueColumn>) column); + } else if (column instanceof DRIBooleanColumn) { + detailComponent = detailBooleanComponent((DRIBooleanColumn) column); + } else { + detailComponent = detailComponent(column); + } + detail.addComponent(column, detailComponent); + } + } + + if (showColumnTitle && !columnTitle.isEmpty()) { + accessor.getBandTransform().getColumnHeaderBand().addComponent(0, columnTitle.getList()); + } + if (showColumnTitleForGroup && !columnTitleForGroup.isEmpty()) { + accessor.getBandTransform().getColumnHeaderForGroupBand().addComponent(0, columnTitleForGroup.getList()); + } + if (showColumnValues) { + accessor.getBandTransform().getDetailBand().addComponent(detail.getList()); + } + } + + private MapgetColumnComponent.
+ * + * @param column a {@link software.xdev.dynamicreports.report.definition.column.DRIColumn} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + public DRIComponent getColumnComponent(final DRIColumn> column) { + return columnComponents.get(column); + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ComponentPosition.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ComponentPosition.java new file mode 100644 index 0000000..77f815c --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ComponentPosition.java @@ -0,0 +1,836 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seecomponent.
+ * + * @param name a {@link java.lang.String} object. + * @param component a {@link software.xdev.dynamicreports.design.base.component.DRDesignComponent} object. + * @param maxWidth a int. + * @param maxHeight a int. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected static void component(String name, DRDesignComponent component, int maxWidth, int maxHeight) throws DRException { + if (component instanceof DRDesignList) { + DRDesignList list = (DRDesignList) component; + list.setX(0); + list.setY(0); + list(name, list, maxWidth, maxHeight, true); + list(name, list); + } else { + throw new DRDesignReportException("Component " + component.getClass().getName() + " position not supported"); + } + } + + private static void list(String name, DRDesignList list, int maxWidth, int maxHeight, boolean stretch) throws DRException { + width(list); + alignment(list); + recalculateWidth(name, list, maxWidth - StyleResolver.getHorizontalPadding(list.getStyle())); + height(list); + + int availableWidth = maxWidth - list.getWidth(); + if (availableWidth < 0) { + throw new DRException(name + " components reaches outside available width, available width = " + maxWidth + ", components width = " + list.getWidth()); + } + if (stretch) { + list.setWidth(list.getWidth() + availableWidth); + } + + if (maxHeight > 0) { + int availableHeight = maxHeight - list.getHeight(); + if (availableHeight < 0) { + throw new DRException(name + " components reaches outside available height, available height = " + maxHeight + ", components height = " + list.getHeight()); + } + if (stretch) { + list.setHeight(list.getHeight() + availableHeight); + } + } + + listCellWidth(list, availableWidth, list.getWidth() - StyleResolver.getHorizontalPadding(list.getStyle())); + listCellX(list); + listCellHeight(list, list.getHeight() - StyleResolver.getVerticalPadding(list.getStyle())); + listCellY(list); + + componentX(list); + componentY(list); + componentWidth(list); + componentHeight(list); + } + + private static void list(String name, DRDesignList list) throws DRException { + for (DRDesignComponent designComponent : list.getComponents()) { + if (designComponent instanceof DRDesignList) { + DRDesignList listComponent = (DRDesignList) designComponent; + if (!listComponent.isCalculateComponents()) { + listComponent.setCalculateComponents(true); + list(name, listComponent, listComponent.getWidth(), listComponent.getHeight(), false); + } + list(name, listComponent); + } + } + } + + private static void alignment(DRDesignList list) { + for (DRDesignListCell listCell : list.getListCells()) { + if (listCell.getComponent() instanceof DRDesignList) { + DRDesignList comList = (DRDesignList) listCell.getComponent(); + alignment(comList); + if (listCell.getHorizontalAlignment() == null) { + listCell.setHorizontalAlignment(detectHorizontalCellComponentAlignment(comList)); + } + if (listCell.getVerticalAlignment() == null) { + listCell.setVerticalAlignment(detectVerticalCellComponentAlignment(comList)); + } + } + if (listCell.getHorizontalAlignment() == null) { + listCell.setHorizontalAlignment(Defaults.getDefaults().getHorizontalCellComponentAlignment()); + } + if (listCell.getVerticalAlignment() == null) { + listCell.setVerticalAlignment(Defaults.getDefaults().getVerticalCellComponentAlignment()); + } + } + } + + private static HorizontalCellComponentAlignment detectHorizontalCellComponentAlignment(DRDesignList list) { + ListType type = list.getType(); + + if (type == null) { + return null; + } + + switch (type) { + case HORIZONTAL: + case HORIZONTAL_FLOW: + for (DRDesignListCell listCell : list.getListCells()) { + switch (listCell.getHorizontalAlignment()) { + case EXPAND: + case FLOAT: + return null; + default: + break; + } + } + return HorizontalCellComponentAlignment.LEFT; + case VERTICAL: + HorizontalCellComponentAlignment alignment = null; + int maxWidth = 0; + for (DRDesignComponent designComponent : list.getComponents()) { + if (designComponent.getWidth() > maxWidth) { + maxWidth = designComponent.getWidth(); + } + } + for (DRDesignListCell listCell : list.getListCells()) { + switch (listCell.getHorizontalAlignment()) { + case EXPAND: + return HorizontalCellComponentAlignment.EXPAND; + case FLOAT: + alignment = HorizontalCellComponentAlignment.FLOAT; + break; + default: + if (alignment == null) { + alignment = HorizontalCellComponentAlignment.LEFT; + } else { + if (alignment != HorizontalCellComponentAlignment.LEFT && maxWidth == listCell.getComponent().getWidth()) { + return HorizontalCellComponentAlignment.EXPAND; + } + } + break; + } + } + return alignment; + default: + throw new DRDesignReportException("List type " + type.name() + " not supported"); + } + } + + private static VerticalCellComponentAlignment detectVerticalCellComponentAlignment(DRDesignList list) { + ListType type = list.getType(); + + if (type == null) { + return null; + } + + switch (type) { + case HORIZONTAL: + case HORIZONTAL_FLOW: + VerticalCellComponentAlignment alignment = null; + for (DRDesignListCell listCell : list.getListCells()) { + switch (listCell.getVerticalAlignment()) { + case EXPAND: + return VerticalCellComponentAlignment.EXPAND; + default: + if (alignment == null) { + alignment = VerticalCellComponentAlignment.TOP; + } + break; + } + } + return alignment; + case VERTICAL: + return null; + default: + throw new DRDesignReportException("List type " + type.name() + " not supported"); + } + } + + /** + *width.
+ * + * @param list a {@link software.xdev.dynamicreports.design.base.component.DRDesignList} object. + */ + protected static void width(DRDesignList list) { + int maxWidth = 0; + ListType type = list.getType(); + + if (type != null) { + switch (type) { + case HORIZONTAL: + case HORIZONTAL_FLOW: + for (DRDesignComponent component : list.getComponents()) { + if (component instanceof DRDesignList) { + width((DRDesignList) component);// , availableWidth - StyleResolver.getHorizontalPadding(component.getStyle())); + } + if (component.getWidth() == null) { + throw new DRDesignReportException("Component has null width"); + } + maxWidth += component.getWidth() + list.getGap(); + } + if (!list.getComponents().isEmpty()) { + maxWidth -= list.getGap(); + } + break; + case VERTICAL: + for (DRDesignComponent component : list.getComponents()) { + if (component instanceof DRDesignList) { + width((DRDesignList) component);// , availableWidth - StyleResolver.getHorizontalPadding(component.getStyle())); + } + if (component.getWidth() == null) { + throw new DRDesignReportException("Component has null width"); + } + if (component.getWidth() > maxWidth) { + maxWidth = component.getWidth(); + } + } + break; + default: + throw new DRDesignReportException("List type " + type.name() + " not supported"); + } + } else { + for (DRDesignComponent component : list.getComponents()) { + if (component instanceof DRDesignList) { + width((DRDesignList) component);// , availableWidth - StyleResolver.getHorizontalPadding(component.getStyle())); + } + if (component.getWidth() == null) { + throw new DRDesignReportException("Component has null width"); + } + if (component.getWidth() + component.getX() > maxWidth) { + maxWidth = component.getWidth() + component.getX(); + } + } + } + + maxWidth += StyleResolver.getHorizontalPadding(list.getStyle()); + + if (list.getWidth() == null) { + list.setWidth(maxWidth); + } + } + + private static void recalculateWidth(String name, DRDesignList list, int availableWidth) throws DRException { + if (!list.isCalculateComponents()) { + return; + } + if (list.getWidth() <= availableWidth) { + return; + } + + int maxWidth = 0; + ListType type = list.getType(); + + if (type == null) { + return; + } + + switch (type) { + case HORIZONTAL: + int floatCells = 0; + int floatCellsWidth = 0; + for (DRDesignListCell listCell : list.getListCells()) { + if (listCell.getHorizontalAlignment().equals(HorizontalCellComponentAlignment.FLOAT)) { + floatCellsWidth += listCell.getComponent().getWidth(); + floatCells++; + } + } + if (list.getWidth() - floatCellsWidth >= availableWidth) { + throw new DRException(name + " components reaches outside available width, available width = " + availableWidth + ", components width = " + list.getWidth()); + } + availableWidth -= list.getWidth() - floatCellsWidth; + for (DRDesignListCell listCell : list.getListCells()) { + DRDesignComponent component = listCell.getComponent(); + if (listCell.getHorizontalAlignment().equals(HorizontalCellComponentAlignment.FLOAT)) { + int availableCellWidth = 0; + if (floatCells > 1) { + availableCellWidth = (int) ((double) availableWidth / floatCellsWidth * component.getWidth()); + floatCellsWidth -= component.getWidth(); + availableWidth -= availableCellWidth; + } else if (floatCells == 1) { + availableCellWidth = availableWidth; + availableWidth = 0; + } + floatCells--; + + if (component instanceof DRDesignList) { + recalculateWidth(name, (DRDesignList) component, availableCellWidth - StyleResolver.getHorizontalPadding(component.getStyle())); + } else { + component.setWidth(availableCellWidth); + } + } + maxWidth += component.getWidth() + list.getGap(); + } + if (!list.getComponents().isEmpty()) { + maxWidth -= list.getGap(); + } + break; + case HORIZONTAL_FLOW: + maxWidth = splitHorizontalListWhenOverflowWidth(name, list, availableWidth); + break; + case VERTICAL: + maxWidth = availableWidth; + for (DRDesignListCell listCell : list.getListCells()) { + DRDesignComponent component = listCell.getComponent(); + if (component.getWidth() > availableWidth) { + if (listCell.getHorizontalAlignment().equals(HorizontalCellComponentAlignment.FLOAT)) { + if (component instanceof DRDesignList) { + recalculateWidth(name, (DRDesignList) component, availableWidth - StyleResolver.getHorizontalPadding(component.getStyle())); + } else { + component.setWidth(availableWidth); + } + } else { + throw new DRException(name + " components reaches outside available width, available width = " + availableWidth + ", components width = " + component.getWidth()); + } + } + if (component.getWidth() > maxWidth) { + maxWidth = component.getWidth(); + } + } + break; + default: + throw new DRDesignReportException("List type " + type.name() + " not supported"); + } + maxWidth += StyleResolver.getHorizontalPadding(list.getStyle()); + list.setWidth(maxWidth); + } + + private static int splitHorizontalListWhenOverflowWidth(String name, DRDesignList list, int availableWidth) throws DRException { + Listheight.
+ * + * @param list a {@link software.xdev.dynamicreports.design.base.component.DRDesignList} object. + */ + protected static void height(DRDesignList list) { + int maxHeight = 0; + ListType type = list.getType(); + + if (type != null) { + switch (type) { + case HORIZONTAL: + case HORIZONTAL_FLOW: + for (DRDesignComponent component : list.getComponents()) { + if (component instanceof DRDesignList) { + height((DRDesignList) component); + } + if (component.getHeight() == null) { + throw new DRDesignReportException("Component has null height"); + } + if (component.getHeight() > maxHeight) { + maxHeight = component.getHeight(); + } + } + break; + case VERTICAL: + for (DRDesignComponent component : list.getComponents()) { + if (component instanceof DRDesignList) { + height((DRDesignList) component); + } + if (component.getHeight() == null) { + throw new DRDesignReportException("Component has null height"); + } + maxHeight += component.getHeight() + list.getGap(); + + } + if (!list.getComponents().isEmpty()) { + maxHeight -= list.getGap(); + } + break; + default: + throw new DRDesignReportException("List type " + type.name() + " not supported"); + } + } else { + for (DRDesignComponent component : list.getComponents()) { + if (component instanceof DRDesignList) { + height((DRDesignList) component); + } + if (component.getHeight() == null) { + throw new DRDesignReportException("Component has null height"); + } + if (component.getHeight() + component.getY() > maxHeight) { + maxHeight = component.getHeight() + component.getY(); + } + } + } + + maxHeight += StyleResolver.getVerticalPadding(list.getStyle()); + + if (list.getHeight() == null) { + list.setHeight(maxHeight); + } + } + + private static void listCellWidth(DRDesignList list, int availableWidth, int maxWidth) { + if (!list.isCalculateComponents()) { + return; + } + + ListType type = list.getType(); + if (type != null) { + switch (type) { + case HORIZONTAL: + case HORIZONTAL_FLOW: + int expandCellsWidth = 0; + int expandCells = 0; + for (DRDesignListCell listCell : list.getListCells()) { + switch (listCell.getHorizontalAlignment()) { + case FLOAT: + case EXPAND: + expandCellsWidth += listCell.getComponent().getWidth(); + expandCells++; + break; + default: + break; + } + } + + for (DRDesignListCell listCell : list.getListCells()) { + DRDesignComponent component = listCell.getComponent(); + switch (listCell.getHorizontalAlignment()) { + case FLOAT: + case EXPAND: + int availableCellWidth = 0; + if (expandCells > 1) { + availableCellWidth = (int) ((double) availableWidth / expandCellsWidth * component.getWidth()); + expandCellsWidth -= component.getWidth(); + availableWidth -= availableCellWidth; + } else if (expandCells == 1) { + availableCellWidth = availableWidth; + availableWidth = 0; + } + expandCells--; + + listCell.setWidth(component.getWidth() + availableCellWidth); + if (component instanceof DRDesignList) { + listCellWidth((DRDesignList) component, availableCellWidth, component.getWidth() + availableCellWidth - StyleResolver.getHorizontalPadding(component.getStyle())); + } + break; + default: + listCell.setWidth(component.getWidth()); + if (component instanceof DRDesignList) { + listCellWidth((DRDesignList) component, 0, component.getWidth() - StyleResolver.getHorizontalPadding(component.getStyle())); + } + break; + } + } + break; + case VERTICAL: + for (DRDesignListCell listCell : list.getListCells()) { + DRDesignComponent component = listCell.getComponent(); + switch (listCell.getHorizontalAlignment()) { + case FLOAT: + case EXPAND: + listCell.setWidth(maxWidth); + if (component instanceof DRDesignList) { + listCellWidth((DRDesignList) component, maxWidth - component.getWidth(), maxWidth - StyleResolver.getHorizontalPadding(component.getStyle())); + } + break; + default: + listCell.setWidth(maxWidth); + if (component instanceof DRDesignList) { + listCellWidth((DRDesignList) component, 0, component.getWidth() - StyleResolver.getHorizontalPadding(component.getStyle())); + } + break; + } + } + break; + default: + throw new DRDesignReportException("List type " + type.name() + " not supported"); + } + } else { + for (DRDesignListCell listCell : list.getListCells()) { + DRDesignComponent component = listCell.getComponent(); + listCell.setWidth(component.getWidth()); + if (component instanceof DRDesignList) { + listCellWidth((DRDesignList) component, 0, component.getWidth() - StyleResolver.getHorizontalPadding(component.getStyle())); + } + } + } + } + + private static void listCellX(DRDesignList list) { + if (!list.isCalculateComponents()) { + return; + } + + ListType type = list.getType(); + if (type != null) { + switch (type) { + case HORIZONTAL: + case HORIZONTAL_FLOW: + int x = 0; + for (DRDesignListCell listCell : list.getListCells()) { + listCell.setX(x); + x += listCell.getWidth() + list.getGap(); + if (listCell.getComponent() instanceof DRDesignList) { + listCellX((DRDesignList) listCell.getComponent()); + } + } + break; + case VERTICAL: + for (DRDesignListCell listCell : list.getListCells()) { + listCell.setX(0); + if (listCell.getComponent() instanceof DRDesignList) { + listCellX((DRDesignList) listCell.getComponent()); + } + } + break; + default: + throw new DRDesignReportException("List type " + type.name() + " not supported"); + } + } else { + for (DRDesignListCell listCell : list.getListCells()) { + listCell.setX(listCell.getComponent().getX()); + if (listCell.getComponent() instanceof DRDesignList) { + listCellX((DRDesignList) listCell.getComponent()); + } + } + } + } + + private static void listCellHeight(DRDesignList list, int availableHeight) { + if (!list.isCalculateComponents()) { + return; + } + + ListType type = list.getType(); + if (type != null) { + switch (type) { + case HORIZONTAL: + case HORIZONTAL_FLOW: + int maxHeight = availableHeight; + for (DRDesignListCell listCell : list.getListCells()) { + if (listCell.getComponent().getHeight() > maxHeight) { + maxHeight = listCell.getComponent().getHeight(); + } + } + for (DRDesignListCell listCell : list.getListCells()) { + DRDesignComponent component = listCell.getComponent(); + switch (listCell.getVerticalAlignment()) { + case EXPAND: + listCell.setHeight(maxHeight); + if (component instanceof DRDesignList) { + listCellHeight((DRDesignList) component, maxHeight - StyleResolver.getVerticalPadding(component.getStyle())); + } + break; + default: + listCell.setHeight(maxHeight); + if (component instanceof DRDesignList) { + listCellHeight((DRDesignList) component, component.getHeight() - StyleResolver.getVerticalPadding(component.getStyle())); + } + break; + } + } + break; + case VERTICAL: + maxHeight = 0; + int expandCellsHeight = 0; + int expandCells = 0; + for (DRDesignListCell listCell : list.getListCells()) { + maxHeight += listCell.getComponent().getHeight(); + switch (listCell.getVerticalAlignment()) { + case EXPAND: + expandCellsHeight += listCell.getComponent().getHeight(); + expandCells++; + break; + default: + break; + } + } + availableHeight = availableHeight - maxHeight - list.getGap() * (list.getComponents().size() - 1); + + for (DRDesignListCell listCell : list.getListCells()) { + DRDesignComponent component = listCell.getComponent(); + switch (listCell.getVerticalAlignment()) { + case EXPAND: + int availableCellHeight = 0; + if (expandCells > 1) { + availableCellHeight = (int) ((double) availableHeight / expandCellsHeight * component.getHeight()); + expandCellsHeight -= component.getHeight(); + availableHeight -= availableCellHeight; + } else if (expandCells == 1) { + availableCellHeight = availableHeight; + availableHeight = 0; + } + expandCells--; + + listCell.setHeight(component.getHeight() + availableCellHeight); + if (component instanceof DRDesignList) { + listCellHeight((DRDesignList) component, listCell.getHeight() - StyleResolver.getVerticalPadding(component.getStyle())); + } + break; + default: + listCell.setHeight(component.getHeight()); + if (component instanceof DRDesignList) { + listCellHeight((DRDesignList) component, listCell.getHeight() - StyleResolver.getVerticalPadding(component.getStyle())); + } + break; + } + } + break; + default: + throw new DRDesignReportException("List type " + type.name() + " not supported"); + } + } else { + for (DRDesignListCell listCell : list.getListCells()) { + DRDesignComponent component = listCell.getComponent(); + listCell.setHeight(component.getHeight()); + if (component instanceof DRDesignList) { + listCellHeight((DRDesignList) component, listCell.getHeight() - StyleResolver.getVerticalPadding(component.getStyle())); + } + } + } + } + + private static void listCellY(DRDesignList list) { + if (!list.isCalculateComponents()) { + return; + } + + ListType type = list.getType(); + if (type != null) { + switch (type) { + case HORIZONTAL: + case HORIZONTAL_FLOW: + for (DRDesignListCell listCell : list.getListCells()) { + listCell.setY(0); + if (listCell.getComponent() instanceof DRDesignList) { + listCellY((DRDesignList) listCell.getComponent()); + } + } + break; + case VERTICAL: + int y = 0; + for (DRDesignListCell listCell : list.getListCells()) { + listCell.setY(y); + y += listCell.getHeight() + list.getGap(); + if (listCell.getComponent() instanceof DRDesignList) { + listCellY((DRDesignList) listCell.getComponent()); + } + } + break; + default: + throw new DRDesignReportException("List type " + type.name() + " not supported"); + } + } else { + for (DRDesignListCell listCell : list.getListCells()) { + listCell.setY(listCell.getComponent().getY()); + if (listCell.getComponent() instanceof DRDesignList) { + listCellY((DRDesignList) listCell.getComponent()); + } + } + } + } + + private static void componentX(DRDesignList list) { + if (!list.isCalculateComponents()) { + return; + } + + for (DRDesignListCell listCell : list.getListCells()) { + DRDesignComponent component = listCell.getComponent(); + HorizontalCellComponentAlignment alignment = listCell.getHorizontalAlignment(); + switch (alignment) { + case FLOAT: + case EXPAND: + case LEFT: + component.setX(listCell.getX()); + break; + case CENTER: + component.setX(listCell.getX() + listCell.getWidth() / 2 - component.getWidth() / 2); + break; + case RIGHT: + component.setX(listCell.getX() + listCell.getWidth() - component.getWidth()); + break; + default: + throw new DRDesignReportException("Component alignment " + alignment.name() + " not supported"); + } + if (component instanceof DRDesignList) { + componentX((DRDesignList) component); + } + } + } + + private static void componentY(DRDesignList list) { + if (!list.isCalculateComponents()) { + return; + } + + for (DRDesignListCell listCell : list.getListCells()) { + DRDesignComponent component = listCell.getComponent(); + VerticalCellComponentAlignment alignment = listCell.getVerticalAlignment(); + switch (alignment) { + case EXPAND: + case TOP: + component.setY(listCell.getY()); + break; + case MIDDLE: + component.setY(listCell.getY() + listCell.getHeight() / 2 - component.getHeight() / 2); + break; + case BOTTOM: + component.setY(listCell.getY() + listCell.getHeight() - component.getHeight()); + break; + default: + throw new DRDesignReportException("Component alignment " + alignment.name() + " not supported"); + } + if (component instanceof DRDesignList) { + componentY((DRDesignList) component); + } + } + } + + private static void componentWidth(DRDesignList list) { + if (!list.isCalculateComponents()) { + return; + } + + for (DRDesignListCell listCell : list.getListCells()) { + DRDesignComponent component = listCell.getComponent(); + HorizontalCellComponentAlignment alignment = listCell.getHorizontalAlignment(); + switch (alignment) { + case FLOAT: + case EXPAND: + component.setWidth(listCell.getWidth()); + break; + case LEFT: + case CENTER: + case RIGHT: + break; + default: + throw new DRDesignReportException("Component alignment " + alignment.name() + " not supported"); + } + if (component instanceof DRDesignList) { + componentWidth((DRDesignList) component); + } + } + } + + private static void componentHeight(DRDesignList list) { + if (!list.isCalculateComponents()) { + return; + } + + for (DRDesignListCell listCell : list.getListCells()) { + DRDesignComponent component = listCell.getComponent(); + VerticalCellComponentAlignment alignment = listCell.getVerticalAlignment(); + switch (alignment) { + case EXPAND: + component.setHeight(listCell.getHeight()); + break; + case TOP: + case MIDDLE: + case BOTTOM: + break; + default: + throw new DRDesignReportException("Component alignment " + alignment.name() + " not supported"); + } + if (component instanceof DRDesignList) { + componentHeight((DRDesignList) component); + } + } + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ComponentTransform.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ComponentTransform.java new file mode 100644 index 0000000..71015af --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ComponentTransform.java @@ -0,0 +1,912 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeComponentTransform class.
+ * + * @author Ricardo Mariaca, Jan Moxter + * + */ +public class ComponentTransform { + private final DesignTransformAccessor accessor; + + /** + *Constructor for ComponentTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public ComponentTransform(final DesignTransformAccessor accessor) { + this.accessor = accessor; + } + + // component + + /** + *component.
+ * + * @param component a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + * @param defaultStyleType a {@link software.xdev.dynamicreports.design.constant.DefaultStyleType} object. + * @param resetType a {@link software.xdev.dynamicreports.design.constant.ResetType} object. + * @param resetGroup a {@link software.xdev.dynamicreports.design.base.DRDesignGroup} object. + * @return a {@link software.xdev.dynamicreports.design.base.component.DRDesignComponent} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignComponent component(final DRIComponent component, final DefaultStyleType defaultStyleType, final ResetType resetType, final DRDesignGroup resetGroup) throws DRException { + if (component instanceof DRITextField>) { + return this.textField((DRITextField>) component, defaultStyleType); + } + if (component instanceof DRIList) { + return this.list((DRIList) component, defaultStyleType, resetType, resetGroup); + } + if (component instanceof DRIXyList) { + return this.xyList((DRIXyList) component, defaultStyleType, resetType, resetGroup); + } + if (component instanceof DRIMultiPageList) { + return this.multiPageList((DRIMultiPageList) component); + } + if (component instanceof DRIFiller) { + return this.filler((DRIFiller) component); + } + if (component instanceof DRIImage) { + return this.image((DRIImage) component); + } + if (component instanceof DRISubreport) { + return this.subreport((DRISubreport) component); + } + if (component instanceof DRIPageXofY) { + return this.pageXofY((DRIPageXofY) component, defaultStyleType); + } + if (component instanceof DRITotalPages) { + return this.totalPages((DRITotalPages) component, defaultStyleType); + } + if (component instanceof DRIPageNumber) { + return this.pageNumber((DRIPageNumber) component, defaultStyleType); + } + if (component instanceof DRICurrentDate) { + return this.currentDate((DRICurrentDate) component, defaultStyleType); + } + if (component instanceof DRILine) { + return this.line((DRILine) component); + } + if (component instanceof DRIEllipse) { + return this.ellipse((DRIEllipse) component); + } + if (component instanceof DRIRectangle) { + return this.rectangle((DRIRectangle) component); + } + if (component instanceof DRIBooleanField) { + return this.booleanField((DRIBooleanField) component, defaultStyleType, resetType, resetGroup); + } + if (component instanceof DRIBreak) { + return this.breakComponent((DRIBreak) component); + } + if (component instanceof DRIGenericElement) { + return this.genericElement((DRIGenericElement) component, resetType, resetGroup); + } + if (component instanceof DRICrosstab) { + return this.crosstab((DRICrosstab) component, resetType, resetGroup); + } + if (component instanceof DRIMap) { + return this.map((DRIMap) component, resetType, resetGroup); + } + if (component instanceof DRICustomComponent) { + return this.customComponent((DRICustomComponent) component, resetType, resetGroup); + } + throw new DRDesignReportException("Component " + component.getClass().getName() + " not supported"); + } + + private void component(final DRDesignComponent designComponent, final DRIComponent component, final DRIReportStyle style, final boolean textStyle, final DefaultStyleType defaultStyleType) throws DRException { + designComponent.setStyle(this.accessor.getStyleTransform().transformStyle(style, textStyle, defaultStyleType)); + designComponent.setPrintWhenExpression(this.accessor.getExpressionTransform().transformExpression(component.getPrintWhenExpression())); + designComponent.setRemoveLineWhenBlank(this.accessor.getTemplateTransform().getRemoveLineWhenBlank(component)); + designComponent.setPositionType(this.accessor.getTemplateTransform().getPositionType(component)); + designComponent.setStretchType(this.accessor.getTemplateTransform().getStretchType(component)); + designComponent.setPrintInFirstWholeBand(this.accessor.getTemplateTransform().getPrintInFirstWholeBand(component)); + designComponent.setPrintWhenDetailOverflows(this.accessor.getTemplateTransform().getPrintWhenDetailOverflows(component)); + designComponent.setPrintWhenGroupChanges(this.accessor.getTemplateTransform().getPrintWhenGroupChanges(component)); + for (final DRIPropertyExpression propertyExpression : component.getPropertyExpressions()) { + designComponent.getPropertyExpressions().add(this.accessor.getExpressionTransform().transformPropertyExpression(propertyExpression)); + } + final DRDesignTableOfContentsHeading designTocHeading = + this.accessor.getTableOfContentsTransform().componentHeading(component); + if (designTocHeading != null) { + designComponent.setTableOfContentsHeading(designTocHeading); + final DRIDesignExpression anchorNameExpression = designTocHeading.getReferenceField().getAnchorNameExpression(); + final Integer bookmarkLevel = designTocHeading.getReferenceField().getBookmarkLevel(); + final DRDesignHyperLink designHyperLink = designTocHeading.getReferenceField().getHyperLink(); + if (designComponent instanceof DRDesignHyperlinkComponent) { + ((DRDesignHyperlinkComponent) designComponent).setAnchorNameExpression(anchorNameExpression); + ((DRDesignHyperlinkComponent) designComponent).setBookmarkLevel(bookmarkLevel); + ((DRDesignHyperlinkComponent) designComponent).setHyperLink(designHyperLink); + } + } + } + + private void hyperlink(final DRDesignHyperlinkComponent designHyperlinkComponent, final DRIHyperLinkComponent hyperlinkComponent, final DRIReportStyle style, final boolean textStyle, final DefaultStyleType defaultStyleType) + throws DRException { + this.component(designHyperlinkComponent, hyperlinkComponent, style, textStyle, defaultStyleType); + + if (hyperlinkComponent.getAnchorNameExpression() != null) { + designHyperlinkComponent.setAnchorNameExpression(this.accessor.getExpressionTransform().transformExpression(hyperlinkComponent.getAnchorNameExpression())); + } + if (hyperlinkComponent.getBookmarkLevel() != null) { + designHyperlinkComponent.setBookmarkLevel(hyperlinkComponent.getBookmarkLevel()); + } + + final DRIHyperLink hyperLink = hyperlinkComponent.getHyperLink(); + final DRDesignHyperLink designHyperLink = this.accessor.getReportTransform().hyperlink(hyperLink); + if (designHyperLink != null) { + designHyperlinkComponent.setHyperLink(designHyperLink); + } + } + + // list + + /** + *list.
+ * + * @param list a {@link software.xdev.dynamicreports.report.definition.component.DRIList} object. + * @param defaultStyleType a {@link software.xdev.dynamicreports.design.constant.DefaultStyleType} object. + * @param resetType a {@link software.xdev.dynamicreports.design.constant.ResetType} object. + * @param resetGroup a {@link software.xdev.dynamicreports.design.base.DRDesignGroup} object. + * @return a {@link software.xdev.dynamicreports.design.base.component.DRDesignList} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignList list(final DRIList list, final DefaultStyleType defaultStyleType, final ResetType resetType, final DRDesignGroup resetGroup) throws DRException { + final DRDesignList designList = new DRDesignList(); + this.component(designList, list, list.getStyle(), false, DefaultStyleType.NONE); + designList.setType(list.getType()); + designList.setGap(this.accessor.getTemplateTransform().getListGap(list)); + designList.setWidth(this.accessor.getTemplateTransform().getListWidth(list)); + designList.setHeight(this.accessor.getTemplateTransform().getListHeight(list)); + designList.setCalculateComponents(designList.getWidth() == null && designList.getHeight() == null); + for (final DRIListCell innerComponent : list.getListCells()) { + final DRIComponent component = innerComponent.getComponent(); + HorizontalCellComponentAlignment horizontalAlignment = innerComponent.getHorizontalAlignment(); + VerticalCellComponentAlignment verticalAlignment = innerComponent.getVerticalAlignment(); + if (component instanceof DRIDimensionComponent) { + final DRIDimensionComponent dimComponent = (DRIDimensionComponent) component; + if (horizontalAlignment == null) { + horizontalAlignment = ConstantTransform.toHorizontalCellComponentAlignment(dimComponent.getWidthType()); + } + if (verticalAlignment == null) { + verticalAlignment = ConstantTransform.toVerticalCellComponentAlignment(dimComponent.getHeightType()); + } + } + designList.addComponent(horizontalAlignment, verticalAlignment, + this.component(component, defaultStyleType, resetType, resetGroup)); + } + designList.setBackgroundComponent(this.listBackgroundComponent(list.getBackgroundComponent(), defaultStyleType, resetType, resetGroup)); + + return designList; + } + + /** + *xyList.
+ * + * @param xyList a {@link software.xdev.dynamicreports.report.definition.component.DRIXyList} object. + * @param defaultStyleType a {@link software.xdev.dynamicreports.design.constant.DefaultStyleType} object. + * @param resetType a {@link software.xdev.dynamicreports.design.constant.ResetType} object. + * @param resetGroup a {@link software.xdev.dynamicreports.design.base.DRDesignGroup} object. + * @return a {@link software.xdev.dynamicreports.design.base.component.DRDesignList} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignList xyList(final DRIXyList xyList, final DefaultStyleType defaultStyleType, final ResetType resetType, final DRDesignGroup resetGroup) throws DRException { + final DRDesignList designList = new DRDesignList(null); + this.component(designList, xyList, xyList.getStyle(), false, DefaultStyleType.NONE); + designList.setWidth(this.accessor.getTemplateTransform().getXyListWidth(xyList)); + designList.setHeight(this.accessor.getTemplateTransform().getXyListHeight(xyList)); + designList.setCalculateComponents(designList.getWidth() == null && designList.getHeight() == null); + designList.setRemovable(true); + for (final DRIXyListCell innerComponent : xyList.getXyListCells()) { + final DRDesignComponent designComponent = + this.component(innerComponent.getComponent(), defaultStyleType, resetType, resetGroup); + designComponent.setX(innerComponent.getX()); + designComponent.setY(innerComponent.getY()); + designList.addComponent(HorizontalCellComponentAlignment.LEFT, VerticalCellComponentAlignment.TOP, designComponent); + } + + return designList; + } + + /** + *listBackgroundComponent.
+ * + * @param backgroundComponent a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + * @param defaultStyleType a {@link software.xdev.dynamicreports.design.constant.DefaultStyleType} object. + * @param resetType a {@link software.xdev.dynamicreports.design.constant.ResetType} object. + * @param resetGroup a {@link software.xdev.dynamicreports.design.base.DRDesignGroup} object. + * @return a {@link software.xdev.dynamicreports.design.base.component.DRDesignComponent} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignComponent listBackgroundComponent(final DRIComponent backgroundComponent, final DefaultStyleType defaultStyleType, final ResetType resetType, final DRDesignGroup resetGroup) throws DRException { + if (backgroundComponent != null) { + if (backgroundComponent instanceof DRIRectangle || backgroundComponent instanceof DRIImage || backgroundComponent instanceof DRITextField) { + return this.component(backgroundComponent, defaultStyleType, resetType, resetGroup); + } else { + throw new DRDesignReportException("List background component not supported. Only rectangle, image and textfield are supported"); + } + } + return null; + } + + // multi page list + private DRDesignSubreport multiPageList(final DRIMultiPageList multiPageList) throws DRException { + final DRDesignSubreport designSubreport = new DRDesignSubreport(); + this.component(designSubreport, multiPageList, multiPageList.getStyle(), false, DefaultStyleType.NONE); + designSubreport.setWidth(this.accessor.getTemplateTransform().getMultiPageListWidth(multiPageList)); + designSubreport.setHeight(this.accessor.getTemplateTransform().getMultiPageListHeight(multiPageList)); + final JasperReportBuilder multiPageReport = DynamicReports.report(); + final MultiPageListSubreportExpression subreportExpression = + new MultiPageListSubreportExpression( + this.accessor.getLocale(), + this.accessor.getResourceBundle(), + this.accessor.getResourceBundleName(), + this.accessor.getWhenResourceMissingType(), + multiPageList.getComponents(), + this.accessor.getTemplateTransform().getTemplateStyles()); + multiPageReport.detail(Components.subreport(subreportExpression)); + multiPageReport.setDetailSplitType(multiPageList.getSplitType()); + final DRIDesignExpression reportExpression = + this.accessor.getExpressionTransform().transformExpression(Expressions.value(multiPageReport)); + final DRIDesignExpression dataSourceExpression = this.accessor.getExpressionTransform().transformExpression(new MultiPageListDataSourceExpression(multiPageList.getComponents().size())); + designSubreport.setReportExpression(reportExpression); + designSubreport.setDataSourceExpression(dataSourceExpression); + return designSubreport; + } + + // text field + + /** + *textField.
+ * + * @param textField a {@link software.xdev.dynamicreports.report.definition.component.DRITextField} object. + * @param defaultStyleType a {@link software.xdev.dynamicreports.design.constant.DefaultStyleType} object. + * @return a {@link software.xdev.dynamicreports.design.base.component.DRDesignTextField} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignTextField textField(final DRITextField> textField, final DefaultStyleType defaultStyleType) throws DRException { + final DRDesignTextField designTextField = new DRDesignTextField(); + this.hyperlink(designTextField, textField, textField.getStyle(), true, defaultStyleType); + final TemplateTransform templateTransform = this.accessor.getTemplateTransform(); + designTextField.setPrintRepeatedValues(templateTransform.isTextFieldPrintRepeatedValues(textField)); + designTextField.setStretchWithOverflow(templateTransform.getTextFieldStretchWithOverflow(textField)); + designTextField.setTextAdjust(templateTransform.getTextFieldTextAdjust(textField)); + final DRDesignStyle style = designTextField.getStyle(); + designTextField.setWidth(templateTransform.getTextFieldWidth(textField, style)); + designTextField.setHeight(templateTransform.getTextFieldHeight(textField, style)); + designTextField.setPattern(templateTransform.getTextFieldPattern(textField, style)); + designTextField.setPatternExpression(this.accessor.getExpressionTransform().transformExpression(textField.getPatternExpression())); + designTextField.setHorizontalTextAlignment(templateTransform.getTextFieldHorizontalTextAlignment(textField, style)); + designTextField.setValueExpression(this.accessor.getExpressionTransform().transformExpression(textField.getValueExpression(), templateTransform.getTextFieldValueFormatter(textField), null)); + designTextField.setMarkup(textField.getMarkup()); + if (textField.getEvaluationTime() != null) { + designTextField.setEvaluationTime(ConstantTransform.textFieldEvaluationTime(textField.getEvaluationTime(), textField.getEvaluationGroup(), + this.accessor)); + designTextField.setEvaluationGroup( + this.accessor.getGroupTransform().getGroup(ConstantTransform.textFieldEvaluationGroup(textField.getEvaluationTime(), textField.getEvaluationGroup(), + this.accessor))); + } else { + if (textField.getEvaluationGroup() != null) { + throw new DRException("Evaluation group for textField is required only for evaluation time BEFORE_GROUP or GROUP"); + } + final EvaluationTime evaluationTime = this.detectEvaluationTime(designTextField.getValueExpression()); + designTextField.setEvaluationTime(evaluationTime); + designTextField.setEvaluationGroup(this.detectEvaluationGroup(evaluationTime, designTextField.getValueExpression())); + } + return designTextField; + } + + // filler + + /** + *filler.
+ * + * @param filler a {@link software.xdev.dynamicreports.report.definition.component.DRIFiller} object. + * @return a {@link software.xdev.dynamicreports.design.base.component.DRDesignFiller} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignFiller filler(final DRIFiller filler) throws DRException { + final DRDesignFiller designFiller = new DRDesignFiller(); + this.component(designFiller, filler, filler.getStyle(), false, DefaultStyleType.NONE); + designFiller.setWidth(this.accessor.getTemplateTransform().getFillerWidth(filler)); + designFiller.setHeight(this.accessor.getTemplateTransform().getFillerHeight(filler)); + return designFiller; + } + + // image + private DRDesignImage image(final DRIImage image) throws DRException { + return this.image(image, null, DefaultStyleType.IMAGE); + } + + private DRDesignImage image(final DRIImage image, final Integer imageHeight, final DefaultStyleType defaultStyleType) throws DRException { + final DRDesignImage designImage = new DRDesignImage(); + this.hyperlink(designImage, image, image.getStyle(), false, defaultStyleType); + designImage.setImageScale(image.getImageScale()); + designImage.setImageExpression(this.accessor.getExpressionTransform().transformExpression(image.getImageExpression())); + designImage.setUsingCache(image.getUsingCache()); + designImage.setLazy(image.getLazy()); + designImage.setHorizontalImageAlignment(image.getHorizontalImageAlignment()); + designImage.setWidth(this.accessor.getTemplateTransform().getImageWidth(image)); + final DRDesignStyle style = designImage.getStyle(); + designImage.setHeight(this.accessor.getTemplateTransform().getImageHeight(image, imageHeight, style)); + return designImage; + } + + + // subreport + private DRDesignSubreport subreport(final DRISubreport subreport) throws DRException { + final DRDesignSubreport designSubreport = new DRDesignSubreport(); + this.component(designSubreport, subreport, subreport.getStyle(), false, DefaultStyleType.NONE); + designSubreport.setWidth(this.accessor.getTemplateTransform().getSubreportWidth(subreport)); + designSubreport.setHeight(this.accessor.getTemplateTransform().getSubreportHeight(subreport)); + designSubreport.setReportExpression(this.accessor.getExpressionTransform().transformExpression(subreport.getReportExpression())); + designSubreport.setParametersExpression(this.accessor.getExpressionTransform().transformExpression(subreport.getParametersExpression())); + designSubreport.setConnectionExpression(this.accessor.getExpressionTransform().transformExpression(subreport.getConnectionExpression())); + designSubreport.setDataSourceExpression(this.accessor.getExpressionTransform().transformExpression(subreport.getDataSourceExpression())); + designSubreport.setRunToBottom(subreport.getRunToBottom()); + return designSubreport; + } + + // page x of y + private DRDesignList pageXofY(final DRIPageXofY pageXofY, final DefaultStyleType defaultStyleType) throws DRException { + final TemplateTransform templateTransform = this.accessor.getTemplateTransform(); + DRIReportStyle pageXofYStyle = pageXofY.getStyle(); + if (pageXofYStyle == null) { + pageXofYStyle = this.accessor.getTemplateTransform().getTextStyle(); + } + final DRDesignStyle style = + this.accessor.getStyleTransform().transformStyle(pageXofYStyle, true, defaultStyleType); + final Integer height = templateTransform.getPageXofYHeight(pageXofY, style); + final HorizontalTextAlignment horizontalTextAlignment = templateTransform.getPageXofYHorizontalTextAlignment(pageXofY, style); + + final DRStyle newStylePageX = new DRStyle(); + newStylePageX.setParentStyle(pageXofYStyle); + newStylePageX.getPadding().setRight(0); + final DRPen pen = new DRPen(); + pen.setLineWidth(0f); + newStylePageX.getBorder().setRightPen(pen); + final DRStyle newStylePageY = new DRStyle(); + newStylePageY.setParentStyle(pageXofYStyle); + newStylePageY.getPadding().setLeft(0); + newStylePageY.getBorder().setLeftPen(pen); + + final DRTextFieldline.
+ * + * @param line a {@link software.xdev.dynamicreports.report.definition.component.DRILine} object. + * @return a {@link software.xdev.dynamicreports.design.base.component.DRDesignLine} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignLine line(final DRILine line) throws DRException { + final DRDesignLine designLine = new DRDesignLine(); + this.component(designLine, line, line.getStyle(), false, DefaultStyleType.NONE); + designLine.setDirection(line.getDirection()); + designLine.setPen(this.accessor.getStyleTransform().pen(line.getPen())); + designLine.setWidth(this.accessor.getTemplateTransform().getLineWidth(line)); + designLine.setHeight(this.accessor.getTemplateTransform().getLineHeight(line)); + return designLine; + } + + // ellipse + + /** + *ellipse.
+ * + * @param ellipse a {@link software.xdev.dynamicreports.report.definition.component.DRIEllipse} object. + * @return a {@link software.xdev.dynamicreports.design.base.component.DRDesignEllipse} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignEllipse ellipse(final DRIEllipse ellipse) throws DRException { + final DRDesignEllipse designEllipse = new DRDesignEllipse(); + this.component(designEllipse, ellipse, ellipse.getStyle(), false, DefaultStyleType.NONE); + designEllipse.setPen(this.accessor.getStyleTransform().pen(ellipse.getPen())); + designEllipse.setWidth(this.accessor.getTemplateTransform().getEllipseWidth(ellipse)); + designEllipse.setHeight(this.accessor.getTemplateTransform().getEllipseHeight(ellipse)); + return designEllipse; + } + + // rectangle + + /** + *rectangle.
+ * + * @param rectangle a {@link software.xdev.dynamicreports.report.definition.component.DRIRectangle} object. + * @return a {@link software.xdev.dynamicreports.design.base.component.DRDesignRectangle} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignRectangle rectangle(final DRIRectangle rectangle) throws DRException { + final DRDesignRectangle designRectangle = new DRDesignRectangle(); + this.component(designRectangle, rectangle, rectangle.getStyle(), false, DefaultStyleType.NONE); + designRectangle.setRadius(this.accessor.getTemplateTransform().getRectangleRadius(rectangle)); + designRectangle.setPen(this.accessor.getStyleTransform().pen(rectangle.getPen())); + designRectangle.setWidth(this.accessor.getTemplateTransform().getRectangleWidth(rectangle)); + designRectangle.setHeight(this.accessor.getTemplateTransform().getRectangleHeight(rectangle)); + return designRectangle; + } + + // boolean + + /** + *booleanField.
+ * + * @param booleanField a {@link software.xdev.dynamicreports.report.definition.component.DRIBooleanField} object. + * @param defaultStyleType a {@link software.xdev.dynamicreports.design.constant.DefaultStyleType} object. + * @param resetType a {@link software.xdev.dynamicreports.design.constant.ResetType} object. + * @param resetGroup a {@link software.xdev.dynamicreports.design.base.DRDesignGroup} object. + * @return a {@link software.xdev.dynamicreports.design.base.component.DRDesignComponent} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignComponent booleanField(final DRIBooleanField booleanField, final DefaultStyleType defaultStyleType, final ResetType resetType, final DRDesignGroup resetGroup) throws DRException { + final BooleanComponentType componentType = + this.accessor.getTemplateTransform().getBooleanComponentType(booleanField); + final boolean emptyWhenNullValue = + this.accessor.getTemplateTransform().getBooleanEmptyWhenNullValue(booleanField); + + DRHyperLinkComponent component = null; + + switch (componentType) { + case TEXT_TRUE_FALSE: + case TEXT_YES_NO: + final String keyTrue; + final String keyFalse; + if (componentType.equals(BooleanComponentType.TEXT_TRUE_FALSE)) { + keyTrue = "true"; + keyFalse = "false"; + } else { + keyTrue = "yes"; + keyFalse = "no"; + } + final DRTextFieldbreakComponent.
+ * + * @param breakComponent a {@link software.xdev.dynamicreports.report.definition.component.DRIBreak} object. + * @return a {@link software.xdev.dynamicreports.design.base.component.DRDesignBreak} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignBreak breakComponent(final DRIBreak breakComponent) throws DRException { + final DRDesignBreak designBreak = new DRDesignBreak(); + this.component(designBreak, breakComponent, null, false, DefaultStyleType.NONE); + designBreak.setType(breakComponent.getType()); + designBreak.setWidth(this.accessor.getTemplateTransform().getBreakWidth(breakComponent)); + designBreak.setHeight(this.accessor.getTemplateTransform().getBreakHeight(breakComponent)); + return designBreak; + } + + // generic element + + /** + *genericElement.
+ * + * @param genericElement a {@link software.xdev.dynamicreports.report.definition.component.DRIGenericElement} object. + * @param resetType a {@link software.xdev.dynamicreports.design.constant.ResetType} object. + * @param resetGroup a {@link software.xdev.dynamicreports.design.base.DRDesignGroup} object. + * @return a {@link software.xdev.dynamicreports.design.base.component.DRDesignGenericElement} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignGenericElement genericElement(final DRIGenericElement genericElement, final ResetType resetType, final DRDesignGroup resetGroup) throws DRException { + final DRDesignGenericElement designGenericElement = new DRDesignGenericElement(); + this.component(designGenericElement, genericElement, genericElement.getStyle(), false, DefaultStyleType.NONE); + designGenericElement.setGenericElementNamespace(genericElement.getGenericElementNamespace()); + designGenericElement.setGenericElementName(genericElement.getGenericElementName()); + designGenericElement.setEvaluationTime(this.evaluationTimeFromResetType(resetType)); + designGenericElement.setEvaluationGroup(resetGroup); + designGenericElement.setWidth(this.accessor.getTemplateTransform().getGenericElementWidth(genericElement)); + designGenericElement.setHeight(this.accessor.getTemplateTransform().getGenericElementHeight(genericElement)); + for (final DRIParameterExpression parameterExpression : genericElement.getParameterExpressions()) { + designGenericElement.getParameterExpressions().add(this.accessor.getExpressionTransform().transformParameterExpression(parameterExpression)); + } + return designGenericElement; + } + + // crosstab + private DRDesignCrosstab crosstab(final DRICrosstab crosstab, final ResetType resetType, final DRDesignGroup resetGroup) throws DRException { + final DRDesignCrosstab designCrosstab = + this.accessor.getCrosstabTransform().transform(crosstab, resetType, resetGroup); + this.component(designCrosstab, crosstab, crosstab.getStyle(), false, DefaultStyleType.NONE); + return designCrosstab; + } + + // map + private DRDesignMap map(final DRIMap map, final ResetType resetType, final DRDesignGroup resetGroup) throws DRException { + final DRDesignMap designMap = new DRDesignMap(); + this.component(designMap, map, map.getStyle(), false, DefaultStyleType.NONE); + designMap.setLatitudeExpression(this.accessor.getExpressionTransform().transformExpression(map.getLatitudeExpression())); + designMap.setLongitudeExpression(this.accessor.getExpressionTransform().transformExpression(map.getLongitudeExpression())); + designMap.setZoomExpression(this.accessor.getExpressionTransform().transformExpression(map.getZoomExpression())); + designMap.setWidth(this.accessor.getTemplateTransform().getMapWidth(map)); + designMap.setHeight(this.accessor.getTemplateTransform().getMapHeight(map)); + designMap.setEvaluationTime(this.evaluationTimeFromResetType(resetType)); + designMap.setEvaluationGroup(resetGroup); + return designMap; + } + + // custom component + private DRDesignComponent customComponent(final DRICustomComponent component, final ResetType resetType, final DRDesignGroup resetGroup) throws DRException { + @SuppressWarnings("rawtypes") final CustomComponentTransform componentTransfom = CustomComponents.getComponentTransform(component); + if (componentTransfom == null) { + throw new DRDesignReportException("Component " + component.getClass().getName() + " not supported"); + } + @SuppressWarnings("unchecked") final DRDesignComponent designComponent = (DRDesignComponent) componentTransfom.designComponent( + this.accessor, component, resetType, resetGroup); + this.component(designComponent, component, component.getStyle(), false, DefaultStyleType.NONE); + final DRIDimensionComponent dimensionComponent = component; + if (designComponent.getWidth() == null) { + designComponent.setWidth(this.accessor.getTemplateTransform().getCustomComponentWidth(dimensionComponent)); + } + if (designComponent.getHeight() == null) { + designComponent.setHeight(this.accessor.getTemplateTransform().getCustomComponentHeight(dimensionComponent)); + } + return designComponent; + } + + /** + *detectEvaluationTime.
+ * + * @param expression a {@link software.xdev.dynamicreports.design.definition.expression.DRIDesignExpression} object. + * @return a {@link software.xdev.dynamicreports.design.constant.EvaluationTime} object. + */ + protected EvaluationTime detectEvaluationTime(final DRIDesignExpression expression) { + if (expression == null) { + return null; + } + + if (expression instanceof DRIDesignField || expression instanceof DRIDesignSystemExpression || expression instanceof DRIDesignSimpleExpression || + expression instanceof DRIDesignJasperExpression) { + return EvaluationTime.NOW; + } + if (expression instanceof DRIDesignVariable) { + return this.evaluationTimeFromResetType(((DRIDesignVariable) expression).getResetType()); + } + if (expression instanceof DRIDesignComplexExpression) { + return this.detectComplexExpressionEvaluationTime((DRIDesignComplexExpression) expression); + } + throw new DRDesignReportException("Expression " + expression.getClass().getName() + " not supported"); + } + + /** + *evaluationTimeFromResetType.
+ * + * @param resetType a {@link software.xdev.dynamicreports.design.constant.ResetType} object. + * @return a {@link software.xdev.dynamicreports.design.constant.EvaluationTime} object. + */ + public EvaluationTime evaluationTimeFromResetType(final ResetType resetType) { + if (resetType == null) { + return null; + } + + switch (resetType) { + case NONE: + return EvaluationTime.NOW; + case REPORT: + return EvaluationTime.REPORT; + case PAGE: + return EvaluationTime.PAGE; + case COLUMN: + return EvaluationTime.COLUMN; + case GROUP: + return EvaluationTime.GROUP; + default: + throw new DRDesignReportException("Reset type " + resetType.name() + " not supported"); + } + } + + private EvaluationTime detectComplexExpressionEvaluationTime(final DRIDesignComplexExpression complexExpression) { + EvaluationTime evaluationTime = null; + for (final DRIDesignExpression expression : complexExpression.getExpressions()) { + final EvaluationTime evalTime = this.detectEvaluationTime(expression); + if (evaluationTime == null) { + evaluationTime = evalTime; + } else if (evaluationTime != evalTime || evaluationTime.equals(EvaluationTime.GROUP) && evalTime.equals(EvaluationTime.GROUP)) { + return EvaluationTime.AUTO; + } + } + return evaluationTime; + } + + private DRDesignGroup detectEvaluationGroup(final EvaluationTime evaluationTime, final DRIDesignExpression expression) { + if (expression != null && evaluationTime != null && evaluationTime.equals(EvaluationTime.GROUP)) { + final DRDesignGroup evaluationGroup = this.detectEvaluationGroup(expression); + if (evaluationGroup == null) { + throw new DRDesignReportException("Can not detect evaluation group"); + } + return evaluationGroup; + } + return null; + } + + private DRDesignGroup detectEvaluationGroup(final DRIDesignExpression expression) { + if (expression instanceof DRIDesignField || expression instanceof DRIDesignSimpleExpression) { + return null; + } + if (expression instanceof DRDesignVariable) { + return ((DRDesignVariable) expression).getResetGroup(); + } + if (expression instanceof DRIDesignComplexExpression) { + return this.detectComplexExpressionEvaluationGroup((DRIDesignComplexExpression) expression); + } + throw new DRDesignReportException("Expression " + expression.getClass().getName() + " not supported"); + } + + private DRDesignGroup detectComplexExpressionEvaluationGroup(final DRIDesignComplexExpression complexExpression) { + DRDesignGroup evaluationGroup = null; + for (final DRIDesignExpression expression : complexExpression.getExpressions()) { + final DRDesignGroup group = this.detectEvaluationGroup(expression); + if (evaluationGroup == null) { + evaluationGroup = group; + } else if (evaluationGroup != group) { + throw new DRDesignReportException("Can not detect evaluation group"); + } + } + return evaluationGroup; + } + +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ConstantTransform.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ConstantTransform.java new file mode 100644 index 0000000..80118ee --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/ConstantTransform.java @@ -0,0 +1,264 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seevariableResetType.
+ * + * @param resetType a {@link software.xdev.dynamicreports.report.constant.Evaluation} object. + * @param resetGroup a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + * @return a {@link software.xdev.dynamicreports.design.constant.ResetType} object. + */ + public static ResetType variableResetType(Evaluation resetType, DRIGroup resetGroup, DesignTransformAccessor accessor) { + if (resetType == null) { + return ResetType.REPORT; + } + + switch (resetType) { + case NONE: + return ResetType.NONE; + case REPORT: + return ResetType.REPORT; + case PAGE: + return ResetType.PAGE; + case COLUMN: + return ResetType.COLUMN; + case FIRST_GROUP: + if (accessor.getGroupTransform().getFirstGroup() == null) { + return ResetType.REPORT; + } + return ResetType.GROUP; + case BEFORE_GROUP: + if (accessor.getGroupTransform().getBeforeGroup(resetGroup) == null) { + return ResetType.REPORT; + } + return ResetType.GROUP; + case LAST_GROUP: + if (accessor.getGroupTransform().getLastGroup() == null) { + return ResetType.REPORT; + } + return ResetType.GROUP; + case GROUP: + return ResetType.GROUP; + default: + throw new DRDesignReportException("Reset type " + resetType.name() + " not supported"); + } + } + + /** + *variableResetGroup.
+ * + * @param name a {@link java.lang.String} object. + * @param resetType a {@link software.xdev.dynamicreports.report.constant.Evaluation} object. + * @param resetGroup a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + * @return a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public static DRIGroup variableResetGroup(String name, Evaluation resetType, DRIGroup resetGroup, DesignTransformAccessor accessor) throws DRException { + if (resetType == null) { + return null; + } + + switch (resetType) { + case NONE: + case REPORT: + case PAGE: + case COLUMN: + if (resetGroup != null) { + throw new DRException("Reset group for variable " + name + " is required only for reset type BEFORE_GROUP or GROUP"); + } + return null; + case FIRST_GROUP: + if (resetGroup != null) { + throw new DRException("Reset group for variable " + name + " is required only for reset type BEFORE_GROUP or GROUP"); + } + return accessor.getGroupTransform().getFirstGroup(); + case BEFORE_GROUP: + if (resetGroup == null) { + throw new DRException("Reset group missing for variable " + name); + } + return accessor.getGroupTransform().getBeforeGroup(resetGroup); + case LAST_GROUP: + if (resetGroup != null) { + throw new DRException("Reset group for variable " + name + " is required only for reset type BEFORE_GROUP or GROUP"); + } + return accessor.getGroupTransform().getLastGroup(); + case GROUP: + if (resetGroup == null) { + throw new DRException("Reset group missing for variable " + name); + } + return resetGroup; + default: + throw new DRDesignReportException("Reset group " + resetType.name() + " not supported"); + } + } + + /** + *textFieldEvaluationTime.
+ * + * @param evaluationTime a {@link software.xdev.dynamicreports.report.constant.Evaluation} object. + * @param evaluationGroup a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + * @return a {@link software.xdev.dynamicreports.design.constant.EvaluationTime} object. + */ + public static EvaluationTime textFieldEvaluationTime(Evaluation evaluationTime, DRIGroup evaluationGroup, DesignTransformAccessor accessor) { + if (evaluationTime == null) { + return EvaluationTime.NOW; + } + + switch (evaluationTime) { + case NONE: + return EvaluationTime.NOW; + case REPORT: + return EvaluationTime.REPORT; + case PAGE: + return EvaluationTime.PAGE; + case COLUMN: + return EvaluationTime.COLUMN; + case FIRST_GROUP: + if (accessor.getGroupTransform().getFirstGroup() == null) { + return EvaluationTime.REPORT; + } + return EvaluationTime.GROUP; + case BEFORE_GROUP: + if (accessor.getGroupTransform().getBeforeGroup(evaluationGroup) == null) { + return EvaluationTime.REPORT; + } + return EvaluationTime.GROUP; + case LAST_GROUP: + if (accessor.getGroupTransform().getLastGroup() == null) { + return EvaluationTime.REPORT; + } + return EvaluationTime.GROUP; + case GROUP: + return EvaluationTime.GROUP; + default: + throw new DRDesignReportException("Evaluation time " + evaluationTime.name() + " not supported"); + } + } + + /** + *textFieldEvaluationGroup.
+ * + * @param evaluationTime a {@link software.xdev.dynamicreports.report.constant.Evaluation} object. + * @param evaluationGroup a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + * @return a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public static DRIGroup textFieldEvaluationGroup(Evaluation evaluationTime, DRIGroup evaluationGroup, DesignTransformAccessor accessor) throws DRException { + if (evaluationTime == null) { + return null; + } + + switch (evaluationTime) { + case NONE: + case REPORT: + case PAGE: + case COLUMN: + if (evaluationGroup != null) { + throw new DRException("Evaluation group for textField is required only for evaluation time BEFORE_GROUP or GROUP"); + } + return null; + case FIRST_GROUP: + if (evaluationGroup != null) { + throw new DRException("Evaluation group for textField is required only for evaluation time BEFORE_GROUP or GROUP"); + } + return accessor.getGroupTransform().getFirstGroup(); + case BEFORE_GROUP: + if (evaluationGroup == null) { + throw new DRException("Evaluation group missing for textField"); + } + return accessor.getGroupTransform().getBeforeGroup(evaluationGroup); + case LAST_GROUP: + if (evaluationGroup != null) { + throw new DRException("Evaluation group for textField is required only for evaluation time BEFORE_GROUP or GROUP"); + } + return accessor.getGroupTransform().getLastGroup(); + case GROUP: + if (evaluationGroup == null) { + throw new DRException("Evaluation group missing for textField"); + } + return evaluationGroup; + default: + throw new DRDesignReportException("Evaluation group " + evaluationTime.name() + " not supported"); + } + } + + /** + *toHorizontalCellComponentAlignment.
+ * + * @param widthType a {@link software.xdev.dynamicreports.report.constant.ComponentDimensionType} object. + * @return a {@link software.xdev.dynamicreports.report.constant.HorizontalCellComponentAlignment} object. + */ + public static HorizontalCellComponentAlignment toHorizontalCellComponentAlignment(ComponentDimensionType widthType) { + if (widthType == null) { + return null; + } + + switch (widthType) { + case FIXED: + return HorizontalCellComponentAlignment.LEFT; + case FLOAT: + return HorizontalCellComponentAlignment.FLOAT; + case EXPAND: + return HorizontalCellComponentAlignment.EXPAND; + default: + throw new DRDesignReportException("Component dimension type " + widthType.name() + " not supported"); + } + } + + /** + *toVerticalCellComponentAlignment.
+ * + * @param heightType a {@link software.xdev.dynamicreports.report.constant.ComponentDimensionType} object. + * @return a {@link software.xdev.dynamicreports.report.constant.VerticalCellComponentAlignment} object. + */ + public static VerticalCellComponentAlignment toVerticalCellComponentAlignment(ComponentDimensionType heightType) { + if (heightType == null) { + return null; + } + + switch (heightType) { + case FIXED: + return VerticalCellComponentAlignment.TOP; + case FLOAT: + case EXPAND: + return VerticalCellComponentAlignment.EXPAND; + default: + throw new DRDesignReportException("Component dimension type " + heightType.name() + " not supported"); + } + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/CrosstabTransform.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/CrosstabTransform.java new file mode 100644 index 0000000..9399756 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/CrosstabTransform.java @@ -0,0 +1,665 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeCrosstabTransform class.
+ * + * @author Ricardo Mariaca, Jan Moxter + * + */ +public class CrosstabTransform { + private final DesignTransformAccessor accessor; + private MapConstructor for CrosstabTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public CrosstabTransform(final DesignTransformAccessor accessor) { + this.accessor = accessor; + init(); + } + + private void init() { + crosstabs = new HashMap<>(); + crosstabRowCounter = new CrosstabRowCounter(); + } + + /** + *transform.
+ * + * @param crosstab a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstab} object. + * @param resetType a {@link software.xdev.dynamicreports.design.constant.ResetType} object. + * @param resetGroup a {@link software.xdev.dynamicreports.design.base.DRDesignGroup} object. + * @return a {@link software.xdev.dynamicreports.design.base.crosstab.DRDesignCrosstab} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignCrosstab transform(final DRICrosstab crosstab, ResetType resetType, DRDesignGroup resetGroup) throws DRException { + final DRDesignCrosstab designCrosstab = new DRDesignCrosstab(); + designCrosstab.setDataset(dataset(crosstab.getDataset(), resetType, resetGroup)); + accessor.transformToDataset(crosstab.getDataset().getSubDataset()); + if (crosstab.getDataset() != null) { + resetType = null; + resetGroup = null; + } + final DRDesignCrosstabCellContent whenNoDataCell = cellContent(crosstab.getWhenNoDataCell(), resetType, resetGroup); + designCrosstab.setWidth(accessor.getTemplateTransform().getCrosstabWidth(crosstab)); + designCrosstab.setHeight(accessor.getTemplateTransform().getCrosstabHeight(crosstab, whenNoDataCell)); + designCrosstab.setRepeatColumnHeaders(crosstab.isRepeatColumnHeaders()); + designCrosstab.setRepeatRowHeaders(crosstab.isRepeatRowHeaders()); + designCrosstab.setColumnBreakOffset(crosstab.getColumnBreakOffset()); + designCrosstab.setIgnoreWidth(crosstab.getIgnoreWidth()); + designCrosstab.setRunDirection(crosstab.getRunDirection()); + designCrosstab.setWhenNoDataCell(whenNoDataCell); + designCrosstab.setHeaderCell(cellContent(crosstab.getHeaderCell(), resetType, resetGroup)); + for (final DRICrosstabColumnGroup> columnGroup : crosstab.getColumnGroups()) { + addColumnGroup(crosstab, designCrosstab, columnGroup, resetType, resetGroup); + } + for (final DRICrosstabRowGroup> rowGroup : crosstab.getRowGroups()) { + addRowGroup(crosstab, designCrosstab, rowGroup, resetType, resetGroup); + } + addCells(crosstab, designCrosstab, resetType, resetGroup); + for (final DRICrosstabVariable> variable : crosstab.getVariables()) { + addMeasure(designCrosstab, variable); + } + for (final DRICrosstabMeasure> measure : crosstab.getMeasures()) { + if (measure.getExpression() instanceof DRICrosstabVariable>) { + addMeasure(designCrosstab, (DRICrosstabVariable>) measure.getExpression()); + } + } + accessor.getExpressionTransform().transformExpression(crosstabRowCounter); + addRowCountExpression(designCrosstab); + crosstabs.put(designCrosstab, crosstab); + accessor.transformToMainDataset(); + + return designCrosstab; + } + + // dataset + private DRDesignCrosstabDataset dataset(final DRICrosstabDataset dataset, final ResetType resetType, final DRDesignGroup resetGroup) throws DRException { + final DRDesignCrosstabDataset designDataset = new DRDesignCrosstabDataset(); + designDataset.setSubDataset(accessor.getDatasetTransform().transform(dataset.getSubDataset())); + designDataset.setDataPreSorted(dataset.getDataPreSorted()); + if (resetType != null && resetType.equals(ResetType.NONE)) { + designDataset.setResetType(ResetType.REPORT); + } else { + designDataset.setResetType(resetType); + } + designDataset.setResetGroup(resetGroup); + return designDataset; + } + + private void addRowCountExpression(final DRDesignCrosstab designCrosstab) throws DRException { + final DRDesignCrosstabRowGroup lastRowGroup = getLastValue(designCrosstab.getRowGroups()); + final DRFiller filler = new DRFiller(); + final CrosstabRowCount rowCountExpression = new CrosstabRowCount(); + filler.setPrintWhenExpression(rowCountExpression); + final DRDesignComponent designTextField = accessor.getComponentTransform().filler(filler); + lastRowGroup.getHeader().getList().addComponent(designTextField); + } + + private DRDesignCrosstabCellContent cellContent(final DRICrosstabCellContent cellContent, final ResetType resetType, final DRDesignGroup resetGroup) throws DRException { + final DRDesignCrosstabCellContent designCellContents = new DRDesignCrosstabCellContent(); + designCellContents.setList(accessor.getComponentTransform().list(cellContent.getList(), DefaultStyleType.TEXT, resetType, resetGroup)); + designCellContents.setStyle(accessor.getStyleTransform().transformStyle(cellContent.getStyle(), false, DefaultStyleType.NONE)); + return designCellContents; + } + + @SuppressWarnings( {"rawtypes", "unchecked"}) + private void group(final DRDesignCrosstabGroup designGroup, final DRICrosstab crosstab, final DRICrosstabGroup group, final boolean showTotal, final ResetType resetType, final DRDesignGroup resetGroup, + final DRDesignComponent designTitleComponent, final DRDesignComponent designTotalTitleComponent) throws DRException { + designGroup.setName(group.getName()); + designGroup.setOrderType(group.getOrderType()); + + designGroup.setExpression(accessor.getExpressionTransform().transformExpression(group.getExpression())); + if (group.getOrderByExpression() != null) { + final DRIExpression orderByExpression = getCrosstabExpression(crosstab, group.getOrderByExpression()); + designGroup.setOrderByExpression(accessor.getExpressionTransform().transformExpression(orderByExpression)); + } + if (group.getComparatorExpression() != null) { + final DRIExpression comparatorExpression = getCrosstabExpression(crosstab, group.getComparatorExpression()); + designGroup.setComparatorExpression(accessor.getExpressionTransform().transformExpression(comparatorExpression)); + } + + DRTextField textField = new DRTextField(); + textField.setValueExpression(group); + textField.setPattern(group.getHeaderPattern()); + textField.setHorizontalTextAlignment(group.getHeaderHorizontalTextAlignment()); + textField.setValueFormatter(group.getHeaderValueFormatter()); + textField.setDataType(group.getDataType()); + textField.setStretchWithOverflow(group.getHeaderStretchWithOverflow()); + textField.setTextAdjust(group.getHeaderTextAdjust()); + textField.setHyperLink((DRHyperLink) group.getHeaderHyperLink()); + textField.setPropertyExpressions(group.getHeaderPropertyExpressions()); + + boolean measureTitle = false; + for (final DRICrosstabMeasure> crosstabMeasure : crosstab.getMeasures()) { + if (crosstabMeasure.getTitleExpression() != null) { + measureTitle = true; + break; + } + } + + if (group instanceof DRICrosstabRowGroup || group instanceof DRICrosstabColumnGroup && !measureTitle) { + textField.setStretchType(StretchType.CONTAINER_HEIGHT); + } + DRIReportStyle groupStyle = group.getHeaderStyle(); + if (groupStyle == null) { + groupStyle = accessor.getTemplateTransform().getCrosstabGroupStyle(crosstab); + } + textField.setStyle(groupStyle); + final DRDesignCrosstabCellContent header = createCellContent(getCellStyle(groupStyle), resetType, resetGroup); + DRDesignTextField designTextField = accessor.getComponentTransform().textField(textField, DefaultStyleType.TEXT); + designTextField.setUniqueName("group_" + designGroup.getName() + ".header"); + header.getList().addComponent(designTextField); + if (designTitleComponent != null) { + header.getList().addComponent(designTitleComponent); + } + designGroup.setHeader(header); + if (showTotal) { + DRIReportStyle totalStyle = group.getTotalHeaderStyle(); + if (totalStyle == null) { + DRICrosstabGroup> firstGroup = null; + if (group instanceof DRICrosstabRowGroup) { + firstGroup = getFirstValue(crosstab.getRowGroups()); + } else { + firstGroup = getFirstValue(crosstab.getColumnGroups()); + } + if (firstGroup == group) { + totalStyle = accessor.getTemplateTransform().getCrosstabGrandTotalStyle(crosstab); + } else { + totalStyle = accessor.getTemplateTransform().getCrosstabGroupTotalStyle(crosstab); + } + } + + textField = new DRTextField(); + DRIExpression> totalHeaderExpression = group.getTotalHeaderExpression(); + if (totalHeaderExpression == null) { + totalHeaderExpression = new SystemMessageExpression("total"); + } + textField.setValueExpression(totalHeaderExpression); + textField.setStretchWithOverflow(group.getTotalHeaderStretchWithOverflow()); + textField.setTextAdjust(group.getTotalHeaderTextAdjust()); + textField.setPropertyExpressions(group.getTotalHeaderPropertyExpressions()); + textField.setStyle(totalStyle); + if (group instanceof DRICrosstabRowGroup || group instanceof DRICrosstabColumnGroup && !measureTitle) { + textField.setStretchType(StretchType.CONTAINER_HEIGHT); + } + + final DRDesignCrosstabCellContent totalHeader = createCellContent(getCellStyle(totalStyle), resetType, resetGroup); + designTextField = accessor.getComponentTransform().textField(textField, DefaultStyleType.TEXT); + designTextField.setUniqueName("group_" + designGroup.getName() + ".totalheader"); + totalHeader.getList().addComponent(designTextField); + if (designTotalTitleComponent != null) { + totalHeader.getList().addComponent(designTotalTitleComponent); + } + designGroup.setTotalHeader(totalHeader); + } + } + + private void addColumnGroup(final DRICrosstab crosstab, final DRDesignCrosstab designCrosstab, final DRICrosstabColumnGroup> columnGroup, final ResetType resetType, final DRDesignGroup resetGroup) throws DRException { + final DRDesignCrosstabColumnGroup designColumnGroup = new DRDesignCrosstabColumnGroup(); + final boolean showTotal = accessor.getTemplateTransform().isCrosstabColumnGroupShowTotal(columnGroup); + + DRDesignComponent designTitleComponent = null; + DRDesignComponent designTotalTitleComponent = null; + final boolean lastColumn = columnGroup == getLastValue(crosstab.getColumnGroups()); + if (showTotal || lastColumn) { + boolean showTitle = false; + for (final DRICrosstabMeasure> measure : crosstab.getMeasures()) { + if (measure.getTitleExpression() != null) { + showTitle = true; + break; + } + } + + if (showTitle) { + if (lastColumn) { + DRIReportStyle groupStyle = columnGroup.getHeaderStyle(); + if (groupStyle == null) { + groupStyle = accessor.getTemplateTransform().getCrosstabGroupStyle(crosstab); + } + final String name = "group_" + columnGroup.getName() + ".titleheader"; + designTitleComponent = getMeasureTitleComponent(name, crosstab, groupStyle); + } + if (showTotal) { + DRIReportStyle totalStyle = columnGroup.getTotalHeaderStyle(); + if (totalStyle == null) { + final DRICrosstabGroup> firstGroup = getFirstValue(crosstab.getColumnGroups()); + if (firstGroup == columnGroup) { + totalStyle = accessor.getTemplateTransform().getCrosstabGrandTotalStyle(crosstab); + } else { + totalStyle = accessor.getTemplateTransform().getCrosstabGroupTotalStyle(crosstab); + } + } + final String name = "group_" + columnGroup.getName() + ".titletotalheader"; + designTotalTitleComponent = getMeasureTitleComponent(name, crosstab, totalStyle); + } + } + } + + group(designColumnGroup, crosstab, columnGroup, showTotal, resetType, resetGroup, designTitleComponent, designTotalTitleComponent); + designColumnGroup.setTotalPosition(accessor.getTemplateTransform().getCrosstabColumnGroupTotalPosition(columnGroup)); + designCrosstab.getColumnGroups().add(designColumnGroup); + } + + @SuppressWarnings( {"rawtypes", "unchecked"}) + private DRDesignComponent getMeasureTitleComponent(final String name, final DRICrosstab crosstab, final DRIReportStyle defaultStyle) throws DRException { + final DRDesignList titleComponent = new DRDesignList(); + for (final DRICrosstabMeasure> measure : crosstab.getMeasures()) { + final DRTextField textField = new DRTextField(); + if (measure.getTitleExpression() != null) { + textField.setValueExpression(measure.getTitleExpression()); + } + DRIReportStyle titleStyle = accessor.getTemplateTransform().getCrosstabMeasureTitleStyle(crosstab, measure); + if (titleStyle == null) { + titleStyle = defaultStyle; + } + textField.setStyle(titleStyle); + final DRDesignTextField designTextField = accessor.getComponentTransform().textField(textField, DefaultStyleType.TEXT); + designTextField.setUniqueName(name + "." + measure.getName()); + titleComponent.addComponent(designTextField); + } + + return titleComponent; + } + + private void addRowGroup(final DRICrosstab crosstab, final DRDesignCrosstab designCrosstab, final DRICrosstabRowGroup> rowGroup, final ResetType resetType, final DRDesignGroup resetGroup) throws DRException { + final DRDesignCrosstabRowGroup designRowGroup = new DRDesignCrosstabRowGroup(); + final boolean showTotal = accessor.getTemplateTransform().isCrosstabRowGroupShowTotal(rowGroup); + group(designRowGroup, crosstab, rowGroup, showTotal, resetType, resetGroup, null, null); + designRowGroup.setTotalPosition(accessor.getTemplateTransform().getCrosstabRowGroupTotalPosition(rowGroup)); + designCrosstab.getRowGroups().add(designRowGroup); + } + + private void addCells(final DRICrosstab crosstab, final DRDesignCrosstab designCrosstab, final ResetType resetType, final DRDesignGroup resetGroup) throws DRException { + final MeasuresStyles measuresStyle = new MeasuresStyles(crosstab, designCrosstab); + + DRIReportStyle groupTotalStyle = accessor.getTemplateTransform().getCrosstabGroupTotalStyle(crosstab); + groupTotalStyle = getCellStyle(groupTotalStyle); + DRIReportStyle grandTotalStyle = accessor.getTemplateTransform().getCrosstabGrandTotalStyle(crosstab); + grandTotalStyle = getCellStyle(grandTotalStyle); + DRIReportStyle cellStyle = accessor.getTemplateTransform().getCrosstabCellStyle(crosstab); + cellStyle = getCellStyle(cellStyle); + + final DRICrosstabGroup> firstColumnGroup = getFirstValue(crosstab.getColumnGroups()); + final DRICrosstabGroup> firstRowGroup = getFirstValue(crosstab.getRowGroups()); + + DRDesignCrosstabCell designCell = cell(crosstab, cellStyle, measuresStyle, null, null, resetType, resetGroup); + designCrosstab.getCells().add(designCell); + + DRIReportStyle style = null; + for (final DRICrosstabColumnGroup> columnGroup : crosstab.getColumnGroups()) { + if (columnGroup == firstColumnGroup) { + style = grandTotalStyle; + } else { + style = groupTotalStyle; + } + if (accessor.getTemplateTransform().isCrosstabColumnGroupShowTotal(columnGroup)) { + designCell = cell(crosstab, style, measuresStyle, null, columnGroup, resetType, resetGroup); + designCrosstab.getCells().add(designCell); + } + } + + for (final DRICrosstabRowGroup> rowGroup : crosstab.getRowGroups()) { + if (rowGroup == firstRowGroup) { + style = grandTotalStyle; + } else { + style = groupTotalStyle; + } + if (accessor.getTemplateTransform().isCrosstabRowGroupShowTotal(rowGroup)) { + designCell = cell(crosstab, style, measuresStyle, rowGroup, null, resetType, resetGroup); + designCrosstab.getCells().add(designCell); + + for (final DRICrosstabColumnGroup> columnGroup : crosstab.getColumnGroups()) { + if (accessor.getTemplateTransform().isCrosstabColumnGroupShowTotal(columnGroup)) { + DRIReportStyle totalStyle = style; + if (columnGroup == firstColumnGroup) { + totalStyle = grandTotalStyle; + } + designCell = cell(crosstab, totalStyle, measuresStyle, rowGroup, columnGroup, resetType, resetGroup); + designCrosstab.getCells().add(designCell); + } + } + } + } + } + + privategetCrosstab.
+ * + * @param designCrosstab a {@link software.xdev.dynamicreports.design.base.crosstab.DRDesignCrosstab} object. + * @return a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstab} object. + */ + protected DRICrosstab getCrosstab(final DRDesignCrosstab designCrosstab) { + return crosstabs.get(designCrosstab); + } + + privateDatasetExpressionTransform class.
+ * + * @author Ricardo Mariaca + * + */ +public class DatasetExpressionTransform extends AbstractExpressionTransform { + private DRIDataset dataset; + + /** + *Constructor for DatasetExpressionTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + * @param dataset a {@link software.xdev.dynamicreports.report.definition.DRIDataset} object. + */ + public DatasetExpressionTransform(DesignTransformAccessor accessor, DRIDataset dataset) { + super(accessor); + this.dataset = dataset; + } + + /** {@inheritDoc} */ + @Override + protected ResetType getVariableResetType(DRIVariable> variable) { + return ResetType.REPORT; + } + + /** {@inheritDoc} */ + @Override + protected List extends DRIField>> transformFields() { + return dataset.getFields(); + } + + /** {@inheritDoc} */ + @Override + protected List extends DRIVariable>> transformVariables() { + return dataset.getVariables(); + } + + /** {@inheritDoc} */ + @Override + protected List extends DRISort> transformSorts() { + return dataset.getSorts(); + } + + /** {@inheritDoc} */ + @Override + protected DRIDesignDataset getDataset() { + return accessor.getDatasetTransform().getDesignDataset(dataset); + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/DatasetTransform.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/DatasetTransform.java new file mode 100644 index 0000000..0bb2539 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/DatasetTransform.java @@ -0,0 +1,119 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeDatasetTransform class.
+ * + * @author Ricardo Mariaca + * + */ +public class DatasetTransform { + private DesignTransformAccessor accessor; + private MapConstructor for DatasetTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public DatasetTransform(DesignTransformAccessor accessor) { + this.accessor = accessor; + datasets = new HashMap<>(); + designDatasets = new HashMap<>(); + } + + /** + *transform.
+ * + * @param dataset a {@link software.xdev.dynamicreports.report.definition.DRIDataset} object. + * @return a {@link software.xdev.dynamicreports.design.base.DRDesignDataset} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public DRDesignDataset transform(DRIDataset dataset) throws DRException { + if (dataset == null) { + return null; + } + if (designDatasets.containsKey(dataset)) { + return designDatasets.get(dataset); + } + + DatasetExpressionTransform datasetExpressionTransform = new DatasetExpressionTransform(accessor, dataset); + datasetExpressionTransform.transform(); + DRDesignDataset designDataset = new DRDesignDataset(datasetExpressionTransform); + if (dataset.getQuery() != null) { + designDataset.setQuery(accessor.getReportTransform().query(dataset.getQuery())); + } + designDataset.setConnectionExpression(accessor.getExpressionTransform().transformExpression(dataset.getConnectionExpression())); + designDataset.setDataSourceExpression(accessor.getExpressionTransform().transformExpression(dataset.getDataSourceExpression())); + designDataset.setFilterExpression(datasetExpressionTransform.transformExpression(dataset.getFilterExpression(), JasperScriptlet.SCRIPTLET_NAME)); + + addDataset(dataset, designDataset); + + return designDataset; + } + + /** + *getDatasetExpressionTransform.
+ * + * @param dataset a {@link software.xdev.dynamicreports.report.definition.DRIDataset} object. + * @return a {@link software.xdev.dynamicreports.design.transformation.DatasetExpressionTransform} object. + */ + public DatasetExpressionTransform getDatasetExpressionTransform(DRIDataset dataset) { + return designDatasets.get(dataset).getDatasetExpressionTransform(); + } + + /** + *getDesignDataset.
+ * + * @param dataset a {@link software.xdev.dynamicreports.report.definition.DRIDataset} object. + * @return a {@link software.xdev.dynamicreports.design.base.DRDesignDataset} object. + */ + protected DRDesignDataset getDesignDataset(DRIDataset dataset) { + return designDatasets.get(dataset); + } + + private void addDataset(DRIDataset dataset, DRDesignDataset designDataset) { + if (datasets.containsKey(designDataset.getName())) { + throw new DRDesignReportException("Duplicate declaration of dataset \"" + designDataset.getName() + "\""); + } + datasets.put(designDataset.getName(), designDataset); + designDatasets.put(dataset, designDataset); + } + + /** + *Getter for the field datasets
.
DesignTransformAccessor interface.
+ * + * @author Ricardo Mariaca + * + */ +public interface DesignTransformAccessor { + + /** + *getReport.
+ * + * @return a {@link software.xdev.dynamicreports.report.definition.DRIReport} object. + */ + public DRIReport getReport(); + + /** + *getPageWidth.
+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getPageWidth(); + + /** + *getReportTransform.
+ * + * @return a {@link software.xdev.dynamicreports.design.transformation.ReportTransform} object. + */ + public ReportTransform getReportTransform(); + + /** + *getTemplateTransform.
+ * + * @return a {@link software.xdev.dynamicreports.design.transformation.TemplateTransform} object. + */ + public TemplateTransform getTemplateTransform(); + + /** + *transformToMainDataset.
+ */ + public void transformToMainDataset(); + + /** + *transformToDataset.
+ * + * @param dataset a {@link software.xdev.dynamicreports.report.definition.DRIDataset} object. + */ + public void transformToDataset(DRIDataset dataset); + + /** + *getExpressionTransform.
+ * + * @return a {@link software.xdev.dynamicreports.design.transformation.AbstractExpressionTransform} object. + */ + public AbstractExpressionTransform getExpressionTransform(); + + /** + *getPageTransform.
+ * + * @return a {@link software.xdev.dynamicreports.design.transformation.PageTransform} object. + */ + public PageTransform getPageTransform(); + + /** + *getBandTransform.
+ * + * @return a {@link software.xdev.dynamicreports.design.transformation.BandTransform} object. + */ + public BandTransform getBandTransform(); + + /** + *getComponentTransform.
+ * + * @return a {@link software.xdev.dynamicreports.design.transformation.ComponentTransform} object. + */ + public ComponentTransform getComponentTransform(); + + /** + *getGroupTransform.
+ * + * @return a {@link software.xdev.dynamicreports.design.transformation.GroupTransform} object. + */ + public GroupTransform getGroupTransform(); + + /** + *getColumnTransform.
+ * + * @return a {@link software.xdev.dynamicreports.design.transformation.ColumnTransform} object. + */ + public ColumnTransform getColumnTransform(); + + /** + *getColumnGridTransform.
+ * + * @return a {@link software.xdev.dynamicreports.design.transformation.ColumnGridTransform} object. + */ + public ColumnGridTransform getColumnGridTransform(); + + /** + *getStyleTransform.
+ * + * @return a {@link software.xdev.dynamicreports.design.transformation.StyleTransform} object. + */ + public StyleTransform getStyleTransform(); + + /** + *getCrosstabTransform.
+ * + * @return a {@link software.xdev.dynamicreports.design.transformation.CrosstabTransform} object. + */ + public CrosstabTransform getCrosstabTransform(); + + /** + *getDatasetTransform.
+ * + * @return a {@link software.xdev.dynamicreports.design.transformation.DatasetTransform} object. + */ + public DatasetTransform getDatasetTransform(); + + /** + *getTableOfContentsTransform.
+ * + * @return a {@link software.xdev.dynamicreports.design.transformation.TableOfContentsTransform} object. + */ + public TableOfContentsTransform getTableOfContentsTransform(); + + /** + *isTableOfContents.
+ * + * @return a boolean. + */ + public boolean isTableOfContents(); + + /** + *getPage.
+ * + * @return a {@link software.xdev.dynamicreports.design.base.DRDesignPage} object. + */ + public DRDesignPage getPage(); + + /** + *getLocale.
+ * + * @return a {@link java.util.Locale} object. + */ + public Locale getLocale(); + + /** + *getResourceBundle.
+ * + * @return a {@link java.util.ResourceBundle} object. + */ + public ResourceBundle getResourceBundle(); + + /** + *getResourceBundleName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getResourceBundleName(); + + /** + *getWhenResourceMissingType.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.WhenResourceMissingType} object. + */ + public WhenResourceMissingType getWhenResourceMissingType(); +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/GroupTransform.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/GroupTransform.java new file mode 100644 index 0000000..29be44d --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/GroupTransform.java @@ -0,0 +1,331 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeGroupTransform class.
+ * + * @author Ricardo Mariaca + * + */ +public class GroupTransform { + private DesignTransformAccessor accessor; + private List extends DRIGroup> groups; + private MapConstructor for GroupTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public GroupTransform(DesignTransformAccessor accessor) { + this.accessor = accessor; + init(); + } + + private void init() { + DRIReport report = accessor.getReport(); + groups = report.getGroups(); + designGroups = new LinkedHashMaptransform.
+ * + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public void transform() throws DRException { + for (DRIGroup group : groups) { + DRDesignGroup designGroup = group(group); + addGroup(group, designGroup); + } + } + + private void addGroup(DRIGroup group, DRDesignGroup designGroup) { + if (accessor.getTemplateTransform().isGroupHideColumn(group) && group.getValueField().getValueExpression() instanceof DRIValueColumn>) { + hideGroupColumns.add((DRIValueColumn>) group.getValueField().getValueExpression()); + } + designGroups.put(group, designGroup); + if (firstResetPageNumberGroup == null && designGroup.isResetPageNumber()) { + firstResetPageNumberGroup = group; + } + groupPadding += accessor.getTemplateTransform().getGroupPadding(group); + } + + /** + *transformHeaderAndFooter.
+ * + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public void transformHeaderAndFooter() throws DRException { + int groupPadding = 0; + int level = 0; + for (DRIGroup group : groups) { + headerAndFooter(group, designGroups.get(group), groupPadding, level++); + groupPadding += accessor.getTemplateTransform().getGroupPadding(group); + } + } + + private void headerAndFooter(DRIGroup group, DRDesignGroup designGroup, int groupPadding, int level) throws DRException { + DRDesignList header = new DRDesignList(); + TemplateTransform templateTransform = accessor.getTemplateTransform(); + + DRDesignTableOfContentsHeading designTocHeading = accessor.getTableOfContentsTransform().groupHeading(group, level); + if (designTocHeading != null) { + header.addComponent(designTocHeading.getReferenceField()); + } + + switch (templateTransform.getGroupHeaderLayout(group)) { + case EMPTY: + break; + case TITLE_AND_VALUE: + if (groupPadding > 0) { + DRDesignFiller filler = new DRDesignFiller(); + filler.setWidth(groupPadding); + filler.setHeight(0); + header.addComponent(HorizontalCellComponentAlignment.CENTER, null, filler); + } + header.addComponent(HorizontalCellComponentAlignment.LEFT, null, titleComponent(group)); + DRDesignTextField valueComponent = valueComponent(group); + header.addComponent(valueComponent); + if (designTocHeading != null) { + valueComponent.setAnchorNameExpression(designTocHeading.getReferenceField().getAnchorNameExpression()); + valueComponent.setBookmarkLevel(designTocHeading.getReferenceField().getBookmarkLevel()); + valueComponent.setHyperLink(designTocHeading.getReferenceField().getHyperLink()); + } + break; + case VALUE: + if (groupPadding > 0) { + DRDesignFiller filler = new DRDesignFiller(); + filler.setWidth(groupPadding); + filler.setHeight(0); + header.addComponent(HorizontalCellComponentAlignment.CENTER, null, filler); + } + valueComponent = valueComponent(group); + header.addComponent(valueComponent); + if (designTocHeading != null) { + valueComponent.setAnchorNameExpression(designTocHeading.getReferenceField().getAnchorNameExpression()); + valueComponent.setBookmarkLevel(designTocHeading.getReferenceField().getBookmarkLevel()); + valueComponent.setHyperLink(designTocHeading.getReferenceField().getHyperLink()); + } + break; + default: + throw new DRDesignReportException("Group header layout " + templateTransform.getGroupHeaderLayout(group).name() + " not supported"); + } + if (!header.isEmpty()) { + DRIBand bnd = group.getHeaderBand(); + DRDesignBand band = accessor.getBandTransform() + .band("groupHeaderTitleAndValue", bnd, templateTransform.getGroupHeaderSplitType(bnd), templateTransform.getGroupHeaderStyle(bnd), + templateTransform.getGroupHeaderBackgroundComponent(bnd)); + band.addComponent(header); + designGroup.addHeaderBand(band); + } + + DRIBand band = group.getHeaderBand(); + designGroup.addHeaderBand( + groupBand("groupHeader", band, templateTransform.getGroupHeaderSplitType(band), templateTransform.getGroupHeaderStyle(band), templateTransform.getGroupHeaderBackgroundComponent(band), + groupPadding, designGroup)); + band = group.getFooterBand(); + designGroup.addFooterBand( + groupBand("groupFooter", band, templateTransform.getGroupFooterSplitType(band), templateTransform.getGroupFooterStyle(band), templateTransform.getGroupFooterBackgroundComponent(band), + groupPadding, designGroup)); + if (templateTransform.isGroupShowColumnHeaderAndFooter(group)) { + designGroup.addHeaderBand(accessor.getBandTransform().getColumnHeaderForGroupBand()); + designGroup.addFooterBand(accessor.getBandTransform().getColumnFooterBand()); + } + } + + private DRDesignBand groupBand(String name, DRIBand band, SplitType splitType, DRIReportStyle defaultStyle, DRIComponent defaultBackgroundComponent, int groupPadding, DRDesignGroup resetGroup) + throws DRException { + DRDesignBand designBand = accessor.getBandTransform().band(name, band, splitType, defaultStyle, defaultBackgroundComponent, ResetType.GROUP, resetGroup); + if (groupPadding > 0) { + DRDesignFiller filler = new DRDesignFiller(); + filler.setWidth(groupPadding); + filler.setHeight(0); + DRDesignList list = new DRDesignList(); + list.addComponent(HorizontalCellComponentAlignment.CENTER, null, filler); + list.addComponent(designBand.getList()); + designBand.setList(list); + } + return designBand; + } + + // title + @SuppressWarnings("unchecked") + private DRDesignComponent titleComponent(DRIGroup group) throws DRException { + @SuppressWarnings("rawtypes") DRTextField titleField = new DRTextField(); + titleField.setValueExpression(group.getTitleExpression()); + titleField.setStyle(group.getTitleStyle()); + titleField.setWidth(group.getTitleWidth()); + DRDesignTextField designTitleField = accessor.getComponentTransform().textField(titleField, DefaultStyleType.GROUP_TITLE); + designTitleField.setUniqueName("group_" + group.getName() + ".title"); + return designTitleField; + } + + // value + private DRDesignTextField valueComponent(DRIGroup group) throws DRException { + DRDesignTextField designValueField = accessor.getComponentTransform().textField(group.getValueField(), DefaultStyleType.GROUP); + designValueField.setUniqueName("group_" + group.getName()); + return designValueField; + } + + // group + @SuppressWarnings( {"unchecked", "rawtypes"}) + private DRDesignGroup group(DRIGroup group) throws DRException { + TemplateTransform templateTransform = accessor.getTemplateTransform(); + DRDesignGroup designGroup = new DRDesignGroup(group.getName()); + designGroup.setStartInNewPage(templateTransform.isGroupStartInNewPage(group)); + designGroup.setStartInNewColumn(templateTransform.isGroupStartInNewColumn(group)); + designGroup.setReprintHeaderOnEachPage(templateTransform.isGroupReprintHeaderOnEachPage(group)); + designGroup.setResetPageNumber(templateTransform.isGroupResetPageNumber(group)); + designGroup.setMinHeightToStartNewPage(templateTransform.getGroupMinHeightToStartNewPage(group)); + designGroup.setFooterPosition(templateTransform.getGroupFooterPosition(group)); + designGroup.setKeepTogether(templateTransform.isGroupKeepTogether(group)); + designGroup.setHeaderWithSubtotal(templateTransform.isGroupHeaderWithSubtotal(group)); + DRIExpression> groupExpression = group.getValueField().getValueExpression(); + if (templateTransform.isGroupByDataType(group) && group.getValueField().getDataType() != null) { + accessor.getExpressionTransform().transformExpression(groupExpression); + DRIDataType, ?> dataType = group.getValueField().getDataType(); + groupExpression = new GroupByDataTypeExpression(groupExpression, dataType); + } + groupExpression = new DRVariable(groupExpression, Calculation.NOTHING); + designGroup.setGroupExpression(accessor.getExpressionTransform().transformExpression(groupExpression)); + return designGroup; + } + + /** + *getGroup.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a {@link software.xdev.dynamicreports.design.base.DRDesignGroup} object. + */ + protected DRDesignGroup getGroup(DRIGroup group) { + return designGroups.get(group); + } + + /** + *getFirstGroup.
+ * + * @return a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + */ + protected DRIGroup getFirstGroup() { + if (!groups.isEmpty()) { + return groups.get(0); + } + return null; + } + + /** + *getBeforeGroup.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + */ + protected DRIGroup getBeforeGroup(DRIGroup group) { + if (groups.size() > 1 && groups.indexOf(group) > 0) { + return groups.get(groups.indexOf(group) - 1); + } + return null; + } + + /** + *getLastGroup.
+ * + * @return a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + */ + protected DRIGroup getLastGroup() { + if (!groups.isEmpty()) { + return groups.get(groups.size() - 1); + } + return null; + } + + /** + *Getter for the field firstResetPageNumberGroup
.
Getter for the field groupPadding
.
Getter for the field hideGroupColumns
.
Getter for the field groups
.
MainDatasetExpressionTransform class.
+ * + * @author Ricardo Mariaca + * + */ +public class MainDatasetExpressionTransform extends AbstractExpressionTransform { + + /** + *Constructor for MainDatasetExpressionTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public MainDatasetExpressionTransform(DesignTransformAccessor accessor) { + super(accessor); + } + + /** {@inheritDoc} */ + @Override + public void transform() throws DRException { + DRIReport report = accessor.getReport(); + ListPageTransform class.
+ * + * @author Ricardo Mariaca + * + */ +public class PageTransform { + private TemplateTransform templateTransform; + private DRDesignPage page; + private int maxBandWidth; + + /** + *Constructor for PageTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public PageTransform(DesignTransformAccessor accessor) { + this.templateTransform = accessor.getTemplateTransform(); + this.page = new DRDesignPage(); + } + + /** + *transform.
+ * + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public void transform() throws DRException { + this.page.setHeight(templateTransform.getPageHeight()); + this.page.setOrientation(templateTransform.getPageOrientation()); + this.page.setMargin(margin(templateTransform.getPageMargin())); + this.page.setColumnsPerPage(templateTransform.getPageColumnsPerPage()); + this.page.setColumnSpace(templateTransform.getPageColumnSpace()); + } + + private DRDesignMargin margin(DRIMargin margin) { + DRDesignMargin designMargin = new DRDesignMargin(); + designMargin.setTop(margin.getTop()); + designMargin.setLeft(margin.getLeft()); + designMargin.setBottom(margin.getBottom()); + designMargin.setRight(margin.getRight()); + return designMargin; + } + + /** + *Getter for the field page
.
transformPageWidth.
+ * + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public void transformPageWidth() throws DRException { + int pageWidth = templateTransform.getPageWidth(); + maxBandWidth = pageWidth - getPage().getMargin().getLeft() - getPage().getMargin().getRight(); + this.page.setWidth(pageWidth); + this.page.setColumnWidth(templateTransform.getPageColumnWidth(this.page)); + } + + /** + *Getter for the field maxBandWidth
.
ReportTransform class.
+ * + * @author Ricardo Mariaca + * + */ +public class ReportTransform { + private DesignTransformAccessor accessor; + private DRIDesignTemplateDesign templateDesign; + private DRDesignQuery query; + private ListConstructor for ReportTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public ReportTransform(DesignTransformAccessor accessor) { + this.accessor = accessor; + parameters = new ArrayListtransform.
+ * + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public void transform() throws DRException { + DRIReport report = accessor.getReport(); + templateDesign = new DRDesignTemplateDesign(report.getTemplateDesign()); + if (report.getQuery() != null) { + query = query(report.getQuery()); + } + for (DRIParameter> parameter : report.getParameters()) { + parameters.add(parameter(parameter)); + } + filterExpression = accessor.getExpressionTransform().transformExpression(report.getFilterExpression(), JasperScriptlet.SCRIPTLET_NAME); + } + + /** + *query.
+ * + * @param query a {@link software.xdev.dynamicreports.report.definition.DRIQuery} object. + * @return a {@link software.xdev.dynamicreports.design.base.DRDesignQuery} object. + */ + protected DRDesignQuery query(DRIQuery query) { + DRDesignQuery designQuery = new DRDesignQuery(); + designQuery.setText(query.getText()); + designQuery.setLanguage(query.getLanguage()); + return designQuery; + } + + private DRDesignParameter parameter(DRIParameter> parameter) { + DRDesignParameter designParameter = new DRDesignParameter(); + designParameter.setName(parameter.getName()); + designParameter.setValueClass(parameter.getValueClass()); + designParameter.setValue(parameter.getValue()); + designParameter.setExternal(accessor.getReport().getTemplateDesign().isDefinedParameter(parameter.getName())); + return designParameter; + } + + /** + *hyperlink.
+ * + * @param hyperLink a {@link software.xdev.dynamicreports.report.definition.DRIHyperLink} object. + * @return a {@link software.xdev.dynamicreports.design.base.DRDesignHyperLink} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public DRDesignHyperLink hyperlink(DRIHyperLink hyperLink) throws DRException { + if (hyperLink == null) { + return null; + } + + DRDesignHyperLink designHyperLink = new DRDesignHyperLink(); + designHyperLink.setAnchorExpression(accessor.getExpressionTransform().transformExpression(hyperLink.getAnchorExpression())); + designHyperLink.setPageExpression(accessor.getExpressionTransform().transformExpression(hyperLink.getPageExpression())); + designHyperLink.setReferenceExpression(accessor.getExpressionTransform().transformExpression(hyperLink.getReferenceExpression())); + designHyperLink.setTooltipExpression(accessor.getExpressionTransform().transformExpression(hyperLink.getTooltipExpression())); + designHyperLink.setType(hyperLink.getType()); + designHyperLink.setTarget(hyperLink.getTarget()); + + return designHyperLink; + } + + /** + *Getter for the field templateDesign
.
Getter for the field query
.
Getter for the field parameters
.
Getter for the field filterExpression
.
StyleResolver class.
+ * + * @author Ricardo Mariaca + * + */ +public class StyleResolver { + private static FontRenderContext context = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB).createGraphics().getFontRenderContext(); + + /** + *getFontWidth.
+ * + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @param columns a int. + * @return a int. + */ + protected static int getFontWidth(DRDesignStyle style, int columns) { + double width = getFont(style).getStringBounds("m", context).getWidth(); + return (int) Math.ceil(width * columns) + getHorizontalPadding(style); + } + + /** + *getFontHeight.
+ * + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @param rows a int. + * @return a int. + */ + protected static int getFontHeight(DRDesignStyle style, int rows) { + double height = getFont(style).getMaxCharBounds(context).getHeight(); + return (int) Math.ceil(height * rows) + getVerticalPadding(style); + } + + /** + *getFontWidth.
+ * + * @param font a {@link software.xdev.dynamicreports.report.base.style.DRFont} object. + * @return a double. + */ + public static double getFontWidth(DRFont font) { + Font fnt = getFont(font.getFontName(), font.getBold(), font.getItalic(), font.getFontSize()); + return fnt.getStringBounds("m", context).getWidth(); + } + + /** + *getFontHeight.
+ * + * @param font a {@link software.xdev.dynamicreports.report.base.style.DRFont} object. + * @return a double. + */ + public static double getFontHeight(DRFont font) { + Font fnt = getFont(font.getFontName(), font.getBold(), font.getItalic(), font.getFontSize()); + return fnt.getMaxCharBounds(context).getHeight(); + } + + private static Font getFont(DRDesignStyle style) { + String fontName = getFontName(style); + Integer fontSize = getFontSize(style); + Boolean bold = getFontBold(style); + Boolean italic = getFontItalic(style); + return getFont(fontName, bold, italic, fontSize); + } + + private static Font getFont(String fontName, Boolean bold, Boolean italic, Integer fontSize) { + if (bold == null) { + bold = false; + } + if (italic == null) { + italic = false; + } + int fontStyle; + if (bold && italic) { + fontStyle = Font.BOLD | Font.ITALIC; + } else if (bold) { + fontStyle = Font.BOLD; + } else if (italic) { + fontStyle = Font.ITALIC; + } else { + fontStyle = Font.PLAIN; + } + + FontUtil fontUtil = FontUtil.getInstance(DefaultJasperReportsContext.getInstance()); + Font font = fontUtil.getAwtFontFromBundles(fontName, fontStyle, (float) fontSize, Locale.getDefault(), true); + if (font == null) { + font = new Font(fontName, fontStyle, fontSize); + } + return font; + } + + /** + *getFontName.
+ * + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link java.lang.String} object. + */ + protected static String getFontName(DRDesignStyle style) { + if (style == null) { + return null; + } + if (style.getFont().getFontName() != null) { + return style.getFont().getFontName(); + } + if (style.getParentStyle() != null) { + return getFontName(style.getParentStyle()); + } + return null; + } + + /** + *getFontSize.
+ * + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link java.lang.Integer} object. + */ + protected static Integer getFontSize(DRDesignStyle style) { + if (style == null) { + return null; + } + if (style.getFont().getFontSize() != null) { + return style.getFont().getFontSize(); + } + if (style.getParentStyle() != null) { + return getFontSize(style.getParentStyle()); + } + return null; + } + + /** + *getFontBold.
+ * + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link java.lang.Boolean} object. + */ + protected static Boolean getFontBold(DRDesignStyle style) { + if (style == null) { + return null; + } + if (style.getFont().getBold() != null) { + return style.getFont().getBold(); + } + if (style.getParentStyle() != null) { + return getFontBold(style.getParentStyle()); + } + return null; + } + + /** + *getFontItalic.
+ * + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link java.lang.Boolean} object. + */ + protected static Boolean getFontItalic(DRDesignStyle style) { + if (style == null) { + return null; + } + if (style.getFont().getItalic() != null) { + return style.getFont().getItalic(); + } + if (style.getParentStyle() != null) { + return getFontItalic(style.getParentStyle()); + } + return null; + } + + /** + *getFontUnderline.
+ * + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link java.lang.Boolean} object. + */ + protected static Boolean getFontUnderline(DRDesignStyle style) { + if (style == null) { + return null; + } + if (style.getFont().getUnderline() != null) { + return style.getFont().getUnderline(); + } + if (style.getParentStyle() != null) { + return getFontUnderline(style.getParentStyle()); + } + return null; + } + + /** + *getFontStrikeThrough.
+ * + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link java.lang.Boolean} object. + */ + protected static Boolean getFontStrikeThrough(DRDesignStyle style) { + if (style == null) { + return null; + } + if (style.getFont().getStrikeThrough() != null) { + return style.getFont().getStrikeThrough(); + } + if (style.getParentStyle() != null) { + return getFontStrikeThrough(style.getParentStyle()); + } + return null; + } + + /** + *getPdfFontName.
+ * + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link java.lang.String} object. + */ + protected static String getPdfFontName(DRDesignStyle style) { + if (style == null) { + return null; + } + if (style.getFont().getPdfFontName() != null) { + return style.getFont().getPdfFontName(); + } + if (style.getParentStyle() != null) { + return getPdfFontName(style.getParentStyle()); + } + return null; + } + + /** + *getPdfEncoding.
+ * + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link java.lang.String} object. + */ + protected static String getPdfEncoding(DRDesignStyle style) { + if (style == null) { + return null; + } + if (style.getFont().getPdfEncoding() != null) { + return style.getFont().getPdfEncoding(); + } + if (style.getParentStyle() != null) { + return getPdfEncoding(style.getParentStyle()); + } + return null; + } + + /** + *getPdfEmbedded.
+ * + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link java.lang.Boolean} object. + */ + protected static Boolean getPdfEmbedded(DRDesignStyle style) { + if (style == null) { + return null; + } + if (style.getFont().getPdfEmbedded() != null) { + return style.getFont().getPdfEmbedded(); + } + if (style.getParentStyle() != null) { + return getPdfEmbedded(style.getParentStyle()); + } + return null; + } + + /** + *getHorizontalPadding.
+ * + * @param style a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignStyle} object. + * @return a int. + */ + public static int getHorizontalPadding(DRIDesignStyle style) { + return getLeftPadding(style) + getRightPadding(style) + getLeftIndent(style) + getRightIndent(style); + } + + /** + *getVerticalPadding.
+ * + * @param style a {@link software.xdev.dynamicreports.design.definition.style.DRIDesignStyle} object. + * @return a int. + */ + public static int getVerticalPadding(DRIDesignStyle style) { + return getTopPadding(style) + getBottomPadding(style) + getFirstLineIndent(style); + } + + private static Integer getTopPadding(DRIDesignStyle style) { + if (style == null) { + return 0; + } + if (style.getPadding() != null && style.getPadding().getTop() != null) { + return style.getPadding().getTop(); + } + if (style.getParentStyle() != null) { + return getTopPadding(style.getParentStyle()); + } + return 0; + } + + private static Integer getBottomPadding(DRIDesignStyle style) { + if (style == null) { + return 0; + } + if (style.getPadding() != null && style.getPadding().getBottom() != null) { + return style.getPadding().getBottom(); + } + if (style.getParentStyle() != null) { + return getBottomPadding(style.getParentStyle()); + } + return 0; + } + + private static Integer getLeftPadding(DRIDesignStyle style) { + if (style == null) { + return 0; + } + if (style.getPadding() != null && style.getPadding().getLeft() != null) { + return style.getPadding().getLeft(); + } + if (style.getParentStyle() != null) { + return getLeftPadding(style.getParentStyle()); + } + return 0; + } + + private static Integer getRightPadding(DRIDesignStyle style) { + if (style == null) { + return 0; + } + if (style.getPadding() != null && style.getPadding().getRight() != null) { + return style.getPadding().getRight(); + } + if (style.getParentStyle() != null) { + return getRightPadding(style.getParentStyle()); + } + return 0; + } + + private static Integer getFirstLineIndent(DRIDesignStyle style) { + if (style == null) { + return 0; + } + if (style.getParagraph() != null && style.getParagraph().getFirstLineIndent() != null) { + return style.getParagraph().getFirstLineIndent(); + } + if (style.getParentStyle() != null) { + return getFirstLineIndent(style.getParentStyle()); + } + return 0; + } + + private static Integer getLeftIndent(DRIDesignStyle style) { + if (style == null) { + return 0; + } + if (style.getParagraph() != null && style.getParagraph().getLeftIndent() != null) { + return style.getParagraph().getLeftIndent(); + } + if (style.getParentStyle() != null) { + return getLeftIndent(style.getParentStyle()); + } + return 0; + } + + private static Integer getRightIndent(DRIDesignStyle style) { + if (style == null) { + return 0; + } + if (style.getParagraph() != null && style.getParagraph().getRightIndent() != null) { + return style.getParagraph().getRightIndent(); + } + if (style.getParentStyle() != null) { + return getRightIndent(style.getParentStyle()); + } + return 0; + } + + /** + *getPattern.
+ * + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link java.lang.String} object. + */ + public static String getPattern(DRDesignStyle style) { + if (style == null) { + return null; + } + if (style.getPattern() != null) { + return style.getPattern(); + } + if (style.getParentStyle() != null) { + return getPattern(style.getParentStyle()); + } + return null; + } + + /** + *getHorizontalTextAlignment.
+ * + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link software.xdev.dynamicreports.report.constant.HorizontalTextAlignment} object. + */ + public static HorizontalTextAlignment getHorizontalTextAlignment(DRDesignStyle style) { + if (style == null) { + return null; + } + if (style.getHorizontalTextAlignment() != null) { + return style.getHorizontalTextAlignment(); + } + if (style.getParentStyle() != null) { + return getHorizontalTextAlignment(style.getParentStyle()); + } + return null; + } + + /** + *getHorizontalImageAlignment.
+ * + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link software.xdev.dynamicreports.report.constant.HorizontalImageAlignment} object. + */ + public static HorizontalImageAlignment getHorizontalImageAlignment(DRDesignStyle style) { + if (style == null) { + return null; + } + if (style.getHorizontalImageAlignment() != null) { + return style.getHorizontalImageAlignment(); + } + if (style.getParentStyle() != null) { + return getHorizontalImageAlignment(style.getParentStyle()); + } + return null; + } + + /** + *getBackgroundColor.
+ * + * @param reportStyle a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + * @param transform a {@link software.xdev.dynamicreports.design.transformation.StyleTransform} object. + * @return a {@link java.awt.Color} object. + */ + public static Color getBackgroundColor(DRIReportStyle reportStyle, StyleTransform transform) { + if (reportStyle == null) { + return null; + } + DRIStyle style = transform.getStyle(reportStyle); + if (style.getBackgroundColor() != null) { + return style.getBackgroundColor(); + } + if (style.getParentStyle() != null) { + return getBackgroundColor(style.getParentStyle(), transform); + } + return null; + } + + /** + *mergeColors.
+ * + * @param color1 a {@link java.awt.Color} object. + * @param color2 a {@link java.awt.Color} object. + * @param percent a float. + * @return a {@link java.awt.Color} object. + */ + public static Color mergeColors(Color color1, Color color2, float percent) { + float amount = 1.0f - percent; + int r = (int) (color1.getRed() * amount + color2.getRed() * percent); + int g = (int) (color1.getGreen() * amount + color2.getGreen() * percent); + int b = (int) (color1.getBlue() * amount + color2.getBlue() * percent); + int a = (int) (color1.getAlpha() * amount + color2.getAlpha() * percent); + return new Color(r, g, b, a); + } + +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/StyleTransform.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/StyleTransform.java new file mode 100644 index 0000000..05ebc57 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/StyleTransform.java @@ -0,0 +1,440 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeStyleTransform class.
+ * + * @author Ricardo Mariaca + */ +public class StyleTransform +{ + private final DesignTransformAccessor accessor; + private MapConstructor for StyleTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public StyleTransform(final DesignTransformAccessor accessor) + { + this.accessor = accessor; + this.init(); + } + + private void init() + { + this.styles = new LinkedHashMap<>(); + this.designStyles = new HashMap<>(); + this.templateStyles = this.accessor.getTemplateTransform().getTemplateStyles(); + } + + private DRDesignStyle transformStyle(final DRIReportStyle style, final boolean textStyle) throws DRException + { + return this.transformStyle(style, textStyle, DefaultStyleType.NONE); + } + + /** + *transformStyle.
+ * + * @param style a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + * @param textStyle a boolean. + * @param defaultStyleType a {@link software.xdev.dynamicreports.design.constant.DefaultStyleType} object. + * @return a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignStyle transformStyle( + final DRIReportStyle style, + final boolean textStyle, + final DefaultStyleType defaultStyleType) throws DRException + { + if(style == null) + { + return this.getDefaultStyle(defaultStyleType); + } + final String styleName = style.hashCode() + "_" + textStyle; + if(this.designStyles.containsKey(styleName)) + { + return this.designStyles.get(styleName); + } + + final DRDesignStyle designStyle = this.style(this.getStyle(style), textStyle, defaultStyleType); + if(textStyle) + { + if(StyleResolver.getFontName(designStyle) == null) + { + designStyle.getFont().setFontName(this.accessor.getTemplateTransform().getDefaultFontName()); + } + if(StyleResolver.getFontSize(designStyle) == null) + { + designStyle.getFont().setFontSize(this.accessor.getTemplateTransform().getDefaultFontSize()); + } + if(StyleResolver.getFontBold(designStyle) == null) + { + designStyle.getFont().setBold(this.accessor.getTemplateTransform().getDefaultFontBold()); + } + if(StyleResolver.getFontItalic(designStyle) == null) + { + designStyle.getFont().setItalic(this.accessor.getTemplateTransform().getDefaultFontItalic()); + } + if(StyleResolver.getFontUnderline(designStyle) == null) + { + designStyle.getFont().setUnderline(this.accessor.getTemplateTransform().getDefaultFontUnderline()); + } + if(StyleResolver.getFontStrikeThrough(designStyle) == null) + { + designStyle.getFont() + .setStrikeThrough(this.accessor.getTemplateTransform().getDefaultFontStrikeThrough()); + } + if(StyleResolver.getPdfFontName(designStyle) == null) + { + designStyle.getFont().setPdfFontName(this.accessor.getTemplateTransform().getDefaultFontPdfFontName()); + } + if(StyleResolver.getPdfEncoding(designStyle) == null) + { + designStyle.getFont().setPdfEncoding(this.accessor.getTemplateTransform().getDefaultFontPdfEncoding()); + } + if(StyleResolver.getPdfEmbedded(designStyle) == null) + { + designStyle.getFont().setPdfEmbedded(this.accessor.getTemplateTransform().getDefaultFontPdfEmbedded()); + } + } + this.addStyle(styleName, designStyle); + return designStyle; + } + + /** + *transformFont.
+ * + * @param font a {@link software.xdev.dynamicreports.report.definition.style.DRIFont} object. + * @return a {@link software.xdev.dynamicreports.design.base.style.DRDesignFont} object. + */ + protected DRDesignFont transformFont(final DRIFont font) + { + if(font == null) + { + return null; + } + + final DRDesignFont designFont = new DRDesignFont(); + designFont.setFontName(font.getFontName()); + designFont.setFontSize(font.getFontSize()); + designFont.setBold(font.getBold()); + designFont.setItalic(font.getItalic()); + designFont.setUnderline(font.getUnderline()); + designFont.setStrikeThrough(font.getStrikeThrough()); + designFont.setPdfFontName(font.getPdfFontName()); + designFont.setPdfEncoding(font.getPdfEncoding()); + designFont.setPdfEmbedded(font.getPdfEmbedded()); + return designFont; + } + + private DRDesignStyle style(final DRIStyle style, final boolean textStyle, final DefaultStyleType defaultStyleType) + throws DRException + { + final DRDesignStyle designStyle; + if(StringUtils.isBlank(style.getName())) + { + designStyle = new DRDesignStyle(); + } + else + { + designStyle = new DRDesignStyle(style.getName()); + } + this.baseStyle(designStyle, style); + if(style.getParentStyle() != null) + { + designStyle.setParentStyle(this.transformStyle(style.getParentStyle(), textStyle, defaultStyleType)); + } + for(final DRIConditionalStyle conditionalStyle : style.getConditionalStyles()) + { + designStyle.addConditionalStyle(this.conditionalStyle(conditionalStyle)); + } + return designStyle; + } + + /** + *getStyle.
+ * + * @param reportStyle a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIStyle} object. + */ + protected DRIStyle getStyle(final DRIReportStyle reportStyle) + { + if(reportStyle == null) + { + return null; + } + if(reportStyle instanceof DRIStyle) + { + return (DRIStyle)reportStyle; + } + if(reportStyle instanceof DRITemplateStyle) + { + final String name = ((DRITemplateStyle)reportStyle).getName(); + final DRIStyle style = this.templateStyles.get(name); + if(style == null) + { + throw new DRDesignReportException("Template style " + name + " not found"); + } + return style; + } + throw new DRDesignReportException("Style " + reportStyle.getClass().getName() + " not supported"); + } + + /** + *transformTemplateStyles.
+ * + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public void transformTemplateStyles() throws DRException + { + for(final DRIStyle style : this.templateStyles.values()) + { + if(this.styles.containsKey(style.getName())) + { + continue; + } + this.transformStyle(style, false); + } + } + + private DRDesignConditionalStyle conditionalStyle(final DRIConditionalStyle conditionalStyle) throws DRException + { + final DRDesignConditionalStyle designConditionalStyle = new DRDesignConditionalStyle(); + this.baseStyle(designConditionalStyle, conditionalStyle); + designConditionalStyle.setConditionExpression(this.accessor.getExpressionTransform() + .transformExpression(conditionalStyle.getConditionExpression())); + designConditionalStyle.setDataset(this.accessor.getExpressionTransform().getDataset()); + return designConditionalStyle; + } + + private void baseStyle(final DRDesignBaseStyle designBaseStyle, final DRIBaseStyle baseStyle) throws DRException + { + designBaseStyle.setForegroundColor(baseStyle.getForegroundColor()); + designBaseStyle.setBackgroundColor(baseStyle.getBackgroundColor()); + designBaseStyle.setRadius(baseStyle.getRadius()); + designBaseStyle.setImageScale(baseStyle.getImageScale()); + designBaseStyle.setHorizontalImageAlignment(baseStyle.getHorizontalImageAlignment()); + designBaseStyle.setVerticalImageAlignment(baseStyle.getVerticalImageAlignment()); + designBaseStyle.setHorizontalTextAlignment(baseStyle.getHorizontalTextAlignment()); + designBaseStyle.setVerticalTextAlignment(baseStyle.getVerticalTextAlignment()); + designBaseStyle.setBorder(this.border(baseStyle.getBorder())); + designBaseStyle.setPadding(this.padding(baseStyle.getPadding())); + designBaseStyle.setFont(this.transformFont(baseStyle.getFont())); + designBaseStyle.setRotation(baseStyle.getRotation()); + designBaseStyle.setPattern(baseStyle.getPattern()); + designBaseStyle.setMarkup(baseStyle.getMarkup()); + designBaseStyle.setParagraph(this.paragraph(baseStyle.getParagraph())); + designBaseStyle.setLinePen(this.pen(baseStyle.getLinePen())); + } + + private DRDesignParagraph paragraph(final DRIParagraph paragraph) + { + final DRDesignParagraph designParagraph = new DRDesignParagraph(); + designParagraph.setLineSpacing(paragraph.getLineSpacing()); + designParagraph.setLineSpacingSize(paragraph.getLineSpacingSize()); + designParagraph.setFirstLineIndent(paragraph.getFirstLineIndent()); + designParagraph.setLeftIndent(paragraph.getLeftIndent()); + designParagraph.setRightIndent(paragraph.getRightIndent()); + designParagraph.setSpacingBefore(paragraph.getSpacingBefore()); + designParagraph.setSpacingAfter(paragraph.getSpacingAfter()); + designParagraph.setTabStopWidth(paragraph.getTabStopWidth()); + final Listpen.
+ * + * @param pen a {@link software.xdev.dynamicreports.report.definition.style.DRIPen} object. + * @return a {@link software.xdev.dynamicreports.design.base.style.DRDesignPen} object. + */ + protected DRDesignPen pen(final DRIPen pen) + { + if(pen == null) + { + return null; + } + final DRDesignPen designPen = new DRDesignPen(); + designPen.setLineWidth(pen.getLineWidth()); + designPen.setLineStyle(pen.getLineStyle()); + designPen.setLineColor(pen.getLineColor()); + return designPen; + } + + /** + *getDefaultStyle.
+ * + * @param defaultStyleType a {@link software.xdev.dynamicreports.design.constant.DefaultStyleType} object. + * @return a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignStyle getDefaultStyle(final DefaultStyleType defaultStyleType) throws DRException + { + final TemplateTransform templateTransform = this.accessor.getTemplateTransform(); + switch(defaultStyleType) + { + case NONE: + return null; + case TEXT: + return this.transformStyle(templateTransform.getTextStyle(), true); + case COLUMN: + return this.transformStyle(templateTransform.getColumnStyle(true), true); + case COLUMN_TITLE: + return this.transformStyle(templateTransform.getColumnTitleStyle(), true); + case GROUP: + return this.transformStyle(templateTransform.getGroupStyle(), true); + case GROUP_TITLE: + return this.transformStyle(templateTransform.getGroupTitleStyle(), true); + case SUBTOTAL: + return this.transformStyle(templateTransform.getSubtotalStyle(), true); + case IMAGE: + return this.transformStyle(templateTransform.getImageStyle(), false); + default: + throw new DRDesignReportException("Default style type " + defaultStyleType.name() + " not supported"); + } + } + + private void addStyle(final String styleName, final DRDesignStyle designStyle) + { + if(designStyle == null) + { + return; + } + if(this.styles.containsKey(designStyle.getName())) + { + if(!this.styles.get(designStyle.getName()).equals(designStyle)) + { + throw new DRDesignReportException("Duplicate declaration of style \"" + designStyle.getName() + "\""); + } + return; + } + this.styles.put(designStyle.getName(), designStyle); + this.designStyles.put(styleName, designStyle); + } + + /** + *copyStyle.
+ * + * @param toStyle a {@link software.xdev.dynamicreports.report.base.style.DRBaseStyle} object. + * @param fromStyle a {@link software.xdev.dynamicreports.report.definition.style.DRIBaseStyle} object. + */ + public void copyStyle(final DRBaseStyle toStyle, final DRIBaseStyle fromStyle) + { + toStyle.setForegroundColor(fromStyle.getForegroundColor()); + toStyle.setBackgroundColor(fromStyle.getBackgroundColor()); + toStyle.setRadius(fromStyle.getRadius()); + toStyle.setImageScale(fromStyle.getImageScale()); + toStyle.setHorizontalImageAlignment(fromStyle.getHorizontalImageAlignment()); + toStyle.setVerticalImageAlignment(fromStyle.getVerticalImageAlignment()); + toStyle.setHorizontalTextAlignment(fromStyle.getHorizontalTextAlignment()); + toStyle.setVerticalTextAlignment(fromStyle.getVerticalTextAlignment()); + toStyle.setBorder((DRBorder)fromStyle.getBorder()); + toStyle.setPadding((DRPadding)fromStyle.getPadding()); + toStyle.setFont((DRFont)fromStyle.getFont()); + toStyle.setRotation(fromStyle.getRotation()); + toStyle.setPattern(fromStyle.getPattern()); + toStyle.setMarkup(fromStyle.getMarkup()); + toStyle.setParagraph((DRParagraph)fromStyle.getParagraph()); + toStyle.setLinePen((DRPen)fromStyle.getLinePen()); + } + + /** + *Getter for the field styles
.
SubtotalTransform class.
+ * + * @author Ricardo Mariaca + * + */ +public class SubtotalTransform { + private DesignTransformAccessor accessor; + + /** + *Constructor for SubtotalTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public SubtotalTransform(DesignTransformAccessor accessor) { + this.accessor = accessor; + } + + // subtotals + + /** + *transform.
+ * + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public void transform() throws DRException { + ColumnGrid title = accessor.getColumnGridTransform().createColumnGrid(); + ColumnGrid pageHeader = accessor.getColumnGridTransform().createColumnGrid(); + ColumnGrid pageFooter = accessor.getColumnGridTransform().createColumnGrid(); + ColumnGrid columnHeader = accessor.getColumnGridTransform().createColumnGrid(); + ColumnGrid columnFooter = accessor.getColumnGridTransform().createColumnGrid(); + MapTableOfContentsTransform class.
+ * + * @author Ricardo Mariaca + * + */ +public class TableOfContentsTransform { + private DesignTransformAccessor accessor; + private MapConstructor for TableOfContentsTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public TableOfContentsTransform(DesignTransformAccessor accessor) { + this.accessor = accessor; + this.levels = new HashMapcomponentHeading.
+ * + * @param component a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + * @return a {@link software.xdev.dynamicreports.design.base.DRDesignTableOfContentsHeading} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignTableOfContentsHeading componentHeading(DRIComponent component) throws DRException { + DRITableOfContentsHeading tocHeading = component.getTableOfContentsHeading(); + boolean tableOfContents = accessor.isTableOfContents(); + if (tableOfContents && tocHeading != null) { + DRTextFieldgroupHeading.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @param level a int. + * @return a {@link software.xdev.dynamicreports.design.base.DRDesignTableOfContentsHeading} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRDesignTableOfContentsHeading groupHeading(DRIGroup group, int level) throws DRException { + boolean tableOfContents = accessor.isTableOfContents(); + boolean isAddGroupToTableOfContents = accessor.getTemplateTransform().isAddGroupToTableOfContents(group); + if (tableOfContents && isAddGroupToTableOfContents) { + DRTextFieldTemplateTransform class.
+ * + * @author Ricardo Mariaca, Jan Moxter + */ +public class TemplateTransform +{ + private final DRIReport report; + private final DesignTransformAccessor accessor; + private final DRIReportTemplate template; + private final DRITemplateDesign> templateDesign; + + /** + *Constructor for TemplateTransform.
+ * + * @param accessor a {@link software.xdev.dynamicreports.design.transformation.DesignTransformAccessor} object. + */ + public TemplateTransform(final DesignTransformAccessor accessor) + { + this.accessor = accessor; + this.report = accessor.getReport(); + this.template = this.report.getTemplate(); + this.templateDesign = this.report.getTemplateDesign(); + } + + /** + *getReportName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getReportName() + { + if(this.report.getReportName() != null) + { + return this.report.getReportName(); + } + if(this.templateDesign.getReportName() != null) + { + return this.templateDesign.getReportName(); + } + return Defaults.getDefaults().getReportName(); + } + + /** + *getLocale.
+ * + * @return a {@link java.util.Locale} object. + */ + public Locale getLocale() + { + if(this.report.getLocale() != null) + { + return this.report.getLocale(); + } + if(this.template.getLocale() != null) + { + return this.template.getLocale(); + } + return Defaults.getDefaults().getLocale(); + } + + /** + *isShowColumnTitle.
+ * + * @return a boolean. + */ + protected boolean isShowColumnTitle() + { + if(this.report.getShowColumnTitle() != null) + { + return this.report.getShowColumnTitle(); + } + if(this.template.getShowColumnTitle() != null) + { + return this.template.getShowColumnTitle(); + } + return Defaults.getDefaults().isShowColumnTitle(); + } + + /** + *isShowColumnValues.
+ * + * @return a boolean. + */ + protected boolean isShowColumnValues() + { + if(this.report.getShowColumnValues() != null) + { + return this.report.getShowColumnValues(); + } + if(this.template.getShowColumnValues() != null) + { + return this.template.getShowColumnValues(); + } + return Defaults.getDefaults().isShowColumnValues(); + } + + /** + *getResourceBundleName.
+ * + * @return a {@link java.lang.String} object. + */ + public String getResourceBundleName() + { + if(this.report.getResourceBundleName() != null) + { + return this.report.getResourceBundleName(); + } + if(this.templateDesign.getResourceBundleName() != null) + { + return this.templateDesign.getResourceBundleName(); + } + return null; + } + + /** + *isIgnorePagination.
+ * + * @return a boolean. + */ + public boolean isIgnorePagination() + { + if(this.report.getIgnorePagination() != null) + { + return this.report.getIgnorePagination(); + } + if(this.templateDesign.getIgnorePagination() != null) + { + return this.templateDesign.getIgnorePagination(); + } + if(this.template.getIgnorePagination() != null) + { + return this.template.getIgnorePagination(); + } + return Defaults.getDefaults().isIgnorePagination(); + } + + /** + *getWhenNoDataType.
+ * + * @param emptyDetail a boolean. + * @param noDataBand a {@link software.xdev.dynamicreports.design.definition.DRIDesignBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.WhenNoDataType} object. + */ + public WhenNoDataType getWhenNoDataType(final boolean emptyDetail, final DRIDesignBand noDataBand) + { + if(this.report.getWhenNoDataType() != null) + { + return this.report.getWhenNoDataType(); + } + if(this.templateDesign.getWhenNoDataType() != null) + { + return this.templateDesign.getWhenNoDataType(); + } + if(this.template.getWhenNoDataType() != null) + { + return this.template.getWhenNoDataType(); + } + if(noDataBand != null) + { + return WhenNoDataType.NO_DATA_SECTION; + } + if(emptyDetail) + { + return WhenNoDataType.ALL_SECTIONS_NO_DETAIL; + } + return Defaults.getDefaults().getWhenNoDataType(); + } + + /** + *getWhenResourceMissingType.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.WhenResourceMissingType} object. + */ + public WhenResourceMissingType getWhenResourceMissingType() + { + if(this.report.getWhenResourceMissingType() != null) + { + return this.report.getWhenResourceMissingType(); + } + if(this.templateDesign.getWhenResourceMissingType() != null) + { + return this.templateDesign.getWhenResourceMissingType(); + } + if(this.template.getWhenResourceMissingType() != null) + { + return this.template.getWhenResourceMissingType(); + } + return Defaults.getDefaults().getWhenResourceMissingType(); + } + + /** + *isTitleOnANewPage.
+ * + * @return a boolean. + */ + public boolean isTitleOnANewPage() + { + if(this.report.getTitleOnANewPage() != null) + { + return this.report.getTitleOnANewPage(); + } + if(this.templateDesign.getTitleOnANewPage() != null) + { + return this.templateDesign.getTitleOnANewPage(); + } + if(this.template.getTitleOnANewPage() != null) + { + return this.template.getTitleOnANewPage(); + } + return Defaults.getDefaults().isTitleOnANewPage(); + } + + /** + *isSummaryOnANewPage.
+ * + * @return a boolean. + */ + public boolean isSummaryOnANewPage() + { + if(this.report.getSummaryOnANewPage() != null) + { + return this.report.getSummaryOnANewPage(); + } + if(this.templateDesign.getSummaryOnANewPage() != null) + { + return this.templateDesign.getSummaryOnANewPage(); + } + if(this.template.getSummaryOnANewPage() != null) + { + return this.template.getSummaryOnANewPage(); + } + return Defaults.getDefaults().isSummaryOnANewPage(); + } + + /** + *isSummaryWithPageHeaderAndFooter.
+ * + * @return a boolean. + */ + public boolean isSummaryWithPageHeaderAndFooter() + { + if(this.report.getSummaryWithPageHeaderAndFooter() != null) + { + return this.report.getSummaryWithPageHeaderAndFooter(); + } + if(this.templateDesign.getSummaryWithPageHeaderAndFooter() != null) + { + return this.templateDesign.getSummaryWithPageHeaderAndFooter(); + } + if(this.template.getSummaryWithPageHeaderAndFooter() != null) + { + return this.template.getSummaryWithPageHeaderAndFooter(); + } + return Defaults.getDefaults().isSummaryWithPageHeaderAndFooter(); + } + + /** + *isFloatColumnFooter.
+ * + * @return a boolean. + */ + public boolean isFloatColumnFooter() + { + if(this.report.getFloatColumnFooter() != null) + { + return this.report.getFloatColumnFooter(); + } + if(this.templateDesign.getFloatColumnFooter() != null) + { + return this.templateDesign.getFloatColumnFooter(); + } + if(this.template.getFloatColumnFooter() != null) + { + return this.template.getFloatColumnFooter(); + } + return Defaults.getDefaults().isFloatColumnFooter(); + } + + /** + *getPrintOrder.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.Orientation} object. + */ + public Orientation getPrintOrder() + { + if(this.report.getPrintOrder() != null) + { + return this.report.getPrintOrder(); + } + if(this.template.getPrintOrder() != null) + { + return this.template.getPrintOrder(); + } + return Defaults.getDefaults().getPrintOrder(); + } + + /** + *getColumnDirection.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.RunDirection} object. + */ + public RunDirection getColumnDirection() + { + if(this.report.getColumnDirection() != null) + { + return this.report.getColumnDirection(); + } + if(this.template.getColumnDirection() != null) + { + return this.template.getColumnDirection(); + } + return Defaults.getDefaults().getColumnDirection(); + } + + /** + *getLanguage.
+ * + * @return a {@link java.lang.String} object. + */ + public String getLanguage() + { + if(this.report.getLanguage() != null) + { + return this.report.getLanguage(); + } + if(this.template.getLanguage() != null) + { + return this.template.getLanguage(); + } + return Defaults.getDefaults().getLanguage(); + } + + /** + *getFieldDescription.
+ * + * @param field a {@link software.xdev.dynamicreports.report.definition.DRIField} object. + * @return a {@link java.lang.String} object. + */ + public String getFieldDescription(final DRIField> field) + { + if(field.getDescription() != null) + { + return field.getDescription(); + } + if(this.isUseFieldNameAsDescription()) + { + return field.getName(); + } + return null; + } + + private boolean isUseFieldNameAsDescription() + { + if(this.report.getUseFieldNameAsDescription() != null) + { + return this.report.getUseFieldNameAsDescription(); + } + if(this.template.getUseFieldNameAsDescription() != null) + { + return this.template.getUseFieldNameAsDescription(); + } + return Defaults.getDefaults().isUseFieldNameAsDescription(); + } + + // table of contents + + /** + *isTableOfContents.
+ * + * @param tocHeadings a {@link java.util.Map} object. + * @return a boolean. + */ + public boolean isTableOfContents(final MapgetTableOfContentsCustomizer.
+ * + * @return a {@link software.xdev.dynamicreports.report.definition.DRITableOfContentsCustomizer} object. + */ + public DRITableOfContentsCustomizer getTableOfContentsCustomizer() + { + if(this.report.getTableOfContentsCustomizer() != null) + { + return this.report.getTableOfContentsCustomizer(); + } + if(this.template.getTableOfContentsCustomizer() != null) + { + return this.template.getTableOfContentsCustomizer(); + } + return Defaults.getDefaults().getTableOfContentsCustomizer(); + } + + /** + *isAddGroupToTableOfContents.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a boolean. + */ + public boolean isAddGroupToTableOfContents(final DRIGroup group) + { + if(group.getAddToTableOfContents() != null) + { + return group.getAddToTableOfContents(); + } + return Defaults.getDefaults().isAddGroupToTableOfContents(); + } + + // style + + /** + *getDetailOddRowStyle.
+ * + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRISimpleStyle} object. + */ + protected DRISimpleStyle getDetailOddRowStyle() + { + if(this.isHighlightDetailOddRows()) + { + if(this.report.getDetailOddRowStyle() != null) + { + return this.report.getDetailOddRowStyle(); + } + if(this.template.getDetailOddRowStyle() != null) + { + return this.template.getDetailOddRowStyle(); + } + return Defaults.getDefaults().getDetailOddRowStyle(); + } + return null; + } + + /** + *getDetailEvenRowStyle.
+ * + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRISimpleStyle} object. + */ + protected DRISimpleStyle getDetailEvenRowStyle() + { + if(this.isHighlightDetailEvenRows()) + { + if(this.report.getDetailEvenRowStyle() != null) + { + return this.report.getDetailEvenRowStyle(); + } + if(this.template.getDetailEvenRowStyle() != null) + { + return this.template.getDetailEvenRowStyle(); + } + return Defaults.getDefaults().getDetailEvenRowStyle(); + } + return null; + } + + private boolean isHighlightDetailOddRows() + { + if(this.report.getHighlightDetailOddRows() != null) + { + return this.report.getHighlightDetailOddRows(); + } + if(this.template.getHighlightDetailOddRows() != null) + { + return this.template.getHighlightDetailOddRows(); + } + return Defaults.getDefaults().isHighlightDetailOddRows(); + } + + private boolean isHighlightDetailEvenRows() + { + if(this.report.getHighlightDetailEvenRows() != null) + { + return this.report.getHighlightDetailEvenRows(); + } + if(this.template.getHighlightDetailEvenRows() != null) + { + return this.template.getHighlightDetailEvenRows(); + } + return Defaults.getDefaults().isHighlightDetailEvenRows(); + } + + /** + *getDefaultFontName.
+ * + * @return a {@link java.lang.String} object. + */ + protected String getDefaultFontName() + { + if(this.report.getDefaultFont() != null && this.report.getDefaultFont().getFontName() != null) + { + return this.report.getDefaultFont().getFontName(); + } + if(this.template.getDefaultFont() != null && this.template.getDefaultFont().getFontName() != null) + { + return this.template.getDefaultFont().getFontName(); + } + return Defaults.getDefaults().getFont().getFontName(); + } + + /** + *getDefaultFontSize.
+ * + * @return a {@link java.lang.Integer} object. + */ + protected Integer getDefaultFontSize() + { + if(this.report.getDefaultFont() != null && this.report.getDefaultFont().getFontSize() != null) + { + return this.report.getDefaultFont().getFontSize(); + } + if(this.template.getDefaultFont() != null && this.template.getDefaultFont().getFontSize() != null) + { + return this.template.getDefaultFont().getFontSize(); + } + return Defaults.getDefaults().getFont().getFontSize(); + } + + /** + *getDefaultFontBold.
+ * + * @return a {@link java.lang.Boolean} object. + */ + protected Boolean getDefaultFontBold() + { + if(this.report.getDefaultFont() != null && this.report.getDefaultFont().getBold() != null) + { + return this.report.getDefaultFont().getBold(); + } + if(this.template.getDefaultFont() != null && this.template.getDefaultFont().getBold() != null) + { + return this.template.getDefaultFont().getBold(); + } + return Defaults.getDefaults().getFont().getBold(); + } + + /** + *getDefaultFontItalic.
+ * + * @return a {@link java.lang.Boolean} object. + */ + protected Boolean getDefaultFontItalic() + { + if(this.report.getDefaultFont() != null && this.report.getDefaultFont().getItalic() != null) + { + return this.report.getDefaultFont().getItalic(); + } + if(this.template.getDefaultFont() != null && this.template.getDefaultFont().getItalic() != null) + { + return this.template.getDefaultFont().getItalic(); + } + return Defaults.getDefaults().getFont().getItalic(); + } + + /** + *getDefaultFontUnderline.
+ * + * @return a {@link java.lang.Boolean} object. + */ + protected Boolean getDefaultFontUnderline() + { + if(this.report.getDefaultFont() != null && this.report.getDefaultFont().getUnderline() != null) + { + return this.report.getDefaultFont().getUnderline(); + } + if(this.template.getDefaultFont() != null && this.template.getDefaultFont().getUnderline() != null) + { + return this.template.getDefaultFont().getUnderline(); + } + return Defaults.getDefaults().getFont().getUnderline(); + } + + /** + *getDefaultFontStrikeThrough.
+ * + * @return a {@link java.lang.Boolean} object. + */ + protected Boolean getDefaultFontStrikeThrough() + { + if(this.report.getDefaultFont() != null && this.report.getDefaultFont().getStrikeThrough() != null) + { + return this.report.getDefaultFont().getStrikeThrough(); + } + if(this.template.getDefaultFont() != null && this.template.getDefaultFont().getStrikeThrough() != null) + { + return this.template.getDefaultFont().getStrikeThrough(); + } + return Defaults.getDefaults().getFont().getStrikeThrough(); + } + + /** + *getDefaultFontPdfFontName.
+ * + * @return a {@link java.lang.String} object. + */ + protected String getDefaultFontPdfFontName() + { + if(this.report.getDefaultFont() != null && this.report.getDefaultFont().getPdfFontName() != null) + { + return this.report.getDefaultFont().getPdfFontName(); + } + if(this.template.getDefaultFont() != null && this.template.getDefaultFont().getPdfFontName() != null) + { + return this.template.getDefaultFont().getPdfFontName(); + } + return Defaults.getDefaults().getFont().getPdfFontName(); + } + + /** + *getDefaultFontPdfEncoding.
+ * + * @return a {@link java.lang.String} object. + */ + protected String getDefaultFontPdfEncoding() + { + if(this.report.getDefaultFont() != null && this.report.getDefaultFont().getPdfEncoding() != null) + { + return this.report.getDefaultFont().getPdfEncoding(); + } + if(this.template.getDefaultFont() != null && this.template.getDefaultFont().getPdfEncoding() != null) + { + return this.template.getDefaultFont().getPdfEncoding(); + } + return Defaults.getDefaults().getFont().getPdfEncoding(); + } + + /** + *getDefaultFontPdfEmbedded.
+ * + * @return a {@link java.lang.Boolean} object. + */ + protected Boolean getDefaultFontPdfEmbedded() + { + if(this.report.getDefaultFont() != null && this.report.getDefaultFont().getPdfEmbedded() != null) + { + return this.report.getDefaultFont().getPdfEmbedded(); + } + if(this.template.getDefaultFont() != null && this.template.getDefaultFont().getPdfEmbedded() != null) + { + return this.template.getDefaultFont().getPdfEmbedded(); + } + return Defaults.getDefaults().getFont().getPdfEmbedded(); + } + + /** + *getTextStyle.
+ * + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getTextStyle() + { + if(this.report.getTextStyle() != null) + { + return this.report.getTextStyle(); + } + if(this.template.getTextStyle() != null) + { + return this.template.getTextStyle(); + } + return Defaults.getDefaults().getTextStyle(); + } + + /** + *getColumnTitleStyle.
+ * + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getColumnTitleStyle() + { + if(this.report.getColumnTitleStyle() != null) + { + return this.report.getColumnTitleStyle(); + } + if(this.template.getColumnTitleStyle() != null) + { + return this.template.getColumnTitleStyle(); + } + if(Defaults.getDefaults().getColumnTitleStyle() != null) + { + return Defaults.getDefaults().getColumnTitleStyle(); + } + return this.getTextStyle(); + } + + /** + *getColumnStyle.
+ * + * @param textStyle a boolean. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getColumnStyle(final boolean textStyle) + { + if(this.report.getColumnStyle() != null) + { + return this.report.getColumnStyle(); + } + if(this.template.getColumnStyle() != null) + { + return this.template.getColumnStyle(); + } + if(Defaults.getDefaults().getColumnStyle() != null) + { + return Defaults.getDefaults().getColumnStyle(); + } + if(textStyle) + { + return this.getTextStyle(); + } + return null; + } + + /** + *getGroupTitleStyle.
+ * + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getGroupTitleStyle() + { + if(this.report.getGroupTitleStyle() != null) + { + return this.report.getGroupTitleStyle(); + } + if(this.template.getGroupTitleStyle() != null) + { + return this.template.getGroupTitleStyle(); + } + if(Defaults.getDefaults().getGroupTitleStyle() != null) + { + return Defaults.getDefaults().getGroupTitleStyle(); + } + return this.getTextStyle(); + } + + /** + *getGroupStyle.
+ * + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getGroupStyle() + { + if(this.report.getGroupStyle() != null) + { + return this.report.getGroupStyle(); + } + if(this.template.getGroupStyle() != null) + { + return this.template.getGroupStyle(); + } + if(Defaults.getDefaults().getGroupStyle() != null) + { + return Defaults.getDefaults().getGroupStyle(); + } + return this.getTextStyle(); + } + + /** + *getSubtotalStyle.
+ * + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getSubtotalStyle() + { + if(this.report.getSubtotalStyle() != null) + { + return this.report.getSubtotalStyle(); + } + if(this.template.getSubtotalStyle() != null) + { + return this.template.getSubtotalStyle(); + } + if(Defaults.getDefaults().getSubtotalStyle() != null) + { + return Defaults.getDefaults().getSubtotalStyle(); + } + return this.getTextStyle(); + } + + /** + *getImageStyle.
+ * + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getImageStyle() + { + if(this.report.getImageStyle() != null) + { + return this.report.getImageStyle(); + } + if(this.template.getImageStyle() != null) + { + return this.template.getImageStyle(); + } + return Defaults.getDefaults().getImageStyle(); + } + + // page + + /** + *getPageWidth.
+ * + * @return a int. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected int getPageWidth() throws DRException + { + if(this.isIgnorePageWidth()) + { + return this.getDynamicPageWidth(); + } + else + { + return this.getStaticPageWidth(); + } + } + + private boolean isIgnorePageWidth() + { + if(this.report.getPage().getIgnorePageWidth() != null) + { + return this.report.getPage().getIgnorePageWidth(); + } + if(this.template.getIgnorePageWidth() != null) + { + return this.template.getIgnorePageWidth(); + } + return Defaults.getDefaults().isIgnorePageWidth(); + } + + private int getDynamicPageWidth() throws DRException + { + int maxPageWidth = 0; + maxPageWidth = this.getMaxBandWidth(this.accessor.getBandTransform().getTitleBand(), maxPageWidth); + maxPageWidth = this.getMaxBandWidth(this.accessor.getBandTransform().getPageHeaderBand(), maxPageWidth); + maxPageWidth = this.getMaxBandWidth(this.accessor.getBandTransform().getPageFooterBand(), maxPageWidth); + maxPageWidth = this.getMaxBandWidth(this.accessor.getBandTransform().getColumnHeaderBand(), maxPageWidth); + maxPageWidth = this.getMaxBandWidth(this.accessor.getBandTransform().getColumnFooterBand(), maxPageWidth); + maxPageWidth = this.getMaxBandWidth(this.accessor.getBandTransform().getDetailBand(), maxPageWidth); + maxPageWidth = this.getMaxBandWidth(this.accessor.getBandTransform().getLastPageFooterBand(), maxPageWidth); + maxPageWidth = this.getMaxBandWidth(this.accessor.getBandTransform().getSummaryBand(), maxPageWidth); + + return maxPageWidth + this.getPageMargin().getLeft() + this.getPageMargin().getRight(); + } + + private int getMaxBandWidth(final DRIDesignBand band, final int maxWidth) throws DRException + { + if(band == null || band.getList() == null) + { + return maxWidth; + } + + final int bandWidth = this.detectWidth(band.getList()); + if(bandWidth > maxWidth) + { + return bandWidth; + } + return maxWidth; + } + + private int getStaticPageWidth() throws DRException + { + if(this.accessor.getPageWidth() != null) + { + return this.accessor.getPageWidth(); + } + if(this.report.getPage().getWidth() != null) + { + return this.report.getPage().getWidth(); + } + if(this.templateDesign.getPageWidth() != null) + { + return this.templateDesign.getPageWidth(); + } + if(this.template.getPageWidth() != null) + { + return this.template.getPageWidth(); + } + return Defaults.getDefaults().getPageWidth(); + } + + /** + *getPageHeight.
+ * + * @return a int. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected int getPageHeight() throws DRException + { + if(this.report.getPage().getHeight() != null) + { + return this.report.getPage().getHeight(); + } + if(this.templateDesign.getPageHeight() != null) + { + return this.templateDesign.getPageHeight(); + } + if(this.template.getPageHeight() != null) + { + return this.template.getPageHeight(); + } + return Defaults.getDefaults().getPageHeight(); + } + + /** + *getPageOrientation.
+ * + * @return a {@link software.xdev.dynamicreports.report.constant.PageOrientation} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected PageOrientation getPageOrientation() throws DRException + { + if(this.report.getPage().getOrientation() != null) + { + return this.report.getPage().getOrientation(); + } + if(this.templateDesign.getPageOrientation() != null) + { + return this.templateDesign.getPageOrientation(); + } + if(this.template.getPageOrientation() != null) + { + return this.template.getPageOrientation(); + } + return Defaults.getDefaults().getPageOrientation(); + } + + /** + *getPageMargin.
+ * + * @return a {@link software.xdev.dynamicreports.report.definition.DRIMargin} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected DRIMargin getPageMargin() throws DRException + { + if(this.report.getPage().getMargin() != null) + { + return this.report.getPage().getMargin(); + } + if(this.templateDesign.getPageMargin() != null) + { + return this.templateDesign.getPageMargin(); + } + if(this.accessor.getPageWidth() != null) + { + return Defaults.getDefaults().getSubreportPageMargin(); + } + if(this.template.getPageMargin() != null) + { + return this.template.getPageMargin(); + } + return Defaults.getDefaults().getPageMargin(); + } + + /** + *getPageColumnsPerPage.
+ * + * @return a int. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected int getPageColumnsPerPage() throws DRException + { + if(this.report.getPage().getColumnsPerPage() != null) + { + return this.report.getPage().getColumnsPerPage(); + } + if(this.templateDesign.getPageColumnsPerPage() != null) + { + return this.templateDesign.getPageColumnsPerPage(); + } + if(this.template.getPageColumnsPerPage() != null) + { + return this.template.getPageColumnsPerPage(); + } + return Defaults.getDefaults().getPageColumnsPerPage(); + } + + /** + *getPageColumnSpace.
+ * + * @return a int. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected int getPageColumnSpace() throws DRException + { + if(this.report.getPage().getColumnSpace() != null) + { + return this.report.getPage().getColumnSpace(); + } + if(this.templateDesign.getPageColumnSpace() != null) + { + return this.templateDesign.getPageColumnSpace(); + } + if(this.template.getPageColumnSpace() != null) + { + return this.template.getPageColumnSpace(); + } + return Defaults.getDefaults().getPageColumnSpace(); + } + + /** + *getPageColumnWidth.
+ * + * @param page a {@link software.xdev.dynamicreports.design.definition.DRIDesignPage} object. + * @return a int. + */ + protected int getPageColumnWidth(final DRIDesignPage page) + { + int columnWidth = page.getWidth() - page.getMargin().getLeft() - page.getMargin().getRight(); + columnWidth -= page.getColumnSpace() * (page.getColumnsPerPage() - 1); + columnWidth = columnWidth / page.getColumnsPerPage(); + if(this.templateDesign.getPageColumnWidth() != null && this.templateDesign.getPageColumnWidth() > 0 + && this.templateDesign.getPageColumnWidth() < columnWidth && !this.isIgnorePageWidth()) + { + return this.templateDesign.getPageColumnWidth(); + } + return columnWidth; + } + + // column + + /** + *isColumnPrintRepeatedDetailValues.
+ * + * @param column a {@link software.xdev.dynamicreports.report.definition.column.DRIValueColumn} object. + * @return a boolean. + */ + protected boolean isColumnPrintRepeatedDetailValues(final DRIValueColumn> column) + { + if(column.getPrintRepeatedDetailValues() != null) + { + return column.getPrintRepeatedDetailValues(); + } + if(this.template.getColumnPrintRepeatedDetailValues() != null) + { + return this.template.getColumnPrintRepeatedDetailValues(); + } + return Defaults.getDefaults().isColumnPrintRepeatedDetailValues(); + } + + /** + *getColumnWidth.
+ * + * @param column a {@link software.xdev.dynamicreports.report.definition.column.DRIColumn} object. + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a int. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + protected int getColumnWidth(final DRIColumn> column, final DRDesignStyle style) throws DRException + { + final DRIComponent component = this.accessor.getColumnTransform().getColumnComponent(column); + if(component != null) + { + if(component instanceof DRIList) + { + final DRDesignList list = + this.accessor.getComponentTransform().list((DRIList)component, DefaultStyleType.COLUMN, null, null); + return this.detectWidth(list); + } + else if(component instanceof DRIDimensionComponent) + { + if(((DRIDimensionComponent)component).getWidth() != null) + { + return ((DRIDimensionComponent)component).getWidth(); + } + if(component instanceof DRITextField>) + { + if(((DRITextField>)component).getColumns() != null) + { + return StyleResolver.getFontWidth(style, ((DRITextField>)component).getColumns()); + } + } + } + else + { + throw new DRDesignReportException("Component " + component.getClass().getName() + " not supported"); + } + } + return this.getColumnWidth(); + } + + /** + *getColumnWidth.
+ * + * @return a int. + */ + protected int getColumnWidth() + { + if(this.template.getColumnWidth() != null) + { + return this.template.getColumnWidth(); + } + return Defaults.getDefaults().getColumnWidth(); + } + + // component + + /** + *getRemoveLineWhenBlank.
+ * + * @param component a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + * @return a boolean. + */ + protected boolean getRemoveLineWhenBlank(final DRIComponent component) + { + if(component.getRemoveLineWhenBlank() != null) + { + return component.getRemoveLineWhenBlank(); + } + return Defaults.getDefaults().isRemoveLineWhenBlank(); + } + + /** + *getPositionType.
+ * + * @param component a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + * @return a {@link software.xdev.dynamicreports.report.constant.ComponentPositionType} object. + */ + protected ComponentPositionType getPositionType(final DRIComponent component) + { + if(component instanceof DRIDimensionComponent && ((DRIDimensionComponent)component).getPositionType() != null) + { + return ((DRIDimensionComponent)component).getPositionType(); + } + return null; + } + + /** + *getStretchType.
+ * + * @param component a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + * @return a {@link software.xdev.dynamicreports.report.constant.StretchType} object. + */ + protected StretchType getStretchType(final DRIComponent component) + { + if(component instanceof DRIDimensionComponent && ((DRIDimensionComponent)component).getStretchType() != null) + { + return ((DRIDimensionComponent)component).getStretchType(); + } + return null; + } + + /** + *getPrintInFirstWholeBand.
+ * + * @param component a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + * @return a boolean. + */ + protected boolean getPrintInFirstWholeBand(final DRIComponent component) + { + if(component instanceof DRIDimensionComponent + && ((DRIDimensionComponent)component).getPrintInFirstWholeBand() != null) + { + return ((DRIDimensionComponent)component).getPrintInFirstWholeBand(); + } + return Defaults.getDefaults().isPrintInFirstWholeBand(); + } + + /** + *getPrintWhenDetailOverflows.
+ * + * @param component a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + * @return a boolean. + */ + protected boolean getPrintWhenDetailOverflows(final DRIComponent component) + { + if(component instanceof DRIDimensionComponent + && ((DRIDimensionComponent)component).getPrintWhenDetailOverflows() != null) + { + return ((DRIDimensionComponent)component).getPrintWhenDetailOverflows(); + } + return Defaults.getDefaults().isPrintWhenDetailOverflows(); + } + + /** + *getPrintWhenGroupChanges.
+ * + * @param component a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + * @return a {@link software.xdev.dynamicreports.design.definition.DRIDesignGroup} object. + */ + protected DRIDesignGroup getPrintWhenGroupChanges(final DRIComponent component) + { + if(component instanceof DRIDimensionComponent + && ((DRIDimensionComponent)component).getPrintWhenGroupChanges() != null) + { + return this.accessor.getGroupTransform().getGroup(((DRIDimensionComponent)component).getPrintWhenGroupChanges()); + } + return null; + } + + // group + + /** + *getGroupHeaderLayout.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a {@link software.xdev.dynamicreports.report.constant.GroupHeaderLayout} object. + */ + protected GroupHeaderLayout getGroupHeaderLayout(final DRIGroup group) + { + if(group.getHeaderLayout() != null) + { + return group.getHeaderLayout(); + } + if(this.template.getGroupHeaderLayout() != null) + { + return this.template.getGroupHeaderLayout(); + } + return Defaults.getDefaults().getGroupHeaderLayout(); + } + + /** + *isGroupHideColumn.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a boolean. + */ + protected boolean isGroupHideColumn(final DRIGroup group) + { + if(group.getHideColumn() != null) + { + return group.getHideColumn(); + } + if(this.template.getGroupHideColumn() != null) + { + return this.template.getGroupHideColumn(); + } + return Defaults.getDefaults().isGroupHideColumn(); + } + + /** + *isGroupShowColumnHeaderAndFooter.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a boolean. + */ + protected boolean isGroupShowColumnHeaderAndFooter(final DRIGroup group) + { + if(group.getShowColumnHeaderAndFooter() != null) + { + return group.getShowColumnHeaderAndFooter(); + } + if(this.template.getGroupShowColumnHeaderAndFooter() != null) + { + return this.template.getGroupShowColumnHeaderAndFooter(); + } + return Defaults.getDefaults().isGroupShowColumnHeaderAndFooter(); + } + + /** + *getGroupPadding.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a int. + */ + protected int getGroupPadding(final DRIGroup group) + { + if(group.getPadding() != null) + { + return group.getPadding(); + } + if(this.template.getGroupPadding() != null) + { + return this.template.getGroupPadding(); + } + return Defaults.getDefaults().getGroupPadding(); + } + + /** + *isGroupStartInNewPage.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a boolean. + */ + protected boolean isGroupStartInNewPage(final DRIGroup group) + { + if(group.getStartInNewPage() != null) + { + return group.getStartInNewPage(); + } + if(this.template.getGroupStartInNewPage() != null) + { + return this.template.getGroupStartInNewPage(); + } + return Defaults.getDefaults().isGroupStartInNewPage(); + } + + /** + *isGroupStartInNewColumn.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a boolean. + */ + protected boolean isGroupStartInNewColumn(final DRIGroup group) + { + if(group.getStartInNewColumn() != null) + { + return group.getStartInNewColumn(); + } + if(this.template.getGroupStartInNewColumn() != null) + { + return this.template.getGroupStartInNewColumn(); + } + return Defaults.getDefaults().isGroupStartInNewColumn(); + } + + /** + *isGroupReprintHeaderOnEachPage.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a boolean. + */ + protected boolean isGroupReprintHeaderOnEachPage(final DRIGroup group) + { + if(group.getReprintHeaderOnEachPage() != null) + { + return group.getReprintHeaderOnEachPage(); + } + if(this.template.getGroupReprintHeaderOnEachPage() != null) + { + return this.template.getGroupReprintHeaderOnEachPage(); + } + return Defaults.getDefaults().isGroupReprintHeaderOnEachPage(); + } + + /** + *isGroupResetPageNumber.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a boolean. + */ + protected boolean isGroupResetPageNumber(final DRIGroup group) + { + if(group.getResetPageNumber() != null) + { + return group.getResetPageNumber(); + } + if(this.template.getGroupResetPageNumber() != null) + { + return this.template.getGroupResetPageNumber(); + } + return Defaults.getDefaults().isGroupResetPageNumber(); + } + + /** + *getGroupMinHeightToStartNewPage.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a {@link java.lang.Integer} object. + */ + protected Integer getGroupMinHeightToStartNewPage(final DRIGroup group) + { + if(group.getMinHeightToStartNewPage() != null) + { + return group.getMinHeightToStartNewPage(); + } + return Defaults.getDefaults().getGroupMinHeightToStartNewPage(); + } + + /** + *getGroupFooterPosition.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a {@link software.xdev.dynamicreports.report.constant.GroupFooterPosition} object. + */ + protected GroupFooterPosition getGroupFooterPosition(final DRIGroup group) + { + if(group.getFooterPosition() != null) + { + return group.getFooterPosition(); + } + if(this.template.getGroupFooterPosition() != null) + { + return this.template.getGroupFooterPosition(); + } + return Defaults.getDefaults().getGroupFooterPosition(); + } + + /** + *isGroupKeepTogether.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a boolean. + */ + protected boolean isGroupKeepTogether(final DRIGroup group) + { + if(group.getKeepTogether() != null) + { + return group.getKeepTogether(); + } + if(this.template.getGroupKeepTogether() != null) + { + return this.template.getGroupKeepTogether(); + } + return Defaults.getDefaults().isGroupKeepTogether(); + } + + /** + *isGroupHeaderWithSubtotal.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a boolean. + */ + protected boolean isGroupHeaderWithSubtotal(final DRIGroup group) + { + if(group.getHeaderWithSubtotal() != null) + { + return group.getHeaderWithSubtotal(); + } + if(this.template.getGroupHeaderWithSubtotal() != null) + { + return this.template.getGroupHeaderWithSubtotal(); + } + return Defaults.getDefaults().isGroupHeaderWithSubtotal(); + } + + /** + *isGroupByDataType.
+ * + * @param group a {@link software.xdev.dynamicreports.report.definition.DRIGroup} object. + * @return a boolean. + */ + protected boolean isGroupByDataType(final DRIGroup group) + { + if(group.getGroupByDataType() != null) + { + return group.getGroupByDataType(); + } + return Defaults.getDefaults().isGroupByDataType(); + } + + // subtotal + + /** + *getSubtotalLabelPosition.
+ * + * @param subtotal a {@link software.xdev.dynamicreports.report.definition.DRISubtotal} object. + * @return a {@link software.xdev.dynamicreports.report.constant.Position} object. + */ + public Position getSubtotalLabelPosition(final DRISubtotal> subtotal) + { + if(subtotal.getLabelPosition() != null) + { + return subtotal.getLabelPosition(); + } + if(this.template.getSubtotalLabelPosition() != null) + { + return this.template.getSubtotalLabelPosition(); + } + return Defaults.getDefaults().getSubtotalLabelPosition(); + } + + // text field + + /** + *getTextFieldWidth.
+ * + * @param textField a {@link software.xdev.dynamicreports.report.definition.component.DRITextField} object. + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a int. + */ + protected int getTextFieldWidth(final DRITextField> textField, final DRDesignStyle style) + { + if(textField.getWidth() != null) + { + return textField.getWidth(); + } + if(textField.getColumns() != null) + { + return StyleResolver.getFontWidth(style, textField.getColumns()); + } + if(this.template.getTextFieldWidth() != null) + { + return this.template.getTextFieldWidth(); + } + return Defaults.getDefaults().getTextFieldWidth(); + } + + /** + *getTextFieldHeight.
+ * + * @param textField a {@link software.xdev.dynamicreports.report.definition.component.DRITextField} object. + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a int. + */ + protected int getTextFieldHeight(final DRITextField> textField, final DRDesignStyle style) + { + if(textField.getHeight() != null) + { + return textField.getHeight(); + } + if(textField.getRows() != null) + { + return StyleResolver.getFontHeight(style, textField.getRows()); + } + return StyleResolver.getFontHeight(style, 1); + } + + /** + *getTextFieldPattern.
+ * + * @param textField a {@link software.xdev.dynamicreports.report.definition.component.DRITextField} object. + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link java.lang.String} object. + */ + protected String getTextFieldPattern(final DRITextField> textField, final DRDesignStyle style) + { + if(textField.getPattern() != null) + { + return textField.getPattern(); + } + if(StyleResolver.getPattern(style) != null) + { + return null;// StyleResolver.getPattern(style); + } + if(textField.getDataType() != null) + { + return textField.getDataType().getPattern(); + } + return null; + } + + /** + *getTextFieldHorizontalTextAlignment.
+ * + * @param textField a {@link software.xdev.dynamicreports.report.definition.component.DRITextField} object. + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link software.xdev.dynamicreports.report.constant.HorizontalTextAlignment} object. + */ + protected HorizontalTextAlignment getTextFieldHorizontalTextAlignment( + final DRITextField> textField, + final DRDesignStyle style) + { + if(textField.getHorizontalTextAlignment() != null) + { + return textField.getHorizontalTextAlignment(); + } + if(StyleResolver.getHorizontalTextAlignment(style) != null) + { + return null;// StyleResolver.getHorizontalTextAlignment(style); + } + if(textField.getDataType() != null) + { + return textField.getDataType().getHorizontalTextAlignment(); + } + return null; + } + + /** + *getTextFieldValueFormatter.
+ * + * @param textField a {@link software.xdev.dynamicreports.report.definition.component.DRITextField} object. + * @return a {@link software.xdev.dynamicreports.report.definition.expression.DRIValueFormatter} object. + */ + protected DRIValueFormatter, ?> getTextFieldValueFormatter(final DRITextField> textField) + { + if(textField.getValueFormatter() != null) + { + return textField.getValueFormatter(); + } + if(textField.getDataType() != null) + { + return textField.getDataType().getValueFormatter(); + } + return null; + } + + /** + *getTextFieldStretchWithOverflow.
+ * + * @param textField a {@link software.xdev.dynamicreports.report.definition.component.DRITextField} object. + * @return a boolean. + * @deprecated replaced by {@link #getTextFieldTextAdjust(DRITextField)} + */ + @Deprecated + protected boolean getTextFieldStretchWithOverflow(final DRITextField> textField) + { + if(textField.getStretchWithOverflow() != null) + { + return textField.getStretchWithOverflow(); + } + return Defaults.getDefaults().isTextFieldStretchWithOverflow(); + } + + /** + *getTextFieldTextAdjust.
+ * + * @param textField a {@link software.xdev.dynamicreports.report.definition.component.DRITextField} object. + * @return a {@link software.xdev.dynamicreports.report.constant.TextAdjust} object. + */ + protected TextAdjust getTextFieldTextAdjust(final DRITextField> textField) + { + if(textField.getTextAdjust() != null) + { + return textField.getTextAdjust(); + } + return Defaults.getDefaults().getTextFieldTextAdjust(); + } + + /** + *isTextFieldPrintRepeatedValues.
+ * + * @param textField a {@link software.xdev.dynamicreports.report.definition.component.DRITextField} object. + * @return a boolean. + */ + protected boolean isTextFieldPrintRepeatedValues(final DRITextField> textField) + { + if(textField.getPrintRepeatedValues() != null) + { + return textField.getPrintRepeatedValues(); + } + return Defaults.getDefaults().isTextFieldPrintRepeatedValues(); + } + + // text field + + /** + *getBooleanFieldWidth.
+ * + * @param booleanField a {@link software.xdev.dynamicreports.report.definition.component.DRIBooleanField} object. + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a int. + */ + protected int getBooleanFieldWidth(final DRIBooleanField booleanField, final DRDesignStyle style) + { + if(booleanField.getWidth() != null) + { + return booleanField.getWidth(); + } + if(this.template.getTextFieldWidth() != null) + { + return this.template.getTextFieldWidth(); + } + return Defaults.getDefaults().getTextFieldWidth(); + } + + /** + *getBooleanFieldHeight.
+ * + * @param booleanField a {@link software.xdev.dynamicreports.report.definition.component.DRIBooleanField} object. + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a int. + */ + protected int getBooleanFieldHeight(final DRIBooleanField booleanField, final DRDesignStyle style) + { + if(booleanField.getHeight() != null) + { + return booleanField.getHeight(); + } + return StyleResolver.getFontHeight(style, 1); + } + + // page x of y + + /** + *getPageXofYWidth.
+ * + * @param pageXofY a {@link software.xdev.dynamicreports.report.definition.component.DRIPageXofY} object. + * @return a int. + */ + protected int getPageXofYWidth(final DRIPageXofY pageXofY) + { + if(pageXofY.getWidth() != null) + { + return pageXofY.getWidth(); + } + if(this.template.getTextFieldWidth() != null) + { + return this.template.getTextFieldWidth(); + } + return Defaults.getDefaults().getTextFieldWidth(); + } + + /** + *getPageXofYHeight.
+ * + * @param pageXofY a {@link software.xdev.dynamicreports.report.definition.component.DRIPageXofY} object. + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a int. + */ + protected int getPageXofYHeight(final DRIPageXofY pageXofY, final DRDesignStyle style) + { + if(pageXofY.getHeight() != null) + { + return pageXofY.getHeight(); + } + return StyleResolver.getFontHeight(style, 1); + } + + /** + *getPageXofYHorizontalTextAlignment.
+ * + * @param pageXofY a {@link software.xdev.dynamicreports.report.definition.component.DRIPageXofY} object. + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link software.xdev.dynamicreports.report.constant.HorizontalTextAlignment} object. + */ + protected HorizontalTextAlignment getPageXofYHorizontalTextAlignment( + final DRIPageXofY pageXofY, + final DRDesignStyle style) + { + if(pageXofY.getHorizontalTextAlignment() != null) + { + return pageXofY.getHorizontalTextAlignment(); + } + if(StyleResolver.getHorizontalTextAlignment(style) != null) + { + return StyleResolver.getHorizontalTextAlignment(style); + } + return Defaults.getDefaults().getPageXofYHorizontalTextAlignment(); + } + + // image + + /** + *getImageWidth.
+ * + * @param image a {@link software.xdev.dynamicreports.report.definition.component.DRIImage} object. + * @return a int. + */ + protected int getImageWidth(final DRIImage image) + { + if(image.getWidth() != null) + { + return image.getWidth(); + } + if(this.template.getImageWidth() != null) + { + return this.template.getImageWidth(); + } + return Defaults.getDefaults().getImageWidth(); + } + + /** + *getImageHeight.
+ * + * @param image a {@link software.xdev.dynamicreports.report.definition.component.DRIImage} object. + * @param imageHeight a {@link java.lang.Integer} object. + * @param imageHeight a {@link java.lang.Integer} object. + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a int. + */ + protected int getImageHeight(final DRIImage image, final Integer imageHeight, final DRDesignStyle style) + { + if(image.getHeight() != null) + { + return image.getHeight(); + } + if(imageHeight != null) + { + return imageHeight + StyleResolver.getVerticalPadding(style); + } + if(this.template.getImageHeight() != null) + { + return this.template.getImageHeight(); + } + return Defaults.getDefaults().getImageHeight(); + } + + // filler + + /** + *getFillerWidth.
+ * + * @param filler a {@link software.xdev.dynamicreports.report.definition.component.DRIFiller} object. + * @return a int. + */ + protected int getFillerWidth(final DRIFiller filler) + { + if(filler.getWidth() != null) + { + return filler.getWidth(); + } + return Defaults.getDefaults().getFillerWidth(); + } + + /** + *getFillerHeight.
+ * + * @param filler a {@link software.xdev.dynamicreports.report.definition.component.DRIFiller} object. + * @return a int. + */ + protected int getFillerHeight(final DRIFiller filler) + { + if(filler.getHeight() != null) + { + return filler.getHeight(); + } + return Defaults.getDefaults().getFillerHeight(); + } + + // line + + /** + *getLineWidth.
+ * + * @param line a {@link software.xdev.dynamicreports.report.definition.component.DRILine} object. + * @return a int. + */ + protected int getLineWidth(final DRILine line) + { + if(line.getWidth() != null) + { + return line.getWidth(); + } + return Defaults.getDefaults().getLineWidth(); + } + + /** + *getLineHeight.
+ * + * @param line a {@link software.xdev.dynamicreports.report.definition.component.DRILine} object. + * @return a int. + */ + protected int getLineHeight(final DRILine line) + { + if(line.getHeight() != null) + { + return line.getHeight(); + } + return Defaults.getDefaults().getLineHeight(); + } + + // ellipse + + /** + *getEllipseWidth.
+ * + * @param ellipse a {@link software.xdev.dynamicreports.report.definition.component.DRIEllipse} object. + * @return a int. + */ + protected int getEllipseWidth(final DRIEllipse ellipse) + { + if(ellipse.getWidth() != null) + { + return ellipse.getWidth(); + } + return Defaults.getDefaults().getEllipseWidth(); + } + + /** + *getEllipseHeight.
+ * + * @param ellipse a {@link software.xdev.dynamicreports.report.definition.component.DRIEllipse} object. + * @return a int. + */ + protected int getEllipseHeight(final DRIEllipse ellipse) + { + if(ellipse.getHeight() != null) + { + return ellipse.getHeight(); + } + return Defaults.getDefaults().getEllipseHeight(); + } + + // rectangle + + /** + *getRectangleRadius.
+ * + * @param rectangle a {@link software.xdev.dynamicreports.report.definition.component.DRIRectangle} object. + * @return a {@link java.lang.Integer} object. + */ + protected Integer getRectangleRadius(final DRIRectangle rectangle) + { + if(rectangle.getRadius() != null) + { + return rectangle.getRadius(); + } + return Defaults.getDefaults().getRectangleRadius(); + } + + /** + *getRectangleWidth.
+ * + * @param rectangle a {@link software.xdev.dynamicreports.report.definition.component.DRIRectangle} object. + * @return a int. + */ + protected int getRectangleWidth(final DRIRectangle rectangle) + { + if(rectangle.getWidth() != null) + { + return rectangle.getWidth(); + } + return Defaults.getDefaults().getRectangleWidth(); + } + + /** + *getRectangleHeight.
+ * + * @param rectangle a {@link software.xdev.dynamicreports.report.definition.component.DRIRectangle} object. + * @return a int. + */ + protected int getRectangleHeight(final DRIRectangle rectangle) + { + if(rectangle.getHeight() != null) + { + return rectangle.getHeight(); + } + return Defaults.getDefaults().getRectangleHeight(); + } + + // map + + /** + *getMapWidth.
+ * + * @param map a {@link software.xdev.dynamicreports.report.definition.component.DRIMap} object. + * @return a int. + */ + protected int getMapWidth(final DRIMap map) + { + if(map.getWidth() != null) + { + return map.getWidth(); + } + return Defaults.getDefaults().getMapWidth(); + } + + /** + *getMapHeight.
+ * + * @param map a {@link software.xdev.dynamicreports.report.definition.component.DRIMap} object. + * @return a int. + */ + protected int getMapHeight(final DRIMap map) + { + if(map.getHeight() != null) + { + return map.getHeight(); + } + return Defaults.getDefaults().getMapHeight(); + } + + // custom component + + /** + *getCustomComponentWidth.
+ * + * @param component a {@link software.xdev.dynamicreports.report.definition.component.DRIDimensionComponent} object. + * @return a int. + */ + protected int getCustomComponentWidth(final DRIDimensionComponent component) + { + if(component.getWidth() != null) + { + return component.getWidth(); + } + return Defaults.getDefaults().getCustomComponentWidth(); + } + + /** + *getCustomComponentHeight.
+ * + * @param component a {@link software.xdev.dynamicreports.report.definition.component.DRIDimensionComponent} object. + * @return a int. + */ + protected int getCustomComponentHeight(final DRIDimensionComponent component) + { + if(component.getHeight() != null) + { + return component.getHeight(); + } + return Defaults.getDefaults().getCustomComponentHeight(); + } + + // break + + /** + *getBreakWidth.
+ * + * @param breakComponent a {@link software.xdev.dynamicreports.report.definition.component.DRIBreak} object. + * @return a int. + */ + protected int getBreakWidth(final DRIBreak breakComponent) + { + return Defaults.getDefaults().getBreakWidth(); + } + + /** + *getBreakHeight.
+ * + * @param breakComponent a {@link software.xdev.dynamicreports.report.definition.component.DRIBreak} object. + * @return a int. + */ + protected int getBreakHeight(final DRIBreak breakComponent) + { + return Defaults.getDefaults().getBreakHeight(); + } + + // generic element + + /** + *getGenericElementWidth.
+ * + * @param genericElement a {@link software.xdev.dynamicreports.report.definition.component.DRIGenericElement} object. + * @return a {@link java.lang.Integer} object. + */ + protected Integer getGenericElementWidth(final DRIGenericElement genericElement) + { + if(genericElement.getWidth() != null) + { + return genericElement.getWidth(); + } + return Defaults.getDefaults().getGenericElementWidth(); + } + + /** + *getGenericElementHeight.
+ * + * @param genericElement a {@link software.xdev.dynamicreports.report.definition.component.DRIGenericElement} object. + * @return a {@link java.lang.Integer} object. + */ + protected Integer getGenericElementHeight(final DRIGenericElement genericElement) + { + if(genericElement.getHeight() != null) + { + return genericElement.getHeight(); + } + return Defaults.getDefaults().getGenericElementHeight(); + } + + // list + + /** + *getListWidth.
+ * + * @param list a {@link software.xdev.dynamicreports.report.definition.component.DRIList} object. + * @return a {@link java.lang.Integer} object. + */ + protected Integer getListWidth(final DRIList list) + { + if(list.getWidth() != null) + { + return list.getWidth(); + } + return Defaults.getDefaults().getListWidth(); + } + + /** + *getListHeight.
+ * + * @param list a {@link software.xdev.dynamicreports.report.definition.component.DRIList} object. + * @return a {@link java.lang.Integer} object. + */ + protected Integer getListHeight(final DRIList list) + { + if(list.getHeight() != null) + { + return list.getHeight(); + } + return Defaults.getDefaults().getListHeight(); + } + + /** + *getListGap.
+ * + * @param list a {@link software.xdev.dynamicreports.report.definition.component.DRIList} object. + * @return a int. + */ + protected int getListGap(final DRIList list) + { + if(list.getGap() != null) + { + return list.getGap(); + } + if(this.template.getListgap() != null) + { + return this.template.getListgap(); + } + return Defaults.getDefaults().getListgap(); + } + + // xy list + + /** + *getXyListWidth.
+ * + * @param xyList a {@link software.xdev.dynamicreports.report.definition.component.DRIXyList} object. + * @return a {@link java.lang.Integer} object. + */ + protected Integer getXyListWidth(final DRIXyList xyList) + { + if(xyList.getWidth() != null) + { + return xyList.getWidth(); + } + return Defaults.getDefaults().getListWidth(); + } + + /** + *getXyListHeight.
+ * + * @param xyList a {@link software.xdev.dynamicreports.report.definition.component.DRIXyList} object. + * @return a {@link java.lang.Integer} object. + */ + protected Integer getXyListHeight(final DRIXyList xyList) + { + if(xyList.getHeight() != null) + { + return xyList.getHeight(); + } + return Defaults.getDefaults().getListHeight(); + } + + // multi page list + + /** + *getMultiPageListWidth.
+ * + * @param multiPageList a {@link software.xdev.dynamicreports.report.definition.component.DRIMultiPageList} object. + * @return a int. + */ + protected int getMultiPageListWidth(final DRIMultiPageList multiPageList) + { + if(multiPageList.getWidth() != null) + { + return multiPageList.getWidth(); + } + if(this.template.getMultiPageListWidth() != null) + { + return this.template.getMultiPageListWidth(); + } + return Defaults.getDefaults().getMultiPageListWidth(); + } + + /** + *getMultiPageListHeight.
+ * + * @param multiPageList a {@link software.xdev.dynamicreports.report.definition.component.DRIMultiPageList} object. + * @return a int. + */ + protected int getMultiPageListHeight(final DRIMultiPageList multiPageList) + { + if(multiPageList.getHeight() != null) + { + return multiPageList.getHeight(); + } + if(this.template.getMultiPageListHeight() != null) + { + return this.template.getMultiPageListHeight(); + } + return Defaults.getDefaults().getMultiPageListHeight(); + } + + // subreport + + /** + *getSubreportWidth.
+ * + * @param subreport a {@link software.xdev.dynamicreports.report.definition.component.DRISubreport} object. + * @return a int. + */ + protected int getSubreportWidth(final DRISubreport subreport) + { + if(subreport.getWidth() != null) + { + return subreport.getWidth(); + } + if(this.template.getSubreportWidth() != null) + { + return this.template.getSubreportWidth(); + } + return Defaults.getDefaults().getSubreportWidth(); + } + + /** + *getSubreportHeight.
+ * + * @param subreport a {@link software.xdev.dynamicreports.report.definition.component.DRISubreport} object. + * @return a int. + */ + protected int getSubreportHeight(final DRISubreport subreport) + { + if(subreport.getHeight() != null) + { + return subreport.getHeight(); + } + if(this.template.getSubreportHeight() != null) + { + return this.template.getSubreportHeight(); + } + return Defaults.getDefaults().getSubreportHeight(); + } + + // crosstab + + /** + *getCrosstabWidth.
+ * + * @param crosstab a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstab} object. + * @return a int. + */ + protected int getCrosstabWidth(final DRICrosstab crosstab) + { + if(crosstab.getWidth() != null) + { + return crosstab.getWidth(); + } + if(this.template.getCrosstabWidth() != null) + { + return this.template.getCrosstabWidth(); + } + return Defaults.getDefaults().getCrosstabWidth(); + } + + /** + *getCrosstabHeight.
+ * + * @param crosstab a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstab} object. + * @param whenNoDataCell a {@link software.xdev.dynamicreports.design.base.crosstab.DRDesignCrosstabCellContent} object. + * @return a int. + */ + protected int getCrosstabHeight(final DRICrosstab crosstab, final DRDesignCrosstabCellContent whenNoDataCell) + { + final int height; + if(crosstab.getHeight() != null) + { + height = crosstab.getHeight(); + } + else if(this.template.getCrosstabHeight() != null) + { + height = this.template.getCrosstabHeight(); + } + else + { + height = Defaults.getDefaults().getCrosstabHeight(); + } + final int whenNoDataCellHeight = this.getCrosstabWhenNoDataCellHeight(whenNoDataCell); + if(height == 0 && whenNoDataCellHeight > 0) + { + return whenNoDataCellHeight; + } + return height; + } + + /** + *getCrosstabColumnGroupTotalPosition.
+ * + * @param columnGroup a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstabColumnGroup} object. + * @return a {@link software.xdev.dynamicreports.report.constant.CrosstabTotalPosition} object. + */ + public CrosstabTotalPosition getCrosstabColumnGroupTotalPosition(final DRICrosstabColumnGroup> columnGroup) + { + if(!this.isCrosstabColumnGroupShowTotal(columnGroup)) + { + return null; + } + if(columnGroup.getTotalPosition() != null) + { + return columnGroup.getTotalPosition(); + } + return Defaults.getDefaults().getCrosstabColumnGroupTotalPosition(); + } + + /** + *getCrosstabRowGroupTotalPosition.
+ * + * @param rowGroup a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstabRowGroup} object. + * @return a {@link software.xdev.dynamicreports.report.constant.CrosstabTotalPosition} object. + */ + public CrosstabTotalPosition getCrosstabRowGroupTotalPosition(final DRICrosstabRowGroup> rowGroup) + { + if(!this.isCrosstabRowGroupShowTotal(rowGroup)) + { + return null; + } + if(rowGroup.getTotalPosition() != null) + { + return rowGroup.getTotalPosition(); + } + return Defaults.getDefaults().getCrosstabRowGroupTotalPosition(); + } + + /** + *isCrosstabColumnGroupShowTotal.
+ * + * @param columnGroup a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstabColumnGroup} object. + * @return a boolean. + */ + public boolean isCrosstabColumnGroupShowTotal(final DRICrosstabColumnGroup> columnGroup) + { + if(columnGroup.getShowTotal() != null) + { + return columnGroup.getShowTotal(); + } + return Defaults.getDefaults().isCrosstabColumnGroupShowTotal(); + } + + /** + *isCrosstabRowGroupShowTotal.
+ * + * @param rowGroup a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstabRowGroup} object. + * @return a boolean. + */ + public boolean isCrosstabRowGroupShowTotal(final DRICrosstabRowGroup> rowGroup) + { + if(rowGroup.getShowTotal() != null) + { + return rowGroup.getShowTotal(); + } + return Defaults.getDefaults().isCrosstabRowGroupShowTotal(); + } + + /** + *getCrosstabColumnGroupHeaderHeight.
+ * + * @param columnGroup a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstabColumnGroup} object. + * @param designCrosstab a {@link software.xdev.dynamicreports.design.base.crosstab.DRDesignCrosstab} object. + * @param availableHeight a int. + * @return a int. + */ + public int getCrosstabColumnGroupHeaderHeight( + final DRICrosstabColumnGroup> columnGroup, + final DRDesignCrosstab designCrosstab, + final int availableHeight) + { + if(columnGroup.getHeaderHeight() != null) + { + return columnGroup.getHeaderHeight(); + } + int maxHeight = 0; + for(final DRDesignCrosstabColumnGroup designColumnGroup : designCrosstab.getColumnGroups()) + { + if(designColumnGroup.getName().equals(columnGroup.getName())) + { + int height = this.detectHeight(designColumnGroup.getHeader().getList()); + if(maxHeight < height) + { + maxHeight = height; + } + if(designColumnGroup.getTotalHeader() != null) + { + height = this.detectHeight(designColumnGroup.getTotalHeader().getList()); + if(maxHeight < height && height > availableHeight) + { + maxHeight = height; + } + } + break; + } + } + return maxHeight; + } + + /** + *getCrosstabColumnGroupTotalHeaderWidth.
+ * + * @param columnGroup a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstabColumnGroup} object. + * @param cellWidth a {@link java.lang.Integer} object. + * @param designCrosstab a {@link software.xdev.dynamicreports.design.base.crosstab.DRDesignCrosstab} object. + * @return a int. + */ + public int getCrosstabColumnGroupTotalHeaderWidth( + final DRICrosstabColumnGroup> columnGroup, + final Integer cellWidth, + final DRDesignCrosstab designCrosstab) + { + if(columnGroup.getTotalHeaderWidth() != null) + { + return columnGroup.getTotalHeaderWidth(); + } + if(cellWidth != null) + { + return cellWidth; + } + int maxWidth = 0; + for(final DRDesignCrosstabColumnGroup designColumnGroup : designCrosstab.getColumnGroups()) + { + if(designColumnGroup.getName().equals(columnGroup.getName())) + { + if(designColumnGroup.getTotalHeader() != null) + { + final int height = this.detectWidth(designColumnGroup.getTotalHeader().getList()); + if(maxWidth < height) + { + maxWidth = height; + } + } + break; + } + } + for(final DRDesignCrosstabCell designCell : designCrosstab.getCells()) + { + if(designCell.getColumnTotalGroup() == columnGroup.getName()) + { + final int height = this.detectWidth(designCell.getContent().getList()); + if(maxWidth < height) + { + maxWidth = height; + } + } + } + if(maxWidth > Defaults.getDefaults().getCrosstabColumnGroupTotalHeaderMaxWidth()) + { + return Defaults.getDefaults().getCrosstabColumnGroupTotalHeaderMaxWidth(); + } + return maxWidth; + } + + /** + *getCrosstabRowGroupHeaderWidth.
+ * + * @param rowGroup a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstabRowGroup} object. + * @param designCrosstab a {@link software.xdev.dynamicreports.design.base.crosstab.DRDesignCrosstab} object. + * @return a int. + */ + public int getCrosstabRowGroupHeaderWidth( + final DRICrosstabRowGroup> rowGroup, + final DRDesignCrosstab designCrosstab) + { + if(rowGroup.getHeaderWidth() != null) + { + return rowGroup.getHeaderWidth(); + } + int maxWidth = 0; + for(final DRDesignCrosstabRowGroup designRowGroup : designCrosstab.getRowGroups()) + { + if(designRowGroup.getName().equals(rowGroup.getName())) + { + int width = this.detectWidth(designRowGroup.getHeader().getList()); + if(maxWidth < width) + { + maxWidth = width; + } + if(designRowGroup.getTotalHeader() != null) + { + width = this.detectWidth(designRowGroup.getTotalHeader().getList()); + if(maxWidth < width) + { + maxWidth = width; + } + } + break; + } + } + if(maxWidth > Defaults.getDefaults().getCrosstabRowGroupHeaderMaxWidth()) + { + return Defaults.getDefaults().getCrosstabRowGroupHeaderMaxWidth(); + } + return maxWidth; + } + + /** + *getCrosstabRowGroupTotalHeaderHeight.
+ * + * @param rowGroup a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstabRowGroup} object. + * @param cellHeight a {@link java.lang.Integer} object. + * @param designCrosstab a {@link software.xdev.dynamicreports.design.base.crosstab.DRDesignCrosstab} object. + * @return a int. + */ + public int getCrosstabRowGroupTotalHeaderHeight( + final DRICrosstabRowGroup> rowGroup, + final Integer cellHeight, + final DRDesignCrosstab designCrosstab) + { + if(rowGroup.getTotalHeaderHeight() != null) + { + return rowGroup.getTotalHeaderHeight(); + } + if(cellHeight != null) + { + return cellHeight; + } + int maxHeight = 0; + for(final DRDesignCrosstabRowGroup designRowGroup : designCrosstab.getRowGroups()) + { + if(designRowGroup.getName().equals(rowGroup.getName())) + { + if(designRowGroup.getTotalHeader() != null) + { + final int height = this.detectHeight(designRowGroup.getTotalHeader().getList()); + if(maxHeight < height) + { + maxHeight = height; + } + } + break; + } + } + for(final DRDesignCrosstabCell designCell : designCrosstab.getCells()) + { + if(designCell.getRowTotalGroup() == rowGroup.getName()) + { + final int height = this.detectHeight(designCell.getContent().getList()); + if(maxHeight < height) + { + maxHeight = height; + } + } + } + return maxHeight; + } + + /** + *getCrosstabCellWidth.
+ * + * @param crosstab a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstab} object. + * @param designCrosstab a {@link software.xdev.dynamicreports.design.base.crosstab.DRDesignCrosstab} object. + * @return a int. + */ + public int getCrosstabCellWidth(final DRICrosstab crosstab, final DRDesignCrosstab designCrosstab) + { + if(crosstab.getCellWidth() != null) + { + return crosstab.getCellWidth(); + } + int maxWidth = 0; + for(final DRDesignCrosstabCell designCell : designCrosstab.getCells()) + { + if(designCell.getColumnTotalGroup() == null) + { + final int width = this.detectWidth(designCell.getContent().getList()); + if(maxWidth < width) + { + maxWidth = width; + } + } + } + for(final DRDesignCrosstabColumnGroup designColumnGroup : designCrosstab.getColumnGroups()) + { + final int width = this.detectWidth(designColumnGroup.getHeader().getList()); + if(maxWidth < width) + { + maxWidth = width; + } + } + if(maxWidth > Defaults.getDefaults().getCrosstabCellMaxWidth()) + { + return Defaults.getDefaults().getCrosstabCellMaxWidth(); + } + return maxWidth; + } + + /** + *getCrosstabCellHeight.
+ * + * @param crosstab a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstab} object. + * @param designCrosstab a {@link software.xdev.dynamicreports.design.base.crosstab.DRDesignCrosstab} object. + * @return a int. + */ + public int getCrosstabCellHeight(final DRICrosstab crosstab, final DRDesignCrosstab designCrosstab) + { + if(crosstab.getCellHeight() != null) + { + return crosstab.getCellHeight(); + } + int maxHeight = 0; + for(final DRDesignCrosstabCell designCell : designCrosstab.getCells()) + { + if(designCell.getRowTotalGroup() == null) + { + final int height = this.detectHeight(designCell.getContent().getList()); + if(maxHeight < height) + { + maxHeight = height; + } + } + } + for(final DRDesignCrosstabRowGroup designRowGroup : designCrosstab.getRowGroups()) + { + final int height = this.detectHeight(designRowGroup.getHeader().getList()); + if(maxHeight < height) + { + maxHeight = height; + } + } + return maxHeight; + } + + /** + *getCrosstabWhenNoDataCellHeight.
+ * + * @param whenNoDataCell a {@link software.xdev.dynamicreports.design.base.crosstab.DRDesignCrosstabCellContent} object. + * @return a int. + */ + public int getCrosstabWhenNoDataCellHeight(final DRDesignCrosstabCellContent whenNoDataCell) + { + return this.detectHeight(whenNoDataCell.getList()); + } + + /** + *getCrosstabOddRowStyle.
+ * + * @param crosstab a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstab} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRISimpleStyle} object. + */ + protected DRISimpleStyle getCrosstabOddRowStyle(final DRICrosstab crosstab) + { + if(this.isCrosstabHighlightOddRows(crosstab)) + { + if(crosstab.getOddRowStyle() != null) + { + return crosstab.getOddRowStyle(); + } + if(this.template.getCrosstabOddRowStyle() != null) + { + return this.template.getCrosstabOddRowStyle(); + } + return Defaults.getDefaults().getCrosstabOddRowStyle(); + } + return null; + } + + /** + *getCrosstabEvenRowStyle.
+ * + * @param crosstab a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstab} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRISimpleStyle} object. + */ + protected DRISimpleStyle getCrosstabEvenRowStyle(final DRICrosstab crosstab) + { + if(this.isCrosstabHighlightEvenRows(crosstab)) + { + if(crosstab.getEvenRowStyle() != null) + { + return crosstab.getEvenRowStyle(); + } + if(this.template.getCrosstabEvenRowStyle() != null) + { + return this.template.getCrosstabEvenRowStyle(); + } + return Defaults.getDefaults().getCrosstabEvenRowStyle(); + } + return null; + } + + private boolean isCrosstabHighlightOddRows(final DRICrosstab crosstab) + { + if(crosstab.getHighlightOddRows() != null) + { + return crosstab.getHighlightOddRows(); + } + if(this.template.getCrosstabHighlightOddRows() != null) + { + return this.template.getCrosstabHighlightOddRows(); + } + return Defaults.getDefaults().isCrosstabHighlightOddRows(); + } + + private boolean isCrosstabHighlightEvenRows(final DRICrosstab crosstab) + { + if(crosstab.getHighlightEvenRows() != null) + { + return crosstab.getHighlightEvenRows(); + } + if(this.template.getCrosstabHighlightEvenRows() != null) + { + return this.template.getCrosstabHighlightEvenRows(); + } + return Defaults.getDefaults().isCrosstabHighlightEvenRows(); + } + + /** + *getCrosstabGroupStyle.
+ * + * @param crosstab a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstab} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getCrosstabGroupStyle(final DRICrosstab crosstab) + { + if(crosstab.getGroupStyle() != null) + { + return crosstab.getGroupStyle(); + } + if(this.template.getCrosstabGroupStyle() != null) + { + return this.template.getCrosstabGroupStyle(); + } + if(Defaults.getDefaults().getCrosstabGroupStyle() != null) + { + return Defaults.getDefaults().getCrosstabGroupStyle(); + } + return this.getTextStyle(); + } + + /** + *getCrosstabGroupTotalStyle.
+ * + * @param crosstab a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstab} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getCrosstabGroupTotalStyle(final DRICrosstab crosstab) + { + if(crosstab.getGroupTotalStyle() != null) + { + return crosstab.getGroupTotalStyle(); + } + if(this.template.getCrosstabGroupTotalStyle() != null) + { + return this.template.getCrosstabGroupTotalStyle(); + } + if(Defaults.getDefaults().getCrosstabGroupTotalStyle() != null) + { + return Defaults.getDefaults().getCrosstabGroupTotalStyle(); + } + return this.getTextStyle(); + } + + /** + *getCrosstabGrandTotalStyle.
+ * + * @param crosstab a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstab} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getCrosstabGrandTotalStyle(final DRICrosstab crosstab) + { + if(crosstab.getGrandTotalStyle() != null) + { + return crosstab.getGrandTotalStyle(); + } + if(this.template.getCrosstabGrandTotalStyle() != null) + { + return this.template.getCrosstabGrandTotalStyle(); + } + if(Defaults.getDefaults().getCrosstabGrandTotalStyle() != null) + { + return Defaults.getDefaults().getCrosstabGrandTotalStyle(); + } + return this.getTextStyle(); + } + + /** + *getCrosstabCellStyle.
+ * + * @param crosstab a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstab} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getCrosstabCellStyle(final DRICrosstab crosstab) + { + if(crosstab.getCellStyle() != null) + { + return crosstab.getCellStyle(); + } + if(this.template.getCrosstabCellStyle() != null) + { + return this.template.getCrosstabCellStyle(); + } + if(Defaults.getDefaults().getCrosstabCellStyle() != null) + { + return Defaults.getDefaults().getCrosstabCellStyle(); + } + return this.getTextStyle(); + } + + /** + *getCrosstabMeasureTitleStyle.
+ * + * @param crosstab a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstab} object. + * @param measure a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstabMeasure} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + public DRIReportStyle getCrosstabMeasureTitleStyle(final DRICrosstab crosstab, final DRICrosstabMeasure> measure) + { + if(measure.getTitleStyle() != null) + { + return measure.getTitleStyle(); + } + if(crosstab.getMeasureTitleStyle() != null) + { + return crosstab.getMeasureTitleStyle(); + } + if(this.template.getCrosstabMeasureTitleStyle() != null) + { + return this.template.getCrosstabMeasureTitleStyle(); + } + return Defaults.getDefaults().getCrosstabMeasureTitleStyle(); + } + + /** + *getCrosstabPercentageType.
+ * + * @param variable a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstabVariable} object. + * @return a {@link software.xdev.dynamicreports.report.constant.CrosstabPercentageType} object. + */ + protected CrosstabPercentageType getCrosstabPercentageType(final DRICrosstabVariable> variable) + { + if(variable.getPercentageType() != null) + { + return variable.getPercentageType(); + } + return Defaults.getDefaults().getCrosstabPercentageType(); + } + + /** + *getBooleanComponentType.
+ * + * @param booleanField a {@link software.xdev.dynamicreports.report.definition.component.DRIBooleanField} object. + * @return a {@link software.xdev.dynamicreports.report.constant.BooleanComponentType} object. + */ + public BooleanComponentType getBooleanComponentType(final DRIBooleanField booleanField) + { + if(booleanField.getComponentType() != null) + { + return booleanField.getComponentType(); + } + if(this.template.getBooleanComponentType() != null) + { + return this.template.getBooleanComponentType(); + } + return Defaults.getDefaults().getBooleanComponentType(); + } + + /** + *getBooleanEmptyWhenNullValue.
+ * + * @param booleanField a {@link software.xdev.dynamicreports.report.definition.component.DRIBooleanField} object. + * @return a boolean. + */ + public boolean getBooleanEmptyWhenNullValue(final DRIBooleanField booleanField) + { + if(booleanField.getEmptyWhenNullValue() != null) + { + return booleanField.getEmptyWhenNullValue(); + } + if(this.template.getBooleanEmptyWhenNullValue() != null) + { + return this.template.getBooleanEmptyWhenNullValue(); + } + return Defaults.getDefaults().isBooleanEmptyWhenNullValue(); + } + + /** + *getBooleanImageWidth.
+ * + * @param booleanField a {@link software.xdev.dynamicreports.report.definition.component.DRIBooleanField} object. + * @return a int. + */ + public int getBooleanImageWidth(final DRIBooleanField booleanField) + { + if(booleanField.getImageWidth() != null) + { + return booleanField.getImageWidth(); + } + if(this.template.getBooleanImageWidth() != null) + { + return this.template.getBooleanImageWidth(); + } + return Defaults.getDefaults().getBooleanImageWidth(); + } + + /** + *getBooleanImageHeight.
+ * + * @param booleanField a {@link software.xdev.dynamicreports.report.definition.component.DRIBooleanField} object. + * @return a int. + */ + public int getBooleanImageHeight(final DRIBooleanField booleanField) + { + if(booleanField.getImageHeight() != null) + { + return booleanField.getImageHeight(); + } + if(this.template.getBooleanImageHeight() != null) + { + return this.template.getBooleanImageHeight(); + } + return Defaults.getDefaults().getBooleanImageHeight(); + } + + /** + *getBooleanHorizontalImageAlignment.
+ * + * @param booleanField a {@link software.xdev.dynamicreports.report.definition.component.DRIBooleanField} object. + * @param style a {@link software.xdev.dynamicreports.design.base.style.DRDesignStyle} object. + * @return a {@link software.xdev.dynamicreports.report.constant.HorizontalImageAlignment} object. + */ + protected HorizontalImageAlignment getBooleanHorizontalImageAlignment( + final DRIBooleanField booleanField, + final DRDesignStyle style) + { + if(booleanField.getHorizontalImageAlignment() != null) + { + return booleanField.getHorizontalImageAlignment(); + } + if(StyleResolver.getHorizontalImageAlignment(style) != null) + { + return null;// StyleResolver.getHorizontalAlignment(style); + } + return Defaults.getDefaults().getBooleanHorizontalImageAlignment(); + } + + /** + *getBooleanColumnStyle.
+ * + * @param column a {@link software.xdev.dynamicreports.report.definition.column.DRIBooleanColumn} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + public DRIReportStyle getBooleanColumnStyle(final DRIBooleanColumn column) + { + if(column.getComponent().getStyle() != null) + { + return column.getComponent().getStyle(); + } + if(this.template.getBooleanColumnStyle() != null) + { + return this.template.getBooleanColumnStyle(); + } + return Defaults.getDefaults().getBooleanColumnStyle(); + } + + /** + *getTemplateStyles.
+ * + * @return a {@link java.util.Map} object. + */ + public MapgetTitleSplitType.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + protected SplitType getTitleSplitType(final DRIBand band) + { + return this.getSplitType(band, this.template.getTitleSplitType(), Defaults.getDefaults().getTitleSplitType()); + } + + /** + *getPageHeaderSplitType.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + protected SplitType getPageHeaderSplitType(final DRIBand band) + { + return this.getSplitType(band, + this.template.getPageHeaderSplitType(), Defaults.getDefaults().getPageHeaderSplitType()); + } + + /** + *getPageFooterSplitType.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + protected SplitType getPageFooterSplitType(final DRIBand band) + { + return this.getSplitType(band, + this.template.getPageFooterSplitType(), Defaults.getDefaults().getPageFooterSplitType()); + } + + /** + *getColumnHeaderSplitType.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + protected SplitType getColumnHeaderSplitType(final DRIBand band) + { + return this.getSplitType( + band, + this.template.getColumnHeaderSplitType(), + Defaults.getDefaults().getColumnHeaderSplitType()); + } + + /** + *getColumnFooterSplitType.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + protected SplitType getColumnFooterSplitType(final DRIBand band) + { + return this.getSplitType( + band, + this.template.getColumnFooterSplitType(), + Defaults.getDefaults().getColumnFooterSplitType()); + } + + /** + *getGroupHeaderSplitType.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + protected SplitType getGroupHeaderSplitType(final DRIBand band) + { + return this.getSplitType(band, this.template.getGroupHeaderSplitType(), + Defaults.getDefaults().getGroupHeaderSplitType()); + } + + /** + *getGroupFooterSplitType.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + protected SplitType getGroupFooterSplitType(final DRIBand band) + { + return this.getSplitType(band, this.template.getGroupFooterSplitType(), + Defaults.getDefaults().getGroupFooterSplitType()); + } + + /** + *getDetailHeaderSplitType.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + protected SplitType getDetailHeaderSplitType(final DRIBand band) + { + return this.getSplitType( + band, + this.template.getDetailHeaderSplitType(), + Defaults.getDefaults().getDetailHeaderSplitType()); + } + + /** + *getDetailSplitType.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + protected SplitType getDetailSplitType(final DRIBand band) + { + return this.getSplitType(band, this.template.getDetailSplitType(), Defaults.getDefaults().getDetailSplitType()); + } + + /** + *getDetailFooterSplitType.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + protected SplitType getDetailFooterSplitType(final DRIBand band) + { + return this.getSplitType( + band, + this.template.getDetailFooterSplitType(), + Defaults.getDefaults().getDetailFooterSplitType()); + } + + /** + *getLastPageFooterSplitType.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + protected SplitType getLastPageFooterSplitType(final DRIBand band) + { + return this.getSplitType( + band, + this.template.getLastPageFooterSplitType(), + Defaults.getDefaults().getLastPageFooterSplitType()); + } + + /** + *getSummarySplitType.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + protected SplitType getSummarySplitType(final DRIBand band) + { + return this.getSplitType(band, this.template.getSummarySplitType(), Defaults.getDefaults().getSummarySplitType()); + } + + /** + *getNoDataSplitType.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + protected SplitType getNoDataSplitType(final DRIBand band) + { + return this.getSplitType(band, this.template.getNoDataSplitType(), Defaults.getDefaults().getNoDataSplitType()); + } + + /** + *getBackgroundSplitType.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.constant.SplitType} object. + */ + protected SplitType getBackgroundSplitType(final DRIBand band) + { + return this.getSplitType(band, + this.template.getBackgroundSplitType(), Defaults.getDefaults().getBackgroundSplitType()); + } + + private SplitType getSplitType(final DRIBand band, final SplitType templateSplitType, final SplitType splitType) + { + if(band.getSplitType() != null) + { + return band.getSplitType(); + } + if(templateSplitType != null) + { + return templateSplitType; + } + if(splitType != null) + { + return splitType; + } + if(this.template.getDefaultSplitType() != null) + { + return this.template.getDefaultSplitType(); + } + return Defaults.getDefaults().getDefaultSplitType(); + } + + // band style + + /** + *getTitleStyle.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getTitleStyle(final DRIBand band) + { + return this.getBandStyle(band, this.template.getTitleStyle()); + } + + /** + *getPageHeaderStyle.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getPageHeaderStyle(final DRIBand band) + { + return this.getBandStyle(band, this.template.getPageHeaderStyle()); + } + + /** + *getPageFooterStyle.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getPageFooterStyle(final DRIBand band) + { + return this.getBandStyle(band, this.template.getPageFooterStyle()); + } + + /** + *getColumnHeaderStyle.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getColumnHeaderStyle(final DRIBand band) + { + return this.getBandStyle(band, this.template.getColumnHeaderStyle()); + } + + /** + *getColumnFooterStyle.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getColumnFooterStyle(final DRIBand band) + { + return this.getBandStyle(band, this.template.getColumnFooterStyle()); + } + + /** + *getGroupHeaderStyle.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getGroupHeaderStyle(final DRIBand band) + { + return this.getBandStyle(band, this.template.getGroupHeaderStyle()); + } + + /** + *getGroupFooterStyle.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getGroupFooterStyle(final DRIBand band) + { + return this.getBandStyle(band, this.template.getGroupFooterStyle()); + } + + /** + *getDetailHeaderStyle.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getDetailHeaderStyle(final DRIBand band) + { + return this.getBandStyle(band, this.template.getDetailHeaderStyle()); + } + + /** + *getDetailStyle.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getDetailStyle(final DRIBand band) + { + return this.getBandStyle(band, this.template.getDetailStyle()); + } + + /** + *getDetailFooterStyle.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getDetailFooterStyle(final DRIBand band) + { + return this.getBandStyle(band, this.template.getDetailFooterStyle()); + } + + /** + *getLastPageFooterStyle.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getLastPageFooterStyle(final DRIBand band) + { + return this.getBandStyle(band, this.template.getLastPageFooterStyle()); + } + + /** + *getSummaryStyle.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getSummaryStyle(final DRIBand band) + { + return this.getBandStyle(band, this.template.getSummaryStyle()); + } + + /** + *getNoDataStyle.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getNoDataStyle(final DRIBand band) + { + return this.getBandStyle(band, this.template.getNoDataStyle()); + } + + /** + *getBackgroundStyle.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.style.DRIReportStyle} object. + */ + protected DRIReportStyle getBackgroundStyle(final DRIBand band) + { + return this.getBandStyle(band, this.template.getBackgroundStyle()); + } + + private DRIReportStyle getBandStyle(final DRIBand band, final DRIReportStyle templateStyle) + { + if(band.getList().getStyle() != null) + { + return band.getList().getStyle(); + } + if(templateStyle != null) + { + return templateStyle; + } + return Defaults.getDefaults().getBandStyle(); + } + + // band background component + + /** + *getTitleBackgroundComponent.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + protected DRIComponent getTitleBackgroundComponent(final DRIBand band) + { + return this.getBandBackgroundComponent(band, this.template.getTitleBackgroundComponent()); + } + + /** + *getPageHeaderBackgroundComponent.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + protected DRIComponent getPageHeaderBackgroundComponent(final DRIBand band) + { + return this.getBandBackgroundComponent(band, this.template.getPageHeaderBackgroundComponent()); + } + + /** + *getPageFooterBackgroundComponent.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + protected DRIComponent getPageFooterBackgroundComponent(final DRIBand band) + { + return this.getBandBackgroundComponent(band, this.template.getPageFooterBackgroundComponent()); + } + + /** + *getColumnHeaderBackgroundComponent.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + protected DRIComponent getColumnHeaderBackgroundComponent(final DRIBand band) + { + return this.getBandBackgroundComponent(band, this.template.getColumnHeaderBackgroundComponent()); + } + + /** + *getColumnFooterBackgroundComponent.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + protected DRIComponent getColumnFooterBackgroundComponent(final DRIBand band) + { + return this.getBandBackgroundComponent(band, this.template.getColumnFooterBackgroundComponent()); + } + + /** + *getGroupHeaderBackgroundComponent.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + protected DRIComponent getGroupHeaderBackgroundComponent(final DRIBand band) + { + return this.getBandBackgroundComponent(band, this.template.getGroupHeaderBackgroundComponent()); + } + + /** + *getGroupFooterBackgroundComponent.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + protected DRIComponent getGroupFooterBackgroundComponent(final DRIBand band) + { + return this.getBandBackgroundComponent(band, this.template.getGroupFooterBackgroundComponent()); + } + + /** + *getDetailHeaderBackgroundComponent.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + protected DRIComponent getDetailHeaderBackgroundComponent(final DRIBand band) + { + return this.getBandBackgroundComponent(band, this.template.getDetailHeaderBackgroundComponent()); + } + + /** + *getDetailBackgroundComponent.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + protected DRIComponent getDetailBackgroundComponent(final DRIBand band) + { + return this.getBandBackgroundComponent(band, this.template.getDetailBackgroundComponent()); + } + + /** + *getDetailFooterBackgroundComponent.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + protected DRIComponent getDetailFooterBackgroundComponent(final DRIBand band) + { + return this.getBandBackgroundComponent(band, this.template.getDetailFooterBackgroundComponent()); + } + + /** + *getLastPageFooterBackgroundComponent.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + protected DRIComponent getLastPageFooterBackgroundComponent(final DRIBand band) + { + return this.getBandBackgroundComponent(band, this.template.getLastPageFooterBackgroundComponent()); + } + + /** + *getSummaryBackgroundComponent.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + protected DRIComponent getSummaryBackgroundComponent(final DRIBand band) + { + return this.getBandBackgroundComponent(band, this.template.getSummaryBackgroundComponent()); + } + + /** + *getNoDataBackgroundComponent.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + protected DRIComponent getNoDataBackgroundComponent(final DRIBand band) + { + return this.getBandBackgroundComponent(band, this.template.getNoDataBackgroundComponent()); + } + + /** + *getBackgroundBackgroundComponent.
+ * + * @param band a {@link software.xdev.dynamicreports.report.definition.DRIBand} object. + * @return a {@link software.xdev.dynamicreports.report.definition.component.DRIComponent} object. + */ + protected DRIComponent getBackgroundBackgroundComponent(final DRIBand band) + { + return this.getBandBackgroundComponent(band, this.template.getBackgroundBackgroundComponent()); + } + + private DRIComponent getBandBackgroundComponent(final DRIBand band, final DRIComponent templateBackgroundComponent) + { + if(band.getList().getBackgroundComponent() != null) + { + return band.getList().getBackgroundComponent(); + } + if(templateBackgroundComponent != null) + { + return templateBackgroundComponent; + } + return Defaults.getDefaults().getBandBackgroundComponent(); + } + + private int detectWidth(final DRDesignList designList) + { + ComponentPosition.width(designList); + return designList.getWidth(); + } + + private int detectHeight(final DRDesignList designList) + { + ComponentPosition.height(designList); + return designList.getHeight(); + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/expressions/BooleanTextValueFormatter.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/expressions/BooleanTextValueFormatter.java new file mode 100644 index 0000000..8925acf --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/expressions/BooleanTextValueFormatter.java @@ -0,0 +1,66 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeBooleanTextValueFormatter class.
+ * + * @author Ricardo Mariaca + * + */ +public class BooleanTextValueFormatter extends AbstractValueFormatterConstructor for BooleanTextValueFormatter.
+ * + * @param keyTrue a {@link java.lang.String} object. + * @param keyFalse a {@link java.lang.String} object. + * @param emptyWhenNullValue a boolean. + */ + public BooleanTextValueFormatter(String keyTrue, String keyFalse, boolean emptyWhenNullValue) { + this.keyTrue = keyTrue; + this.keyFalse = keyFalse; + this.emptyWhenNullValue = emptyWhenNullValue; + } + + /** {@inheritDoc} */ + @Override + public String format(Boolean value, ReportParameters reportParameters) { + if (emptyWhenNullValue && value == null) { + return ""; + } + String key; + if (value != null && value) { + key = keyTrue; + } else { + key = keyFalse; + } + return ResourceBundle.getBundle(Constants.RESOURCE_BUNDLE_NAME, reportParameters.getLocale()).getString(key); + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/expressions/CrosstabExpression.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/expressions/CrosstabExpression.java new file mode 100644 index 0000000..2bd209c --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/expressions/CrosstabExpression.java @@ -0,0 +1,90 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeCrosstabExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class CrosstabExpressionConstructor for CrosstabExpression.
+ * + * @param crosstab a {@link software.xdev.dynamicreports.report.definition.crosstab.DRICrosstab} object. + * @param expression a {@link software.xdev.dynamicreports.report.definition.expression.DRIExpression} object. + * @throws software.xdev.dynamicreports.report.exception.DRException if any. + */ + public CrosstabExpression(DRICrosstab crosstab, DRIExpressionCrosstabMeasureExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class CrosstabMeasureExpression extends AbstractComplexExpressionConstructor for CrosstabMeasureExpression.
+ * + * @param expression a {@link software.xdev.dynamicreports.report.definition.expression.DRIExpression} object. + */ + public CrosstabMeasureExpression(DRIExpression> expression) { + addExpression(expression); + } + + /** {@inheritDoc} */ + @Override + public Double evaluate(List> values, ReportParameters reportParameters) { + Number value = (Number) values.get(0); + if (value != null) { + return value.doubleValue(); + } + return null; + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/expressions/CrosstabPrintInEvenRow.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/expressions/CrosstabPrintInEvenRow.java new file mode 100644 index 0000000..ac39847 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/expressions/CrosstabPrintInEvenRow.java @@ -0,0 +1,38 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeCrosstabPrintInEvenRow class.
+ * + * @author Ricardo Mariaca + * + */ +public class CrosstabPrintInEvenRow extends AbstractSimpleExpressionCrosstabPrintInOddRow class.
+ * + * @author Ricardo Mariaca + * + */ +public class CrosstabPrintInOddRow extends AbstractSimpleExpressionCrosstabRowCount class.
+ * + * @author Ricardo Mariaca + * + */ +public class CrosstabRowCount extends AbstractSimpleExpressionCrosstabRowCounter class.
+ * + * @author Ricardo Mariaca + * + */ +public class CrosstabRowCounter extends AbstractSimpleExpressionincrement.
+ */ + public void increment() { + rowNumber++; + } + + /** + *Getter for the field rowNumber
.
CurrentDateExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class CurrentDateExpression extends AbstractComplexExpressionConstructor for CurrentDateExpression.
+ * + * @param currentDateExpression a {@link software.xdev.dynamicreports.report.definition.expression.DRIExpression} object. + * @param datePattern a {@link java.lang.String} object. + */ + public CurrentDateExpression(DRIExpressionGroupByDataTypeExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class GroupByDataTypeExpression extends AbstractSimpleExpressionConstructor for GroupByDataTypeExpression.
+ * + * @param valueExpression a {@link software.xdev.dynamicreports.report.definition.expression.DRIExpression} object. + * @param dataType a {@link software.xdev.dynamicreports.report.definition.datatype.DRIDataType} object. + */ + public GroupByDataTypeExpression(DRIExpression> valueExpression, DRIDataType, ?> dataType) { + this.valueExpression = valueExpression; + this.dataType = dataType; + } + + /** {@inheritDoc} */ + @Override + public String evaluate(ReportParameters reportParameters) { + return dataType.valueToString(valueExpression.getName(), reportParameters); + } +} diff --git a/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/expressions/MultiPageListDataSourceExpression.java b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/expressions/MultiPageListDataSourceExpression.java new file mode 100644 index 0000000..2c5cbc6 --- /dev/null +++ b/dynamicreports-core-for-grid-exporter/src/main/java/software/xdev/dynamicreports/design/transformation/expressions/MultiPageListDataSourceExpression.java @@ -0,0 +1,57 @@ +/* + * dynamicreports-core-for-grid-exporter - dynamicreports-core-for-grid-exporter + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, seeMultiPageListDataSourceExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class MultiPageListDataSourceExpression extends AbstractSimpleExpressionConstructor for MultiPageListDataSourceExpression.
+ * + * @param count a int. + */ + public MultiPageListDataSourceExpression(int count) { + this.count = count; + } + + /** {@inheritDoc} */ + @Override + public JRDataSource evaluate(ReportParameters reportParameters) { + return new JREmptyDataSource(count); + } + + /** {@inheritDoc} */ + @Override + public ClassMultiPageListSubreportExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class MultiPageListSubreportExpression extends AbstractSimpleExpressionConstructor for MultiPageListSubreportExpression.
+ * + * @param locale a {@link java.util.Locale} object. + * @param resourceBundle a {@link java.util.ResourceBundle} object. + * @param resourceBundleName a {@link java.lang.String} object. + * @param resourceBundleName a {@link java.lang.String} object. + * @param whenResourceMissingType a {@link software.xdev.dynamicreports.report.constant.WhenResourceMissingType} object. + * @param detailComponents a {@link java.util.List} object. + * @param templateStyles a {@link java.util.Map} object. + */ + public MultiPageListSubreportExpression(Locale locale, ResourceBundle resourceBundle, String resourceBundleName, WhenResourceMissingType whenResourceMissingType, + ListPageNumberExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class PageNumberExpression extends AbstractComplexExpressionConstructor for PageNumberExpression.
+ * + * @param pageNumberFormatExpression a {@link software.xdev.dynamicreports.report.definition.expression.DRIExpression} object. + */ + public PageNumberExpression(DRIExpressionPageXofYNumberExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class PageXofYNumberExpression extends AbstractComplexExpressionConstructor for PageXofYNumberExpression.
+ * + * @param pageNumberFormatExpression a {@link software.xdev.dynamicreports.report.definition.expression.DRIExpression} object. + * @param index a int. + */ + public PageXofYNumberExpression(DRIExpressionSerieValueExpression class.
+ * + * @author Ricardo Mariaca + * + */ +public class SerieValueExpression extends AbstractSimpleExpression