diff -Nru jasperreports-6.2.2/build.xml jasperreports-6.3.1/build.xml --- jasperreports-6.2.2/build.xml 2016-05-05 16:57:17.000000000 +0000 +++ jasperreports-6.3.1/build.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,269 +0,0 @@ - - - Helps build the JasperReports distribution files. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
-
- - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - -JasperReports API (version ${version}) - - -]]> - - -© 2001-2014 TIBCO Software Inc. www.jaspersoft.com -]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff -Nru jasperreports-6.2.2/changes.txt jasperreports-6.3.1/changes.txt --- jasperreports-6.2.2/changes.txt 2016-05-06 08:35:57.000000000 +0000 +++ jasperreports-6.3.1/changes.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,2220 +0,0 @@ - -JasperReports Library Change Log -============================================= - -JasperReports 6.2.2 (2016-05-06) ---------------------------------------------- - -- adding new types of element stretch and deprecating some of the existing ones, -to differentiate between element group stretch and container stretch and to -also account for the current vertical displacement of the element; - -- introducing new generic Renderable interface for image rendering while -deprecating the existing one and its implementations, to better differentiate -between static visualizations such as images, SVGs, and dynamically generated -drawings, each identified by separate specialized renderable interface, -with convenience implementation classes; - -- built-in support for SVG as image format, including support for embedding -SVG in HTML export; - -- making use of fonts from JR font extensions when rendering SVG with Apache Batik -as well as use of Web fonts in the SVG embedded into the HTML export; - -- enhanced support for internationalization, with the addition of font set definitions -in JR font extensions, to allow grouping font families in super-sets that can cover -several languages/scripts; when using a font set, the font family resolution occurs -during text processing and is performed on a per character basis, allowing mixing of words -in different languages/scripts in the same text element; - -- support for calling PL/SQL stored procedures (Oracle), which was available -as a separate query executer extension, is now part of the JR core library; - -- minor bug fixes and improvements; - - - - - -JasperReports 6.2.1 (2016-03-22) ---------------------------------------------- - -- removed all JAR dependencies from project and introduced Apache Ivy dependency management -for building the distribution files and running the samples; - -- support for embedding Base64 encoded images in HTML export using the new -"net.sf.jasperreports.export.html.embed.image" configuration property; - -- new CSV export configuration properties for controlling the field encoding character -(net.sf.jasperreports.export.csv.field.enclosure) and also for forcing field enclosure -(net.sf.jasperreports.export.csv.force.field.enclosure); - -- rendering of ellipses and round corner rectangles using SVG in HTML export; - -- minor bug fixes and improvements; - - - - - -JasperReports 6.2.0 (2015-11-11) ---------------------------------------------- - -- improved PDF export accessibility in compliance with Section 508 Amendment to -the Rehabilitation Act of 1973, by adding support for making headings up to level 6, -marking lists and automatic insertion of table markers for table component output; - -- support for complex scripts (such as Indic scripts) in PDF by means of AWT text layout; - -- added support for duration based filter and duration based conditional formatting of -numeric columns in table components; special format pattern [h]:mm:ss causes numeric values -to be treated as duration; - -- refactored map component items APIs for further reuse in other custom components; - -- minor bug fixes and improvements; - - - - - -JasperReports 6.1.1 (2015-09-07) ---------------------------------------------- - -- added support for returning values from bands, which gives better control over -variable incrementation in cases where calculations are coupled with content rendering, -such as page totals; - -- allow frame elements to be placed beyond frame bottom edge; this would cause frames -to grow in height in order to display all their content and reduces the need for frames to -shrink in case some of their content displays conditionally and space needs to be collapsed; - -- new configuration property "net.sf.jasperreports.evaluator.ignore.npe" added to control -the expressions evaluation with respect to raising NullPointerException; - -- added support for locale and timezone in CSV and XLS data adapters; - -- minor bug fixes and improvements; - - - - - -JasperReports 6.1.0 (2015-05-25) ---------------------------------------------- -- support for multiple JSON metadata export properties attached to same report element -to allow more flexibility in report data exports; - -- improvements in QRCode barcodes rendering; - -- configuration property added to control the addition of a BOM character at the beginning -of CSV export files; - -- minor bug fixes and improvements; - - - - - -JasperReports 6.0.4 (2015-04-15) ---------------------------------------------- - -- support for pluggable data file locations in file-based data adapters, with default -implementations for remote HTTP data files; - -- new report data source implementation able to consume a list of JSON files provided as input; - -- internationalization of exceptions raised by the JasperReports Library with the introduction -of exception error codes that serve as message keys in translation bundles; - -- downgrade to iText version 2.1.7 and distribution of this third party library under -the terms of the Mozilla Public License version 1.1; - -- support for gutter margins in PDF export with the introduction of export configuration -properties to allow setting different left and right margins for odd and even pages; - -- ability to ignore text formatting in all Excel exporters using newly added export -configuration property; - -- minor bug fixes and improvements; - - - - - -JasperReports 6.0.3 (2015-02-06) ---------------------------------------------- - -- minor bug fixes and improvements; - - - - - -JasperReports 6.0.2 (2015-02-04) ---------------------------------------------- - -- throw specific exception net.sf.jasperreports.export.ExportInterruptedException on all -report export interruption events; - -- differentiate between text align properties and image align properties by adding specific -properties and enumerations in object model and deprecating the existing ones; - -- support for QR Code barcodes in barcode4j component; - -- support for pluggable remote file provider in all file-based data adapters; - -- minor bug fixes and improvements; - - - - - -JasperReports 6.0.0 (2014-11-25) ---------------------------------------------- - -- new type of report template called "report book" was added, in which sections are made -of parts instead of bands; parts are external report templates, similar to subreports, -and allow creation of documents with variable page size and/or orientation; parts can be -displayed on separate tabs by report viewers and simplify creation of "table of contents" -structures in which parts that appear early in the document are actually filled/rendered -later during the report filling process (see evaluationTime attribute of part); - -- new JSON metadata exporter added, similar to the XLS and CSV metadata exporters in which -the values that need to be exported have to be marked-up using configuration properties at -text element level; - -- upgrade to iText version 5.5.0 in the PDF exporter; - -- upgrade to POI version 3.10.1 in the XLS exporter and data source; - -- minor bug fixes and improvements; - - - - - -JasperReports 5.6.1 (2014-09-04) ---------------------------------------------- - -- minor bug fixes and improvements; - - - - - -JasperReports 5.6.0 (2014-05-27) ---------------------------------------------- - -- new overflowType attribute available for subreport elements to control subreport runtime -stretch behavior; - -- minor bug fixes and improvements; - - - - - -JasperReports 5.5.2 (2014-04-28) ---------------------------------------------- - -- new API for setting exporter's input, output and configuration, which replaces the now -deprecated parameter based exporter configuration; The JRExporterParameter class and its subclasses -are now deprecated and replaced by ExporterInput, ExporterOutput and ExporterConfiguration interfaces -and their subinterfaces and convenience implementations; - -- new Apache POI based metadata XLS exporter (JRXlsMetadataExporter class), which replaces -the now deprecated JExcelApi based metadata exporter (JExcelApiExporter class); - -- all JExcelApi based XLS exporters (JExcelApiExporter and JExcelApiMetadataExporter) are -now deprecated and should no longer be used as they will no longer be maintained and will be -completely removed from the library sometime in the future; The JRXlsExporter, JRXlsMetadataExporter -(both Apache POI based) and JRXlsxExporter implementations should be used instead; - -- new Apache POI based XLS report data source (XlsDataSource class), which replaces the now -deprecated JExcelApi based data source (JRXlsDataSource class); - -- new Excel data adapter implementation, with ability to auto-detect Excel file format -(XLS 2003 or XLSX 2007); sample provided under the /demo/samples/exceldataadapter folder of -the project source distro; - -- the older HTML and XHTML exporters (JRHtmlExporter and JRXhtmlExporter) are now deprecated -and should no longer be used as they will no longer be maintained and will be completely removed -from the library sometime in the future; The newer HtmlExporter implementation should be used instead; - -- new title cell added to crosstab element structure, to allow align content with -dynamic width crosstabs; - -- added new PDF exporter configuration properties (net.sf.jasperreports.export.pdf.permissions.allowed -and net.sf.jasperreports.export.pdf.permissions.denied) to control PDF file permissions from -within the report template or globally, from JasperReports configuration context; - -- support for table-of-contents metadata build-up during report filling process, to be leveraged -in document viewers that have the ability to display bookmark based table-of-contents that are not -part of the document content itself. - -- new XMLA query executer based on olap4j; - -- support for loading report resource bundles from repository; - -- support for decimal font size in report templates; - -- richer Javadoc API documentation throughout the entire library source code; - -- minor bug fixes and improvements; - - - - - -JasperReports 5.5.1 (2014-02-07) ---------------------------------------------- - -- added built-in parameter JASPER_REPORTS_CONTEXT for access to current JasperReportsContext -configuration object during report filling; - -- allow specifying the encoding in CSV data adapter configuration; - -- enhanced built-in datetime and text processing report expression functions to leverage -the built-in report parameters for the locale and the timezone; - -- added new extension point for template-based RequireJS configurations; - -- minor bug fixes and improvements; - - - - - -JasperReports 5.5.0 (2013-10-24) ---------------------------------------------- - -- improved JasperReports Web Framework containing embeddable report viewer APIs. -It introduces a separation between the report's HTML output and its interactivity-related -metadata (new JSON exporter) and support for dynamically loaded Javascript modules through RequireJS. -The new APIs simplify interactive report viewer adoption and its customization while giving -new opportunities for creation of interactive custom components; - -- interactive table component formatting capabilities extended to allow basic formatting and -conditional formatting of all table sections including group headers and footers; - -- interactive sorting introduced to the crosstab element, where crosstab data can be sorted interactively -by row group values and/or measure values, when report is viewed with an interactive report viewer; - -- support for Web fonts in the HTML exporter by enhancing JasperReports font extension configuration -to allow specifying font files in EOT, SVG and WOFF format. When specified, font files are delivered -to the browser by dynamically created CSS containing @font-face declarations; - -- enhanced Google Map component with support for marker properties and support for paths and polygons; - -- minor bug fixes and improvements; - - - - - -JasperReports 5.2.0 (2013-06-29) ---------------------------------------------- - -- minor bug fixes and improvements; - - - - - -JasperReports 5.1.2 (2013-06-07) ---------------------------------------------- - -- support for custom functions in report expressions; -this includes support for expression functions in the JDT, Groovy and Javascript -report compilers and excludes the JDK-based report compilers, for which static imports -would be needed in the report template; - -- custom serialization for virtualizers, to improve performance of large reports; - -- print text element optimizations to lower memory consumption and speed up processing; - -- refactored grid layout algorithms for grid-based exporters, to lower memory consumption; - -- caching of dynamic style properties and of transferable element level properties -for improved report filling performance; - -- secrets storage extension point added to allow pluging custom mechanisms for storing -passwords for data adapters and other secret information; - -- minor bug fixes and improvements; - - - - - -JasperReports 5.1.0 (2013-04-29) ---------------------------------------------- - -- enhanced support for markers in Google map component, including hyperlinks and info window; - -- completing features in new layered HTML exporter; - -- minor bug fixes and improvements; - - - - - -JasperReports 5.0.4 (2013-03-26) ---------------------------------------------- - -- new HTML exporter implementation added, which uses HTML tables to render the report content, -but still supports overlapping elements by arranging them in separate layers. -This new exporter implemented in the net.sf.jasperreports.engine.export.HtmlExporter class also -supports report interactivity and is now the preferred way to export to HTML, being used by -the JasperExportManager class and all other convenience and utility classes in the JasperReports -library and its provided samples; - -- the ODS exporter refactored so that it behaves more like the XLS exporters and thus supports -a significant number of XLS export configuration properties and parameters; - -- new introduced for hyperlink definitions, complemented with export time -configuration properties to control the appearance of hyperlinks depending on the export format; - -- new cells available in crosstab structure, to allow defining headers for column groups in -the top left corner of the crosstab, where the unstructured crosstab header cell is normally rendered; - these new cells overlap the former crosstab header cell, if present, but allow for their content - to stretch in accordance with column group header cell stretching; - -- new shared virtualizer implementation added to allow the use of a separate swap file per report; - -- added support for localization in the exceptions raised by the JasperReports library; - -- added configuration properties for controlling the interactive features of the table component -such as column sorting, filtering and formatting; - -- minor bug fixes and improvements; - - - - - -JasperReports 5.0.1 (2013-01-03) ---------------------------------------------- - -- eliminate empty collapsed columns in XLS/XLSX exporters; - -- XLS/XLSX data adapter improvements; - -- minor bug fixes and improvements; - - - - - -JasperReports 5.0.0 (2012-11-12, SVN 5807) ---------------------------------------------- - -- improved report filling performance by extending the use of the simplified text measurer -that was previously used only for single line text elements; - -- improved subreport filling performance by using a thread pooling mechanism; - -- minor bug fixes and improvements; - - - - - -JasperReports 4.8.0 (2012-11-05, SVN 5784) ---------------------------------------------- - -- enhanced interactivity in the table component, with support for conditional formatting -of values in a column; - -- support for style providers as pluggable extensions, to control report element styling -depending on report data at runtime; a default style provider implementation is available, -allowing the use of expression based custom properties at report element level, to control -each style attribute, including backcolor, forecolor, font, borders style, etc; - -- added support for markers to the built-in map component, along with other new map level -settings such as type of map, image type and language (I18n support); - -- version support added to the JRXmlWriter utility class to allow generating source JRXML format -for older versions of the library, including support for versioning of custom components markup; - -- support for custom $X{} functions in queries, which can be plugged in as extensions; - -- added support for relative date ranges used as input parameters in parametrized queries; - -- minor bug fixes and improvements; - - - - - -JasperReports 4.7.1 (2012-09-22, SVN 5678) ---------------------------------------------- - -- improved performance for the newly introduced Javascript report compiler; - -- configuration properties to control table component interactive features; - -- minor bug fixes and improvements; - - - - - -JasperReports 4.7.0 (2012-07-02, SVN 5473) ---------------------------------------------- - -- improved rendering performance for the table component; - -- enhanced interactive report viewer APIs; - -- new "net.sf.jasperreports.export.pdf.size.page.to.content" export configuration property added -to allow for variable page size in PDF documents, by adapting page size to page content size; - -- better control over memory footprint in large XLSX exports, by allowing the temporary files buffer size -to be configured locally through report custom properties; - -- minor bug fixes and improvements; - - - - - -JasperReports 4.6.0 (2012-05-21, SVN 5400) ---------------------------------------------- - -- improved JasperReports configuration infrastructure by the introduction of a JasperReportsContext, -an new interface from where JR configuration properties are read and JR extensions are loaded. -This allows different configurations of the JR engine to exist simultaneously in the same JVM; - -- improved JasperReports Web Framework which now features a centralized controller to dispatch -actions triggered by end user interactions in the report viewer. Actions are backed by atomized -commands that modify the report metadata on-the-fly, with support for undo/redo operations, -to reflect changes in the report output; - -- introduction of reusable Web report viewer APIs, featuring configurable report viewing servlets, -and built-in Javascript modules that can be used to create custom interactive report viewers in Web -applications embedding the JasperReports Library. -This is demonstrated in the new /demo/samples/webapp-repo sample where two different looking versions -of the same build-in JR interactive report viewer are used to displays interactive reports; - -- enhanced interactivity in the table component, with support for column formatting, hiding, resizing, -moving, sorting and filtering, all leveraging the new action-based JR Web Framework controller and its -interactivity supporting report viewer Javascript APIs; - -- introduction of a data caching API that helps avoid re-querying the report's data source, -for performance reasons, while interactively viewing the report using an interactive report viewer -created based on the new JR Web Framework; - -- added new page related events in the asynchronous report filler to support asynchronous page display -in interactive report viewers; - -- added support for message providers that can be plugged into JR as extensions, to allow -internationalization of interactive custom components UIs; - -- minor bug fixes and improvements; - - - - - -JasperReports 4.5.1 (2012-03-05, SVN 5027) ---------------------------------------------- - -- the JSON data source and the respective JSON query executer were moved -from the samples folder to the core library; - -- support for macros added in XLS and XSLX exporters; - -- the repository APIs were enhanced with support for pluggable persistence -services to load and store resources in the repository; - -- the "net.sf.jasperreports.export.pdf.force.linebreak.policy" configuration -property is un-deprecated, as a partial revert of the changes made in 4.1.1 with -regards to PDF text rendering; These changes were partially reverted as they affected -the performance of the PDF exporter when dealing with simple texts. The AWT-based text -rendering is now performed only on complex text fields that contain tab characters -for tab stop alignment or contain multiple paragraphs, with variable paragraph styling. - -- minor bug fixes and improvements; - - - - - -JasperReports 4.5.0 (2011-12-06, SVN 4839) ---------------------------------------------- - -- border and padding style properties added to crosstab elements; - -- optimized text measurement for short and simple texts, to speed up report filling process; - -- new "net.sf.jasperreports.export.xls.use.timezone" export configuration property added -to force translation of date values during XLS export, to the timezone used to fill the report; - -- minor bug fixes and improvements; - - - - - -JasperReports 4.1.3 (2011-10-28, SVN 4774) ---------------------------------------------- - -- new XLS/XLSX export configuration properties added for advanced features -including auto-filter, row outline collapse/expand grouping and custom column width; - -- enhanced support for interactive sorting and filtering, with more filter criteria -available depending on column data type and possibility to sort and filter on multiple -columns at the same time; - -- improved virtualization by consolidating styling information for repeating subreports -and by splitting large pages into smaller virtualized pieces for non-paginated reports; - -- the XML exporter was changed to use namespaces and thus allow pluggable generic element -parameter value handlers; - -- minor bug fixes and improvements; - - - - - -JasperReports 4.1.2 (2011-09-12, SVN 4600) ---------------------------------------------- - -- support for PDF/A compliance added to the PDF exporter; - -- new sort/filter custom component added to allow non-table component reports to leverage -the interactive sorting and filtering feature when deployed inside the JR Web Framework; - -- minor bug fixes and improvements; - - - - - -JasperReports 4.1.1 (2011-08-11, SVN 4550) ---------------------------------------------- - -- deprecated code for JRReportFont, JRBox, graphic element pen property -and all deprecated byte-based properties were removed from the library's API; - -- the whole JR source code was overhauled to make use of Java5-style Generics; - -- value class property is now deprecated in expression objects; the type of -expression no longer needs to be specified; - -- the library's API was extended with a new repository API, which is used now -throughout the reporting engine to locate report resources such as images, fonts, -subreports, etc; - -- new parameter contributor interface was added to the engine to allow parameter -manipulation prior to query execution; parameter contributors can be plugged in as -extensions; - -- new data adapter concept was added to the library's API to allow the reporting engine -to connect to data directly, without the parent application providing the data the source -nor the query executer parameters, at report fill time; - -- new report executing servlet was added as part of a larger Web framework that -is now available in the library's core API, to simplify deployment of JR inside -Web applications and achieve higher degree of interactivity for reports; -details about how this new Web framework can be used can be seen in the new -/demo/samples/webapp-repo sample, which also makes use of the newly introduced -repository API, to locate the report templates and their additional resources; - -- the table component was enhanced so that it is more interactive by default, -when the reports are deployed in an application that makes use of the above mentioned -Web framework; by default, table columns are sortable, while text columns are filterable -using a simple "contains" filter criteria; this can be seen in the TableReport -deployed in the /demo/samples/webapp-repo sample; - -- new map component added to the core library to simplify rendering of Google maps -inside reports; - -- new XLS metadata exporter added, similar to the CSV metadata exporter in which -columns that need to be exported have to be marked-up using configuration properties -at text element level; - -- new XLSX data source and query executer added; details about how it works -are found in the new /demo/samples/xlsxdatasource sample; - -- pattern expression added to text fields elements to allow for more flexible -dates and numbers formatting; - -- custom property "net.sf.jasperreports.export.xls.pattern" is now available to control -cell formatting patterns in XLS/XLSX exporters; - -- new custom properties are available in XLS/XLSX exporters to freeze panes; - -- new "net.sf.jasperreports.image.dpi" custom property added to allow specifying -the image resolution in dots-per-inch, for the images created by the engine when -rasterizing SVGs or when clipping other image renderers; - -- the "net.sf.jasperreports.export.pdf.force.linebreak.policy" configuration property -is now deprecated as the PDF text rendering code was refactored so that text is rendered -exactly like in AWT; - -- minor bug fixes and improvements; - - - - - -JasperReports 4.0.2 (2011-04-18, SVN 4298) ---------------------------------------------- - -- improved XHTML exporter to bring it at feature parity with the former HTML exporter; - -- initial support for paragraph styling including: indentation, spacing and tab stops; - -- new values available for line spacing type: AtLeast, Fixed and Proportional; - -- added support for tab characters inside text elements based on newly introduced tab stop concept; - -- new /demo/samples/paragraphs sample added to demonstrate paragraph styling features; - -- minor bug fixes and improvements; - - - - - -JasperReports 4.0.1 (2011-02-28, SVN 4219) ---------------------------------------------- - -- new Xalan-based and Jaxen-based XPath query executer namespace aware -implementations added; - -- new functions EQUAL, NOTEQUAL, LESS, GREATER and BETWEEN are now available -for the $X{} syntax in dynamic SQL queries; - -- new XSL query executer implementation added; - -- support for multiple hyperlinks embedded into styled/markup text; - -- improved image quality in the XLS exporters; - -- experimental JSON data source and query executer added as separate sample -under /demo/samples/jsondatasource; - -- experimental HTML renderer component added as separate sample -under /demo/samples/htmlcomponent; - -- custom property "net.sf.jasperreports.export.html.class" added at element level to allow -specifying the CSS "class" attribute for elements when exported to HTML and XHTML/CSS format; - -- minor bug fixes and improvements; - - - - - -JasperReports 4.0.0 (2010-12-31, SVN 4121) ---------------------------------------------- - -- new CSV query executer added to simplify to allow configuring CSV data sources from within report templates -using built-in parameters and config properties; - -- new CSV metadata exporter added to better control the CSV export by marking columns in the report template -using custom properties; - -- new chapters in the Sample Reference documentation have beed completed -(http://jasperreports.sf.net/sample.reference.html); - -- minor bug fixes and improvements; - - - - - -JasperReports 3.7.6 (2010-10-27, SVN 4037) ---------------------------------------------- - -- enhancing the XLSX exporter so that it supports more exporter parameters -and configuration properties from the ones shared by all the XLS exporters; - -- various fixes in the XLS exporters; - -- added support for hidden text in the DOCX exporter; - -- new chapters added to the Sample Reference documentation; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.7.5 (2010-09-22, SVN 3978) ---------------------------------------------- - -- support for dynamic sorting which includes sorting on dataset variables -(in addition to data source fields) and build in SORT_FIELDS parameter -to control sorting criteria at runtime; - -- new „columnDirection” attribute at report level to allow filling -multi-column reports from right to left; - -- various XLS/XLSX export enhancements which include controlling the -sheet's direction (RTL), protecting its content, fitting its size for printing, -and setting other print related metadata; - -- upgrade to POI 3.6 and and JExcelApi 2.6.10; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.7.4 (2010-07-20, SVN 3911) ---------------------------------------------- - -- new spider/radar chart added as custom component; - -- the scope of the "frames as nested tables" configuration properties was extended -to frame element level; - -- new entries added to Sample Reference documentation; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.7.3 (2010-06-01, SVN 3846) ---------------------------------------------- - -- support for images and hyperlinks added to the XLSX exporter; - -- support for line spacing and hyperlinks added to the PPTX exporter; - -- support for hyperlinks and local anchors in the POI-based XLS exporter; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.7.2 (2010-04-12, SVN 3736) ---------------------------------------------- - -- new table component added to simplify designing tables with variable number of columns; - -- new PPTX exporter added to the core library to help creating PowerPoint 2007 documents -based on the Office Open XML format; - -- upgrade to Java 5.0; starting with this release, JasperReports is no longer compatible -with Java 1.4 and makes use of newer language features such as generics and typed enums; - -- simple XML-DOM-based font extension implementation added to eliminate the dependency on Spring -brought by the previous font extension default implementation; - -- code generating utility class added (JRApiWriter) to help users understand how to use -the JasperReports API and its report object model to create report templates at runtime (no JRXML); - -- the Flash viewer was added to the demo/samples/webapp sample; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.7.1 (2010-02-01, SVN 3367) ---------------------------------------------- - -- new JRHtmlExporterParameter.ZOOM_RATIO exporter added to allow scaling the content generated -by the HTML and the XHTML/CSS exporters; - -- upgrade to POI 3.5 and iText 2.1.7; - -- the custom Ant task for batch updating report template files was moved from community project -to core library; - -- new custom Ant task for decompiling report templates; it allows regenerating the source JRXML -files from compiled report templates files. - -- added support for documenting the samples and automatically create the Sample Reference document, -as part of the project build process; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.7.0 (2009-12-08, SVN 3227) ---------------------------------------------- - -- generic element export handler support was added to all built-in exporters; - -- fixes were made in the text exporter and new configuration properties were added -to help configure the text exporter globally, or at report level; - -- custom property "net.sf.jasperreports.export.html.id" added at element level -to allow specifying the ID attribute for elements when exported to HTML and XHTML/CSS format; - -- new export parameter and configuration property added to ignore cell background -color in the XLS/XLSX exporters; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.6.2 (2009-11-23, SVN 3215) ---------------------------------------------- - -- new "footerPosition" attribute added to report groups to control the rendering -position of the group footer sections; - -- new "keepTogether" boolean flag added to report groups to prevent groups from -splitting across two pages or columns, but only on their first break attempt; - -- new tag added to crosstab group definitions to allow -sorting the crosstab by measure totals; - -- axis tick labels in charts can now be rotated using the new "verticalTickLabels" -flag (for numeric or datetime axis) or at an angle, using the new "labelRotation" -numeric attribute (for category axis); - -- minor bug fixes and improvements; - - - - - -JasperReports 3.6.1 (2009-10-26, SVN 3170) ---------------------------------------------- - -- enhanced font extension support to allow mapping JVM available fonts -with PDF built-in fonts; - -- exporter font mapping support added to font extensions, which deprecates -the former FONT_MAP exporter parameter; - -- net.sf.jasperreports.awt.ignore.missing.font configuration property added -to control font availability verifications during report filling and report -AWT rendering; - -- new JAR containing default font extension was added to the JasperReports -project build process as well as the distribution files; - -- new XLS data source implementation added, to support filling reports -using data coming from Excel 95, 97, 2000, XP, and 2003 workbooks; - -- new XLSX exporter added to the core library to help creating Excel 2007 -documents based on the Office Open XML format; - -- new OpenDocument Spreadsheet exporter added (ODS); - -- new "isSummaryWithPageHeaderAndFooter" attribute added to the report template -definition, to allow rendering the summary page together with the page footer -and page header bands; - -- new "printOrder" attribute added to list component, to support horizontal -filling of lists, in addition to vertical filling; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.6.0 (2009-08-31, SVN 3038) ---------------------------------------------- - -- upgrading the JasperReports license to Version 3 of the -GNU LESSER GENERAL PUBLIC LICENSE (http://www.gnu.org/licenses/lgpl.txt); - -- fixed JRXlsExporter to avoid creating invalid XLS files for large reports -(tracker #0004014); - -- fixed JRRtfExporter font table section (tracker #0004169); - -- fixed hyperlink encoding in JRDocxExporter (tracker #0004252); - -- minor bug fixes and improvements; - - - - - -JasperReports 3.5.3 (2009-07-29, SVN 2990) ---------------------------------------------- - -- new DOCX exporter added to the core library to help creating Word 2007 documents -based on the Office Open XML format; - -- new XLSX exporter provided as a separate sample to those who want to make use of -the XLSX (Excel 2007) generating capabilities of POI 3.5 Beta; - -- new XHTML/CSS exporter added to core library to avoid the grid exporter limitations -of the classic HTML exporter; - -- new JDBC-related configuration properties introduced to allow fine-tuning the SQL query execution; - -- tag added to properties in the Config Reference documentation; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.5.2 (2009-06-03, SVN 2856) ---------------------------------------------- - -- the report detail, the group headers and the group footers are now -multi-band sections, meaning that their content can be distributed into -several bands, having similar rendering behavior; - -- new "splitType" attribute available at band level, to control the band -breaking policy; this new attribute deprecates the "isSplitAllowed" attribute; - -- two new production-ready barcode components that use the Barbecue library -and the Barcode4J library, respectively; - -- all configuration properties are now fully documented in a source XML file that -is used to produce a complete and up-to-date HTML configuration reference; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.5.1 (2009-05-05, SVN 2762) ---------------------------------------------- - -- list component added to simplify iteration through datasets -without using a subreport; - -- support for generic element PDF handlers to allow customizing -PDF output using generic elements; - -- the report template structure and syntax (JRXML) are now fully -documented using the comments from the source XSD file to produce -a complete and up-to-date HTML schema reference; - -- option to save line break positions at fill/measure time and -use them during HTML export in order to preserve word wrap; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.5.0 (2009-03-25, SVN 2712) ---------------------------------------------- - -- new min/max expressions available for controlling the displayed values -interval for both chart axis; - -- the pie dataset now supports multiple series; this is useful in cases where -multiple categories are added to the pie dataset in one incrementation step; - -- new attributes and expressions where added to the pie dataset to allow limiting -the number of slices displayed in the pie chart by grouping smaller slices under -a single generic slice called "Other"; - -- new "runToBottom" attribute available for subreport elements to specify if -the subreport should consume all the available space on the current page; - -- the "net.sf.jasperreports.allow.element.overlap" property can be used globally, -at report or element level to specify whether element overlapping verifications -are performed at report compilation time; this is useful when designing reports -that are to be exported using grid exporters such as HTML and XLS, -where overlapping elements do not show up; - -- support for ordered lists added in the HTML markup text processor; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.1.4 (2009-02-10, SVN 2607) ---------------------------------------------- - -- allow any value as hyperlink target to support open hyperlinks -into named frames; - -- custom hyperlink targets can be generated at runtime using -hyperlink target producers; - -- custom hyperlink producers and hyperlink target producers -can be deployed as extensions; - -- multiple scriptlet instances allowed per report execution; - -- support for report governors to prevent infinite loops caused by -invalid report templates; - -- simple report governor implementations based on maximum -number of pages and timeout; - -- new JASPER_REPORT built-in parameter to give access to the report -template object in report expressions and scriptlets; - -- chart element live preview in design mode; - -- improved XML-based chart theme model to support the creation of -a visual chart theme designer; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.1.3 (2009-01-12, SVN 2526) ---------------------------------------------- - -- font extensions support to allow using TTF files without the need to install -them into the system; this also allows using different TTF files for the same -logical font name, depending on the locale; - -- primitive type chart properties replaced with equivalent object type properties -to allow chart theme implementations to check if they were set or not; - -- XML based chart theme implementations provided with the charts sample; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.1.2 (2008-11-04, SVN 2458) ---------------------------------------------- - -- new report compiler based on the Rhino library to support JavaScript -as the report expression language; - -- simplified configuration for custom query executers, which can register -themselves to a JasperReports deployment using the library's extensions support; - -- new custom properties available at report level and element level, -to mark document structure and produce produce PDF output that is compliant -with Section 508 Amendment to the Rehabilitation Act of 1973, which governs -accessibility of software solutions for people with disabilities. - -- new TrueType font files (DejaVu fonts) are shipped with the sample reports; - -- new chart theme implementation (name eye.candy.sixties) shipped with -the charts samples, to show how chart themes can be used to change the overall -appearance of charts generated with the build-in chart element; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.1.0 (2008-09-17, SVN 2367) ---------------------------------------------- - -- chart themes support to allow changing the overall appearance -of charts generated with the build-in chart element; - -- deprecation of DTD based JRXML validation and introduction of -XML schema based JRXML validation; - -- generic component support to allow extending the functionality of the -JasperReports engine by plugging-in custom-made visual components that -would take data as input and produce content that is embedded into the -resulting documents; - -- support for generic print elements in generated documents to allow -introducing custom exporter content; - -- introducing generic report design elements to simplify creation of -custom exporter content, without implementing full-blown components; - -- extension support added in order to simplify configuring various -JasperReports extension points such as chart themes and generic components; - -- new "labelFormat" and "legendLabelFormat" properties available for pie -and pie 3D chart plots to allow controlling the labels for pie charts -without need for chart customizer; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.0.1 (2008-08-07, SVN 2263) ---------------------------------------------- - -- new Gantt chart type added; - -- support for item hyperlinks in multi-axis charts; - -- new Swing report viewer component, with enhanced plugability -and reusability (the page viewer and its toolbar can be separated); - -- new possible values (RealHeight and RealSize) for the "scaleImage" -attribute of the image elements; - -- support for pluggable exporter filter factories in addition -to the existing FILTER exporter parameter; - -- new exporter filter implementation for filtering out content -based on the element's key property; - -- password protection for the XLS files generated with -the JExcelApi-based exporter; - -- the Javaflow-based distributed JAR has the JRContinuationSubreportRunnerFactory -configured as the default subreport runner factory; - -- minor bug fixes and improvements; - - - - - -JasperReports 3.0.0 (2008-05-19, SVN 2200) ---------------------------------------------- - -- support for custom properties at element level in generated documents, -to allow extending exporter functionality; - -- custom element properties can have expressions as values (dynamic values); - -- support for XLS cell formula, using the "net.sf.jasperreports.export.xls.formula" -custom property at element level; - -- better control over sheet breaks in XLS exporters using the new custom element -properties called "net.sf.jasperreports.export.xls.break.before.row" and -"net.sf.jasperreports.export.xls.break.after.row"; - -- new configuration property called "net.sf.jasperreports.export.legacy.border.offset" -to allow rendering element borders in older reports using the legacy border offset -technique that was used in versions prior to the 2.0.3 release. - -- support for "Parent" and "Top" as hyperlink targets; - -- enhanced XML exporter and new XML exporter servlet added to facilitate viewing -reports using the JasperReports Flash Viewer component -(http://jasperforge.org/sf/projects/jasperreports-flash); - -- new experimental XMLSS exporter (XML Spreadsheet Format) that allows streaming -content while generating the document and thus avoid memory problems with -very large reports; - -- minor bug fixes and improvements; - - - - - - -JasperReports 2.0.5 (2008-03-12, SVN 2137) ---------------------------------------------- - -- support for RTF and HTML snippets inside text elements using new "markup" attribute -that deprecates the former isStyledText attribute; - -- new "renderType" chart attribute and configuration property, to support rendering charts as images -or as SVG, besides the direct drawing performed by the JFreeChart components; - -- new FileResolver interface and built-in parameter for better control over resource loading; - -- minor bug fixes and improvements; - - - - - -JasperReports 2.0.4 (2008-01-11, SVN 2065) ---------------------------------------------- - -- support for Dotted and Double line style added; - -- warning messages added to signal the use of deprecated pen and box -attributes and tags in JRXML; all samples refactored; - -- minor bug fixes and improvements; - - - - - -JasperReports 2.0.3 (2007-12-12) ------------------------------------ - -- the default value of the deprecated JRXlsExporterParameter.IS_AUTO_DETECT_CELL_TYPE -exporter parameter is now "false"; the newer IS_DETECT_CELL_TYPE exporter parameter -should be used to control the cell types in the generated XLS documents; - -- exporter filter support added to all exporters, including support for -origin exporter filter hints; - -- refactored RTF exporter to remove limitations related to Unicode texts and RTL writing; - -- change events handling and clone support in the report template object model; - -- custom properties support for report templates elements; - -- support for pluggable text measurers, to allow simpler and faster implementations; - -- support for keeping the entire original text for text elements that do not -stretch; the full text is used in data-oriented exporters such as XLS and CSV; - -- support for truncating texts at character (not word); - -- support for text truncation suffix (i.e. adding ellipses at the end); - -- new JRPen and JRLineBox interfaces added to support rendering of an unlimited -number of line width/style combinations; - -- minor bug fixes and improvements; - - - - - -JasperReports 2.0.2 (2007-10-09) ------------------------------------ - -- support for element origin information in generated documents; - -- support for exporter element filtering based on element origin; - -- minor bug fixes and improvements; - - - - - -JasperReports 2.0.1 (2007-08-24) ------------------------------------ - -- support for custom properties in generated documents (JasperPrint objects); - -- predefined JasperPrint custom properties used as exporter hints; - -- new configuration properties for setting exporter parameter default values; - -- new configuration properties for mapping report compilers to expression languages; - -- minor bug fixes and improvements; - - - - - -JasperReports 2.0.0 (2007-08-14) ------------------------------------ - -- support for reusable external report styles, through style templates; - -- new noData section introduced for better control over reports or subreports filled -with empty data sources; - -- faster XML data source using Jaxen added; - -- current bean mapped to the report field called _THIS, in bean data sources; - -- new export parameters available for generating a more data-centric XLS documents; - -- custom color palette creation for JExcelApi exporter; - -- the BeanShell report compiler moved back to core library; - -- upgrade to Mondrian 2.3.2; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.3.4 (2007-06-11) ------------------------------------ - -- new "runDirection" attribute available for crosstabs to enable right-to-left rendering policy; - -- support for large documents in the ODT exporter; - -- security checks enabled for custom code execution during report generation; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.3.3 (2007-04-30) ------------------------------------ - -- support for inner classes and arrays in report template types (parameters, fields, variables) -and custom classes associated with the report template (scriptletClass, formatFactoryClass, etc); - -- minor bug fixes and improvements; - - - - - -JasperReports 1.3.2 (2007-03-30) ------------------------------------ - -- new Open Document Format exporter added (beta version); - -- enhanced RTF exporter; - -- improved error handling during report compilation to help detecting -the source of the problem; - -- support for custom name/value pair properties for report fields -and report parameters; - -- new $X{} syntax available and recursive expansion of $P!{} parameter -references in the tag to help building dynamic queries; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.3.1 (2007-02-21) ------------------------------------ - -- stacked area chart support added; - -- style properties inheritance for charts; - -- XMLA query executer mapped by default to the "mdx" and "MDX" query languages, -just like the MDX query executer; the latter takes precedence; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.3.0 (2006-12-22) ------------------------------------ - -- new XMLA data source implementation added to support reporting using OLAP engine -through a Web Services interface; - -- new element to better control page and column breaks in reports; - -- improved image loading and image encoding processes as well as full support -for transparent images; - -- enhanced support for localization in the XML and CSV data sources; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.2.8 (2006-11-14) ------------------------------------ - -- support for sorting the data source using new tags in JRXML; -if such tags are present, an intermediate JRSortableDataSource will wrap -the initial report data source and perform in-memory sorting before the -records are fed into the report filling process; - -- upside down text rotation; - -- new report template property (formatFactoryClass) and built-in parameter -(REPORT_FORMAT_FACTORY) to allow the use of custom date and number formatters; - -- new exporter parameter (FORCE_SVG_SHAPES) and configuration property -(net.sf.jasperreports.export.pdf.force.svg.shapes) to disable the rendering -of SVG images using shapes in PDF and reduce file size; - -- new exporter parameter (MINIMIZE_PRINTER_JOB_SIZE) and configuration property -(net.sf.jasperreports.export.graphics2d.min.job.size) to disable the printer job -size optimization and allow full support for bidirectional writing; - -- new exporter parameter (FORMAT_PATTERNS_MAP) to allow translating the text field -patterns to XLS exporter specific cell format patterns; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.2.7 (2006-09-21) ------------------------------------ - -- extended support for charts including new chart types: -meter chart, thermometer chart and multi-axis charts; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.2.6 (2006-09-03) ------------------------------------ - -- enhanced hyperlink support for text elements, images and charts; -hyperlinks per chart items for enhanced drill-through support; - -- support for superscript and subscript in styled text; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.2.5 (2006-07-11) ------------------------------------ - -- new filter expression added to filter out records in a data source; - -- "increment when" expression to filter out data in chart and crosstab datasets; - -- new IS_DETECT_CELL_TYPE exporter parameter available for the XLS exporters, -to allow setting the correct cell data type in worksheets; -the former IS_AUTO_DETECT_CELL_TYPE is now deprecated; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.2.4 (2006-06-23) ------------------------------------ - -- new distinct count calculation supported; - -- new REPORT_TIME_ZONE built-in parameter added to fully control date formatting; - -- new FORCE_LINEBREAK_POLICY exporter parameter to force the PDF exporter to use -the same line break policy as in AWT; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.2.3 (2006-05-30) ------------------------------------ -- support for OLAP and MDX queries using Mondrian-based -query executer and data source implementations; - -- support for EJBQL using JPA-based query executer implementation -(contribution by Marcel Overdijk); - -- GZIP in-memory virtualizer -(contributed by John Bindel, Works Inc.); - -- new single/swap file virtualizer; - -- support for shared file virtualizer; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.2.2 (2006-04-23) ------------------------------------ -- the use of threads is no longer mandatory for the subreport filling process after -introducing a new subreport runner interface and an altenative default implementation -that realies on Javaflow continuations (Jakarta Commons Javaflow library); - -- Groovy report compiler moved to core library; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.2.1 (2006-04-07) ------------------------------------ -- support for URL stream handlers to allow loading resources such as images, -fonts or subreports using customized URL protocols; - -- new isPdfSimulatedBold and isPdfSimulatedItalic attributes available -for the PDF exporter font mappings; - -- serialVersionUID frozen at 10200; this will no longer be incremented -with every new release; - -- JExcelApi exporter moved to core library; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.2.0 (2006-02-06) ------------------------------------ -- support for other query languages including HQL and XPath implementations; - -- new evaluation time "Auto" available for text fields enabling -new types of calculations such as percentage; - -- CSV datasource; - -- conditional styles; - -- crosstab total variables to allow combining data at different -aggregation levels (percentages, etc); - -- serialization of virtualized reports; - -- the built-in HTML exporter now produces XHTML-compatible output; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.1.1 (2005-11-28) ------------------------------------ -- support for crosstab cell vertical stretch; - -- access to report data from chart customizer implementations by -extending new JRAbstractChartCustomizer class; - -- support for Java 1.5 in the JDT-based report compiler; - -- new "isIgnorePagination" attribute available at report template level; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.1.0 (2005-10-21) ------------------------------------ -- support for report styles that can be referenced by elements to inherit -visual properties such as font, color, border, etc; report fonts are now deprecated; - -- new frame element added to support grouping other report element together; - -- new dataset concept that comprises parameter, field, variable and group -declarations and represents a mixture between a data source and a subreport -to help iterating through data for chart and crosstab generation; - -- support for crosstabs added using a specialized component; - -- new XLS exporter implementation that uses the Java Excel Api open source library is -available as a sample; contributed by Manuel Paul (Rat & Tat Beratungsgesellschaft mbH); - -- minor bug fixes and improvements; - - - - - -JasperReports 1.0.3 (2005-10-10) ------------------------------------ -- new J2EE module added to the core library including servlets for image -delivery in HTML format, PDF, XLS and RTF generation; - -- new REPORT_CLASS_LOADER built-in fill time parameter and new CLASS_LOADER export time -parameter to allow extending the way resources such as images, fonts and subreports -are located at runtime; - -- support for detecting the image type inside JRRenderable instances using an image type sniffer; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.0.2 (2005-09-07) ------------------------------------ -- fixes the bug introduced in the 1.0.1 version related to the subreports caching -(see http://sourceforge.net/tracker/index.php?func=detail&aid=1277217&group_id=36382&atid=416703); - -- support for simple HTML tags like , , , and
  • inside styled texts; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.0.1 (2005-08-26) ------------------------------------ -- further chart element customization possible using a new JRChartCustomizer interface -and the "customizerClass" attribute available for charts; - -- new RTF and plain text exporters added; - -- new FONT_MAP exporter parameter introduced to allow export-time font mappings and -better control of font translation during document export; - -- support for generating PDF bookmarks from report anchors using a new "bookmarkLevel" -attribute available for hyperlink elements; - -- new IS_IGNORE_PAGINATION built-in parameter for disabling pagination and allow -creating flow-based documents instead of page-based documents; - -- minor bug fixes and improvements; - - - - - -JasperReports 1.0.0 (2005-07-20) ------------------------------------ -- built-in support for charts added; a new chart component was added to simplify the -rendering of the following types of charts: Pie, Pie 3D, Bar, Bar 3D, XY Bar, Stacked Bar, -Stacked Bar 3D, Line, XY Line, Area, XY Area, Scatter Plot, Bubble, Time series, -High Low Open Close, Candlestick; - -- support for generating very large reports using serialization on disk to minimize memory -consumption during the filling and exporting processes -(report virtualizer, contributed by John Bindel, Works Inc.); - -- report fields can be of any type, just like report parameters and report variables. -This simplifies working with JavaBean data sources where casting from java.lang.Object -to the actual report field class is no longer required in the expressions; - -- when using $P{REPORT_SCRIPTLET} in expressions, specific cast to the actual scriptlet -class is no longer needed; - -- new attribute "whenResourceMissingType" for customizing the behavior of the engine -when it deals with missing resources in the associated resources bundle; - -- support for CLOB and BLOB report fields in JRResultSetDataSource; - -- support for PDF font registration using properties file; - -- simplified support for returning values from subreport; - -- new possible value (Band) for the "evaluationTime" property of text fields, images and charts -to allow postponing their expression evaluation until the end of the parent band rendering -in order to simplify the use of values returned from subreports; - -- support for canceling the report filling process, including the cancellation of the -report query execution through JDBC (see the AsynchronousFillHandle class); - -- minor bug fixes and improvements; - - - - - -JasperReports 0.6.8 (2005-05-31) ------------------------------------ -- fixes the bug introduced in the 0.6.7 version related to the way -variables are incremented and group breaks estimated -(see http://sourceforge.net/tracker/index.php?func=detail&aid=1207897&group_id=36382&atid=416703); - -- minor bug fixes and improvements; - - - - -JasperReports 0.6.7 (2005-05-16) ------------------------------------ -- new REPORT_MAX_COUNT built-in parameter for limiting -the number of rows in the data source; - -- dots, spaces and other special characters allowed -in parameter, field and variable names; - -- minor bug fixes and improvements; - - - - -JasperReports 0.6.6 (2005-04-06) ------------------------------------ -- new "incrementType" and "incrementGroup" attributes added to allow -incrementing variable values on page, column or group breaks and not -with every detail row; - -- new "language" attribute added to allow writing report expressions -in other languages, provided that a report compiler that knows how to -interpret the specified language is used; - -- new Groovy report compiler added as a sample to allow using the -Groovy language and its simplified syntax inside report expressions; - -- the JRBshCompiler has been removed from the core library and provided -as a separate sample; - -- minor bug fixes and improvements; - - - - -JasperReports 0.6.5 (2005-02-27) ------------------------------------ -- JasperReports licensing model has been simplified and the library -will be shipped only under the "GNU Lesser Public License" (LGPL); - -- new "onErrorType" and "isLazy" attributes for image elements -to allow customizing the engine's behavior for loading and displaying images; - -- new sample showing how to use the JasperReports library inside a J2EE application -running on the JBoss Application Server; - -- minor bug fixes and improvements; - - - - -JasperReports 0.6.4 (2005-01-16) ------------------------------------ -- new report compiler that uses the Eclipse JDT Java compiler for faster compilation -and simpler deployment; - -- minor bug fixes and improvements; - - - - -JasperReports 0.6.3 (2004-11-29) ------------------------------------ -- new tag available for putting border around text and image elements -with independent properties such as color, style and padding on all four sides; - -- new "isFloatColumnFooter" attribute to allow printing the column footer section -right after the detail lines and not only at the bottom of the page; - -- new global OFFSET_X and OFFSET_Y exporter parameters that can be used to move -all the elements on a page when exporting the generated document; - -- minor bug fixes and improvements; - - - - -JasperReports 0.6.2 (2004-11-14) ------------------------------------ -- added support for import statements in order to eliminate -the need to use complete class names inside report expressions; - -- new "resourceBundle" attribute and new build-in REPORT_LOCALE and -REPORT_RESOURCE_BUNDLE report parameters, to allow associating -a ResourceBundle and a Locale with the report design when filling it with data; - -- new $R{...} syntax available inside report expressions to access the -resource bundle information based on resource keys; - -- new built-in msg() and str() functions to allow formatting messages in -different languages inside the report expressions; - -- support for right-to-left writing (like Arabic and Hebrew); - -- new "hyperlinkTarget" attribute available for hyperlink elements -in order to allow opening documents in a new window; - -- minor bug fixes and improvements; - - - - -JasperReports 0.6.1 (2004-08-30) ------------------------------------ -- new "lastPageFooter" report section added to simplify the creation of some -special report designs; - -- new sample "barbecue" added to show how to render barcodes using -the Barbecue open source library; - -- new "Go To Page" option available in the viewer's toolbar; - -- minor bug fixes and improvements; - - - - -JasperReports 0.6.0 (2004-07-24) ------------------------------------ -- the package name hierarchy has changed throughout the entire library. -The now obsolete root package called "dori.jasper" was replaced by "net.sf.jasperreports" -for standardization reasons; - -- new net.sf.jasperreports.engine.JRRenderable interface supported in the image expression -to improve the quality of charts and other SVG images. The patch, initially proposed by -Adrian Jackson, David Taylor and Lars Kristensen, was incorporated in the main version; - -- added support for batch export through the use of the new exporter parameter -JRExporterParameter.JASPER_PRINT_LIST, which accepts a list containing JasperPrint objects -(contribution by Jason Essington); - -- new XPath based XML data source implementation provided. The "xmldatasource" sample shows -how the net.sf.jasperreports.engine.data.JRXmlDataSource can be used in combination -with subreports (contribution by Peter Severin); - -- minor bug fixes and improvements; - - - - -JasperReports 0.5.3 (2004-05-18) ------------------------------------ -- new boolean "isStyledText" attribute available for text elements to allow -introducing style information inside the text content using XML syntax based on -nested - - - - - - - - - - - - - - - - - - - - - - - -
    - -JasperReports-Ultimate-Guide-3.pdfJasperReports Ultimate Guide - -sample.reference.htmlSample Reference - -schema.reference.htmlSchema Reference - -config.reference.htmlConfiguration Reference - -http://community.jaspersoft.com/wiki/jasperreports-library-faqsFAQ - -index.htmlAPI (Javadoc) -
    -
    -
    -
    -JasperReports - Components Schema Reference (version ) - - -
    -
    -
    - -
    - -This document describes the JRXML structure of the built-in components for the JasperReports Library. - - - - - - - - - - - - - - - - - - - - -


    -
    Other JasperReports Library Schemas
    -
    - Report Schema Reference -
    - Report Parts Schema Reference -
    -
    Components Schema Reference
    -
    - - - - - -
    - - - # - - - - - - - - - (in ) - (in ) - - -
    - - </td><td> - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -






    - - - - - - top


    - - - - - - top

    -

    Attributes



    - © 2001- TIBCO Software Inc. www.jaspersoft.com -
    - - - - - - - - - - - - -
    Attributes
    - - -
    -
    - - - - - - - - - - -
    Parent type:
    schema.reference.html#_blank. - -
    - - - - - - - - -
    Attributes
    - - -
    -
    - - - - -
    Contains
    - - -
    - - - - - - - - - - - - - - - - - -

    -
    - - - - - - - - -
    -
    - - - - - - - - - #<> - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - -
    - - - - # - - - - # - - - - # - - - attribute - - - - - - - - Type: - - - - Use: - - - - - Values - - - - - - -
    - - -
    - - - - Values - - - - - - -
    - - -
    - - - - Values - - - - - - -
    - - -
    - - - - Default: - - - -
    - - - - - - - - # - - - - - - - - schema.reference.html# - _blank - - - - *? - - - - - - - - - ( - - - - # - - - - - - schema.reference.html# - _blank - - - *? - - - - (in ) - (in ) - - - - - | - )*? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru jasperreports-6.2.2/docs/config.reference.xml jasperreports-6.3.1/docs/config.reference.xml --- jasperreports-6.2.2/docs/config.reference.xml 2016-05-03 12:21:03.000000000 +0000 +++ jasperreports-6.3.1/docs/config.reference.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,5671 +0,0 @@ - - - - - - - - Data Source / Query Executer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Report Compilation - - - - - - - - - - - - - Report Design - - - - - - - - - - - - Report Filling - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Governors - - - - - - - - - - Crosstabs - - - - - - - - - - - Barcode Component - - - - - - - - - Map Component - - - - - - - - - - Table Component - - - - - - - - - - - - - - - - - - Chart Themes - - - - - - - - - - - - - - Report Export - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - JasperReports Extensions - - - - - - - - - JasperReports Repository - - - - - - - - Other - - - - - - - - - - - - - - - - - - - - - - - -Property that references the parameter containing the bookmarks data source. - - net/sf/jasperreports/parts/subreport/SubreportFillPart.html#PROPERTY_BOOKMARKS_DATA_SOURCE_PARAMETER - N/A - Part - 6.0.0 - - - - - - - -Property having this prefix hold the comma separated names of the columns to be extracted from the CSV source. - - net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_COLUMN_NAMES - N/A - Global | Dataset - 4.0.0 - - - - - - - -Property holding the value of the date format pattern to be used when parsing the CSV data. - - net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_DATE_PATTERN - N/A - Global | Dataset - 4.0.0 - - - - - - - - - net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_ENCODING - N/A - Global | Dataset - 4.0.0 - - - - - - - - - net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_FIELD_DELIMITER - , - Global | Dataset - 4.0.0 - - - - - - - - - net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_LOCALE_CODE - N/A - Global | Dataset - 4.0.0 - - - - - - - -Property holding the value of the number format pattern to be used when parsing the CSV data. - - net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_NUMBER_PATTERN - N/A - Global | Dataset - 4.0.0 - - - - - - - - - net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_RECORD_DELIMITER - \n - Global | Dataset - 4.0.0 - - - - - - - - - net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_SOURCE - N/A - Global | Dataset - 4.0.0 - - - - - - - - - net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_TIMEZONE_ID - N/A - Global | Dataset - 4.0.0 - - - - - - - -A report/dataset level property that provides the location of a data adapter resource to be used for the dataset. - - net/sf/jasperreports/data/DataAdapterParameterContributorFactory.html#PROPERTY_DATA_ADAPTER_LOCATION - N/A - Global | Dataset - 4.1.1 - - - - - - - -Properties with this prefix introduce JPA implementation specific EJBQL query hints to be used by the -JRJpaQueryExecuter. The suffix is the name of the hint, as documented by the specific JPA implementation. - - net/sf/jasperreports/engine/query/JRJpaQueryExecuterFactory.html#PROPERTY_JPA_QUERY_HINT_PREFIX - N/A - Dataset - 1.2.3 - - - - - - - -Property specifying the number of result rows to be retrieved at once. Result pagination is implemented by -javax.persistence.Query.setFirstResult() and javax.persistence.Query.setMaxResults(). -
    -By default, all the rows are retrieved (no result pagination is performed). -
    - net/sf/jasperreports/engine/query/JRJpaQueryExecuterFactory.html#PROPERTY_JPA_QUERY_PAGE_SIZE - 0 - Global | Dataset - 1.2.3 -
    - - - - - - -Property specifying whether Hibernate session cache should be cleared between two consecutive fetches when using pagination. -
    -By default, the cache cleanup is not performed. -
    - net/sf/jasperreports/engine/query/JRHibernateQueryExecuterFactory.html#PROPERTY_HIBERNATE_CLEAR_CACHE - false - Global | Dataset - 1.3.1 -
    - - - - - - -Property specifying whether field descriptions should be used to determine the mapping between the fields and the query return values. -
    -By default, field description are used. -
    - net/sf/jasperreports/engine/query/JRHibernateQueryExecuterFactory.html#PROPERTY_HIBERNATE_FIELD_MAPPING_DESCRIPTIONS - true - Global | Dataset - 1.2.0 -
    - - - - - - -Property specifying the number of result rows to be retrieved at once when the execution type is list. -Result pagination is implemented by org.hibernate.Query.setFirstResult() and org.hibernate.Query.setMaxResults(). -By default, all the rows are retrieved (no result pagination is performed). - - net/sf/jasperreports/engine/query/JRHibernateQueryExecuterFactory.html#PROPERTY_HIBERNATE_QUERY_LIST_PAGE_SIZE - 0 - Global | Dataset - 1.2.0 - - - - - - - -Property specifying the Hibernate query execution type. Possible values are: -
      -
    • list - the query will be run by calling org.hibernate.Query.list()
    • -
    • iterate - the query will be run by calling org.hibernate.Query.iterate()
    • -
    • scroll - the query will be run by calling org.hibernate.Query.scroll()
    • -
    -
    - net/sf/jasperreports/engine/query/JRHibernateQueryExecuterFactory.html#PROPERTY_HIBERNATE_QUERY_RUN_TYPE - list - Global | Dataset - 1.2.0 -
    - - - - - - -Flag property specifying if data will be stored in a cached rowset. - - net/sf/jasperreports/engine/query/JRJdbcQueryExecuterFactory.html#PROPERTY_CACHED_ROWSET - false - Global | Dataset - 4.1.2 - - - - - - -Property specifying the fetch size for the java.sql.ResultSet created by the -JRJdbcQueryExecuter and the -JRHibernateQueryExecuter. - - net/sf/jasperreports/engine/query/JRJdbcQueryExecuterFactory.html#PROPERTY_JDBC_FETCH_SIZE - 0 - Global | Dataset - 1.2.0 - - - - - - -Property specifying the type for the java.sql.ResultSet created by the -JRJdbcQueryExecuter. Possible values are: -
      -
    • forwardOnly - the cursor may move only forward.
    • -
    • scrollInsensitive - the result set is scrollable but generally not sensitive to changes made by others.
    • -
    • scrollSensitive - the result set is scrollable and generally sensitive to changes made by others.
    • -
    -
    - net/sf/jasperreports/engine/query/JRJdbcQueryExecuterFactory.html#PROPERTY_JDBC_RESULT_SET_TYPE - forwardOnly - Global | Dataset - 3.5.3 -
    - - - - - -Property specifying the concurrency rule for the java.sql.ResultSet created by the -JRJdbcQueryExecuter. Possible values are: -
      -
    • readOnly - the concurrency mode for a ResultSet object that may NOT be updated.
    • -
    • updatable - the concurrency mode for a ResultSet object that may be updated.
    • -
    -
    - net/sf/jasperreports/engine/query/JRJdbcQueryExecuterFactory.html#PROPERTY_JDBC_CONCURRENCY - readOnly - Global | Dataset - 3.5.3 -
    - - - - - -Property specifying the cursor holdability after commit for the java.sql.ResultSet created by the -JRJdbcQueryExecuter. Possible values are: -
      -
    • hold - indicates that ResultSet objects should not be closed when the method Connection.commit() is called.
    • -
    • close - indicates that ResultSet objects should be closed when the method Connection.commit() is called.
    • -
    -
    - net/sf/jasperreports/engine/query/JRJdbcQueryExecuterFactory.html#PROPERTY_JDBC_HOLDABILITY - hold - Global | Dataset - 3.5.3 -
    - - - - - -Property specifying the limit for the maximum number of bytes in a ResultSet column -storing character or binary values created by the -JRJdbcQueryExecuter. - - net/sf/jasperreports/engine/query/JRJdbcQueryExecuterFactory.html#PROPERTY_JDBC_MAX_FIELD_SIZE - N/A - Global | Dataset - 3.5.3 - - - - - - -Property that specifies the list of token separators characters for TYPE_CLAUSE_TOKENS tokenized query clauses. - - net/sf/jasperreports/engine/JRQueryChunk.html#PROPERTY_CHUNK_TOKEN_SEPARATOR - , ; | - Global - 2.0.5 - - - - - - - - -Properties with this prefix associate a query executer factory implementation with a query language. -To obtain query executer factories, a property having the query language appended to this prefix is used to get the query executer factory name. - - net/sf/jasperreports/engine/query/QueryExecuterFactory.html#QUERY_EXECUTER_FACTORY_PREFIX - N/A - Global - 1.2.0 - - - - - - - -Property specifying the -JRXPathExecuterFactory XPath executer factory implementation class name. JasperReports is shipped with two implementation of this factory interface: -XalanXPathExecuterFactory and -JaxenXPathExecuter. - - net/sf/jasperreports/engine/util/xml/JRXPathExecuterUtils.html#PROPERTY_XPATH_EXECUTER_FACTORY - net.sf.jasperreports.engine.util.xml.XalanXPathExecuterFactory - Global - 2.0.0 - - - - - - - -Prefix for properties that map report compilers to expression languages. -
    -Properties having this prefix indicate the JRCompiler implementation to be used when compiling -report designs that rely on the expression language specified as property suffix. -
    - net/sf/jasperreports/engine/design/JRCompiler.html#COMPILER_PREFIX - net.sf.jasperreports.engine.design.JRJdtCompiler, if available; net.sf.jasperreports.engine.design.JRJdk13Compiler otherwise.
    Java is considered the default expression language.
    - Global - 2.0.1 -
    - - - - - - -Property specifying the classpath used by the report compiler during the compilation process. - - net/sf/jasperreports/engine/design/JRCompiler.html#COMPILER_CLASSPATH - System.getProperty("java.class.path") - Global - 1.0.0 - - - - - - - -Property specifying whether the temporary source file created by the report compiler should be kept or deleted after the report compilation process ended. - - net/sf/jasperreports/engine/design/JRCompiler.html#COMPILER_KEEP_JAVA_FILE - false - Global - 1.0.0 - - - - - - - -Property specifying the temporary working directory to be used by the report compiler. - - net/sf/jasperreports/engine/design/JRCompiler.html#COMPILER_TEMP_DIR - System.getProperty("user.dir") - Global - 1.0.0 - - - - - - - -Property that forces the XML validation of the report template file before compiling. - - net/sf/jasperreports/engine/xml/JRReportSaxParserFactory.html#COMPILER_XML_VALIDATION - true - Global - 1.0.0 - - - - - - - -Property that determines whether XML schemas/grammars are to be cached -so that they are not read/initialized each time a report is compiled. -
    -Currently, setting this property is only effective when a Xerces XML -parser is used (either a stock one from Apache or one embedded into a -SUN JDK). -
    - net/sf/jasperreports/engine/xml/JRReportSaxParserFactory.html#PROPERTY_CACHE_SCHEMAS - true - Global - 3.1.0 -
    - - - - - - -Property that gives a parser factory class which should be used -for parsing JRXMLs. -
    -By default, this property is set to use JRReportSaxParserFactory -as report parser factory. -
    - net/sf/jasperreports/engine/xml/JRSaxParserFactory.html#PROPERTY_REPORT_PARSER_FACTORY - net.sf.jasperreports.engine.xml.JRReportSaxParserFactory - Global - 3.1.0 -
    - - - - - - -Stores the text sequence used to replace invalid XML characters. -
    -By default, this property is set to replace invalid chars with question marks. Depending on particular needs, the following settings are available: -
      -
    • to completely remove invalid XML chars from the processed text, set an empty string as property value: -
      -<property name="net.sf.jasperreports.export.xml.replace.invalid.chars" value=""/> -
    • -
    • to replace invalid XML chars with a custom char or text sequence, set the text sequence as property value. For instance: -
      -<property name="net.sf.jasperreports.export.xml.replace.invalid.chars" value="^^"/> -
    • -
    • to preserve invalid chars in the processed text, either set the property with no value, or remove the property from the JasperReports context. -Below is the property with no value set: -
      -<property name="net.sf.jasperreports.export.xml.replace.invalid.chars"/> -
    • -
    -
    - net/sf/jasperreports/engine/export/JRXmlExporter.html#PROPERTY_REPLACE_INVALID_CHARS - ? - Global | Report - 4.7.1 -
    - - - - - - -A property that determines whether elements having negative width values are allowed. -
    -If this value is set to false, the report is verified not -to contain elements with negative width values. This is useful when the report is -meant to be exported to grid-based formats such as HTML, XLS or CSV, which might enter -an infinite loop. Having elements with negative widths does not make sense, but allowing -this is a workaround in case older report templates still need to pass validation -at report compile time. -
    - net/sf/jasperreports/engine/design/JRVerifier.html#PROPERTY_ALLOW_ELEMENT_NEGATIVE_WIDTH - false - Global | Report - 3.7.1 -
    - - - - - - -Property that determines whether elements positioned at negative X offsets on bands, frames and other element containers are allowed in a report. -
    -Elements placed at negative X offsets can cause unexpected problems in grid-based exporters where they can overlap elements from previous bands/element containers. -
    -If the property is set to false, elements in the report are verified to have positive X offsets. Otherwise, no check is performed on element X offsets. -
    - net/sf/jasperreports/engine/design/JRVerifier.html#PROPERTY_ALLOW_ELEMENT_NEGATIVE_X - true - Global | Report | Element - 6.1.1 -
    - - - - - - -Property that determines whether elements positioned at negative Y offsets on bands, frames and other element containers are allowed in a report. -
    -Elements placed at negative Y offsets can cause unexpected problems in grid-based exporters where they can overlap elements from previous bands/element containers. -
    -If the property is set to false, elements in the report are verified to have positive Y offsets. Otherwise, no check is performed on element Y offsets. -
    - net/sf/jasperreports/engine/design/JRVerifier.html#PROPERTY_ALLOW_ELEMENT_NEGATIVE_Y - true - Global | Report | Element - 3.7.3 -
    - - - - - - -A property that determines whether elements are allowed to overlap. -
    -If this value is set to false, the report is verified not -to contain elements that overlap. This is useful when the report is -meant to be exported to grid-based formats such as HTML, XLS or CSV. -Setting this property to false ensures that element overlap -issues are caught at report compile time. -
    -Additionally, when this property is set to false false, the -report is verified not to have any content in the background section as -this content would likely be overlapped by other sections and would not -show in grid-based exporters. -
    -By default, the property is set to true which means that -no element overlap checks are performed. -
    -The property can be set at the following levels: -
      -
    • At global level (in jasperreports.properties) to provide a default -value.
    • -
    • At report level, to indicate whether element overlap checks are to -be performed for the report. If not set, the global property value is -used.
    • -
    • At report element level to specify that the particular element is -allowed to overlap or be overlapped by other elements, when the report -or global property determines report element overlap verification. -The element level property is only effective when set to true; -setting the property to false does not make the verifier -check for overlaps when the report is not set to be checked for element -overlaps.
    • -
    -
    -Note that print when expressions or export filters cannot be taken into -consideration while checking for overlapping elements as this check is -performed at report compilation time. -If a report contains two elements that overlap but have print when -expressions that guarantee that only one of them will be printed, -or if export filters are in place to exclude one of the elements, -one of them should be explicitly marked to allow element overlap -when the report is configured to check for overlaps. -
    - net/sf/jasperreports/engine/design/JRVerifier.html#PROPERTY_ALLOW_ELEMENT_OVERLAP - true - Global | Report | Element - 3.5.0 -
    - - - - - - -Properties with this prefix are used in the PropertyStyleProvider class -(which is the default JR implementation of the StyleProvider interface) -to configure dynamic style features for report elements. If such a property is found at element level, its value will override the related -style feature of the element. -
    -
    -The following style properties are defined in PropertyStyleProvider class: -
      -
    • Properties for common style attributes: -
        -
        -
      • net.sf.jasperreports.style.mode
      • -
      • net.sf.jasperreports.style.backcolor
      • -
      • net.sf.jasperreports.style.forecolor
      • -
      • net.sf.jasperreports.style.fill
      • -
      • net.sf.jasperreports.style.radius
      • -
      • net.sf.jasperreports.style.scaleImage
      • -
      • net.sf.jasperreports.style.hAlign
      • -
      • net.sf.jasperreports.style.vAlign
      • -
      • net.sf.jasperreports.style.hTextAlign
      • -
      • net.sf.jasperreports.style.vTextAlign
      • -
      • net.sf.jasperreports.style.hImageAlign
      • -
      • net.sf.jasperreports.style.vImageAlign
      • -
      • net.sf.jasperreports.style.rotation
      • -
      • net.sf.jasperreports.style.markup
      • -
      • net.sf.jasperreports.style.isBlankWhenNull
      • -
      • net.sf.jasperreports.style.fontName
      • -
      • net.sf.jasperreports.style.fontSize
      • -
      • net.sf.jasperreports.style.isBold
      • -
      • net.sf.jasperreports.style.isItalic
      • -
      • net.sf.jasperreports.style.isUnderline
      • -
      • net.sf.jasperreports.style.isStrikeThrough
      • -
      • net.sf.jasperreports.style.pdfFontName
      • -
      • net.sf.jasperreports.style.pdfEncoding
      • -
      • net.sf.jasperreports.style.isPdfEmbedded
      • -
      • net.sf.jasperreports.style.pattern - the value of this property is overriden by the <patternExpression/>, if present.
      • -
        -
      -
    • -
    • Properties for pen style attributes: -
        -
        -
      • net.sf.jasperreports.style.pen.lineWidth
      • -
      • net.sf.jasperreports.style.pen.lineStyle
      • -
      • net.sf.jasperreports.style.pen.lineColor
      • -
        -
      -
    • -
    • Properties for box style attributes: -
        -
        -
      • net.sf.jasperreports.style.box.padding
      • -
      • net.sf.jasperreports.style.box.topPadding
      • -
      • net.sf.jasperreports.style.box.leftPadding
      • -
      • net.sf.jasperreports.style.box.rightPadding
      • -
      • net.sf.jasperreports.style.box.bottomPadding
      • -
      • net.sf.jasperreports.style.box.pen.lineWidth
      • -
      • net.sf.jasperreports.style.box.pen.lineStyle
      • -
      • net.sf.jasperreports.style.box.pen.lineColor
      • -
      • net.sf.jasperreports.style.box.top.pen.lineWidth
      • -
      • net.sf.jasperreports.style.box.top.pen.lineStyle
      • -
      • net.sf.jasperreports.style.box.top.pen.lineColor
      • -
      • net.sf.jasperreports.style.box.left.pen.lineWidth
      • -
      • net.sf.jasperreports.style.box.left.pen.lineStyle
      • -
      • net.sf.jasperreports.style.box.left.pen.lineColor
      • -
      • net.sf.jasperreports.style.box.right.pen.lineWidth
      • -
      • net.sf.jasperreports.style.box.right.pen.lineStyle
      • -
      • net.sf.jasperreports.style.box.right.pen.lineColor
      • -
      • net.sf.jasperreports.style.box.bottom.pen.lineWidth
      • -
      • net.sf.jasperreports.style.box.bottom.pen.lineStyle
      • -
      • net.sf.jasperreports.style.box.bottom.pen.lineColor
      • -
        -
      -
    • -
    • Properties for paragraph style attributes: -
        -
        -
      • net.sf.jasperreports.style.paragraph.lineSpacing
      • -
      • net.sf.jasperreports.style.paragraph.lineSpacingSize
      • -
      • net.sf.jasperreports.style.paragraph.firstLineIndent
      • -
      • net.sf.jasperreports.style.paragraph.leftIndent
      • -
      • net.sf.jasperreports.style.paragraph.rightIndent
      • -
      • net.sf.jasperreports.style.paragraph.spacingBefore
      • -
      • net.sf.jasperreports.style.paragraph.spacingAfter
      • -
      • net.sf.jasperreports.style.paragraph.tabStopWidth
      • -
      -
    • -
    -Note: All the above properties are exclusively used to override features of the element's style, and not to define a -new style in the report. Properties such as net.sf.jasperreports.style.name or net.sf.jasperreports.style.style -have no meaning and no effects in this implementation. Conditional styles should be used instead. -
    - net/sf/jasperreports/engine/style/PropertyStyleProvider.html#STYLE_PROPERTY_PREFIX - N/A - Element - 4.8.0 -
    - - - - - - -Specifies whether report styles that do not have a parent specified would rely on the default style as parent for property inheritance. -Before version 6.2.1, styles without parent were not inheriting from default style. - - net/sf/jasperreports/engine/util/StyleResolver.html#PROPERTY_STYLES_INHERIT_FROM_DEFAULT - true - Global - 6.2.1 - - - - - - - -Specifies the default split type for bands. See the splitType attribute of the report band. - - net/sf/jasperreports/engine/JRBand.html#PROPERTY_SPLIT_TYPE - Stretch - Global | Report - 3.5.2 - - - - - - - -Specifies whether duplicated key entries in pie dataset should be ignored and only the last value be considered, or whether an exception should be raised instead. - - net/sf/jasperreports/charts/JRPieDataset.html#PROPERTY_IGNORE_DUPLICATED_KEY - false - Global | Report | Dataset - 6.0.2 - - - - - - - -Specifies the default render type for charts. See the renderType attribute of the chart elements. - - net/sf/jasperreports/engine/JRChart.html#PROPERTY_CHART_RENDER_TYPE - draw - Global | Report - 2.0.5 - - - - - - - -Prefix for properties that map chart renderers. -
    -Properties having this prefix indicate the JRRenderable implementation to be used when rendering -a chart element having a rendering type specified in the property suffix. -
    - net/sf/jasperreports/engine/JRChart.html#PROPERTY_CHART_RENDER_TYPE - N/A - Global - 2.0.5 -
    - - - - - - -Property used to specify the chart theme name. - - net/sf/jasperreports/engine/JRChart.html#PROPERTY_CHART_THEME - default - Global | Report - 3.1.0 - - - - - - - -Specifies the default value (in pixels) for the first line indent, if no explicit information is provided in a JR paragraph. -
    -By default the first line in JR paragraphs has no indentation. -
    - net/sf/jasperreports/engine/JRParagraph.html#DEFAULT_FIRST_LINE_INDENT - 0 - Global - 4.0.2 -
    - - - - - - -Specifies the default font name when no default font is explicitly given in a report. - - net/sf/jasperreports/engine/JRFont.html#DEFAULT_FONT_NAME - SansSerif - Global - 1.3.0 - - - - - - - -Specifies the default font size when no default font size is explicitly given in a report. - - net/sf/jasperreports/engine/JRFont.html#DEFAULT_FONT_SIZE - 10 - Global - 1.3.0 - - - - - - - -Specifies the default value (in pixels) for the left indent, if no explicit information is provided in a JR paragraph. -
    -By default JR paragraphs provide no left indentation. -
    - net/sf/jasperreports/engine/JRParagraph.html#DEFAULT_LEFT_INDENT - 0 - Global - 4.0.2 -
    - - - - - - -Specifies the default value for the text line spacing size, if no explicit information is provided in a -JR paragraph. -
    -This value is used in combination with the size-dependent line spacings in -LineSpacingEnum: -
      -
    • AT_LEAST
    • -
    • FIXED
    • -
    • PROPORTIONAL
    • -
    -
    - net/sf/jasperreports/engine/JRParagraph.html#DEFAULT_LINE_SPACING_SIZE - 1 - Global - 4.0.2 -
    - - - - - - -Specifies the default value (in pixels) for the right indent, if no explicit information is provided in a JR paragraph. -
    -By default JR paragraphs provide no right indentation. -
    - net/sf/jasperreports/engine/JRParagraph.html#DEFAULT_RIGHT_INDENT - 0 - Global - 4.0.2 -
    - - - - - - -Specifies the default value (in pixels) for the spacing after lines, if no explicit information is provided in a JR paragraph. -
    -By default JR paragraphs provide no spacing after lines. -
    - net/sf/jasperreports/engine/JRParagraph.html#DEFAULT_SPACING_AFTER - 0 - Global - 4.0.2 -
    - - - - - - -Specifies the default value (in pixels) for the spacing before lines, if no explicit information is provided in a JR paragraph. -
    -By default JR paragraphs provide no spacing before lines. -
    - net/sf/jasperreports/engine/JRParagraph.html#DEFAULT_SPACING_BEFORE - 0 - Global - 4.0.2 -
    - - - - - - -Specifies the default value (in pixels) for the tab stop width, if no explicit information is provided in a paragraph. -
    -By default JR paragraphs provide 40 pixels wide tab stops. -
    - net/sf/jasperreports/engine/JRParagraph.html#DEFAULT_TAB_STOP_WIDTH - 40 - Global - 4.0.2 -
    - - - - - - -Property specifying the name of the class implementing the -JRImageEncoder interface to be used by the engine. -If not set, the engine will try to an image encoder implementation that corresponds to the JVM version. - - net/sf/jasperreports/engine/util/JRImageLoader.html#PROPERTY_IMAGE_ENCODER - N/A - Global - 2.0.5 - - - - - - - -Property specifying the name of the class implementing the -JRImageReader interface to be used by the engine. -If not set, the engine will try to an image reader implementation that corresponds to the JVM version. - - net/sf/jasperreports/engine/util/JRImageLoader.html#PROPERTY_IMAGE_READER - N/A - Global - 2.0.5 - - - - - - - -Prefix for properties that map markup text processors. -
    -Properties having this prefix indicate the MarkupProcessor implementation to be used when parsing -a given styled text having the markup type specified in the property suffix. -
    - net/sf/jasperreports/engine/util/MarkupProcessorFactory.html#PROPERTY_MARKUP_PROCESSOR_FACTORY_PREFIX - N/A - Global - 2.0.5 -
    - - - - - - -This property is used to determine whether missing bookmarks levels should be colapsed when -the propety
    net.sf.jasperreports.print.create.bookmarks is set - - net/sf/jasperreports/engine/JasperPrint.html#PROPERTY_COLLAPSE_MISSING_BOOKMARK_LEVELS - false - Global | Report - 5.5.2 - - - - - - - -Property used to determine whether bookmarks should be collected at report generation time. - - net/sf/jasperreports/engine/JasperPrint.html#PROPERTY_CREATE_BOOKMARKS - false - Global | Report - 5.5.2 - - - - - - - -Property used to determine whether the fill process must preserve the original text for text elements that are not able to fit their entire contents. -When this property is set, the engine saves the original text in the JRPrintText print text object, along with the index at which the text is to be truncated by the print object. - - net/sf/jasperreports/engine/JRTextElement.html#PROPERTY_PRINT_KEEP_FULL_TEXT - false - Global | Report | Text Element - 2.0.3 - - - - - - - -Boolean property that determines whether text elements are to be truncated at the last character that fits. -By default, when the entire text of a text element does not fit the element's area, the text is truncated at the last word that fits the area.
    -
    - net/sf/jasperreports/engine/JRTextElement.html#PROPERTY_TRUNCATE_AT_CHAR - false - Global | Report | Text Element - 2.0.3 -
    - - - - - - -Property whose value is used as a suffix for the truncated text. -The suffix is appended to the text when truncation occurs. -If the property is not defined or empty (which is the case by default), no suffix will be used when the text is truncated. - - net/sf/jasperreports/engine/JRTextElement.html#PROPERTY_TRUNCATE_SUFFIX - empty string - Global | Report | Text Element - 2.0.3 - - - - - - - -This property can either hold the name of a text measurer factory class, or hold an alias of a text measurer factory class property. -One can write an implementation of the JRTextMeasurerFactory interface. This will usually imply writing a custom implementation of the JRTextMeasurer interface, either from scratch or by extending the default implementation (TextMeasurer). -A text measurer is responsible with computing text layout attributes (in the form of JRMeasuredText instances) for report text elements. The measurer is only used at report fill time, the exporters will use the computed text layout attributes. -Then one can define an alias of the text measurer factory implementation by declaring a property named net.sf.jasperreports.text.measurer.factory.{alias} which has the name of the factory class as value. -The net.sf.jasperreports.text.measurer.factory property is set to a defined alias or a full factory class name. -The factory class is used to instantiate text measurers for report text elements, which are then used to compute the text layout attributes. - - net/sf/jasperreports/engine/util/JRTextMeasurerUtil.html#PROPERTY_TEXT_MEASURER_FACTORY - net.sf.jasperreports.engine.fill.TextMeasurerFactory - Global | Report | Text Element - 2.0.3 - - - - - - - -Boolean property that determines whether the positions where text line -break occurs are to be saved during report fill in oder to be used at -export time. -
    -At report fill time, each text element is measured in order to determine -how long it needs to stretch or where it needs to be truncated. -During this measurement, the text wraps at certain positions in order to -fit the text element defined width. -
    -Setting this property to true instructs the engine to save the positions -at which line breaks occur in the generated print element. -The positions can be used by report exporters that want to enforce line -breaks to occur at exactly the same position as they did during text -measurement at fill time. -
    -Currently, the HTML exporter will make use of the saved line break -positions by introducing explicit line breaks. -
    - net/sf/jasperreports/engine/JRTextElement.html#PROPERTY_SAVE_LINE_BREAKS - false - Global | Report | Text Element - 3.5.1 -
    - - - - - - -Property used to decide whether java.io.File#deleteOnExit() should be requested for temporary files created by the virtualizer. -Temporary files will be deleted by explicitly calling cleanup() or from the virtualizer finalize() method. - - net/sf/jasperreports/engine/fill/JRFileVirtualizer.html#PROPERTY_TEMP_FILES_SET_DELETE_ON_EXIT - true - Global - 1.2.3 - - - - - - - -Property that determines how many print elements will make up a virtual page handled as a unit by the virtualizer. - -

    -For most paginated reports, a virtual page corresponds to a report page. -But for non-paginated reports and for reports having very large pages, a report page is broken into several virtual pages which are handled individually by the virtualizer. -

    - -

    -This property provides the size of a virtual page in print elements. -Note that virtual page sizes will actually vary around the configured size since there are cases when fewer elements remain on a report page and cases when the configured size is exceeded due to print frames being included at the end of virtual page. -

    - -

    -If set to 0 or negative, report pages will not be broken into several virtual pages. -

    -
    - net/sf/jasperreports/engine/base/JRVirtualPrintPage.html#PROPERTY_VIRTUAL_PAGE_ELEMENT_SIZE - 2000 - Global | Report - 4.1.3 -
    - - - - - - -Property specifying the JRSubreportRunnerFactory implementation to use for creating subreport runners. - - net/sf/jasperreports/engine/fill/JRSubreportRunnerFactory.html#SUBREPORT_RUNNER_FACTORY - net.sf.jasperreports.engine.fill
    .JRThreadSubreportRunnerFactory
    - Global - 1.2.2 -
    - - - - - - -Property that indicates whether a legacy fix for a JVM issue related to -evaluator classes generated by JasperReports is enabled. The fix is -enabled by default. -
    -Due to the fix, the garbage collector might not be able to collect -a classloader that loaded JasperReports classes. This would be -inconvenient in scenarios in which JasperReports classes are repeatedly -loaded by different classloaders, e.g. when JasperReports is part of -the classpath of a web application which is often reloaded. In such -scenarios, set this property to false. -
    - net/sf/jasperreports/engine/design/JRAbstractJavaCompiler.html#PROPERTY_EVALUATOR_CLASS_REFERENCE_FIX_ENABLED - true - Global - 3.0.0 -
    - - - - - - -The expression evaluation engine in JasperReports has always ignored -java.lang.NullPointerException exceptions raised during expression evaluation. -An expression raising NullPointerException is evaluated to null. -However, in certain cases, users want to be able to track down the source of -their NPE and this configuration property can be set to instruct the expression -evaluation engine to treat NPEs just the way all other expression exceptions are treated. -
    -The default value of this configuration property is true, meaning NPEs are ignored. -The property can be set globally, at report or at dataset level. -
    - net/sf/jasperreports/engine/fill/JREvaluator.html#PROPERTY_IGNORE_NPE - true - Global | Dataset - 6.1.1 -
    - - - - - - -A flag the determines whether the style of an element is evaluated at -the element evaluation time, or at the time the band on which the element -is placed is rendered. -
    -This applies to report elements that can have delayed evaluations times -(such as text fields and images). When this flag is set to -true, conditional style expressions of the style that is -associated with the element are evaluated at the moment the element is -set to evaluate, and the resulting style to the generated print element. -
    - net/sf/jasperreports/engine/JRStyle.html#PROPERTY_EVALUATION_TIME_ENABLED - false - Global | Report | Element - 3.5.2 -
    - - - - - - -A flag indicating whether the governor that checks if a report exceeds a specified limit of pages is turned on. -With this property enabled, the JR engine will stop the report execution if the number of pages becomes greater than a -custom given value. - - net/sf/jasperreports/governors/MaxPagesGovernor.html#PROPERTY_MAX_PAGES_ENABLED - false - Global | Report - 3.1.4 - - - - - - - -If the governor that checks if a report exceeds a specified limit of pages is turned on, this property will indicate the -maximum number of pages allowed to be ran, in order to prevent a memory overflow error. If the number of pages in the report -becomes greater than this value, the report execution will be stopped. - - net/sf/jasperreports/governors/MaxPagesGovernor.html#PROPERTY_MAX_PAGES - N/A - Global | Report - 3.1.4 - - - - - - - -A flag indicating whether the governor that checks if the elapsed time during report execution -exceeds a specified amount of time is turned on. -
    -With this property enabled, the JR engine will stop the report execution if the elapsed time -becomes greater than the limit value. -
    -By default it should be turned off. -
    - net/sf/jasperreports/governors/TimeoutGovernor.html#PROPERTY_TIMEOUT_ENABLED - false - Global | Report - 3.1.4 -
    - - - - - - -If the governor that checks if the elapsed time during report execution -exceeds a specified amount of time is turned on, this property will indicate the -maximum allowed amount of time, in order to prevent a memory overflow error. If this value -becomes exceeded, the report execution will be stopped. - - net/sf/jasperreports/governors/TimeoutGovernor.html#PROPERTY_TIMEOUT - N/A - Global | Report - 3.1.4 - - - - - - - -Property that limits the number of buckets in a crosstab, to avoid out of memory errors. - - net/sf/jasperreports/crosstabs/fill/calculation/BucketingService.html#PROPERTY_BUCKET_MEASURE_LIMIT - 0 - Global - 1.3.4 - - - - - - - -Property that provides the type of the cell that generated a print frame. (FIXME not a user defined property) -
    -The property value is one of -
      -
    • TYPE_CROSSTAB_HEADER
    • -
    • TYPE_COLUMN_HEADER
    • -
    • TYPE_ROW_HEADER
    • -
    • TYPE_DATA
    • -
    • TYPE_NO_DATA_CELL
    • -
    -
    - net/sf/jasperreports/crosstabs/JRCellContents.html#PROPERTY_TYPE - N/A - Element - 3.1.2 -
    - - - - - - -Property that provides the crosstab row span of a print frame. (FIXME not a user defined property) - - net/sf/jasperreports/crosstabs/JRCellContents.html#PROPERTY_ROW_SPAN - N/A - Element - 3.1.2 - - - - - - - -Property that provides the crosstab column span of a print frame. (FIXME not a user defined property) - - net/sf/jasperreports/crosstabs/JRCellContents.html#PROPERTY_COLUMN_SPAN - N/A - Element - 3.1.2 - - - - - - - -Property that provides the default value for the crosstab ignoreWidth attribute. - - net/sf/jasperreports/crosstabs/JRCrosstab.html#PROPERTY_IGNORE_WIDTH - false - Global | Report - 3.5.3 - - - - - - - -Property that determines which image producer to be used for a barcode component element. The property can -have a value of the name of the class that implements the image producer interface or an -alias that has been set for such a class, using a property of the form -net.sf.jasperreports.components.barcode4j.image.producer.{alias}. -
    -JasperReports provides two barcode image producer implementations: one which renders the -barcode in SVG format and one which renders the barcode as a rasterized image. The -first implementation is registered under the svg alias and is used by default; -the second one has image as alias and can be used by changing the -net.sf.jasperreports.components.barcode4j.image.producer.{alias} -property at any level. -
    -The SVG barcode image producer uses the Barcode4J API to export the barcode to SVG, -then it creates a SVG renderer based on the Batik SVG library. Hence, this option -introduces a dependency on Batik for viewing or exporting a report that includes -barcodes. -
    -The rasterized image producer draws the barcode on a PNG image which can be then -displayed in the generated report. This producer uses further properties, set at the same -levels as the image producer property, to allow the customization of the generated image. -
    - net/sf/jasperreports/components/barcode4j/BarcodeImageProducer.html#PROPERTY_IMAGE_PRODUCER - svg - Global | Report | Element - 3.5.2 -
    - - - - - - -Property that determines which image producer implementation to be used for an alias associated -with the barcode component element using the net.sf.jasperreports.components.barcode4j.image.producer -property. -
    -The value of this property represents the name of the class that implements the image -producer interface for the specified alias. -
    -Rendering the barcode in SVG format is registered under the svg alias and is used by default; -the built-in property value for this alias is net.sf.jasperreports.components.barcode4j.BarcodeSVGImageProducer. -Rendering the barcode as rasterized is registered under the image alias and -the built-in property value for this alias is net.sf.jasperreports.components.barcode4j.BarcodeRasterizedImageProducer. -
    -If the svg alias is set, the built-in SVG renderer is based on the Batik SVG library. -Hence, this option introduces a dependency on Batik for viewing or exporting a report that includes -barcodes. -
    -The rasterized image producer draws the barcode on a PNG image which can be then -displayed in the generated report. This producer uses further properties, set at the same -levels as the image producer property, to allow the customization of the generated image. -
    -
    -Note: This property does not apply to QRCode barcodes which are generated based on a different library (ZXing). For -QRCode barcodes, see net.sf.jasperreports.components.barcode4j.qrcode.producer.{alias}. -
    - net/sf/jasperreports/components/barcode4j/BarcodeImageProducer.html#PROPERTY_PREFIX_IMAGE_PRODUCER - N/A - Global | Report | Element - 3.5.2 -
    - - - - - - -Property that determines which image producer implementation to be used for an alias associated -with the QRCode component element using the net.sf.jasperreports.components.barcode4j.image.producer -property. -
    -The value of this property represents the name of the class that implements the image -producer interface for the specified alias. -
    -Rendering the QRCode component in SVG format is registered under the svg alias and is used by default; -the built-in property value for this alias is net.sf.jasperreports.components.barcode4j.QRCodeSVGImageProducer. -Rendering the QRCode component as rasterized is registered under the image alias and -the built-in property value for this alias is net.sf.jasperreports.components.barcode4j.QRCodeRasterizedImageProducer. -
    - net/sf/jasperreports/components/barcode4j/QRCodeImageProducer.html#PROPERTY_PREFIX_QRCODE_PRODUCER - N/A - Global | Report | Element - 6.0.2 -
    - - - - - - -Property that specifies the Google Maps API key. Using an API key enables additional features: -
      -
    • better Maps APIs usage monitoring in your application
    • -
    • purchasing additional quota if the usage limits are exceeded
    • -
    • allows Google contact you about your application, if necessary
    • -
    -Note: The API key must not be included in Google Maps API for Business requests. Business customers should send their -client ID instead. -
    - net/sf/jasperreports/components/map/MapComponent.html#PROPERTY_KEY - N/A - Global | Report - 5.3 -
    - - - - - - -Property that indicates which version of the Google Maps API to be loaded. The version property may be set as: -
      -
    • experimental version - specified by including the .exp suffix: <property name="net.sf.jasperreports.components.map.version" value="3.exp">
    • -
    • release version - specified either with the release major number (<property name="net.sf.jasperreports.components.map.version" value="3">) or with the release version number (<property name="net.sf.jasperreports.components.map.version" value="3.12">)
    • -
    • numbered version - specified with the version number (<property name="net.sf.jasperreports.components.map.version" value="3.11">)
    • -
    -If not specified, the experimental version is loaded by default. -
    - net/sf/jasperreports/components/map/MapComponent.html#PROPERTY_VERSION - N/A - Global | Report - 5.3 -
    - - - - - - -Property that specifies the client ID for Google Maps API for Business. If set, it takes precedence over the API key property. -
    -Usually works along with the signature property for signed URLs. -
    - net/sf/jasperreports/components/map/MapComponent.html#PROPERTY_CLIENT_ID - N/A - Global | Report - 5.3 -
    - - - - - - -Property that specifies the encrypted client signature for signed request URLs. For complete information see the official Authentication and Authorization documentation for -Maps Image APIs and -Web Services APIs. - - net/sf/jasperreports/components/map/MapComponent.html#PROPERTY_SIGNATURE - N/A - Global | Report - 5.3 - - - - - - - -Property that specifies the character to be used on the column header when the tables's column is sorted ascending - - net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_UP_ARROW_CHAR - \u25B2 - Global - 4.6.0 - - - - - - - -Property that specifies the character to be used on the column header when the tables's column is sorted descending - - net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_DOWN_ARROW_CHAR - \u25BC - Global - 4.6.0 - - - - - - - -Property that specifies the character to be used on the column header when the tables's column has a filtered applied - - net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_FILTER_CHAR - \u2606 - Global - 4.6.0 - - - - - - - -Property that enables/disables the automatic addition of specific custom properties to table cell elements, -that would in turn trigger the creation of special document accessibility tags during PDF export. - - net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_GENERATE_TABLE_PDF_TAGS - false - Global | Report | Component - 6.1.2 - - - - - - - -Property that enables/disables the interactivity in the table component - - net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_INTERACTIVE_TABLE - true - Global | Report | Component | Column - 4.7.1 - - - - - - - -Property that specifies the field to be used for sorting and/or filtering - - net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_COLUMN_FIELD - N/A - Column - 5.0.1 - - - - - - - -Property that specifies the variable to be used for sorting and/or filtering - - net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_COLUMN_VARIABLE - N/A - Column - 5.0.1 - - - - - - - -Property that enables/disables sorting - - net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_COLUMN_SORTABLE - true - Column - 5.0.1 - - - - - - - -Property that enables/disables filtering - - net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_COLUMN_FILTERABLE - true - Column - 5.0.1 - - - - - - - -Property that enables/disables conditional formatting - - net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_COLUMN_CONDITIONALLY_FORMATTABLE - true - Column - 5.0.1 - - - - - - - -Property that specifies a default value for the whenNoDataType attribute of table components. - - net/sf/jasperreports/components/table/TableComponent.html#PROPERTY_WHEN_NO_DATA_TYPE - Blank - Global | Report - 6.0.0 - - - - - - - -Property that specifies whether additional sort fields should be created automatically to preserve -the integrity of dataset groups, when interactive sorting is performed. The groups need to have simple -expressions using single field or single variable reference, for this feature to work properly. - - net/sf/jasperreports/components/sort/actions/SortCommand.html#PROPERTY_CREATE_SORT_FIELDS_FOR_GROUPS - false - Global | Dataset - 4.6.0 - - - - - - - -Property specifying whether the measured value should be rendered visible on a meter or thermometer chart's display zone. - - net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_DIAL_VALUE_DISPLAY_VISIBLE - false - Element - 3.5.0 - - - - - - - -Property containing the label text attached to the measured value in a meter or thermometer chart. - - net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_DIAL_LABEL - N/A - Element - 3.5.0 - - - - - - - -Flag property enabling the JFreeCharts engine to use integer tick units on a domain value axis. If set to true, it will take precedence over the -net.sf.jasperreports.chart.domain.axis.tick.interval and net.sf.jasperreports.chart.domain.axis.tick.count properties. - - net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_DOMAIN_AXIS_INTEGER_UNIT - N/A - Element - 4.6.0 - - - - - - - -Property specifying the number of ticks on a domain value axis. If it is not set, the JFreeCharts engine will use its own defaults to instantiate the axis. - - net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_DOMAIN_AXIS_TICK_COUNT - N/A - Element - 3.5.0 - - - - - - - -Property specifying the interval between 2 consecutive ticks on a domain value axis. If the net.sf.jasperreports.chart.domain.axis.tick.count property -is set, this interval will be neglected. -
    -If it is not set, the JFreeCharts engine will use its own defaults to instantiate the axis. -
    -By default it is not set. -
    - net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_DOMAIN_AXIS_TICK_INTERVAL - N/A - Element - 3.1.4 -
    - - - - - - -Flag property enabling the JFreeCharts engine to use integer tick units on a range value axis. If set to true, it will take precedence over the -net.sf.jasperreports.chart.range.axis.tick.interval and net.sf.jasperreports.chart.range.axis.tick.count properties. - - net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_RANGE_AXIS_INTEGER_UNIT - N/A - Element - 4.6.0 - - - - - - - -Property specifying the number of ticks on a range value axis. If it is not set, the JFreeCharts engine will use its own defaults to instantiate the axis. -
    -By default it is not set. -
    - net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_RANGE_AXIS_TICK_COUNT - N/A - Element - 3.5.0 -
    - - - - - - -Property specifying the interval between 2 consecutive ticks on a range value axis. If the net.sf.jasperreports.chart.range.axis.tick.count property -is set, this interval will be neglected. -
    -If it is not set, the JFreeCharts engine will use its own defaults to instantiate the axis. -
    -By default it is not set. -
    - net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_RANGE_AXIS_TICK_INTERVAL - N/A - Element - 3.1.4 -
    - - - - - - -Properties used to indicate extensions registry factories. -
    -Such factories are used by the default components registry class to -instantiate sub extensions registries. Each such property contains the fixed property prefix net.sf.jasperreports.extension.registry.factory. and an arbitrary name suffix -which is used as registry ID when instantiating. The property should have as value the name of a - ExtensionsRegistryFactory implementation. -
    - net/sf/jasperreports/extensions/DefaultExtensionsRegistry.html#PROPERTY_REGISTRY_FACTORY_PREFIX - N/A - Global - 3.1.0 -
    - - - - - - -Property that can be used to provide a registry-specific property, by appending the registry ID and then a fixed property suffix to the fixed property prefix net.sf.jasperreports.extension.. -
    -For example: -
    -the net.sf.jasperreports.extension.chart.theme.spring.beans.resource contains the spring beans resource bundle location -for the spring-based extensions registry class with the "chart.theme" registry ID. -
    - net/sf/jasperreports/extensions/DefaultExtensionsRegistry.html#PROPERTY_REGISTRY_PREFIX - N/A - Global - 3.1.0 -
    - - - - - - -A property that provides the default ExtensionsRegistry -implementation class. -
    -This property is only read at initialization time, therefore changing -the property value at a later time will have no effect. -
    - net/sf/jasperreports/extensions/ExtensionsEnvironment.html#PROPERTY_EXTENSIONS_REGISTRY_CLASS - net.sf.jasperreports.extensions.DefaultExtensionsRegistry - Global - 3.1.0 - -
    - - - - - - -Property specifying the maximum in-memory buffer length that triggers the creation of a temporary file on disk to store further content sent to a -FileBufferedOutputStream instance. -
    -Note: While the Global level setting is available for all document exporters, the Report level setting is processed for the XLSX output -format only. To avoid memory leaks when exporting reports with a large number of sheets to XLSX format, just set this property to 0 at report level. -
    - net/sf/jasperreports/engine/util/FileBufferedOutputStream.html#PROPERTY_MEMORY_THRESHOLD - 262144 - Global | Report - 1.3.4 - -
    - - - - - - -Specifies the image resolution in dots-per-inch, for the images created by the engine when rasterizing SVGs or when clipping other renderers. - - net/sf/jasperreports/engine/JRRenderable.html#PROPERTY_IMAGE_DPI - 72 - Global - 4.1.1 - - - - - - - -The name of the system property that specifies the properties file name. -If the system property net.sf.jasperreports.properties has been set then the specified properties file is loaded. -Otherwise the jasperreports.properties file is loaded, if found in the classpath. - - net/sf/jasperreports/engine/DefaultJasperReportsContext.html#PROPERTIES_FILE - jasperreports.properties - System - 1.0.0 - - - - - - - -Property that specifies the JasperReports version associated with this report. Report elements/attributes newer than -this version will be skipped by the JRXML writers (see the JRXmlWriter class for example) -during the report template generation. If not set, the version is considered to be the currenly deployed version. - - net/sf/jasperreports/engine/xml/JRXmlBaseWriter.html#PROPERTY_REPORT_VERSION - N/A - Global | Report - 4.8.0 - - - - - - - -Maximum size (in pixels) of a buffered image that would be used by JRViewer to render a report page. -If rendering a report page would require an image larger than this threshold (i.e. image width x image height > maximum size), the report page will be rendered directly on the viewer component. -If this property is zero or negative, buffered images will never be used to render a report page. - - net/sf/jasperreports/view/JRViewer.html#VIEWER_RENDER_BUFFER_MAX_SIZE - 0 - Global - 1.2.8 - - - - - - - -A property that specifies the number of times the measurer should attempt -to measure a single text element before giving up. - - net/sf/jasperreports/engine/util/JdkGlyphFixTextMeasurer.html#PROPERTY_ATTEMPTS - 20 - Global - 3.0.0 - - - - - - - -A property that specifies the number of milliseconds to sleep between -measuring reattempts. -
    -The default value is 0, which means that the measurer will not pause -between reattempts (see DEFAULT_ATTEMPT_SLEEP). -
    - net/sf/jasperreports/engine/util/JdkGlyphFixTextMeasurer.html#PROPERTY_ATTEMPT_SLEEP - 0 - Global - 3.0.0 -
    - - - - - - -A property that specifies whether java.lang.NullPointer exceptions with empty stacktraces -should be caught. -
    -This is useful when running on a Sun server JVM (java -server), which might omit -exception stacktraces in some cases. -
    - net/sf/jasperreports/engine/util/JdkGlyphFixTextMeasurer.html#PROPERTY_CATCH_EMPTY_STACKTRACE - false - Global - 3.0.0 -
    - - - - - - -Property that forces the XML validation, when a document exported to XML format is loaded. - - net/sf/jasperreports/engine/xml/PrintSaxParserFactory.html#EXPORT_XML_VALIDATION - true - Global | Report - 1.0.0 - - - - - - - -Property that gives a parser factory class which should be used -for parsing XML exports. -
    -By default, this property is set to use PrintSaxParserFactory -as report parser factory. -
    - net/sf/jasperreports/engine/xml/JRSaxParserFactory.html#PROPERTY_PRINT_PARSER_FACTORY - net.sf.jasperreports.engine.xml.PrintSaxParserFactory - Global - 4.1.3 -
    - - - - - - -Property indicating the default PDF font, if not specified in the report template or at export time. - - net/sf/jasperreports/engine/JRFont.html#DEFAULT_PDF_FONT_NAME - Helvetica - Global - 1.3.0 - - - - - - - -Property indicating the default PDF encoding, if not specified in the report template or at export time. - - net/sf/jasperreports/engine/JRFont.html#DEFAULT_PDF_ENCODING - Cp1252 - Global - 1.3.0 - - - - - - - -Property indicating the default PDF font embedding behavior, if not specified in the report template or at export time. - - net/sf/jasperreports/engine/JRFont.html#DEFAULT_PDF_EMBEDDED - false - Global - 1.3.0 - - - - - - - -Properties with this syntax are used by the exporters to determine if a certain hyperlink should be activated or not. -These flags can be controlled at hyperlink declaration level by using the hyperlink parameter with the same name. The -available output formats for filling in the {format} placeholder are: html, pdf, rtf, xls, docx, pptx, odt. When the -format is set to 'xls', this property will be applied for XLS, XLSX and ODS exporters. - - N/A - N/A - Global | Report | Hyperlink - 5.0.4 - - - - - - - -Properties with this syntax are used by the exporters to create default exporter filter instances that filter -out content based on element key information. Possible values for the {format} token are -pdf, html, xls, xlsx, rtf, odt, ods, csv -and txt. The {suffix} token can be either the element's key value or an arbitrary string. The value of the property, if -defined, should be the element's key value. If the property has no value, its suffix will be assumed as a value. -
    -The following example shows how to specify element keys which are to be excluded -from specific export outputs: -

    - <jasperReport ...> -
    - <!-- exclude elements with keys Image1 and Text4 from HTML export --> -
    - <property name="net.sf.jasperreports.export.html.exclude.key.Image1"/> -
    - <property name="net.sf.jasperreports.export.html.exclude.key.Text4"/> -
    - <!-- exclude elements with keys Image5 from PDF export --> -
    - <property name="net.sf.jasperreports.export.pdf.exclude.key.the.image" value="Image5"/> -
    - ... -
    - </jasperReport>
    -
    - N/A - N/A - Global | Report - 3.0.1 -
    - - - - - - -Properties with this syntax are used by the exporters to create default exporter filter instances that filter -out content based on element origin information. Possible values for the {format} token are -pdf, html, xls, xlsx, rtf, odt, csv -and txt. The {suffix} token can be: band, group or -report. -
    -See this FAQ for more details about filtering out content while exporting. -
    - N/A - N/A - Global | Report - 2.0.3 -
    - - - - - - -Properties with this syntax are used by the exporters to create default exporter filter instances that filter -out content based on element origin information. Possible values for the {format} token are -pdf, html, xls, xlsx, rtf, odt, csv -and txt. The {suffix} token can be: band, group or -report. -
    -See this FAQ for more details about filtering out content while exporting. -
    - N/A - N/A - Global | Report - 2.0.3 -
    - - - - - - -A set of properties that are used to register filter factories. They all contain the fixed prefix net.sf.jasperreports.export.filter.factory. and a suffix indicating the considered filter element. -
    -For example: net.sf.jasperreports.export.filter.factory.origin indicates an element origin filter factory. -
    - net/sf/jasperreports/engine/export/DefaultExporterFilterFactory.html#PROPERTY_EXPORTER_FILTER_FACTORY_PREFIX - N/A - Global | Report - 3.0.1 -
    - - - - - - -A property that gives the generic default filter factory class name. - net/sf/jasperreports/engine/JRAbstractExporter.html#PROPERTY_DEFAULT_FILTER_FACTORY - net.sf.jasperreports.engine.export.DefaultExporterFilterFactory - Global | Report - 3.0.1 - - - - - - - -Property that gives the default filter factory for a specific exporter. -Contains the property prefix net.sf.jasperreports.export. concatenated with an arbitrary name indicating the exporter type and -the property suffix default.filter.factory. -
    -For instance, the default filter factory for XLS exporters is - net.sf.jasperreports.export.xls.default.filter.factory. -If this property is not defined for a specific exporter, the generic - exporter factory given by PROPERTY_DEFAULT_FILTER_FACTORY is used. -
    - net/sf/jasperreports/engine/JRAbstractExporter.html#PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY - PROPERTY_DEFAULT_FILTER_FACTORY 's default value. - Global - 3.0.1 -
    - - - - - - -Property whose value is used as as default for the getEncoding() export output setting. -Stores the character encoding for exported reports. - - net/sf/jasperreports/export/WriterExporterOutput.html#PROPERTY_CHARACTER_ENCODING - UTF-8 - Global | Report - 2.0.1 - - - - - - - -Property specifying the name of the CSV exported column the element belongs to. -It must be one of the column names in the net.sf.jasperreports.export.csv.column.names.{suffix}, if provided. - - net/sf/jasperreports/engine/export/JRCsvMetadataExporter.html#PROPERTY_COLUMN_NAME - N/A - Element - 4.0.0 - - - - - - - -Properties having this prefix contain comma-separated names of the columns that will be exported to CSV. -
    -Column names in this property are used as default list for the -getColumnNames() -CSV metadata export output setting. -

    -Note: For accurate results it's recommended that column names in the list to follow the same order as the original columns. -
    - net/sf/jasperreports/export/CsvMetadataExporterConfiguration.html#PROPERTY_COLUMN_NAMES_PREFIX - N/A - Report - 4.0.0 -
    - - - - - - -Property that specifies a custom value to be associated with the column specified by the -PROPERTY_COLUMN_NAME. -
    -The property itself defaults to the text value of the report element this property is assigned to. -
    - net/sf/jasperreports/engine/export/JRCsvMetadataExporter.html#PROPERTY_DATA - N/A - Element - 4.0.0 -
    - - - - - - -Property that contains the character or sequence of characters used to delimit two fields on the same record. Its value is used as default for the -getFieldDelimiter() CSV export configuration setting. - - net/sf/jasperreports/export/CsvExporterConfiguration.html#PROPERTY_FIELD_DELIMITER - , - Global | Report - 2.0.1 - - - - - - - -Property containing the character to enclose a field value on a record. -
    -If a sequence of characters is set for this property, only the leading one will be taken into account. White spaces are not considered. -
    -Its value is used as default for the -getFieldEnclosure() CSV export configuration setting. -
    -This property set in the JRXML report does not support expressions, so we have to ensure that -character values representing XML entity references are XML-escaped, accordingly. -For instance, use &quot; instead of ", &apos; instead of ', etc. -
    - net/sf/jasperreports/export/CsvExporterConfiguration.html#PROPERTY_FIELD_ENCLOSURE - " - Global | Report - 6.2.1 -
    - - - - - - -Property that enforces all exported field values to be enclosed within a pair of enclosure characters (usually a pair of quotes:""). -Its value is used as default for the -getForceFieldEnclosure() CSV export configuration flag. - - net/sf/jasperreports/export/CsvExporterConfiguration.html#PROPERTY_FORCE_FIELD_ENCLOSURE - false - Global | Report - 6.2.1 - - - - - - - -Property that contains the character or sequence of characters used to delimit two records. -
    -Its value is used as default for the -getRecordDelimiter() CSV export configuration setting. -
    - net/sf/jasperreports/export/CsvExporterConfiguration.html#PROPERTY_RECORD_DELIMITER - \n - Global | Report - 2.0.1 -
    - - - - - - -Property that specifies whether the value associated with PROPERTY_COLUMN_NAME -should be repeated or not when it is missing. - - net/sf/jasperreports/engine/export/JRCsvMetadataExporter.html#PROPERTY_REPEAT_VALUE - false - Element - 4.0.0 - - - - - - - -Property that specifies whether a BOM character should be put at the beginning of the output. -
    -Its value is used as default for the -isWriteBOM() CSV export configuration setting. -
    - net/sf/jasperreports/export/CsvExporterConfiguration.html#PROPERTY_WRITE_BOM - false - Global | Report - 6.1.0 -
    - - - - - - -Property that specifies whether the export header (the column names) should be written or not. -
    -Its value is used as default for the -isWriteHeader() CSV metadata export configuration setting. -
    - net/sf/jasperreports/export/CsvMetadataExporterConfiguration.html#PROPERTY_WRITE_HEADER - false - Global | Report - 4.0.0 -
    - - - - - - -Flag property that controls the use of an AWT rendering fix which causes the printer job size to be reduced when the exporter draws onto a printer graphic context. -
    -Its value is used as default for the -isMinimizePrinterJobSize() Graphics2D export configuration setting. -
    - net/sf/jasperreports/export/Graphics2DReportConfiguration.html#MINIMIZE_PRINTER_JOB_SIZE - true - Global | Report - 1.2.8 -
    - - - - - - -This flag property specifies whether page margins should be ignored when the report is exported using a grid-based exporter. -
    -Its value is used as default for the Excel -and HTML isIgnorePageMargins() export -configuration setting. -
    -If the property is true, any page in the document will be exported without taking into account its margins. -
    - net/sf/jasperreports/export/ExporterConfiguration.html#PROPERTY_IGNORE_PAGE_MARGINS - false - Global | Report - 2.0.5 -
    - - - - - - -This property specifies whether JRPrintFrame frames are to be exported as nested tables. -
    -Its value is used as default for the -isFramesAsNestedTables() DOCX export configuration setting. -
    -If set to false, the frame content will be integrated into the master/page table. -
    - net/sf/jasperreports/export/DocxExporterConfiguration.html#PROPERTY_FRAMES_AS_NESTED_TABLES - true - Global | Report | Element - 3.5.3 -
    - - - - - - -This property indicates whether table rows can grow if more text is added into cells. -
    -Its value is used as default for the -isFlexibleRowHeight() DOCX export configuration setting. -
    -If set to false, the table rows do not increase in height automatically and the user has to enlarge them manually. -
    - net/sf/jasperreports/export/DocxExporterConfiguration.html#PROPERTY_FLEXIBLE_ROW_HEIGHT - false - Global | Report - 3.6.1 -
    - - - - - - -This property is used to mark text elements as being hidden either for printing or on-screen display. - - net/sf/jasperreports/engine/export/ooxml/JRDocxExporter.html#PROPERTY_HIDDEN_TEXT - false - Element - 3.7.6 - - - - - - - -This property specifies whether the newline element present in a justified paragraph introduces a new justified paragraph. -If set to true, the text line before the new paragraph will lose the justified alignment. -
    -It serves as default value for the -isNewLineAsParagraph() DOCX export configuration setting. -The property itself defaults to false (for backward compatibility reasons). -
    - net/sf/jasperreports/export/DocxExporterConfiguration.html#PROPERTY_NEW_LINE_AS_PARAGRAPH - false - Global | Report | Element - 6.1.1 -
    - - - - - - -Property that determines the value of the allowScriptAccess parameter for Flash elements. - - net/sf/jasperreports/engine/export/FlashPrintElement.html#PROPERTY_ALLOW_SCRIPT_ACCESS - sameDomain - Global | Report | Element - 4.1.3 - - - - - - - -Configuration property that determines the exporter to produce accessible HTML. -
    -Its value is used as default for the -isAccessibleHtml() HTML export configuration setting. -
    - net/sf/jasperreports/export/HtmlExporterConfiguration.html#PROPERTY_ACCESSIBLE - false - Global | Report - 3.7.5 -
    - - - - - - -This property specifies whether JRPrintFrame frames are to be exported as nested HTML tables. -
    -Its value is used as default for the -isFramesAsNestedTables() HTML export configuration setting. -
    -If set to false, the frame content will be integrated into the master/page HTML table. -
    - net/sf/jasperreports/engine/export/JRHtmlExporterConfiguration.html#PROPERTY_FRAMES_AS_NESTED_TABLES - true - Global | Report | Element - 2.0.1 -
    - - - - - - -Configuration property that provides the HTML code that will be inserted between pages of the generated report. -
    -Its value is used as default for the -getBetweenPagesHtml() HTML export configuration setting. -
    - net/sf/jasperreports/export/HtmlExporterConfiguration.html#PROPERTY_BETWEEN_PAGES_HTML - N/A - Global | Report - 5.5.2 -
    - - - - - - -Configuration property that provides the value for the border-collapse CSS property to be applied -to the table generated for the report. Possible values are: -
      -
    • separate
    • -
    • collapse (default)
    • -
    • initial
    • -
    • inherit
    • -
    -Its value is used as default for the -getBorderCollapse() HTML export configuration setting. -
    - net/sf/jasperreports/export/HtmlReportConfiguration.html#PROPERTY_BORDER_COLLAPSE - collapse - Global | Report - 5.0.4 -
    - - - - - - -Configuration property that provides the HTML code that will be inserted before the generated report content. -
    -Its value is used as default for the -getHtmlHeader() HTML export configuration setting. -
    - net/sf/jasperreports/export/HtmlExporterConfiguration.html#PROPERTY_HTML_HEADER - N/A - Global | Report - 5.5.2 -
    - - - - - - -Configuration property that provides the HTML code that will be inserted after the generated report content. -
    -Its value is used as default for the -getHtmlFooter() HTML export configuration setting. -
    - net/sf/jasperreports/export/HtmlExporterConfiguration.html#PROPERTY_HTML_FOOTER - N/A - Global | Report - 5.5.2 -
    - - - - - - -Property used to specify the value of the CSS class attribute of elements when exported to HTML and XHTML formats. The value of this property -will be used as the value for the class attribute of the <td> tag for the element when exported to HTML and/or -the class attribute of the <span> or <div> tag for the element, when exported to XHTML/CSS. - - net/sf/jasperreports/engine/export/HtmlExporter.html#PROPERTY_HTML_CLASS - N/A - Element - 4.0.1 - - - - - - - -This property specifies whether the image should be Base64 encoded and embedded into the src attribute of the image tag, and not referenced as separate resource. -The property provides a default value for the isEmbedImage() export setting. - - net/sf/jasperreports/engine/export/HtmlReportConfiguration.html#PROPERTY_EMBED_IMAGE - false - Global | Report | Element - 6.2.1 - - - - - - - -This property specifies whether the HTML embedded SVG should have the font family names replaced with the web fonts coming from font extensions, similar to what we do for text elements. - - net/sf/jasperreports/engine/export/HtmlReportConfiguration.html#PROPERTY_EMBEDDED_SVG_USE_FONTS - false - Global | Report | Element - 6.2.2 - - - - - - - -Property used to specify the value of the ID attribute of elements when exported to HTML and XHTML formats. The value of this property will be used -as the value for the id attribute of the <td> tag for the element when exported to HTML and/or the id attribute of -the <span> or <div> tag for the element, when exported to XHTML/CSS. - - net/sf/jasperreports/engine/export/HtmlExporter.html#PROPERTY_HTML_ID - N/A - Element - 3.7.0 - - - - - - - -Flag property that specifies whether the blank lines that sometimes appear between rows as spacers should be removed. -
    -Its value is used as default for the -isRemoveEmptySpaceBetweenRows() HTML export configuration setting. -
    - net/sf/jasperreports/export/HtmlExporterConfiguration.html#PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_ROWS - false - Global | Report - 2.0.1 -
    - - - - - - -Property that specifies the unit to use when measuring lengths or font size. This can be one of the supported size units from the CSS -specifications like "px" for pixels or "pt" for points. The default value is "px", meaning that lengths and font sizes are specified in pixels. -
    -Its value is used as default for the -getSizeUnit() HTML export configuration setting. -
    - net/sf/jasperreports/export/HtmlExporterConfiguration.html#PROPERTY_SIZE_UNIT - px - Global | Report - 2.0.1 -
    - - - - - - -Property that specifies whether the export engine should use small transparent spacer images for aligning content. - - net/sf/jasperreports/engine/export/JRHtmlExporterConfiguration.html#PROPERTY_USING_IMAGES_TO_ALIGN - true - Global | Report - 2.0.1 - - - - - - - -Property that indicates whether the report background should be turned to white. If not set, the default background will appear, depending on the selected CSS styles. -
    -Its value is used as default for the -isWhitePageBackground() HTML export configuration setting. -
    - net/sf/jasperreports/export/HtmlExporterConfiguration.html#PROPERTY_WHITE_PAGE_BACKGROUND - true - Global | Report - 2.0.1 -
    - - - - - - -Property that specifies whether the export engine should force text wrapping by breaking words (CSS word-wrap: break-word). -
    -Its value is used as default for the -isWrapBreakWord() HTML export configuration setting. -
    -Note that this CSS property is not currently supported by all browsers. An alternative approach for forcing word breaks in HTML is to save the -line breaks at fill time via the net.sf.jasperreports.text.save.line.breaks property. -
    - net/sf/jasperreports/export/HtmlExporterConfiguration.html#PROPERTY_WRAP_BREAK_WORD - false - Global | Report - 2.0.1 -
    - - - - - - -This element-level property is considered by the JsonMetadataExporter -and provides the exported value of a given type for that element. This value will be exported within the JSON tree following the path specified -by the property suffix. Possible values for the value type are: -
      -
    • string
    • -
    • number
    • -
    • date
    • -
    • boolean
    • -
    -
    -When working with this property, numbers have to be written with no thousand separators and using a period as decimal. For instance, 1,000,000 should be written as -"1000000" and 2,000.45 should be written as "2000.45". Dates must be written according to ISO 8601 standard: "yyyy-MM-dd'T'HH:mm:ss". -
    - net/sf/jasperreports/engine/export/JsonMetadataExporter.html#JSON_EXPORTER_STRING_PROPERTIES_PREFIX - N/A - Element - 6.1.0 -
    - - - - - - -This element-level property is considered by the JsonMetadataExporter -and provides the exported value for that element. By default is considered the value of the report element itself. -
    -When working with this property, numbers have to be written with no thousand separators and using a period as decimal. For instance, 1,000,000 should be written as -"1000000" and 2,000.45 should be written as "2000.45". Dates must be written according to ISO 8601 standard: "yyyy-MM-dd'T'HH:mm:ss". -
    - net/sf/jasperreports/engine/export/JsonMetadataExporter.html#JSON_EXPORTER_DATA_PROPERTY - N/A - Element - 6.0.0 -
    - - - - - - -This report-level flag is considered by the JsonMetadataExporter -and specifies if the member property names should be enclosed with quotes or no. - - net/sf/jasperreports/export/JsonMetadataReportConfiguration.html#JSON_EXPORTER_ESCAPE_MEMBERS - true - Report - 6.0.0 - - - - - - - -This element-level property is used by the JsonMetadataExporter -and specifies a given path within the JSON tree, where the current element will be exported. If the -net.sf.jasperreports.export.json.schema property is not -present in the report, this property can be used to determine a rule in the JSON schema as well. - - net/sf/jasperreports/engine/export/JsonMetadataExporter.html#JSON_EXPORTER_PATH_PROPERTY - N/A - Element - 6.0.0 - - - - - - - -This element-level flag is considered by the JsonMetadataExporter -and specifies whether the value associated to that JSON path should be repeated or not when it is missing. Usually this property -works in conjunction with one of the net.sf.jasperreports.export.json.{type}.{path} -properties. - - net/sf/jasperreports/engine/export/JsonMetadataExporter.html#JSON_EXPORTER_REPEAT_PROPERTIES_PREFIX - false - Element - 6.1.0 - - - - - - - -This element-level flag is considered by the JsonMetadataExporter -and specifies whether the value associated to the JSON path specified by net.sf.jasperreports.export.json.path property -should be repeated or not when it is missing. - - net/sf/jasperreports/engine/export/JsonMetadataExporter.html#JSON_EXPORTER_REPEAT_VALUE_PROPERTY - false - Element - 6.0.0 - - - - - - - -This report-level property is considered by the JsonMetadataExporter -and specifies the path to a JSON schema file that will be used to generate the JSON structure at export time. Nodes in a given schema should provide: -
      -
    • the _type property (mandatory), which can be an object or an array.
    • -
    • the _children property (mandatory for array-type nodes), which defines the type of the objects in the array.
    • -
    • other properties that describe the object.
    • -
    -
    - net/sf/jasperreports/export/JsonMetadataReportConfiguration.html#JSON_EXPORTER_JSON_SCHEMA - N/A - Report - 6.0.0 -
    - - - - - - -Boolean property enabling the JExcelApiExporter to use temporary files when creating large documents. - - net/sf/jasperreports/export/JxlExporterConfiguration.html#PROPERTY_USE_TEMP_FILE - false - Global | Report - 3.7.5 - - - - - - - -Boolean property specifying whether the cell format pattern is user-defined. -When set to true, the exporter will assume that the specified pattern is well defined. -If the pattern is invalid, it won't be taken into account by the Excel file viewer. - - net/sf/jasperreports/export/JxlExporterConfiguration.html#PROPERTY_COMPLEX_FORMAT - false - Global | Report | Element - 3.7.6 - - - - - - - -This property indicates whether table rows in ODS documents can grow if more text is added into cells. -
    -Its value is used as default for the -isFlexibleRowHeight() ODS export configuration setting. -
    -If set to false, the rows in the ODS document do not increase in height automatically and the user has to enlarge them manually. Otherwise, -the table rows will adjust their height automatically in order to fit their content in. -
    - net/sf/jasperreports/export/OdsExporterConfiguration.html#PROPERTY_ODS_FLEXIBLE_ROW_HEIGHT - false - Global | Report - 5.0.4 -
    - - - - - - -This property table rows in ODT documents can grow if more text is added into cells. -
    -Its value is used as default for the -isFlexibleRowHeight() ODT export configuration setting. -
    -If set to false, the table rows in the ODT document do not increase in height automatically and the user has to enlarge them manually. -Otherwise, the table rows will adjust their height automatically in order to fit their content in. -
    - net/sf/jasperreports/export/OdtExporterConfiguration.html#PROPERTY_ODT_FLEXIBLE_ROW_HEIGHT - false - Global | Report - 5.0.4 -
    - - - - - - -Property that establishes the priority of export parameters against report hints. -
    -Its value is used as default for the -isOverrideHints() export configuration setting. -
    -If the property is true, export parameters override report hints; this is the default behavior. -
    - net/sf/jasperreports/export/ExporterConfiguration.html#PROPERTY_EXPORT_PARAMETERS_OVERRIDE_REPORT_HINTS - true - Global -
    - - - - - - -Property that specifies whether the encryption key is 128 bits. -
    -Its value is used as default for the -is128BitKey() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_128_BIT_KEY - false - Global | Report - 2.0.1 -
    - - - - - - -Property that specifies whether the PDF document should be compressed. -
    -Its value is used as default for the -isCompressed() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_COMPRESSED - false - Global | Report - 2.0.1 -
    - - - - - - -Property that specifies whether the PDF document should contain an outline section. -
    -Its value is used as default for the -isCreatingBatchModeBookmarks() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_CREATE_BATCH_MODE_BOOKMARKS - false - Global | Report - 2.0.1 -
    - - - - - - -Property that specifies whether the final PDF document should be encrypted. -
    -Its value is used as default for the -isEncrypted() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_ENCRYPTED - false - Global | Report - 2.0.1 -
    - - - - - - -Prefix of properties that specify font files for the PDF exporter. - - net/sf/jasperreports/engine/export/JRPdfExporter.html#PDF_FONT_FILES_PREFIX - N/A - Global - 1.0.0 - - - - - - - - -Prefix of properties that specify font directories for the PDF exporter. - - net/sf/jasperreports/engine/export/JRPdfExporter.html#PDF_FONT_DIRS_PREFIX - N/A - Global - 1.0.0 - - - - - - - - -Property that specifies whether the PDF exporter should use a SplitCharacter -implementation to ensure that PDF text wrap behavior is the same as in AWT. -
    -Its value is used as default for the -isForceLineBreakPolicy() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_FORCE_LINEBREAK_POLICY - false - Global | Report - 2.0.1 - -
    - - - - - - -Property that specifies whether the rendering of SVG images using shapes on the PDF Graphics2D context should be forced. -
    -Its value is used as default for the -isForceSvgShapes() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_FORCE_SVG_SHAPES - true - Global | Report - 2.0.1 -
    - - - - - - -Property that contains the user defined JavaScript piece of code to be inserted into the generated PDF document. -
    -Its value is used as default for the -getPdfJavaScript() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_PDF_JAVASCRIPT - N/A - Global | Report - 2.0.1 -
    - - - - - - -Property that contains the author information to use for the generated PDF metadata. -
    -Its value is used as default for the -getMetadataAutor() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_METADATA_AUTHOR - N/A - Global | Report - 5.5.2 -
    - - - - - - -Property that contains the creator information to use for the generated PDF metadata. -
    -Its value is used as default for the -getMetadataCreator() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_METADATA_CREATOR - N/A - Global | Report - 5.5.2 -
    - - - - - - -Property that contains the keywords to use for the generated PDF metadata. -
    -Its value is used as default for the -getMetadataKeywords() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_METADATA_KEYWORDS - N/A - Global | Report - 5.5.2 -
    - - - - - - -Property that contains the subject information to use for the generated PDF metadata. -
    -Its value is used as default for the -getMetadataSubject() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_METADATA_SUBJECT - N/A - Global | Report - 5.5.2 -
    - - - - - - -Property that contains the title information to use for the generated PDF metadata. -
    -Its value is used as default for the -getMetadataTitle() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_METADATA_TITLE - N/A - Global | Report - 5.5.2 -
    - - - - - - -Property that specifies whether the document title should be displayed in the title bar instead of the file name. Should be set to true for accessible documents that provide a document title. -
    -Its value is used as default for the -isDisplayMetadataTitle() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_DISPLAY_METADATA_TITLE - false - Global | Report - 6.0.0 -
    - - - - - - -Property that contains the password belonging to the owner of the document, if it is encrypted. If the owner password is not specified, but the PDF is -encrypted, then the password will be a random string. -
    -Its value is used as default for the -getOwnerPassword() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_OWNER_PASSWORD - N/A - Global | Report - 2.0.1 -
    - - - - - - -Property that contains the allowed user permissions of the PDF document, if it is encrypted. Allowed values are one or many the permission names enumerated in -PdfPermissionsEnum class, separated by a pipe (|) sign: -
      -
    • ALL - all user permissions are allowed
    • -
    • ASSEMBLY - assembly permission allowed
    • -
    • COPY - copy permission allowed
    • -
    • DEGRADED_PRINTING - degraded printing permission allowed
    • -
    • FILL_IN - fill in forms permission allowed
    • -
    • MODIFY_ANNOTATIONS - modify annotation permission allowed
    • -
    • MODIFY_CONTENTS - modify contents permission allowed
    • -
    • PRINTING - print permission allowed
    • -
    • SCREENREADERS - screen readers permission allowed
    • -
    -
    -Its value is used as default for the -getAllowedPermissions() PDF export configuration setting. -By default no user permissions are allowed at all. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_PERMISSIONS_ALLOWED - N/A - Global | Report - 5.6.0 -
    - - - - - - -Property that contains the denied user permissions of the PDF document, if it is encrypted. This property works in conjunction with -the net.sf.jasperreports.export.pdf.permissions.allowed. If present, denied permissions -will be excluded from the allowed values. This property may contain one or many permission names enumerated in -PdfPermissionsEnum class, separated by a pipe (|) sign: -
      -
    • ALL - all user permissions are denied
    • -
    • ASSEMBLY - assembly permission denied
    • -
    • COPY - copy permission denied
    • -
    • DEGRADED_PRINTING - degraded printing permission denied
    • -
    • FILL_IN - fill in forms permission denied
    • -
    • MODIFY_ANNOTATIONS - modify annotation permission denied
    • -
    • MODIFY_CONTENTS - modify contents permission denied
    • -
    • PRINTING - print permission denied
    • -
    • SCREENREADERS - screen readers permission denied
    • -
    -
    -Its value is used as default for the -getDeniedPermissionsHint() PDF export configuration setting. -By default there are no user permissions allowed for the document. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_PERMISSIONS_DENIED - N/A - Global | Report - 5.6.0 -
    - - - - - - -Property that specifies the print scaling preference in the PDF print dialog. -
    -Its value is used as default for the -getPrintScaling() PDF export configuration setting. -
    -Possible values are default and none. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PRINT_SCALING - default - Global | Report - 3.6.1 -
    - - - - - - -Property that contains the user password needed to open the document, if it is encrypted. -
    -Its value is used as default for the -getUserPassword() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_USER_PASSWORD - N/A - Global | Report - 2.0.1 -
    - - - - - - -Property that contains a Character instance representing the version of the generated PDF. -
    -Its value is used as default for the -getPdfVersion() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_PDF_VERSION - N/A - Global | Report - 2.0.1 -
    - - - - - - -Property whose value is used as default for the getPdfaConformance() -export configuration setting. It specifies the conformance level of the PDF/A document. Possible values are: pdfa1a, pdfa1b and none. -
    -By default, this property is set to none. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_PDFA_CONFORMANCE - none - Global | Report - 3.1.2 -
    - - - - - - -Property whose value is used as default for the getIccProfilePath() -export configuration setting. It specifies the path to the ICC profile file for the PDF/A compliant documents. - - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_PDFA_ICC_PROFILE_PATH - N/A - Global | Report - 3.1.2 - - - - - - - -Property that specifies whether the exporter should put structure tags in the generated PDF. -
    -Its value is used as default for the -isTagged() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_PDF_TAGGED - false - Global | Report - 3.1.2 -
    - - - - - - -Property that specifies the language that the exporter should put in the language tag of the generated PDF. -
    -Its value is used as default for the -getTagLanguage() PDF export configuration setting. -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_TAG_LANGUAGE - N/A - Global | Report - 3.1.2 -
    - - - - - - -Property whose floating point value is representing the pixel/character horizontal ratio. -
    -Its value is used as default for the -getCharWidth() Text export configuration setting. -
    - net/sf/jasperreports/export/TextExporterConfiguration.html#PROPERTY_CHARACTER_WIDTH - N/A - Global | Report - 3.6.1 -
    - - - - - - -Property whose value represents text that will be inserted between pages of the generated report. -
    -Its value is used as default for the -getPageSeparator() Text export configuration setting. -
    - net/sf/jasperreports/export/TextExporterConfiguration.html#PROPERTY_PAGE_SEPARATOR - N/A - Global | Report - 5.5.2 -
    - - - - - - -Property whose floating point value is representing the pixel/character vertical ratio. -
    -Its value is used as default for the -getCharHeight() Text export configuration setting. -
    - net/sf/jasperreports/export/TextExporterConfiguration.html#PROPERTY_CHARACTER_HEIGHT - N/A - Global | Report - 3.6.1 -
    - - - - - - -Property whose integer value is representing the page width in characters. -
    -Its value is used as default for the -getPageWidthInChars() Text export configuration setting. -
    - net/sf/jasperreports/export/TextExporterConfiguration.html#PROPERTY_PAGE_WIDTH - N/A - Global | Report - 3.6.1 -
    - - - - - - -Property whose value represents the separator between two lines of text in the exported report. -
    -Its value is used as default for the -getLineSeparator() Text export configuration setting. -
    - net/sf/jasperreports/export/TextExporterConfiguration.html#PROPERTY_LINE_SEPARATOR - N/A - Global | Report - 5.5.2 -
    - - - - - - -Property whose integer value representing the page height in characters. -
    -Its value is used as default for the -getPageHeightInChars() Text export configuration setting. -
    - net/sf/jasperreports/export/TextExporterConfiguration.html#PROPERTY_PAGE_HEIGHT - N/A - Global | Report - 3.6.1 -
    - - - - - - -Property that specifies whether the text lines in the document should be trimmed to the right. -
    -Its value is used as default for the -isTrimLineRight() export configuration setting. -
    - net/sf/jasperreports/export/TextExporterConfiguration.html#PROPERTY_TRIM_LINE_RIGHT - false - Global | Report - 6.0.0 -
    - - - - - - -This element-level property is used to indicate the boundaries of the autofilter data range in the current sheet. -Allowed values are: -
      -
    • Start - The current cell will be marked as autofilter heading cell, and column data below/to the right of -this cell can be considered as part of the autofilter data range. The starting point of the autofilter data range will be -the next cell below the current cell (ie if the current cell reference is B4, the autofilter range will start with the "B5" -cell reference: "B5:M20"). -
      -If multiple autofilter Start values are found in the same sheet, only the last one will be considered. If the -Start value is present but no End value is found in the sheet, then only the current column will -be considered for the data range. -
      -If the autofilter Start value is set on the same row as the autofilter End value, the data range -will include all data below this heading row, placed between the start column and the end column.
    • -
    • End - The current cell will be marked as autofilter ending cell, and column data in this cell and -above/to the left can be considered as part of the autofilter data range. The ending cell in the data range is the -current cell reference (ie if the current cell reference is M20, the autofilter range will end in "M20": "B5:M20"). -The heading cell for the current column will be placed in the same column on the row containing the autofilter Start value. -
      -Caution: If no autofilter Start value is found in the sheet, the autofilter End value will be considered -as Start value instead. -
      -If multiple autofilter End values are found in the same sheet, only the last one will be considered. -
      -If the autofilter Start value is set on the same row as the autofilter End value, the data range -will include all data below this heading row, placed between the start column and the end column.
    • -
    -
    - net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_AUTO_FILTER - N/A - Element - 4.1.3 -
    - - - - - - -Flag property that indicates whether Excel should autofit the current column width. -
    -Allowed values are: -
      -
    • true
    • -
    • false
    • -
    -
    - net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_AUTO_FIT_COLUMN - false - Element - 4.5.1 -
    - - - - - - -Flag property that provides a default value for the isAutoFitPageHeight() export setting. -If set to true, the exporter will automatically fit the print height of a sheet to the number of JasperPrint pages exported in that sheet -
    -Allowed values are: -
      -
    • true
    • -
    • false
    • -
    -
    - net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_AUTO_FIT_PAGE_HEIGHT - false - Global | Report - 6.0.2 -
    - - - - - - -Flag property that indicates whether Excel should autofit the current row height. -
    -Allowed values are: -
      -
    • true
    • -
    • false
    • -
    -
    - net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_AUTO_FIT_ROW - false - Element - 4.5.1 -
    - - - - - - -Property that specifies whether row spans should be collapsed and merging cells across rows should be inhibited. -
    -Its value is used as default for the -isCollapseRowSpan() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_COLLAPSE_ROW_SPAN - false - Global | Report - 2.0.1 -
    - - - - - - -Represents the name for the column that should appear in the metadata-based Excel export. It must be one of the column names stored in -net.sf.jasperreports.export.xls.column.names.{suffix}, if provided. - - net/sf/jasperreports/engine/export/JRXlsAbstractMetadataExporter.html#PROPERTY_COLUMN_NAME - N/A - Element - 4.0.2 - - - - - - - -Properties having this prefix contain comma-separated column names used in the metadata-based Excel export. -
    -Column names in these properties are used as default list of values for the -getColumnNames() Excel metadata export configuration setting. -
    -The order of the columns is important and for accurate results they should be in the same order as the original columns. -
    - net/sf/jasperreports/export/XlsMetadataExporterConfiguration.html#PROPERTY_COLUMN_NAMES_PREFIX - N/A - Report - 4.0.2 -
    - - - - - - -Element-level property used to adjust the column width to values suitable for Excel output, taking into account -that column widths are measured in Excel in Normal style default character width units. The pixel-to-character width -translation depends on the default normal style character width, so it cannot be always accurately fitted. In this case, -one can adjust the current column width by setting this property with an integer value measured in pixels. The JR engine -will perform the pixel-to-character width mapping using this value instead of the element's width attribute. -
    -If defined, this property will override the PROPERTY_COLUMN_WIDTH_RATIO -value for the current column -
    - net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_COLUMN_WIDTH - N/A - Element - 4.1.3 -
    - - - - - - -Property used to adjust all column widths in a document or sheet with the same width ratio, in order to get column width -values suitable for Excel output. Usually column widths are measured by Excel in Normal style default character width -units, while the JR engine uses pixels as default size units. When exporting the report to the Excel output format, the -pixel-to-character width translation depends on the normal style default character width provided by the Excel instance, -so it cannot be always accurately fitted. In this case, one can alter the generated column widths by setting this property -with a float value representing the adjustment ratio. The property can be set: -
      -
    • globally - then all the columns in all documents exported to the Excel output format will be adjusted with the same width ratio
    • -
    • at report level - then all the columns in the document will be adjusted with the same width ratio
    • -
    • at element level - then all the columns in the current sheet will be adjusted with the same width ratio
    • -
    -Global settings are overriden by report level settings and report level settings are overriden by element level settings. If -present, a PROPERTY_COLUMN_WIDTH property will override the -PROPERTY_COLUMN_WIDTH_RATIO value for that column only. -
    - net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_COLUMN_WIDTH_RATIO - N/A - Global | Report | Element - 4.1.3 -
    - - - - - - -Property that specifies if the cell content is hidden or exposed in the formula bar of a protected sheet. -
    -Its value is used as default for the -isCellHidden() Excel export configuration setting. -
    -By default the property is not set (false), and the cell content is not hidden. -
    -This property has effect only if the enclosing sheet is protected. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_CELL_HIDDEN - false - Global | Report | Element - 3.7.5 -
    - - - - - - -Property that specifies if the cell content is locked (read-only) within a protected sheet. -
    -Its value is used as default for the -isCellLocked() Excel export configuration setting. -
    -By default the property is considered (true), but it only has effect if the enclosing sheet is protected. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_CELL_LOCKED - true - Global | Report | Element - 3.7.5 -
    - - - - - - -Flag property specifying whether the standard color palette should be customized so that the XLS result uses the original report colors. -
    -Its value is used as default for the -isCreateCustomPalette() Excel export configuration setting. -
    -The colors used in the result XLS are determined in the following manner: -
      -
    1. If this flag is not set, the nearest color from the standard XLS palette is chosen for a report color.
    2. -
    3. If the flag is set, the nearest not yet modified color from the palette is chosen and modified to exactly match the report color. -If all the colors from the palette are modified (the palette has a fixed size), the nearest color from the palette is chosen for further report colors.
    4. -
    -This property is by default not set (false). -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_CREATE_CUSTOM_PALETTE - false - Global | Report - 2.0.0 -
    - - - - - - -Property that specifies the value to be placed in the cell associated with the -PROPERTY_COLUMN_NAME -in the metadata-based Excel export. -
    -When working with this property, numbers have to be written with no thousand separators and using a period as decimal. For instance, 1,000,000 should be written as -"1000000" and 2,000.45 should be written as "2000.45". Dates must be written according to ISO 8601 standard: "yyyy-MM-dd'T'HH:mm:ss". -
    -By default this value is represented by the value stored in the report element this property is assigned to. -
    - net/sf/jasperreports/engine/export/JRXlsAbstractMetadataExporter.html#PROPERTY_DATA - N/A - Element - 4.0.2 -
    - - - - - - -Property that specifies whether the exporter should take into consideration the type of the original text field expressions and set the cell types and values accordingly. -
    -Its value is used as default for the -isDetectCellType() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_DETECT_CELL_TYPE - false - Global | Report - 2.0.1 -
    - - - - - - -Property used at print time to indicate the number of pages height to fit the sheet in. -
    -Its value is used as default for the -getFitHeight() Excel export configuration setting. -
    -Print pages for a given sheet in Excel are generated according to 'Paper size' settings in the Print menu, -with no respect to the initial pagination of the report. In this case differences between a JasperReport print page and a page in Excel may occur. -
    -Usually the content of a given sheet is considered to be printed into a single page. But when a sheet contains too many rows, including all of them in a single page may lead to an unreadable printed -document. In this case the sheet must be split into multiple print pages. In JasperReports this number of pages can be set with the net.sf.jasperreports.export.xls.fit.height property. -
    -Note: When this property is set to a value (for instance, n), Excel will estimate if n pages are enough to cover the entire sheet height, keeping font settings and row heights unchanged. -If the number of pages is too small, font and row height adjustments will be performed in order to make room for the entire content. The printed document will come out with smaller fonts and thinner -rows than those exposed in the related sheet. -
    -See also the net.sf.jasperreports.export.xls.fit.width property. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_FIT_HEIGHT - N/A - Global | Report - 3.7.5 -
    - - - - - - -Property used at print time to indicate the number of pages width to fit the sheet in. -
    -Its value is used as default for the -getFitWidth() Excel export configuration setting. -
    -Print pages for a given sheet in Excel are generated according to 'Paper size' settings in the Print menu, -with no respect to the initial pagination of the report. In this case differences between a JasperReport print page and a page in Excel may occur. -
    -In most common cases the content of a given sheet is supposed to be printed into a single page. But problems may occur when a sheet contains too many rows and/or columns and the printed page -becomes unreadable. If too many columns are involved, we can split the sheet width into multiple print pages, in order to make the content readable. In JasperReports this number of pages can -be set with the net.sf.jasperreports.export.xls.fit.width property. -
    -Note: When this property is set to a value (for instance, n), Excel will estimate if n pages are enough to cover the entire sheet width, keeping font settings and column widths unchanged. -If the number of pages is too small, font and column width adjustments will be performed in order to include the entire content into available pages. The printed document will come out with -smaller fonts and thinner columns than those exposed in the related sheet. -
    -See also the net.sf.jasperreports.export.xls.fit.height property. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_FIT_WIDTH - N/A - Global | Report - 3.7.5 -
    - - - - - - -Property that specifies the first page number in the page setup dialog. -
    -Its value is used as default for the -getFirstPageNumber() Excel export configuration setting. -
    -When the property is set at Element level, it can be used to set the first page number for the current sheet. -
    -Global settings are overriden by report level settings; report level settings are overriden by element (sheet) level settings. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_FIRST_PAGE_NUMBER - N/A - Global | Report | Element - 4.6.0 -
    - - - - - - -Flag property that indicates whether the font size should be decreased so that texts fit into the specified cell height. -
    -Its value is used as default for the -isFontSizeFixEnabled() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_FONT_SIZE_FIX_ENABLED - false - Global | Report - 2.0.1 -
    - - - - - - -Flag property that provides a default value for the isForcePageBreaks() export setting. -If set to true, the exporter will automatically add a page break at the end of each page exported on the current sheet. -
    -Allowed values are: -
      -
    • true
    • -
    • false
    • -
    -
    - net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_FORCE_PAGE_BREAKS - false - Global | Report - 6.0.2 -
    - - - - - - -Flag property that indicates whether local anchors should be ignored when elements are exported to Excel. -
    -Its value is used as default for the -isIgnoreAnchors() Excel export configuration setting. -
    -If set to true, local anchors will be excluded from export. -Otherwise they will be exported along with elements they belong to. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_IGNORE_ANCHORS - false - Global | Report - 4.6.0 -
    - - - - - - -Property that specifies whether cell background color should be ignored in the generated document. -
    -Its value is used as default for the -isIgnoreCellBackground() Excel export configuration setting. -
    -If the property is set at element level, its value will be applied only to the sheet containing that element. -Other sheets in the document will not be affected. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_IGNORE_CELL_BACKGROUND - false - Global | Report | Element (since 6.2.0) - 3.6.2 -
    - - - - - - -Property that specifies whether cell borders should be ignored in the generated document. -
    -Its value is used as default for the -isIgnoreCellBorder() Excel export configuration setting. -
    -If the property is set at element level, its value will be applied only to the sheet containing that element. -Other sheets in the document will not be affected. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_IGNORE_CELL_BORDER - false - Global | Report | Element (since 6.2.0) - 2.0.1 -
    - - - - - - -Property that specifies whether graphic elements should be ignored and only text elements will be exported. -
    -Its value is used as default for the -isIgnoreGraphics() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_IGNORE_GRAPHICS - false - Global | Report - 2.0.1 -
    - - - - - - -Property that specifies the image anchor type. Possible values are: -
      -
    • MoveSize - images move and size with cells
    • -
    • MoveNoSize - images move but don't size with cells
    • -
    • NoMoveNoSize - images don't move or size with cells
    • -
    -Global settings are overriden by report level settings; report level settings are overriden by element level settings. -
    -Its value is used as default for the -getImageAnchorType() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_IMAGE_ANCHOR_TYPE - MoveNoSize - Global | Report | Element - 5.0.4 -
    - - - - - - -Flag property that specifies whether the minimum image padding will be forced to 1 pixel, to avoid situations where the image hides the cell border. -
    -Its value is used as default for the -isImageBorderFixEnabled() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_IMAGE_BORDER_FIX_ENABLED - false - Global | Report - 3.0.0 -
    - - - - - - -Property that specifies the maximum number of rows allowed to be exported to the same sheet. Negative values or zero means that no limit has been set. -
    -Its value is used as default for the -getMaxRowsPerSheet() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_MAXIMUM_ROWS_PER_SHEET - 0 - Global | Report - 2.0.1 -
    - - - - - - -Property that specifies whether each report page should be written in a different XLS sheet. -
    -Its value is used as default for the -isOnePagePerSheet() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_ONE_PAGE_PER_SHEET - false - Global | Report - 2.0.1 -
    - - - - - - -Property that specifies whether the empty spacer columns should be removed or not. -
    -Its value is used as default for the -isRemoveEmptySpaceBetweenColumns() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS - false - Global | Report - 2.0.1 -
    - - - - - - -Property that specifies whether the empty spacer rows should be removed or not. -
    -Its value is used as default for the -isRemoveEmptySpaceBetweenRows() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_ROWS - false - Global | Report - 2.0.1 -
    - - - - - - -Property that specifies whether the text formatting (such as text color, background color, bold style, italic, underline, etc) -should be ignored in the resulting Excel document at export time or not. -
    -Its value is used as default for the -isIgnoreTextFormatting() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_IGNORE_TEXT_FORMATTING - false - Global | Report | Text Element - 6.0.4 -
    - - - - - - -Property that determines whether date values are to be translated to the timezone that was used to fill the report. -
    -Its value is used as default for the -isUseTimeZone() Excel export configuration setting. -
    -By default, date values are exported to Excel using the default timezone of the system. -Setting this property to true instructs the exporter to use he report fill timezone to export date values. -
    -The property only has effect when net.sf.jasperreports.export.xls.detect.cell.type is set. -
    - net/sf/jasperreports/engine/export/XlsExporterConfiguration.html#PROPERTY_USE_TIMEZONE - false - Global | Report | Element - 4.5.0 -
    - - - - - - -Property that specifies whether the page background should be white or the default XLS background color. -
    -Its value is used as default for the -isWhitePageBackground() Excel export configuration setting. -
    -If the property is set at element level, its value will be applied only to the sheet containing that element. -Other sheets in the document will not be affected. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_WHITE_PAGE_BACKGROUND - true - Global | Report | Element (since 6.2.0) - 2.0.1 -
    - - - - - - -Property used to store the location of an existing workbook template. -
    -Its value is used as default for the -getWorkbookTemplate() Excel export configuration setting. -
    -The content of an existing workbook document -or template can be embedded into exported document if the template location is known. In this case the content of -the template will be exported first and the content of the exported report will be appended to this one. Macros and -other settings in the existing template will be also preserved in the generated document. Templates can be loaded from -Excel template files (*.xlt) as well as from valid Excel documents (*.xls). -
    -This property is used in Excel exporters based either on Apache POI APIs -(JRXlsExporter) or on JExcelApi library -(JExcelApiExporter). There's no similar property -for the JRXlsxExporter. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_WORKBOOK_TEMPLATE - N/A - Global | Report - 4.5.1 -
    - - - - - - -Flag property that specifies whether to keep the sheets of the existing template into generated document. -
    -Its value is used as default for the -isKeepWorkbookTemplateSheets() Excel export configuration setting. -Sometimes is important to embed in a generated document only macros and/or other global settings from an existing template, but -without keeping the own sheets of the template document. If set to false, this property prevent the template sheets to be exported. -
    -This property is used in conjunction with PROPERTY_WORKBOOK_TEMPLATE. -
    -Allowed values are: -
      -
    • true
    • -
    • false - this is the default value.
    • -
    -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_WORKBOOK_TEMPLATE_KEEP_SHEETS - false - Global | Report - 4.5.1 -
    - - - - - - -Property that stores the formula which has to be applied to a given cell in an Excel sheet. - - net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_CELL_FORMULAstores the formula which has to be applied to a given cell in an Excel sheet. - N/A - Text Element - 3.0.0 - - - - - - - -Indicates the name of the first unlocked column in document's sheets. All columns to the left of this one will be 'frozen'. -Allowed values are letters or letter combinations representing valid column names in Excel, such as A, B, AB, AC, etc. -The property should be used when all sheets in the document have the same freeze column name.
    -The property is available for: -
      -
    • JRXlsExporter
    • -
    • JExcelApiExporter
    • -
    • JExcelApiMetadataExporter
    • -
    • JRXlsxExporter
    • -
    -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_FREEZE_COLUMN - N/A - Global | Report - 4.1.1 -
    - - - - - - -Property that indicates the vertical edge of the freeze pane, relative to the current cell. If set, it overrides the -PROPERTY_FREEZE_COLUMN value. -
    -Allowed values are: -
      -
    • -Left - the current column is the first unlocked column in the sheet. All columns to the left are 'frozen'. -
    • -
    • -Right - the current column is the last 'frozen' column in the sheet. All columns to the right are unlocked. -
    • -
    -If several elements in a sheet contain this property, the freeze pane edge will pick its value from the element -with maximum column index. -
    -The property is available for: -
      -
    • JRXlsExporter
    • -
    • JExcelApiExporter
    • -
    • JExcelApiMetadataExporter
    • -
    • JRXlsxExporter (since 6.2.0)
    • -
    -
    - net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_FREEZE_COLUMN_EDGE - N/A - Report Element - 4.1.1 -
    - - - - - - -Specifies the index of the first unlocked row in document's sheets. All rows above this will be 'frozen'. -Allowed values are represented by positive integers in the 1..65536 range. Negative values are not considered. -The property should be used when all sheets in the document have the same freeze row index.
    -The property is available for: -
      -
    • JRXlsExporter
    • -
    • JExcelApiExporter
    • -
    • JExcelApiMetadataExporter
    • -
    • JRXlsxExporter
    • -
    -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_FREEZE_ROW - N/A - Global | Report - 4.1.1 -
    - - - - - - -Property that indicates the horizontal edge of the freeze pane, relative to the current cell. If set, it overrides the -PROPERTY_FREEZE_ROW value. -
    -Allowed values are: -
      -
    • -Top - the current row is the first unlocked row in the sheet. All rows above are 'frozen'. -
    • -
    • -Bottom - the current row is the last 'frozen' row in the sheet. All rows below are unlocked. -
    • -
    -If several elements in a sheet contain this property, the freeze pane edge will pick its value from the element -with maximum row index. -
    -The property is available for: -
      -
    • JRXlsExporter
    • -
    • JExcelApiExporter
    • -
    • JExcelApiMetadataExporter
    • -
    • JRXlsxExporter (since 6.2.0)
    • -
    -
    - net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_FREEZE_ROW_EDGE - N/A - Report Element - 4.1.1 -
    - - - - - - -Property used to adjust the page content to a given percent of the normal size in the print preview pane. -
    -Its value is used as default for the -getPageScale() Excel export configuration setting. -
    -Allowed values are positive integers from 10 to 400, representing percents of the normal size. -
    -When the property is set at Element level, it can be used to set the page scale per sheet -
    -Global settings are overriden by report level settings; report level settings are overriden by element (sheet) level settings. -
    -The property overrides the PROPERTY_FIT_WIDTH and -PROPERTY_FIT_HEIGHT values. -
    -This property is by default not set (null). -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_PAGE_SCALE - N/A - Global | Report | Element - 4.6.0 -
    - - - - - - -Property that contains a String value representing the password in case of password protected sheets in documents. -
    -Its value is used as default for the -getPassword() Excel export configuration setting. -
    -This property is by default not set (null). -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_PASSWORD - N/A - Global | Report - 3.0.1 -
    - - - - - - -Property whose value is an Excel compatible pattern, to be used as replacement for the text field pattern when exporting to XLS formats. - - net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_CELL_PATTERN - N/A - Text Element - 4.1.1 - - - - - - - -Custom element property specifying if a sheet will break before the row displaying that element. -It is very useful especially when displaying each report's group on a separate sheet is intended. - - net/sf/jasperreports/engine/export/JRXlsAbstractExporterNature.html#PROPERTY_BREAK_BEFORE_ROW - false - Element - 3.0.0 - - - - - - - -Custom element property specifying if a sheet will break after the row displaying that element. -It is very useful especially when displaying each report's group on a separate sheet is intended. - - net/sf/jasperreports/engine/export/JRXlsAbstractExporterNature.html#PROPERTY_BREAK_AFTER_ROW - false - Element - 3.0.0 - - - - - - - -Property prefix used to indicate the current outline row level, and when necessary, the ending row of the current outline row -group with the given level. The suffix of these properties is associated with the outline level, while the property value indicates -if the current row group should continue or should end. The most recommended practice is to use the outline level itself as property -suffix, although this is not mandatory. The suffix may take any other string value, but one has to keep in mind that suffixes are -used as sorted row levels descriptors. For instance, because "aaa" < "bbb", the outline level associated with the "aaa" suffix -will be smaller than the level associated with the "bbb" suffix. A completely intuitive representation of the row levels uses the row -level as property suffix. -
    -In such a case, the net.sf.jasperreports.export.xls.outline.level.2 property means that its value is correlated with -the outline level 2, so the current row belongs to a level 2 row group. Based on Office Open XML specs, allowed values for outline -levels are positive integers from 1 to 7. -
    -The value of this property could be any expression (including null). When such a property occurrence is met, the suffix -indicates the outline level for that row. If multiple properties with the same prefix are defined for the same row, the deepest -outline level is considered for that row. To end an outline row group one has to set the related outline level property with the -End value. This is a special property value instructing the JR engine that the current row group of that level ends -on the current row. -
    - net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_ROW_OUTLINE_LEVEL_PREFIX - N/A - Element - 4.1.3 -
    - - - - - - -Property that specifies whether the value associated with -PROPERTY_COLUMN_NAME -should be repeated or not when it is missing. This property is available for the metadata-based Excel export. - - net/sf/jasperreports/engine/export/JRXlsAbstractMetadataExporter.html#PROPERTY_REPEAT_VALUE - false - Element - 4.0.2 - - - - - - - -This property indicates if the sheet is left-to-right or right-to-left oriented. Possible values are: -
      -
    • LTR
    • -
    • RTL
    • -
    -Its value is used as default for the -getSheetDirection() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_SHEET_DIRECTION - LTR - Global | Report - 3.7.5 -
    - - - - - - -Custom property storing the text content of the sheet footer's center. -
    -Its value is used as default for the -getSheetFooterCenter() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_SHEET_FOOTER_CENTER - N/A - Global | Report - 3.7.5 -
    - - - - - - -Custom property storing the text content of the left side of the sheet footer. -
    -Its value is used as default for the -getSheetFooterLeft() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_SHEET_FOOTER_LEFT - N/A - Global | Report - 3.7.5 -
    - - - - - - -Custom property storing the text content of the right side of the sheet footer. -
    -Its value is used as default for the -getSheetFooterRight() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_SHEET_FOOTER_RIGHT - N/A - Global | Report - 3.7.5 -
    - - - - - - -Custom property storing the text content of the sheet header's center. -
    -Its value is used as default for the -getSheetHeaderCenter() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_SHEET_HEADER_CENTER - N/A - Global | Report - 3.7.5 -
    - - - - - - -Custom property storing the text content of the left side of the sheet header. -
    -Its value is used as default for the -getSheetHeaderLeft() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_SHEET_HEADER_LEFT - N/A - Global | Report - 3.7.5 -
    - - - - - - -Custom property storing the text content of the right side of the sheet header. -
    -Its value is used as default for the -getSheetHeaderRight() Excel export configuration setting. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_SHEET_HEADER_RIGHT - N/A - Global | Report - 3.7.5 -
    - - - - - - -Property used to set the name of the sheet containing a given element. Its value overrides the report-level settings for the sheet name. -
    -If several elements in the sheet contain this property, the engine will consider the value of the last exported element's property. -
    - net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_SHEET_NAME - N/A - Element - 4.1.3 -
    - - - - - - -A set of report custom properties (exporter hints) added in order to hold user defined sheet names. This is very useful when -indicating sheet names in the jrxml template is required. -
    -Sheet names in these properties are used as default for the -getSheetNames() Excel export configuration setting. -
    -These properties should start with the -net.sf.jasperreports.export.xls.sheet.names. prefix, and should end with an -arbitrary suffix. Any of them can hold one or many sheet names, -separated by the slash ("/") separator. Values are collected in the same -order as they are enumerated in the jrxml template, so one have to be careful with that -order when editing a jrxml. The ending suffix is not important, but the order -is very. -
    -For instance, if a given report has 3 resulting sheets, there are multiple -possibilities to define the sheet names within the jrxml template: -
    -
    -
      -
    1. To have a single property for each sheet name: -
      -
      - -<property name="net.sf.jasperreports.export.xls.sheet.names.sheet1" -value="First sheet" /> -
      -<property name="net.sf.jasperreports.export.xls.sheet.names.second.sheet.name" -value="Second sheet" /> -
      -<property name="net.sf.jasperreports.export.xls.sheet.names.3" value="Third -sheet" />
      -
      -
      -Then, the 3 resulting sheets will be named as follows: -
      -
      -First sheet -
      -Second sheet -
      -Third sheet -
      -
      -
    2. -
    3. -To have a single property containing all sheet names, separated by the "/" -separator: -
      -
      - -<property name="net.sf.jasperreports.export.xls.sheet.names.all" value="First -sheet/Second sheet/Third sheet" /> -
      -
      -Then, the 3 resulting sheets will be named as follows: -
      -
      -First sheet -
      -Second sheet -
      -Third sheet -
      -The order is very important, as shown above. -
      -
      -
    4. -
    5. -To have any combination of 1) and 2): -
      -
      - -<property name="net.sf.jasperreports.export.xls.sheet.names.first" value="First -sheet" /> -
      -<property name="net.sf.jasperreports.export.xls.sheet.names.others" -value="Second sheet/Third sheet" />
      -
      -
      -Then, the 3 resulting sheets will be named as follows: -
      -
      -First sheet -
      -Second sheet -
      -Third sheet -
    6. -
    -
    -Finally, if the user sets less sheet names (let's say x) than the -number of sheets, the exporter will use the custom user sheet names for the -first x sheets in the document, and the remaining sheets will be named by -default as "Page y", where y is the current page number. -
    -These properties are by default not set. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_SHEET_NAMES_PREFIX - N/A - Report - 3.5.2 -
    - - - - - - -Property whose value is used to set the tab color of a given sheet in XLSX and ODS output formats. -When set at report level, all sheets in the document will have their tabs colored the same way. -When set at report element level and multiple elements in a sheet provide this property, -the last read value will be considered. -
    -Its value usually can be expressed as #-prefixed CSS color. -
    -Report-level settings are overriden by element-level settings for this property. -If several elements in a sheet contain this property, the engine will consider the value of the -last exported element's property. -
    -Note: This property is not supported by the XLS output format. -
    - net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_SHEET_TAB_COLOR - N/A - Global | Report | Element - 6.2.0 -
    - - - - - - -Flag property that specifies if the gridlines in a given sheet are shown. -
    -Its value is used as default for the -isShowGridLines() Excel export configuration setting. -
    -If multiple elements in a sheet provide this property, the last read value will be considered. -Global settings are overriden by report level settings; report level settings are overriden by element (sheet) level settings. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_SHOW_GRIDLINES - true - Global | Report | Element - 4.8.0 -
    - - - - - - -Flag property that indicates whether the text font size should be decreased in order to -keep the entire text visible in the cell. If set to true, this will automatically disable the -wrap text setting for the cell (see net.sf.jasperreports.export.xls.wrap.text). -
    -Usually this property works in conjunction with net.sf.jasperreports.print.keep.full.text, -in order to preserve the entire text content at export time. -
    -The value of this property is used as default for the -isShrinkToFit() Excel export configuration setting. -
    -Settings at global level are overriden by report level settings; report level settings are overriden by element level settings. -
    - net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_SHRINK_TO_FIT - false - Global | Report | Element - 6.0.2 -
    - - - - - - -Custom element property specifying if text wrapping is allowed in a given cell. -
    -Its value is used as default for the -isWrapText() Excel export configuration setting. -
    -If set to false, text wrapping is forbidden, otherwise it is allowed. -
    - net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_WRAP_TEXT - true - Global | Report | Element - 3.7.3 -
    - - - - - - -Property that specifies whether the export header (the column names) should be written or not, in the metadata-based Excel export. -
    -Its value is used as default for the -isWriteHeader() Excel metadata export configuration setting. -
    - net/sf/jasperreports/export/XlsMetadataExporterConfiguration.html#PROPERTY_WRITE_HEADER - false - Element - 4.0.2 -
    - - - - - - -Property used to store the location of an existing Excel 2007 workbook template containing a macro object. -When exporting into Excel 2007 format, the macro object will be copied into the generated document if the template location is valid. -Macros can be loaded from Excel 2007 macro-enabled template files (*.xltm) as well as from valid -Excel macro-enabled documents (*.xlsm). -
    -The value of this property is used as default for the -getMacroTemplate() Excel 2007 export configuration setting. -
    - net/sf/jasperreports/export/XlsxExporterConfiguration.html#PROPERTY_MACRO_TEMPLATE - N/A - Global | Report - 4.5.1 -
    - - - - - - When set to false, it forces the engine to check if the font used as value for the fontName attribute inside -the report template is available either through the JasperReports font extension mechanism or as a JVM accesible font, -and raise a JRFontNotFoundException exception, if this font is not available. - net/sf/jasperreports/engine/util/JRStyledText.html#PROPERTY_AWT_IGNORE_MISSING_FONT - false - Global | Report - 3.6.1 - - - - - - - - - net/sf/jasperreports/engine/util/JRStyledText.html#PROPERTY_AWT_SUPERSCRIPT_FIX_ENABLED - N/A - Global - 3.1.3 - - - - - - - - - - net/sf/jasperreports/engine/export/JRXmlExporter.html#PROPERTY_START_PAGE_INDEX - N/A - Global | Report - 3.0.1 - - - - - - - - - net/sf/jasperreports/engine/export/JRXmlExporter.html#PROPERTY_END_PAGE_INDEX - N/A - Global | Report - 3.0.1 - - - - - - - - - net/sf/jasperreports/engine/export/JRXmlExporter.html#PROPERTY_PAGE_COUNT - N/A - Global | Report - 3.0.0 - - - - - - - - - net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_TABLE - N/A - Element - 3.1.2 - - - - - - - - - net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_TR - N/A - Element - 3.1.2 - - - - - - - - - net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_TH - N/A - Element - 3.1.2 - - - - - - - - - net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_TD - N/A - Element - 3.1.2 - - - - - - - - - net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_H1 - N/A - Element - 3.1.2 - - - - - - - - - net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_H2 - N/A - Element - 3.1.2 - - - - - - - - - net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_H3 - N/A - Element - 3.1.2 - - - - - - - - - net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_COLSPAN - N/A - Element - 3.1.2 - - - - - - - - - net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_ROWSPAN - N/A - Element - 3.1.2 - - - - - - - -An integer property that provides the minimum precision to be used for java.math.BigDecimal division operations. -Important note: this property is only effective when Java 1.5 or newer is used. See BigDecimalUtils for details. - - net/sf/jasperreports/engine/util/Java15BigDecimalHandler.html#PROPERTY_MINIMUM_PRECISION - 16 - Global - 3.5.4 - - - - - - - - -Properties having this prefix specify the version for the associated built-in component in a given report. Built-in components are those who are shipped as part of the -JasperReports Library JAR. -
    -For instance, for the table component shipped with JR distribution, the version is given with a property as follows: -
    -
    -<property name="net.sf.jasperreports.components.table.version" value="4.0.0" /> -
    -
    -If not specified, the component version is considered to be the one specified by the net.sf.jasperreports.report.version. -
    - net/sf/jasperreports/engine/component/ComponentXmlWriter.html#PROPERTY_COMPONENT_VERSION_PREFIX - N/A - Global | Report | Element - 4.8.0 -
    - - - - - - -Property whose value is used to check the availability of printers accepting jobs. - - net/sf/jasperreports/engine/JasperPrintManager.html#PROPERTY_CHECK_AVAILABLE_PRINTERS - true - Global | Report - 3.7.3 - - - - - - - -A boolean property that determines whether the HTML exporter should flush the output stream after writing the HTML content to it. - - net/sf/jasperreports/export/HtmlExporterConfiguration.html#PROPERTY_FLUSH_OUTPUT - true - Global | Report - 3.7.1 - - - - - - - -Property that determines if missing bookmark levels are collapsed, or if -empty bookmarks are created for the missing levels. -

    -The property dictates what happens when a filled report contains an anchor -having a bookmark level that is not the immediate successor of its parent -(e.g. an anchor with bookmark level 3 follows immediately after a bookmark -of level 1). -If the property is not set, an empty bookmark is created for the missing -level(s) in order to preserve the original level of the bookmark. -When the property is set, the level of the bookmark will be collapsed and -the bookmark will be created as a direct descendant of its nearest parent. -

    -
    - net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_COLLAPSE_MISSING_BOOKMARK_LEVELS - false - Global | Report - 3.7.3 -
    - - - - - - -Property which specifies if the size of each page should be increased to accommodate its content. - - net/sf/jasperreports/export/PdfReportConfiguration.html#PROPERTY_SIZE_PAGE_TO_CONTENT - false - Global | Report - 4.7.0 - - - - - - - -Flag property that indicates whether the absolute path to be used instead, when resources are not found in the file repository. - - net/sf/jasperreports/repo/FileRepositoryServiceExtensionsRegistryFactory.html#PROPERTY_FILE_REPOSITORY_RESOLVE_ABSOLUTE_PATH - false - Global - 4.1.1 - - - - - - - - -Specifies the file repository root location. - - net/sf/jasperreports/repo/FileRepositoryServiceExtensionsRegistryFactory.html#PROPERTY_FILE_REPOSITORY_ROOT - N/A - Global - 4.1.1 - - - - - - - - -Determines how page breaks are to be handled in reports that are not paginated. -
    -Possible values are: -
      -
    • ignore - page breaks are ignored in non paginated reports.
    • -
    • apply - page breaks are honoured in non paginated reports.
    • -
    -
    - net/sf/jasperreports/engine/JRBreak.html#PROPERTY_PAGE_BREAK_NO_PAGINATION - ignore - Global | Report | Element - 5.0.4 -
    - - - - - - -The default locale used to fill reports. The property is overridden by the REPORT_LOCALE parameter value. - - net/sf/jasperreports/engine/fill/JRFiller.html#PROPERTY_DEFAULT_LOCALE - system locale - Global | Report - 5.2.0 - - - - - - - -The default time zone used to fill reports. The property is overridden by the REPORT_TIME_ZONE parameter value. - - net/sf/jasperreports/engine/fill/JRFiller.html#PROPERTY_DEFAULT_TIMEZONE - system time zone - Global | Report - 5.2.0 - - - - - - - -Provides a default pattern to be used for java.sql.Date values. - -

    -Locale specific values can be configured by appending _<locale code> to the property name. -

    - -

    -The property can be set at global/JasperReports context level. -

    -
    - net/sf/jasperreports/engine/JRTextField.html#PROPERTY_PATTERN_DATE - N/A - Global - 6.0.0 -
    - - - - - - -Provides a default pattern to be used for java.sql.Time values. - -

    -Locale specific values can be configured by appending _<locale code> to the property name. -

    - -

    -The property can be set at global/JasperReports context level. -

    -
    - net/sf/jasperreports/engine/JRTextField.html#PROPERTY_PATTERN_TIME - N/A - Global - 6.0.0 -
    - - - - - - -Provides a default pattern to be used for java.util.Date values other than java.sql.Date and java.sql.Time. - -

    -Locale specific values can be configured by appending _<locale code> to the property name. -

    - -

    -The property can be set at global/JasperReports context level. -

    -
    - net/sf/jasperreports/engine/JRTextField.html#PROPERTY_PATTERN_DATETIME - N/A - Global - 6.0.0 -
    - - - - - - -Provides a default pattern to be used for numerical values that are known to be integer, i.e. integer primitive wrapper types and java.math.BigInteger. - -

    -Locale specific values can be configured by appending _<locale code> to the property name. -

    - -

    -The property can be set at global/JasperReports context level. -

    -
    - net/sf/jasperreports/engine/JRTextField.html#PROPERTY_PATTERN_INTEGER - N/A - Global - 6.0.0 -
    - - - - - - -Provides a default pattern to be used for numerical values other than the integer types. - -

    -Locale specific values can be configured by appending _<locale code> to the property name. -

    - -

    -The property can be set at global/JasperReports context level. -

    -
    - net/sf/jasperreports/engine/JRTextField.html#PROPERTY_PATTERN_NUMBER - N/A - Global - 6.0.0 -
    - - - - - - -Provides the default border split type for frames. - -

    -The property can be set at report and global/JasperReports context levels. -The property value can be NoBorders, in which case frames that span two pages do not have the bottom border of the first fragment and the top border of the second fragment drawn, -and DrawBorders, in which case both fragments have borders drawn on all sides. -

    -
    - net/sf/jasperreports/engine/JRFrame.html#PROPERTY_BORDER_SPLIT_TYPE - NoBorders - Global | Report - 6.0.0 -
    - - - - - - -Property specifying the default time zone to be used for sending and retrieving date/time values to and from the database. - -

    -The property can be set globally, at dataset level, at parameter and field levels, and as a report/dataset parameter. -Note that sending a value as parameter will override all properties, and the time zone will be used for all date/time parameters and fields in the report. -

    - -

    -The property value can be a time zone ID or REPORT_TIME_ZONE. -In the latter case the report time zone (as in JRParameter.REPORT_TIME_ZONE will be used. -

    -
    - net/sf/jasperreports/engine/query/JRJdbcQueryExecuterFactory.html#PROPERTY_TIME_ZONE - N/A - Global | Dataset | Parameter | Field - 6.1.0 -
    - - - - - - -Property that determines whether loading entities that are not known to the engine is allowed. - - net/sf/jasperreports/engine/xml/JRXmlDigester.html#PROPERTY_LOAD_UNKNOWN_ENTITIES - false - Global - 6.2.1 - - - - \ No newline at end of file diff -Nru jasperreports-6.2.2/docs/config.reference.xsl jasperreports-6.3.1/docs/config.reference.xsl --- jasperreports-6.2.2/docs/config.reference.xsl 2016-05-03 12:21:03.000000000 +0000 +++ jasperreports-6.3.1/docs/config.reference.xsl 1970-01-01 00:00:00.000000000 +0000 @@ -1,354 +0,0 @@ - - - - - - - - - - - api/ - http://jasperreports.sourceforge.net/api/ - - - - - - -JasperReports <xsl:value-of select="$version"/> - Configuration Reference - - - - - - - - - - - - - - - - - - - - - - - - -
    - -JasperReports-Ultimate-Guide-3.pdfJasperReports Ultimate Guide - -sample.reference.htmlSample Reference - -schema.reference.htmlSchema Reference - -config.reference.htmlConfiguration Reference - -http://community.jaspersoft.com/wiki/jasperreports-library-faqsFAQ - -index.htmlAPI (Javadoc) -
    -
    -
    -
    -JasperReports - Configuration Reference (version ) - - -
    -
    -
    - -
    - -This document lists all the configuration properties available for the JasperReports library. - - - - - - - - - - - - - - - -


    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -






    top


    API - - - - - - - - - - -
    Default
    Scope
    Since




    - © 2001- TIBCO Software Inc. www.jaspersoft.com -
    - - - -
    - - - - - - - - - - - - - NOTE: - - Properties with this prefix are - This property is - not read from the configuration context. This - - http://community.jaspersoft.com/wiki/setting-non-context-configuration-properties-dynamically - _blankFAQ shows the additional steps to follow in order to set - - them - it - dynamically. - - - - - - - - - - - - - # - - - - - - - - - - - - - - -

    -
    - - - -
    -
    - - - - - - - - - _blank - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    diff -Nru jasperreports-6.2.2/docs/parts.schema.reference.xsl jasperreports-6.3.1/docs/parts.schema.reference.xsl --- jasperreports-6.2.2/docs/parts.schema.reference.xsl 2016-05-03 12:21:03.000000000 +0000 +++ jasperreports-6.3.1/docs/parts.schema.reference.xsl 1970-01-01 00:00:00.000000000 +0000 @@ -1,498 +0,0 @@ - - - - - - - - - - - api/ - http://jasperreports.sourceforge.net/api/ - - - - - - -JasperReports <xsl:value-of select="$version"/> - Report Parts Schema Reference - - - - - - - - - - - - - - - - - - - - - - - - -
    - -JasperReports-Ultimate-Guide-3.pdfJasperReports Ultimate Guide - -sample.reference.htmlSample Reference - -schema.reference.htmlSchema Reference - -config.reference.htmlConfiguration Reference - -http://community.jaspersoft.com/wiki/jasperreports-library-faqsFAQ - -index.htmlAPI (Javadoc) -
    -
    -
    -
    -JasperReports - Report Parts Schema Reference (version ) - - -
    -
    -
    - -
    - -This document describes the JRXML structure of the built-in report parts for the JasperReports Library. - - - - - - - - - - - - - - - - - - - - -


    -
    Other JasperReports Library Schemas
    -
    - Report Schema Reference -
    - Components Schema Reference -
    -
    Report Parts Schema Reference
    -
    - - - - - - - - - - - - - - - - - - - - - - -



    - © 2001- TIBCO Software Inc. www.jaspersoft.com -
    - - - - - - - - -
    - -
    top - - - -
    - - - - - - - - - - - - - -
    Attributes
    - - -
    -
    - - - - - - - - - - -
    Parent type:
    schema.reference.html#_blank. - -
    - - - - - - - - -
    Attributes
    - - -
    -
    - - - - -
    Contains
    - - -
    - - - - - - - - - - - - - - - - - -

    -
    - - - - - - - - -
    -
    - - - - - - - - - #<> - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - -
    - - - - # - - - - # - - - - # - - - attribute - - - - - - - - Type: - - - - Use: - - - - - Values - - - - - - -
    - - -
    - - - - Values - - - - - - -
    - - -
    - - - - Values - - - - - - -
    - - -
    - - - - Default: - - - -
    - - - - - - - - # - - - - - - - - schema.reference.html# - _blank - - - - *? - - - - - - - - - ( - - - - # - - - - - - schema.reference.html# - _blank - - - *? - - - - (in ) - (in ) - - - - - | - )*? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/docs/resources/jasperreports.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/docs/resources/jasperreports.png differ diff -Nru jasperreports-6.2.2/docs/resources/jasperreports.svg jasperreports-6.3.1/docs/resources/jasperreports.svg --- jasperreports-6.2.2/docs/resources/jasperreports.svg 2016-05-03 12:21:03.000000000 +0000 +++ jasperreports-6.3.1/docs/resources/jasperreports.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,164 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/docs/resources/jr-16x16.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/docs/resources/jr-16x16.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/docs/resources/px.gif and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/docs/resources/px.gif differ diff -Nru jasperreports-6.2.2/docs/sample.reference.xml jasperreports-6.3.1/docs/sample.reference.xml --- jasperreports-6.2.2/docs/sample.reference.xml 2016-05-03 12:21:03.000000000 +0000 +++ jasperreports-6.3.1/docs/sample.reference.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ - - - - - - General - - - - - - - - - - Report Design - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Components - - - - - - - - - - - - - - - - - Report Compilation - - - - - - - - - - - - - - Data Source / Query Executer - - - - - - - - - - - - - - - - - - - - - - Report Filling - - - - - - - - - - Report Export - - - - - - - - - - - - - - diff -Nru jasperreports-6.2.2/docs/sample.reference.xsl jasperreports-6.3.1/docs/sample.reference.xsl --- jasperreports-6.2.2/docs/sample.reference.xsl 2016-05-03 12:21:03.000000000 +0000 +++ jasperreports-6.3.1/docs/sample.reference.xsl 1970-01-01 00:00:00.000000000 +0000 @@ -1,260 +0,0 @@ - - - - - - - - - - - api/ - http://jasperreports.sourceforge.net/api/ - - - - - - -JasperReports <xsl:value-of select="$version"/> - Sample Reference - - - - - - - - - - - - - - - - - - - - - - - - -
    - -JasperReports-Ultimate-Guide-3.pdfJasperReports Ultimate Guide - -sample.reference.htmlSample Reference - -schema.reference.htmlSchema Reference - -config.reference.htmlConfiguration Reference - -http://community.jaspersoft.com/wiki/jasperreports-library-faqsFAQ - -index.htmlAPI (Javadoc) -
    -
    -
    -
    -JasperReports - Sample Reference (version ) - - -
    -
    -
    - -
    - -This document lists all the major features of the JasperReports library, as shown in the samples shipped with the project's source code package. - - - - - - - - - - - - - -


    -
    -
    - - - - - - - - - - - -



    - © 2001- TIBCO Software Inc. www.jaspersoft.com -
    - - - -
    - - - - - - - - - - sample.reference//index.html#incomplete - - - sample.reference//index.html#complete - - - - - - - - - - - - - - sample.reference//index.html - - - - - - - - - - - - - - -

    -
    - - - -
    -
    - - - - _blank - - - - - - - - - - - - - - - - - - - - - - - -
    diff -Nru jasperreports-6.2.2/docs/sample.xsl jasperreports-6.3.1/docs/sample.xsl --- jasperreports-6.2.2/docs/sample.xsl 2016-05-03 12:21:03.000000000 +0000 +++ jasperreports-6.3.1/docs/sample.xsl 1970-01-01 00:00:00.000000000 +0000 @@ -1,476 +0,0 @@ - - - - - - - - - - - - ../../api/ - http://jasperreports.sourceforge.net/api/ - - - - - - -JasperReports <xsl:value-of select="$version"/> - <xsl:value-of select="sample/title"/> - - - - - - - - - - - - - - - - - - - - - - - - -
    - -../../JasperReports-Ultimate-Guide-3.pdfJasperReports Ultimate Guide - -../../sample.reference.htmlSample Reference - -../../schema.reference.htmlSchema Reference - -../../config.reference.htmlConfiguration Reference - -index.htmlAPI (Javadoc) -
    -
    -
    -
    -JasperReports - (version ) - - -
    -
    -
    - -
    - - -
    -
    -http://sourceforge.net/projects/jasperreports/files/jasperreports/JasperReports%20/jasperreports--project.zip/download_blankDownload All Sample Source Files -
    -http://sourceforge.net/p/jasperreports/code/ci//tree/jasperreports/demo/samples//_blankBrowse Sample Source Files on Git - - - - - - - - - - - - - - - - - - - - - - - - - -


    - Main Features in This Sample -

    - Secondary Features -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


    top

    - - - Documented by - - - - mailto:copy - - - - - - , - - - -
    -
    -


    Description / Goal

    Since

    Other Samples
    - - - - - - -
    -



    - -
    - - - - - - - - -

    -© 2001- TIBCO Software Inc. www.jaspersoft.com -
    - - - - - - - - - - - - - - - - - - - -
    - - - - # - - - - -
    - - - - - - - ..//index.html# - - - - - - - ..//index.html - - - - - - - -

    - -

    -
    - - - -
    -
    - - - - - - - - - _blankelement - - - - - - - - - - - - ../../sample.reference//index.html# - subtitle - - - - - - - - - - - -0 - - - - - ../../schema.reference.html#<> - - - - - - - - _blank - - - - - - - -..//index.html/demo/samples/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - diff -Nru jasperreports-6.2.2/docs/schema.reference.xsl jasperreports-6.3.1/docs/schema.reference.xsl --- jasperreports-6.2.2/docs/schema.reference.xsl 2016-05-03 12:21:03.000000000 +0000 +++ jasperreports-6.3.1/docs/schema.reference.xsl 1970-01-01 00:00:00.000000000 +0000 @@ -1,778 +0,0 @@ - - - - - - - - - - - api/ - http://jasperreports.sourceforge.net/api/ - - - - - - -JasperReports <xsl:value-of select="$version"/> - Schema Reference - - - - - - - - - -
    - - - - - - - - - - - - - - -
    - -JasperReports-Ultimate-Guide-3.pdfJasperReports Ultimate Guide - -sample.reference.htmlSample Reference - -schema.reference.htmlSchema Reference - -config.reference.htmlConfiguration Reference - -http://community.jaspersoft.com/wiki/jasperreports-library-faqsFAQ - -index.htmlAPI (Javadoc) -
    -
    -
    -
    -JasperReports - Schema Reference (version ) - - -
    -
    -
    - -
    - -This document describes the JRXML structure of the report template files for the JasperReports Library. - - - - - - - - - - - - - - - - - - - - -


    -
    Other JasperReports Library Schemas
    -
    - Report Parts Schema Reference -
    - Components Schema Reference -
    -
    Report Schema Reference
    -
    - - - - - -
    - - - # - - - - - - - - - (in ) - (in ) - - -
    - - </td><td> - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    1. Named Enumeration Types
    -
    top

    - Values: -
    - - - -
    -
    -

    2. Named Complex Types
    -
    top

    - abstract type

    Attributes
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -





    -
    3. Schema Elements
    -
    - - - - - - top

    - - (in ) - (in ) - - -
    Type: - - - # - - - - - -

    Attributes



    - © 2001- TIBCO Software Inc. www.jaspersoft.com -
    - - - - - - - - - - - -
    Parent type:
    schema.reference.html#_blank. - -
    - - - - - - - -
    Contains
    - - -
    - - - -
    Attributes
    - - -
    - -
    - - - - - -
    Contains
    - - -
    - - - - - - - - - - - - - - - - - - -

    -
    - - - - - - - - -
    -
    - - - - - - - - - #<> - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - -
    #attribute - - - - - - - - - Type: - - - # - - - - - - - - - - - Use: - - - - - - Base Type: - - - - - - Values - - - - - - -
    - - -
    - - - - Values - - - - - - -
    - - -
    - - - - Values - - - - - - -
    - - -
    - - - - Values - - - - - - -
    - - -
    - - - - Default: - - - -
    - - - - - - - - # - - - - - - # - - - *? - -
    -
    - - -
    - - - - - - - ( - - - - # - - - - - - # - - - *? - - - - (in ) - (in ) - - - - - | - )*? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - # - - - - # - - - - # - - - attribute - - - - - - - - Type: - - - - Use: - - - - - Values - - - - - - -
    - - -
    - - - - Values - - - - - - -
    - - -
    - - - - Values - - - - - - -
    - - -
    - - - - Default: - - - -
    - - diff -Nru jasperreports-6.2.2/.gitignore jasperreports-6.3.1/.gitignore --- jasperreports-6.2.2/.gitignore 2016-05-03 12:21:02.000000000 +0000 +++ jasperreports-6.3.1/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -/build -/dist -/target diff -Nru jasperreports-6.2.2/ivysettings.xml jasperreports-6.3.1/ivysettings.xml --- jasperreports-6.2.2/ivysettings.xml 2016-05-03 12:21:03.000000000 +0000 +++ jasperreports-6.3.1/ivysettings.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ - - - - - - - - - - diff -Nru jasperreports-6.2.2/ivy.xml jasperreports-6.3.1/ivy.xml --- jasperreports-6.2.2/ivy.xml 2016-05-03 12:21:03.000000000 +0000 +++ jasperreports-6.3.1/ivy.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ - - - - JasperReports Library - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru jasperreports-6.2.2/jasperreports/build.xml jasperreports-6.3.1/jasperreports/build.xml --- jasperreports-6.2.2/jasperreports/build.xml 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/build.xml 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,282 @@ + + + Helps build the JasperReports distribution files. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + +
    +
    + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +JasperReports API (version ${version}) + + +]]> + + +© 2001 - ${CURRENT_YEAR} TIBCO Software Inc.
    www.jaspersoft.com +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jasperreports-6.2.2/jasperreports/changes.txt jasperreports-6.3.1/jasperreports/changes.txt --- jasperreports-6.2.2/jasperreports/changes.txt 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/changes.txt 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,2285 @@ + +JasperReports Library Change Log +============================================= + +JasperReports 6.3.1 (2016-10-03) +--------------------------------------------- + +- new JSONQL query language with advanced syntax for queries and for field mapping +expressions to allow more complex field mapping scenarios including the ability to map +fields to the parent node values; this new query language and its respective query executer, +which offers XPath-like capabilities, deprecate the existing JSON query language and +the former query executer; + +- support for request headers was added to HTTP data adapters as well as improved +parameter mapping using custom parameter properties to markup dataset parameters which +contribute to the HTTP request; the new sample under /demo/samples/httpdataadapters shows +some of these improvements; + +- new evaluationTime attribute added to dataset parameter definition to control the exact +moment when the default value expression of the parameter is evaluated; the default evaluation +time for parameters which do not specify a value for the attribute is controlled using the +net.sf.jasperreports.parameter.evaluation.time configuration property; + +- support for property expressions added for dataset fields to allow more flexibility in +data source and query executer field mapping; + +- the use of the fieldDescription attribute in data source and query executer field mapping +is now deprecated by the introduction of special field level custom properties for each type +of data source and query executer; + +- support for property expressions in dataset was added to allow more flexibility in dataset +and report configuration, including the ability to control export properties using report parameters; +the report and dataset property expressions can be evaluated at different moments and this is +controlled by the their evaluationTime attribute; when evaluationTime attribute is not specified +for a property expression, it defaults to the value specified by the +net.sf.jasperreports.property.evaluation.time configuration property; + +- multiple chart customizer objects can be registered per chart element using new configuration +properties having the net.sf.jasperreports.customizer.class.{arbitrary_name} format; +the new sample under /demo/samples/chartcustomizers introduces a set of pre-defined chart +customizers which are ready to use in reports; + +- the data adapter extension is now enabled by default in all JasperReports deployments; + +- the XLS, XLSX, DOCX and PPTX exporters were enhanced to support specifying metadata +information such as title, subject, author, keywords and creator application for the +generated documents using export configuration properties; + +- minor bug fixes and improvements; + + + + + +JasperReports 6.3.0 (2016-06-20) +--------------------------------------------- + +- upgrade to Java 7; starting with this release, the binary distribution of the JR library +is compiled for the Java 7 platform and is no longer guaranteed to be compatible with Java 6; + +- deprecation of DTD based validation for style template files (*.jrtx) and introduction of +XML schema based validation; + +- minor bug fixes and improvements; + + + + + +JasperReports 6.2.2 (2016-05-06) +--------------------------------------------- + +- adding new types of element stretch and deprecating some of the existing ones, +to differentiate between element group stretch and container stretch and to +also account for the current vertical displacement of the element; + +- introducing new generic Renderable interface for image rendering while +deprecating the existing one and its implementations, to better differentiate +between static visualizations such as images, SVGs, and dynamically generated +drawings, each identified by separate specialized renderable interface, +with convenience implementation classes; + +- built-in support for SVG as image format, including support for embedding +SVG in HTML export; + +- making use of fonts from JR font extensions when rendering SVG with Apache Batik +as well as use of Web fonts in the SVG embedded into the HTML export; + +- enhanced support for internationalization, with the addition of font set definitions +in JR font extensions, to allow grouping font families in super-sets that can cover +several languages/scripts; when using a font set, the font family resolution occurs +during text processing and is performed on a per character basis, allowing mixing of words +in different languages/scripts in the same text element; + +- support for calling PL/SQL stored procedures (Oracle), which was available +as a separate query executer extension, is now part of the JR core library; + +- minor bug fixes and improvements; + + + + + +JasperReports 6.2.1 (2016-03-22) +--------------------------------------------- + +- removed all JAR dependencies from project and introduced Apache Ivy dependency management +for building the distribution files and running the samples; + +- support for embedding Base64 encoded images in HTML export using the new +"net.sf.jasperreports.export.html.embed.image" configuration property; + +- new CSV export configuration properties for controlling the field encoding character +(net.sf.jasperreports.export.csv.field.enclosure) and also for forcing field enclosure +(net.sf.jasperreports.export.csv.force.field.enclosure); + +- rendering of ellipses and round corner rectangles using SVG in HTML export; + +- minor bug fixes and improvements; + + + + + +JasperReports 6.2.0 (2015-11-11) +--------------------------------------------- + +- improved PDF export accessibility in compliance with Section 508 Amendment to +the Rehabilitation Act of 1973, by adding support for making headings up to level 6, +marking lists and automatic insertion of table markers for table component output; + +- support for complex scripts (such as Indic scripts) in PDF by means of AWT text layout; + +- added support for duration based filter and duration based conditional formatting of +numeric columns in table components; special format pattern [h]:mm:ss causes numeric values +to be treated as duration; + +- refactored map component items APIs for further reuse in other custom components; + +- minor bug fixes and improvements; + + + + + +JasperReports 6.1.1 (2015-09-07) +--------------------------------------------- + +- added support for returning values from bands, which gives better control over +variable incrementation in cases where calculations are coupled with content rendering, +such as page totals; + +- allow frame elements to be placed beyond frame bottom edge; this would cause frames +to grow in height in order to display all their content and reduces the need for frames to +shrink in case some of their content displays conditionally and space needs to be collapsed; + +- new configuration property "net.sf.jasperreports.evaluator.ignore.npe" added to control +the expressions evaluation with respect to raising NullPointerException; + +- added support for locale and timezone in CSV and XLS data adapters; + +- minor bug fixes and improvements; + + + + + +JasperReports 6.1.0 (2015-05-25) +--------------------------------------------- +- support for multiple JSON metadata export properties attached to same report element +to allow more flexibility in report data exports; + +- improvements in QRCode barcodes rendering; + +- configuration property added to control the addition of a BOM character at the beginning +of CSV export files; + +- minor bug fixes and improvements; + + + + + +JasperReports 6.0.4 (2015-04-15) +--------------------------------------------- + +- support for pluggable data file locations in file-based data adapters, with default +implementations for remote HTTP data files; + +- new report data source implementation able to consume a list of JSON files provided as input; + +- internationalization of exceptions raised by the JasperReports Library with the introduction +of exception error codes that serve as message keys in translation bundles; + +- downgrade to iText version 2.1.7 and distribution of this third party library under +the terms of the Mozilla Public License version 1.1; + +- support for gutter margins in PDF export with the introduction of export configuration +properties to allow setting different left and right margins for odd and even pages; + +- ability to ignore text formatting in all Excel exporters using newly added export +configuration property; + +- minor bug fixes and improvements; + + + + + +JasperReports 6.0.3 (2015-02-06) +--------------------------------------------- + +- minor bug fixes and improvements; + + + + + +JasperReports 6.0.2 (2015-02-04) +--------------------------------------------- + +- throw specific exception net.sf.jasperreports.export.ExportInterruptedException on all +report export interruption events; + +- differentiate between text align properties and image align properties by adding specific +properties and enumerations in object model and deprecating the existing ones; + +- support for QR Code barcodes in barcode4j component; + +- support for pluggable remote file provider in all file-based data adapters; + +- minor bug fixes and improvements; + + + + + +JasperReports 6.0.0 (2014-11-25) +--------------------------------------------- + +- new type of report template called "report book" was added, in which sections are made +of parts instead of bands; parts are external report templates, similar to subreports, +and allow creation of documents with variable page size and/or orientation; parts can be +displayed on separate tabs by report viewers and simplify creation of "table of contents" +structures in which parts that appear early in the document are actually filled/rendered +later during the report filling process (see evaluationTime attribute of part); + +- new JSON metadata exporter added, similar to the XLS and CSV metadata exporters in which +the values that need to be exported have to be marked-up using configuration properties at +text element level; + +- upgrade to iText version 5.5.0 in the PDF exporter; + +- upgrade to POI version 3.10.1 in the XLS exporter and data source; + +- minor bug fixes and improvements; + + + + + +JasperReports 5.6.1 (2014-09-04) +--------------------------------------------- + +- minor bug fixes and improvements; + + + + + +JasperReports 5.6.0 (2014-05-27) +--------------------------------------------- + +- new overflowType attribute available for subreport elements to control subreport runtime +stretch behavior; + +- minor bug fixes and improvements; + + + + + +JasperReports 5.5.2 (2014-04-28) +--------------------------------------------- + +- new API for setting exporter's input, output and configuration, which replaces the now +deprecated parameter based exporter configuration; The JRExporterParameter class and its subclasses +are now deprecated and replaced by ExporterInput, ExporterOutput and ExporterConfiguration interfaces +and their subinterfaces and convenience implementations; + +- new Apache POI based metadata XLS exporter (JRXlsMetadataExporter class), which replaces +the now deprecated JExcelApi based metadata exporter (JExcelApiExporter class); + +- all JExcelApi based XLS exporters (JExcelApiExporter and JExcelApiMetadataExporter) are +now deprecated and should no longer be used as they will no longer be maintained and will be +completely removed from the library sometime in the future; The JRXlsExporter, JRXlsMetadataExporter +(both Apache POI based) and JRXlsxExporter implementations should be used instead; + +- new Apache POI based XLS report data source (XlsDataSource class), which replaces the now +deprecated JExcelApi based data source (JRXlsDataSource class); + +- new Excel data adapter implementation, with ability to auto-detect Excel file format +(XLS 2003 or XLSX 2007); sample provided under the /demo/samples/exceldataadapter folder of +the project source distro; + +- the older HTML and XHTML exporters (JRHtmlExporter and JRXhtmlExporter) are now deprecated +and should no longer be used as they will no longer be maintained and will be completely removed +from the library sometime in the future; The newer HtmlExporter implementation should be used instead; + +- new title cell added to crosstab element structure, to allow align content with +dynamic width crosstabs; + +- added new PDF exporter configuration properties (net.sf.jasperreports.export.pdf.permissions.allowed +and net.sf.jasperreports.export.pdf.permissions.denied) to control PDF file permissions from +within the report template or globally, from JasperReports configuration context; + +- support for table-of-contents metadata build-up during report filling process, to be leveraged +in document viewers that have the ability to display bookmark based table-of-contents that are not +part of the document content itself. + +- new XMLA query executer based on olap4j; + +- support for loading report resource bundles from repository; + +- support for decimal font size in report templates; + +- richer Javadoc API documentation throughout the entire library source code; + +- minor bug fixes and improvements; + + + + + +JasperReports 5.5.1 (2014-02-07) +--------------------------------------------- + +- added built-in parameter JASPER_REPORTS_CONTEXT for access to current JasperReportsContext +configuration object during report filling; + +- allow specifying the encoding in CSV data adapter configuration; + +- enhanced built-in datetime and text processing report expression functions to leverage +the built-in report parameters for the locale and the timezone; + +- added new extension point for template-based RequireJS configurations; + +- minor bug fixes and improvements; + + + + + +JasperReports 5.5.0 (2013-10-24) +--------------------------------------------- + +- improved JasperReports Web Framework containing embeddable report viewer APIs. +It introduces a separation between the report's HTML output and its interactivity-related +metadata (new JSON exporter) and support for dynamically loaded Javascript modules through RequireJS. +The new APIs simplify interactive report viewer adoption and its customization while giving +new opportunities for creation of interactive custom components; + +- interactive table component formatting capabilities extended to allow basic formatting and +conditional formatting of all table sections including group headers and footers; + +- interactive sorting introduced to the crosstab element, where crosstab data can be sorted interactively +by row group values and/or measure values, when report is viewed with an interactive report viewer; + +- support for Web fonts in the HTML exporter by enhancing JasperReports font extension configuration +to allow specifying font files in EOT, SVG and WOFF format. When specified, font files are delivered +to the browser by dynamically created CSS containing @font-face declarations; + +- enhanced Google Map component with support for marker properties and support for paths and polygons; + +- minor bug fixes and improvements; + + + + + +JasperReports 5.2.0 (2013-06-29) +--------------------------------------------- + +- minor bug fixes and improvements; + + + + + +JasperReports 5.1.2 (2013-06-07) +--------------------------------------------- + +- support for custom functions in report expressions; +this includes support for expression functions in the JDT, Groovy and Javascript +report compilers and excludes the JDK-based report compilers, for which static imports +would be needed in the report template; + +- custom serialization for virtualizers, to improve performance of large reports; + +- print text element optimizations to lower memory consumption and speed up processing; + +- refactored grid layout algorithms for grid-based exporters, to lower memory consumption; + +- caching of dynamic style properties and of transferable element level properties +for improved report filling performance; + +- secrets storage extension point added to allow pluging custom mechanisms for storing +passwords for data adapters and other secret information; + +- minor bug fixes and improvements; + + + + + +JasperReports 5.1.0 (2013-04-29) +--------------------------------------------- + +- enhanced support for markers in Google map component, including hyperlinks and info window; + +- completing features in new layered HTML exporter; + +- minor bug fixes and improvements; + + + + + +JasperReports 5.0.4 (2013-03-26) +--------------------------------------------- + +- new HTML exporter implementation added, which uses HTML tables to render the report content, +but still supports overlapping elements by arranging them in separate layers. +This new exporter implemented in the net.sf.jasperreports.engine.export.HtmlExporter class also +supports report interactivity and is now the preferred way to export to HTML, being used by +the JasperExportManager class and all other convenience and utility classes in the JasperReports +library and its provided samples; + +- the ODS exporter refactored so that it behaves more like the XLS exporters and thus supports +a significant number of XLS export configuration properties and parameters; + +- new introduced for hyperlink definitions, complemented with export time +configuration properties to control the appearance of hyperlinks depending on the export format; + +- new cells available in crosstab structure, to allow defining headers for column groups in +the top left corner of the crosstab, where the unstructured crosstab header cell is normally rendered; + these new cells overlap the former crosstab header cell, if present, but allow for their content + to stretch in accordance with column group header cell stretching; + +- new shared virtualizer implementation added to allow the use of a separate swap file per report; + +- added support for localization in the exceptions raised by the JasperReports library; + +- added configuration properties for controlling the interactive features of the table component +such as column sorting, filtering and formatting; + +- minor bug fixes and improvements; + + + + + +JasperReports 5.0.1 (2013-01-03) +--------------------------------------------- + +- eliminate empty collapsed columns in XLS/XLSX exporters; + +- XLS/XLSX data adapter improvements; + +- minor bug fixes and improvements; + + + + + +JasperReports 5.0.0 (2012-11-12, SVN 5807) +--------------------------------------------- + +- improved report filling performance by extending the use of the simplified text measurer +that was previously used only for single line text elements; + +- improved subreport filling performance by using a thread pooling mechanism; + +- minor bug fixes and improvements; + + + + + +JasperReports 4.8.0 (2012-11-05, SVN 5784) +--------------------------------------------- + +- enhanced interactivity in the table component, with support for conditional formatting +of values in a column; + +- support for style providers as pluggable extensions, to control report element styling +depending on report data at runtime; a default style provider implementation is available, +allowing the use of expression based custom properties at report element level, to control +each style attribute, including backcolor, forecolor, font, borders style, etc; + +- added support for markers to the built-in map component, along with other new map level +settings such as type of map, image type and language (I18n support); + +- version support added to the JRXmlWriter utility class to allow generating source JRXML format +for older versions of the library, including support for versioning of custom components markup; + +- support for custom $X{} functions in queries, which can be plugged in as extensions; + +- added support for relative date ranges used as input parameters in parametrized queries; + +- minor bug fixes and improvements; + + + + + +JasperReports 4.7.1 (2012-09-22, SVN 5678) +--------------------------------------------- + +- improved performance for the newly introduced Javascript report compiler; + +- configuration properties to control table component interactive features; + +- minor bug fixes and improvements; + + + + + +JasperReports 4.7.0 (2012-07-02, SVN 5473) +--------------------------------------------- + +- improved rendering performance for the table component; + +- enhanced interactive report viewer APIs; + +- new "net.sf.jasperreports.export.pdf.size.page.to.content" export configuration property added +to allow for variable page size in PDF documents, by adapting page size to page content size; + +- better control over memory footprint in large XLSX exports, by allowing the temporary files buffer size +to be configured locally through report custom properties; + +- minor bug fixes and improvements; + + + + + +JasperReports 4.6.0 (2012-05-21, SVN 5400) +--------------------------------------------- + +- improved JasperReports configuration infrastructure by the introduction of a JasperReportsContext, +an new interface from where JR configuration properties are read and JR extensions are loaded. +This allows different configurations of the JR engine to exist simultaneously in the same JVM; + +- improved JasperReports Web Framework which now features a centralized controller to dispatch +actions triggered by end user interactions in the report viewer. Actions are backed by atomized +commands that modify the report metadata on-the-fly, with support for undo/redo operations, +to reflect changes in the report output; + +- introduction of reusable Web report viewer APIs, featuring configurable report viewing servlets, +and built-in Javascript modules that can be used to create custom interactive report viewers in Web +applications embedding the JasperReports Library. +This is demonstrated in the new /demo/samples/webapp-repo sample where two different looking versions +of the same build-in JR interactive report viewer are used to displays interactive reports; + +- enhanced interactivity in the table component, with support for column formatting, hiding, resizing, +moving, sorting and filtering, all leveraging the new action-based JR Web Framework controller and its +interactivity supporting report viewer Javascript APIs; + +- introduction of a data caching API that helps avoid re-querying the report's data source, +for performance reasons, while interactively viewing the report using an interactive report viewer +created based on the new JR Web Framework; + +- added new page related events in the asynchronous report filler to support asynchronous page display +in interactive report viewers; + +- added support for message providers that can be plugged into JR as extensions, to allow +internationalization of interactive custom components UIs; + +- minor bug fixes and improvements; + + + + + +JasperReports 4.5.1 (2012-03-05, SVN 5027) +--------------------------------------------- + +- the JSON data source and the respective JSON query executer were moved +from the samples folder to the core library; + +- support for macros added in XLS and XSLX exporters; + +- the repository APIs were enhanced with support for pluggable persistence +services to load and store resources in the repository; + +- the "net.sf.jasperreports.export.pdf.force.linebreak.policy" configuration +property is un-deprecated, as a partial revert of the changes made in 4.1.1 with +regards to PDF text rendering; These changes were partially reverted as they affected +the performance of the PDF exporter when dealing with simple texts. The AWT-based text +rendering is now performed only on complex text fields that contain tab characters +for tab stop alignment or contain multiple paragraphs, with variable paragraph styling. + +- minor bug fixes and improvements; + + + + + +JasperReports 4.5.0 (2011-12-06, SVN 4839) +--------------------------------------------- + +- border and padding style properties added to crosstab elements; + +- optimized text measurement for short and simple texts, to speed up report filling process; + +- new "net.sf.jasperreports.export.xls.use.timezone" export configuration property added +to force translation of date values during XLS export, to the timezone used to fill the report; + +- minor bug fixes and improvements; + + + + + +JasperReports 4.1.3 (2011-10-28, SVN 4774) +--------------------------------------------- + +- new XLS/XLSX export configuration properties added for advanced features +including auto-filter, row outline collapse/expand grouping and custom column width; + +- enhanced support for interactive sorting and filtering, with more filter criteria +available depending on column data type and possibility to sort and filter on multiple +columns at the same time; + +- improved virtualization by consolidating styling information for repeating subreports +and by splitting large pages into smaller virtualized pieces for non-paginated reports; + +- the XML exporter was changed to use namespaces and thus allow pluggable generic element +parameter value handlers; + +- minor bug fixes and improvements; + + + + + +JasperReports 4.1.2 (2011-09-12, SVN 4600) +--------------------------------------------- + +- support for PDF/A compliance added to the PDF exporter; + +- new sort/filter custom component added to allow non-table component reports to leverage +the interactive sorting and filtering feature when deployed inside the JR Web Framework; + +- minor bug fixes and improvements; + + + + + +JasperReports 4.1.1 (2011-08-11, SVN 4550) +--------------------------------------------- + +- deprecated code for JRReportFont, JRBox, graphic element pen property +and all deprecated byte-based properties were removed from the library's API; + +- the whole JR source code was overhauled to make use of Java5-style Generics; + +- value class property is now deprecated in expression objects; the type of +expression no longer needs to be specified; + +- the library's API was extended with a new repository API, which is used now +throughout the reporting engine to locate report resources such as images, fonts, +subreports, etc; + +- new parameter contributor interface was added to the engine to allow parameter +manipulation prior to query execution; parameter contributors can be plugged in as +extensions; + +- new data adapter concept was added to the library's API to allow the reporting engine +to connect to data directly, without the parent application providing the data the source +nor the query executer parameters, at report fill time; + +- new report executing servlet was added as part of a larger Web framework that +is now available in the library's core API, to simplify deployment of JR inside +Web applications and achieve higher degree of interactivity for reports; +details about how this new Web framework can be used can be seen in the new +/demo/samples/webapp-repo sample, which also makes use of the newly introduced +repository API, to locate the report templates and their additional resources; + +- the table component was enhanced so that it is more interactive by default, +when the reports are deployed in an application that makes use of the above mentioned +Web framework; by default, table columns are sortable, while text columns are filterable +using a simple "contains" filter criteria; this can be seen in the TableReport +deployed in the /demo/samples/webapp-repo sample; + +- new map component added to the core library to simplify rendering of Google maps +inside reports; + +- new XLS metadata exporter added, similar to the CSV metadata exporter in which +columns that need to be exported have to be marked-up using configuration properties +at text element level; + +- new XLSX data source and query executer added; details about how it works +are found in the new /demo/samples/xlsxdatasource sample; + +- pattern expression added to text fields elements to allow for more flexible +dates and numbers formatting; + +- custom property "net.sf.jasperreports.export.xls.pattern" is now available to control +cell formatting patterns in XLS/XLSX exporters; + +- new custom properties are available in XLS/XLSX exporters to freeze panes; + +- new "net.sf.jasperreports.image.dpi" custom property added to allow specifying +the image resolution in dots-per-inch, for the images created by the engine when +rasterizing SVGs or when clipping other image renderers; + +- the "net.sf.jasperreports.export.pdf.force.linebreak.policy" configuration property +is now deprecated as the PDF text rendering code was refactored so that text is rendered +exactly like in AWT; + +- minor bug fixes and improvements; + + + + + +JasperReports 4.0.2 (2011-04-18, SVN 4298) +--------------------------------------------- + +- improved XHTML exporter to bring it at feature parity with the former HTML exporter; + +- initial support for paragraph styling including: indentation, spacing and tab stops; + +- new values available for line spacing type: AtLeast, Fixed and Proportional; + +- added support for tab characters inside text elements based on newly introduced tab stop concept; + +- new /demo/samples/paragraphs sample added to demonstrate paragraph styling features; + +- minor bug fixes and improvements; + + + + + +JasperReports 4.0.1 (2011-02-28, SVN 4219) +--------------------------------------------- + +- new Xalan-based and Jaxen-based XPath query executer namespace aware +implementations added; + +- new functions EQUAL, NOTEQUAL, LESS, GREATER and BETWEEN are now available +for the $X{} syntax in dynamic SQL queries; + +- new XSL query executer implementation added; + +- support for multiple hyperlinks embedded into styled/markup text; + +- improved image quality in the XLS exporters; + +- experimental JSON data source and query executer added as separate sample +under /demo/samples/jsondatasource; + +- experimental HTML renderer component added as separate sample +under /demo/samples/htmlcomponent; + +- custom property "net.sf.jasperreports.export.html.class" added at element level to allow +specifying the CSS "class" attribute for elements when exported to HTML and XHTML/CSS format; + +- minor bug fixes and improvements; + + + + + +JasperReports 4.0.0 (2010-12-31, SVN 4121) +--------------------------------------------- + +- new CSV query executer added to simplify to allow configuring CSV data sources from within report templates +using built-in parameters and config properties; + +- new CSV metadata exporter added to better control the CSV export by marking columns in the report template +using custom properties; + +- new chapters in the Sample Reference documentation have beed completed +(http://jasperreports.sf.net/sample.reference.html); + +- minor bug fixes and improvements; + + + + + +JasperReports 3.7.6 (2010-10-27, SVN 4037) +--------------------------------------------- + +- enhancing the XLSX exporter so that it supports more exporter parameters +and configuration properties from the ones shared by all the XLS exporters; + +- various fixes in the XLS exporters; + +- added support for hidden text in the DOCX exporter; + +- new chapters added to the Sample Reference documentation; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.7.5 (2010-09-22, SVN 3978) +--------------------------------------------- + +- support for dynamic sorting which includes sorting on dataset variables +(in addition to data source fields) and build in SORT_FIELDS parameter +to control sorting criteria at runtime; + +- new „columnDirection” attribute at report level to allow filling +multi-column reports from right to left; + +- various XLS/XLSX export enhancements which include controlling the +sheet's direction (RTL), protecting its content, fitting its size for printing, +and setting other print related metadata; + +- upgrade to POI 3.6 and and JExcelApi 2.6.10; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.7.4 (2010-07-20, SVN 3911) +--------------------------------------------- + +- new spider/radar chart added as custom component; + +- the scope of the "frames as nested tables" configuration properties was extended +to frame element level; + +- new entries added to Sample Reference documentation; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.7.3 (2010-06-01, SVN 3846) +--------------------------------------------- + +- support for images and hyperlinks added to the XLSX exporter; + +- support for line spacing and hyperlinks added to the PPTX exporter; + +- support for hyperlinks and local anchors in the POI-based XLS exporter; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.7.2 (2010-04-12, SVN 3736) +--------------------------------------------- + +- new table component added to simplify designing tables with variable number of columns; + +- new PPTX exporter added to the core library to help creating PowerPoint 2007 documents +based on the Office Open XML format; + +- upgrade to Java 5.0; starting with this release, JasperReports is no longer compatible +with Java 1.4 and makes use of newer language features such as generics and typed enums; + +- simple XML-DOM-based font extension implementation added to eliminate the dependency on Spring +brought by the previous font extension default implementation; + +- code generating utility class added (JRApiWriter) to help users understand how to use +the JasperReports API and its report object model to create report templates at runtime (no JRXML); + +- the Flash viewer was added to the demo/samples/webapp sample; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.7.1 (2010-02-01, SVN 3367) +--------------------------------------------- + +- new JRHtmlExporterParameter.ZOOM_RATIO exporter added to allow scaling the content generated +by the HTML and the XHTML/CSS exporters; + +- upgrade to POI 3.5 and iText 2.1.7; + +- the custom Ant task for batch updating report template files was moved from community project +to core library; + +- new custom Ant task for decompiling report templates; it allows regenerating the source JRXML +files from compiled report templates files. + +- added support for documenting the samples and automatically create the Sample Reference document, +as part of the project build process; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.7.0 (2009-12-08, SVN 3227) +--------------------------------------------- + +- generic element export handler support was added to all built-in exporters; + +- fixes were made in the text exporter and new configuration properties were added +to help configure the text exporter globally, or at report level; + +- custom property "net.sf.jasperreports.export.html.id" added at element level +to allow specifying the ID attribute for elements when exported to HTML and XHTML/CSS format; + +- new export parameter and configuration property added to ignore cell background +color in the XLS/XLSX exporters; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.6.2 (2009-11-23, SVN 3215) +--------------------------------------------- + +- new "footerPosition" attribute added to report groups to control the rendering +position of the group footer sections; + +- new "keepTogether" boolean flag added to report groups to prevent groups from +splitting across two pages or columns, but only on their first break attempt; + +- new tag added to crosstab group definitions to allow +sorting the crosstab by measure totals; + +- axis tick labels in charts can now be rotated using the new "verticalTickLabels" +flag (for numeric or datetime axis) or at an angle, using the new "labelRotation" +numeric attribute (for category axis); + +- minor bug fixes and improvements; + + + + + +JasperReports 3.6.1 (2009-10-26, SVN 3170) +--------------------------------------------- + +- enhanced font extension support to allow mapping JVM available fonts +with PDF built-in fonts; + +- exporter font mapping support added to font extensions, which deprecates +the former FONT_MAP exporter parameter; + +- net.sf.jasperreports.awt.ignore.missing.font configuration property added +to control font availability verifications during report filling and report +AWT rendering; + +- new JAR containing default font extension was added to the JasperReports +project build process as well as the distribution files; + +- new XLS data source implementation added, to support filling reports +using data coming from Excel 95, 97, 2000, XP, and 2003 workbooks; + +- new XLSX exporter added to the core library to help creating Excel 2007 +documents based on the Office Open XML format; + +- new OpenDocument Spreadsheet exporter added (ODS); + +- new "isSummaryWithPageHeaderAndFooter" attribute added to the report template +definition, to allow rendering the summary page together with the page footer +and page header bands; + +- new "printOrder" attribute added to list component, to support horizontal +filling of lists, in addition to vertical filling; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.6.0 (2009-08-31, SVN 3038) +--------------------------------------------- + +- upgrading the JasperReports license to Version 3 of the +GNU LESSER GENERAL PUBLIC LICENSE (http://www.gnu.org/licenses/lgpl.txt); + +- fixed JRXlsExporter to avoid creating invalid XLS files for large reports +(tracker #0004014); + +- fixed JRRtfExporter font table section (tracker #0004169); + +- fixed hyperlink encoding in JRDocxExporter (tracker #0004252); + +- minor bug fixes and improvements; + + + + + +JasperReports 3.5.3 (2009-07-29, SVN 2990) +--------------------------------------------- + +- new DOCX exporter added to the core library to help creating Word 2007 documents +based on the Office Open XML format; + +- new XLSX exporter provided as a separate sample to those who want to make use of +the XLSX (Excel 2007) generating capabilities of POI 3.5 Beta; + +- new XHTML/CSS exporter added to core library to avoid the grid exporter limitations +of the classic HTML exporter; + +- new JDBC-related configuration properties introduced to allow fine-tuning the SQL query execution; + +- tag added to properties in the Config Reference documentation; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.5.2 (2009-06-03, SVN 2856) +--------------------------------------------- + +- the report detail, the group headers and the group footers are now +multi-band sections, meaning that their content can be distributed into +several bands, having similar rendering behavior; + +- new "splitType" attribute available at band level, to control the band +breaking policy; this new attribute deprecates the "isSplitAllowed" attribute; + +- two new production-ready barcode components that use the Barbecue library +and the Barcode4J library, respectively; + +- all configuration properties are now fully documented in a source XML file that +is used to produce a complete and up-to-date HTML configuration reference; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.5.1 (2009-05-05, SVN 2762) +--------------------------------------------- + +- list component added to simplify iteration through datasets +without using a subreport; + +- support for generic element PDF handlers to allow customizing +PDF output using generic elements; + +- the report template structure and syntax (JRXML) are now fully +documented using the comments from the source XSD file to produce +a complete and up-to-date HTML schema reference; + +- option to save line break positions at fill/measure time and +use them during HTML export in order to preserve word wrap; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.5.0 (2009-03-25, SVN 2712) +--------------------------------------------- + +- new min/max expressions available for controlling the displayed values +interval for both chart axis; + +- the pie dataset now supports multiple series; this is useful in cases where +multiple categories are added to the pie dataset in one incrementation step; + +- new attributes and expressions where added to the pie dataset to allow limiting +the number of slices displayed in the pie chart by grouping smaller slices under +a single generic slice called "Other"; + +- new "runToBottom" attribute available for subreport elements to specify if +the subreport should consume all the available space on the current page; + +- the "net.sf.jasperreports.allow.element.overlap" property can be used globally, +at report or element level to specify whether element overlapping verifications +are performed at report compilation time; this is useful when designing reports +that are to be exported using grid exporters such as HTML and XLS, +where overlapping elements do not show up; + +- support for ordered lists added in the HTML markup text processor; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.1.4 (2009-02-10, SVN 2607) +--------------------------------------------- + +- allow any value as hyperlink target to support open hyperlinks +into named frames; + +- custom hyperlink targets can be generated at runtime using +hyperlink target producers; + +- custom hyperlink producers and hyperlink target producers +can be deployed as extensions; + +- multiple scriptlet instances allowed per report execution; + +- support for report governors to prevent infinite loops caused by +invalid report templates; + +- simple report governor implementations based on maximum +number of pages and timeout; + +- new JASPER_REPORT built-in parameter to give access to the report +template object in report expressions and scriptlets; + +- chart element live preview in design mode; + +- improved XML-based chart theme model to support the creation of +a visual chart theme designer; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.1.3 (2009-01-12, SVN 2526) +--------------------------------------------- + +- font extensions support to allow using TTF files without the need to install +them into the system; this also allows using different TTF files for the same +logical font name, depending on the locale; + +- primitive type chart properties replaced with equivalent object type properties +to allow chart theme implementations to check if they were set or not; + +- XML based chart theme implementations provided with the charts sample; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.1.2 (2008-11-04, SVN 2458) +--------------------------------------------- + +- new report compiler based on the Rhino library to support JavaScript +as the report expression language; + +- simplified configuration for custom query executers, which can register +themselves to a JasperReports deployment using the library's extensions support; + +- new custom properties available at report level and element level, +to mark document structure and produce produce PDF output that is compliant +with Section 508 Amendment to the Rehabilitation Act of 1973, which governs +accessibility of software solutions for people with disabilities. + +- new TrueType font files (DejaVu fonts) are shipped with the sample reports; + +- new chart theme implementation (name eye.candy.sixties) shipped with +the charts samples, to show how chart themes can be used to change the overall +appearance of charts generated with the build-in chart element; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.1.0 (2008-09-17, SVN 2367) +--------------------------------------------- + +- chart themes support to allow changing the overall appearance +of charts generated with the build-in chart element; + +- deprecation of DTD based JRXML validation and introduction of +XML schema based JRXML validation; + +- generic component support to allow extending the functionality of the +JasperReports engine by plugging-in custom-made visual components that +would take data as input and produce content that is embedded into the +resulting documents; + +- support for generic print elements in generated documents to allow +introducing custom exporter content; + +- introducing generic report design elements to simplify creation of +custom exporter content, without implementing full-blown components; + +- extension support added in order to simplify configuring various +JasperReports extension points such as chart themes and generic components; + +- new "labelFormat" and "legendLabelFormat" properties available for pie +and pie 3D chart plots to allow controlling the labels for pie charts +without need for chart customizer; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.0.1 (2008-08-07, SVN 2263) +--------------------------------------------- + +- new Gantt chart type added; + +- support for item hyperlinks in multi-axis charts; + +- new Swing report viewer component, with enhanced plugability +and reusability (the page viewer and its toolbar can be separated); + +- new possible values (RealHeight and RealSize) for the "scaleImage" +attribute of the image elements; + +- support for pluggable exporter filter factories in addition +to the existing FILTER exporter parameter; + +- new exporter filter implementation for filtering out content +based on the element's key property; + +- password protection for the XLS files generated with +the JExcelApi-based exporter; + +- the Javaflow-based distributed JAR has the JRContinuationSubreportRunnerFactory +configured as the default subreport runner factory; + +- minor bug fixes and improvements; + + + + + +JasperReports 3.0.0 (2008-05-19, SVN 2200) +--------------------------------------------- + +- support for custom properties at element level in generated documents, +to allow extending exporter functionality; + +- custom element properties can have expressions as values (dynamic values); + +- support for XLS cell formula, using the "net.sf.jasperreports.export.xls.formula" +custom property at element level; + +- better control over sheet breaks in XLS exporters using the new custom element +properties called "net.sf.jasperreports.export.xls.break.before.row" and +"net.sf.jasperreports.export.xls.break.after.row"; + +- new configuration property called "net.sf.jasperreports.export.legacy.border.offset" +to allow rendering element borders in older reports using the legacy border offset +technique that was used in versions prior to the 2.0.3 release. + +- support for "Parent" and "Top" as hyperlink targets; + +- enhanced XML exporter and new XML exporter servlet added to facilitate viewing +reports using the JasperReports Flash Viewer component +(http://jasperforge.org/sf/projects/jasperreports-flash); + +- new experimental XMLSS exporter (XML Spreadsheet Format) that allows streaming +content while generating the document and thus avoid memory problems with +very large reports; + +- minor bug fixes and improvements; + + + + + + +JasperReports 2.0.5 (2008-03-12, SVN 2137) +--------------------------------------------- + +- support for RTF and HTML snippets inside text elements using new "markup" attribute +that deprecates the former isStyledText attribute; + +- new "renderType" chart attribute and configuration property, to support rendering charts as images +or as SVG, besides the direct drawing performed by the JFreeChart components; + +- new FileResolver interface and built-in parameter for better control over resource loading; + +- minor bug fixes and improvements; + + + + + +JasperReports 2.0.4 (2008-01-11, SVN 2065) +--------------------------------------------- + +- support for Dotted and Double line style added; + +- warning messages added to signal the use of deprecated pen and box +attributes and tags in JRXML; all samples refactored; + +- minor bug fixes and improvements; + + + + + +JasperReports 2.0.3 (2007-12-12) +----------------------------------- + +- the default value of the deprecated JRXlsExporterParameter.IS_AUTO_DETECT_CELL_TYPE +exporter parameter is now "false"; the newer IS_DETECT_CELL_TYPE exporter parameter +should be used to control the cell types in the generated XLS documents; + +- exporter filter support added to all exporters, including support for +origin exporter filter hints; + +- refactored RTF exporter to remove limitations related to Unicode texts and RTL writing; + +- change events handling and clone support in the report template object model; + +- custom properties support for report templates elements; + +- support for pluggable text measurers, to allow simpler and faster implementations; + +- support for keeping the entire original text for text elements that do not +stretch; the full text is used in data-oriented exporters such as XLS and CSV; + +- support for truncating texts at character (not word); + +- support for text truncation suffix (i.e. adding ellipses at the end); + +- new JRPen and JRLineBox interfaces added to support rendering of an unlimited +number of line width/style combinations; + +- minor bug fixes and improvements; + + + + + +JasperReports 2.0.2 (2007-10-09) +----------------------------------- + +- support for element origin information in generated documents; + +- support for exporter element filtering based on element origin; + +- minor bug fixes and improvements; + + + + + +JasperReports 2.0.1 (2007-08-24) +----------------------------------- + +- support for custom properties in generated documents (JasperPrint objects); + +- predefined JasperPrint custom properties used as exporter hints; + +- new configuration properties for setting exporter parameter default values; + +- new configuration properties for mapping report compilers to expression languages; + +- minor bug fixes and improvements; + + + + + +JasperReports 2.0.0 (2007-08-14) +----------------------------------- + +- support for reusable external report styles, through style templates; + +- new noData section introduced for better control over reports or subreports filled +with empty data sources; + +- faster XML data source using Jaxen added; + +- current bean mapped to the report field called _THIS, in bean data sources; + +- new export parameters available for generating a more data-centric XLS documents; + +- custom color palette creation for JExcelApi exporter; + +- the BeanShell report compiler moved back to core library; + +- upgrade to Mondrian 2.3.2; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.3.4 (2007-06-11) +----------------------------------- + +- new "runDirection" attribute available for crosstabs to enable right-to-left rendering policy; + +- support for large documents in the ODT exporter; + +- security checks enabled for custom code execution during report generation; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.3.3 (2007-04-30) +----------------------------------- + +- support for inner classes and arrays in report template types (parameters, fields, variables) +and custom classes associated with the report template (scriptletClass, formatFactoryClass, etc); + +- minor bug fixes and improvements; + + + + + +JasperReports 1.3.2 (2007-03-30) +----------------------------------- + +- new Open Document Format exporter added (beta version); + +- enhanced RTF exporter; + +- improved error handling during report compilation to help detecting +the source of the problem; + +- support for custom name/value pair properties for report fields +and report parameters; + +- new $X{} syntax available and recursive expansion of $P!{} parameter +references in the tag to help building dynamic queries; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.3.1 (2007-02-21) +----------------------------------- + +- stacked area chart support added; + +- style properties inheritance for charts; + +- XMLA query executer mapped by default to the "mdx" and "MDX" query languages, +just like the MDX query executer; the latter takes precedence; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.3.0 (2006-12-22) +----------------------------------- + +- new XMLA data source implementation added to support reporting using OLAP engine +through a Web Services interface; + +- new element to better control page and column breaks in reports; + +- improved image loading and image encoding processes as well as full support +for transparent images; + +- enhanced support for localization in the XML and CSV data sources; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.2.8 (2006-11-14) +----------------------------------- + +- support for sorting the data source using new tags in JRXML; +if such tags are present, an intermediate JRSortableDataSource will wrap +the initial report data source and perform in-memory sorting before the +records are fed into the report filling process; + +- upside down text rotation; + +- new report template property (formatFactoryClass) and built-in parameter +(REPORT_FORMAT_FACTORY) to allow the use of custom date and number formatters; + +- new exporter parameter (FORCE_SVG_SHAPES) and configuration property +(net.sf.jasperreports.export.pdf.force.svg.shapes) to disable the rendering +of SVG images using shapes in PDF and reduce file size; + +- new exporter parameter (MINIMIZE_PRINTER_JOB_SIZE) and configuration property +(net.sf.jasperreports.export.graphics2d.min.job.size) to disable the printer job +size optimization and allow full support for bidirectional writing; + +- new exporter parameter (FORMAT_PATTERNS_MAP) to allow translating the text field +patterns to XLS exporter specific cell format patterns; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.2.7 (2006-09-21) +----------------------------------- + +- extended support for charts including new chart types: +meter chart, thermometer chart and multi-axis charts; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.2.6 (2006-09-03) +----------------------------------- + +- enhanced hyperlink support for text elements, images and charts; +hyperlinks per chart items for enhanced drill-through support; + +- support for superscript and subscript in styled text; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.2.5 (2006-07-11) +----------------------------------- + +- new filter expression added to filter out records in a data source; + +- "increment when" expression to filter out data in chart and crosstab datasets; + +- new IS_DETECT_CELL_TYPE exporter parameter available for the XLS exporters, +to allow setting the correct cell data type in worksheets; +the former IS_AUTO_DETECT_CELL_TYPE is now deprecated; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.2.4 (2006-06-23) +----------------------------------- + +- new distinct count calculation supported; + +- new REPORT_TIME_ZONE built-in parameter added to fully control date formatting; + +- new FORCE_LINEBREAK_POLICY exporter parameter to force the PDF exporter to use +the same line break policy as in AWT; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.2.3 (2006-05-30) +----------------------------------- +- support for OLAP and MDX queries using Mondrian-based +query executer and data source implementations; + +- support for EJBQL using JPA-based query executer implementation +(contribution by Marcel Overdijk); + +- GZIP in-memory virtualizer +(contributed by John Bindel, Works Inc.); + +- new single/swap file virtualizer; + +- support for shared file virtualizer; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.2.2 (2006-04-23) +----------------------------------- +- the use of threads is no longer mandatory for the subreport filling process after +introducing a new subreport runner interface and an altenative default implementation +that realies on Javaflow continuations (Jakarta Commons Javaflow library); + +- Groovy report compiler moved to core library; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.2.1 (2006-04-07) +----------------------------------- +- support for URL stream handlers to allow loading resources such as images, +fonts or subreports using customized URL protocols; + +- new isPdfSimulatedBold and isPdfSimulatedItalic attributes available +for the PDF exporter font mappings; + +- serialVersionUID frozen at 10200; this will no longer be incremented +with every new release; + +- JExcelApi exporter moved to core library; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.2.0 (2006-02-06) +----------------------------------- +- support for other query languages including HQL and XPath implementations; + +- new evaluation time "Auto" available for text fields enabling +new types of calculations such as percentage; + +- CSV datasource; + +- conditional styles; + +- crosstab total variables to allow combining data at different +aggregation levels (percentages, etc); + +- serialization of virtualized reports; + +- the built-in HTML exporter now produces XHTML-compatible output; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.1.1 (2005-11-28) +----------------------------------- +- support for crosstab cell vertical stretch; + +- access to report data from chart customizer implementations by +extending new JRAbstractChartCustomizer class; + +- support for Java 1.5 in the JDT-based report compiler; + +- new "isIgnorePagination" attribute available at report template level; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.1.0 (2005-10-21) +----------------------------------- +- support for report styles that can be referenced by elements to inherit +visual properties such as font, color, border, etc; report fonts are now deprecated; + +- new frame element added to support grouping other report element together; + +- new dataset concept that comprises parameter, field, variable and group +declarations and represents a mixture between a data source and a subreport +to help iterating through data for chart and crosstab generation; + +- support for crosstabs added using a specialized component; + +- new XLS exporter implementation that uses the Java Excel Api open source library is +available as a sample; contributed by Manuel Paul (Rat & Tat Beratungsgesellschaft mbH); + +- minor bug fixes and improvements; + + + + + +JasperReports 1.0.3 (2005-10-10) +----------------------------------- +- new J2EE module added to the core library including servlets for image +delivery in HTML format, PDF, XLS and RTF generation; + +- new REPORT_CLASS_LOADER built-in fill time parameter and new CLASS_LOADER export time +parameter to allow extending the way resources such as images, fonts and subreports +are located at runtime; + +- support for detecting the image type inside JRRenderable instances using an image type sniffer; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.0.2 (2005-09-07) +----------------------------------- +- fixes the bug introduced in the 1.0.1 version related to the subreports caching +(see http://sourceforge.net/tracker/index.php?func=detail&aid=1277217&group_id=36382&atid=416703); + +- support for simple HTML tags like , , , and
  • inside styled texts; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.0.1 (2005-08-26) +----------------------------------- +- further chart element customization possible using a new JRChartCustomizer interface +and the "customizerClass" attribute available for charts; + +- new RTF and plain text exporters added; + +- new FONT_MAP exporter parameter introduced to allow export-time font mappings and +better control of font translation during document export; + +- support for generating PDF bookmarks from report anchors using a new "bookmarkLevel" +attribute available for hyperlink elements; + +- new IS_IGNORE_PAGINATION built-in parameter for disabling pagination and allow +creating flow-based documents instead of page-based documents; + +- minor bug fixes and improvements; + + + + + +JasperReports 1.0.0 (2005-07-20) +----------------------------------- +- built-in support for charts added; a new chart component was added to simplify the +rendering of the following types of charts: Pie, Pie 3D, Bar, Bar 3D, XY Bar, Stacked Bar, +Stacked Bar 3D, Line, XY Line, Area, XY Area, Scatter Plot, Bubble, Time series, +High Low Open Close, Candlestick; + +- support for generating very large reports using serialization on disk to minimize memory +consumption during the filling and exporting processes +(report virtualizer, contributed by John Bindel, Works Inc.); + +- report fields can be of any type, just like report parameters and report variables. +This simplifies working with JavaBean data sources where casting from java.lang.Object +to the actual report field class is no longer required in the expressions; + +- when using $P{REPORT_SCRIPTLET} in expressions, specific cast to the actual scriptlet +class is no longer needed; + +- new attribute "whenResourceMissingType" for customizing the behavior of the engine +when it deals with missing resources in the associated resources bundle; + +- support for CLOB and BLOB report fields in JRResultSetDataSource; + +- support for PDF font registration using properties file; + +- simplified support for returning values from subreport; + +- new possible value (Band) for the "evaluationTime" property of text fields, images and charts +to allow postponing their expression evaluation until the end of the parent band rendering +in order to simplify the use of values returned from subreports; + +- support for canceling the report filling process, including the cancellation of the +report query execution through JDBC (see the AsynchronousFillHandle class); + +- minor bug fixes and improvements; + + + + + +JasperReports 0.6.8 (2005-05-31) +----------------------------------- +- fixes the bug introduced in the 0.6.7 version related to the way +variables are incremented and group breaks estimated +(see http://sourceforge.net/tracker/index.php?func=detail&aid=1207897&group_id=36382&atid=416703); + +- minor bug fixes and improvements; + + + + +JasperReports 0.6.7 (2005-05-16) +----------------------------------- +- new REPORT_MAX_COUNT built-in parameter for limiting +the number of rows in the data source; + +- dots, spaces and other special characters allowed +in parameter, field and variable names; + +- minor bug fixes and improvements; + + + + +JasperReports 0.6.6 (2005-04-06) +----------------------------------- +- new "incrementType" and "incrementGroup" attributes added to allow +incrementing variable values on page, column or group breaks and not +with every detail row; + +- new "language" attribute added to allow writing report expressions +in other languages, provided that a report compiler that knows how to +interpret the specified language is used; + +- new Groovy report compiler added as a sample to allow using the +Groovy language and its simplified syntax inside report expressions; + +- the JRBshCompiler has been removed from the core library and provided +as a separate sample; + +- minor bug fixes and improvements; + + + + +JasperReports 0.6.5 (2005-02-27) +----------------------------------- +- JasperReports licensing model has been simplified and the library +will be shipped only under the "GNU Lesser Public License" (LGPL); + +- new "onErrorType" and "isLazy" attributes for image elements +to allow customizing the engine's behavior for loading and displaying images; + +- new sample showing how to use the JasperReports library inside a J2EE application +running on the JBoss Application Server; + +- minor bug fixes and improvements; + + + + +JasperReports 0.6.4 (2005-01-16) +----------------------------------- +- new report compiler that uses the Eclipse JDT Java compiler for faster compilation +and simpler deployment; + +- minor bug fixes and improvements; + + + + +JasperReports 0.6.3 (2004-11-29) +----------------------------------- +- new tag available for putting border around text and image elements +with independent properties such as color, style and padding on all four sides; + +- new "isFloatColumnFooter" attribute to allow printing the column footer section +right after the detail lines and not only at the bottom of the page; + +- new global OFFSET_X and OFFSET_Y exporter parameters that can be used to move +all the elements on a page when exporting the generated document; + +- minor bug fixes and improvements; + + + + +JasperReports 0.6.2 (2004-11-14) +----------------------------------- +- added support for import statements in order to eliminate +the need to use complete class names inside report expressions; + +- new "resourceBundle" attribute and new build-in REPORT_LOCALE and +REPORT_RESOURCE_BUNDLE report parameters, to allow associating +a ResourceBundle and a Locale with the report design when filling it with data; + +- new $R{...} syntax available inside report expressions to access the +resource bundle information based on resource keys; + +- new built-in msg() and str() functions to allow formatting messages in +different languages inside the report expressions; + +- support for right-to-left writing (like Arabic and Hebrew); + +- new "hyperlinkTarget" attribute available for hyperlink elements +in order to allow opening documents in a new window; + +- minor bug fixes and improvements; + + + + +JasperReports 0.6.1 (2004-08-30) +----------------------------------- +- new "lastPageFooter" report section added to simplify the creation of some +special report designs; + +- new sample "barbecue" added to show how to render barcodes using +the Barbecue open source library; + +- new "Go To Page" option available in the viewer's toolbar; + +- minor bug fixes and improvements; + + + + +JasperReports 0.6.0 (2004-07-24) +----------------------------------- +- the package name hierarchy has changed throughout the entire library. +The now obsolete root package called "dori.jasper" was replaced by "net.sf.jasperreports" +for standardization reasons; + +- new net.sf.jasperreports.engine.JRRenderable interface supported in the image expression +to improve the quality of charts and other SVG images. The patch, initially proposed by +Adrian Jackson, David Taylor and Lars Kristensen, was incorporated in the main version; + +- added support for batch export through the use of the new exporter parameter +JRExporterParameter.JASPER_PRINT_LIST, which accepts a list containing JasperPrint objects +(contribution by Jason Essington); + +- new XPath based XML data source implementation provided. The "xmldatasource" sample shows +how the net.sf.jasperreports.engine.data.JRXmlDataSource can be used in combination +with subreports (contribution by Peter Severin); + +- minor bug fixes and improvements; + + + + +JasperReports 0.5.3 (2004-05-18) +----------------------------------- +- new boolean "isStyledText" attribute available for text elements to allow +introducing style information inside the text content using XML syntax based on +nested + + + + + + + + + + + + + + + + + + + + + + + +
    + +JasperReports-Ultimate-Guide-3.pdfJasperReports Ultimate Guide - +sample.reference.htmlSample Reference - +schema.reference.htmlSchema Reference - +config.reference.htmlConfiguration Reference - +http://community.jaspersoft.com/wiki/jasperreports-library-faqsFAQ - +index.htmlAPI (Javadoc) +
    +
    +
    +
    +JasperReports - Components Schema Reference (version ) + + +
    +
    +
    + +
    + +This document describes the JRXML structure of the built-in components for the JasperReports Library. + + + + + + + + + + + + + + + + + + + + +


    +
    Other JasperReports Library Schemas
    +
    + Report Schema Reference +
    + Report Parts Schema Reference +
    +
    Components Schema Reference
    +
    + + + + + +
    + + + # + + + + + + + + + (in ) + (in ) + + +
    + + </td><td> + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +






    + + + + + + top


    + + + + + + top

    +

    Attributes



    + © 2001- TIBCO Software Inc. www.jaspersoft.com +
    + + + + + + + + + + + + +
    Attributes
    + + +
    +
    + + + + + + + + + + +
    Parent type:
    schema.reference.html#_blank. + +
    + + + + + + + + +
    Attributes
    + + +
    +
    + + + + +
    Contains
    + + +
    + + + + + + + + + + + + + + + + + +

    +
    + + + + + + + + +
    +
    + + + + + + + + + #<> + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + +
    + + + + # + + + + # + + + + # + + + attribute + + + + + + + + Type: + + + + Use: + + + + + Values + + + + + + +
    + + +
    + + + + Values + + + + + + +
    + + +
    + + + + Values + + + + + + +
    + + +
    + + + + Default: + + + +
    + + + + + + + + # + + + + + + + + schema.reference.html# + _blank + + + + *? + + + + + + + + + ( + + + + # + + + + + + schema.reference.html# + _blank + + + *? + + + + (in ) + (in ) + + + + + | + )*? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jasperreports-6.2.2/jasperreports/docs/config.reference.xml jasperreports-6.3.1/jasperreports/docs/config.reference.xml --- jasperreports-6.2.2/jasperreports/docs/config.reference.xml 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/docs/config.reference.xml 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,6489 @@ + + + + + + + + Data Source / Query Executer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Report Compilation + + + + + + + + + + + + + Report Design + + + + + + + + + + + + Report Filling + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Governors + + + + + + + + + + Crosstabs + + + + + + + + + + + + + Barcode Component + + + + + + + + + Map Component + + + + + + + + + + Table Component + + + + + + + + + + + + + + + + + + + Chart Themes + + + + + + + + + + + + + + Report Export + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JasperReports Extensions + + + + + + + + + JasperReports Repository + + + + + + + + Other + + + + + + + + + + + + + + + + + + + + + + + +Property that references the parameter containing the bookmarks data source. + + net/sf/jasperreports/parts/subreport/SubreportFillPart.html#PROPERTY_BOOKMARKS_DATA_SOURCE_PARAMETER + N/A + Part + 6.0.0 + + + + + + + +Property having this prefix hold the comma separated names of the columns to be extracted from the CSV source. + + net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_COLUMN_NAMES + N/A + Global | Dataset + 4.0.0 + + + + + + + +Property holding the value of the date format pattern to be used when parsing the CSV data. + + net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_DATE_PATTERN + N/A + Global | Dataset + 4.0.0 + + + + + + + + + net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_ENCODING + N/A + Global | Dataset + 4.0.0 + + + + + + + +Property specifying the name of the column in the CSV data to which the dataset field is mapped to, in case CSV data is used. + + net/sf/jasperreports/engine/data/JRCsvDataSource.html#PROPERTY_FIELD_COLUMN_NAME + N/A + Field + 6.3.1 + + + + + + + +Property specifying the 0-based index of the column in the CSV data to which the dataset field is mapped to, in case CSV data is used. + + net/sf/jasperreports/engine/data/JRCsvDataSource.html#PROPERTY_FIELD_COLUMN_INDEX + N/A + Field + 6.3.1 + + + + + + + + + net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_FIELD_DELIMITER + , + Global | Dataset + 4.0.0 + + + + + + + + + net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_LOCALE_CODE + N/A + Global | Dataset + 4.0.0 + + + + + + + +Property holding the value of the number format pattern to be used when parsing the CSV data. + + net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_NUMBER_PATTERN + N/A + Global | Dataset + 4.0.0 + + + + + + + + + net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_RECORD_DELIMITER + \n + Global | Dataset + 4.0.0 + + + + + + + +String property representing a valid path to the requested resource containing the CSV data. It can be: +
      +
    • a resource on the classpath
    • +
    • a file from the filesystem, with an absolute or relative path
    • +
    • an url
    • +
    +
    + net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_SOURCE + N/A + Global | Dataset + 4.0.0 +
    + + + + + + + + net/sf/jasperreports/engine/query/JRCsvQueryExecuterFactory.html#CSV_TIMEZONE_ID + N/A + Global | Dataset + 4.0.0 + + + + + + + +A report/dataset level property that provides the location of a data adapter resource to be used for the dataset. + + net/sf/jasperreports/data/DataAdapterParameterContributorFactory.html#PROPERTY_DATA_ADAPTER_LOCATION + N/A + Global | Dataset + 4.1.1 + + + + + + + +Properties with this prefix introduce JPA implementation specific EJBQL query hints to be used by the +JRJpaQueryExecuter. The suffix is the name of the hint, as documented by the specific JPA implementation. + + net/sf/jasperreports/engine/query/JRJpaQueryExecuterFactory.html#PROPERTY_JPA_QUERY_HINT_PREFIX + N/A + Dataset + 1.2.3 + + + + + + + +Property specifying the number of result rows to be retrieved at once. Result pagination is implemented by +javax.persistence.Query.setFirstResult() and javax.persistence.Query.setMaxResults(). +
    +By default, all the rows are retrieved (no result pagination is performed). +
    + net/sf/jasperreports/engine/query/JRJpaQueryExecuterFactory.html#PROPERTY_JPA_QUERY_PAGE_SIZE + 0 + Global | Dataset + 1.2.3 +
    + + + + + + +Property specifying whether Hibernate session cache should be cleared between two consecutive fetches when using pagination. +
    +By default, the cache cleanup is not performed. +
    + net/sf/jasperreports/engine/query/JRHibernateQueryExecuterFactory.html#PROPERTY_HIBERNATE_CLEAR_CACHE + false + Global | Dataset + 1.3.1 +
    + + + + + + +Property specifying whether field descriptions should be used to determine the mapping between the fields and the query return values. +
    +By default, field description are used. +
    + net/sf/jasperreports/engine/query/JRHibernateQueryExecuterFactory.html#PROPERTY_HIBERNATE_FIELD_MAPPING_DESCRIPTIONS + true + Global | Dataset + 1.2.0 +
    + + + + + + +Property specifying the number of result rows to be retrieved at once when the execution type is list. +Result pagination is implemented by org.hibernate.Query.setFirstResult() and org.hibernate.Query.setMaxResults(). +By default, all the rows are retrieved (no result pagination is performed). + + net/sf/jasperreports/engine/query/JRHibernateQueryExecuterFactory.html#PROPERTY_HIBERNATE_QUERY_LIST_PAGE_SIZE + 0 + Global | Dataset + 1.2.0 + + + + + + + +Property specifying the Hibernate query execution type. Possible values are: +
      +
    • list - the query will be run by calling org.hibernate.Query.list()
    • +
    • iterate - the query will be run by calling org.hibernate.Query.iterate()
    • +
    • scroll - the query will be run by calling org.hibernate.Query.scroll()
    • +
    +
    + net/sf/jasperreports/engine/query/JRHibernateQueryExecuterFactory.html#PROPERTY_HIBERNATE_QUERY_RUN_TYPE + list + Global | Dataset + 1.2.0 +
    + + + + + + +Property that specifies the base URL to be used by the HTTP data adapters. +If present in the dataset or at report parameter level, it overrides the URL specified in the data adapter definition, or the value provided +by the report parameter having the now deprecated HTTP_DATA_URL name. +When specified at parameter level, it does not need to provide a value. Instead, it is used to mark the report parameter that would provide the URL value. +If multiple parameters have this property set, the last one will be used to provide the URL value. + + net/sf/jasperreports/data/http/HttpDataService.html#PROPERTY_URL + N/A + Dataset | Parameter + 6.3.1 + + + + + + + +Property that specifies the user name to be used by the HTTP data adapters with basic authentication. +If present in the dataset or at report parameter level, it overrides the user name specified in the data adapter definition, or the value provided +by the report parameter having the now deprecated HTTP_DATA_USERNAME name. +When specified at parameter level, it does not need to provide a value. Instead, it is used to mark the report parameter that would provide the user name value. +If multiple parameters have this property set, the last one will be used to provide the user name value. + + net/sf/jasperreports/data/http/HttpDataService.html#PROPERTY_USERNAME + N/A + Dataset | Parameter + 6.3.1 + + + + + + + +Property that specifies the password to be used by the HTTP data adapters with basic authentication. +If present in the dataset or at report parameter level, it overrides the password specified in the data adapter definition, or the value provided +by the report parameter having the now deprecated HTTP_DATA_PASSWORD name. +When specified at parameter level, it does not need to provide a value. Instead, it is used to mark the report parameter that would provide the password value. +If multiple parameters have this property set, the last one will be used to provide the password value. + + net/sf/jasperreports/data/http/HttpDataService.html#PROPERTY_PASSWORD + N/A + Dataset | Parameter + 6.3.1 + + + + + + + +Property which specifies that the current parameter will append a request parameter value to the base URL when HTTP data adapters are used. +The value of this property indicates the name of the request parameter to be appended. In case the property is used, but no value is provided, the name of the request +parameter will be the same as the current report parameter name. +Request parameters introduced this way override the request parameters having the same name which were declared at data adapter level or were provided +by the report parameters having the now deprecated HTTP_DATA_URL_PARAMETER_ prefix. +If multiple parameters try to provide a value for the same request parameter, the request parameter will be sent multiple times, becoming a request parameter of type array. + + net/sf/jasperreports/data/http/HttpDataService.html#PROPERTY_URL_PARAMETER + N/A + Parameter + 6.3.1 + + + + + + + +Property which specifies that the current parameter will contribute a POST request parameter value when HTTP data adapters are used. +The value of this property indicates the name of the request parameter to be contributed. In case the property is used, but no value is provided, the name of the request +parameter will be the same as the current report parameter name. +Request parameters introduced this way override the request parameters having the same name which were declared at data adapter level or were provided +by the report parameters having the now deprecated HTTP_DATA_POST_PARAMETER_ prefix. +If multiple parameters try to provide a value for the same request parameter, the request parameter will be sent multiple times, becoming a request parameter of type array. + + net/sf/jasperreports/data/http/HttpDataService.html#PROPERTY_POST_PARAMETER + N/A + Parameter + 6.3.1 + + + + + + + +Property which specifies that the current parameter will contribute a request header value when HTTP data adapters are used. +The value of this property indicates the name of the request header to be contributed. In case the property is used, but no value is provided, the name of the request +header will be the same as the current report parameter name. +Request headers introduced this way override the request headers having the same name which were declared at data adapter level. +If multiple parameters try to provide a value for the same request header, the request header will be added multiple times to the request. + + net/sf/jasperreports/data/http/HttpDataService.html#PROPERTY_HEADER + N/A + Parameter + 6.3.1 + + + + + + + +Property specifying the JavaBean property name for the dataset field in case an JavaBean data source is used. +This mapping was previously specified using the fieldDescription attribute, but using this custom property is now recommended. + + net/sf/jasperreports/engine/data/JRAbstractBeanDataSource.html#PROPERTY_JAVABEAN_FIELD_PROPERTY + N/A + Field + 6.3.1 + + + + + + + +Property specifying the JSON expression for the dataset field in case an XML data source is used. +This mapping was previously specified using the fieldDescription attribute, but using this custom property is now recommended. + + net/sf/jasperreports/engine/data/JsonDataSource.html#PROPERTY_FIELD_EXPRESSION + N/A + Field + 6.3.1 + + + + + + + +Flag property specifying if data will be stored in a cached rowset. + + net/sf/jasperreports/engine/query/JRJdbcQueryExecuterFactory.html#PROPERTY_CACHED_ROWSET + false + Global | Dataset + 4.1.2 + + + + + + +Property specifying the fetch size for the java.sql.ResultSet created by the +JRJdbcQueryExecuter and the +JRHibernateQueryExecuter. + + net/sf/jasperreports/engine/query/JRJdbcQueryExecuterFactory.html#PROPERTY_JDBC_FETCH_SIZE + 0 + Global | Dataset + 1.2.0 + + + + + + +Property specifying the type for the java.sql.ResultSet created by the +JRJdbcQueryExecuter. Possible values are: +
      +
    • forwardOnly - the cursor may move only forward.
    • +
    • scrollInsensitive - the result set is scrollable but generally not sensitive to changes made by others.
    • +
    • scrollSensitive - the result set is scrollable and generally sensitive to changes made by others.
    • +
    +
    + net/sf/jasperreports/engine/query/JRJdbcQueryExecuterFactory.html#PROPERTY_JDBC_RESULT_SET_TYPE + forwardOnly + Global | Dataset + 3.5.3 +
    + + + + + +Property specifying the concurrency rule for the java.sql.ResultSet created by the +JRJdbcQueryExecuter. Possible values are: +
      +
    • readOnly - the concurrency mode for a ResultSet object that may NOT be updated.
    • +
    • updatable - the concurrency mode for a ResultSet object that may be updated.
    • +
    +
    + net/sf/jasperreports/engine/query/JRJdbcQueryExecuterFactory.html#PROPERTY_JDBC_CONCURRENCY + readOnly + Global | Dataset + 3.5.3 +
    + + + + + +Property specifying the cursor holdability after commit for the java.sql.ResultSet created by the +JRJdbcQueryExecuter. Possible values are: +
      +
    • hold - indicates that ResultSet objects should not be closed when the method Connection.commit() is called.
    • +
    • close - indicates that ResultSet objects should be closed when the method Connection.commit() is called.
    • +
    +
    + net/sf/jasperreports/engine/query/JRJdbcQueryExecuterFactory.html#PROPERTY_JDBC_HOLDABILITY + hold + Global | Dataset + 3.5.3 +
    + + + + + +Property specifying the limit for the maximum number of bytes in a ResultSet column +storing character or binary values created by the +JRJdbcQueryExecuter. + + net/sf/jasperreports/engine/query/JRJdbcQueryExecuterFactory.html#PROPERTY_JDBC_MAX_FIELD_SIZE + N/A + Global | Dataset + 3.5.3 + + + + + + +Property that specifies the list of token separators characters for TYPE_CLAUSE_TOKENS tokenized query clauses. + + net/sf/jasperreports/engine/JRQueryChunk.html#PROPERTY_CHUNK_TOKEN_SEPARATOR + , ; | + Global + 2.0.5 + + + + + + + + +Properties with this prefix associate a query executer factory implementation with a query language. +To obtain query executer factories, a property having the query language appended to this prefix is used to get the query executer factory name. + + net/sf/jasperreports/engine/query/QueryExecuterFactory.html#QUERY_EXECUTER_FACTORY_PREFIX + N/A + Global + 1.2.0 + + + + + + + +Property specifying the name of the column in the JDBC result set to which the dataset field is mapped to, in case an SQL query is used. + + net/sf/jasperreports/engine/JRResultSetDataSource.html#PROPERTY_FIELD_COLUMN_NAME + N/A + Field + 6.3.1 + + + + + + + +Property specifying the label of the column in the JDBC result set to which the dataset field is mapped to, in case an SQL query is used. + + net/sf/jasperreports/engine/JRResultSetDataSource.html#PROPERTY_FIELD_COLUMN_LABEL + N/A + Field + 6.3.1 + + + + + + + +Property specifying the 1-based index of the column in the JDBC result set to which the dataset field is mapped to, in case an SQL query is used. + + net/sf/jasperreports/engine/JRResultSetDataSource.html#PROPERTY_FIELD_COLUMN_INDEX + N/A + Field + 6.3.1 + + + + + + + +Property having this prefix hold the comma separated values of the column indexes to be extracted from the Excel source. + + net/sf/jasperreports/engine/query/AbstractXlsQueryExecuterFactory.html#XLS_COLUMN_INDEXES + N/A + Global | Dataset + 5.5.2 + + + + + + + +Property having this prefix hold the comma separated names of the columns to be extracted from the Excel source. + + net/sf/jasperreports/engine/query/AbstractXlsQueryExecuterFactory.html#XLS_COLUMN_NAMES + N/A + Global | Dataset + 5.5.2 + + + + + + + +Property specifying the name of the column in the Excel data to which the dataset field is mapped to, in case Excel data is used. + + net/sf/jasperreports/engine/data/AbstractXlsDataSource.html#PROPERTY_FIELD_COLUMN_NAME + N/A + Field + 6.3.1 + + + + + + + +Property specifying the 0-based index of the column in the Excel data to which the dataset field is mapped to, in case Excel data is used. + + net/sf/jasperreports/engine/data/AbstractXlsDataSource.html#PROPERTY_FIELD_COLUMN_INDEX + N/A + Field + 6.3.1 + + + + + + + +Property holding the value of the date format pattern to be used when parsing the Excel data. + + net/sf/jasperreports/engine/query/AbstractXlsQueryExecuterFactory.html#XLS_DATE_PATTERN + N/A + Global | Dataset + 5.5.2 + + + + + + + +String property specifying the code of the locale to be used when parsing the Excel data. +

    +The allowed format is: language[_country[_variant]] + + net/sf/jasperreports/engine/query/AbstractXlsQueryExecuterFactory.html#XLS_LOCALE_CODE + N/A + Global | Dataset + 5.5.2 + + + + + + + +Property holding the value of the number format pattern to be used when parsing the Excel data. + + net/sf/jasperreports/engine/query/AbstractXlsQueryExecuterFactory.html#XLS_NUMBER_PATTERN + N/A + Global | Dataset + 5.5.2 + + + + + + + +String property representing a valid path to the requested resource containing the Excel data. It can be: +

      +
    • a resource on the classpath
    • +
    • a file from the filesystem, with an absolute or relative path
    • +
    • an url
    • +
    +
    + net/sf/jasperreports/engine/query/AbstractXlsQueryExecuterFactory.html#XLS_SOURCE + N/A + Global | Dataset + 5.5.2 +
    + + + + + + +String property specifying value of the time zone id to be used when parsing the Excel data. + + net/sf/jasperreports/engine/query/AbstractXlsQueryExecuterFactory.html#XLS_TIMEZONE_ID + N/A + Global | Dataset + 5.5.2 + + + + + + + +String property representing a valid path to the requested resource containing the XML data. It can be: +
      +
    • a resource on the classpath
    • +
    • a file from the filesystem, with an absolute or relative path
    • +
    • an url
    • +
    +
    + net/sf/jasperreports/engine/query/JRXPathQueryExecuterFactory.html#XML_SOURCE + N/A + Global | Dataset + 4.7.1 +
    + + + + + + +Property specifying the +JRXPathExecuterFactory XPath executer factory implementation class name. JasperReports is shipped with two implementation of this factory interface: +XalanXPathExecuterFactory and +JaxenXPathExecuter. + + net/sf/jasperreports/engine/util/xml/JRXPathExecuterUtils.html#PROPERTY_XPATH_EXECUTER_FACTORY + net.sf.jasperreports.engine.util.xml.XalanXPathExecuterFactory + Global + 2.0.0 + + + + + + + +Property specifying the XPath expression for the dataset field in case an XML data source is used. +This mapping was previously specified using the fieldDescription attribute, but using this custom property is now recommended. + + net/sf/jasperreports/engine/data/AbstractXmlDataSource.html#PROPERTY_FIELD_EXPRESSION + N/A + Field + 6.3.1 + + + + + + + +Prefix for properties that map report compilers to expression languages. +
    +Properties having this prefix indicate the JRCompiler implementation to be used when compiling +report designs that rely on the expression language specified as property suffix. +
    + net/sf/jasperreports/engine/design/JRCompiler.html#COMPILER_PREFIX + net.sf.jasperreports.engine.design.JRJdtCompiler, if available; net.sf.jasperreports.engine.design.JRJdk13Compiler otherwise.
    Java is considered the default expression language.
    + Global + 2.0.1 +
    + + + + + + +Property specifying the classpath used by the report compiler during the compilation process. + + net/sf/jasperreports/engine/design/JRCompiler.html#COMPILER_CLASSPATH + System.getProperty("java.class.path") + Global + 1.0.0 + + + + + + + +Property specifying whether the temporary source file created by the report compiler should be kept or deleted after the report compilation process ended. + + net/sf/jasperreports/engine/design/JRCompiler.html#COMPILER_KEEP_JAVA_FILE + false + Global + 1.0.0 + + + + + + + +Property specifying the temporary working directory to be used by the report compiler. + + net/sf/jasperreports/engine/design/JRCompiler.html#COMPILER_TEMP_DIR + System.getProperty("user.dir") + Global + 1.0.0 + + + + + + + +Property that forces the XML validation of the report template file before compiling. + + net/sf/jasperreports/engine/xml/JRReportSaxParserFactory.html#COMPILER_XML_VALIDATION + true + Global + 1.0.0 + + + + + + + +Property that determines whether XML schemas/grammars are to be cached +so that they are not read/initialized each time a report is compiled. +
    +Currently, setting this property is only effective when a Xerces XML +parser is used (either a stock one from Apache or one embedded into a +SUN JDK). +
    + net/sf/jasperreports/engine/xml/BaseSaxParserFactory.html#PROPERTY_CACHE_SCHEMAS + true + Global + 3.1.0 +
    + + + + + + +Property that gives a parser factory class which should be used +for parsing JRXMLs. +
    +By default, this property is set to use JRReportSaxParserFactory +as report parser factory. +
    + net/sf/jasperreports/engine/xml/JRSaxParserFactory.html#PROPERTY_REPORT_PARSER_FACTORY + net.sf.jasperreports.engine.xml.JRReportSaxParserFactory + Global + 3.1.0 +
    + + + + + + +Stores the text sequence used to replace invalid XML characters. +
    +By default, this property is set to replace invalid chars with question marks. Depending on particular needs, the following settings are available: +
      +
    • to completely remove invalid XML chars from the processed text, set an empty string as property value: +
      +<property name="net.sf.jasperreports.export.xml.replace.invalid.chars" value=""/> +
    • +
    • to replace invalid XML chars with a custom char or text sequence, set the text sequence as property value. For instance: +
      +<property name="net.sf.jasperreports.export.xml.replace.invalid.chars" value="^^"/> +
    • +
    • to preserve invalid chars in the processed text, either set the property with no value, or remove the property from the JasperReports context. +Below is the property with no value set: +
      +<property name="net.sf.jasperreports.export.xml.replace.invalid.chars"/> +
    • +
    +
    + net/sf/jasperreports/engine/export/JRXmlExporter.html#PROPERTY_REPLACE_INVALID_CHARS + ? + Global | Report + 4.7.1 +
    + + + + + + +A property that determines whether elements having negative width values are allowed. +
    +If this value is set to false, the report is verified not +to contain elements with negative width values. This is useful when the report is +meant to be exported to grid-based formats such as HTML, XLS or CSV, which might enter +an infinite loop. Having elements with negative widths does not make sense, but allowing +this is a workaround in case older report templates still need to pass validation +at report compile time. +
    + net/sf/jasperreports/engine/design/JRVerifier.html#PROPERTY_ALLOW_ELEMENT_NEGATIVE_WIDTH + false + Global | Report + 3.7.1 +
    + + + + + + +Property that determines whether elements positioned at negative X offsets on bands, frames and other element containers are allowed in a report. +
    +Elements placed at negative X offsets can cause unexpected problems in grid-based exporters where they can overlap elements from previous bands/element containers. +
    +If the property is set to false, elements in the report are verified to have positive X offsets. Otherwise, no check is performed on element X offsets. +
    + net/sf/jasperreports/engine/design/JRVerifier.html#PROPERTY_ALLOW_ELEMENT_NEGATIVE_X + true + Global | Report | Element + 6.1.1 +
    + + + + + + +Property that determines whether elements positioned at negative Y offsets on bands, frames and other element containers are allowed in a report. +
    +Elements placed at negative Y offsets can cause unexpected problems in grid-based exporters where they can overlap elements from previous bands/element containers. +
    +If the property is set to false, elements in the report are verified to have positive Y offsets. Otherwise, no check is performed on element Y offsets. +
    + net/sf/jasperreports/engine/design/JRVerifier.html#PROPERTY_ALLOW_ELEMENT_NEGATIVE_Y + true + Global | Report | Element + 3.7.3 +
    + + + + + + +A property that determines whether elements are allowed to overlap. +
    +If this value is set to false, the report is verified not +to contain elements that overlap. This is useful when the report is +meant to be exported to grid-based formats such as HTML, XLS or CSV. +Setting this property to false ensures that element overlap +issues are caught at report compile time. +
    +Additionally, when this property is set to false false, the +report is verified not to have any content in the background section as +this content would likely be overlapped by other sections and would not +show in grid-based exporters. +
    +By default, the property is set to true which means that +no element overlap checks are performed. +
    +The property can be set at the following levels: +
      +
    • At global level (in jasperreports.properties) to provide a default +value.
    • +
    • At report level, to indicate whether element overlap checks are to +be performed for the report. If not set, the global property value is +used.
    • +
    • At report element level to specify that the particular element is +allowed to overlap or be overlapped by other elements, when the report +or global property determines report element overlap verification. +The element level property is only effective when set to true; +setting the property to false does not make the verifier +check for overlaps when the report is not set to be checked for element +overlaps.
    • +
    +
    +Note that print when expressions or export filters cannot be taken into +consideration while checking for overlapping elements as this check is +performed at report compilation time. +If a report contains two elements that overlap but have print when +expressions that guarantee that only one of them will be printed, +or if export filters are in place to exclude one of the elements, +one of them should be explicitly marked to allow element overlap +when the report is configured to check for overlaps. +
    + net/sf/jasperreports/engine/design/JRVerifier.html#PROPERTY_ALLOW_ELEMENT_OVERLAP + true + Global | Report | Element + 3.5.0 +
    + + + + + + +Properties with this prefix are used in the PropertyStyleProvider class +(which is the default JR implementation of the StyleProvider interface) +to configure dynamic style features for report elements. If such a property is found at element level, its value will override the related +style feature of the element. +
    +
    +The following style properties are defined in PropertyStyleProvider class: +
      +
    • Properties for common style attributes: +
        +
        +
      • net.sf.jasperreports.style.mode
      • +
      • net.sf.jasperreports.style.backcolor
      • +
      • net.sf.jasperreports.style.forecolor
      • +
      • net.sf.jasperreports.style.fill
      • +
      • net.sf.jasperreports.style.radius
      • +
      • net.sf.jasperreports.style.scaleImage
      • +
      • net.sf.jasperreports.style.hAlign - deprecated since v.6.0.2 - replaced with net.sf.jasperreports.style.hTextAlign or net.sf.jasperreports.style.hImageAlign
      • +
      • net.sf.jasperreports.style.vAlign - deprecated since v.6.0.2 - replaced with net.sf.jasperreports.style.vTextAlign or net.sf.jasperreports.style.vImageAlign
      • +
      • net.sf.jasperreports.style.hTextAlign
      • +
      • net.sf.jasperreports.style.vTextAlign
      • +
      • net.sf.jasperreports.style.hImageAlign
      • +
      • net.sf.jasperreports.style.vImageAlign
      • +
      • net.sf.jasperreports.style.rotation
      • +
      • net.sf.jasperreports.style.markup
      • +
      • net.sf.jasperreports.style.isBlankWhenNull
      • +
      • net.sf.jasperreports.style.fontName
      • +
      • net.sf.jasperreports.style.fontSize
      • +
      • net.sf.jasperreports.style.isBold
      • +
      • net.sf.jasperreports.style.isItalic
      • +
      • net.sf.jasperreports.style.isUnderline
      • +
      • net.sf.jasperreports.style.isStrikeThrough
      • +
      • net.sf.jasperreports.style.pdfFontName
      • +
      • net.sf.jasperreports.style.pdfEncoding
      • +
      • net.sf.jasperreports.style.isPdfEmbedded
      • +
      • net.sf.jasperreports.style.pattern - the value of this property is overridden by the <patternExpression/>, if present.
      • +
        +
      +
    • +
    • Properties for pen style attributes: +
        +
        +
      • net.sf.jasperreports.style.pen.lineWidth
      • +
      • net.sf.jasperreports.style.pen.lineStyle
      • +
      • net.sf.jasperreports.style.pen.lineColor
      • +
        +
      +
    • +
    • Properties for box style attributes: +
        +
        +
      • net.sf.jasperreports.style.box.padding
      • +
      • net.sf.jasperreports.style.box.topPadding
      • +
      • net.sf.jasperreports.style.box.leftPadding
      • +
      • net.sf.jasperreports.style.box.rightPadding
      • +
      • net.sf.jasperreports.style.box.bottomPadding
      • +
      • net.sf.jasperreports.style.box.pen.lineWidth
      • +
      • net.sf.jasperreports.style.box.pen.lineStyle
      • +
      • net.sf.jasperreports.style.box.pen.lineColor
      • +
      • net.sf.jasperreports.style.box.top.pen.lineWidth
      • +
      • net.sf.jasperreports.style.box.top.pen.lineStyle
      • +
      • net.sf.jasperreports.style.box.top.pen.lineColor
      • +
      • net.sf.jasperreports.style.box.left.pen.lineWidth
      • +
      • net.sf.jasperreports.style.box.left.pen.lineStyle
      • +
      • net.sf.jasperreports.style.box.left.pen.lineColor
      • +
      • net.sf.jasperreports.style.box.right.pen.lineWidth
      • +
      • net.sf.jasperreports.style.box.right.pen.lineStyle
      • +
      • net.sf.jasperreports.style.box.right.pen.lineColor
      • +
      • net.sf.jasperreports.style.box.bottom.pen.lineWidth
      • +
      • net.sf.jasperreports.style.box.bottom.pen.lineStyle
      • +
      • net.sf.jasperreports.style.box.bottom.pen.lineColor
      • +
        +
      +
    • +
    • Properties for paragraph style attributes: +
        +
        +
      • net.sf.jasperreports.style.paragraph.lineSpacing
      • +
      • net.sf.jasperreports.style.paragraph.lineSpacingSize
      • +
      • net.sf.jasperreports.style.paragraph.firstLineIndent
      • +
      • net.sf.jasperreports.style.paragraph.leftIndent
      • +
      • net.sf.jasperreports.style.paragraph.rightIndent
      • +
      • net.sf.jasperreports.style.paragraph.spacingBefore
      • +
      • net.sf.jasperreports.style.paragraph.spacingAfter
      • +
      • net.sf.jasperreports.style.paragraph.tabStopWidth
      • +
      +
    • +
    +Note: All the above properties are exclusively used to override features of the element's style, and not to define a +new style in the report. Properties such as net.sf.jasperreports.style.name or net.sf.jasperreports.style.style +have no meaning and no effects in this implementation. Conditional styles should be used instead. +
    + net/sf/jasperreports/engine/style/PropertyStyleProvider.html#STYLE_PROPERTY_PREFIX + N/A + Element + 4.8.0 +
    + + + + + + +Specifies whether report styles that do not have a parent specified would rely on the default style as parent for property inheritance. +Before version 6.2.1, styles without parent were not inheriting from default style. + + net/sf/jasperreports/engine/util/StyleResolver.html#PROPERTY_STYLES_INHERIT_FROM_DEFAULT + true + Global + 6.2.1 + + + + + + + +Specifies the default split type for bands. See the splitType attribute of the report band. + + net/sf/jasperreports/engine/JRBand.html#PROPERTY_SPLIT_TYPE + Stretch + Global | Report + 3.5.2 + + + + + + + +Specifies whether duplicated key entries in pie dataset should be ignored and only the last value be considered, or whether an exception should be raised instead. + + net/sf/jasperreports/charts/JRPieDataset.html#PROPERTY_IGNORE_DUPLICATED_KEY + false + Global | Report | Dataset + 6.0.2 + + + + + + + +Specifies the default render type for charts. See the renderType attribute of the chart elements. + + net/sf/jasperreports/engine/JRChart.html#PROPERTY_CHART_RENDER_TYPE + draw + Global | Report + 2.0.5 + + + + + + + +Prefix for properties that map chart renderers. +
    +Properties having this prefix indicate the JRRenderable implementation to be used when rendering +a chart element having a rendering type specified in the property suffix. +
    + net/sf/jasperreports/charts/util/JRChart.html#PROPERTY_CHART_RENDER_TYPE + N/A + Global + 2.0.5 +
    + + + + + + +Property used to specify the chart theme name. + + net/sf/jasperreports/engine/ChartRenderableFactory.html#PROPERTY_CHART_RENDERER_FACTORY_PREFIX + default + Global | Report + 3.1.0 + + + + + + + +Properties having this prefix specify the name of a class that implements the JRChartCustomizer +interface and has an empty constructor. +This class will be used to instantiate a chart customizer object that will be then called to customize the chart produced by the element. +The {arbitrary_name} suffix of the property is considered to be the name of the chart customizer instance and in case the chart customizer class +implements the NamedChartCustomizer interface, this name is passed to it after instantiation +using the setName(String) method. +Named customizer implementations such as the ones extending the JRAbstractChartCustomizer could +use this name to read custom chart element properties that are supposed to be their own, because they have this name as part of the full custom property name in the form of +net.sf.jasperreports.customizer.{arbitrary_name}.{property_name}. + + net/sf/jasperreports/engine/JRChartCustomizer.html#CUSTOMIZER_CLASS_PROPERTY_PREFIX + N/A + Chart + 6.3.1 + + + + + + + +Properties having this form are usually supposed to be read by NamedChartCustomizer instances assigned to a chart element using a custom property in the form of +net.sf.jasperreports.customizer.class.{arbitrary_name}. + + net/sf/jasperreports/engine/NamedChartCustomizer.html + N/A + Global | Report | Chart + 6.3.1 + + + + + + + +Property used to force the expanding text fields to occupy all remaining space at the bottom of the page so that no other element renders there. + + net/sf/jasperreports/engine/fill/JRFillTextElement.html#PROPERTY_CONSUME_SPACE_ON_OVERFLOW + true + Global | Report | Element + 6.3.1 + + + + + + + +Specifies the default value (in pixels) for the first line indent, if no explicit information is provided in a JR paragraph. +
    +By default the first line in JR paragraphs has no indentation. +
    + net/sf/jasperreports/engine/JRParagraph.html#DEFAULT_FIRST_LINE_INDENT + 0 + Global + 4.0.2 +
    + + + + + + +Specifies the default font name when no default font is explicitly given in a report. + + net/sf/jasperreports/engine/JRFont.html#DEFAULT_FONT_NAME + SansSerif + Global + 1.3.0 + + + + + + + +Specifies the default font size when no default font size is explicitly given in a report. + + net/sf/jasperreports/engine/JRFont.html#DEFAULT_FONT_SIZE + 10 + Global + 1.3.0 + + + + + + + +Specifies the default value (in pixels) for the left indent, if no explicit information is provided in a JR paragraph. +
    +By default JR paragraphs provide no left indentation. +
    + net/sf/jasperreports/engine/JRParagraph.html#DEFAULT_LEFT_INDENT + 0 + Global + 4.0.2 +
    + + + + + + +Specifies the default value for the text line spacing size, if no explicit information is provided in a +JR paragraph. +
    +This value is used in combination with the size-dependent line spacings in +LineSpacingEnum: +
      +
    • AT_LEAST
    • +
    • FIXED
    • +
    • PROPORTIONAL
    • +
    +
    + net/sf/jasperreports/engine/JRParagraph.html#DEFAULT_LINE_SPACING_SIZE + 1 + Global + 4.0.2 +
    + + + + + + +Specifies the default value (in pixels) for the right indent, if no explicit information is provided in a JR paragraph. +
    +By default JR paragraphs provide no right indentation. +
    + net/sf/jasperreports/engine/JRParagraph.html#DEFAULT_RIGHT_INDENT + 0 + Global + 4.0.2 +
    + + + + + + +Specifies the default value (in pixels) for the spacing after lines, if no explicit information is provided in a JR paragraph. +
    +By default JR paragraphs provide no spacing after lines. +
    + net/sf/jasperreports/engine/JRParagraph.html#DEFAULT_SPACING_AFTER + 0 + Global + 4.0.2 +
    + + + + + + +Specifies the default value (in pixels) for the spacing before lines, if no explicit information is provided in a JR paragraph. +
    +By default JR paragraphs provide no spacing before lines. +
    + net/sf/jasperreports/engine/JRParagraph.html#DEFAULT_SPACING_BEFORE + 0 + Global + 4.0.2 +
    + + + + + + +Specifies the default value (in pixels) for the tab stop width, if no explicit information is provided in a paragraph. +
    +By default JR paragraphs provide 40 pixels wide tab stops. +
    + net/sf/jasperreports/engine/JRParagraph.html#DEFAULT_TAB_STOP_WIDTH + 40 + Global + 4.0.2 +
    + + + + + + +Property specifying the name of the class implementing the +JRImageEncoder interface to be used by the engine. +If not set, the engine will try to an image encoder implementation that corresponds to the JVM version. + + net/sf/jasperreports/engine/util/JRImageLoader.html#PROPERTY_IMAGE_ENCODER + N/A + Global + 2.0.5 + + + + + + + +Property specifying the name of the class implementing the +JRImageReader interface to be used by the engine. +If not set, the engine will try to an image reader implementation that corresponds to the JVM version. + + net/sf/jasperreports/engine/util/JRImageLoader.html#PROPERTY_IMAGE_READER + N/A + Global + 2.0.5 + + + + + + + +Prefix for properties that map markup text processors. +
    +Properties having this prefix indicate the MarkupProcessor implementation to be used when parsing +a given styled text having the markup type specified in the property suffix. +
    + net/sf/jasperreports/engine/util/MarkupProcessorFactory.html#PROPERTY_MARKUP_PROCESSOR_FACTORY_PREFIX + N/A + Global + 2.0.5 +
    + + + + + + +This property is used to determine whether missing bookmarks levels should be colapsed when +the propety
    net.sf.jasperreports.print.create.bookmarks is set + + net/sf/jasperreports/engine/JasperPrint.html#PROPERTY_COLLAPSE_MISSING_BOOKMARK_LEVELS + false + Global | Report + 5.5.2 + + + + + + + +Property used to determine whether bookmarks should be collected at report generation time. + + net/sf/jasperreports/engine/JasperPrint.html#PROPERTY_CREATE_BOOKMARKS + false + Global | Report + 5.5.2 + + + + + + + +Property used to determine whether the fill process must preserve the original text for text elements that are not able to fit their entire contents. +When this property is set, the engine saves the original text in the JRPrintText print text object, along with the index at which the text is to be truncated by the print object. + + net/sf/jasperreports/engine/JRTextElement.html#PROPERTY_PRINT_KEEP_FULL_TEXT + false + Global | Report | Text Element + 2.0.3 + + + + + + + +Boolean property that determines whether text elements are to be truncated at the last character that fits. +By default, when the entire text of a text element does not fit the element's area, the text is truncated at the last word that fits the area.
    +
    + net/sf/jasperreports/engine/JRTextElement.html#PROPERTY_TRUNCATE_AT_CHAR + false + Global | Report | Text Element + 2.0.3 +
    + + + + + + +Property whose value is used as a suffix for the truncated text. +The suffix is appended to the text when truncation occurs. +If the property is not defined or empty (which is the case by default), no suffix will be used when the text is truncated. + + net/sf/jasperreports/engine/JRTextElement.html#PROPERTY_TRUNCATE_SUFFIX + empty string + Global | Report | Text Element + 2.0.3 + + + + + + + +This property can either hold the name of a text measurer factory class, or hold an alias of a text measurer factory class property. +One can write an implementation of the JRTextMeasurerFactory interface. This will usually imply writing a custom implementation of the JRTextMeasurer interface, either from scratch or by extending the default implementation (TextMeasurer). +A text measurer is responsible with computing text layout attributes (in the form of JRMeasuredText instances) for report text elements. The measurer is only used at report fill time, the exporters will use the computed text layout attributes. +Then one can define an alias of the text measurer factory implementation by declaring a property named net.sf.jasperreports.text.measurer.factory.{alias} which has the name of the factory class as value. +The net.sf.jasperreports.text.measurer.factory property is set to a defined alias or a full factory class name. +The factory class is used to instantiate text measurers for report text elements, which are then used to compute the text layout attributes. + + net/sf/jasperreports/engine/util/JRTextMeasurerUtil.html#PROPERTY_TEXT_MEASURER_FACTORY + net.sf.jasperreports.engine.fill.TextMeasurerFactory + Global | Report | Text Element + 2.0.3 + + + + + + + +Boolean property that determines whether the positions where text line +break occurs are to be saved during report fill in oder to be used at +export time. +
    +At report fill time, each text element is measured in order to determine +how long it needs to stretch or where it needs to be truncated. +During this measurement, the text wraps at certain positions in order to +fit the text element defined width. +
    +Setting this property to true instructs the engine to save the positions +at which line breaks occur in the generated print element. +The positions can be used by report exporters that want to enforce line +breaks to occur at exactly the same position as they did during text +measurement at fill time. +
    +Currently, the HTML exporter will make use of the saved line break +positions by introducing explicit line breaks. +
    + net/sf/jasperreports/engine/JRTextElement.html#PROPERTY_SAVE_LINE_BREAKS + false + Global | Report | Text Element + 3.5.1 +
    + + + + + + +Property used to decide whether java.io.File#deleteOnExit() should be requested for temporary files created by the virtualizer. +Temporary files will be deleted by explicitly calling cleanup() or from the virtualizer finalize() method. + + net/sf/jasperreports/engine/fill/JRFileVirtualizer.html#PROPERTY_TEMP_FILES_SET_DELETE_ON_EXIT + true + Global + 1.2.3 + + + + + + + +Property that determines how many print elements will make up a virtual page handled as a unit by the virtualizer. + +

    +For most paginated reports, a virtual page corresponds to a report page. +But for non-paginated reports and for reports having very large pages, a report page is broken into several virtual pages which are handled individually by the virtualizer. +

    + +

    +This property provides the size of a virtual page in print elements. +Note that virtual page sizes will actually vary around the configured size since there are cases when fewer elements remain on a report page and cases when the configured size is exceeded due to print frames being included at the end of virtual page. +

    + +

    +If set to 0 or negative, report pages will not be broken into several virtual pages. +

    +
    + net/sf/jasperreports/engine/base/JRVirtualPrintPage.html#PROPERTY_VIRTUAL_PAGE_ELEMENT_SIZE + 2000 + Global | Report + 4.1.3 +
    + + + + + + +Property that specifies a default value for the whenNoDataType attribute of report. + + net/sf/jasperreports/engine/JRReport.html#CONFIG_PROPERTY_WHEN_NO_DATA_TYPE + NoPages + Global | Report + 6.3.1 + + + + + + + +Property specifying the JRSubreportRunnerFactory implementation to use for creating subreport runners. + + net/sf/jasperreports/engine/fill/JRSubreportRunnerFactory.html#SUBREPORT_RUNNER_FACTORY + net.sf.jasperreports.engine.fill
    .JRThreadSubreportRunnerFactory
    + Global + 1.2.2 +
    + + + + + + +Property that indicates whether a legacy fix for a JVM issue related to +evaluator classes generated by JasperReports is enabled. The fix is +enabled by default. +
    +Due to the fix, the garbage collector might not be able to collect +a classloader that loaded JasperReports classes. This would be +inconvenient in scenarios in which JasperReports classes are repeatedly +loaded by different classloaders, e.g. when JasperReports is part of +the classpath of a web application which is often reloaded. In such +scenarios, set this property to false. +
    + net/sf/jasperreports/engine/design/JRAbstractJavaCompiler.html#PROPERTY_EVALUATOR_CLASS_REFERENCE_FIX_ENABLED + true + Global + 3.0.0 +
    + + + + + + +The expression evaluation engine in JasperReports has always ignored +java.lang.NullPointerException exceptions raised during expression evaluation. +An expression raising NullPointerException is evaluated to null. +However, in certain cases, users want to be able to track down the source of +their NPE and this configuration property can be set to instruct the expression +evaluation engine to treat NPEs just the way all other expression exceptions are treated. +
    +The default value of this configuration property is true, meaning NPEs are ignored. +The property can be set globally, at report or at dataset level. +
    + net/sf/jasperreports/engine/fill/JREvaluator.html#PROPERTY_IGNORE_NPE + true + Global | Dataset + 6.1.1 +
    + + + + + + +A flag the determines whether the style of an element is evaluated at +the element evaluation time, or at the time the band on which the element +is placed is rendered. +
    +This applies to report elements that can have delayed evaluations times +(such as text fields and images). When this flag is set to +true, conditional style expressions of the style that is +associated with the element are evaluated at the moment the element is +set to evaluate, and the resulting style to the generated print element. +
    + net/sf/jasperreports/engine/JRStyle.html#PROPERTY_EVALUATION_TIME_ENABLED + false + Global | Report | Element + 3.5.2 +
    + + + + + + +A flag indicating whether the governor that checks if a report exceeds a specified limit of pages is turned on. +With this property enabled, the JR engine will stop the report execution if the number of pages becomes greater than a +custom given value. + + net/sf/jasperreports/governors/MaxPagesGovernor.html#PROPERTY_MAX_PAGES_ENABLED + false + Global | Report + 3.1.4 + + + + + + + +If the governor that checks if a report exceeds a specified limit of pages is turned on, this property will indicate the +maximum number of pages allowed to be ran, in order to prevent a memory overflow error. If the number of pages in the report +becomes greater than this value, the report execution will be stopped. + + net/sf/jasperreports/governors/MaxPagesGovernor.html#PROPERTY_MAX_PAGES + N/A + Global | Report + 3.1.4 + + + + + + + +A flag indicating whether the governor that checks if the elapsed time during report execution +exceeds a specified amount of time is turned on. +
    +With this property enabled, the JR engine will stop the report execution if the elapsed time +becomes greater than the limit value. +
    +By default it should be turned off. +
    + net/sf/jasperreports/governors/TimeoutGovernor.html#PROPERTY_TIMEOUT_ENABLED + false + Global | Report + 3.1.4 +
    + + + + + + +If the governor that checks if the elapsed time during report execution +exceeds a specified amount of time is turned on, this property will indicate the +maximum allowed amount of time, in order to prevent a memory overflow error. If this value +becomes exceeded, the report execution will be stopped. + + net/sf/jasperreports/governors/TimeoutGovernor.html#PROPERTY_TIMEOUT + N/A + Global | Report + 3.1.4 + + + + + + + +Property that limits the number of buckets in a crosstab, to avoid out of memory errors. + + net/sf/jasperreports/crosstabs/fill/calculation/BucketingService.html#PROPERTY_BUCKET_MEASURE_LIMIT + 0 + Global + 1.3.4 + + + + + + + +Property that provides the type of the cell that generated a print frame. (FIXME not a user defined property) +
    +The property value is one of +
      +
    • TYPE_CROSSTAB_HEADER
    • +
    • TYPE_COLUMN_HEADER
    • +
    • TYPE_ROW_HEADER
    • +
    • TYPE_DATA
    • +
    • TYPE_NO_DATA_CELL
    • +
    +
    + net/sf/jasperreports/crosstabs/JRCellContents.html#PROPERTY_TYPE + N/A + Element + 3.1.2 +
    + + + + + + +Property that provides the crosstab row span of a print frame. (FIXME not a user defined property) + + net/sf/jasperreports/crosstabs/JRCellContents.html#PROPERTY_ROW_SPAN + N/A + Element + 3.1.2 + + + + + + + +Property that provides the crosstab column span of a print frame. (FIXME not a user defined property) + + net/sf/jasperreports/crosstabs/JRCellContents.html#PROPERTY_COLUMN_SPAN + N/A + Element + 3.1.2 + + + + + + + +Property that provides the default value for the crosstab ignoreWidth attribute. + + net/sf/jasperreports/crosstabs/JRCrosstab.html#PROPERTY_IGNORE_WIDTH + false + Global | Report + 3.5.3 + + + + + + +Property that enables/disables the interactivity in the crosstab component. + + net/sf/jasperreports/engine/fill/JRFillCrosstab.html#PROPERTY_INTERACTIVE + true + Global | Report | Component + 5.5.0 + + + + + + +Property that enables/disables the floating headers in the crosstab component when scrolling. +
    +If the interactivity has been disabled by setting net.sf.jasperreports.crosstab.interactive to false, then setting this property will have no effect. +
    + net/sf/jasperreports/engine/fill/JRFillCrosstab.html#PROPERTY_FLOATING_HEADERS + true + Global | Report | Component + 6.0.0 +
    + + + + + + +Property that determines which image producer to be used for a barcode component element. The property can +have a value of the name of the class that implements the image producer interface or an +alias that has been set for such a class, using a property of the form +net.sf.jasperreports.components.barcode4j.image.producer.{alias}. +
    +JasperReports provides two barcode image producer implementations: one which renders the +barcode in SVG format and one which renders the barcode as a rasterized image. The +first implementation is registered under the svg alias and is used by default; +the second one has image as alias and can be used by changing the +net.sf.jasperreports.components.barcode4j.image.producer.{alias} +property at any level. +
    +The SVG barcode image producer uses the Barcode4J API to export the barcode to SVG, +then it creates a SVG renderer based on the Batik SVG library. Hence, this option +introduces a dependency on Batik for viewing or exporting a report that includes +barcodes. +
    +The rasterized image producer draws the barcode on a PNG image which can be then +displayed in the generated report. This producer uses further properties, set at the same +levels as the image producer property, to allow the customization of the generated image. +
    + net/sf/jasperreports/components/barcode4j/BarcodeImageProducer.html#PROPERTY_IMAGE_PRODUCER + svg + Global | Report | Element + 3.5.2 +
    + + + + + + +Property that determines which image producer implementation to be used for an alias associated +with the barcode component element using the net.sf.jasperreports.components.barcode4j.image.producer +property. +
    +The value of this property represents the name of the class that implements the image +producer interface for the specified alias. +
    +Rendering the barcode in SVG format is registered under the svg alias and is used by default; +the built-in property value for this alias is net.sf.jasperreports.components.barcode4j.BarcodeSVGImageProducer. +Rendering the barcode as rasterized is registered under the image alias and +the built-in property value for this alias is net.sf.jasperreports.components.barcode4j.BarcodeRasterizedImageProducer. +
    +If the svg alias is set, the built-in SVG renderer is based on the Batik SVG library. +Hence, this option introduces a dependency on Batik for viewing or exporting a report that includes +barcodes. +
    +The rasterized image producer draws the barcode on a PNG image which can be then +displayed in the generated report. This producer uses further properties, set at the same +levels as the image producer property, to allow the customization of the generated image. +
    +
    +Note: This property does not apply to QRCode barcodes which are generated based on a different library (ZXing). For +QRCode barcodes, see net.sf.jasperreports.components.barcode4j.qrcode.producer.{alias}. +
    + net/sf/jasperreports/components/barcode4j/BarcodeImageProducer.html#PROPERTY_PREFIX_IMAGE_PRODUCER + N/A + Global | Report | Element + 3.5.2 +
    + + + + + + +Property that determines which image producer implementation to be used for an alias associated +with the QRCode component element using the net.sf.jasperreports.components.barcode4j.image.producer +property. +
    +The value of this property represents the name of the class that implements the image +producer interface for the specified alias. +
    +Rendering the QRCode component in SVG format is registered under the svg alias and is used by default; +the built-in property value for this alias is net.sf.jasperreports.components.barcode4j.QRCodeSVGImageProducer. +Rendering the QRCode component as rasterized is registered under the image alias and +the built-in property value for this alias is net.sf.jasperreports.components.barcode4j.QRCodeRasterizedImageProducer. +
    + net/sf/jasperreports/components/barcode4j/QRCodeImageProducer.html#PROPERTY_PREFIX_QRCODE_PRODUCER + N/A + Global | Report | Element + 6.0.2 +
    + + + + + + +Property that specifies the Google Maps API key. Using an API key enables additional features: +
      +
    • better Maps APIs usage monitoring in your application
    • +
    • purchasing additional quota if the usage limits are exceeded
    • +
    • allows Google contact you about your application, if necessary
    • +
    +Note: The API key must not be included in Google Maps API for Business requests. Business customers should send their +client ID instead. +
    + net/sf/jasperreports/components/map/MapComponent.html#PROPERTY_KEY + N/A + Global | Report + 5.3 +
    + + + + + + +Property that indicates which version of the Google Maps API to be loaded. The version property may be set as: +
      +
    • experimental version - specified by including the .exp suffix: <property name="net.sf.jasperreports.components.map.version" value="3.exp">
    • +
    • release version - specified either with the release major number (<property name="net.sf.jasperreports.components.map.version" value="3">) or with the release version number (<property name="net.sf.jasperreports.components.map.version" value="3.12">)
    • +
    • numbered version - specified with the version number (<property name="net.sf.jasperreports.components.map.version" value="3.11">)
    • +
    +If not specified, the experimental version is loaded by default. +
    + net/sf/jasperreports/components/map/MapComponent.html#PROPERTY_VERSION + N/A + Global | Report + 5.3 +
    + + + + + + +Property that specifies the client ID for Google Maps API for Business. If set, it takes precedence over the API key property. +
    +Usually works along with the signature property for signed URLs. +
    + net/sf/jasperreports/components/map/MapComponent.html#PROPERTY_CLIENT_ID + N/A + Global | Report + 5.3 +
    + + + + + + +Property that specifies the encrypted client signature for signed request URLs. For complete information see the official Authentication and Authorization documentation for +Maps Image APIs and +Web Services APIs. + + net/sf/jasperreports/components/map/MapComponent.html#PROPERTY_SIGNATURE + N/A + Global | Report + 5.3 + + + + + + + +Property that specifies the character to be used on the column header when the tables's column is sorted ascending + + net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_UP_ARROW_CHAR + \u25B2 + Global + 4.6.0 + + + + + + + +Property that specifies the character to be used on the column header when the tables's column is sorted descending + + net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_DOWN_ARROW_CHAR + \u25BC + Global + 4.6.0 + + + + + + + +Property that specifies the character to be used on the column header when the tables's column has a filtered applied + + net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_FILTER_CHAR + \u2606 + Global + 4.6.0 + + + + + + + +Property that enables/disables the automatic addition of specific custom properties to table cell elements, +that would in turn trigger the creation of special document accessibility tags during PDF export. + + net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_GENERATE_TABLE_PDF_TAGS + false + Global | Report | Component + 6.1.2 + + + + + + + +Property that enables/disables the interactivity in the table component + + net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_INTERACTIVE_TABLE + true + Global | Report | Component | Column + 4.7.1 + + + + + + + + Property that enables/disables the floating header in the table component when scrolling. +
    + If the interactivity has been disabled by setting net.sf.jasperreports.components.table.interactive to false, then setting this property will have no effect. +
    + net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_FLOATING_HEADER + true + Global | Report | Component + 6.3.1 +
    + + + + + + +Property that specifies the field to be used for sorting and/or filtering + + net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_COLUMN_FIELD + N/A + Column + 5.0.1 + + + + + + + +Property that specifies the variable to be used for sorting and/or filtering + + net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_COLUMN_VARIABLE + N/A + Column + 5.0.1 + + + + + + + +Property that enables/disables sorting + + net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_COLUMN_SORTABLE + true + Column + 5.0.1 + + + + + + + +Property that enables/disables filtering + + net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_COLUMN_FILTERABLE + true + Column + 5.0.1 + + + + + + + +Property that enables/disables conditional formatting + + net/sf/jasperreports/components/table/fill/TableReport.html#PROPERTY_COLUMN_CONDITIONALLY_FORMATTABLE + true + Column + 5.0.1 + + + + + + + +Property that specifies a default value for the whenNoDataType attribute of table components. + + net/sf/jasperreports/components/table/TableComponent.html#CONFIG_PROPERTY_WHEN_NO_DATA_TYPE + Blank + Global | Report + 6.0.0 + + + + + + + +Property that specifies whether additional sort fields should be created automatically to preserve +the integrity of dataset groups, when interactive sorting is performed. The groups need to have simple +expressions using single field or single variable reference, for this feature to work properly. + + net/sf/jasperreports/components/sort/actions/SortCommand.html#PROPERTY_CREATE_SORT_FIELDS_FOR_GROUPS + false + Global | Dataset + 4.6.0 + + + + + + + +Property specifying whether the measured value should be rendered visible on a meter or thermometer chart's display zone. + + net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_DIAL_VALUE_DISPLAY_VISIBLE + false + Element + 3.5.0 + + + + + + + +Property containing the label text attached to the measured value in a meter or thermometer chart. + + net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_DIAL_LABEL + N/A + Element + 3.5.0 + + + + + + + +Flag property enabling the JFreeCharts engine to use integer tick units on a domain value axis. If set to true, it will take precedence over the +net.sf.jasperreports.chart.domain.axis.tick.interval and net.sf.jasperreports.chart.domain.axis.tick.count properties. + + net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_DOMAIN_AXIS_INTEGER_UNIT + N/A + Element + 4.6.0 + + + + + + + +Property specifying the number of ticks on a domain value axis. If it is not set, the JFreeCharts engine will use its own defaults to instantiate the axis. + + net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_DOMAIN_AXIS_TICK_COUNT + N/A + Element + 3.5.0 + + + + + + + +Property specifying the interval between 2 consecutive ticks on a domain value axis. If the net.sf.jasperreports.chart.domain.axis.tick.count property +is set, this interval will be neglected. +
    +If it is not set, the JFreeCharts engine will use its own defaults to instantiate the axis. +
    +By default it is not set. +
    + net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_DOMAIN_AXIS_TICK_INTERVAL + N/A + Element + 3.1.4 +
    + + + + + + +Flag property enabling the JFreeCharts engine to use integer tick units on a range value axis. If set to true, it will take precedence over the +net.sf.jasperreports.chart.range.axis.tick.interval and net.sf.jasperreports.chart.range.axis.tick.count properties. + + net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_RANGE_AXIS_INTEGER_UNIT + N/A + Element + 4.6.0 + + + + + + + +Property specifying the number of ticks on a range value axis. If it is not set, the JFreeCharts engine will use its own defaults to instantiate the axis. +
    +By default it is not set. +
    + net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_RANGE_AXIS_TICK_COUNT + N/A + Element + 3.5.0 +
    + + + + + + +Property specifying the interval between 2 consecutive ticks on a range value axis. If the net.sf.jasperreports.chart.range.axis.tick.count property +is set, this interval will be neglected. +
    +If it is not set, the JFreeCharts engine will use its own defaults to instantiate the axis. +
    +By default it is not set. +
    + net/sf/jasperreports/engine/fill/DefaultChartTheme.html#PROPERTY_RANGE_AXIS_TICK_INTERVAL + N/A + Element + 3.1.4 +
    + + + + + + +Properties used to indicate extensions registry factories. +
    +Such factories are used by the default components registry class to +instantiate sub extensions registries. Each such property contains the fixed property prefix net.sf.jasperreports.extension.registry.factory. and an arbitrary name suffix +which is used as registry ID when instantiating. The property should have as value the name of a + ExtensionsRegistryFactory implementation. +
    + net/sf/jasperreports/extensions/DefaultExtensionsRegistry.html#PROPERTY_REGISTRY_FACTORY_PREFIX + N/A + Global + 3.1.0 +
    + + + + + + +Property that can be used to provide a registry-specific property, by appending the registry ID and then a fixed property suffix to the fixed property prefix net.sf.jasperreports.extension.. +
    +For example: +
    +the net.sf.jasperreports.extension.chart.theme.spring.beans.resource contains the spring beans resource bundle location +for the spring-based extensions registry class with the "chart.theme" registry ID. +
    + net/sf/jasperreports/extensions/DefaultExtensionsRegistry.html#PROPERTY_REGISTRY_PREFIX + N/A + Global + 3.1.0 +
    + + + + + + +A property that provides the default ExtensionsRegistry +implementation class. +
    +This property is only read at initialization time, therefore changing +the property value at a later time will have no effect. +
    + net/sf/jasperreports/extensions/ExtensionsEnvironment.html#PROPERTY_EXTENSIONS_REGISTRY_CLASS + net.sf.jasperreports.extensions.DefaultExtensionsRegistry + Global + 3.1.0 + +
    + + + + + + +Property specifying the maximum in-memory buffer length that triggers the creation of a temporary file on disk to store further content sent to a +FileBufferedOutputStream instance. +
    +Note: While the Global level setting is available for all document exporters, the Report level setting is processed for the XLSX output +format only. To avoid memory leaks when exporting reports with a large number of sheets to XLSX format, just set this property to 0 at report level. +
    + net/sf/jasperreports/engine/util/FileBufferedOutputStream.html#PROPERTY_MEMORY_THRESHOLD + 262144 + Global | Report + 1.3.4 + +
    + + + + + + +Specifies the image resolution in dots-per-inch, for the images created by the engine when rasterizing SVGs or when clipping other renderers. + + net/sf/jasperreports/engine/JRRenderable.html#PROPERTY_IMAGE_DPI + 72 + Global + 4.1.1 + + + + + + + +The name of the system property that specifies the properties file name. +If the system property net.sf.jasperreports.properties has been set then the specified properties file is loaded. +Otherwise the jasperreports.properties file is loaded, if found in the classpath. + + net/sf/jasperreports/engine/DefaultJasperReportsContext.html#PROPERTIES_FILE + jasperreports.properties + System + 1.0.0 + + + + + + + +Property that specifies the JasperReports version associated with this report. Report elements/attributes newer than +this version will be skipped by the JRXML writers (see the JRXmlWriter class for example) +during the report template generation. If not set, the version is considered to be the currenly deployed version. + + net/sf/jasperreports/engine/xml/JRXmlBaseWriter.html#PROPERTY_REPORT_VERSION + N/A + Global | Report + 4.8.0 + + + + + + + +Maximum size (in pixels) of a buffered image that would be used by JRViewer to render a report page. +If rendering a report page would require an image larger than this threshold (i.e. image width x image height > maximum size), the report page will be rendered directly on the viewer component. +If this property is zero or negative, buffered images will never be used to render a report page. + + net/sf/jasperreports/view/JRViewer.html#VIEWER_RENDER_BUFFER_MAX_SIZE + 0 + Global + 1.2.8 + + + + + + + +A property that specifies the number of times the measurer should attempt +to measure a single text element before giving up. + + net/sf/jasperreports/engine/util/JdkGlyphFixTextMeasurer.html#PROPERTY_ATTEMPTS + 20 + Global + 3.0.0 + + + + + + + +A property that specifies the number of milliseconds to sleep between +measuring reattempts. +
    +The default value is 0, which means that the measurer will not pause +between reattempts (see DEFAULT_ATTEMPT_SLEEP). +
    + net/sf/jasperreports/engine/util/JdkGlyphFixTextMeasurer.html#PROPERTY_ATTEMPT_SLEEP + 0 + Global + 3.0.0 +
    + + + + + + +A property that specifies whether java.lang.NullPointer exceptions with empty stacktraces +should be caught. +
    +This is useful when running on a Sun server JVM (java -server), which might omit +exception stacktraces in some cases. +
    + net/sf/jasperreports/engine/util/JdkGlyphFixTextMeasurer.html#PROPERTY_CATCH_EMPTY_STACKTRACE + false + Global + 3.0.0 +
    + + + + + + +Property that forces the XML validation, when a document exported to XML format is loaded. + + net/sf/jasperreports/engine/xml/PrintSaxParserFactory.html#EXPORT_XML_VALIDATION + true + Global | Report + 1.0.0 + + + + + + + +Property that gives a parser factory class which should be used +for parsing XML exports. +
    +By default, this property is set to use PrintSaxParserFactory +as report parser factory. +
    + net/sf/jasperreports/engine/xml/JRSaxParserFactory.html#PROPERTY_PRINT_PARSER_FACTORY + net.sf.jasperreports.engine.xml.PrintSaxParserFactory + Global + 4.1.3 +
    + + + + + + +Property indicating the default PDF font, if not specified in the report template or at export time. + + net/sf/jasperreports/engine/JRFont.html#DEFAULT_PDF_FONT_NAME + Helvetica + Global + 1.3.0 + + + + + + + +Property indicating the default PDF encoding, if not specified in the report template or at export time. + + net/sf/jasperreports/engine/JRFont.html#DEFAULT_PDF_ENCODING + Cp1252 + Global + 1.3.0 + + + + + + + +Property indicating the default PDF font embedding behavior, if not specified in the report template or at export time. + + net/sf/jasperreports/engine/JRFont.html#DEFAULT_PDF_EMBEDDED + false + Global + 1.3.0 + + + + + + + +Properties with this syntax are used by the exporters to determine if a certain hyperlink should be activated or not. +These flags can be controlled at hyperlink declaration level by using the hyperlink parameter with the same name. The +available output formats for filling in the {format} placeholder are: html, pdf, rtf, xls, docx, pptx, odt. When the +format is set to 'xls', this property will be applied for XLS, XLSX and ODS exporters. + + N/A + N/A + Global | Report | Hyperlink + 5.0.4 + + + + + + + +Properties with this syntax are used by the exporters to create default exporter filter instances that filter +out content based on element key information. Possible values for the {format} token are +pdf, html, xls, xlsx, rtf, odt, ods, csv +and txt. The {suffix} token can be either the element's key value or an arbitrary string. The value of the property, if +defined, should be the element's key value. If the property has no value, its suffix will be assumed as a value. +
    +The following example shows how to specify element keys which are to be excluded +from specific export outputs: +

    + <jasperReport ...> +
    + <!-- exclude elements with keys Image1 and Text4 from HTML export --> +
    + <property name="net.sf.jasperreports.export.html.exclude.key.Image1"/> +
    + <property name="net.sf.jasperreports.export.html.exclude.key.Text4"/> +
    + <!-- exclude elements with keys Image5 from PDF export --> +
    + <property name="net.sf.jasperreports.export.pdf.exclude.key.the.image" value="Image5"/> +
    + ... +
    + </jasperReport>
    +
    + N/A + N/A + Global | Report + 3.0.1 +
    + + + + + + +Properties with this syntax are used by the exporters to create default exporter filter instances that filter +out content based on element origin information. Possible values for the {format} token are +pdf, html, xls, xlsx, rtf, odt, csv +and txt. The {suffix} token can be: band, group or +report. +
    +See this FAQ for more details about filtering out content while exporting. +
    + N/A + N/A + Global | Report + 2.0.3 +
    + + + + + + +Properties with this syntax are used by the exporters to create default exporter filter instances that filter +out content based on element origin information. Possible values for the {format} token are +pdf, html, xls, xlsx, rtf, odt, csv +and txt. The {suffix} token can be: band, group or +report. +
    +See this FAQ for more details about filtering out content while exporting. +
    + N/A + N/A + Global | Report + 2.0.3 +
    + + + + + + +A set of properties that are used to register filter factories. They all contain the fixed prefix net.sf.jasperreports.export.filter.factory. and a suffix indicating the considered filter element. +
    +For example: net.sf.jasperreports.export.filter.factory.origin indicates an element origin filter factory. +
    + net/sf/jasperreports/engine/export/DefaultExporterFilterFactory.html#PROPERTY_EXPORTER_FILTER_FACTORY_PREFIX + N/A + Global | Report + 3.0.1 +
    + + + + + + +A property that gives the generic default filter factory class name. + net/sf/jasperreports/engine/JRAbstractExporter.html#PROPERTY_DEFAULT_FILTER_FACTORY + net.sf.jasperreports.engine.export.DefaultExporterFilterFactory + Global | Report + 3.0.1 + + + + + + + +Property that gives the default filter factory for a specific exporter. +Contains the property prefix net.sf.jasperreports.export. concatenated with an arbitrary name indicating the exporter type and +the property suffix default.filter.factory. +
    +For instance, the default filter factory for XLS exporters is + net.sf.jasperreports.export.xls.default.filter.factory. +If this property is not defined for a specific exporter, the generic + exporter factory given by PROPERTY_DEFAULT_FILTER_FACTORY is used. +
    + net/sf/jasperreports/engine/JRAbstractExporter.html#PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY + PROPERTY_DEFAULT_FILTER_FACTORY 's default value. + Global + 3.0.1 +
    + + + + + + +Property whose value is used as as default for the getEncoding() export output setting. +Stores the character encoding for exported reports. + + net/sf/jasperreports/export/WriterExporterOutput.html#PROPERTY_CHARACTER_ENCODING + UTF-8 + Global | Report + 2.0.1 + + + + + + + +Property specifying the name of the CSV exported column the element belongs to. +It must be one of the column names in the net.sf.jasperreports.export.csv.column.names.{suffix}, if provided. + + net/sf/jasperreports/engine/export/JRCsvMetadataExporter.html#PROPERTY_COLUMN_NAME + N/A + Element + 4.0.0 + + + + + + + +Properties having this prefix contain comma-separated names of the columns that will be exported to CSV. +
    +Column names in this property are used as default list for the +getColumnNames() +CSV metadata export output setting. +

    +Note: For accurate results it's recommended that column names in the list to follow the same order as the original columns. +
    + net/sf/jasperreports/export/CsvMetadataReportConfiguration.html#PROPERTY_COLUMN_NAMES_PREFIX + N/A + Report + 4.0.0 +
    + + + + + + +Property that specifies a custom value to be associated with the column specified by the +PROPERTY_COLUMN_NAME. +
    +The property itself defaults to the text value of the report element this property is assigned to. +
    + net/sf/jasperreports/engine/export/JRCsvMetadataExporter.html#PROPERTY_DATA + N/A + Element + 4.0.0 +
    + + + + + + +Property that contains the character or sequence of characters used to delimit two fields on the same record. Its value is used as default for the +getFieldDelimiter() CSV export configuration setting. + + net/sf/jasperreports/export/CsvExporterConfiguration.html#PROPERTY_FIELD_DELIMITER + , + Global | Report + 2.0.1 + + + + + + + +Property containing the character to enclose a field value on a record. +
    +If a sequence of characters is set for this property, only the leading one will be taken into account. White spaces are not considered. +
    +Its value is used as default for the +getFieldEnclosure() CSV export configuration setting. +
    +This property set in the JRXML report does not support expressions, so we have to ensure that +character values representing XML entity references are XML-escaped, accordingly. +For instance, use &quot; instead of ", &apos; instead of ', etc. +
    + net/sf/jasperreports/export/CsvExporterConfiguration.html#PROPERTY_FIELD_ENCLOSURE + " + Global | Report + 6.2.1 +
    + + + + + + +Property that enforces all exported field values to be enclosed within a pair of enclosure characters (usually a pair of quotes:""). +Its value is used as default for the +getForceFieldEnclosure() CSV export configuration flag. + + net/sf/jasperreports/export/CsvExporterConfiguration.html#PROPERTY_FORCE_FIELD_ENCLOSURE + false + Global | Report + 6.2.1 + + + + + + + +Property that contains the character or sequence of characters used to delimit two records. +
    +Its value is used as default for the +getRecordDelimiter() CSV export configuration setting. +
    + net/sf/jasperreports/export/CsvExporterConfiguration.html#PROPERTY_RECORD_DELIMITER + \n + Global | Report + 2.0.1 +
    + + + + + + +Property that specifies whether the value associated with PROPERTY_COLUMN_NAME +should be repeated or not when it is missing. + + net/sf/jasperreports/engine/export/JRCsvMetadataExporter.html#PROPERTY_REPEAT_VALUE + false + Element + 4.0.0 + + + + + + + +Property that specifies whether a BOM character should be put at the beginning of the output. +
    +Its value is used as default for the +isWriteBOM() CSV export configuration setting. +
    + net/sf/jasperreports/export/CsvExporterConfiguration.html#PROPERTY_WRITE_BOM + false + Global | Report + 6.1.0 +
    + + + + + + +Property that specifies whether the export header (the column names) should be written or not. +
    +Its value is used as default for the +isWriteHeader() CSV metadata export configuration setting. +
    + net/sf/jasperreports/export/CsvMetadataReportConfiguration.html#PROPERTY_WRITE_HEADER + false + Global | Report + 4.0.0 +
    + + + + + + +Flag property that controls the use of an AWT rendering fix which causes the printer job size to be reduced when the exporter draws onto a printer graphic context. +
    +Its value is used as default for the +isMinimizePrinterJobSize() Graphics2D export configuration setting. +
    + net/sf/jasperreports/export/Graphics2DReportConfiguration.html#MINIMIZE_PRINTER_JOB_SIZE + true + Global | Report + 1.2.8 +
    + + + + + + +This flag property specifies whether page margins should be ignored when the report is exported using a grid-based exporter. +
    +Its value is used as default for the Excel +and HTML isIgnorePageMargins() export +configuration setting. +
    +If the property is true, any page in the document will be exported without taking into account its margins. +
    + net/sf/jasperreports/export/ReportExportConfiguration.html#PROPERTY_IGNORE_PAGE_MARGINS + false + Global | Report + 2.0.5 +
    + + + + + + +This property specifies whether JRPrintFrame frames are to be exported as nested tables. +
    +Its value is used as default for the +isFramesAsNestedTables() DOCX export configuration setting. +
    +If set to false, the frame content will be integrated into the master/page table. +
    + net/sf/jasperreports/export/DocxReportConfiguration.html#PROPERTY_FRAMES_AS_NESTED_TABLES + true + Global | Report | Element + 3.5.3 +
    + + + + + + +This property indicates whether table rows can grow if more text is added into cells. +
    +Its value is used as default for the +isFlexibleRowHeight() DOCX export configuration setting. +
    +If set to false, the table rows do not increase in height automatically and the user has to enlarge them manually. +
    + net/sf/jasperreports/export/DocxExporterConfiguration.html#PROPERTY_FLEXIBLE_ROW_HEIGHT + false + Global | Report + 3.6.1 +
    + + + + + + +This property is used to mark text elements as being hidden either for printing or on-screen display. + + net/sf/jasperreports/engine/export/ooxml/JRDocxExporter.html#PROPERTY_HIDDEN_TEXT + false + Element + 3.7.6 + + + + + + + +Property that contains the application information to use for the generated DOCX metadata. +
    +Its value is used as default for the +getMetadataApplication() DOCX export configuration setting. +
    + net/sf/jasperreports/export/DocxExporterConfiguration.html#PROPERTY_METADATA_APPLICATION + N/A + Global | Report + 6.3.1 +
    + + + + + + +Property that contains the author information to use for the generated DOCX metadata. +
    +Its value is used as default for the +getMetadataAutor() DOCX export configuration setting. +
    + net/sf/jasperreports/export/DocxExporterConfiguration.html#PROPERTY_METADATA_AUTHOR + N/A + Global | Report + 6.3.1 +
    + + + + + + +Property that contains the keywords to use for the generated DOCX metadata. +
    +Its value is used as default for the +getMetadataKeywords() DOCX export configuration setting. +
    + net/sf/jasperreports/export/DocxExporterConfiguration.html#PROPERTY_METADATA_KEYWORDS + N/A + Global | Report + 6.3.1 +
    + + + + + + +Property that contains the subject information to use for the generated DOCX metadata. +
    +Its value is used as default for the +getMetadataSubject() DOCX export configuration setting. +
    + net/sf/jasperreports/export/DocxExporterConfiguration.html#PROPERTY_METADATA_SUBJECT + N/A + Global | Report + 6.3.1 +
    + + + + + + +Property that contains the title information to use for the generated DOCX metadata. +
    +Its value is used as default for the +getMetadataTitle() DOCX export configuration setting. +
    + net/sf/jasperreports/export/DocxExporterConfiguration.html#PROPERTY_METADATA_TITLE + N/A + Global | Report + 6.3.1 +
    + + + + + + +This property specifies whether the newline element present in a justified paragraph introduces a new justified paragraph. +If set to true, the text line before the new paragraph will lose the justified alignment. +
    +It serves as default value for the +isNewLineAsParagraph() DOCX export configuration setting. +The property itself defaults to false (for backward compatibility reasons). +
    + net/sf/jasperreports/export/DocxReportConfiguration.html#PROPERTY_NEW_LINE_AS_PARAGRAPH + false + Global | Report | Element + 6.1.1 +
    + + + + + + +Property that determines the value of the allowScriptAccess parameter for Flash elements. + + net/sf/jasperreports/engine/export/FlashPrintElement.html#PROPERTY_ALLOW_SCRIPT_ACCESS + sameDomain + Global | Report | Element + 4.1.3 + + + + + + + +Configuration property that determines the exporter to produce accessible HTML. +
    +Its value is used as default for the +isAccessibleHtml() HTML export configuration setting. +
    + net/sf/jasperreports/export/HtmlReportConfiguration.html#PROPERTY_ACCESSIBLE + false + Global | Report + 3.7.5 +
    + + + + + + +This property specifies whether JRPrintFrame frames are to be exported as nested HTML tables. +
    +Its value is used as default for the +isFramesAsNestedTables() HTML export configuration setting. +
    +If set to false, the frame content will be integrated into the master/page HTML table. +
    + net/sf/jasperreports/engine/export/JRHtmlReportConfiguration.html#PROPERTY_FRAMES_AS_NESTED_TABLES + true + Global | Report | Element + 2.0.1 +
    + + + + + + +Configuration property that provides the HTML code that will be inserted between pages of the generated report. +
    +Its value is used as default for the +getBetweenPagesHtml() HTML export configuration setting. +
    + net/sf/jasperreports/export/HtmlExporterConfiguration.html#PROPERTY_BETWEEN_PAGES_HTML + N/A + Global | Report + 5.5.2 +
    + + + + + + +Configuration property that provides the value for the border-collapse CSS property to be applied +to the table generated for the report. Possible values are: +
      +
    • separate
    • +
    • collapse (default)
    • +
    • initial
    • +
    • inherit
    • +
    +Its value is used as default for the +getBorderCollapse() HTML export configuration setting. +
    + net/sf/jasperreports/export/HtmlReportConfiguration.html#PROPERTY_BORDER_COLLAPSE + collapse + Global | Report + 5.0.4 +
    + + + + + + +Configuration property that provides the HTML code that will be inserted before the generated report content. +
    +Its value is used as default for the +getHtmlHeader() HTML export configuration setting. +
    + net/sf/jasperreports/export/HtmlExporterConfiguration.html#PROPERTY_HTML_HEADER + N/A + Global | Report + 5.5.2 +
    + + + + + + +Configuration property that provides the HTML code that will be inserted after the generated report content. +
    +Its value is used as default for the +getHtmlFooter() HTML export configuration setting. +
    + net/sf/jasperreports/export/HtmlExporterConfiguration.html#PROPERTY_HTML_FOOTER + N/A + Global | Report + 5.5.2 +
    + + + + + + +Property used to specify the value of the CSS class attribute of elements when exported to HTML and XHTML formats. The value of this property +will be used as the value for the class attribute of the <td> tag for the element when exported to HTML and/or +the class attribute of the <span> or <div> tag for the element, when exported to XHTML/CSS. + + net/sf/jasperreports/engine/export/HtmlExporter.html#PROPERTY_HTML_CLASS + N/A + Element + 4.0.1 + + + + + + + +This property specifies whether the SVG graphics should be rasterized as images. +The property provides a default value for the isConvertSvgToImage() export setting. + + net/sf/jasperreports/export/HtmlReportConfiguration.html#PROPERTY_CONVERT_SVG_TO_IMAGE + false + Global | Report | Element + 6.3.0 + + + + + + + +This property specifies whether the image should be Base64 encoded and embedded into the src attribute of the image tag, and not referenced as separate resource. +The property provides a default value for the isEmbedImage() export setting. + + net/sf/jasperreports/export/HtmlReportConfiguration.html#PROPERTY_EMBED_IMAGE + false + Global | Report | Element + 6.2.1 + + + + + + + +This property specifies whether the HTML embedded SVG should have the font family names replaced with the web fonts coming from font extensions, similar to what we do for text elements. + + net/sf/jasperreports/export/HtmlReportConfiguration.html#PROPERTY_EMBEDDED_SVG_USE_FONTS + false + Global | Report | Element + 6.2.2 + + + + + + + +Property used to specify the value of the ID attribute of elements when exported to HTML and XHTML formats. The value of this property will be used +as the value for the id attribute of the <td> tag for the element when exported to HTML and/or the id attribute of +the <span> or <div> tag for the element, when exported to XHTML/CSS. + + net/sf/jasperreports/engine/export/HtmlExporter.html#PROPERTY_HTML_ID + N/A + Element + 3.7.0 + + + + + + + +Flag property that specifies whether the blank lines that sometimes appear between rows as spacers should be removed. +
    +Its value is used as default for the +isRemoveEmptySpaceBetweenRows() HTML export configuration setting. +
    + net/sf/jasperreports/export/HtmlReportConfiguration.html#PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_ROWS + false + Global | Report + 2.0.1 +
    + + + + + + +Property that specifies the unit to use when measuring lengths or font size. This can be one of the supported size units from the CSS +specifications like "px" for pixels or "pt" for points. The default value is "px", meaning that lengths and font sizes are specified in pixels. +
    +Its value is used as default for the +getSizeUnit() HTML export configuration setting. +
    + net/sf/jasperreports/export/HtmlReportConfiguration.html#PROPERTY_SIZE_UNIT + px + Global | Report + 2.0.1 +
    + + + + + + +Property that specifies whether the export engine should use small transparent spacer images for aligning content. + + net/sf/jasperreports/engine/export/JRHtmlExporterConfiguration.html#PROPERTY_USING_IMAGES_TO_ALIGN + true + Global | Report + 2.0.1 + + + + + + + +Property that indicates whether the report background should be turned to white. If not set, the default background will appear, depending on the selected CSS styles. +
    +Its value is used as default for the +isWhitePageBackground() HTML export configuration setting. +
    + net/sf/jasperreports/export/HtmlReportConfiguration.html#PROPERTY_WHITE_PAGE_BACKGROUND + true + Global | Report + 2.0.1 +
    + + + + + + +Property that specifies whether the export engine should force text wrapping by breaking words (CSS word-wrap: break-word). +
    +Its value is used as default for the +isWrapBreakWord() HTML export configuration setting. +
    +Note that this CSS property is not currently supported by all browsers. An alternative approach for forcing word breaks in HTML is to save the +line breaks at fill time via the net.sf.jasperreports.text.save.line.breaks property. +
    + net/sf/jasperreports/export/HtmlReportConfiguration.html#PROPERTY_WRAP_BREAK_WORD + false + Global | Report + 2.0.1 +
    + + + + + + +This element-level property is considered by the JsonMetadataExporter +and provides the exported value of a given type for that element. This value will be exported within the JSON tree following the path specified +by the property suffix. Possible values for the value type are: +
      +
    • string
    • +
    • number
    • +
    • date
    • +
    • boolean
    • +
    +
    +When working with this property, numbers have to be written with no thousand separators and using a period as decimal. For instance, 1,000,000 should be written as +"1000000" and 2,000.45 should be written as "2000.45". Dates must be written according to ISO 8601 standard: "yyyy-MM-dd'T'HH:mm:ss". +
    + net/sf/jasperreports/engine/export/JsonMetadataExporter.html#JSON_EXPORTER_STRING_PROPERTIES_PREFIX + N/A + Element + 6.1.0 +
    + + + + + + +This element-level property is considered by the JsonMetadataExporter +and provides the exported value for that element. By default is considered the value of the report element itself. +
    +When working with this property, numbers have to be written with no thousand separators and using a period as decimal. For instance, 1,000,000 should be written as +"1000000" and 2,000.45 should be written as "2000.45". Dates must be written according to ISO 8601 standard: "yyyy-MM-dd'T'HH:mm:ss". +
    + net/sf/jasperreports/engine/export/JsonMetadataExporter.html#JSON_EXPORTER_DATA_PROPERTY + N/A + Element + 6.0.0 +
    + + + + + + +This report-level flag is considered by the JsonMetadataExporter +and specifies if the member property names should be enclosed with quotes or no. + + net/sf/jasperreports/export/JsonMetadataReportConfiguration.html#JSON_EXPORTER_ESCAPE_MEMBERS + true + Report + 6.0.0 + + + + + + + +This element-level property is used by the JsonMetadataExporter +and specifies a given path within the JSON tree, where the current element will be exported. If the +net.sf.jasperreports.export.json.schema property is not +present in the report, this property can be used to determine a rule in the JSON schema as well. + + net/sf/jasperreports/engine/export/JsonMetadataExporter.html#JSON_EXPORTER_PATH_PROPERTY + N/A + Element + 6.0.0 + + + + + + + +This element-level flag is considered by the JsonMetadataExporter +and specifies whether the value associated to that JSON path should be repeated or not when it is missing. Usually this property +works in conjunction with one of the net.sf.jasperreports.export.json.{type}.{path} +properties. + + net/sf/jasperreports/engine/export/JsonMetadataExporter.html#JSON_EXPORTER_REPEAT_PROPERTIES_PREFIX + false + Element + 6.1.0 + + + + + + + +This element-level flag is considered by the JsonMetadataExporter +and specifies whether the value associated to the JSON path specified by net.sf.jasperreports.export.json.path property +should be repeated or not when it is missing. + + net/sf/jasperreports/engine/export/JsonMetadataExporter.html#JSON_EXPORTER_REPEAT_VALUE_PROPERTY + false + Element + 6.0.0 + + + + + + + +This report-level property is considered by the JsonMetadataExporter +and specifies the path to a JSON schema file that will be used to generate the JSON structure at export time. Nodes in a given schema should provide: +
      +
    • the _type property (mandatory), which can be an object or an array.
    • +
    • the _children property (mandatory for array-type nodes), which defines the type of the objects in the array.
    • +
    • other properties that describe the object.
    • +
    +
    + net/sf/jasperreports/export/JsonMetadataReportConfiguration.html#JSON_EXPORTER_JSON_SCHEMA + N/A + Report + 6.0.0 +
    + + + + + + +Boolean property enabling the JExcelApiExporter to use temporary files when creating large documents. + + net/sf/jasperreports/export/JxlExporterConfiguration.html#PROPERTY_USE_TEMP_FILE + false + Global | Report + 3.7.5 + + + + + + + +Boolean property specifying whether the cell format pattern is user-defined. +When set to true, the exporter will assume that the specified pattern is well defined. +If the pattern is invalid, it won't be taken into account by the Excel file viewer. + + net/sf/jasperreports/export/JxlReportConfiguration.html#PROPERTY_COMPLEX_FORMAT + false + Global | Report | Element + 3.7.6 + + + + + + + +This property indicates whether table rows in ODS documents can grow if more text is added into cells. +
    +Its value is used as default for the +isFlexibleRowHeight() ODS export configuration setting. +
    +If set to false, the rows in the ODS document do not increase in height automatically and the user has to enlarge them manually. Otherwise, +the table rows will adjust their height automatically in order to fit their content in. +
    + net/sf/jasperreports/export/OdsReportConfiguration.html#PROPERTY_ODS_FLEXIBLE_ROW_HEIGHT + false + Global | Report + 5.0.4 +
    + + + + + + +This property table rows in ODT documents can grow if more text is added into cells. +
    +Its value is used as default for the +isFlexibleRowHeight() ODT export configuration setting. +
    +If set to false, the table rows in the ODT document do not increase in height automatically and the user has to enlarge them manually. +Otherwise, the table rows will adjust their height automatically in order to fit their content in. +
    + net/sf/jasperreports/export/OdtReportConfiguration.html#PROPERTY_ODT_FLEXIBLE_ROW_HEIGHT + false + Global | Report + 5.0.4 +
    + + + + + + +Property that establishes the priority of export parameters against report hints. +
    +Its value is used as default for the +isOverrideHints() export configuration setting. +
    +If the property is true, export parameters override report hints; this is the default behavior. +
    + net/sf/jasperreports/engine/JRExporterParameter.html#PROPERTY_EXPORT_PARAMETERS_OVERRIDE_REPORT_HINTS + true + Global +
    + + + + + + +Property that specifies whether the encryption key is 128 bits. +
    +Its value is used as default for the +is128BitKey() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_128_BIT_KEY + false + Global | Report + 2.0.1 +
    + + + + + + +Property that specifies whether the PDF document should be compressed. +
    +Its value is used as default for the +isCompressed() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_COMPRESSED + false + Global | Report + 2.0.1 +
    + + + + + + +Property that specifies whether the PDF document should contain an outline section. +
    +Its value is used as default for the +isCreatingBatchModeBookmarks() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_CREATE_BATCH_MODE_BOOKMARKS + false + Global | Report + 2.0.1 +
    + + + + + + +Property that specifies whether the final PDF document should be encrypted. +
    +Its value is used as default for the +isEncrypted() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_ENCRYPTED + false + Global | Report + 2.0.1 +
    + + + + + + +Prefix of properties that specify font files for the PDF exporter. + + net/sf/jasperreports/engine/export/JRPdfExporter.html#PDF_FONT_FILES_PREFIX + N/A + Global + 1.0.0 + + + + + + + + +Prefix of properties that specify font directories for the PDF exporter. + + net/sf/jasperreports/engine/export/JRPdfExporter.html#PDF_FONT_DIRS_PREFIX + N/A + Global + 1.0.0 + + + + + + + + +Property that specifies whether the PDF exporter should use a SplitCharacter +implementation to ensure that PDF text wrap behavior is the same as in AWT. +
    +Its value is used as default for the +isForceLineBreakPolicy() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfReportConfiguration.html#PROPERTY_FORCE_LINEBREAK_POLICY + false + Global | Report + 2.0.1 + +
    + + + + + + +Property that specifies whether the rendering of SVG images using shapes on the PDF Graphics2D context should be forced. +
    +Its value is used as default for the +isForceSvgShapes() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfReportConfiguration.html#PROPERTY_FORCE_SVG_SHAPES + true + Global | Report + 2.0.1 +
    + + + + + + +Property that contains the user defined JavaScript piece of code to be inserted into the generated PDF document. +
    +Its value is used as default for the +getPdfJavaScript() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_PDF_JAVASCRIPT + N/A + Global | Report + 2.0.1 +
    + + + + + + +Property that contains the author information to use for the generated PDF metadata. +
    +Its value is used as default for the +getMetadataAutor() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_METADATA_AUTHOR + N/A + Global | Report + 5.5.2 +
    + + + + + + +Property that contains the creator information to use for the generated PDF metadata. +
    +Its value is used as default for the +getMetadataCreator() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_METADATA_CREATOR + N/A + Global | Report + 5.5.2 +
    + + + + + + +Property that contains the keywords to use for the generated PDF metadata. +
    +Its value is used as default for the +getMetadataKeywords() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_METADATA_KEYWORDS + N/A + Global | Report + 5.5.2 +
    + + + + + + +Property that contains the subject information to use for the generated PDF metadata. +
    +Its value is used as default for the +getMetadataSubject() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_METADATA_SUBJECT + N/A + Global | Report + 5.5.2 +
    + + + + + + +Property that contains the title information to use for the generated PDF metadata. +
    +Its value is used as default for the +getMetadataTitle() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_METADATA_TITLE + N/A + Global | Report + 5.5.2 +
    + + + + + + +Property that specifies whether the document title should be displayed in the title bar instead of the file name. Should be set to true for accessible documents that provide a document title. +
    +Its value is used as default for the +isDisplayMetadataTitle() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_DISPLAY_METADATA_TITLE + false + Global | Report + 6.0.0 +
    + + + + + + +Property that contains the password belonging to the owner of the document, if it is encrypted. If the owner password is not specified, but the PDF is +encrypted, then the password will be a random string. +
    +Its value is used as default for the +getOwnerPassword() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_OWNER_PASSWORD + N/A + Global | Report + 2.0.1 +
    + + + + + + +Property that contains the allowed user permissions of the PDF document, if it is encrypted. Allowed values are one or many the permission names enumerated in +PdfPermissionsEnum class, separated by a pipe (|) sign: +
      +
    • ALL - all user permissions are allowed
    • +
    • ASSEMBLY - assembly permission allowed
    • +
    • COPY - copy permission allowed
    • +
    • DEGRADED_PRINTING - degraded printing permission allowed
    • +
    • FILL_IN - fill in forms permission allowed
    • +
    • MODIFY_ANNOTATIONS - modify annotation permission allowed
    • +
    • MODIFY_CONTENTS - modify contents permission allowed
    • +
    • PRINTING - print permission allowed
    • +
    • SCREENREADERS - screen readers permission allowed
    • +
    +
    +Its value is used as default for the +getAllowedPermissions() PDF export configuration setting. +By default no user permissions are allowed at all. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_PERMISSIONS_ALLOWED + N/A + Global | Report + 5.6.0 +
    + + + + + + +Property that contains the denied user permissions of the PDF document, if it is encrypted. This property works in conjunction with +the net.sf.jasperreports.export.pdf.permissions.allowed. If present, denied permissions +will be excluded from the allowed values. This property may contain one or many permission names enumerated in +PdfPermissionsEnum class, separated by a pipe (|) sign: +
      +
    • ALL - all user permissions are denied
    • +
    • ASSEMBLY - assembly permission denied
    • +
    • COPY - copy permission denied
    • +
    • DEGRADED_PRINTING - degraded printing permission denied
    • +
    • FILL_IN - fill in forms permission denied
    • +
    • MODIFY_ANNOTATIONS - modify annotation permission denied
    • +
    • MODIFY_CONTENTS - modify contents permission denied
    • +
    • PRINTING - print permission denied
    • +
    • SCREENREADERS - screen readers permission denied
    • +
    +
    +Its value is used as default for the +getDeniedPermissions() PDF export configuration setting. +By default there are no user permissions allowed for the document. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_PERMISSIONS_DENIED + N/A + Global | Report + 5.6.0 +
    + + + + + + +Property that specifies the print scaling preference in the PDF print dialog. +
    +Its value is used as default for the +getPrintScaling() PDF export configuration setting. +
    +Possible values are default and none. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_PRINT_SCALING + default + Global | Report + 3.6.1 +
    + + + + + + +Property that contains the user password needed to open the document, if it is encrypted. +
    +Its value is used as default for the +getUserPassword() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_USER_PASSWORD + N/A + Global | Report + 2.0.1 +
    + + + + + + +Property that contains a Character instance representing the version of the generated PDF. +
    +Its value is used as default for the +getPdfVersion() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_PDF_VERSION + N/A + Global | Report + 2.0.1 +
    + + + + + + +Property whose value is used as default for the getPdfaConformance() +export configuration setting. It specifies the conformance level of the PDF/A document. Possible values are: pdfa1a, pdfa1b and none. +
    +By default, this property is set to none. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_PDFA_CONFORMANCE + none + Global | Report + 3.1.2 +
    + + + + + + +Property whose value is used as default for the getIccProfilePath() +export configuration setting. It specifies the path to the ICC profile file for the PDF/A compliant documents. + + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_PDFA_ICC_PROFILE_PATH + N/A + Global | Report + 3.1.2 + + + + + + + +Property that specifies whether the exporter should put structure tags in the generated PDF. +
    +Its value is used as default for the +isTagged() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_TAGGED + false + Global | Report + 3.1.2 +
    + + + + + + +Property that specifies the language that the exporter should put in the language tag of the generated PDF. +
    +Its value is used as default for the +getTagLanguage() PDF export configuration setting. +
    + net/sf/jasperreports/export/PdfExporterConfiguration.html#PROPERTY_TAG_LANGUAGE + N/A + Global | Report + 3.1.2 +
    + + + + + + +Property that contains the application information to use for the generated PPTX metadata. +
    +Its value is used as default for the +getMetadataApplication() PPTX export configuration setting. +
    + net/sf/jasperreports/export/PptxExporterConfiguration.html#PROPERTY_METADATA_APPLICATION + N/A + Global | Report + 6.3.1 +
    + + + + + + +Property that contains the author information to use for the generated PPTX metadata. +
    +Its value is used as default for the +getMetadataAutor() PPTX export configuration setting. +
    + net/sf/jasperreports/export/PptxExporterConfiguration.html#PROPERTY_METADATA_AUTHOR + N/A + Global | Report + 6.3.1 +
    + + + + + + +Property that contains the keywords to use for the generated PPTX metadata. +
    +Its value is used as default for the +getMetadataKeywords() PPTX export configuration setting. +
    + net/sf/jasperreports/export/PptxExporterConfiguration.html#PROPERTY_METADATA_KEYWORDS + N/A + Global | Report + 6.3.1 +
    + + + + + + +Property that contains the subject information to use for the generated PPTX metadata. +
    +Its value is used as default for the +getMetadataSubject() PPTX export configuration setting. +
    + net/sf/jasperreports/export/PptxExporterConfiguration.html#PROPERTY_METADATA_SUBJECT + N/A + Global | Report + 6.3.1 +
    + + + + + + +Property that contains the title information to use for the generated PPTX metadata. +
    +Its value is used as default for the +getMetadataTitle() PPTX export configuration setting. +
    + net/sf/jasperreports/export/PptxExporterConfiguration.html#PROPERTY_METADATA_TITLE + N/A + Global | Report + 6.3.1 +
    + + + + + + +Property whose floating point value is representing the pixel/character horizontal ratio. +
    +Its value is used as default for the +getCharWidth() Text export configuration setting. +
    + net/sf/jasperreports/export/TextReportConfiguration.html#PROPERTY_CHARACTER_WIDTH + N/A + Global | Report + 3.6.1 +
    + + + + + + +Property whose value represents text that will be inserted between pages of the generated report. +
    +Its value is used as default for the +getPageSeparator() Text export configuration setting. +
    + net/sf/jasperreports/export/TextExporterConfiguration.html#PROPERTY_PAGE_SEPARATOR + N/A + Global | Report + 5.5.2 +
    + + + + + + +Property whose floating point value is representing the pixel/character vertical ratio. +
    +Its value is used as default for the +getCharHeight() Text export configuration setting. +
    + net/sf/jasperreports/export/TextReportConfiguration.html#PROPERTY_CHARACTER_HEIGHT + N/A + Global | Report + 3.6.1 +
    + + + + + + +Property whose integer value is representing the page width in characters. +
    +Its value is used as default for the +getPageWidthInChars() Text export configuration setting. +
    + net/sf/jasperreports/export/TextReportConfiguration.html#PROPERTY_PAGE_WIDTH + N/A + Global | Report + 3.6.1 +
    + + + + + + +Property whose value represents the separator between two lines of text in the exported report. +
    +Its value is used as default for the +getLineSeparator() Text export configuration setting. +
    + net/sf/jasperreports/export/TextExporterConfiguration.html#PROPERTY_LINE_SEPARATOR + N/A + Global | Report + 5.5.2 +
    + + + + + + +Property whose integer value representing the page height in characters. +
    +Its value is used as default for the +getPageHeightInChars() Text export configuration setting. +
    + net/sf/jasperreports/export/TextReportConfiguration.html#PROPERTY_PAGE_HEIGHT + N/A + Global | Report + 3.6.1 +
    + + + + + + +Property that specifies whether the text lines in the document should be trimmed to the right. +
    +Its value is used as default for the +isTrimLineRight() export configuration setting. +
    + net/sf/jasperreports/export/TextExporterConfiguration.html#PROPERTY_TRIM_LINE_RIGHT + false + Global | Report + 6.0.0 +
    + + + + + + +This element-level property is used to indicate the boundaries of the autofilter data range in the current sheet. +Allowed values are: +
      +
    • Start - The current cell will be marked as autofilter heading cell, and column data below/to the right of +this cell can be considered as part of the autofilter data range. The starting point of the autofilter data range will be +the next cell below the current cell (ie if the current cell reference is B4, the autofilter range will start with the "B5" +cell reference: "B5:M20"). +
      +If multiple autofilter Start values are found in the same sheet, only the last one will be considered. If the +Start value is present but no End value is found in the sheet, then only the current column will +be considered for the data range. +
      +If the autofilter Start value is set on the same row as the autofilter End value, the data range +will include all data below this heading row, placed between the start column and the end column.
    • +
    • End - The current cell will be marked as autofilter ending cell, and column data in this cell and +above/to the left can be considered as part of the autofilter data range. The ending cell in the data range is the +current cell reference (ie if the current cell reference is M20, the autofilter range will end in "M20": "B5:M20"). +The heading cell for the current column will be placed in the same column on the row containing the autofilter Start value. +
      +Caution: If no autofilter Start value is found in the sheet, the autofilter End value will be considered +as Start value instead. +
      +If multiple autofilter End values are found in the same sheet, only the last one will be considered. +
      +If the autofilter Start value is set on the same row as the autofilter End value, the data range +will include all data below this heading row, placed between the start column and the end column.
    • +
    +
    + net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_AUTO_FILTER + N/A + Element + 4.1.3 +
    + + + + + + +Flag property that indicates whether Excel should autofit the current column width. +
    +Allowed values are: +
      +
    • true
    • +
    • false
    • +
    +
    + net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_AUTO_FIT_COLUMN + false + Element + 4.5.1 +
    + + + + + + +Flag property that provides a default value for the isAutoFitPageHeight() export setting. +If set to true, the exporter will automatically fit the print height of a sheet to the number of JasperPrint pages exported in that sheet +
    +Allowed values are: +
      +
    • true
    • +
    • false
    • +
    +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_AUTO_FIT_PAGE_HEIGHT + false + Global | Report + 6.0.2 +
    + + + + + + +Flag property that indicates whether Excel should autofit the current row height. +
    +Allowed values are: +
      +
    • true
    • +
    • false
    • +
    +
    + net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_AUTO_FIT_ROW + false + Element + 4.5.1 +
    + + + + + + +Property that specifies whether row spans should be collapsed and merging cells across rows should be inhibited. +
    +Its value is used as default for the +isCollapseRowSpan() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_COLLAPSE_ROW_SPAN + false + Global | Report + 2.0.1 +
    + + + + + + +Represents the name for the column that should appear in the metadata-based Excel export. It must be one of the column names stored in +net.sf.jasperreports.export.xls.column.names.{suffix}, if provided. + + net/sf/jasperreports/engine/export/JRXlsAbstractMetadataExporter.html#PROPERTY_COLUMN_NAME + N/A + Element + 4.0.2 + + + + + + + +Properties having this prefix contain comma-separated column names used in the metadata-based Excel export. +
    +Column names in these properties are used as default list of values for the +getColumnNames() Excel metadata export configuration setting. +
    +The order of the columns is important and for accurate results they should be in the same order as the original columns. +
    + net/sf/jasperreports/export/XlsMetadataReportConfiguration.html#PROPERTY_COLUMN_NAMES_PREFIX + N/A + Report + 4.0.2 +
    + + + + + + +Element-level property used to adjust the column width to values suitable for Excel output, taking into account +that column widths are measured in Excel in Normal style default character width units. The pixel-to-character width +translation depends on the default normal style character width, so it cannot be always accurately fitted. In this case, +one can adjust the current column width by setting this property with an integer value measured in pixels. The JR engine +will perform the pixel-to-character width mapping using this value instead of the element's width attribute. +
    +If defined, this property will override the PROPERTY_COLUMN_WIDTH_RATIO +value for the current column +
    + net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_COLUMN_WIDTH + N/A + Element + 4.1.3 +
    + + + + + + +Property used to adjust all column widths in a document or sheet with the same width ratio, in order to get column width +values suitable for Excel output. Usually column widths are measured by Excel in Normal style default character width +units, while the JR engine uses pixels as default size units. When exporting the report to the Excel output format, the +pixel-to-character width translation depends on the normal style default character width provided by the Excel instance, +so it cannot be always accurately fitted. In this case, one can alter the generated column widths by setting this property +with a float value representing the adjustment ratio. The property can be set: +
      +
    • globally - then all the columns in all documents exported to the Excel output format will be adjusted with the same width ratio
    • +
    • at report level - then all the columns in the document will be adjusted with the same width ratio
    • +
    • at element level - then all the columns in the current sheet will be adjusted with the same width ratio
    • +
    +Global settings are overriden by report level settings and report level settings are overriden by element level settings. If +present, a PROPERTY_COLUMN_WIDTH property will override the +PROPERTY_COLUMN_WIDTH_RATIO value for that column only. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_COLUMN_WIDTH_RATIO + N/A + Global | Report | Element + 4.1.3 +
    + + + + + + +Property that specifies if the cell content is hidden or exposed in the formula bar of a protected sheet. +
    +Its value is used as default for the +isCellHidden() Excel export configuration setting. +
    +By default the property is not set (false), and the cell content is not hidden. +
    +This property has effect only if the enclosing sheet is protected. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_CELL_HIDDEN + false + Global | Report | Element + 3.7.5 +
    + + + + + + +Property that specifies if the cell content is locked (read-only) within a protected sheet. +
    +Its value is used as default for the +isCellLocked() Excel export configuration setting. +
    +By default the property is considered (true), but it only has effect if the enclosing sheet is protected. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_CELL_LOCKED + true + Global | Report | Element + 3.7.5 +
    + + + + + + +Flag property specifying whether the standard color palette should be customized so that the XLS result uses the original report colors. +
    +Its value is used as default for the +isCreateCustomPalette() Excel export configuration setting. +
    +The colors used in the result XLS are determined in the following manner: +
      +
    1. If this flag is not set, the nearest color from the standard XLS palette is chosen for a report color.
    2. +
    3. If the flag is set, the nearest not yet modified color from the palette is chosen and modified to exactly match the report color. +If all the colors from the palette are modified (the palette has a fixed size), the nearest color from the palette is chosen for further report colors.
    4. +
    +This property is by default not set (false). +
    + net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_CREATE_CUSTOM_PALETTE + false + Global | Report + 2.0.0 +
    + + + + + + +Property that specifies the value to be placed in the cell associated with the +PROPERTY_COLUMN_NAME +in the metadata-based Excel export. +
    +When working with this property, numbers have to be written with no thousand separators and using a period as decimal. For instance, 1,000,000 should be written as +"1000000" and 2,000.45 should be written as "2000.45". Dates must be written according to ISO 8601 standard: "yyyy-MM-dd'T'HH:mm:ss". +
    +By default this value is represented by the value stored in the report element this property is assigned to. +
    + net/sf/jasperreports/engine/export/JRXlsAbstractMetadataExporter.html#PROPERTY_DATA + N/A + Element + 4.0.2 +
    + + + + + + +Property that specifies whether the exporter should take into consideration the type of the original text field expressions and set the cell types and values accordingly. +
    +Its value is used as default for the +isDetectCellType() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_DETECT_CELL_TYPE + false + Global | Report + 2.0.1 +
    + + + + + + +Property used at print time to indicate the number of pages height to fit the sheet in. +
    +Its value is used as default for the +getFitHeight() Excel export configuration setting. +
    +Print pages for a given sheet in Excel are generated according to 'Paper size' settings in the Print menu, +with no respect to the initial pagination of the report. In this case differences between a JasperReport print page and a page in Excel may occur. +
    +Usually the content of a given sheet is considered to be printed into a single page. But when a sheet contains too many rows, including all of them in a single page may lead to an unreadable printed +document. In this case the sheet must be split into multiple print pages. In JasperReports this number of pages can be set with the net.sf.jasperreports.export.xls.fit.height property. +
    +Note: When this property is set to a value (for instance, n), Excel will estimate if n pages are enough to cover the entire sheet height, keeping font settings and row heights unchanged. +If the number of pages is too small, font and row height adjustments will be performed in order to make room for the entire content. The printed document will come out with smaller fonts and thinner +rows than those exposed in the related sheet. +
    +See also the net.sf.jasperreports.export.xls.fit.width property. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_FIT_HEIGHT + N/A + Global | Report + 3.7.5 +
    + + + + + + +Property used at print time to indicate the number of pages width to fit the sheet in. +
    +Its value is used as default for the +getFitWidth() Excel export configuration setting. +
    +Print pages for a given sheet in Excel are generated according to 'Paper size' settings in the Print menu, +with no respect to the initial pagination of the report. In this case differences between a JasperReport print page and a page in Excel may occur. +
    +In most common cases the content of a given sheet is supposed to be printed into a single page. But problems may occur when a sheet contains too many rows and/or columns and the printed page +becomes unreadable. If too many columns are involved, we can split the sheet width into multiple print pages, in order to make the content readable. In JasperReports this number of pages can +be set with the net.sf.jasperreports.export.xls.fit.width property. +
    +Note: When this property is set to a value (for instance, n), Excel will estimate if n pages are enough to cover the entire sheet width, keeping font settings and column widths unchanged. +If the number of pages is too small, font and column width adjustments will be performed in order to include the entire content into available pages. The printed document will come out with +smaller fonts and thinner columns than those exposed in the related sheet. +
    +See also the net.sf.jasperreports.export.xls.fit.height property. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_FIT_WIDTH + N/A + Global | Report + 3.7.5 +
    + + + + + + +Property that specifies the first page number in the page setup dialog. +
    +Its value is used as default for the +getFirstPageNumber() Excel export configuration setting. +
    +When the property is set at Element level, it can be used to set the first page number for the current sheet. +
    +Global settings are overriden by report level settings; report level settings are overriden by element (sheet) level settings. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_FIRST_PAGE_NUMBER + N/A + Global | Report | Element + 4.6.0 +
    + + + + + + +Flag property that indicates whether the font size should be decreased so that texts fit into the specified cell height. +
    +Its value is used as default for the +isFontSizeFixEnabled() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_FONT_SIZE_FIX_ENABLED + false + Global | Report + 2.0.1 +
    + + + + + + +Flag property that provides a default value for the isForcePageBreaks() export setting. +If set to true, the exporter will automatically add a page break at the end of each page exported on the current sheet. +
    +Allowed values are: +
      +
    • true
    • +
    • false
    • +
    +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_FORCE_PAGE_BREAKS + false + Global | Report + 6.0.2 +
    + + + + + + +Flag property that indicates whether local anchors should be ignored when elements are exported to Excel. +
    +Its value is used as default for the +isIgnoreAnchors() Excel export configuration setting. +
    +If set to true, local anchors will be excluded from export. +Otherwise they will be exported along with elements they belong to. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_IGNORE_ANCHORS + false + Global | Report + 4.6.0 +
    + + + + + + +Property that specifies whether cell background color should be ignored in the generated document. +
    +Its value is used as default for the +isIgnoreCellBackground() Excel export configuration setting. +
    +If the property is set at element level, its value will be applied only to the sheet containing that element. +Other sheets in the document will not be affected. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_IGNORE_CELL_BACKGROUND + false + Global | Report | Element (since 6.2.0) + 3.6.2 +
    + + + + + + +Property that specifies whether cell borders should be ignored in the generated document. +
    +Its value is used as default for the +isIgnoreCellBorder() Excel export configuration setting. +
    +If the property is set at element level, its value will be applied only to the sheet containing that element. +Other sheets in the document will not be affected. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_IGNORE_CELL_BORDER + false + Global | Report | Element (since 6.2.0) + 2.0.1 +
    + + + + + + +Property that specifies whether graphic elements should be ignored and only text elements will be exported. +
    +Its value is used as default for the +isIgnoreGraphics() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_IGNORE_GRAPHICS + false + Global | Report + 2.0.1 +
    + + + + + + +Property that specifies the image anchor type. Possible values are: +
      +
    • MoveSize - images move and size with cells
    • +
    • MoveNoSize - images move but don't size with cells
    • +
    • NoMoveNoSize - images don't move or size with cells
    • +
    +Global settings are overriden by report level settings; report level settings are overriden by element level settings. +
    +Its value is used as default for the +getImageAnchorType() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_IMAGE_ANCHOR_TYPE + MoveNoSize + Global | Report | Element + 5.0.4 +
    + + + + + + +Flag property that specifies whether the minimum image padding will be forced to 1 pixel, to avoid situations where the image hides the cell border. +
    +Its value is used as default for the +isImageBorderFixEnabled() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_IMAGE_BORDER_FIX_ENABLED + false + Global | Report + 3.0.0 +
    + + + + + + +Property that specifies the maximum number of rows allowed to be exported to the same sheet. Negative values or zero means that no limit has been set. +
    +Its value is used as default for the +getMaxRowsPerSheet() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_MAXIMUM_ROWS_PER_SHEET + 0 + Global | Report + 2.0.1 +
    + + + + + + +Property that contains the application information to use for the generated XLS metadata. +
    +Its value is used as default for the +getMetadataApplication() XLS export configuration setting. +
    + net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_METADATA_APPLICATION + N/A + Global | Report + 6.3.1 +
    + + + + + + +Property that contains the author information to use for the generated XLS metadata. +
    +Its value is used as default for the +getMetadataAutor() XLS export configuration setting. +
    + net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_METADATA_AUTHOR + N/A + Global | Report + 6.3.1 +
    + + + + + + +Property that contains the keywords to use for the generated XLS metadata. +
    +Its value is used as default for the +getMetadataKeywords() XLS export configuration setting. +
    + net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_METADATA_KEYWORDS + N/A + Global | Report + 6.3.1 +
    + + + + + + +Property that contains the subject information to use for the generated XLS metadata. +
    +Its value is used as default for the +getMetadataSubject() XLS export configuration setting. +
    + net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_METADATA_SUBJECT + N/A + Global | Report + 6.3.1 +
    + + + + + + +Property that contains the title information to use for the generated XLS metadata. +
    +Its value is used as default for the +getMetadataTitle() XLS export configuration setting. +
    + net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_METADATA_TITLE + N/A + Global | Report + 6.3.1 +
    + + + + + + +Property that specifies whether each report page should be written in a different XLS sheet. +
    +Its value is used as default for the +isOnePagePerSheet() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_ONE_PAGE_PER_SHEET + false + Global | Report + 2.0.1 +
    + + + + + + +Property that specifies whether the empty spacer columns should be removed or not. +
    +Its value is used as default for the +isRemoveEmptySpaceBetweenColumns() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS + false + Global | Report + 2.0.1 +
    + + + + + + +Property that specifies whether the empty spacer rows should be removed or not. +
    +Its value is used as default for the +isRemoveEmptySpaceBetweenRows() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_ROWS + false + Global | Report + 2.0.1 +
    + + + + + + +Property that specifies whether the text formatting (such as text color, background color, bold style, italic, underline, etc) +should be ignored in the resulting Excel document at export time or not. +
    +Its value is used as default for the +isIgnoreTextFormatting() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_IGNORE_TEXT_FORMATTING + false + Global | Report | Text Element + 6.0.4 +
    + + + + + + +Property that determines whether date values are to be translated to the timezone that was used to fill the report. +
    +Its value is used as default for the +isUseTimeZone() Excel export configuration setting. +
    +By default, date values are exported to Excel using the default timezone of the system. +Setting this property to true instructs the exporter to use he report fill timezone to export date values. +
    +The property only has effect when net.sf.jasperreports.export.xls.detect.cell.type is set. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_USE_TIMEZONE + false + Global | Report | Element + 4.5.0 +
    + + + + + + +Property that specifies whether the page background should be white or the default XLS background color. +
    +Its value is used as default for the +isWhitePageBackground() Excel export configuration setting. +
    +If the property is set at element level, its value will be applied only to the sheet containing that element. +Other sheets in the document will not be affected. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_WHITE_PAGE_BACKGROUND + true + Global | Report | Element (since 6.2.0) + 2.0.1 +
    + + + + + + +Property used to store the location of an existing workbook template. +
    +Its value is used as default for the +getWorkbookTemplate() Excel export configuration setting. +
    +The content of an existing workbook document +or template can be embedded into exported document if the template location is known. In this case the content of +the template will be exported first and the content of the exported report will be appended to this one. Macros and +other settings in the existing template will be also preserved in the generated document. Templates can be loaded from +Excel template files (*.xlt) as well as from valid Excel documents (*.xls). +
    +This property is used in Excel exporters based either on Apache POI APIs +(JRXlsExporter) or on JExcelApi library +(JExcelApiExporter). There's no similar property +for the JRXlsxExporter. +
    + net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_WORKBOOK_TEMPLATE + N/A + Global | Report + 4.5.1 +
    + + + + + + +Flag property that specifies whether to keep the sheets of the existing template into generated document. +
    +Its value is used as default for the +isKeepWorkbookTemplateSheets() Excel export configuration setting. +Sometimes is important to embed in a generated document only macros and/or other global settings from an existing template, but +without keeping the own sheets of the template document. If set to false, this property prevent the template sheets to be exported. +
    +This property is used in conjunction with PROPERTY_WORKBOOK_TEMPLATE. +
    +Allowed values are: +
      +
    • true
    • +
    • false - this is the default value.
    • +
    +
    + net/sf/jasperreports/export/XlsExporterConfiguration.html#PROPERTY_WORKBOOK_TEMPLATE_KEEP_SHEETS + false + Global | Report + 4.5.1 +
    + + + + + + +Property that stores the formula which has to be applied to a given cell in an Excel sheet. + + net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_CELL_FORMULAstores the formula which has to be applied to a given cell in an Excel sheet. + N/A + Text Element + 3.0.0 + + + + + + + +Indicates the name of the first unlocked column in document's sheets. All columns to the left of this one will be 'frozen'. +Allowed values are letters or letter combinations representing valid column names in Excel, such as A, B, AB, AC, etc. +The property should be used when all sheets in the document have the same freeze column name.
    +The property is available for: +
      +
    • JRXlsExporter
    • +
    • JExcelApiExporter
    • +
    • JExcelApiMetadataExporter
    • +
    • JRXlsxExporter
    • +
    +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_FREEZE_COLUMN + N/A + Global | Report + 4.1.1 +
    + + + + + + +Property that indicates the vertical edge of the freeze pane, relative to the current cell. If set, it overrides the +PROPERTY_FREEZE_COLUMN value. +
    +Allowed values are: +
      +
    • +Left - the current column is the first unlocked column in the sheet. All columns to the left are 'frozen'. +
    • +
    • +Right - the current column is the last 'frozen' column in the sheet. All columns to the right are unlocked. +
    • +
    +If several elements in a sheet contain this property, the freeze pane edge will pick its value from the element +with maximum column index. +
    +The property is available for: +
      +
    • JRXlsExporter
    • +
    • JExcelApiExporter
    • +
    • JExcelApiMetadataExporter
    • +
    • JRXlsxExporter (since 6.2.0)
    • +
    +
    + net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_FREEZE_COLUMN_EDGE + N/A + Report Element + 4.1.1 +
    + + + + + + +Specifies the index of the first unlocked row in document's sheets. All rows above this will be 'frozen'. +Allowed values are represented by positive integers in the 1..65536 range. Negative values are not considered. +The property should be used when all sheets in the document have the same freeze row index.
    +The property is available for: +
      +
    • JRXlsExporter
    • +
    • JExcelApiExporter
    • +
    • JExcelApiMetadataExporter
    • +
    • JRXlsxExporter
    • +
    +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_FREEZE_ROW + N/A + Global | Report + 4.1.1 +
    + + + + + + +Property that indicates the horizontal edge of the freeze pane, relative to the current cell. If set, it overrides the +PROPERTY_FREEZE_ROW value. +
    +Allowed values are: +
      +
    • +Top - the current row is the first unlocked row in the sheet. All rows above are 'frozen'. +
    • +
    • +Bottom - the current row is the last 'frozen' row in the sheet. All rows below are unlocked. +
    • +
    +If several elements in a sheet contain this property, the freeze pane edge will pick its value from the element +with maximum row index. +
    +The property is available for: +
      +
    • JRXlsExporter
    • +
    • JExcelApiExporter
    • +
    • JExcelApiMetadataExporter
    • +
    • JRXlsxExporter (since 6.2.0)
    • +
    +
    + net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_FREEZE_ROW_EDGE + N/A + Report Element + 4.1.1 +
    + + + + + + +Property used to adjust the page content to a given percent of the normal size in the print preview pane. +
    +Its value is used as default for the +getPageScale() Excel export configuration setting. +
    +Allowed values are positive integers from 10 to 400, representing percents of the normal size. +
    +When the property is set at Element level, it can be used to set the page scale per sheet +
    +Global settings are overriden by report level settings; report level settings are overriden by element (sheet) level settings. +
    +The property overrides the PROPERTY_FIT_WIDTH and +PROPERTY_FIT_HEIGHT values. +
    +This property is by default not set (null). +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_PAGE_SCALE + N/A + Global | Report | Element + 4.6.0 +
    + + + + + + +Property that contains a String value representing the password in case of password protected sheets in documents. +
    +Its value is used as default for the +getPassword() Excel export configuration setting. +
    +This property is by default not set (null). +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_PASSWORD + N/A + Global | Report + 3.0.1 +
    + + + + + + +Property whose value is an Excel compatible pattern, to be used as replacement for the text field pattern when exporting to XLS formats. + + net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_CELL_PATTERN + N/A + Text Element + 4.1.1 + + + + + + + +Custom element property specifying if a sheet will break before the row displaying that element. +It is very useful especially when displaying each report's group on a separate sheet is intended. + + net/sf/jasperreports/engine/export/JRXlsAbstractExporterNature.html#PROPERTY_BREAK_BEFORE_ROW + false + Element + 3.0.0 + + + + + + + +Custom element property specifying if a sheet will break after the row displaying that element. +It is very useful especially when displaying each report's group on a separate sheet is intended. + + net/sf/jasperreports/engine/export/JRXlsAbstractExporterNature.html#PROPERTY_BREAK_AFTER_ROW + false + Element + 3.0.0 + + + + + + + +Property prefix used to indicate the current outline row level, and when necessary, the ending row of the current outline row +group with the given level. The suffix of these properties is associated with the outline level, while the property value indicates +if the current row group should continue or should end. The most recommended practice is to use the outline level itself as property +suffix, although this is not mandatory. The suffix may take any other string value, but one has to keep in mind that suffixes are +used as sorted row levels descriptors. For instance, because "aaa" < "bbb", the outline level associated with the "aaa" suffix +will be smaller than the level associated with the "bbb" suffix. A completely intuitive representation of the row levels uses the row +level as property suffix. +
    +In such a case, the net.sf.jasperreports.export.xls.outline.level.2 property means that its value is correlated with +the outline level 2, so the current row belongs to a level 2 row group. Based on Office Open XML specs, allowed values for outline +levels are positive integers from 1 to 7. +
    +The value of this property could be any expression (including null). When such a property occurrence is met, the suffix +indicates the outline level for that row. If multiple properties with the same prefix are defined for the same row, the deepest +outline level is considered for that row. To end an outline row group one has to set the related outline level property with the +End value. This is a special property value instructing the JR engine that the current row group of that level ends +on the current row. +
    + net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_ROW_OUTLINE_LEVEL_PREFIX + N/A + Element + 4.1.3 +
    + + + + + + +Property that specifies whether the value associated with +PROPERTY_COLUMN_NAME +should be repeated or not when it is missing. This property is available for the metadata-based Excel export. + + net/sf/jasperreports/engine/export/JRXlsAbstractMetadataExporter.html#PROPERTY_REPEAT_VALUE + false + Element + 4.0.2 + + + + + + + +This property indicates if the sheet is left-to-right or right-to-left oriented. Possible values are: +
      +
    • LTR
    • +
    • RTL
    • +
    +Its value is used as default for the +getSheetDirection() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_SHEET_DIRECTION + LTR + Global | Report + 3.7.5 +
    + + + + + + +Custom property storing the text content of the sheet footer's center. +
    +Its value is used as default for the +getSheetFooterCenter() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_SHEET_FOOTER_CENTER + N/A + Global | Report + 3.7.5 +
    + + + + + + +Custom property storing the text content of the left side of the sheet footer. +
    +Its value is used as default for the +getSheetFooterLeft() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_SHEET_FOOTER_LEFT + N/A + Global | Report + 3.7.5 +
    + + + + + + +Custom property storing the text content of the right side of the sheet footer. +
    +Its value is used as default for the +getSheetFooterRight() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_SHEET_FOOTER_RIGHT + N/A + Global | Report + 3.7.5 +
    + + + + + + +Custom property storing the text content of the sheet header's center. +
    +Its value is used as default for the +getSheetHeaderCenter() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_SHEET_HEADER_CENTER + N/A + Global | Report + 3.7.5 +
    + + + + + + +Custom property storing the text content of the left side of the sheet header. +
    +Its value is used as default for the +getSheetHeaderLeft() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_SHEET_HEADER_LEFT + N/A + Global | Report + 3.7.5 +
    + + + + + + +Custom property storing the text content of the right side of the sheet header. +
    +Its value is used as default for the +getSheetHeaderRight() Excel export configuration setting. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_SHEET_HEADER_RIGHT + N/A + Global | Report + 3.7.5 +
    + + + + + + +Property used to set the name of the sheet containing a given element. Its value overrides the report-level settings for the sheet name. +
    +If several elements in the sheet contain this property, the engine will consider the value of the last exported element's property. +
    + net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_SHEET_NAME + N/A + Element + 4.1.3 +
    + + + + + + +A set of report custom properties (exporter hints) added in order to hold user defined sheet names. This is very useful when +indicating sheet names in the jrxml template is required. +
    +Sheet names in these properties are used as default for the +getSheetNames() Excel export configuration setting. +
    +These properties should start with the +net.sf.jasperreports.export.xls.sheet.names. prefix, and should end with an +arbitrary suffix. Any of them can hold one or many sheet names, +separated by the slash ("/") separator. Values are collected in the same +order as they are enumerated in the jrxml template, so one have to be careful with that +order when editing a jrxml. The ending suffix is not important, but the order +is very. +
    +For instance, if a given report has 3 resulting sheets, there are multiple +possibilities to define the sheet names within the jrxml template: +
    +
    +
      +
    1. To have a single property for each sheet name: +
      +
      + +<property name="net.sf.jasperreports.export.xls.sheet.names.sheet1" +value="First sheet" /> +
      +<property name="net.sf.jasperreports.export.xls.sheet.names.second.sheet.name" +value="Second sheet" /> +
      +<property name="net.sf.jasperreports.export.xls.sheet.names.3" value="Third +sheet" />
      +
      +
      +Then, the 3 resulting sheets will be named as follows: +
      +
      +First sheet +
      +Second sheet +
      +Third sheet +
      +
      +
    2. +
    3. +To have a single property containing all sheet names, separated by the "/" +separator: +
      +
      + +<property name="net.sf.jasperreports.export.xls.sheet.names.all" value="First +sheet/Second sheet/Third sheet" /> +
      +
      +Then, the 3 resulting sheets will be named as follows: +
      +
      +First sheet +
      +Second sheet +
      +Third sheet +
      +The order is very important, as shown above. +
      +
      +
    4. +
    5. +To have any combination of 1) and 2): +
      +
      + +<property name="net.sf.jasperreports.export.xls.sheet.names.first" value="First +sheet" /> +
      +<property name="net.sf.jasperreports.export.xls.sheet.names.others" +value="Second sheet/Third sheet" />
      +
      +
      +Then, the 3 resulting sheets will be named as follows: +
      +
      +First sheet +
      +Second sheet +
      +Third sheet +
    6. +
    +
    +Finally, if the user sets less sheet names (let's say x) than the +number of sheets, the exporter will use the custom user sheet names for the +first x sheets in the document, and the remaining sheets will be named by +default as "Page y", where y is the current page number. +
    +These properties are by default not set. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_SHEET_NAMES_PREFIX + N/A + Report + 3.5.2 +
    + + + + + + +Property whose value is used to set the tab color of a given sheet in XLSX and ODS output formats. +When set at report level, all sheets in the document will have their tabs colored the same way. +When set at report element level and multiple elements in a sheet provide this property, +the last read value will be considered. +
    +Its value usually can be expressed as #-prefixed CSS color. +
    +Report-level settings are overriden by element-level settings for this property. +If several elements in a sheet contain this property, the engine will consider the value of the +last exported element's property. +
    +Note: This property is not supported by the XLS output format. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_SHEET_TAB_COLOR + N/A + Global | Report | Element + 6.2.0 +
    + + + + + + +Flag property that specifies if the gridlines in a given sheet are shown. +
    +Its value is used as default for the +isShowGridLines() Excel export configuration setting. +
    +If multiple elements in a sheet provide this property, the last read value will be considered. +Global settings are overriden by report level settings; report level settings are overriden by element (sheet) level settings. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_SHOW_GRIDLINES + true + Global | Report | Element + 4.8.0 +
    + + + + + + +Flag property that indicates whether the text font size should be decreased in order to +keep the entire text visible in the cell. If set to true, this will automatically disable the +wrap text setting for the cell (see net.sf.jasperreports.export.xls.wrap.text). +
    +Usually this property works in conjunction with net.sf.jasperreports.print.keep.full.text, +in order to preserve the entire text content at export time. +
    +The value of this property is used as default for the +isShrinkToFit() Excel export configuration setting. +
    +Settings at global level are overriden by report level settings; report level settings are overriden by element level settings. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_SHRINK_TO_FIT + false + Global | Report | Element + 6.0.2 +
    + + + + + + +Custom element property specifying if text wrapping is allowed in a given cell. +
    +Its value is used as default for the +isWrapText() Excel export configuration setting. +
    +If set to false, text wrapping is forbidden, otherwise it is allowed. +
    + net/sf/jasperreports/export/XlsReportConfiguration.html#PROPERTY_WRAP_TEXT + true + Global | Report | Element + 3.7.3 +
    + + + + + + +Property that specifies whether the export header (the column names) should be written or not, in the metadata-based Excel export. +
    +Its value is used as default for the +isWriteHeader() Excel metadata export configuration setting. +
    + net/sf/jasperreports/export/XlsMetadataReportConfiguration.html#PROPERTY_WRITE_HEADER + false + Element + 4.0.2 +
    + + + + + + +Property used to store the location of an existing Excel 2007 workbook template containing a macro object. +When exporting into Excel 2007 format, the macro object will be copied into the generated document if the template location is valid. +Macros can be loaded from Excel 2007 macro-enabled template files (*.xltm) as well as from valid +Excel macro-enabled documents (*.xlsm). +
    +The value of this property is used as default for the +getMacroTemplate() Excel 2007 export configuration setting. +
    + net/sf/jasperreports/export/XlsxExporterConfiguration.html#PROPERTY_MACRO_TEMPLATE + N/A + Global | Report + 4.5.1 +
    + + + + + + When set to false, it forces the engine to check if the font used as value for the fontName attribute inside +the report template is available either through the JasperReports font extension mechanism or as a JVM accesible font, +and raise a JRFontNotFoundException exception, if this font is not available. + net/sf/jasperreports/engine/util/JRStyledText.html#PROPERTY_AWT_IGNORE_MISSING_FONT + false + Global | Report + 3.6.1 + + + + + + + + + net/sf/jasperreports/engine/util/JRStyledText.html#PROPERTY_AWT_SUPERSCRIPT_FIX_ENABLED + N/A + Global + 3.1.3 + + + + + + + + + + net/sf/jasperreports/engine/export/JRXmlExporter.html#PROPERTY_START_PAGE_INDEX + N/A + Global | Report + 3.0.1 + + + + + + + + + net/sf/jasperreports/engine/export/JRXmlExporter.html#PROPERTY_END_PAGE_INDEX + N/A + Global | Report + 3.0.1 + + + + + + + + + net/sf/jasperreports/engine/export/JRXmlExporter.html#PROPERTY_PAGE_COUNT + N/A + Global | Report + 3.0.0 + + + + + + + + + net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_TABLE + N/A + Element + 3.1.2 + + + + + + + + + net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_TR + N/A + Element + 3.1.2 + + + + + + + + + net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_TH + N/A + Element + 3.1.2 + + + + + + + + + net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_TD + N/A + Element + 3.1.2 + + + + + + + + + net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_H1 + N/A + Element + 3.1.2 + + + + + + + + + net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_H2 + N/A + Element + 3.1.2 + + + + + + + + + net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_H3 + N/A + Element + 3.1.2 + + + + + + + + + net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_COLSPAN + N/A + Element + 3.1.2 + + + + + + + + + net/sf/jasperreports/engine/export/JRPdfExporterTagHelper.html#PROPERTY_TAG_ROWSPAN + N/A + Element + 3.1.2 + + + + + + + +An integer property that provides the minimum precision to be used for java.math.BigDecimal division operations. +Important note: this property is only effective when Java 1.5 or newer is used. See BigDecimalUtils for details. + + net/sf/jasperreports/engine/util/Java15BigDecimalHandler.html#PROPERTY_MINIMUM_PRECISION + 16 + Global + 3.5.4 + + + + + + + + +Properties having this prefix specify the version for the associated built-in component in a given report. Built-in components are those who are shipped as part of the +JasperReports Library JAR. +
    +For instance, for the table component shipped with JR distribution, the version is given with a property as follows: +
    +
    +<property name="net.sf.jasperreports.components.table.version" value="4.0.0" /> +
    +
    +If not specified, the component version is considered to be the one specified by the net.sf.jasperreports.report.version. +
    + net/sf/jasperreports/engine/component/ComponentXmlWriter.html#PROPERTY_COMPONENT_VERSION_PREFIX + N/A + Global | Report | Element + 4.8.0 +
    + + + + + + +Property whose value is used to check the availability of printers accepting jobs. + + net/sf/jasperreports/engine/JasperPrintManager.html#PROPERTY_CHECK_AVAILABLE_PRINTERS + true + Global | Report + 3.7.3 + + + + + + + +A boolean property that determines whether the HTML exporter should flush the output stream after writing the HTML content to it. + + net/sf/jasperreports/export/HtmlExporterConfiguration.html#PROPERTY_FLUSH_OUTPUT + true + Global | Report + 3.7.1 + + + + + + + +Property that determines if missing bookmark levels are collapsed, or if +empty bookmarks are created for the missing levels. +

    +The property dictates what happens when a filled report contains an anchor +having a bookmark level that is not the immediate successor of its parent +(e.g. an anchor with bookmark level 3 follows immediately after a bookmark +of level 1). +If the property is not set, an empty bookmark is created for the missing +level(s) in order to preserve the original level of the bookmark. +When the property is set, the level of the bookmark will be collapsed and +the bookmark will be created as a direct descendant of its nearest parent. +

    +
    + net/sf/jasperreports/export/PdfReportConfiguration.html#PROPERTY_COLLAPSE_MISSING_BOOKMARK_LEVELS + false + Global | Report + 3.7.3 +
    + + + + + + +Property which specifies if the size of each page should be increased to accommodate its content. + + net/sf/jasperreports/export/PdfReportConfiguration.html#PROPERTY_SIZE_PAGE_TO_CONTENT + false + Global | Report + 4.7.0 + + + + + + + +Flag property that indicates whether the absolute path to be used instead, when resources are not found in the file repository. + + net/sf/jasperreports/repo/FileRepositoryServiceExtensionsRegistryFactory.html#PROPERTY_FILE_REPOSITORY_RESOLVE_ABSOLUTE_PATH + false + Global + 4.1.1 + + + + + + + + +Specifies the file repository root location. + + net/sf/jasperreports/repo/FileRepositoryServiceExtensionsRegistryFactory.html#PROPERTY_FILE_REPOSITORY_ROOT + N/A + Global + 4.1.1 + + + + + + + + +Determines how page breaks are to be handled in reports that are not paginated. +
    +Possible values are: +
      +
    • ignore - page breaks are ignored in non paginated reports.
    • +
    • apply - page breaks are honoured in non paginated reports.
    • +
    +
    + net/sf/jasperreports/engine/JRBreak.html#PROPERTY_PAGE_BREAK_NO_PAGINATION + ignore + Global | Report | Element + 5.0.4 +
    + + + + + + +Specifies the default value for the getEvaluationTime() property of a dataset parameter. +
    +Possible values are defined by the ParameterEvaluationTimeType enumeration. +
      +
    • Early - Evaluate the parameter default value expression before parameter contributors.
    • +
    • Late - Evaluate the parameter default value expression after parameter contributors.
    • +
    +
    + net/sf/jasperreports/engine/type/ParameterEvaluationTimeType.html#PROPERTY_EVALUATION_TIME + Late + Global | Dataset + 6.3.1 +
    + + + + + + +Specifies the default value for the getEvaluationTime() setting of a dataset property expression. +
    +Possible values are defined by the PropertyEvaluationTimeType enumeration. +
      +
    • Early - Evaluate the property expression before parameter contributors.
    • +
    • Late - Evaluate the property expression after parameter contributors.
    • +
    • Late - Evaluate the property expression at the end of the report.
    • +
    +
    + net/sf/jasperreports/engine/type/PropertyEvaluationTimeType.html#PROPERTY_EVALUATION_TIME + Early + Global | Dataset + 6.3.1 +
    + + + + + + +The default locale used to fill reports. The property is overridden by the REPORT_LOCALE parameter value. + + net/sf/jasperreports/engine/fill/JRFiller.html#PROPERTY_DEFAULT_LOCALE + system locale + Global | Report + 5.2.0 + + + + + + + +The default time zone used to fill reports. The property is overridden by the REPORT_TIME_ZONE parameter value. + + net/sf/jasperreports/engine/fill/JRFiller.html#PROPERTY_DEFAULT_TIMEZONE + system time zone + Global | Report + 5.2.0 + + + + + + + +Provides a default pattern to be used for java.sql.Date values. + +

    +Locale specific values can be configured by appending _<locale code> to the property name. +

    + +

    +The property can be set at global/JasperReports context level. +

    +
    + net/sf/jasperreports/engine/JRTextField.html#PROPERTY_PATTERN_DATE + N/A + Global + 6.0.0 +
    + + + + + + +Provides a default pattern to be used for java.sql.Time values. + +

    +Locale specific values can be configured by appending _<locale code> to the property name. +

    + +

    +The property can be set at global/JasperReports context level. +

    +
    + net/sf/jasperreports/engine/JRTextField.html#PROPERTY_PATTERN_TIME + N/A + Global + 6.0.0 +
    + + + + + + +Provides a default pattern to be used for java.util.Date values other than java.sql.Date and java.sql.Time. + +

    +Locale specific values can be configured by appending _<locale code> to the property name. +

    + +

    +The property can be set at global/JasperReports context level. +

    +
    + net/sf/jasperreports/engine/JRTextField.html#PROPERTY_PATTERN_DATETIME + N/A + Global + 6.0.0 +
    + + + + + + +Provides a default pattern to be used for numerical values that are known to be integer, i.e. integer primitive wrapper types and java.math.BigInteger. + +

    +Locale specific values can be configured by appending _<locale code> to the property name. +

    + +

    +The property can be set at global/JasperReports context level. +

    +
    + net/sf/jasperreports/engine/JRTextField.html#PROPERTY_PATTERN_INTEGER + N/A + Global + 6.0.0 +
    + + + + + + +Provides a default pattern to be used for numerical values other than the integer types. + +

    +Locale specific values can be configured by appending _<locale code> to the property name. +

    + +

    +The property can be set at global/JasperReports context level. +

    +
    + net/sf/jasperreports/engine/JRTextField.html#PROPERTY_PATTERN_NUMBER + N/A + Global + 6.0.0 +
    + + + + + + +Provides the default border split type for frames. + +

    +The property can be set at report and global/JasperReports context levels. +The property value can be NoBorders, in which case frames that span two pages do not have the bottom border of the first fragment and the top border of the second fragment drawn, +and DrawBorders, in which case both fragments have borders drawn on all sides. +

    +
    + net/sf/jasperreports/engine/JRFrame.html#PROPERTY_BORDER_SPLIT_TYPE + NoBorders + Global | Report + 6.0.0 +
    + + + + + + +Property specifying the default time zone to be used for sending and retrieving date/time values to and from the database. + +

    +The property can be set globally, at dataset level, at parameter and field levels, and as a report/dataset parameter. +Note that sending a value as parameter will override all properties, and the time zone will be used for all date/time parameters and fields in the report. +

    + +

    +The property value can be a time zone ID or REPORT_TIME_ZONE. +In the latter case the report time zone (as in JRParameter.REPORT_TIME_ZONE will be used. +

    +
    + net/sf/jasperreports/engine/query/JRJdbcQueryExecuterFactory.html#PROPERTY_TIME_ZONE + N/A + Global | Dataset | Parameter | Field + 6.1.0 +
    + + + + + + +Property specifying the mapping for the dataset field in case an OLAP data source is used. +This mapping was previously specified using the fieldDescription attribute, but using this custom property is now recommended. + + net/sf/jasperreports/olap/JROlapDataSource.html#PROPERTY_FIELD_MAPPING + N/A + Field + 6.3.1 + + + + + + + +Property that determines whether loading entities that are not known to the engine is allowed. + + net/sf/jasperreports/engine/xml/JRXmlDigester.html#PROPERTY_LOAD_UNKNOWN_ENTITIES + false + Global + 6.2.1 + + + + \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/docs/config.reference.xsl jasperreports-6.3.1/jasperreports/docs/config.reference.xsl --- jasperreports-6.2.2/jasperreports/docs/config.reference.xsl 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/docs/config.reference.xsl 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,354 @@ + + + + + + + + + + + api/ + http://jasperreports.sourceforge.net/api/ + + + + + + +JasperReports <xsl:value-of select="$version"/> - Configuration Reference + + + + + + + + + + + + + + + + + + + + + + + + +
    + +JasperReports-Ultimate-Guide-3.pdfJasperReports Ultimate Guide - +sample.reference.htmlSample Reference - +schema.reference.htmlSchema Reference - +config.reference.htmlConfiguration Reference - +http://community.jaspersoft.com/wiki/jasperreports-library-faqsFAQ - +index.htmlAPI (Javadoc) +
    +
    +
    +
    +JasperReports - Configuration Reference (version ) + + +
    +
    +
    + +
    + +This document lists all the configuration properties available for the JasperReports library. + + + + + + + + + + + + + + + +


    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +






    top


    API + + + + + + + + + + +
    Default
    Scope
    Since




    + © 2001- TIBCO Software Inc. www.jaspersoft.com +
    + + + +
    + + + + + + + + + + + + + NOTE: + + Properties with this prefix are + This property is + not read from the configuration context. This + + http://community.jaspersoft.com/wiki/setting-non-context-configuration-properties-dynamically + _blankFAQ shows the additional steps to follow in order to set + + them + it + dynamically. + + + + + + + + + + + + + # + + + + + + + + + + + + + + +

    +
    + + + +
    +
    + + + + + + + + + _blank + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff -Nru jasperreports-6.2.2/jasperreports/docs/parts.schema.reference.xsl jasperreports-6.3.1/jasperreports/docs/parts.schema.reference.xsl --- jasperreports-6.2.2/jasperreports/docs/parts.schema.reference.xsl 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/docs/parts.schema.reference.xsl 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,498 @@ + + + + + + + + + + + api/ + http://jasperreports.sourceforge.net/api/ + + + + + + +JasperReports <xsl:value-of select="$version"/> - Report Parts Schema Reference + + + + + + + + + + + + + + + + + + + + + + + + +
    + +JasperReports-Ultimate-Guide-3.pdfJasperReports Ultimate Guide - +sample.reference.htmlSample Reference - +schema.reference.htmlSchema Reference - +config.reference.htmlConfiguration Reference - +http://community.jaspersoft.com/wiki/jasperreports-library-faqsFAQ - +index.htmlAPI (Javadoc) +
    +
    +
    +
    +JasperReports - Report Parts Schema Reference (version ) + + +
    +
    +
    + +
    + +This document describes the JRXML structure of the built-in report parts for the JasperReports Library. + + + + + + + + + + + + + + + + + + + + +


    +
    Other JasperReports Library Schemas
    +
    + Report Schema Reference +
    + Components Schema Reference +
    +
    Report Parts Schema Reference
    +
    + + + + + + + + + + + + + + + + + + + + + + +



    + © 2001- TIBCO Software Inc. www.jaspersoft.com +
    + + + + + + + + +
    + +
    top + + + +
    + + + + + + + + + + + + + +
    Attributes
    + + +
    +
    + + + + + + + + + + +
    Parent type:
    schema.reference.html#_blank. + +
    + + + + + + + + +
    Attributes
    + + +
    +
    + + + + +
    Contains
    + + +
    + + + + + + + + + + + + + + + + + +

    +
    + + + + + + + + +
    +
    + + + + + + + + + #<> + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + +
    + + + + # + + + + # + + + + # + + + attribute + + + + + + + + Type: + + + + Use: + + + + + Values + + + + + + +
    + + +
    + + + + Values + + + + + + +
    + + +
    + + + + Values + + + + + + +
    + + +
    + + + + Default: + + + +
    + + + + + + + + # + + + + + + + + schema.reference.html# + _blank + + + + *? + + + + + + + + + ( + + + + # + + + + + + schema.reference.html# + _blank + + + *? + + + + (in ) + (in ) + + + + + | + )*? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/docs/resources/jasperreports.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/docs/resources/jasperreports.png differ diff -Nru jasperreports-6.2.2/jasperreports/docs/resources/jasperreports.svg jasperreports-6.3.1/jasperreports/docs/resources/jasperreports.svg --- jasperreports-6.2.2/jasperreports/docs/resources/jasperreports.svg 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/docs/resources/jasperreports.svg 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,164 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/docs/resources/jr-16x16.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/docs/resources/jr-16x16.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/docs/resources/px.gif and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/docs/resources/px.gif differ diff -Nru jasperreports-6.2.2/jasperreports/docs/sample.reference.xml jasperreports-6.3.1/jasperreports/docs/sample.reference.xml --- jasperreports-6.2.2/jasperreports/docs/sample.reference.xml 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/docs/sample.reference.xml 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,132 @@ + + + + + + General + + + + + + + + + + Report Design + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Components + + + + + + + + + + + + + + + + + Report Compilation + + + + + + + + + + + + + + Data Source / Query Executer + + + + + + + + + + + + + + + + + + + + + + + + + Report Filling + + + + + + + + + + Report Export + + + + + + + + + + + + + + diff -Nru jasperreports-6.2.2/jasperreports/docs/sample.reference.xsl jasperreports-6.3.1/jasperreports/docs/sample.reference.xsl --- jasperreports-6.2.2/jasperreports/docs/sample.reference.xsl 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/docs/sample.reference.xsl 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,260 @@ + + + + + + + + + + + api/ + http://jasperreports.sourceforge.net/api/ + + + + + + +JasperReports <xsl:value-of select="$version"/> - Sample Reference + + + + + + + + + + + + + + + + + + + + + + + + +
    + +JasperReports-Ultimate-Guide-3.pdfJasperReports Ultimate Guide - +sample.reference.htmlSample Reference - +schema.reference.htmlSchema Reference - +config.reference.htmlConfiguration Reference - +http://community.jaspersoft.com/wiki/jasperreports-library-faqsFAQ - +index.htmlAPI (Javadoc) +
    +
    +
    +
    +JasperReports - Sample Reference (version ) + + +
    +
    +
    + +
    + +This document lists all the major features of the JasperReports library, as shown in the samples shipped with the project's source code package. + + + + + + + + + + + + + +


    +
    +
    + + + + + + + + + + + +



    + © 2001- TIBCO Software Inc. www.jaspersoft.com +
    + + + +
    + + + + + + + + + + sample.reference//index.html#incomplete + + + sample.reference//index.html#complete + + + + + + + + + + + + + + sample.reference//index.html + + + + + + + + + + + + + + +

    +
    + + + +
    +
    + + + + _blank + + + + + + + + + + + + + + + + + + + + + + + +
    diff -Nru jasperreports-6.2.2/jasperreports/docs/sample.xsl jasperreports-6.3.1/jasperreports/docs/sample.xsl --- jasperreports-6.2.2/jasperreports/docs/sample.xsl 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/docs/sample.xsl 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,604 @@ + + + + + + + + + + + + ../../api/ + http://jasperreports.sourceforge.net/api/ + + + + + + +JasperReports <xsl:value-of select="$version"/> - <xsl:value-of select="sample/title"/> + + + + + + + + + + + + + + + + + + + + + + + + +
    + +../../JasperReports-Ultimate-Guide-3.pdfJasperReports Ultimate Guide - +../../sample.reference.htmlSample Reference - +../../schema.reference.htmlSchema Reference - +../../config.reference.htmlConfiguration Reference - +index.htmlAPI (Javadoc) +
    +
    +
    +
    +JasperReports - (version ) + + +
    +
    +
    + +
    + + +
    +
    +http://sourceforge.net/projects/jasperreports/files/jasperreports/JasperReports%20/jasperreports--project.zip/download_blankDownload All Sample Source Files +
    +http://sourceforge.net/p/jasperreports/code/ci//tree/jasperreports/demo/samples//_blankBrowse Sample Source Files on Git + + + + + + + + + + + + + + + + + + + + + + + + + +


    + Main Features in This Sample +

    + Secondary Features +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +


    top

    + + + Documented by + + + + mailto:copy + + + + + + , + + + +
    +
    +


    Description / Goal

    Since

    Other Samples
    + + + + + + +
    +



    + +
    + + + + + + + + +

    +© 2001- TIBCO Software Inc. www.jaspersoft.com +
    + + + + + + + + + + + + + + + + + + + +
    + + + + # + + + + +
    + + + + + + + ..//index.html# + + + + + + + ..//index.html + + + + + + + +

    + +

    +
    + + + +
    +
    + + + + + + + + + _blankelement + + + + + + + + + + + + ../../sample.reference//index.html# + subtitle + + + + + + + + + + + +0 + + + + + ../../schema.reference.html#<> + + + + + + + + _blank + + + + + + + +..//index.html/demo/samples/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jasperreports-6.2.2/jasperreports/docs/schema.reference.xsl jasperreports-6.3.1/jasperreports/docs/schema.reference.xsl --- jasperreports-6.2.2/jasperreports/docs/schema.reference.xsl 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/docs/schema.reference.xsl 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,778 @@ + + + + + + + + + + + api/ + http://jasperreports.sourceforge.net/api/ + + + + + + +JasperReports <xsl:value-of select="$version"/> - Schema Reference + + + + + + + + + +
    + + + + + + + + + + + + + + +
    + +JasperReports-Ultimate-Guide-3.pdfJasperReports Ultimate Guide - +sample.reference.htmlSample Reference - +schema.reference.htmlSchema Reference - +config.reference.htmlConfiguration Reference - +http://community.jaspersoft.com/wiki/jasperreports-library-faqsFAQ - +index.htmlAPI (Javadoc) +
    +
    +
    +
    +JasperReports - Schema Reference (version ) + + +
    +
    +
    + +
    + +This document describes the JRXML structure of the report template files for the JasperReports Library. + + + + + + + + + + + + + + + + + + + + +


    +
    Other JasperReports Library Schemas
    +
    + Report Parts Schema Reference +
    + Components Schema Reference +
    +
    Report Schema Reference
    +
    + + + + + +
    + + + # + + + + + + + + + (in ) + (in ) + + +
    + + </td><td> + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    1. Named Enumeration Types
    +
    top

    + Values: +
    + + + +
    +
    +

    2. Named Complex Types
    +
    top

    - abstract type

    Attributes
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +





    +
    3. Schema Elements
    +
    + + + + + + top

    + + (in ) + (in ) + + +
    Type: + + + # + + + + + +

    Attributes



    + © 2001- TIBCO Software Inc. www.jaspersoft.com +
    + + + + + + + + + + + +
    Parent type:
    schema.reference.html#_blank. + +
    + + + + + + + +
    Contains
    + + +
    + + + +
    Attributes
    + + +
    + +
    + + + + + +
    Contains
    + + +
    + + + + + + + + + + + + + + + + + + +

    +
    + + + + + + + + +
    +
    + + + + + + + + + #<> + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + +
    #attribute + + + + + + + + + Type: + + + # + + + + + + + + + + + Use: + + + + + + Base Type: + + + + + + Values + + + + + + +
    + + +
    + + + + Values + + + + + + +
    + + +
    + + + + Values + + + + + + +
    + + +
    + + + + Values + + + + + + +
    + + +
    + + + + Default: + + + +
    + + + + + + + + # + + + + + + # + + + *? + +
    +
    + + +
    + + + + + + + ( + + + + # + + + + + + # + + + *? + + + + (in ) + (in ) + + + + + | + )*? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + # + + + + # + + + + # + + + attribute + + + + + + + + Type: + + + + Use: + + + + + Values + + + + + + +
    + + +
    + + + + Values + + + + + + +
    + + +
    + + + + Values + + + + + + +
    + + +
    + + + + Default: + + + +
    + + diff -Nru jasperreports-6.2.2/jasperreports/.gitignore jasperreports-6.3.1/jasperreports/.gitignore --- jasperreports-6.2.2/jasperreports/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/.gitignore 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,3 @@ +/build +/dist +/target diff -Nru jasperreports-6.2.2/jasperreports/ivysettings.xml jasperreports-6.3.1/jasperreports/ivysettings.xml --- jasperreports-6.2.2/jasperreports/ivysettings.xml 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/ivysettings.xml 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + diff -Nru jasperreports-6.2.2/jasperreports/ivy.xml jasperreports-6.3.1/jasperreports/ivy.xml --- jasperreports-6.2.2/jasperreports/ivy.xml 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/ivy.xml 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,79 @@ + + + + JasperReports Library + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jasperreports-6.2.2/jasperreports/license.txt jasperreports-6.3.1/jasperreports/license.txt --- jasperreports-6.2.2/jasperreports/license.txt 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/license.txt 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff -Nru jasperreports-6.2.2/jasperreports/pom.xml jasperreports-6.3.1/jasperreports/pom.xml --- jasperreports-6.2.2/jasperreports/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/pom.xml 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,512 @@ + + 4.0.0 + net.sf.jasperreports + jasperreports + 6.3.1 + jar + JasperReports + http://jasperreports.sourceforge.net + JasperReports Library + + + GNU Lesser General Public License + http://jasperreports.sourceforge.net/license.html + repo + + + + scm:git:https://github.com/Jaspersoft/jasperreports.git + jr-6-3-1 + https://github.com/Jaspersoft/jasperreports + + + UTF-8 + + + + teodord + Teodor Danciu + teodord@users.sourceforge.net + http://sourceforge.net/users/teodord + TIBCO Software Inc. + http://www.jaspersoft.com + + architect + developer + + +2 + + + lucianc + Lucian Chirita + lucianc@users.sourceforge.net + http://sourceforge.net/users/lucianc + TIBCO Software Inc. + http://www.jaspersoft.com + + architect + developer + + +2 + + + + + jaspersoft-third-party + http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/ + + + + src + tests + + + src + + **/*.dtd + **/*.xsd + **/*.rels + **/*.xml + **/*.properties + **/*.png + **/*.GIF + **/*.gif + **/*.ico + **/*TokenTypes.txt + **/*.vm + **/*.js + **/*.css + **/*.ttf + **/*.otf + **/*.woff + **/*.eot + **/*.svg + **/*.svgz + **/*.tmpl + + + + + + tests + + **/*.jrxml + **/*.jrpxml + **/*.xml + **/*.csv + **/*.png + **/*.jpg + **/*.json + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.7 + 1.7 + UTF-8 + + + + org.apache.maven.plugins + maven-resources-plugin + 2.4 + + + copy_additional_resources + + copy-resources + + process-resources + + ${basedir}/target/classes + + + ${basedir} + + license.txt + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + ${basedir}/src/META-INF/MANIFEST.MF + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + ${project.build.directory}/surefire + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + + + org.codehaus.mojo + clirr-maven-plugin + + 6.3.0 + ${basedir}/clirr-ignore.xml + + + + + + + sonatype-nexus-staging + Nexus Release Repository + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + jr-ce-snapshots + JasperReports CE Snapshots + http://jaspersoft.jfrog.io/jaspersoft/jr-ce-snapshots + + + + + commons-beanutils + commons-beanutils + 1.9.0 + compile + + + commons-collections + commons-collections + 3.2.2 + compile + + + commons-digester + commons-digester + 2.1 + compile + + + commons-logging + commons-logging + 1.1.1 + compile + + + org.hibernate + hibernate-core + 3.3.2.GA + compile + + + javax.transaction + jta + + + true + + + com.lowagie + itext + 2.1.7.js5 + compile + + + com.adobe.xmp + xmpcore + 5.1.1 + compile + true + + + org.jfree + jcommon + 1.0.23 + compile + + + gnujaxp + gnujaxp + + + + + org.jfree + jfreechart + 1.0.19 + compile + + + gnujaxp + gnujaxp + + + + + org.apache.poi + poi + 3.10.1 + compile + true + + + javax.servlet + servlet-api + 2.4 + provided + true + + + xalan + xalan + 2.7.2 + compile + true + + + org.eclipse.jdt.core.compiler + ecj + 4.3.1 + compile + + + org.codehaus.groovy + groovy-all + 2.4.5 + compile + true + + + org.mozilla + rhino + 1.7.6 + compile + true + + + org.apache.ant + ant + 1.7.1 + compile + true + + + net.sourceforge.jexcelapi + jxl + 2.6.10 + compile + true + + + commons-javaflow + commons-javaflow + 20060411 + compile + true + + + mondrian + mondrian + 3.1.1.12687 + compile + true + + + javax.persistence + persistence-api + 1.0 + compile + true + + + antlr + antlr + 2.7.5 + compile + true + + + javax.xml.soap + saaj-api + 1.3 + runtime + true + + + javax.activation + activation + + + + + jaxen + jaxen + 1.1.1 + compile + true + + + org.beanshell + bsh + 2.0b4 + compile + true + + + org.apache.xmlgraphics + batik-bridge + 1.8 + compile + true + + + org.apache.xmlgraphics + batik-svggen + 1.8 + compile + true + + + org.springframework + spring-core + 2.5 + compile + true + + + org.springframework + spring-beans + 2.5 + compile + true + + + net.sf.barcode4j + barcode4j + 2.1 + compile + true + + + net.sourceforge.barbecue + barbecue + 1.5-beta1 + compile + true + + + org.codehaus.castor + castor-xml + 1.3.3 + compile + + + org.apache.velocity + velocity + 1.7 + compile + true + + + org.apache.poi + poi-ooxml + 3.10.1 + compile + true + + + com.fasterxml.jackson.core + jackson-core + 2.1.4 + compile + + + com.fasterxml.jackson.core + jackson-databind + 2.1.4 + compile + + + com.fasterxml.jackson.core + jackson-annotations + 2.1.4 + compile + + + org.testng + testng + 6.8.1 + test + + + log4j + log4j + 1.2.17 + test + + + net.sf.jasperreports + jasperreports-fonts + 4.0.0 + test + + + org.apache.lucene + lucene-core + 4.5.1 + compile + + + org.apache.lucene + lucene-analyzers-common + 4.5.1 + compile + + + org.apache.lucene + lucene-queryparser + 4.5.1 + compile + + + org.olap4j + olap4j + 0.9.7.309-JS-3 + compile + + + org.apache.httpcomponents + httpclient + 4.3.4 + compile + true + + + com.google.zxing + core + 3.2.1 + compile + + + com.ibm.icu + icu4j + 57.1 + + + diff -Nru jasperreports-6.2.2/jasperreports/readme.txt jasperreports-6.3.1/jasperreports/readme.txt --- jasperreports-6.2.2/jasperreports/readme.txt 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/readme.txt 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,80 @@ + +JasperReports Library +============================= + + +1. Ant Build Tool + Ivy Dependency Manager +------------------------------------------- + +In order to compile the project or to run the sample applications +provided with this distribution, you need to have the Apache Ant build tool +installed on your system and the Apache Ivy dependency management plugin installed +in Ant. + +You can get a copy of the Apache Ant tool and details about how to use it +at this address: +http://ant.apache.org/ + +You can get a copy of the Apache Ivy dependency management plugin and details +about how to install it in Ant at this address: +http://ant.apache.org/ivy/ + +There are several Ant specific build.xml files in this project that +help perform different tasks. Each task has a description explaining +what it does and the list of all available tasks inside a build.xml +file can be obtained by going to the parent directory of that particular +build.xml file and launching "ant -p" from the command line. + + + +2. Compile the source files +------------------------------------------- + +In the project's root directory there is a build.xml file that +exposes different targets and helps compiling the Java source files, +the documentation or build the JAR files. +Make sure you have the Ant build tool correctly installed on your machine +and then launch "ant -p" from the command line in the JasperReports root directory +to see what tasks are available for building up the library from the source files. + + + +3. Run the samples +------------------------------------------- + +The /demo directory contains some JasperReports sample applications +and a HSQLDB demo database. + + +3.1 HSQLDB +Some of the supplied samples use the HSQL Database Engine Server +found in the /demo/hsqldb directory. In order to run those samples +you should start the HSQLDB server first. +There is a build.xml file in the /demo/hsqldb directory which contains +two Ant targets: "runServer" and "runManager". +The first is for starting up the HSQL database and the second is for +lanching the HSQL client application in case you need to view the +database structure or run some queries against it. + +3.2 Fonts +Some of the supplied samples use the TrueType font files found in the +/demo/fonts directory. In order to run those samples you should install +these fonts into your operating system so that they are available to the JVM. +The procedure required to install fonts depends on the operating system. +On Windows systems this is equivalent to copying the font files into +the \Fonts directory. + +3.3 Build and run samples +Inside each sample directory there is a build.xml file that +helps compiling the java source files and also run the application. +More information about each Ant task available for each sample can be obtained +by running "ant -p" from the command prompt inside the sample directory. + + + +4. Support and training +------------------------------------------- + +TIBCO Software Inc. now offers support, services and training +for JasperReports and you can learn more about all these here: +http://www.jaspersoft.com/ss_overview.html diff -Nru jasperreports-6.2.2/jasperreports/src/default.jasperreports.properties jasperreports-6.3.1/jasperreports/src/default.jasperreports.properties --- jasperreports-6.2.2/jasperreports/src/default.jasperreports.properties 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/default.jasperreports.properties 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,328 @@ +# Report compiler settings +net.sf.jasperreports.compiler.xml.validation=true +net.sf.jasperreports.compiler.xml.parser.factory=net.sf.jasperreports.engine.xml.JRReportSaxParserFactory +net.sf.jasperreports.compiler.xml.parser.cache.schemas=true +net.sf.jasperreports.compiler.keep.java.file=false +net.sf.jasperreports.compiler.max.java.method.size=32768 +net.sf.jasperreports.compiler.groovy=net.sf.jasperreports.compilers.JRGroovyCompiler +net.sf.jasperreports.compiler.max.groovy.method.size=32768 +net.sf.jasperreports.compiler.bsh=net.sf.jasperreports.compilers.JRBshCompiler +net.sf.jasperreports.compiler.javascript=net.sf.jasperreports.compilers.JavaScriptClassCompiler +org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.codegen.TargetPlatform=1.5 + +# Font settings +net.sf.jasperreports.default.font.name=SansSerif +net.sf.jasperreports.default.font.size=10 +net.sf.jasperreports.default.pdf.font.name=Helvetica +net.sf.jasperreports.default.pdf.encoding=Cp1252 +net.sf.jasperreports.default.pdf.embedded=false +net.sf.jasperreports.awt.ignore.missing.font=false + +net.sf.jasperreports.default.line.spacing.size=1 +net.sf.jasperreports.default.first.line.indent=0 +net.sf.jasperreports.default.left.indent=0 +net.sf.jasperreports.default.right.indent=0 +net.sf.jasperreports.default.spacing.before=0 +net.sf.jasperreports.default.spacing.after=0 +net.sf.jasperreports.default.tab.stop.width=40 + +net.sf.jasperreports.when.no.data.type=NoPages + +# Query executer settings +net.sf.jasperreports.query.executer.factory.sql=net.sf.jasperreports.engine.query.JRJdbcQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.SQL=net.sf.jasperreports.engine.query.JRJdbcQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.plsql=net.sf.jasperreports.engine.query.PlSqlQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.PLSQL=net.sf.jasperreports.engine.query.PlSqlQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.hql=net.sf.jasperreports.engine.query.JRHibernateQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.HQL=net.sf.jasperreports.engine.query.JRHibernateQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.xPath=net.sf.jasperreports.engine.query.JRXPathQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.XPath=net.sf.jasperreports.engine.query.JRXPathQueryExecuterFactory +# new jaxen-based and namespace aware xpath query executer +#net.sf.jasperreports.query.executer.factory.xPath=net.sf.jasperreports.engine.query.JaxenXPathQueryExecuterFactory +#net.sf.jasperreports.query.executer.factory.XPath=net.sf.jasperreports.engine.query.JaxenXPathQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.mdx=net.sf.jasperreports.olap.JRMdxQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.MDX=net.sf.jasperreports.olap.JRMdxQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.ejbql=net.sf.jasperreports.engine.query.JRJpaQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.EJBQL=net.sf.jasperreports.engine.query.JRJpaQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.csv=net.sf.jasperreports.engine.query.JRCsvQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.CSV=net.sf.jasperreports.engine.query.JRCsvQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.xls=net.sf.jasperreports.engine.query.ExcelQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.XLS=net.sf.jasperreports.engine.query.ExcelQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.xlsx=net.sf.jasperreports.engine.query.ExcelQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.XLSX=net.sf.jasperreports.engine.query.ExcelQueryExecuterFactory + +# Simple JSON query executer +net.sf.jasperreports.query.executer.factory.json=net.sf.jasperreports.engine.query.JsonQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.JSON=net.sf.jasperreports.engine.query.JsonQueryExecuterFactory + +# JSONQL query executer +net.sf.jasperreports.query.executer.factory.jsonql=net.sf.jasperreports.engine.query.JsonQLQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.JSONQL=net.sf.jasperreports.engine.query.JsonQLQueryExecuterFactory + +net.sf.jasperreports.query.executer.factory.olap4j=net.sf.jasperreports.olap.Olap4jQueryExecuterFactory +net.sf.jasperreports.query.executer.factory.OLAP4J=net.sf.jasperreports.olap.Olap4jQueryExecuterFactory + +# Apache Xalan XPath executers are used by default +net.sf.jasperreports.xpath.executer.factory=net.sf.jasperreports.engine.util.xml.XalanXPathExecuterFactory + +# by default, export configuration override report hints +net.sf.jasperreports.export.configuration.override.report.hints=true + +# by default, export parameters override report hints +net.sf.jasperreports.export.parameters.override.report.hints=true + +# Common exporter settings +net.sf.jasperreports.export.character.encoding=UTF-8 + +# grid-based exporters may ignore empty page margins +net.sf.jasperreports.export.ignore.page.margins=false + +# Graphics2D exporter settings +net.sf.jasperreports.export.graphics2d.min.job.size=true + +# HTML exporter settings +net.sf.jasperreports.export.html.frames.as.nested.tables=true +net.sf.jasperreports.export.html.remove.empty.space.between.rows=false +net.sf.jasperreports.export.html.white.page.background=true +net.sf.jasperreports.export.html.wrap.break.word=false +net.sf.jasperreports.export.html.size.unit=px +net.sf.jasperreports.export.html.using.images.to.align=true +net.sf.jasperreports.export.html.border.collapse=collapse +# flush HTML output by default +net.sf.jasperreports.export.html.flush.output=true + +# PDF exporter settings +net.sf.jasperreports.export.pdf.force.svg.shapes=true +net.sf.jasperreports.export.pdf.create.batch.mode.bookmarks=false +net.sf.jasperreports.export.pdf.compressed=false +net.sf.jasperreports.export.pdf.encrypted=false +net.sf.jasperreports.export.pdf.128.bit.key=false +net.sf.jasperreports.export.pdf.print.scaling=default +net.sf.jasperreports.export.pdf.collapse.missing.bookmark.levels=false +net.sf.jasperreports.export.pdf.size.page.to.content=false +net.sf.jasperreports.export.pdfa.conformance=none +net.sf.jasperreports.export.pdf.justified.letter.spacing=false + +# XLS exporter settings +net.sf.jasperreports.export.xls.create.custom.palette=false +net.sf.jasperreports.export.xls.one.page.per.sheet=false +net.sf.jasperreports.export.xls.remove.empty.space.between.rows=false +net.sf.jasperreports.export.xls.remove.empty.space.between.columns=false +net.sf.jasperreports.export.xls.white.page.background=true +net.sf.jasperreports.export.xls.detect.cell.type=false +net.sf.jasperreports.export.xls.size.fix.enabled=false +net.sf.jasperreports.export.xls.ignore.graphics=false +net.sf.jasperreports.export.xls.collapse.row.span=false +net.sf.jasperreports.export.xls.ignore.cell.border=false +net.sf.jasperreports.export.xls.ignore.cell.background=false +net.sf.jasperreports.export.xls.max.rows.per.sheet=0 +#net.sf.jasperreports.export.xls.password=pa22w0rd +net.sf.jasperreports.export.xls.wrap.text=true +net.sf.jasperreports.export.xls.use.timezone=false +net.sf.jasperreports.export.xls.auto.fit.page.height=false +net.sf.jasperreports.export.xls.force.page.breaks=false + +# XML exporter settings +net.sf.jasperreports.export.xml.validation=true +net.sf.jasperreports.export.xml.parser.factory=net.sf.jasperreports.engine.xml.PrintSaxParserFactory +net.sf.jasperreports.export.xml.replace.invalid.chars=? + +# CSV exporter settings +net.sf.jasperreports.export.csv.field.delimiter=, +net.sf.jasperreports.export.csv.field.enclosure=\u0022 +net.sf.jasperreports.export.csv.force.field.enclosure=false +net.sf.jasperreports.export.csv.record.delimiter=\n +net.sf.jasperreports.export.csv.write.header=false + +# DOCX exporter settings +net.sf.jasperreports.export.docx.frames.as.nested.tables=true +net.sf.jasperreports.export.docx.flexible.row.height=false + +# Properties to be transferred in the generated document +net.sf.jasperreports.print.transfer.awt=net.sf.jasperreports.awt +net.sf.jasperreports.print.transfer.export=net.sf.jasperreports.export +net.sf.jasperreports.print.transfer.file.buffer.os=net.sf.jasperreports.file.buffer.os +net.sf.jasperreports.print.transfer.viewer=net.sf.jasperreports.viewer + +#Other settings +net.sf.jasperreports.subreport.runner.factory=net.sf.jasperreports.engine.fill.ThreadPoolSubreportRunnerFactory +net.sf.jasperreports.virtualizer.files.delete.on.exit=true +net.sf.jasperreports.virtual.page.element.size=2000 +net.sf.jasperreports.viewer.render.buffer.max.size=0 +net.sf.jasperreports.ejbql.query.page.size=0 +net.sf.jasperreports.hql.clear.cache=false +net.sf.jasperreports.hql.field.mapping.descriptions=true +net.sf.jasperreports.hql.query.list.page.size=0 +net.sf.jasperreports.jdbc.fetch.size=0 +#net.sf.jasperreports.jdbc.max.field.size=0 +net.sf.jasperreports.file.buffer.os.memory.threshold=262144 +net.sf.jasperreports.chart.render.type=draw +net.sf.jasperreports.chart.renderer.factory.image=net.sf.jasperreports.charts.util.ImageChartRendererFactory +net.sf.jasperreports.chart.renderer.factory.svg=net.sf.jasperreports.charts.util.SvgChartRendererFactory +net.sf.jasperreports.chart.renderer.factory.draw=net.sf.jasperreports.charts.util.DrawChartRendererFactory +net.sf.jasperreports.awt.check.available.printers=true +net.sf.jasperreports.image.dpi=72 +net.sf.jasperreports.export.flash.element.allow.script.access=sameDomain + +# CSV query executer +net.sf.jasperreports.csv.field.delimiter=, +net.sf.jasperreports.csv.record.delimiter=\n + +#Default governors +net.sf.jasperreports.governor.max.pages.enabled=true +net.sf.jasperreports.governor.timeout.enabled=true + +#Default text markup processors +net.sf.jasperreports.markup.processor.factory.rtf=net.sf.jasperreports.engine.util.JEditorPaneMarkupProcessor.RtfFactory +net.sf.jasperreports.markup.processor.factory.html=net.sf.jasperreports.engine.util.JEditorPaneMarkupProcessor.HtmlFactory + +#Default text measurer +net.sf.jasperreports.text.measurer.factory=default +net.sf.jasperreports.text.measurer.factory.default=net.sf.jasperreports.engine.fill.TextMeasurerFactory + +#Bookmarks +net.sf.jasperreports.print.create.bookmarks=false +net.sf.jasperreports.print.collapse.missing.bookmark.levels=false + +#Do not keep whole original text in print objects +net.sf.jasperreports.print.keep.full.text=false + +#Do not truncate texts at character +net.sf.jasperreports.text.truncate.at.char=false + +#Do not use append any suffix on text truncation +net.sf.jasperreports.text.truncate.suffix= + +#Do not save line break positions by default +net.sf.jasperreports.text.save.line.breaks=false + +#query $X clause token separators +net.sf.jasperreports.query.chunk.token.separators=,;| + +#enable the class reference fix +net.sf.jasperreports.evaluator.class.reference.fix.enabled=true + +#ignore NPE in expressions +net.sf.jasperreports.evaluator.ignore.npe=true + +#enable the AWT superscript fix for JDK 1.6 +net.sf.jasperreports.awt.superscript.fix.enabled=true + +#default filter factory for all exporters +net.sf.jasperreports.export.default.filter.factory=net.sf.jasperreports.engine.export.DefaultExporterFilterFactory + +#element origin filter factory +net.sf.jasperreports.export.filter.factory.origin=net.sf.jasperreports.engine.export.JROriginExporterFilterFactory + +#element key filter factory +net.sf.jasperreports.export.filter.factory.key=net.sf.jasperreports.engine.export.ElementKeyExporterFilterFactory + +#simple ignore element property filter factory +net.sf.jasperreports.export.filter.factory.ignore=net.sf.jasperreports.engine.export.MatcherExporterFilterFactory + +#default components registry class +net.sf.jasperreports.extensions.registry.class=net.sf.jasperreports.extensions.DefaultExtensionsRegistry + +#allow element overlap by default +net.sf.jasperreports.allow.element.overlap=true + +#don't allow element negative width by default +net.sf.jasperreports.allow.element.negative.width=false + +#allow element negative X by default +net.sf.jasperreports.allow.element.negative.x=true + +#allow element negative Y by default +net.sf.jasperreports.allow.element.negative.y=true + +# do not perform delayed style evaluation by default +net.sf.jasperreports.style.evaluation.time.enabled=false + +#default band split type +net.sf.jasperreports.band.split.type=Stretch + +# Barcode4J image producers +net.sf.jasperreports.components.barcode4j.image.producer.svg=net.sf.jasperreports.components.barcode4j.BarcodeSVGImageProducer +net.sf.jasperreports.components.barcode4j.image.producer.image=net.sf.jasperreports.components.barcode4j.BarcodeRasterizedImageProducer +net.sf.jasperreports.components.barcode4j.qrcode.producer.svg=net.sf.jasperreports.components.barcode4j.QRCodeSVGImageProducer +net.sf.jasperreports.components.barcode4j.qrcode.producer.image=net.sf.jasperreports.components.barcode4j.QRCodeRasterizedImageProducer +# use SVG by default +net.sf.jasperreports.components.barcode4j.image.producer=svg + +# Barcode4J rasterize image properties +net.sf.jasperreports.components.barcode4j.image.resolution=300 +net.sf.jasperreports.components.barcode4j.image.gray=true +net.sf.jasperreports.components.barcode4j.image.antiAlias=true + +# break crosstabs at design width by default +net.sf.jasperreports.crosstab.ignore.width=false + +# minimum precision for BigDecimal divisions +net.sf.jasperreports.big.decimal.minimum.precision=16 + + + +net.sf.jasperreports.components.sort.up.arrow.char=\uE001 +net.sf.jasperreports.components.sort.down.arrow.char=\uE002 +net.sf.jasperreports.components.filter.char=\uE004 +net.sf.jasperreports.components.icon.font=Pictonic + + +net.sf.jasperreports.web.request.parameter.resource.uri=jr.resource +net.sf.jasperreports.web.request.parameter.dynamic.resource=jr.dynamic +net.sf.jasperreports.web.request.parameter.resource.bundle=jr.bundle +net.sf.jasperreports.web.request.parameter.resource.locale=jr.locale + +net.sf.jasperreports.web.servlets.viewer.header.template=net/sf/jasperreports/web/servlets/resources/viewer/HeaderTemplate.vm +net.sf.jasperreports.web.servlets.viewer.body.template=net/sf/jasperreports/web/servlets/resources/viewer/BodyTemplate.vm +net.sf.jasperreports.web.servlets.viewer.footer.template=net/sf/jasperreports/web/servlets/resources/viewer/FooterTemplate.vm + +# mix HTML with JSON in the same output +net.sf.jasperreports.web.embed.component.metadata.in.html.output=false + +# javascript compiler properties +net.sf.jasperreports.javascript.evaluator.optimization.level=0 +# javascript class compiler properties +net.sf.jasperreports.javascript.class.compiler.optimization.level=0 +net.sf.jasperreports.javascript.class.compiler.expressions.per.script=32 +net.sf.jasperreports.javascript.class.compiler.script.max.size=2048 + +# interactivity for the table component +net.sf.jasperreports.components.table.interactive=true +net.sf.jasperreports.components.table.when.no.data.type=Blank +net.sf.jasperreports.components.table.generate.pdf.tags=false + +# velocity resource loader +net.sf.jasperreports.velocity.file.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader +net.sf.jasperreports.velocity.file.resource.loader.cache=true + +#velocity logging +net.sf.jasperreports.velocity.runtime.log.logsystem.class=org.apache.velocity.runtime.log.CommonsLogLogChute + +# text fields consume remaining space on overflow +net.sf.jasperreports.consume.space.on.overflow=true + +# page breaks ignored in non paginated reports +net.sf.jasperreports.page.break.no.pagination=ignore + +# web resource pattern +net.sf.jasperreports.web.resource.pattern.default=net/sf/jasperreports/.* + +# do not draw top/bottom frame borders on split +net.sf.jasperreports.frame.border.split.type=NoBorders + +net.sf.jasperreports.export.pdf.glyph.renderer.blocks.default=devanagari,bengali,telugu,tamil,gujarati,kannada,malayalam,oriya,gurmukhi,sinhala,tibetan,khmer +net.sf.jasperreports.export.pdf.glyph.renderer.add.actual.text=true + +net.sf.jasperreports.xml.load.unknown.entities=false + +net.sf.jasperreports.styles.inherit.from.default=true + +net.sf.jasperreports.legacy.element.stretch.enabled=false + +net.sf.jasperreports.template.xml.parser.factory=net.sf.jasperreports.engine.xml.TemplateSaxParserFactory + +net.sf.jasperreports.parameter.evaluation.time=Late +net.sf.jasperreports.property.evaluation.time=Early diff -Nru jasperreports-6.2.2/jasperreports/src/jasperreports_extension.properties jasperreports-6.3.1/jasperreports/src/jasperreports_extension.properties --- jasperreports-6.2.2/jasperreports/src/jasperreports_extension.properties 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/jasperreports_extension.properties 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,142 @@ +net.sf.jasperreports.extension.registry.factory.default=net.sf.jasperreports.extensions.DefaultExtensionsRegistryFactory +net.sf.jasperreports.extension.registry.factory.governor=net.sf.jasperreports.governors.GovernorExtensionsRegistryFactory + +net.sf.jasperreports.extension.registry.factory.components=net.sf.jasperreports.components.ComponentsExtensionsRegistryFactory +net.sf.jasperreports.extension.registry.factory.parts=net.sf.jasperreports.parts.PartComponentsExtensionsRegistryFactory + +net.sf.jasperreports.extension.registry.factory.sql.clause.functions=net.sf.jasperreports.engine.query.SQLQueryClauseFunctionsExtensions +net.sf.jasperreports.extension.registry.factory.date.range.clause.functions=net.sf.jasperreports.types.date.DateRangeQueryClauseExtensions + +net.sf.jasperreports.extension.registry.factory.parameter.contributor.data.adapter=net.sf.jasperreports.data.DataAdapterParameterContributorExtensionsRegistryFactory +net.sf.jasperreports.extension.registry.factory.repository=net.sf.jasperreports.repo.DefaultRepositoryExtensionsRegistryFactory +net.sf.jasperreports.extension.registry.factory.data.adapter.services=net.sf.jasperreports.data.DefaultDataAdapterServiceExtensionsRegistryFactory +#net.sf.jasperreports.extension.registry.factory.sort=net.sf.jasperreports.components.sort.SortParameterContributorExtensionFactory +net.sf.jasperreports.extension.registry.factory.header.toolbar.parameter.contributor=net.sf.jasperreports.components.headertoolbar.HeaderToolbarParameterContributorExtensionFactory +net.sf.jasperreports.extension.registry.factory.header.toolbar.style.provider=net.sf.jasperreports.components.headertoolbar.HeaderToolbarConditionalStyleProviderExtensionFactory +net.sf.jasperreports.extension.registry.factory.property.style.provider=net.sf.jasperreports.engine.style.PropertyStyleProviderExtensionFactory + +net.sf.jasperreports.extension.registry.factory.castor.mapping=net.sf.jasperreports.util.CastorMappingExtensionsRegistryFactory +net.sf.jasperreports.extension.castor.mapping.bean=net/sf/jasperreports/data/bean/BeanDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.csv=net/sf/jasperreports/data/csv/CsvDataAdapterImpl-603.xml +net.sf.jasperreports.extension.castor.mapping.csv@6.0.4=net/sf/jasperreports/data/csv/CsvDataAdapterImpl-610.xml +net.sf.jasperreports.extension.castor.mapping.csv@6.1.1=net/sf/jasperreports/data/csv/CsvDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.ds=net/sf/jasperreports/data/ds/DataSourceDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.ejbql=net/sf/jasperreports/data/ejbql/EjbqlDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.excel=net/sf/jasperreports/data/excel/ExcelDataAdapterImpl-603.xml +net.sf.jasperreports.extension.castor.mapping.excel@6.0.4=net/sf/jasperreports/data/excel/ExcelDataAdapterImpl-610.xml +net.sf.jasperreports.extension.castor.mapping.excel@6.1.1=net/sf/jasperreports/data/excel/ExcelDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.empty=net/sf/jasperreports/data/empty/EmptyDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.hibernate=net/sf/jasperreports/data/hibernate/HibernateDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.spring=net/sf/jasperreports/data/hibernate/spring/SpringHibernateDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.jdbc=net/sf/jasperreports/data/jdbc/JdbcDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.jndi=net/sf/jasperreports/data/jndi/JndiDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.json=net/sf/jasperreports/data/json/JsonDataAdapterImpl-603.xml +net.sf.jasperreports.extension.castor.mapping.json@6.0.4=net/sf/jasperreports/data/json/JsonDataAdapterImpl-630.xml +net.sf.jasperreports.extension.castor.mapping.json@6.3.1=net/sf/jasperreports/data/json/JsonDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.mondrian=net/sf/jasperreports/data/mondrian/MondrianDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.provider=net/sf/jasperreports/data/provider/DataSourceProviderDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.qe=net/sf/jasperreports/data/qe/QueryExecuterDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.xls=net/sf/jasperreports/data/xls/XlsDataAdapterImpl-603.xml +net.sf.jasperreports.extension.castor.mapping.xls@6.0.4=net/sf/jasperreports/data/xls/XlsDataAdapterImpl-610.xml +net.sf.jasperreports.extension.castor.mapping.xls@6.1.1=net/sf/jasperreports/data/xls/XlsDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.xlsx=net/sf/jasperreports/data/xlsx/XlsxDataAdapterImpl-603.xml +net.sf.jasperreports.extension.castor.mapping.xlsx@6.0.4=net/sf/jasperreports/data/xlsx/XlsxDataAdapterImpl-610.xml +net.sf.jasperreports.extension.castor.mapping.xlsx@6.1.1=net/sf/jasperreports/data/xlsx/XlsxDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.remote.xml=net/sf/jasperreports/data/xml/RemoteXmlDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.xml=net/sf/jasperreports/data/xml/XmlDataAdapterImpl-603.xml +net.sf.jasperreports.extension.castor.mapping.xml@6.0.4=net/sf/jasperreports/data/xml/XmlDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.xmla=net/sf/jasperreports/data/xmla/XmlaDataAdapterImpl.xml +net.sf.jasperreports.extension.castor.mapping.repository.data.location=net/sf/jasperreports/data/StandardRepositoryDataLocation.xml +net.sf.jasperreports.extension.castor.mapping.http.data.location=net/sf/jasperreports/data/http/StandardHttpDataLocation.xml + +net.sf.jasperreports.extension.registry.factory.jackson.mapping=net.sf.jasperreports.web.util.JacksonMappingExtensionsRegistryFactory +net.sf.jasperreports.extension.jackson.mapping.undo=net.sf.jasperreports.web.actions.UndoAction +net.sf.jasperreports.extension.jackson.mapping.undoAll=net.sf.jasperreports.web.actions.UndoAllAction +net.sf.jasperreports.extension.jackson.mapping.redo=net.sf.jasperreports.web.actions.RedoAction +net.sf.jasperreports.extension.jackson.mapping.save=net.sf.jasperreports.web.actions.SaveAction +net.sf.jasperreports.extension.jackson.mapping.sort=net.sf.jasperreports.components.headertoolbar.actions.SortAction +net.sf.jasperreports.extension.jackson.mapping.filter=net.sf.jasperreports.components.headertoolbar.actions.FilterAction +net.sf.jasperreports.extension.jackson.mapping.resize=net.sf.jasperreports.components.headertoolbar.actions.ResizeColumnAction +net.sf.jasperreports.extension.jackson.mapping.move=net.sf.jasperreports.components.headertoolbar.actions.MoveColumnAction +net.sf.jasperreports.extension.jackson.mapping.sortica=net.sf.jasperreports.components.sort.actions.SortAction +net.sf.jasperreports.extension.jackson.mapping.filterica=net.sf.jasperreports.components.sort.actions.FilterAction +net.sf.jasperreports.extension.jackson.mapping.editTextElement=net.sf.jasperreports.components.headertoolbar.actions.EditTextElementAction +net.sf.jasperreports.extension.jackson.mapping.hideUnhideColumns=net.sf.jasperreports.components.headertoolbar.actions.HideUnhideColumnsAction +net.sf.jasperreports.extension.jackson.mapping.conditionalFormatting=net.sf.jasperreports.components.headertoolbar.actions.ConditionalFormattingAction +net.sf.jasperreports.extension.jackson.mapping.sortXTabByColumn=net.sf.jasperreports.crosstabs.interactive.SortByColumnAction +net.sf.jasperreports.extension.jackson.mapping.sortXTabRowGroup=net.sf.jasperreports.crosstabs.interactive.SortRowGroupAction +net.sf.jasperreports.extension.jackson.mapping.search=net.sf.jasperreports.web.actions.SearchAction +net.sf.jasperreports.extension.jackson.mapping.saveZoom=net.sf.jasperreports.web.actions.SaveZoomAction + +net.sf.jasperreports.extension.registry.factory.content.type.mapping=net.sf.jasperreports.web.util.ContentTypeMappingExtensionsRegistryFactory +net.sf.jasperreports.extension.content.type.mapping.js=text/javascript; charset=UTF-8 +net.sf.jasperreports.extension.content.type.mapping.css=text/css +net.sf.jasperreports.extension.content.type.mapping.eot=application/vnd.ms-fontobject +net.sf.jasperreports.extension.content.type.mapping.svg=image/svg+xml +net.sf.jasperreports.extension.content.type.mapping.ttf=font/ttf +net.sf.jasperreports.extension.content.type.mapping.woff=font/woff + +net.sf.jasperreports.extension.registry.factory.simple.font.families=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory +net.sf.jasperreports.extension.simple.font.families.default=net/sf/jasperreports/fonts/jasperreports-fonts.xml + +# requirejs modules mappings +net.sf.jasperreports.extension.registry.factory.requirejs.module.mapping=net.sf.jasperreports.web.util.RequirejsModuleMappingExtensionsRegistryFactory +net.sf.jasperreports.extension.requirejs.module.jasperreports-report = net/sf/jasperreports/web/servlets/resources/require/report/jasperreports-report.js +net.sf.jasperreports.extension.requirejs.module.jasperreports-report-processor = net/sf/jasperreports/web/servlets/resources/require/report/jasperreports-report-processor.js +net.sf.jasperreports.extension.requirejs.module.jasperreports-status-checker = net/sf/jasperreports/web/servlets/resources/require/report/jasperreports-status-checker.js +net.sf.jasperreports.extension.requirejs.module.jasperreports-component-registrar = net/sf/jasperreports/web/servlets/resources/require/report/jasperreports-component-registrar.js +net.sf.jasperreports.extension.requirejs.module.jasperreports-event-manager = net/sf/jasperreports/web/servlets/resources/require/util/jasperreports-event-manager.js +net.sf.jasperreports.extension.requirejs.module.jasperreports-loader = net/sf/jasperreports/web/servlets/resources/require/util/jasperreports-loader.js +net.sf.jasperreports.extension.requirejs.module.jasperreports-ajax = net/sf/jasperreports/web/servlets/resources/require/util/jasperreports-ajax.js +net.sf.jasperreports.extension.requirejs.module.jasperreports-url-manager = net/sf/jasperreports/web/servlets/resources/require/util/jasperreports-url-manager.js +net.sf.jasperreports.extension.requirejs.module.jasperreports-viewer = net/sf/jasperreports/web/servlets/resources/require/viewer/jasperreports-viewer.js +net.sf.jasperreports.extension.requirejs.module.jasperreports-utils = net/sf/jasperreports/web/servlets/resources/require/util/jasperreports-utils.js +# jive modules +net.sf.jasperreports.extension.requirejs.module.jive.column = net/sf/jasperreports/components/headertoolbar/resources/require/jive.column.js +net.sf.jasperreports.extension.requirejs.module.jive.table = net/sf/jasperreports/components/headertoolbar/resources/require/jive.table.js +net.sf.jasperreports.extension.requirejs.module.jive = net/sf/jasperreports/components/headertoolbar/resources/require/jive.js +net.sf.jasperreports.extension.requirejs.module.jive.interactive.column = net/sf/jasperreports/components/headertoolbar/resources/require/jive.interactive.column.js +net.sf.jasperreports.extension.requirejs.module.jive.crosstab = net/sf/jasperreports/crosstabs/interactive/jive.crosstab.js +net.sf.jasperreports.extension.requirejs.module.jive.crosstab.interactive = net/sf/jasperreports/crosstabs/interactive/jive.crosstab.interactive.js +net.sf.jasperreports.extension.requirejs.module.jive.crosstab.templates = net/sf/jasperreports/crosstabs/interactive/jive.crosstab.templates +# sort component modules +net.sf.jasperreports.extension.requirejs.module.jive.sort = net/sf/jasperreports/components/sort/resources/jive.sort.js +net.sf.jasperreports.extension.requirejs.module.jive.interactive.sort = net/sf/jasperreports/components/sort/resources/jive.interactive.sort.js +# map component modules +net.sf.jasperreports.extension.requirejs.module.jasperreports-map = net/sf/jasperreports/components/map/resources/require/jasperreports-map.js + +# require modules loaded through the text plugin and handled by webresourcehandlers +net.sf.jasperreports.extension.requirejs.module.jive.i18n = jive.i18n +net.sf.jasperreports.extension.requirejs.module.jive.vm = jive.vm +net.sf.jasperreports.extension.requirejs.module.jive.sort.vm = jive.sort.vm +net.sf.jasperreports.extension.requirejs.module.jive.templates = jive.templates +net.sf.jasperreports.extension.requirejs.module.jive.filterDialog = jive.filterDialog +net.sf.jasperreports.extension.requirejs.module.jive.crosstab.templates.styles = jive.crosstab.templates.styles + +net.sf.jasperreports.extension.registry.factory.jive.web.resource.handlers=net.sf.jasperreports.web.util.WebResourceHandlersExtensionRegistryFactory + +net.sf.jasperreports.extension.registry.factory.matcher.exporter.filter.mapping=net.sf.jasperreports.engine.export.MatcherExportFilterMappingExtensionsRegistryFactory +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.html.includes=net.sf.jasperreports.components.table.header.icon.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.html.excludes=net.sf.jasperreports.components.table.header.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.pdf.includes=net.sf.jasperreports.components.table.header.icon.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.pdf.excludes=net.sf.jasperreports.components.table.header.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.graphics2d.includes=net.sf.jasperreports.components.table.header.icon.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.graphics2d.excludes=net.sf.jasperreports.components.table.header.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.docx.includes=net.sf.jasperreports.components.table.header.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.docx.excludes=net.sf.jasperreports.components.table.header.icon.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.xlsx.includes=net.sf.jasperreports.components.table.header.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.xlsx.excludes=net.sf.jasperreports.components.table.header.icon.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.pptx.includes=net.sf.jasperreports.components.table.header.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.pptx.excludes=net.sf.jasperreports.components.table.header.icon.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.xls.includes=net.sf.jasperreports.components.table.header.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.xls.excludes=net.sf.jasperreports.components.table.header.icon.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.jxl.includes=net.sf.jasperreports.components.table.header.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.jxl.excludes=net.sf.jasperreports.components.table.header.icon.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.rtf.includes=net.sf.jasperreports.components.table.header.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.rtf.excludes=net.sf.jasperreports.components.table.header.icon.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.odt.includes=net.sf.jasperreports.components.table.header.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.odt.excludes=net.sf.jasperreports.components.table.header.icon.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.ods.includes=net.sf.jasperreports.components.table.header.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.ods.excludes=net.sf.jasperreports.components.table.header.icon.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.csv.includes=net.sf.jasperreports.components.table.header.label +net.sf.jasperreports.extension.matcher.export.filter.net.sf.jasperreports.csv.excludes=net.sf.jasperreports.components.table.header.icon.label diff -Nru jasperreports-6.2.2/jasperreports/src/jasperreports_messages.properties jasperreports-6.3.1/jasperreports/src/jasperreports_messages.properties --- jasperreports-6.2.2/jasperreports/src/jasperreports_messages.properties 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/jasperreports_messages.properties 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,560 @@ +# chart error messages +net.sf.jasperreports.exception.charts.category.dataset.series.null.name=Category series name is null. +net.sf.jasperreports.exception.charts.chart.type.not.supported=Chart type {0} not supported. +net.sf.jasperreports.exception.charts.chart.type.unsupported=Chart type not supported. +net.sf.jasperreports.exception.charts.customizer.instance.error=Could not create chart customizer instance. +net.sf.jasperreports.exception.charts.high.low.dataset.series.null.close.value=Close value is null in high-low series. +net.sf.jasperreports.exception.charts.high.low.dataset.series.null.date.value=Date value is null in high-low series. +net.sf.jasperreports.exception.charts.high.low.dataset.series.null.high.value=High value is null in high-low series. +net.sf.jasperreports.exception.charts.high.low.dataset.series.null.low.value=Low value is null in high-low series. +net.sf.jasperreports.exception.charts.high.low.dataset.series.null.open.value=Open value is null in high-low series. +net.sf.jasperreports.exception.charts.high.low.dataset.series.null.volume.value=Volume value is null in high-low series. +net.sf.jasperreports.exception.charts.multiaxis.plot.not.supported=MultiAxis charts only support Category and XY plots. +net.sf.jasperreports.exception.charts.multiaxis.plot.types.mix.not.allowed=You can not mix plot types in a MultiAxisChart. +net.sf.jasperreports.exception.charts.pie.dataset.duplicated.key=Key {0} is duplicated in pie dataset. +net.sf.jasperreports.exception.charts.pie.dataset.null.key=Key is null in pie dataset. +net.sf.jasperreports.exception.charts.thermometer.plot.invalid.value.location=Invalid thermometer value location: {0}. +net.sf.jasperreports.exception.charts.time.period.dataset.series.null.name=Time period series name is null. +net.sf.jasperreports.exception.charts.time.series.dataset.series.null.name=Time series name is null. +net.sf.jasperreports.exception.charts.util.chart.theme.not.found=Chart theme "{0}" not found. +net.sf.jasperreports.exception.charts.util.renderer.factory.not.specified=No chart renderer factory specified for "{0}" render type. +net.sf.jasperreports.exception.charts.xyz.dataset.series.null.name=XYZ series name is null. + +# compiler error messages +net.sf.jasperreports.exception.compilers.beanshell.expressions.evaluating.error=Error evaluating report expressions BeanShell script.\nMessage : {0}\nLine {1} : {2}. +net.sf.jasperreports.exception.compilers.beanshell.expressions.testing.error=Error testing report expressions BeanShell script.\nMessage : {0}\nLine {1} : {2}. +net.sf.jasperreports.exception.compilers.beanshell.initializing.report.calculator=Error initializing report BeanShell calculator. +net.sf.jasperreports.exception.compilers.compiling.expressions.class.file=Errors were encountered when compiling report expressions class file: {0}. +net.sf.jasperreports.exception.compilers.crosstab.id.not.found=Crosstab ID not found. +net.sf.jasperreports.exception.compilers.design.compile.error=Error compiling report design. +net.sf.jasperreports.exception.compilers.expression.class.not.loaded=Error loading expression class: {0}. +net.sf.jasperreports.exception.compilers.groovy.function.not.found=Function {0} not found. +net.sf.jasperreports.exception.compilers.groovy.too.few.classes.generated=Too few groovy class were generated. +net.sf.jasperreports.exception.compilers.groovy.too.many.classes.generated=Too many groovy classes were generated.\nPlease make sure that you don''t use Groovy features such as closures that are not supported by this report compiler.\n +net.sf.jasperreports.exception.compilers.invalid.data.type=Invalid compile data type: {0}. +net.sf.jasperreports.exception.compilers.java.source.compile.error=Error compiling report java source files: {0}. +net.sf.jasperreports.exception.compilers.javascript.expression.not.found=No expression for id {0}. +net.sf.jasperreports.exception.compilers.javascript.evaluator.load.error=Unable to load class {0}. +net.sf.jasperreports.exception.compilers.javascript.instance.error=Failed to instantiate script class {0}. +net.sf.jasperreports.exception.compilers.javascript.load.error=Failed to load script class {0}. +net.sf.jasperreports.exception.compilers.javascript.too.many.expressions=Too many expressions in report. +net.sf.jasperreports.exception.compilers.javascript.unexpected.class.name=Unexpected compiled class name {0}, expecting {1}. +net.sf.jasperreports.exception.compilers.javascript.unexpected.classes.length=Unexpected compiled classes length {0}. +net.sf.jasperreports.exception.compilers.jdt.class.loading.error=Not able to load JDT classes. +net.sf.jasperreports.exception.compilers.jdt.method.invoking.error=Error invoking JDT methods. +net.sf.jasperreports.exception.compilers.jdt.method.resolving.error=Error resolving JDT methods. +net.sf.jasperreports.exception.compilers.jdt.name.environment.answer.instance.error=Not able to create NameEnvironmentAnswer. +net.sf.jasperreports.exception.compilers.language.expected.java=Language "{0}" not supported by this report compiler.\nExpecting "{1}" instead. +net.sf.jasperreports.exception.compilers.language.not.supported=Language "{0}" not supported by this report compiler.\nExpecting "{1}" or "{2}" instead. +net.sf.jasperreports.exception.compilers.report.expressions.compile.error=Errors were encountered when compiling report expressions class file:\n{0}. +net.sf.jasperreports.exception.compilers.temp.dir.not.found=Temporary directory not found: {0}. + +# components error messages +net.sf.jasperreports.exception.components.barbecue.barcode.provider.not.found=No barcode provider for type {0}. +net.sf.jasperreports.exception.components.barbecue.error.creating.barcode=Error creating barcode. +net.sf.jasperreports.exception.components.barcode4j.error.correction.level.unknown.name=Unknown error correction level name {0}. +net.sf.jasperreports.exception.components.bundle.not.registered=No components bundle registered for namespace {0}. +net.sf.jasperreports.exception.components.component.manager.not.found=No component manager found for name {0}, namespace {1}. +net.sf.jasperreports.exception.components.map.address.request.failed=Address request failed (see status: {0}). +net.sf.jasperreports.exception.components.map.invalid.address.coordinates=Invalid coordinates geocoded from address; latitude: {0}; longitude: {1}. +net.sf.jasperreports.exception.components.map.missing.coordinates=The value for {0} property is missing and no address was provided either. +net.sf.jasperreports.exception.components.map.null.or.empty.value.not.allowed=Null or empty value is not allowed for {0} item property. +net.sf.jasperreports.exception.components.map.null.or.empty.values.not.allowed=Null or empty values are not allowed for {0} and {1} item properties. +net.sf.jasperreports.exception.components.spiderchart.category.dataset.series.null.name=Category series name is null. +net.sf.jasperreports.exception.components.spiderchart.customizer.instance.error=Could not create chart customizer instance. +net.sf.jasperreports.exception.components.table.cannot.locate.object=Cannot locate TableComponent object on the digester stack. +net.sf.jasperreports.exception.components.table.unsupported.report.data.type=Unsupported compiled report data of type {0}. + +# convert error messages +net.sf.jasperreports.exception.convert.report.converter.circular.dependency.found=Circular dependency found for template at location {0}. + +# crosstabs error messages +net.sf.jasperreports.exception.crosstabs.bucket.data.processed=Crosstab data has already been processed. +net.sf.jasperreports.exception.crosstabs.bucket.load.error=Could not load bucket value class. +net.sf.jasperreports.exception.crosstabs.bucket.measure.limit=Crosstab bucket/measure limit ({0}) exceeded. +net.sf.jasperreports.exception.crosstabs.bucketing.service.error=Could not create bucketing service. +net.sf.jasperreports.exception.crosstabs.calculation.data.not.processed=Crosstab data needs to be processed first. +net.sf.jasperreports.exception.crosstabs.calculation.found.objects.with.same.rank=Arbitrary rank comparator found two objects with the same rank. +net.sf.jasperreports.exception.crosstabs.calculation.rank.comparator.overflow=Arbitrary rank comparator has overflowed. +net.sf.jasperreports.exception.crosstabs.calculation.two.total.keys.in.same.list=Two total keys in the same list. +net.sf.jasperreports.exception.crosstabs.calculation.unsupported.order.type=Unsupported order type {0}. +net.sf.jasperreports.exception.crosstabs.dataset.incrementing.error=Error incrementing crosstab dataset. +net.sf.jasperreports.exception.crosstabs.design.column.group.does.not.exist=Column group {0} does not exist. +net.sf.jasperreports.exception.crosstabs.design.duplicate.cell=Duplicate cell in crosstab. +net.sf.jasperreports.exception.crosstabs.design.duplicate.group.or.measure=A group or measure having the same name already exists in the crosstab. +net.sf.jasperreports.exception.crosstabs.design.duplicate.parameter=Duplicate declaration of parameter: {0}. +net.sf.jasperreports.exception.crosstabs.design.row.group.does.not.exist=Row group {0} does not exist. +net.sf.jasperreports.exception.crosstabs.evaluation.type.not.supported=The crosstab evaluator doesn''t support old or estimated expression evaluation. +net.sf.jasperreports.exception.crosstabs.evaluator.loading.error=Could not load evaluator for crosstab. +net.sf.jasperreports.exception.crosstabs.infinite.loop=Crosstab has not printed anything on 3 consecutive pages, likely infinite loop. +net.sf.jasperreports.exception.crosstabs.measure.incrementer.class.load.error=Could not load measure incrementer class. +net.sf.jasperreports.exception.crosstabs.measure.percentage.calculator.class.load.error=Could not load measure percentage calculator class. +net.sf.jasperreports.exception.crosstabs.measure.value.class.load.error=Could not load measure value class. +net.sf.jasperreports.exception.crosstabs.not.enough.space=Not enough space to render the crosstab. +net.sf.jasperreports.exception.crosstabs.percentage.calculator.class.not.specified=Measure with type {0} should specify a percentage calculator class. +net.sf.jasperreports.exception.crosstabs.percentage.calculator.instance.error=Error while creating percentage calculator instance of {0}. + +# data source error messages +net.sf.jasperreports.exception.data.adapter.service.factory.not.registered=No data adapter service factory registered for the "{0}" data adapter. +net.sf.jasperreports.exception.data.array.list.field.not.found=Field "{0}" not found in data source. +net.sf.jasperreports.exception.data.bean.constructor.argument.cannot.be.null=Constructor argument {0} must not be null. +net.sf.jasperreports.exception.data.bean.field.value.not.retrieved=Error retrieving field value from bean: {0}. +net.sf.jasperreports.exception.data.bean.invalid.return.type=Factory method must return Collection or Object[] not: {0}. +net.sf.jasperreports.exception.data.cache.invalid.snapshot.field.type=Field {0} of type {1} has snapshot value of type {2}. +net.sf.jasperreports.exception.data.cache.no.such.snapshot.field=Field {0} not present in data snapshot. +net.sf.jasperreports.exception.data.cache.snapshot.cannot.be.persisted=The data snapshot cannot be persisted. +net.sf.jasperreports.exception.data.common.cannot.convert.field.type=Field "{0}" is of class {1} and can not be converted. +net.sf.jasperreports.exception.data.common.cannot.modify.properties.after.start=Cannot modify data source properties after data reading has started. +net.sf.jasperreports.exception.data.common.unknown.column.name=Unknown column name: {0}. +net.sf.jasperreports.exception.data.common.unknown.number.type=Unknown number class: {0}. +net.sf.jasperreports.exception.data.common.xml.node.not.available=No node available. Iterate or rewind the data source. +net.sf.jasperreports.exception.data.common.xml.null.document=Document cannot be null. +net.sf.jasperreports.exception.data.common.xml.null.select.expression=Select expression cannot be null. +net.sf.jasperreports.exception.data.csv.cannot.find.source=Cannot find a source to read the data from. +net.sf.jasperreports.exception.data.csv.field.value.not.retrieved=Unable to get value for CSV field "{0}" of class {1}. +net.sf.jasperreports.exception.data.csv.malformed.quoted.field=Malformed quoted field: {0}. +net.sf.jasperreports.exception.data.csv.misplaced.quote=Misplaced quote found at position {0} in row {1}. +net.sf.jasperreports.exception.data.csv.no.more.chars=No more chars. +net.sf.jasperreports.exception.data.ds.invalid.object.returned=Method {0} in {1} class does not return a JRDataSource object. +net.sf.jasperreports.exception.data.hibernate.field.alias.type.mismatch=The field alias "{0}" type should be an entity or a component. +net.sf.jasperreports.exception.data.hibernate.many.fields.detected=The HQL query returns only one non-entity and non-component result but there are more than one fields. +net.sf.jasperreports.exception.data.hibernate.no.field.alias=The HQL query does not have a "{0}" alias. +net.sf.jasperreports.exception.data.hibernate.no.field.reader=No field reader for {0}. +net.sf.jasperreports.exception.data.hibernate.unknown.return.alias=Unknown HQL return alias "{0}". +net.sf.jasperreports.exception.data.http.no.http.url.set=No HTTP URL set. +net.sf.jasperreports.exception.data.http.no.response=No response entity. +net.sf.jasperreports.exception.data.http.status.code.error=Response has status code {0}. +net.sf.jasperreports.exception.data.http.unknown.request.method=Unknown request method {0}. +net.sf.jasperreports.exception.data.jdbc.password.required=This service implementation needs the password to be saved in the data adapter. +net.sf.jasperreports.exception.data.jpa.index.out.of.bounds=Index {0} out of bounds for query result of length {1}. +net.sf.jasperreports.exception.data.json.field.value.not.retrieved=Unable to get value for JSON field "{0}" of class {1}. +net.sf.jasperreports.exception.data.json.invalid.attribute.selection=Invalid attribute selection expression: {0}. +net.sf.jasperreports.exception.data.json.invalid.expression=Invalid expression: {0}; current token {1} not ended properly. +net.sf.jasperreports.exception.data.json.no.data=No JSON data to operate on! +net.sf.jasperreports.exception.data.olap.axis.not.found=No such axis: "{0}". +net.sf.jasperreports.exception.data.olap.axis.not.found.in.result=OLAP result doesn''t contain Axis({0}). +net.sf.jasperreports.exception.data.olap.cannot.convert.field.type=Field "{0}" is of class {1} and can not be converted to class {2}. +net.sf.jasperreports.exception.data.olap.cannot.convert.string.value.type=Field "{0}", string value "{1}" is of class {2} and can not be converted to class {3}. +net.sf.jasperreports.exception.data.olap.cell.calculation.error=OLAP cell calculation returned error. +net.sf.jasperreports.exception.data.olap.dimension.not.found=Could not find dimension "{0}" on axis {1}. +net.sf.jasperreports.exception.data.olap.field.value.not.retrieved=Unable to get value for OLAP field "{0}" of class {1}. +net.sf.jasperreports.exception.data.olap.incorrect.data.mapping=Incorrect data mapping: the number of positions doesn''t match the number of axes. +net.sf.jasperreports.exception.data.olap.internal.error=Internal error. +net.sf.jasperreports.exception.data.olap.missing.field.mapping=Missing field mapping for field "{0}". +net.sf.jasperreports.exception.data.olap.invalid.field.mapping=Invalid field mapping "{0}". +net.sf.jasperreports.exception.data.olap.level.not.found=Could not find level "{0}" on hierarchy #{1} (dimension {2}) on axis #{3}. +net.sf.jasperreports.exception.data.olap.tuple.not.found=No such tuple {0} on axis {1}. +net.sf.jasperreports.exception.data.olap.xmla.axis.positions.number.error=Number of axis positions ({0}) doesn''t match the number of axes ({1}). +net.sf.jasperreports.exception.data.olap.xmla.cannot.retrieve.element=Could not retrieve {0} Element. +net.sf.jasperreports.exception.data.olap.xmla.invalid.dimension.hierarchy=Invalid [Dimension].[Hierarchy]: {0} +net.sf.jasperreports.exception.data.olap.xmla.message.call.failed=Message-Call failed. +net.sf.jasperreports.exception.data.olap.xmla.no.level.name=No level name for: {0}. +net.sf.jasperreports.exception.data.olap.xmla.null.element={0} Element is null. +net.sf.jasperreports.exception.data.result.set.clob.value.read.failure=Unable to read clob value from result set. +net.sf.jasperreports.exception.data.result.set.column.index.out.of.range=Column index out of range in result set: {0}. +net.sf.jasperreports.exception.data.result.set.field.value.not.retrieved=Unable to get value for result set field "{0}" of class {1}. +net.sf.jasperreports.exception.data.result.set.metadata.not.retrieved=Unable to retrieve result set metadata. +net.sf.jasperreports.exception.data.result.set.next.record.not.retrieved=Unable to get next record from result set. +net.sf.jasperreports.exception.data.result.set.unknown.column.name=Unknown column name {0} in result set. +net.sf.jasperreports.exception.data.result.set.unknown.column.label=Unknown column label {0} in result set. +net.sf.jasperreports.exception.data.sortable.sort.field.not.found=Sort field "{0}" not found in the list of data source fields. +net.sf.jasperreports.exception.data.sorted.field.not.found=Field "{0}" not found in data source. +net.sf.jasperreports.exception.data.source.collection.method.call.error=getFieldValue(...) called on a data source with no records. +net.sf.jasperreports.exception.data.table.model.unknown.column.name=Unknown column name: {0}. +net.sf.jasperreports.exception.data.xmla.connection=Error creating XMLA connection. +net.sf.jasperreports.exception.data.xls.column.names.mismatch.column.indexes=The number of column names must be equal to the number of column indexes. +net.sf.jasperreports.exception.data.xls.field.value.not.retrieved=Unable to get value for Excel field "{0}" of class {1}. +net.sf.jasperreports.exception.data.xls.sheet.index.out.of.range=Sheet index {0} is out of range: [0..{1}]. +net.sf.jasperreports.exception.data.xls.sheet.not.found=Sheet "{0}" not found in workbook. + +# date range error messages +net.sf.jasperreports.exception.date.range.equal.clause.db.column.token.missing=SQL EQUAL clause missing DB column token. +net.sf.jasperreports.exception.date.range.equal.clause.parameter.token.missing=SQL EQUAL clause missing parameter token. +net.sf.jasperreports.exception.date.range.invalid.expression=Invalid date range expression: {0}. +net.sf.jasperreports.exception.date.range.unexpected.parameter.type=Parameter {0} in clause {1} is not a date range. +net.sf.jasperreports.exception.date.range.unknown.clause.id=Unknown clause Id {0} for date range. +net.sf.jasperreports.exception.date.range.unsupported.parameter.type=Parameter {0} in clause {1} has unsupported type {2}. + +# design error messages +net.sf.jasperreports.exception.design.compile.data.for.crosstab.not.found=Compile data for crosstab not found in the report. +net.sf.jasperreports.exception.design.compile.data.for.dataset.not.found=Compile data for dataset {0} not found in the report. +net.sf.jasperreports.exception.design.dataset.duplicate.group=Duplicate declaration of group: {0}. +net.sf.jasperreports.exception.design.dataset.duplicate.field=Duplicate declaration of field: {0}. +net.sf.jasperreports.exception.design.dataset.duplicate.parameter=Duplicate declaration of parameter: {0}. +net.sf.jasperreports.exception.design.dataset.duplicate.scriptlet=Duplicate declaration of scriptlet: {0}. +net.sf.jasperreports.exception.design.dataset.duplicate.sort.field=Duplicate declaration of sort field: {0}. +net.sf.jasperreports.exception.design.dataset.duplicate.variable=Duplicate declaration of variable: {0}. +net.sf.jasperreports.exception.design.dataset.run.duplicate.parameter=Duplicate declaration of dataset parameter: {0}. +net.sf.jasperreports.exception.design.dataset.unknown.builtin.parameter.type=Unknown built-in parameter type {0} of class {1}. Expecting java.lang.Class or java.lang.String. +net.sf.jasperreports.exception.design.duplicate.dataset=Duplicate declaration of dataset: {0}. +net.sf.jasperreports.exception.design.duplicate.report.style=Duplicate declaration of report style: {0}. +net.sf.jasperreports.exception.design.subreport.duplicate.parameter=Duplicate declaration of subreport parameter: {0}. + +# engine error messages +net.sf.jasperreports.exception.engine.analytics.dataset.bucket.load.error=Could not load bucket value class. +net.sf.jasperreports.exception.engine.analytics.dataset.cannot.create.bucketing.service=Could not create bucketing service. +net.sf.jasperreports.exception.engine.analytics.dataset.cannot.translate.none=Cannot translate NONE to SortOrderEnum. +net.sf.jasperreports.exception.engine.analytics.dataset.data.axis.level.not.specified=Data axis level needs to be specified. +net.sf.jasperreports.exception.engine.analytics.dataset.duplicate.axis=Axis {0} already exists. +net.sf.jasperreports.exception.engine.analytics.dataset.increment.bidimensional.dataset.error=Error incrementing bidimensional dataset. +net.sf.jasperreports.exception.engine.analytics.dataset.measure.incrementer.load.error=Could not load measure incrementer class. +net.sf.jasperreports.exception.engine.analytics.dataset.measure.value.load.error=Could not load measure value class. +net.sf.jasperreports.exception.engine.analytics.dataset.unknown.axis=Unknown axis {0}. +net.sf.jasperreports.exception.engine.analytics.dataset.unknown.order.enum=Unknown order enum {0}. +net.sf.jasperreports.exception.engine.context.default.properties.file.not.found=Default properties file not found. +net.sf.jasperreports.exception.engine.context.load.default.properties.failure=Failed to load default properties. +net.sf.jasperreports.exception.engine.context.load.properties.failure=Error loading the properties. +net.sf.jasperreports.exception.engine.context.load.properties.file.failure=Could not load properties file "{0}". +net.sf.jasperreports.exception.engine.expression.collector.expression.not.found=Expression "{0}" not found with id {1}. +net.sf.jasperreports.exception.engine.expression.collector.two.generated.ids=Expression "{0}" has two generated IDs. +net.sf.jasperreports.exception.engine.fonts.null.font=The "{0}" font face in family "{1}" returns a null font. +net.sf.jasperreports.exception.engine.hyperlink.target.byte.constant.used=Custom hyperlink targets cannot be specified using the byte constant. +net.sf.jasperreports.exception.engine.hyperlink.type.byte.constant.used=Custom hyperlink types cannot be specified using the byte constant. +net.sf.jasperreports.exception.engine.hyperlink.unknown.hyperlink.target=Unknown hyperlink target: {0}. +net.sf.jasperreports.exception.engine.hyperlink.unknown.hyperlink.type=Unknown hyperlink type: {0}. +net.sf.jasperreports.exception.engine.instantiate.report.compiler.failure=Could not instantiate report compiler: {0}. +net.sf.jasperreports.exception.engine.jasper.print.duplicate.style=Duplicate declaration of report style: {0}. +net.sf.jasperreports.exception.engine.load.properties.failure=Error loading the properties. +net.sf.jasperreports.exception.engine.load.properties.file.failure=Failed to load properties file "{0}". +net.sf.jasperreports.exception.engine.object.factory.crosstab.id.not.found=Crosstab ID not found. +net.sf.jasperreports.exception.engine.object.factory.expression.id.not.found=Expression ID not found for expression <<{0}>>. +net.sf.jasperreports.exception.engine.part.components.bundle.not.registered=No part components bundle registered for namespace {0}. +net.sf.jasperreports.exception.engine.part.component.manager.not.found=No component manager found for name {0}, namespace {1}. +net.sf.jasperreports.exception.engine.part.invalid.evaluation.type=Invalid evaluation type: {0}. +net.sf.jasperreports.exception.engine.part.invalid.simple.evaluation.type=Invalid simple evaluation type: {0}. +net.sf.jasperreports.exception.engine.part.queue.cannot.remove.head.part=Cannot remove head part. +net.sf.jasperreports.exception.engine.part.queue.cannot.replace.head.part=Cannot replace head part. +net.sf.jasperreports.exception.engine.print.image.area.circle.coordinates.error=A circle must have exactly 4 coordinates. +net.sf.jasperreports.exception.engine.print.image.area.polygon.coordinates.error=A polygon must have an even number of coordinates. +net.sf.jasperreports.exception.engine.print.image.area.rectangle.coordinates.error=A rectangle must have exactly 4 coordinates. +net.sf.jasperreports.exception.engine.print.image.area.unknown.html.shape=Unknown HTML image area shape: {0}. +net.sf.jasperreports.exception.engine.print.image.area.unknown.shape=Unknown image area shape: {0}. +net.sf.jasperreports.exception.engine.renderable.util.image.error=Image error. +net.sf.jasperreports.exception.engine.renderable.must.implement.interface=Class {0} must implement at least one of the following interfaces: {1}. +net.sf.jasperreports.exception.engine.renderable.svg.dimension.must.override=Class {0} must override the JRAbstractSvgRenderer.getDimension(JasperReportsContext) method. +net.sf.jasperreports.exception.engine.renderable.svg.dimension.null.not.allowed=Null dimension is not allowed by this SVG renderer implementation. +net.sf.jasperreports.exception.engine.report.compiler.class.not.found=Report compiler class not found: {0}. +net.sf.jasperreports.exception.engine.report.compiler.not.set=No report compiler set for language: {0}. +net.sf.jasperreports.exception.engine.style.circular.dependency=Circular dependency detected for style {0}. +net.sf.jasperreports.exception.engine.template.duplicate.template.style=Duplicate declaration of template style: {0}. +net.sf.jasperreports.exception.engine.virtualization.input.read.object.failed=Failed to read object. +net.sf.jasperreports.exception.engine.virtualization.output.unsupported.reference.type=Unsupported reference type: {0}. +net.sf.jasperreports.exception.engine.virtualization.serializable.serializer.class.instance.error=Failed to instantiate class {0}. +net.sf.jasperreports.exception.engine.virtualization.serializable.serializer.initialization.failed=Failed to initialize virtualization of serializable class {0}. +net.sf.jasperreports.exception.engine.virtualization.serializable.serializer.unexpected.value.type=Unexpected value {0} of type {1}, expecting {2}. +net.sf.jasperreports.exception.engine.virtualization.unexpected.boolean.byte.value=Unexpected boolean byte value: {0}. +net.sf.jasperreports.exception.engine.virtualization.unknown.evaluation.time=Unknown evaluation time: {0}. +net.sf.jasperreports.exception.engine.virtualization.utils.invalid.int.byte.read=Invalid int byte read: {0}. + +# export error messages +net.sf.jasperreports.exception.export.common.end.page.index.out.of.range=End page index out of range: {1} ({0}: {2}) +net.sf.jasperreports.exception.export.common.grid.cell.not.frame.element=Element at address {0} is not a frame. +net.sf.jasperreports.exception.export.common.handlers.not.found.for.namespace=No generic element handlers found for namespace {0}. +net.sf.jasperreports.exception.export.common.handlers.not.found.for.type=No handlers for generic elements of type {0}#{1}. +net.sf.jasperreports.exception.export.common.invalid.image.name=Invalid image name: {0}. +net.sf.jasperreports.exception.export.common.invalid.zoom.ratio=Invalid zoom ratio: {0}. +net.sf.jasperreports.exception.export.common.mixed.calls.not.allowed=Can''t mix deprecated JRParameter API calls with new exporter configuration API calls. +net.sf.jasperreports.exception.export.common.output.writer.error=Error writing to output writer: {0}. +net.sf.jasperreports.exception.export.common.page.index.out.of.range=Page index out of range: {0} of {1}. +net.sf.jasperreports.exception.export.common.process.interrupted=Report export process interrupted. +net.sf.jasperreports.exception.export.common.properties.empty.string.default.not.supported=Export property {0} must have non empty string as default value, otherwise it must be declared as having null default value. +net.sf.jasperreports.exception.export.common.properties.type.not.supported=Export property type {0} not supported. +net.sf.jasperreports.exception.export.common.start.page.index.out.of.range=Start page index out of range: {0} of {1}. + +net.sf.jasperreports.exception.export.docx.column.count.out.of.range=Column number {0} out of range: the DOCX format does not support more than 63 columns in a table. + +net.sf.jasperreports.exception.export.filter.excluded.null.keys.set=The excluded keys set is null. +net.sf.jasperreports.exception.export.filter.factory.class.instance.failure=Error instantiating class {0}. +net.sf.jasperreports.exception.export.filter.factory.class.not.found=Class {0} not found. +net.sf.jasperreports.exception.export.filter.null.filters.list=Null filters list. + +net.sf.jasperreports.exception.export.html.internal.error=Internal error. +net.sf.jasperreports.exception.export.html.resources.directory.not.specified=The resources directory was not specified for the exporter. +net.sf.jasperreports.exception.export.html.unexpected.rotation.value=Unexpected rotation value {0}. + +net.sf.jasperreports.exception.export.json.invalid.json.object=Invalid JSON object provided! +net.sf.jasperreports.exception.export.json.invalid.json.object.array.found=Invalid JSON object provided: expected object, received array! +net.sf.jasperreports.exception.export.json.invalid.json.object.semantic=Invalid JSON object provided: semantically invalid! + +net.sf.jasperreports.exception.export.parameters.empty.input.source.in.batch.mode=Empty input source supplied to the exporter in batch mode. +net.sf.jasperreports.exception.export.parameters.graphics2d.no.output.specified=No output specified for the exporter; java.awt.Graphics2D object expected. +net.sf.jasperreports.exception.export.parameters.no.input.source=No input source supplied to the exporter. +net.sf.jasperreports.exception.export.parameters.no.output.specified=No output specified for the exporter. + +net.sf.jasperreports.exception.export.pdf.document.error=PDF Document error: {0}. +net.sf.jasperreports.exception.export.pdf.font.loading.error=Could not load the following font: \npdfFontName: {0}\npdfEncoding: {1}\nisPdfEmbedded : {2} +net.sf.jasperreports.exception.export.pdf.report.generation.error=Error generating PDF report: {0}. + +net.sf.jasperreports.exception.export.print.service.not.found=No suitable print service found. + +net.sf.jasperreports.exception.export.rtf.invalid.text.height=Invalid text height. + +net.sf.jasperreports.exception.export.tabulator.dimension.end.out.of.range=Out of range end value: {0}. +net.sf.jasperreports.exception.export.tabulator.dimension.start.out.of.range=Out of range start value: {0}. +net.sf.jasperreports.exception.export.tabulator.dropping.parent.error=Internal error while dropping parent. + +net.sf.jasperreports.exception.export.text.character.height.negative=Character height in pixels must be greater than zero. +net.sf.jasperreports.exception.export.text.character.width.negative=Character width in pixels must be greater than zero. +net.sf.jasperreports.exception.export.text.required.positive.page.or.character.height=Character height in pixels or page height in characters must be specified and must be greater than zero. +net.sf.jasperreports.exception.export.text.required.positive.page.or.character.width=Character width in pixels or page width in characters must be specified and must be greater than zero. + +net.sf.jasperreports.exception.export.xls.common.cannot.add.cell=The cell cannot be added. +net.sf.jasperreports.exception.export.xls.common.cannot.merge.cells=Cannot merge cells. +net.sf.jasperreports.exception.export.xls.common.cell.format.template.error=Error setting cellFormat template. +net.sf.jasperreports.exception.export.xls.common.column.index.beyond.limit=The 0-based column index {0} is beyond {1} limit. +net.sf.jasperreports.exception.export.xls.common.loaded.fonts.error=Can''t get loaded fonts. +net.sf.jasperreports.exception.export.xls.common.negative.column.index=Negative column index {0} is not allowed. +net.sf.jasperreports.exception.export.xls.common.report.generation.error=Error generating Excel report: {0}. +net.sf.jasperreports.exception.export.xls.common.template.not.found=Workbook template not found at: {0}. + +net.sf.jasperreports.exception.export.xls.current.sheet.too.many.rows=There are too many rows in the current sheet. +net.sf.jasperreports.exception.export.xls.sheet.too.many.rows=Too many rows in sheet {0}: {1}. + +net.sf.jasperreports.exception.export.xlsx.macro.template.not.found=Macro template not found at: {0}. + +net.sf.jasperreports.exception.export.xml.embedding.image.error=Error embedding image into XML. +net.sf.jasperreports.exception.export.xml.report.style.not.found=Referenced report style not found: {0}. +net.sf.jasperreports.exception.export.xml.resources.directory.not.specified=The resources directory was not specified for the exporter. + +net.sf.jasperreports.exception.export.zip.forbidden.method.call=This method should not be called on this type. + +# JasperReports extensions error messages +net.sf.jasperreports.exception.extensions.no.spring.resource.set=No Spring resource property set. +net.sf.jasperreports.exception.extensions.null.extensions.registry=Cannot set a null extensions registry. +net.sf.jasperreports.exception.extensions.spring.resource.not.found=Could not find Spring resource {0} for extensions registry {1}. + +# report filling error messages +net.sf.jasperreports.exception.fill.base.filler.circular.dependency.found=Circular dependency found for template at location {0}. +net.sf.jasperreports.exception.fill.base.filler.no.such.group=No such group {0}. +net.sf.jasperreports.exception.fill.base.filler.external.style.name.not.set=External style name not set. +net.sf.jasperreports.exception.fill.base.filler.unsupported.report.section.type=Unsupported report section type {0}. +net.sf.jasperreports.exception.fill.big.decimal.value.not.supported=Value {0} of type {1} unsupported for BigDecimal conversion. +net.sf.jasperreports.exception.fill.cell.contents.cannot.shrink.contents=Cannot shrink cell contents. +net.sf.jasperreports.exception.fill.chart.theme.unsupported.chart.type=Chart type {0} not supported. +net.sf.jasperreports.exception.fill.clone.pool.cannot.release.clone=Cannot release clone. +net.sf.jasperreports.exception.fill.common.evaluate.expression.error=Error evaluating expression for source text: {0} +net.sf.jasperreports.exception.fill.common.filler.column.header.overflow.infinite.loop=Infinite loop creating new page due to column header overflow. +net.sf.jasperreports.exception.fill.common.filler.infinite.loop.creating.new.page=Infinite loop creating new page. +net.sf.jasperreports.exception.fill.common.filler.page.header.overflow.infinite.loop=Infinite loop creating new page due to page header overflow. +net.sf.jasperreports.exception.fill.common.filler.thread.interrupted=The report filling thread was interrupted. +net.sf.jasperreports.exception.fill.common.filler.unknown.report.section.type=Unknown report section type {0}. +net.sf.jasperreports.exception.fill.dataset.no.such.field=No such field {0}. +net.sf.jasperreports.exception.fill.dataset.no.such.parameter=No such parameter {0}. +net.sf.jasperreports.exception.fill.dataset.no.such.snapshot.data=No snapshot data found for position {0}. +net.sf.jasperreports.exception.fill.dataset.no.such.snapshot.parameter=A value for parameter {0} was not found in the data snapshot. +net.sf.jasperreports.exception.fill.dataset.no.such.variable=No such variable {0}. +net.sf.jasperreports.exception.fill.dataset.sort.field.not.found=Sort field "{0}" not found in dataset. +net.sf.jasperreports.exception.fill.dataset.sort.variable.not.found=Sort variable "{0}" not found in dataset. +net.sf.jasperreports.exception.fill.delayed.fill.actions.element.not.found=Fill element with id {0} not found. +net.sf.jasperreports.exception.fill.evaluator.resource.not.found=Resource not found for key "{0}". +net.sf.jasperreports.exception.fill.function.context.parameter.not.found=No such parameter: {0}. +net.sf.jasperreports.exception.fill.horizontal.list.row.overflow=List row overflowed on 3 consecutive pages, likely infinite loop. +net.sf.jasperreports.exception.fill.image.unknown.source.class=Unknown image source class {0}. +net.sf.jasperreports.exception.fill.object.factory.style.not.found=Style {0} not found +net.sf.jasperreports.exception.fill.object.factory.unresolved.style=Could not resolve style(s): {0}. +net.sf.jasperreports.exception.fill.part.filler.evaluation.group.not.found=Part evaluation group {0} not found. +net.sf.jasperreports.exception.fill.part.filler.unknown.evaluation.time.type=Unknown evaluation time type {0}. +net.sf.jasperreports.exception.fill.part.filler.unsupported.section.type=Unsupported report section type {0}. +net.sf.jasperreports.exception.fill.print.element.maximum.elements.number.reached=Maximum number of elements for {0} reached. +net.sf.jasperreports.exception.fill.report.filling.process.interrupted=Report filling process interrupted. +net.sf.jasperreports.exception.fill.report.template.unknown.template.source=Unknown template source class {0}. +net.sf.jasperreports.exception.fill.return.values.numeric.type.required=Variable {0} must have a numeric type. +net.sf.jasperreports.exception.fill.return.values.source.not.found=Source variable {0} not found for return value {1}. +net.sf.jasperreports.exception.fill.return.values.variable.not.assignable=Variable {0} is not assignable from source variable {1}. +net.sf.jasperreports.exception.fill.subreport.no.rewindable.data.source=The subreport is placed on a non-splitting band, but it does not have a rewindable data source. +net.sf.jasperreports.exception.fill.subreport.parent.no.subreport.runner=No subreport runner set. +net.sf.jasperreports.exception.fill.subreport.parent.unsupported.overflow=Subreport overflowed on a band that does not support overflow. +net.sf.jasperreports.exception.fill.subreport.property.not.set=Property {0} must be set. +net.sf.jasperreports.exception.fill.subreport.return.value.incrementer.class.not.found=Increment class {0} not found. +net.sf.jasperreports.exception.fill.subreport.unknown.source.class=Unknown subreport source class {0}. +net.sf.jasperreports.exception.fill.subreport.unsupported.section.type=Unsupported subreport section type {0}. +net.sf.jasperreports.exception.fill.table.report.field.not.found=Could not find field "{0}". +net.sf.jasperreports.exception.fill.table.report.unknown.child.type=Unknown child type {0}. +net.sf.jasperreports.exception.fill.table.report.unrecognized.filter.expression.type=Unrecognized filter expression type {0}. +net.sf.jasperreports.exception.fill.table.report.variable.not.found=Could not find variable "{0}". +net.sf.jasperreports.exception.fill.text.element.invalid.start.index=Text start index != 0 on keep all text. +net.sf.jasperreports.exception.fill.text.element.missing.markup.processor.factory=No markup processor factory specified for "{0}" markup. +net.sf.jasperreports.exception.fill.thread.report.runner.wait.error=Error encountered while waiting on the report filling thread. +net.sf.jasperreports.exception.fill.thread.subreport.runner.wait.error=Error encountered while waiting on the subreport filling thread. +net.sf.jasperreports.exception.fill.virtualizer.locking.interrupted=Interrupted while locking virtualization context. +net.sf.jasperreports.exception.fill.virtualizer.no.data.found=No data found for object with UID {0}. +net.sf.jasperreports.exception.fill.virtualizer.renderer.not.found.in.context=Renderer {0} not found in virtualization context. +net.sf.jasperreports.exception.fill.virtualizer.store.not.found=No store found for object {0}. +net.sf.jasperreports.exception.fill.virtualizer.template.not.found=Did not find template with id {0}. +net.sf.jasperreports.exception.fill.virtualizer.template.not.found.in.context=Template {0} not found in virtualization context. + +#fonts exceptions +net.sf.jasperreports.exception.fonts.file.writer.error=Error writing to file: {0}. +net.sf.jasperreports.exception.fonts.output.stream.writer.error=Error writing to OutputStream. +net.sf.jasperreports.exception.fonts.error.loading=Error loading font "{0}". + +# governors error messages +net.sf.jasperreports.exception.governors.max.pages.limit.exceeded=Report "{0}" exceeded the limit of {1} maximum pages. +net.sf.jasperreports.exception.governors.timeout.limit.exceeded=Report "{0}" exceeded the timeout limit of {1} milliseconds. + +# parts error messages +net.sf.jasperreports.exception.parts.subreport.unknown.report.print.order=Unknown report print order: {0}. +net.sf.jasperreports.exception.parts.subreport.unknown.report.section.type=Unknown report section type: {0}. + +# printing error messages +net.sf.jasperreports.exception.print.error.printing.report=Error printing report. +net.sf.jasperreports.exception.print.invalid.page.range=Invalid page index range: {0} - {1} of {2}. +net.sf.jasperreports.exception.print.no.available.printer=No printer available. + +# query executer error messages +net.sf.jasperreports.exception.query.between.clause.db.column.token.missing=SQL BETWEEN clause missing DB column token. +net.sf.jasperreports.exception.query.between.clause.left.parameter.token.missing=SQL BETWEEN clause missing left parameter token. +net.sf.jasperreports.exception.query.between.clause.name.token.missing=SQL BETWEEN missing clause name token. +net.sf.jasperreports.exception.query.between.clause.right.parameter.token.missing=SQL BETWEEN clause missing right parameter token. +net.sf.jasperreports.exception.query.clause.circularly.nested.parameter=The query contains circularly nested parameter clauses starting with {0}. +net.sf.jasperreports.exception.query.clause.id.first.token.missing=Query clause ID/first token missing. +net.sf.jasperreports.exception.query.less.greater.clause.db.column.token.missing=SQL LESS/GREATER clause missing DB column token. +net.sf.jasperreports.exception.query.less.greater.clause.name.token.missing=SQL LESS/GREATER missing clause name token. +net.sf.jasperreports.exception.query.less.greater.clause.parameter.token.missing=SQL LESS/GREATER clause missing parameter token. +net.sf.jasperreports.exception.query.clause.not.found=No clause function for id {0} found. +net.sf.jasperreports.exception.query.equal.clause.db.column.token.missing=SQL EQUAL clause missing DB column token. +net.sf.jasperreports.exception.query.equal.clause.parameter.token.missing=SQL EQUAL clause missing parameter token. +net.sf.jasperreports.exception.query.in.clause.db.column.token.missing=SQL IN clause missing DB column token. +net.sf.jasperreports.exception.query.in.clause.invalid.parameter.type=Invalid type {0} for parameter {1} used in an IN clause; the value must be an array or a collection. +net.sf.jasperreports.exception.query.in.clause.parameter.token.missing=SQL IN clause missing parameter token. +net.sf.jasperreports.exception.query.hibernate.unknown.query.run.type=Unknown value for the {0} property. Possible values are {1}, {2} and {3}. +net.sf.jasperreports.exception.query.hibernate.unresolved.type.constant=Could not resolve Hibernate type constant {0} in class {1}. +net.sf.jasperreports.exception.query.mondrian.connection.error=Error loading Mondrian olap4j driver and getting Connection "{0}". +net.sf.jasperreports.exception.query.mondrian.execute.query.error=Error executing query: {0} +net.sf.jasperreports.exception.query.multi.parameters.cannot.contain.null.values=Multi parameters cannot contain null values. +net.sf.jasperreports.exception.query.numeric.type.required=The {0} property must be numerical. +net.sf.jasperreports.exception.query.parameter.not.found=Parameter "{0}" does not exist. +net.sf.jasperreports.exception.query.parameter.type.selector.candidate.type.size.mismatch=Candidate types sizes do not match: {0} vs {1}. +net.sf.jasperreports.exception.query.parameter.type.selector.clause.implementation.not.found=No clause function implementation found for clause {0} and parameter types {1}. +net.sf.jasperreports.exception.query.parameter.type.selector.clause.required.token.not.found=Required token at position {0} for query clause {1} not found. +net.sf.jasperreports.exception.query.statement.cancel.error=Error canceling SQL statement. +net.sf.jasperreports.exception.query.statement.execute.error=Error executing SQL statement for: {0}. +net.sf.jasperreports.exception.query.statement.prepare.error=Error preparing statement for executing the report query:\n\n{0}\n\n +net.sf.jasperreports.exception.query.unexpected.multi.parameter.type=Multi parameter value is not array nor collection. +net.sf.jasperreports.exception.query.unsupported.parameter.type={0} found unsupported query parameter type: {1}. +net.sf.jasperreports.exception.query.xmla.connection.error=Error loading olap4j driver and getting Connection "{0}". +net.sf.jasperreports.exception.query.xmla.execute.query.error=Error executing query: {0} + +# repository error messages +net.sf.jasperreports.exception.repo.byte.data.loading.error=Error loading byte data from: {0}. +net.sf.jasperreports.exception.repo.byte.data.not.found=Byte data not found at: {0}. +net.sf.jasperreports.exception.repo.default.not.implemented=Not implemented. +net.sf.jasperreports.exception.repo.file.not.implemented=Not implemented. +net.sf.jasperreports.exception.repo.input.stream.not.found=Input stream not found at: {0}. +net.sf.jasperreports.exception.repo.invalid.entry=Invalid {0} entry. +net.sf.jasperreports.exception.repo.report.not.found=Report not found at: {0}. +net.sf.jasperreports.exception.repo.resource.not.found=Resource not found at: {0}. + +# scriptlets error messages +net.sf.jasperreports.exception.scriptlets.class.loading.error=Error loading scriptlet class: {0}. +net.sf.jasperreports.exception.scriptlets.field.not.found=Field not found: {0}. +net.sf.jasperreports.exception.scriptlets.instance.loading.error=Error loading scriptlet class instance: {0}. +net.sf.jasperreports.exception.scriptlets.parameter.not.found=Parameter not found: {0}. +net.sf.jasperreports.exception.scriptlets.variable.not.found=Variable not found: {0}. +net.sf.jasperreports.exception.scriptlets.variable.value.incompatible=Incompatible value assigned to variable {0}. Expected {1}. + +# utility classes error messages +net.sf.jasperreports.exception.util.api.writer.output.stream.write.error=Error writing to OutputStream: {0}. +net.sf.jasperreports.exception.util.api.writer.file.write.error=Error writing to file: {0}. +net.sf.jasperreports.exception.util.array.char.iterator.invalid.index=Invalid index {0} (start = {1}, end = {2}) +net.sf.jasperreports.exception.util.boolean.serializer.unknown.data=Unknown boolean data: "{0}". +net.sf.jasperreports.exception.util.castor.mappings.loading.error=Failed to load Castor mappings. +net.sf.jasperreports.exception.util.character.serializer.single.character.expected=Character data "{0}" should be exactly one character long. +net.sf.jasperreports.exception.util.class.instance.error=Could not instantiate class {0}. +net.sf.jasperreports.exception.util.class.loading.error=Could not load class {0}. +net.sf.jasperreports.exception.util.class.unexpected.type=Class {0} does not implement/extend {1}. +net.sf.jasperreports.exception.util.color.invalid.color=Invalid color: {0}. +net.sf.jasperreports.exception.util.concurrent.swap.file.insufficient.data=Unable to read sufficient data from the swap file. +net.sf.jasperreports.exception.util.digest.md5.not.available=MD5 digest not available. +net.sf.jasperreports.exception.util.expression.unknown.expression.chunk.type=Unknown expression chunk type: "{0}". +net.sf.jasperreports.exception.util.file.buffered.output.stream.already.closed=Output stream already closed. +net.sf.jasperreports.exception.util.font.not.available=Font "{0}" is not available to the JVM. See the Javadoc for more details. +net.sf.jasperreports.exception.util.font.set.family.not.found=Font family "{0}" not found as font extension for font set "{1}". +net.sf.jasperreports.exception.util.format.factory.instance.error=Error creating format factory instance: {0}. +net.sf.jasperreports.exception.util.format.factory.loading.error=Error loading format factory class: {0}. +net.sf.jasperreports.exception.util.graphic.environment.initialization.error=Error initializing graphic environment. +net.sf.jasperreports.exception.util.icc.profile.not.available=The ICC profile is not available to the JVM. See the Javadoc for more details. +net.sf.jasperreports.exception.util.jdk13.image.read.failed=Image read failed. +net.sf.jasperreports.exception.util.jdk14.image.read.failed=Image read failed. +net.sf.jasperreports.exception.util.jdk14.image.writer.not.found=No appropriate image writer found for the "{0}" format. +net.sf.jasperreports.exception.util.json.unknown.operator=Unknown operator in expression: {0}; operator must be one of: {1}. +net.sf.jasperreports.exception.util.loader.byte.data.from.input.stream.error=Error loading byte data from input stream. +net.sf.jasperreports.exception.util.loader.byte.data.loading.error=Error loading byte data: {0}. +net.sf.jasperreports.exception.util.loader.class.not.found.from.file=Class not found when loading object from file: {0}. +net.sf.jasperreports.exception.util.loader.class.not.found.from.input.stream=Class not found when loading object from InputStream. +net.sf.jasperreports.exception.util.loader.class.not.found.from.url=Class not found when loading object from URL: {0}. +net.sf.jasperreports.exception.util.loader.file.open.error=Error opening file: {0}. +net.sf.jasperreports.exception.util.loader.input.stream.from.file.open.error=Error opening input stream from file: {0}. +net.sf.jasperreports.exception.util.loader.input.stream.from.url.open.error=Error opening input stream from URL: {0}. +net.sf.jasperreports.exception.util.loader.object.from.file.loading.error=Error loading object from file: {0}. +net.sf.jasperreports.exception.util.loader.object.from.input.stream.loading.error=Error loading object from InputStream. +net.sf.jasperreports.exception.util.loader.object.from.url.loading.error=Error loading object from URL: {0}. +net.sf.jasperreports.exception.util.loader.resource.not.found=Resource "{0}" not found. +net.sf.jasperreports.exception.util.loader.url.open.error=Error opening URL: {0}. +net.sf.jasperreports.exception.util.long.queue.underflow=Queue underflow. +net.sf.jasperreports.exception.util.message.provider.not.found=Message provider "{0}" not found. +net.sf.jasperreports.exception.util.properties.default.properties.not.found=Default properties file not found. +net.sf.jasperreports.exception.util.properties.loading.defaults.error=Failed to load default properties. +net.sf.jasperreports.exception.util.properties.loading.file.error=Failed to load properties file: {0}. +net.sf.jasperreports.exception.util.query.executer.factory.not.registered=No query executer factory registered for the "{0}" language. +net.sf.jasperreports.exception.util.query.token.separators.not.configured=No token separators configured. +net.sf.jasperreports.exception.util.report.subdataset.not.found=Could not find subdataset named "{0}" in report "{1}". +net.sf.jasperreports.exception.util.saver.expressions.class.file.save.error=Error saving expressions class file: {0}. +net.sf.jasperreports.exception.util.saver.file.save.error=Error saving file: {0}. +net.sf.jasperreports.exception.util.saver.output.stream.save.error=Error saving object to OutputStream. +net.sf.jasperreports.exception.util.secret.not.found=No secret found for "{0}" key in "{1}" category. +net.sf.jasperreports.exception.util.singleton.cache.class.not.compatible=Class {0} should be compatible with {1}. +net.sf.jasperreports.exception.util.singleton.cache.class.not.found=Class {0} not found. +net.sf.jasperreports.exception.util.singleton.cache.instance.error=Error instantiating class {0}. +net.sf.jasperreports.exception.util.styled.text.cannot.copy.characters=Cannot copy characters {0} to {1}. +net.sf.jasperreports.exception.util.swap.file.virtualizer.devirtualizing.error=Error devirtualizing object. +net.sf.jasperreports.exception.util.swap.file.virtualizer.unable.to.read.data=Unable to read virtualized data. +net.sf.jasperreports.exception.util.swap.file.virtualizer.virtualizing.error=Error virtualizing object. +net.sf.jasperreports.exception.util.value.string.error.parsing.data=Error parsing {0} data "{1}". +net.sf.jasperreports.exception.util.value.string.value.not.serializable=Value is not serializable. +net.sf.jasperreports.exception.util.xml.document.builder.creation.failure=Failed to create a document builder. +net.sf.jasperreports.exception.util.xml.document.builder.factory.creation.failure=Failed to create a document builder factory. +net.sf.jasperreports.exception.util.xml.document.parsing.failure=Failed to parse the xml document. +net.sf.jasperreports.exception.util.xml.jaxen.xpath.compilation.failure=Jaxen XPath compilation failed. Expression: {0} +net.sf.jasperreports.exception.util.xml.jaxen.xpath.selection.failure=Jaxen XPath selection failed. Expression: {0} +net.sf.jasperreports.exception.util.xml.xalan.xpath.selection.failure=Xalan XPath selection failed. Expression: {0} +net.sf.jasperreports.exception.util.xml.xpath.executer.factory.property.not.found=XPath executer factory property not found. Create a property named {0}. + +# virtualization errors +net.sf.jasperreports.exception.virtualization.chunk.unexpected.length=Read string chunk of unexpected length {0}. +net.sf.jasperreports.exception.virtualization.chunk.unexpected.length.remaining=Read string chunk of unexpected length {0}, was expecting {1}. + +# web errors +net.sf.jasperreports.exception.web.servlets.async.report.generation.error=Error occurred during report generation. +net.sf.jasperreports.exception.web.servlets.controller.report.not.found=Report not found at: {0}. +net.sf.jasperreports.exception.web.servlets.lock.attempt.interrupted=Interrupted while attempting to lock. +net.sf.jasperreports.exception.web.servlets.no.jasperprint.generated=No JasperPrint generated. +net.sf.jasperreports.exception.web.servlets.page.not.found=Page {0} not found in report. +net.sf.jasperreports.exception.web.servlets.report.generation.cancelled=Report generation cancelled. +net.sf.jasperreports.exception.web.servlets.report.generation.error=Error occurred during report generation. +net.sf.jasperreports.exception.web.servlets.report.not.found=Did not find the report on the session. +net.sf.jasperreports.exception.web.util.config.property.not.set=Configuration property "{0}" is not set. +net.sf.jasperreports.exception.web.util.jasperprint.not.found=No JasperPrint found in report context. +net.sf.jasperreports.exception.web.util.report.context.not.found=No web report context found. + +# xml errors +net.sf.jasperreports.exception.xml.base.factory.unknown.report.style=Unknown report style: {0}. +net.sf.jasperreports.exception.xml.component.rule.invalid.instance=Object of type {0} is not a {1} instance. +net.sf.jasperreports.exception.xml.digester.entity.loading.error=Failed to load entity {0}. +net.sf.jasperreports.exception.xml.digester.unknown.entity.not.loading=Unknown entity {0}, not loading. +net.sf.jasperreports.exception.xml.loader.subdataset.not.found=Could not find subdataset of name "{0}". +net.sf.jasperreports.exception.xml.loader.unknown.subdataset=Unknown sub dataset "{0}" for chart dataset. +net.sf.jasperreports.exception.xml.part.component.rule.invalid.instance=Object of type {0} is not a {1} instance. +net.sf.jasperreports.exception.xml.print.image.decoding.error=Error decoding embedded image. +net.sf.jasperreports.exception.xml.sax.parser.factory.incompatible.class=Class {0} should be compatible with {1}. +net.sf.jasperreports.exception.xml.sax.parser.factory.parser.creation.error=Error creating SAX parser. +net.sf.jasperreports.exception.xml.sax.parser.factory.resource.not.found=Could not find resource: {0}. +net.sf.jasperreports.exception.xml.template.loader.template.not.found=Template XML file not found. +net.sf.jasperreports.exception.xml.template.loader.template.parsing.error=Error parsing template XML. +net.sf.jasperreports.exception.xml.template.loader.template.reading.error=Error reading template XML. +net.sf.jasperreports.exception.xml.template.loader.url.connection.error=Error opening connection to template URL {1}. +net.sf.jasperreports.exception.xml.writer.file.write.error=Error writing to file: {0}. +net.sf.jasperreports.exception.xml.writer.output.stream.write.error=Error writing to OutputStream: {0}. +net.sf.jasperreports.exception.xml.writer.report.design.write.error=Error writing report design. +net.sf.jasperreports.exception.xml.writer.unsupported.chart.type=Chart type not supported. + diff -Nru jasperreports-6.2.2/jasperreports/src/META-INF/MANIFEST.MF jasperreports-6.3.1/jasperreports/src/META-INF/MANIFEST.MF --- jasperreports-6.2.2/jasperreports/src/META-INF/MANIFEST.MF 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/META-INF/MANIFEST.MF 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,174 @@ +Manifest-Version: 1.0 +Built-By: TIBCO Software Inc. +Specification-Title: JasperReports Library +Specification-Version: 6.3.1 +Specification-Vendor: TIBCO Software Inc. +Implementation-Title: net.sf.jasperreports.engine +Implementation-Version: 6.3.1 +Implementation-Vendor: TIBCO Software Inc. +Bundle-ManifestVersion: 2 +Bundle-Name: JasperReports Library +Bundle-Version: 6.3.1 +Bundle-Vendor: TIBCO Software Inc. +Bundle-SymbolicName: net.sf.jasperreports.engine +Bundle-ClassPath: . +Export-Package: net.sf.jasperreports.ant, + net.sf.jasperreports.charts, + net.sf.jasperreports.charts.base, + net.sf.jasperreports.charts.design, + net.sf.jasperreports.charts.fill, + net.sf.jasperreports.charts.type, + net.sf.jasperreports.charts.util, + net.sf.jasperreports.charts.xml, + net.sf.jasperreports.compilers, + net.sf.jasperreports.components, + net.sf.jasperreports.components.barbecue, + net.sf.jasperreports.components.barcode4j, + net.sf.jasperreports.components.charts, + net.sf.jasperreports.components.headertoolbar, + net.sf.jasperreports.components.headertoolbar.actions, + net.sf.jasperreports.components.headertoolbar.json, + net.sf.jasperreports.components.headertoolbar.json.resources, + net.sf.jasperreports.components.headertoolbar.resources, + net.sf.jasperreports.components.headertoolbar.resources.images, + net.sf.jasperreports.components.headertoolbar.resources.images.format, + net.sf.jasperreports.components.headertoolbar.resources.images.jive, + net.sf.jasperreports.components.headertoolbar.resources.images.style, + net.sf.jasperreports.components.headertoolbar.resources.require, + net.sf.jasperreports.components.iconlabel, + net.sf.jasperreports.components.items, + net.sf.jasperreports.components.list, + net.sf.jasperreports.components.map, + net.sf.jasperreports.components.map.fill, + net.sf.jasperreports.components.map.resources, + net.sf.jasperreports.components.map.resources.require, + net.sf.jasperreports.components.map.resources.templates, + net.sf.jasperreports.components.map.type, + net.sf.jasperreports.components.sort, + net.sf.jasperreports.components.sort.actions, + net.sf.jasperreports.components.sort.resources, + net.sf.jasperreports.components.sort.resources.images, + net.sf.jasperreports.components.spiderchart, + net.sf.jasperreports.components.spiderchart.type, + net.sf.jasperreports.components.table, + net.sf.jasperreports.components.table.fill, + net.sf.jasperreports.components.table.util, + net.sf.jasperreports.crosstabs, + net.sf.jasperreports.crosstabs.base, + net.sf.jasperreports.crosstabs.design, + net.sf.jasperreports.crosstabs.fill, + net.sf.jasperreports.crosstabs.fill.calculation, + net.sf.jasperreports.crosstabs.interactive, + net.sf.jasperreports.crosstabs.type, + net.sf.jasperreports.crosstabs.xml, + net.sf.jasperreports.data, + net.sf.jasperreports.data.bean, + net.sf.jasperreports.data.cache, + net.sf.jasperreports.data.csv, + net.sf.jasperreports.data.ds, + net.sf.jasperreports.data.ejbql, + net.sf.jasperreports.data.empty, + net.sf.jasperreports.data.excel, + net.sf.jasperreports.data.hibernate, + net.sf.jasperreports.data.hibernate.spring, + net.sf.jasperreports.data.http, + net.sf.jasperreports.data.jdbc, + net.sf.jasperreports.data.jndi, + net.sf.jasperreports.data.json, + net.sf.jasperreports.data.mondrian, + net.sf.jasperreports.data.provider, + net.sf.jasperreports.data.qe, + net.sf.jasperreports.data.xls, + net.sf.jasperreports.data.xlsx, + net.sf.jasperreports.data.xml, + net.sf.jasperreports.data.xmla, + net.sf.jasperreports.engine, + net.sf.jasperreports.engine.analytics, + net.sf.jasperreports.engine.analytics.data, + net.sf.jasperreports.engine.analytics.dataset, + net.sf.jasperreports.engine.base, + net.sf.jasperreports.engine.component, + net.sf.jasperreports.engine.convert, + net.sf.jasperreports.engine.data, + net.sf.jasperreports.engine.design, + net.sf.jasperreports.engine.design.events, + net.sf.jasperreports.engine.dtds, + net.sf.jasperreports.engine.export, + net.sf.jasperreports.engine.export.data, + net.sf.jasperreports.engine.export.draw, + net.sf.jasperreports.engine.export.oasis, + net.sf.jasperreports.engine.export.ooxml, + net.sf.jasperreports.engine.export.ooxml.docx, + net.sf.jasperreports.engine.export.ooxml.docx._rels, + net.sf.jasperreports.engine.export.ooxml.pptx, + net.sf.jasperreports.engine.export.ooxml.pptx._rels, + net.sf.jasperreports.engine.export.ooxml.pptx.ppt, + net.sf.jasperreports.engine.export.ooxml.pptx.ppt.slideLayouts, + net.sf.jasperreports.engine.export.ooxml.pptx.ppt.slideLayouts._rels, + net.sf.jasperreports.engine.export.ooxml.pptx.ppt.slideMasters, + net.sf.jasperreports.engine.export.ooxml.pptx.ppt.slideMasters._rels, + net.sf.jasperreports.engine.export.ooxml.pptx.ppt.theme, + net.sf.jasperreports.engine.export.ooxml.type, + net.sf.jasperreports.engine.export.ooxml.xlsx, + net.sf.jasperreports.engine.export.ooxml.xlsx._rels, + net.sf.jasperreports.engine.export.tabulator, + net.sf.jasperreports.engine.export.type, + net.sf.jasperreports.engine.export.zip, + net.sf.jasperreports.engine.fill, + net.sf.jasperreports.engine.fonts, + net.sf.jasperreports.engine.images, + net.sf.jasperreports.engine.part, + net.sf.jasperreports.engine.print, + net.sf.jasperreports.engine.query, + net.sf.jasperreports.engine.scriptlets, + net.sf.jasperreports.engine.style, + net.sf.jasperreports.engine.type, + net.sf.jasperreports.engine.util, + net.sf.jasperreports.engine.util.xml, + net.sf.jasperreports.engine.virtualization, + net.sf.jasperreports.engine.xml, + net.sf.jasperreports.export, + net.sf.jasperreports.export.annotations, + net.sf.jasperreports.export.parameters, + net.sf.jasperreports.export.type, + net.sf.jasperreports.expressions, + net.sf.jasperreports.extensions, + net.sf.jasperreports.fonts, + net.sf.jasperreports.fonts.pictonic, + net.sf.jasperreports.functions, + net.sf.jasperreports.functions.annotations, + net.sf.jasperreports.governors, + net.sf.jasperreports.j2ee, + net.sf.jasperreports.j2ee.servlets, + net.sf.jasperreports.olap, + net.sf.jasperreports.olap.mapping, + net.sf.jasperreports.olap.mondrian, + net.sf.jasperreports.olap.olap4j, + net.sf.jasperreports.olap.result, + net.sf.jasperreports.olap.xmla, + net.sf.jasperreports.parts, + net.sf.jasperreports.parts.subreport, + net.sf.jasperreports.renderers, + net.sf.jasperreports.repo, + net.sf.jasperreports.search, + net.sf.jasperreports.swing, + net.sf.jasperreports.types, + net.sf.jasperreports.types.date, + net.sf.jasperreports.util, + net.sf.jasperreports.view, + net.sf.jasperreports.view.images, + net.sf.jasperreports.view.save, + net.sf.jasperreports.web, + net.sf.jasperreports.web.actions, + net.sf.jasperreports.web.commands, + net.sf.jasperreports.web.listeners, + net.sf.jasperreports.web.servlets, + net.sf.jasperreports.web.servlets.resources, + net.sf.jasperreports.web.servlets.resources.require, + net.sf.jasperreports.web.servlets.resources.require.report, + net.sf.jasperreports.web.servlets.resources.require.util, + net.sf.jasperreports.web.servlets.resources.require.viewer, + net.sf.jasperreports.web.servlets.resources.templates, + net.sf.jasperreports.web.servlets.resources.viewer, + net.sf.jasperreports.web.util +DynamicImport-Package: * diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/JavaflowRewriteTask.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/JavaflowRewriteTask.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/JavaflowRewriteTask.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/JavaflowRewriteTask.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,53 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.ant; + +import org.apache.commons.javaflow.ant.AntRewriteTask; +import org.apache.tools.ant.BuildException; + +/** + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class JavaflowRewriteTask extends AntRewriteTask +{ + + @Override + public void execute() throws BuildException + { + Thread thread = Thread.currentThread(); + ClassLoader originalClassLoader = thread.getContextClassLoader(); + try + { + //javaflow's ContinuationMethodAnalyzer uses the thread classloader to resolve classes + thread.setContextClassLoader(getClass().getClassLoader()); + + super.execute(); + } + finally + { + thread.setContextClassLoader(originalClassLoader); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/JRAntApiWriteTask.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/JRAntApiWriteTask.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/JRAntApiWriteTask.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/JRAntApiWriteTask.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,433 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.ant; + +import java.io.File; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRReport; +import net.sf.jasperreports.engine.design.JRCompiler; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.util.JRApiWriter; +import net.sf.jasperreports.engine.util.JRClassLoader; +import net.sf.jasperreports.engine.util.JRLoader; +import net.sf.jasperreports.engine.util.ReportCreator; +import net.sf.jasperreports.engine.xml.JRXmlLoader; +import net.sf.jasperreports.engine.xml.JRXmlWriter; + +import org.apache.tools.ant.AntClassLoader; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.DirectoryScanner; +import org.apache.tools.ant.types.Path; +import org.apache.tools.ant.types.Resource; +import org.apache.tools.ant.types.resources.FileResource; +import org.apache.tools.ant.util.RegexpPatternMapper; +import org.apache.tools.ant.util.SourceFileScanner; + + +/** + * Ant task for batch-generating the Java source file that uses the JR API to create the report design, + * from compiled report template files or from source JRXML files. + * Works like the built-in javac Ant task. + *

    + * This task can take the following arguments: + *

      + *
    • src + *
    • destdir + *
    + * Of these arguments, the src and destdir are required. + * When this task executes, it will recursively scan the src and + * destdir looking for compiled report template files or for source + * JRXML report template files and it will recreate the Java source file for each of them. + * This task makes its file creation decision based on timestamp and only input files + * that have no corresponding file in the target directory or where the destination Java file + * is older than the input file will be processed. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRAntApiWriteTask extends JRBaseAntTask +{ + + + /** + * + */ + private Path src; + private File destdir; + private Path classpath; + private boolean runApi; + + private Map reportFilesMap; + + + /** + * Sets the source directories to find the source files. + * + * @param srcdir source path + */ + public void setSrcdir(Path srcdir) + { + if (src == null) + { + src = srcdir; + } + else + { + src.append(srcdir); + } + } + + + /** + * Adds a path for source report templates. + * + * @return source path + */ + public Path createSrc() + { + if (src == null) + { + src = new Path(getProject()); + } + + return src.createPath(); + } + + + /** + * Sets the destination directory into which the Java report design files should be generated. + * + * @param destdir destination directory + */ + public void setDestdir(File destdir) + { + this.destdir = destdir; + } + + + /** + * Adds a path to the classpath. + * + * @return classpath to use when updating the report + */ + public Path createClasspath() + { + if (classpath == null) + { + classpath = new Path(getProject()); + } + + return classpath.createPath(); + } + + + /** + * If set to true, the task will run the API writer generated classes and produce JRXML source files. + */ + public void setRunApi(boolean runApi) + { + this.runApi = runApi; + } + + + /** + * Executes the task. + */ + @Override + public void execute() throws BuildException + { + checkParameters(); + + reportFilesMap = new HashMap(); + + AntClassLoader classLoader = null; + if (classpath != null) + { + jasperReportsContext.setProperty(JRCompiler.COMPILER_CLASSPATH, String.valueOf(classpath)); + + ClassLoader parentClassLoader = getClass().getClassLoader(); + classLoader = new AntClassLoader(parentClassLoader, getProject(), classpath, true); + classLoader.setThreadContextLoader(); + } + + try + { + /* */ + scanSrc(); + + if (runApi) + { + /* */ + runApi(); + } + else + { + /* */ + writeApi(); + } + } + finally + { + if (classLoader != null) + { + classLoader.resetThreadContextLoader(); + } + } + } + + + /** + * Checks that all required attributes have been set and that the supplied values are valid. + */ + protected void checkParameters() throws BuildException + { + if (src == null || src.size() == 0) + { + throw + new BuildException( + "The srcdir attribute must be set.", + getLocation() + ); + } + + if (destdir != null && !destdir.isDirectory()) + { + throw + new BuildException( + "The destination directory \"" + + destdir + + "\" does not exist " + + "or is not a directory.", + getLocation() + ); + } + } + + + /** + * Scans the source directories looking for source report design files to be processed. + */ + protected void scanSrc() throws BuildException + { + for(@SuppressWarnings("unchecked") + Iterator it = src.iterator(); it.hasNext();) + { + Resource resource = it.next(); + FileResource fileResource = resource instanceof FileResource ? (FileResource)resource : null; + if (fileResource != null) + { + File file = fileResource.getFile(); + if (file.isDirectory()) + { + DirectoryScanner ds = getDirectoryScanner(file); + String[] files = ds.getIncludedFiles(); + + scanDir(file, destdir != null ? destdir : file, files); + } + else + { + String[] files = new String[]{fileResource.getName()}; + + scanDir(fileResource.getBaseDir(), destdir != null ? destdir : fileResource.getBaseDir(), files); + } + } +// else +// { +// //FIXME what to do? +// } + } + } + + + /** + * Scans the directory looking for source report design files to be processed. + * The results are returned in the instance variable reportFilesMap. + * + * @param srcdir source directory + * @param destdir destination directory + * @param files included file names + */ + protected void scanDir(File srcdir, File destdir, String[] files) + { + RegexpPatternMapper mapper = new RegexpPatternMapper(); + if (runApi) + { + mapper.setFrom("^(.*)\\.(.*)$"); + mapper.setTo("\\1.api.jrxml"); + } + else + { + mapper.setFrom("^(.*)\\.(.*)$"); + mapper.setTo("\\1.java"); + } + + SourceFileScanner scanner = new SourceFileScanner(this); + String[] newFiles = scanner.restrict(files, srcdir, destdir, mapper); + + if (newFiles != null && newFiles.length > 0) + { + for (int i = 0; i < newFiles.length; i++) + { + reportFilesMap.put( + (new File(srcdir, newFiles[i])).getAbsolutePath(), + (new File(destdir, mapper.mapFileName(newFiles[i])[0])).getAbsolutePath() + ); + } + } + } + + + /** + * Performs the API code generation for the selected report design files. + */ + protected void writeApi() throws BuildException + { + Collection files = reportFilesMap.keySet(); + + if (files != null && files.size() > 0) + { + boolean isError = false; + + System.out.println("Processing " + files.size() + " report design files."); + + for (Iterator it = files.iterator(); it.hasNext();) + { + String srcFileName = it.next(); + String destFileName = reportFilesMap.get(srcFileName); + File destFileParent = new File(destFileName).getParentFile(); + if(!destFileParent.exists()) + { + destFileParent.mkdirs(); + } + + String srcFileExtension = null; + int srcFileExtensionStart = srcFileName.lastIndexOf('.'); + if (srcFileExtensionStart >= 0) + { + srcFileExtension = srcFileName.substring(srcFileExtensionStart); + } + + try + { + System.out.print("File : " + srcFileName + " ... "); + + JRReport report = null; + + if ("jrxml".equalsIgnoreCase(srcFileExtension)) + { + report = JRXmlLoader.load(srcFileName); + } + else if ("jasper".equalsIgnoreCase(srcFileExtension)) + { + report = (JRReport)JRLoader.loadObjectFromFile(srcFileName); + } + else + { + try + { + report = (JRReport)JRLoader.loadObjectFromFile(srcFileName); + } + catch (JRException e) + { + report = JRXmlLoader.load(srcFileName); + } + } + + new JRApiWriter(jasperReportsContext).write(report, destFileName); + + System.out.println("OK."); + } + catch(JRException e) + { + System.out.println("FAILED."); + System.out.println("Error generating API report design : " + srcFileName); + e.printStackTrace(System.out); + isError = true; + } + } + + if(isError) + { + throw new BuildException("Errors were encountered when generating API report designs."); + } + } + } + + + /** + * Runs the generated code and produces the JRXML image of the report. + */ + protected void runApi() throws BuildException + { + Collection files = reportFilesMap.keySet(); + + if (files != null && files.size() > 0) + { + boolean isError = false; + + System.out.println("Running " + files.size() + " API report design files."); + + for (Iterator it = files.iterator(); it.hasNext();) + { + String srcFileName = it.next(); + String destFileName = reportFilesMap.get(srcFileName); + File destFileParent = new File(destFileName).getParentFile(); + if(!destFileParent.exists()) + { + destFileParent.mkdirs(); + } + + try + { + System.out.print("File : " + srcFileName + " ... "); + + Class reportCreatorClass = JRClassLoader.loadClassFromFile(null, new File(srcFileName)); + ReportCreator reportCreator = (ReportCreator)reportCreatorClass.newInstance(); + JasperDesign jasperDesign = reportCreator.create(); + new JRXmlWriter(jasperReportsContext).write(jasperDesign, destFileName, "UTF-8"); + + System.out.println("OK."); + } + catch (Exception e) + { + System.out.println("FAILED."); + System.out.println("Error running API report design class : " + srcFileName); + e.printStackTrace(System.out); + isError = true; + } + } + + if(isError) + { + throw new BuildException("Errors were encountered when running API report designs classes."); + } + } + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/JRAntCompileTask.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/JRAntCompileTask.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/JRAntCompileTask.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/JRAntCompileTask.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,422 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/* + * Contributors: + * Henri Chen - henrichen@users.sourceforge.net + * Kees Kuip - keeskuip@users.sourceforge.net + */ +package net.sf.jasperreports.ant; + +import java.io.File; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JasperCompileManager; +import net.sf.jasperreports.engine.design.JRCompiler; +import net.sf.jasperreports.engine.xml.JRReportSaxParserFactory; + +import org.apache.tools.ant.AntClassLoader; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.DirectoryScanner; +import org.apache.tools.ant.types.Path; +import org.apache.tools.ant.types.Resource; +import org.apache.tools.ant.types.resources.FileResource; +import org.apache.tools.ant.util.RegexpPatternMapper; +import org.apache.tools.ant.util.SourceFileScanner; + + +/** + * Ant task for batch-compiling XML report design files. + * Works like the built-in javac Ant task. + *

    + * This task can take the following arguments: + *

      + *
    • src + *
    • destdir + *
    • compiler + *
    • classpath + *
    • tempdir + *
    • keepjava + *
    • xmlvalidation + *
    + * Of these arguments, the src and destdir are required. + * When this task executes, it will recursively scan the src and + * destdir looking for XML report design files to compile. + * This task makes its compile decision based on timestamp and only XML files + * that have no corresponding .jasper file or where the compiled report design file + * is older than the XML file will be compiled. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRAntCompileTask extends JRBaseAntTask +{ + + + /** + * + */ + private Path src; + private File destdir; + private File tempdir; + private boolean keepjava; + private String compiler; + private Path classpath; + private boolean xmlvalidation = true; + + private Map reportFilesMap; + + + /** + * Sets the source directories to find the XML report design files. + * + * @param srcdir source path + */ + public void setSrcdir(Path srcdir) + { + if (src == null) + { + src = srcdir; + } + else + { + src.append(srcdir); + } + } + + + /** + * Adds a path for source compilation. + * + * @return source path + */ + public Path createSrc() + { + if (src == null) + { + src = new Path(getProject()); + } + + return src.createPath(); + } + + + /** + * Sets the destination directory into which the XML report design files should be compiled. + * + * @param destdir destination directory + */ + public void setDestdir(File destdir) + { + this.destdir = destdir; + } + + + /** + * Sets the temporary working directory into which to store the temporary files + * generated during XML report design file compilation. This is only used by the + * Java bytecode report compilers that need to have the Java source files stored + * on disk in order to compile them. + *

    + * If not set, the temporary working directory will be the current working directory, + * as specified by the user.dir system property. + * + * @param tempdir temporary working directory + */ + public void setTempdir(File tempdir) + { + this.tempdir = tempdir; + } + + + /** + * Sets a boolean flag that will instruct the Java bytecode report compilers + * to avoid deletion of the Java source files generated in the temporary working + * directory during report generation. This is useful when debugging. + * + * @param keepjava flag for preventing the deletion of generated Java source files + */ + public void setKeepjava(boolean keepjava) + { + this.keepjava = keepjava; + } + + + /** + * Sets the name of the report compiler class to use when compiling the XML + * report design files. + *

    + * The specified class should be an implementation of the + * {@link net.sf.jasperreports.engine.design.JRCompiler} interface. + * When specified, this value will temporarily override the value of the + * {@link net.sf.jasperreports.engine.design.JRCompiler#COMPILER_CLASS net.sf.jasperreports.compiler.class} system property. + * + * @param compiler report compiler class name + */ + public void setCompiler(String compiler) + { + this.compiler = compiler; + } + + + /** + * Adds a path to the classpath. + * + * @return classpath to use when compiling the report associated Java expressions class + */ + public Path createClasspath() + { + if (classpath == null) + { + classpath = new Path(getProject()); + } + + return classpath.createPath(); + } + + + /** + * Instructs the XML parser to validate the XML report design file during compilation. + * + * @param xmlvalidation flag for enabling/disabling the validation feature of the XML parser + */ + public void setXmlvalidation(boolean xmlvalidation) + { + this.xmlvalidation = xmlvalidation; + } + + + /** + * Executes the task. + */ + @Override + public void execute() throws BuildException + { + checkParameters(); + + reportFilesMap = new HashMap(); + + if (tempdir != null) + { + jasperReportsContext.setProperty(JRCompiler.COMPILER_TEMP_DIR, String.valueOf(tempdir)); + } + + jasperReportsContext.setProperty(JRCompiler.COMPILER_KEEP_JAVA_FILE, String.valueOf(keepjava)); + + setCompilerClass(compiler); + + jasperReportsContext.setProperty(JRReportSaxParserFactory.COMPILER_XML_VALIDATION, String.valueOf(xmlvalidation)); + + AntClassLoader classLoader = null; + if (classpath != null) + { + jasperReportsContext.setProperty(JRCompiler.COMPILER_CLASSPATH, String.valueOf(classpath)); + + ClassLoader parentClassLoader = getClass().getClassLoader(); + classLoader = new AntClassLoader(parentClassLoader, getProject(), classpath, true); + classLoader.setThreadContextLoader(); + } + + try + { + /* */ + scanSrc(); + /* */ + compile(); + } + finally + { + if (classLoader != null) + { + classLoader.resetThreadContextLoader(); + } + } + } + + + @SuppressWarnings("deprecation") + private void setCompilerClass(String compile) + { + if (compiler != null) + { + jasperReportsContext.setProperty(JRCompiler.COMPILER_CLASS, compiler); + } + } + + + /** + * Checks that all required attributes have been set and that the supplied values are valid. + */ + protected void checkParameters() throws BuildException + { + if (src == null || src.size() == 0) + { + throw + new BuildException( + "The srcdir attribute must be set.", + getLocation() + ); + } + + if (destdir != null && !destdir.isDirectory()) + { + throw + new BuildException( + "The destination directory \"" + + destdir + + "\" does not exist " + + "or is not a directory.", + getLocation() + ); + } + + if (tempdir != null && !tempdir.isDirectory()) + { + throw + new BuildException( + "The temporary directory \"" + + tempdir + + "\" does not exist " + + "or is not a directory.", + getLocation() + ); + } + } + + + /** + * Scans the source directories looking for source files to be compiled. + */ + protected void scanSrc() throws BuildException + { + for(@SuppressWarnings("unchecked") + Iterator it = src.iterator(); it.hasNext();) + { + Resource resource = it.next(); + FileResource fileResource = resource instanceof FileResource ? (FileResource)resource : null; + if (fileResource != null) + { + File file = fileResource.getFile(); + if (file.isDirectory()) + { + DirectoryScanner ds = getDirectoryScanner(file); + String[] files = ds.getIncludedFiles(); + + scanDir(file, destdir != null ? destdir : file, files); + } + else + { + String[] files = new String[]{fileResource.getName()}; + + scanDir(fileResource.getBaseDir(), destdir != null ? destdir : fileResource.getBaseDir(), files); + } + } +// else +// { +// //FIXME what to do? +// } + } + } + + + /** + * Scans the directory looking for source files to be compiled. + * The results are returned in the instance variable reportFilesMap. + * + * @param srcdir source directory + * @param destdir destination directory + * @param files included file names + */ + protected void scanDir(File srcdir, File destdir, String[] files) + { + RegexpPatternMapper mapper = new RegexpPatternMapper(); + mapper.setFrom("^(.*)\\.(.*)$"); + mapper.setTo("\\1.jasper"); + + SourceFileScanner scanner = new SourceFileScanner(this); + String[] newFiles = scanner.restrict(files, srcdir, destdir, mapper); + + if (newFiles != null && newFiles.length > 0) + { + for (int i = 0; i < newFiles.length; i++) + { + reportFilesMap.put( + (new File(srcdir, newFiles[i])).getAbsolutePath(), + (new File(destdir, mapper.mapFileName(newFiles[i])[0])).getAbsolutePath() + ); + } + } + } + + + /** + * Performs the compilation of the selected report design files. + */ + protected void compile() throws BuildException + { + Collection files = reportFilesMap.keySet(); + + if (files != null && files.size() > 0) + { + boolean isError = false; + + System.out.println("Compiling " + files.size() + " report design files."); + + for (Iterator it = files.iterator(); it.hasNext();) + { + String srcFileName = it.next(); + String destFileName = reportFilesMap.get(srcFileName); + File destFileParent = new File(destFileName).getParentFile(); + if(!destFileParent.exists()) + { + destFileParent.mkdirs(); + } + + try + { + System.out.print("File : " + srcFileName + " ... "); + JasperCompileManager.getInstance(jasperReportsContext).compileToFile(srcFileName, destFileName); + System.out.println("OK."); + } + catch(JRException e) + { + System.out.println("FAILED."); + System.out.println("Error compiling report design : " + srcFileName); + e.printStackTrace(System.out); + isError = true; + } + } + + if(isError) + { + throw new BuildException("Errors were encountered when compiling report designs."); + } + } + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/JRAntDecompileTask.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/JRAntDecompileTask.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/JRAntDecompileTask.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/JRAntDecompileTask.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,322 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.ant; + +import java.io.File; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JasperReport; +import net.sf.jasperreports.engine.design.JRCompiler; +import net.sf.jasperreports.engine.util.JRLoader; +import net.sf.jasperreports.engine.xml.JRXmlWriter; + +import org.apache.tools.ant.AntClassLoader; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.DirectoryScanner; +import org.apache.tools.ant.types.Path; +import org.apache.tools.ant.types.Resource; +import org.apache.tools.ant.types.resources.FileResource; +import org.apache.tools.ant.util.RegexpPatternMapper; +import org.apache.tools.ant.util.SourceFileScanner; + + +/** + * Ant task for batch-generating the source JRXML report design files, from compiled report template files. + * Works like the built-in javac Ant task. + *

    + * This task can take the following arguments: + *

      + *
    • src + *
    • destdir + *
    + * Of these arguments, the src and destdir are required. + * When this task executes, it will recursively scan the src and + * destdir looking for compiled report template files and it will recreate + * the source JRXML file for each of them. + * This task makes its file creation decision based on timestamp and only input files + * that have no corresponding file in the target directory or where the destination JRXML file + * is older than the input file will be processed. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRAntDecompileTask extends JRBaseAntTask +{ + + + /** + * + */ + private Path src; + private File destdir; + private Path classpath; + + private Map reportFilesMap; + + + /** + * Sets the source directories to find the compiled report design files. + * + * @param srcdir source path + */ + public void setSrcdir(Path srcdir) + { + if (src == null) + { + src = srcdir; + } + else + { + src.append(srcdir); + } + } + + + /** + * Adds a path for decompilation source. + * + * @return source path + */ + public Path createSrc() + { + if (src == null) + { + src = new Path(getProject()); + } + + return src.createPath(); + } + + + /** + * Sets the destination directory into which the report design files should be decompilated. + * + * @param destdir destination directory + */ + public void setDestdir(File destdir) + { + this.destdir = destdir; + } + + + /** + * Adds a path to the classpath. + * + * @return classpath to use when decompiling the report + */ + public Path createClasspath() + { + if (classpath == null) + { + classpath = new Path(getProject()); + } + + return classpath.createPath(); + } + + + /** + * Executes the task. + */ + @Override + public void execute() throws BuildException + { + checkParameters(); + + reportFilesMap = new HashMap(); + + AntClassLoader classLoader = null; + if (classpath != null) + { + jasperReportsContext.setProperty(JRCompiler.COMPILER_CLASSPATH, String.valueOf(classpath));//FIXMECONTEXT is this needed? what about class loader below/ + + ClassLoader parentClassLoader = getClass().getClassLoader(); + classLoader = new AntClassLoader(parentClassLoader, getProject(), classpath, true); + classLoader.setThreadContextLoader(); + } + + try + { + /* */ + scanSrc(); + /* */ + decompile(); + } + finally + { + if (classLoader != null) + { + classLoader.resetThreadContextLoader(); + } + } + } + + + /** + * Checks that all required attributes have been set and that the supplied values are valid. + */ + protected void checkParameters() throws BuildException + { + if (src == null || src.size() == 0) + { + throw + new BuildException( + "The srcdir attribute must be set.", //FIXME this message is misleading in case the fileset filters do not match any file + getLocation() + ); + } + + if (destdir != null && !destdir.isDirectory()) + { + throw + new BuildException( + "The destination directory \"" + + destdir + + "\" does not exist " + + "or is not a directory.", + getLocation() + ); + } + } + + + /** + * Scans the source directories looking for source files to be decompiled. + */ + protected void scanSrc() throws BuildException + { + for(@SuppressWarnings("unchecked") + Iterator it = src.iterator(); it.hasNext();) + { + Resource resource = it.next(); + FileResource fileResource = resource instanceof FileResource ? (FileResource)resource : null; + if (fileResource != null) + { + File file = fileResource.getFile(); + if (file.isDirectory()) + { + DirectoryScanner ds = getDirectoryScanner(file); + String[] files = ds.getIncludedFiles(); + + scanDir(file, destdir != null ? destdir : file, files); + } + else + { + String[] files = new String[]{fileResource.getName()}; + + scanDir(fileResource.getBaseDir(), destdir != null ? destdir : fileResource.getBaseDir(), files); + } + } +// else +// { +// //FIXME what to do? +// } + } + } + + + /** + * Scans the directory looking for source files to be decompiled. + * The results are returned in the instance variable reportFilesMap. + * + * @param srcdir source directory + * @param destdir destination directory + * @param files included file names + */ + protected void scanDir(File srcdir, File destdir, String[] files) + { + RegexpPatternMapper mapper = new RegexpPatternMapper(); + mapper.setFrom("^(.*)\\.(.*)$"); + mapper.setTo("\\1.jasper.jrxml"); + + SourceFileScanner scanner = new SourceFileScanner(this); + String[] newFiles = scanner.restrict(files, srcdir, destdir, mapper); + + if (newFiles != null && newFiles.length > 0) + { + for (int i = 0; i < newFiles.length; i++) + { + reportFilesMap.put( + (new File(srcdir, newFiles[i])).getAbsolutePath(), + (new File(destdir, mapper.mapFileName(newFiles[i])[0])).getAbsolutePath() + ); + } + } + } + + + /** + * Performs the decompilation of the selected report design files. + */ + protected void decompile() throws BuildException + { + Collection files = reportFilesMap.keySet(); + + if (files != null && files.size() > 0) + { + boolean isError = false; + + System.out.println("Decompiling " + files.size() + " report design files."); + + for (Iterator it = files.iterator(); it.hasNext();) + { + String srcFileName = it.next(); + String destFileName = reportFilesMap.get(srcFileName); + File destFileParent = new File(destFileName).getParentFile(); + if(!destFileParent.exists()) + { + destFileParent.mkdirs(); + } + + try + { + System.out.print("File : " + srcFileName + " ... "); + + JasperReport jasperReport = (JasperReport)JRLoader.loadObjectFromFile(srcFileName); + + new JRXmlWriter(jasperReportsContext).write(jasperReport, destFileName, "UTF-8"); + + System.out.println("OK."); + } + catch(JRException e) + { + System.out.println("FAILED."); + System.out.println("Error decompiling report design : " + srcFileName); + e.printStackTrace(System.out); + isError = true; + } + } + + if(isError) + { + throw new BuildException("Errors were encountered when decompiling report designs."); + } + } + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/JRAntUpdateTask.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/JRAntUpdateTask.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/JRAntUpdateTask.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/JRAntUpdateTask.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,375 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.ant; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.design.JRCompiler; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.util.ReportUpdater; +import net.sf.jasperreports.engine.xml.JRReportSaxParserFactory; +import net.sf.jasperreports.engine.xml.JRXmlLoader; +import net.sf.jasperreports.engine.xml.JRXmlWriter; + +import org.apache.tools.ant.AntClassLoader; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.DirectoryScanner; +import org.apache.tools.ant.types.Path; +import org.apache.tools.ant.types.Resource; +import org.apache.tools.ant.types.resources.FileResource; +import org.apache.tools.ant.util.RegexpPatternMapper; +import org.apache.tools.ant.util.SourceFileScanner; + + +/** + * Ant task for batch-updating JRXML report design files. + * Works like the built-in javac Ant task. + *

    + * This task can take the following arguments: + *

      + *
    • src + *
    • destdir + *
    + * Of these arguments, the src and destdir are required. + * When this task executes, it will recursively scan the src and + * destdir looking for JRXML report design files to update. + * This task makes its update decision based on timestamp and only JRXML files + * that have no corresponding file in the target directory or where the destination report + * design file is older than the source file will be updated. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRAntUpdateTask extends JRBaseAntTask +{ + + + /** + * + */ + private Path src; + private File destdir; + private Path classpath; + private boolean xmlvalidation = true; + + private List updaters; + + private Map reportFilesMap; + + + /** + * Sets the source directories to find the XML report design files. + * + * @param srcdir source path + */ + public void setSrcdir(Path srcdir) + { + if (src == null) + { + src = srcdir; + } + else + { + src.append(srcdir); + } + } + + + /** + * Adds a path for update source. + * + * @return source path + */ + public Path createSrc() + { + if (src == null) + { + src = new Path(getProject()); + } + + return src.createPath(); + } + + + /** + * Sets the destination directory into which the XML report design files should be updated. + * + * @param destdir destination directory + */ + public void setDestdir(File destdir) + { + this.destdir = destdir; + } + + + /** + * Adds a path to the classpath. + * + * @return classpath to use when updating the report + */ + public Path createClasspath() + { + if (classpath == null) + { + classpath = new Path(getProject()); + } + + return classpath.createPath(); + } + + + /** + * Instructs the XML parser to validate the XML report design file during update. + * + * @param xmlvalidation flag for enabling/disabling the validation feature of the XML parser + */ + public void setXmlvalidation(boolean xmlvalidation) + { + this.xmlvalidation = xmlvalidation; + } + + + /** + * Adds an updater. + */ + public UpdaterElement createUpdater() + { + UpdaterElement updaterElement = new UpdaterElement(); + + if (updaters == null) + { + updaters = new ArrayList(); + } + + updaters.add(updaterElement); + + return updaterElement; + } + + + /** + * Executes the task. + */ + @Override + public void execute() throws BuildException + { + checkParameters(); + + reportFilesMap = new HashMap(); + + jasperReportsContext.setProperty(JRReportSaxParserFactory.COMPILER_XML_VALIDATION, String.valueOf(xmlvalidation));//FIXMECONTEXT is this needed? what about the one below? + + AntClassLoader classLoader = null; + if (classpath != null) + { + jasperReportsContext.setProperty(JRCompiler.COMPILER_CLASSPATH, String.valueOf(classpath)); + + ClassLoader parentClassLoader = getClass().getClassLoader(); + classLoader = new AntClassLoader(parentClassLoader, getProject(), classpath, true); + classLoader.setThreadContextLoader(); + } + + try + { + /* */ + scanSrc(); + /* */ + update(); + } + finally + { + if (classLoader != null) + { + classLoader.resetThreadContextLoader(); + } + } + } + + + /** + * Checks that all required attributes have been set and that the supplied values are valid. + */ + protected void checkParameters() throws BuildException + { + if (src == null || src.size() == 0) + { + throw + new BuildException( + "The srcdir attribute must be set.", + getLocation() + ); + } + + if (destdir != null && !destdir.isDirectory()) + { + throw + new BuildException( + "The destination directory \"" + + destdir + + "\" does not exist " + + "or is not a directory.", + getLocation() + ); + } + } + + + /** + * Scans the source directories looking for source files to be updated. + */ + protected void scanSrc() throws BuildException //FIXME put this method in base class + { + for(@SuppressWarnings("unchecked") + Iterator it = src.iterator(); it.hasNext();) + { + Resource resource = it.next(); + FileResource fileResource = resource instanceof FileResource ? (FileResource)resource : null; + if (fileResource != null) + { + File file = fileResource.getFile(); + if (file.isDirectory()) + { + DirectoryScanner ds = getDirectoryScanner(file); + String[] files = ds.getIncludedFiles(); + + scanDir(file, destdir != null ? destdir : file, files); + } + else + { + String[] files = new String[]{fileResource.getName()}; + + scanDir(fileResource.getBaseDir(), destdir != null ? destdir : fileResource.getBaseDir(), files); + } + } +// else +// { +// //FIXME what to do? +// } + } + } + + + /** + * Scans the directory looking for source files to be updated. + * The results are returned in the instance variable reportFilesMap. + * + * @param srcdir source directory + * @param destdir destination directory + * @param files included file names + */ + protected void scanDir(File srcdir, File destdir, String[] files) + { + RegexpPatternMapper mapper = new RegexpPatternMapper(); + mapper.setFrom("^(.*)\\.(.*)$"); + mapper.setTo("\\1.\\2"); + + SourceFileScanner scanner = new SourceFileScanner(this); + String[] newFiles = scanner.restrict(files, srcdir, destdir, mapper); + + if (newFiles != null && newFiles.length > 0) + { + for (int i = 0; i < newFiles.length; i++) + { + reportFilesMap.put( + (new File(srcdir, newFiles[i])).getAbsolutePath(), + (new File(destdir, mapper.mapFileName(newFiles[i])[0])).getAbsolutePath() + ); + } + } + } + + + /** + * Performs the update of the selected report design files. + */ + protected void update() throws BuildException + { + Collection files = reportFilesMap.keySet(); + + if (files != null && files.size() > 0) + { + boolean isError = false; + + System.out.println("Updating " + files.size() + " report design files."); + + String srcFileName = null; + String destFileName = null; + File destFileParent = null; + + for (Iterator it = files.iterator(); it.hasNext();) + { + srcFileName = it.next(); + destFileName = reportFilesMap.get(srcFileName); + destFileParent = new File(destFileName).getParentFile(); + if(!destFileParent.exists()) + { + destFileParent.mkdirs(); + } + + try + { + System.out.print("File : " + srcFileName + " ... "); + + JasperDesign jasperDesign = JRXmlLoader.load(srcFileName); + + if (updaters != null) + { + for(int i = 0; i < updaters.size(); i++) + { + ReportUpdater updater = updaters.get(i).getUpdater(); + if (updater != null) + { + jasperDesign = updater.update(jasperDesign); + } + } + } + + new JRXmlWriter(jasperReportsContext).write(jasperDesign, destFileName, "UTF-8"); + + System.out.println("OK."); + } + catch(JRException e) + { + System.out.println("FAILED."); + System.out.println("Error updating report design : " + srcFileName); + e.printStackTrace(System.out); + isError = true; + } + } + + if(isError) + { + throw new BuildException("Errors were encountered when updating report designs."); + } + } + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/JRAntXmlExportTask.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/JRAntXmlExportTask.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/JRAntXmlExportTask.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/JRAntXmlExportTask.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,327 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.ant; + +import java.io.File; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JasperExportManager; +import net.sf.jasperreports.engine.JasperPrint; +import net.sf.jasperreports.engine.design.JRCompiler; +import net.sf.jasperreports.engine.util.JRLoader; + +import org.apache.tools.ant.AntClassLoader; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.DirectoryScanner; +import org.apache.tools.ant.types.Path; +import org.apache.tools.ant.types.Resource; +import org.apache.tools.ant.types.resources.FileResource; +import org.apache.tools.ant.util.RegexpPatternMapper; +import org.apache.tools.ant.util.SourceFileScanner; + + +/** + * Ant task for batch-exporting generated report files. + * Works like the built-in javac Ant task. + *

    + * This task can take the following arguments: + *

      + *
    • src + *
    • destdir + *
    + * Of these arguments, the src and destdir are required. + * When this task executes, it will recursively scan the src and + * destdir looking for generated report files to export. + * This task makes its export decision based on timestamp and only JRPRINT files + * that have no corresponding file in the target directory or where the destination report + * design file is older than the source file will be exported. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRAntXmlExportTask extends JRBaseAntTask +{ + + + /** + * + */ + private Path src; + private File destdir; + private Path classpath; + + private Map reportFilesMap; + + + /** + * Sets the source directories to find the XML report design files. + * + * @param srcdir source path + */ + public void setSrcdir(Path srcdir) + { + if (src == null) + { + src = srcdir; + } + else + { + src.append(srcdir); + } + } + + + /** + * Adds a path for export source. + * + * @return source path + */ + public Path createSrc() + { + if (src == null) + { + src = new Path(getProject()); + } + + return src.createPath(); + } + + + /** + * Sets the destination directory into which the report files should be exported. + * + * @param destdir destination directory + */ + public void setDestdir(File destdir) + { + this.destdir = destdir; + } + + + /** + * Adds a path to the classpath. + * + * @return classpath to use when updating the report + */ + public Path createClasspath() + { + if (classpath == null) + { + classpath = new Path(getProject()); + } + + return classpath.createPath(); + } + + + /** + * Executes the task. + */ + @Override + public void execute() throws BuildException + { + checkParameters(); + + reportFilesMap = new HashMap(); + + //JRProperties.setProperty(JRProperties.COMPILER_XML_VALIDATION, xmlvalidation);//FIXMECONTEXT is this needed? what about the one below? + + AntClassLoader classLoader = null; + if (classpath != null) + { + jasperReportsContext.setProperty(JRCompiler.COMPILER_CLASSPATH, String.valueOf(classpath)); + + ClassLoader parentClassLoader = getClass().getClassLoader(); + classLoader = new AntClassLoader(parentClassLoader, getProject(), classpath, true); + classLoader.setThreadContextLoader(); + } + + try + { + /* */ + scanSrc(); + /* */ + export(); + } + finally + { + if (classLoader != null) + { + classLoader.resetThreadContextLoader(); + } + } + } + + + /** + * Checks that all required attributes have been set and that the supplied values are valid. + */ + protected void checkParameters() throws BuildException + { + if (src == null || src.size() == 0) + { + throw + new BuildException( + "The srcdir attribute must be set.", + getLocation() + ); + } + + if (destdir != null && !destdir.isDirectory()) + { + throw + new BuildException( + "The destination directory \"" + + destdir + + "\" does not exist " + + "or is not a directory.", + getLocation() + ); + } + } + + + /** + * Scans the source directories looking for source files to be exported. + */ + protected void scanSrc() throws BuildException + { + for(@SuppressWarnings("unchecked") + Iterator it = src.iterator(); it.hasNext();) + { + Resource resource = it.next(); + FileResource fileResource = resource instanceof FileResource ? (FileResource)resource : null; + if (fileResource != null) + { + File file = fileResource.getFile(); + if (file.isDirectory()) + { + DirectoryScanner ds = getDirectoryScanner(file); + String[] files = ds.getIncludedFiles(); + + scanDir(file, destdir != null ? destdir : file, files); + } + else + { + String[] files = new String[]{fileResource.getName()}; + + scanDir(fileResource.getBaseDir(), destdir != null ? destdir : fileResource.getBaseDir(), files); + } + } +// else +// { +// //FIXME what to do? +// } + } + } + + + /** + * Scans the directory looking for source files to be exported. + * The results are returned in the instance variable reportFilesMap. + * + * @param srcdir source directory + * @param destdir destination directory + * @param files included file names + */ + protected void scanDir(File srcdir, File destdir, String[] files) + { + RegexpPatternMapper mapper = new RegexpPatternMapper(); + mapper.setFrom("^(.*)\\.(.*)$"); + mapper.setTo("\\1.jrpxml"); + + SourceFileScanner scanner = new SourceFileScanner(this); + String[] newFiles = scanner.restrict(files, srcdir, destdir, mapper); + + if (newFiles != null && newFiles.length > 0) + { + for (int i = 0; i < newFiles.length; i++) + { + reportFilesMap.put( + (new File(srcdir, newFiles[i])).getAbsolutePath(), + (new File(destdir, mapper.mapFileName(newFiles[i])[0])).getAbsolutePath() + ); + } + } + } + + + /** + * Performs the export of the selected report files. + */ + protected void export() throws BuildException + { + Collection files = reportFilesMap.keySet(); + + if (files != null && files.size() > 0) + { + boolean isError = false; + + System.out.println("Exporting " + files.size() + " report files."); + + String srcFileName = null; + String destFileName = null; + File destFileParent = null; + + for (Iterator it = files.iterator(); it.hasNext();) + { + srcFileName = it.next(); + destFileName = reportFilesMap.get(srcFileName); + destFileParent = new File(destFileName).getParentFile(); + if(!destFileParent.exists()) + { + destFileParent.mkdirs(); + } + + try + { + System.out.print("File : " + srcFileName + " ... "); + + JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObjectFromFile(srcFileName); + + JasperExportManager.getInstance(jasperReportsContext).exportToXmlFile(jasperPrint, destFileName, false); + + System.out.println("OK."); + } + catch(JRException e) + { + System.out.println("FAILED."); + System.out.println("Error updating report design : " + srcFileName); + e.printStackTrace(System.out); + isError = true; + } + } + + if(isError) + { + throw new BuildException("Errors were encountered when updating report designs."); + } + } + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/JRBaseAntTask.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/JRBaseAntTask.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/JRBaseAntTask.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/JRBaseAntTask.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/* + * Contributors: + * Henri Chen - henrichen@users.sourceforge.net + * Kees Kuip - keeskuip@users.sourceforge.net + */ +package net.sf.jasperreports.ant; + +import net.sf.jasperreports.engine.SimpleJasperReportsContext; + +import org.apache.tools.ant.taskdefs.MatchingTask; + + +/** + * Base class for JasperReports built-in Ant task implementations. + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRBaseAntTask extends MatchingTask +{ + + /** + * + */ + protected SimpleJasperReportsContext jasperReportsContext = new SimpleJasperReportsContext(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,138 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** +* Provides Ant task classes for batch-processing report files. +*
    +*

    Ant Tasks

    +* When the number of different report files that one has to deal with in a project is +* significant, there is a need for automating repeating or re-occurring tasks that are to be +* performed on those files. +*
    +* From a design point of view, the most notable operation that needs to be performed on +* report source files after they are finished and ready to be deployed is the report +* compilation. Sometimes reports need to be decompiled in order to reproduce their +* corresponding source files and perform additional design work on them, or when the +* same modification needs to be performed identically on all reports. +*
    +* For these re-occurring tasks, JasperReports provides built-in ready-to-use Ant task +* definitions, based on the {@link net.sf.jasperreports.ant.JRBaseAntTask JRBaseAntTask} class. +*
    +*

    Ant Task for Compiling Reports

    +* Since report template compilation is more like a design-time job than a runtime one, a +* custom Ant task has been provided with the library to simplify application development. +*
    +* This Ant task is implemented by the {@link net.sf.jasperreports.ant.JRAntCompileTask JRAntCompileTask} class. Its syntax and behavior are +* very similar to the built-in <javac> Ant task. +*
    +* The report template compilation task can be declared like this, in a project's build.xml +* file: +*
    +* <taskdef name="jrc" 
    +* classname="net.sf.jasperreports.ant.JRAntCompileTask"> 
    +*   <classpath> 
    +*     <fileset dir="./lib"> 
    +*       <include name="** /*.jar"/> 
    +*     </fileset> 
    +*   </classpath> 
    +* </taskdef> 
    +*
    +* In the preceding example, the lib folder should contain the jasperreports-x.x.x.jar file +* along with its other required libraries. +*
    +* You can then use this user-defined Ant task to compile multiple JRXML report template +* files in a single operation by specifying the root directory that contains those files or by +* selecting them using file patterns. +*
    +*

    Attributes of the Report Compilation Task

    +* Following is the list of attributes that can be used inside the Ant report compilation task +* to specify the source files, the destination directory, and other configuration properties: +*
      +*
    • srcdir: Location of the JRXML report template files to be compiled. Required unless nested <src> elements are present.
    • +*
    • destdir: Location to store the compiled report template files (the same as the source directory by default).
    • +*
    • compiler: Name of the class that implements the {@link net.sf.jasperreports.engine.design.JRCompiler JRCompiler} interface to be used for compiling the reports (optional).
    • +*
    • xmlvalidation: Flag to indicate whether the XML validation should be performed on the source report template files (true by default).
    • +*
    • tempdir: Location to store the temporarily generated files (the current working directory by default).
    • +*
    • keepjava: Flag to indicate if the temporary Java files generated on the fly should be kept and not deleted automatically (false by default).
    • +*
    +* The report template compilation task supports nested <src> and <classpath> +* elements, just like the Ant <javac> built-in task. +*
    +*

    Ant Task for Decompiling Reports

    +* Sometimes it happens that report templates are to be found only in their compiled form. +*
    +* The source report template files might have been lost and we might have only the +* compiled report template on which we need to make some modifications. +*
    +* In such cases, the Ant task for decompiling report template files that JasperReports +* provides becomes very handy. It is implemented by the {@link net.sf.jasperreports.ant.JRAntDecompileTask JRAntDecompileTask} class and its declaration inside a +* build.xml file should be as follows: +*
     
    +* <taskdef name="jrdc" 
    +* classname="net.sf.jasperreports.ant.JRAntDecompileTask"> 
    +*   <classpath refid="classpath"/> 
    +* </taskdef>
    +* 
    +* In the above example, the classpath should contain the jasperreports-x.x.x.jar file along with its other required +* libraries. +*
    +* This task works similarly to the report compilation task, but it does the reverse operation. +* The files to be decompiled can be specified using the srcdir attribute for their root +* folder or, for more sophisticated file match patterns, a nested <src> tag. The output +* folder for the generated files is specified using the destdir attribute. +*
    +*

    Ant Task for Updating Reports

    +* Although JasperReports always guarantees backward compatibility of report templates +* when upgrading to a newer version, sometimes tags or attributes in JRXML are +* deprecated and replaced with newer ones that offer enhanced capabilities. So while the +* deprecated attributes and tags still work, it is always advisable to use the latest syntax +* and thus get rid of the deprecation warnings. +*
    +* Upgrading a report template to the latest JasperReports syntax is very easy; all that needs +* to be done is to load the report and save it again using the API's utility classes, such as +* the {@link net.sf.jasperreports.engine.xml.JRXmlLoader JRXmlLoader} or {@link net.sf.jasperreports.engine.util.JRLoader JRLoader} +* and the {@link net.sf.jasperreports.engine.xml.JRXmlWriter JRXmlWriter}. +*
    +* This operation can be automated for any number of files using the Ant report update task +* provided by the JasperReports library in the +* {@link net.sf.jasperreports.ant.JRAntUpdateTask JRAntUpdateTask} class, which should have the +* following definition in a build.xml file: +*
    +* <taskdef name="jru" 
    +* classname="net.sf.jasperreports.ant.JRAntUpdateTask"> 
    +*   <classpath refid="classpath"/> 
    +* </taskdef>
    +* 
    +* This task is useful also in situations where the same modification needs to be applied on +* a number of different report files. The required modifications can be performed using the +* JasperReport API after the report design object has been loaded but before it is saved +* again. +*
    +*

    Related documentation:

    +*
    +* +*/ +package net.sf.jasperreports.ant; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/UpdaterElement.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/UpdaterElement.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/ant/UpdaterElement.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/ant/UpdaterElement.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.ant; + +import org.apache.tools.ant.BuildException; + +import net.sf.jasperreports.engine.util.ReportUpdater; + + +/** + * Utility class that provides a {@link net.sf.jasperreports.engine.util.ReportUpdater ReportUpdater} + * implementation + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class UpdaterElement +{ + + + /** + * + */ + private ReportUpdater updater; + + + /** + * + */ + public void addText(String className) + { + if (className != null) + { + try + { + Class clazz = JRAntCompileTask.class.getClassLoader().loadClass(className); + updater = (ReportUpdater)clazz.newInstance(); + } + catch (ClassNotFoundException e) + { + throw new BuildException(e); + } + catch (IllegalAccessException e) + { + throw new BuildException(e); + } + catch (InstantiationException e) + { + throw new BuildException(e); + } + } + } + + /** + * + */ + public ReportUpdater getUpdater() + { + return updater; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/ChartCopyBaseObjectFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/ChartCopyBaseObjectFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/ChartCopyBaseObjectFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/ChartCopyBaseObjectFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import net.sf.jasperreports.charts.ChartCopyObjectFactory; +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.engine.JRChart; + +/** + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class ChartCopyBaseObjectFactory implements ChartCopyObjectFactory +{ + + private static final ChartCopyBaseObjectFactory INSTANCE = new ChartCopyBaseObjectFactory(); + + public static ChartCopyBaseObjectFactory instance() + { + return INSTANCE; + } + + @Override + public JRItemLabel copyItemLabel(JRItemLabel itemLabel, JRChart chart) + { + return new JRBaseItemLabel(itemLabel, chart); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseAreaPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseAreaPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseAreaPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseAreaPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,300 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRAreaPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.base.JRBaseChartPlot; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRBaseAreaPlot extends JRBaseChartPlot implements JRAreaPlot +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + protected JRExpression categoryAxisLabelExpression; + protected JRFont categoryAxisLabelFont; + protected Color categoryAxisLabelColor; + protected JRFont categoryAxisTickLabelFont; + protected Color categoryAxisTickLabelColor; + protected String categoryAxisTickLabelMask; + protected Boolean categoryAxisVerticalTickLabels; + protected Color categoryAxisLineColor; + + protected JRExpression valueAxisLabelExpression; + protected JRExpression rangeAxisMinValueExpression; + protected JRExpression rangeAxisMaxValueExpression; + protected JRExpression domainAxisMinValueExpression; + protected JRExpression domainAxisMaxValueExpression; + protected JRFont valueAxisLabelFont; + protected Color valueAxisLabelColor; + protected JRFont valueAxisTickLabelFont; + protected Color valueAxisTickLabelColor; + protected String valueAxisTickLabelMask; + protected Boolean valueAxisVerticalTickLabels; + protected Color valueAxisLineColor; + + + /** + * + */ + public JRBaseAreaPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + + JRAreaPlot areaPlot = plot instanceof JRAreaPlot ? (JRAreaPlot)plot : null; + if (areaPlot != null)//FIXMECHART make a common interface and try copy props that are common to different plots + { + categoryAxisLabelFont = areaPlot.getCategoryAxisLabelFont(); + categoryAxisTickLabelFont = areaPlot.getCategoryAxisTickLabelFont(); + valueAxisLabelFont = areaPlot.getValueAxisLabelFont(); + valueAxisTickLabelFont = areaPlot.getValueAxisTickLabelFont(); + } + } + + + /** + * + */ + public JRBaseAreaPlot( JRAreaPlot areaPlot, JRBaseObjectFactory factory ) + { + super( areaPlot, factory ); + + categoryAxisLabelExpression = factory.getExpression( areaPlot.getCategoryAxisLabelExpression() ); + categoryAxisLabelFont = factory.getFont(chart, areaPlot.getCategoryAxisLabelFont()); + categoryAxisLabelColor = areaPlot.getOwnCategoryAxisLabelColor(); + categoryAxisTickLabelFont = factory.getFont(chart, areaPlot.getCategoryAxisTickLabelFont()); + categoryAxisTickLabelColor = areaPlot.getOwnCategoryAxisTickLabelColor(); + categoryAxisTickLabelMask = areaPlot.getCategoryAxisTickLabelMask(); + categoryAxisVerticalTickLabels = areaPlot.getCategoryAxisVerticalTickLabels(); + categoryAxisLineColor = areaPlot.getOwnCategoryAxisLineColor(); + labelRotationDouble = areaPlot.getCategoryAxisTickLabelRotation(); + + valueAxisLabelExpression = factory.getExpression( areaPlot.getValueAxisLabelExpression() ); + domainAxisMinValueExpression = factory.getExpression( areaPlot.getDomainAxisMinValueExpression() ); + domainAxisMaxValueExpression = factory.getExpression( areaPlot.getDomainAxisMaxValueExpression() ); + rangeAxisMinValueExpression = factory.getExpression( areaPlot.getRangeAxisMinValueExpression() ); + rangeAxisMaxValueExpression = factory.getExpression( areaPlot.getRangeAxisMaxValueExpression() ); + valueAxisLabelFont = factory.getFont(chart, areaPlot.getValueAxisLabelFont()); + valueAxisLabelColor = areaPlot.getOwnValueAxisLabelColor(); + valueAxisTickLabelFont = factory.getFont(chart, areaPlot.getValueAxisTickLabelFont()); + valueAxisTickLabelColor = areaPlot.getOwnValueAxisTickLabelColor(); + valueAxisTickLabelMask = areaPlot.getValueAxisTickLabelMask(); + valueAxisVerticalTickLabels = areaPlot.getValueAxisVerticalTickLabels(); + valueAxisLineColor = areaPlot.getOwnValueAxisLineColor(); + } + + @Override + public JRExpression getCategoryAxisLabelExpression(){ + return categoryAxisLabelExpression; + } + + @Override + public JRFont getCategoryAxisLabelFont() + { + return categoryAxisLabelFont; + } + + @Override + public Color getCategoryAxisLabelColor() + { + return getStyleResolver().getCategoryAxisLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLabelColor() + { + return categoryAxisLabelColor; + } + + @Override + public JRFont getCategoryAxisTickLabelFont() + { + return categoryAxisTickLabelFont; + } + + @Override + public Color getCategoryAxisTickLabelColor() + { + return getStyleResolver().getCategoryAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisTickLabelColor() + { + return categoryAxisTickLabelColor; + } + + @Override + public String getCategoryAxisTickLabelMask() + { + return categoryAxisTickLabelMask; + } + + @Override + public Boolean getCategoryAxisVerticalTickLabels() + { + return categoryAxisVerticalTickLabels; + } + + @Override + public Double getCategoryAxisTickLabelRotation() + { + return labelRotationDouble; + } + + @Override + public void setCategoryAxisTickLabelRotation(Double labelRotationDouble) + { + Object old = this.labelRotationDouble; + this.labelRotationDouble = labelRotationDouble; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_ROTATION, old, this.labelRotationDouble); + } + + @Override + public Color getCategoryAxisLineColor() + { + return getStyleResolver().getCategoryAxisLineColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLineColor() + { + return categoryAxisLineColor; + } + + @Override + public JRExpression getValueAxisLabelExpression(){ + return valueAxisLabelExpression; + } + + @Override + public JRExpression getDomainAxisMinValueExpression(){ + return domainAxisMinValueExpression; + } + + @Override + public JRExpression getDomainAxisMaxValueExpression(){ + return domainAxisMaxValueExpression; + } + + @Override + public JRExpression getRangeAxisMinValueExpression(){ + return rangeAxisMinValueExpression; + } + + @Override + public JRExpression getRangeAxisMaxValueExpression(){ + return rangeAxisMaxValueExpression; + } + + @Override + public JRFont getValueAxisLabelFont() + { + return valueAxisLabelFont; + } + + @Override + public Color getValueAxisLabelColor() + { + return getStyleResolver().getValueAxisLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisLabelColor() + { + return valueAxisLabelColor; + } + + @Override + public JRFont getValueAxisTickLabelFont() + { + return valueAxisTickLabelFont; + } + + @Override + public Color getValueAxisTickLabelColor() + { + return getStyleResolver().getValueAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisTickLabelColor() + { + return valueAxisTickLabelColor; + } + + @Override + public String getValueAxisTickLabelMask() + { + return valueAxisTickLabelMask; + } + + @Override + public Boolean getValueAxisVerticalTickLabels() + { + return valueAxisVerticalTickLabels; + } + + @Override + public Color getValueAxisLineColor() + { + return getStyleResolver().getValueAxisLineColor(this, this); + } + + @Override + public Color getOwnValueAxisLineColor() + { + return valueAxisLineColor; + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public Object clone(JRChart parentChart) + { + JRBaseAreaPlot clone = (JRBaseAreaPlot)super.clone(parentChart); + clone.categoryAxisLabelExpression = JRCloneUtils.nullSafeClone(categoryAxisLabelExpression); + clone.valueAxisLabelExpression = JRCloneUtils.nullSafeClone(valueAxisLabelExpression); + clone.domainAxisMinValueExpression = JRCloneUtils.nullSafeClone(domainAxisMinValueExpression); + clone.domainAxisMaxValueExpression = JRCloneUtils.nullSafeClone(domainAxisMaxValueExpression); + clone.rangeAxisMinValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMinValueExpression); + clone.rangeAxisMaxValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMaxValueExpression); + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseBar3DPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseBar3DPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseBar3DPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseBar3DPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,406 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.awt.Color; +import java.io.IOException; +import java.io.ObjectInputStream; + +import org.jfree.chart.renderer.category.BarRenderer3D; + +import net.sf.jasperreports.charts.ChartCopyObjectFactory; +import net.sf.jasperreports.charts.JRBar3DPlot; +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.base.JRBaseChartPlot; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRBaseBar3DPlot extends JRBaseChartPlot implements JRBar3DPlot +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_SHOW_LABELS = "isShowLabels"; + + public static final String PROPERTY_X_OFFSET = "xOffset"; + + public static final String PROPERTY_Y_OFFSET = "yOffset"; + + protected JRExpression categoryAxisLabelExpression; + protected JRFont categoryAxisLabelFont; + protected Color categoryAxisLabelColor; + protected JRFont categoryAxisTickLabelFont; + protected Color categoryAxisTickLabelColor; + protected String categoryAxisTickLabelMask; + protected Boolean categoryAxisVerticalTickLabels; + protected Color categoryAxisLineColor; + + protected JRExpression valueAxisLabelExpression; + protected JRExpression rangeAxisMinValueExpression; + protected JRExpression rangeAxisMaxValueExpression; + protected JRExpression domainAxisMinValueExpression; + protected JRExpression domainAxisMaxValueExpression; + protected JRFont valueAxisLabelFont; + protected Color valueAxisLabelColor; + protected JRFont valueAxisTickLabelFont; + protected Color valueAxisTickLabelColor; + protected String valueAxisTickLabelMask; + protected Boolean valueAxisVerticalTickLabels; + protected Color valueAxisLineColor; + + protected JRItemLabel itemLabel; + + private Double xOffsetDouble; + private Double yOffsetDouble; + private Boolean showLabels; + + /** + * + */ + public JRBaseBar3DPlot(JRChartPlot plot, JRChart chart) + { + this(plot, chart, ChartCopyBaseObjectFactory.instance()); + } + + protected JRBaseBar3DPlot(JRChartPlot plot, JRChart chart, ChartCopyObjectFactory copyObjectFactory) + { + super(plot, chart); + + JRBar3DPlot barPlot = plot instanceof JRBar3DPlot ? (JRBar3DPlot)plot : null; + if (barPlot == null) + { + itemLabel = copyObjectFactory.copyItemLabel(null, chart); + } + else + { + categoryAxisLabelFont = barPlot.getCategoryAxisLabelFont(); + categoryAxisTickLabelFont = getCategoryAxisTickLabelFont(); + valueAxisLabelFont = barPlot.getValueAxisLabelFont(); + valueAxisTickLabelFont = barPlot.getValueAxisTickLabelFont(); + itemLabel = copyObjectFactory.copyItemLabel(barPlot.getItemLabel(), chart); + } + } + + + /** + * + */ + public JRBaseBar3DPlot(JRBar3DPlot barPlot, JRBaseObjectFactory factory ) + { + super( barPlot, factory ); + + xOffsetDouble = barPlot.getXOffsetDouble(); + yOffsetDouble = barPlot.getYOffsetDouble(); + showLabels = barPlot.getShowLabels(); + + categoryAxisLabelExpression = factory.getExpression( barPlot.getCategoryAxisLabelExpression() ); + categoryAxisLabelFont = factory.getFont(chart, barPlot.getCategoryAxisLabelFont()); + categoryAxisLabelColor = barPlot.getOwnCategoryAxisLabelColor(); + categoryAxisTickLabelFont = factory.getFont(chart, barPlot.getCategoryAxisTickLabelFont()); + categoryAxisTickLabelColor = barPlot.getOwnCategoryAxisTickLabelColor(); + categoryAxisTickLabelMask = barPlot.getCategoryAxisTickLabelMask(); + categoryAxisVerticalTickLabels = barPlot.getCategoryAxisVerticalTickLabels(); + categoryAxisLineColor = barPlot.getOwnCategoryAxisLineColor(); + labelRotationDouble = barPlot.getCategoryAxisTickLabelRotation(); + + valueAxisLabelExpression = factory.getExpression( barPlot.getValueAxisLabelExpression() ); + domainAxisMinValueExpression = factory.getExpression( barPlot.getDomainAxisMinValueExpression() ); + domainAxisMaxValueExpression = factory.getExpression( barPlot.getDomainAxisMaxValueExpression() ); + rangeAxisMinValueExpression = factory.getExpression( barPlot.getRangeAxisMinValueExpression() ); + rangeAxisMaxValueExpression = factory.getExpression( barPlot.getRangeAxisMaxValueExpression() ); + valueAxisLabelFont = factory.getFont(chart, barPlot.getValueAxisLabelFont()); + valueAxisLabelColor = barPlot.getOwnValueAxisLabelColor(); + valueAxisTickLabelFont = factory.getFont(chart, barPlot.getValueAxisTickLabelFont()); + valueAxisTickLabelColor = barPlot.getOwnValueAxisTickLabelColor(); + valueAxisTickLabelMask = barPlot.getValueAxisTickLabelMask(); + valueAxisVerticalTickLabels = barPlot.getValueAxisVerticalTickLabels(); + valueAxisLineColor = barPlot.getOwnValueAxisLineColor(); + itemLabel = new JRBaseItemLabel(barPlot.getItemLabel(), factory); + } + + @Override + public JRExpression getCategoryAxisLabelExpression(){ + return categoryAxisLabelExpression; + } + + @Override + public JRFont getCategoryAxisLabelFont() + { + return categoryAxisLabelFont; + } + + @Override + public Color getCategoryAxisLabelColor() + { + return getStyleResolver().getCategoryAxisLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLabelColor() + { + return categoryAxisLabelColor; + } + + @Override + public JRFont getCategoryAxisTickLabelFont() + { + return categoryAxisTickLabelFont; + } + + @Override + public Color getCategoryAxisTickLabelColor() + { + return getStyleResolver().getCategoryAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisTickLabelColor() + { + return categoryAxisTickLabelColor; + } + + @Override + public String getCategoryAxisTickLabelMask() + { + return categoryAxisTickLabelMask; + } + + @Override + public Boolean getCategoryAxisVerticalTickLabels() + { + return categoryAxisVerticalTickLabels; + } + + @Override + public Double getCategoryAxisTickLabelRotation() + { + return labelRotationDouble; + } + + @Override + public void setCategoryAxisTickLabelRotation(Double labelRotationDouble) + { + Object old = this.labelRotationDouble; + this.labelRotationDouble = labelRotationDouble; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_ROTATION, old, this.labelRotationDouble); + } + + @Override + public Color getCategoryAxisLineColor() + { + return getStyleResolver().getCategoryAxisLineColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLineColor() + { + return categoryAxisLineColor; + } + + @Override + public JRExpression getValueAxisLabelExpression(){ + return valueAxisLabelExpression; + } + + @Override + public JRExpression getRangeAxisMinValueExpression(){ + return rangeAxisMinValueExpression; + } + + @Override + public JRExpression getRangeAxisMaxValueExpression(){ + return rangeAxisMaxValueExpression; + } + + @Override + public JRExpression getDomainAxisMinValueExpression(){ + return domainAxisMinValueExpression; + } + + @Override + public JRExpression getDomainAxisMaxValueExpression(){ + return domainAxisMaxValueExpression; + } + + @Override + public JRFont getValueAxisLabelFont() + { + return valueAxisLabelFont; + } + + @Override + public Color getValueAxisLabelColor() + { + return getStyleResolver().getValueAxisLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisLabelColor() + { + return valueAxisLabelColor; + } + + @Override + public JRFont getValueAxisTickLabelFont() + { + return valueAxisTickLabelFont; + } + + @Override + public Color getValueAxisTickLabelColor() + { + return getStyleResolver().getValueAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisTickLabelColor() + { + return valueAxisTickLabelColor; + } + + @Override + public String getValueAxisTickLabelMask() + { + return valueAxisTickLabelMask; + } + + @Override + public Boolean getValueAxisVerticalTickLabels() + { + return valueAxisVerticalTickLabels; + } + + @Override + public Color getValueAxisLineColor() + { + return getStyleResolver().getValueAxisLineColor(this, this); + } + + @Override + public Color getOwnValueAxisLineColor() + { + return valueAxisLineColor; + } + + @Override + public Double getXOffsetDouble(){ + return xOffsetDouble; + } + + @Override + public JRItemLabel getItemLabel() + { + return itemLabel; + } + + @Override + public void setXOffset( Double xOffset ){ + Double old = this.xOffsetDouble; + this.xOffsetDouble = xOffset; + getEventSupport().firePropertyChange(PROPERTY_X_OFFSET, old, this.xOffsetDouble); + } + + @Override + public Double getYOffsetDouble(){ + return yOffsetDouble; + } + + @Override + public void setYOffset( Double yOffset ){ + Double old = this.yOffsetDouble; + this.yOffsetDouble = yOffset; + getEventSupport().firePropertyChange(PROPERTY_Y_OFFSET, old, this.yOffsetDouble); + } + + @Override + public Boolean getShowLabels(){ + return showLabels; + } + + @Override + public void setShowLabels( Boolean showLabels ){ + Boolean old = this.showLabels; + this.showLabels = showLabels; + getEventSupport().firePropertyChange(PROPERTY_SHOW_LABELS, old, this.showLabels); + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public Object clone(JRChart parentChart) + { + JRBaseBar3DPlot clone = (JRBaseBar3DPlot)super.clone(parentChart); + clone.categoryAxisLabelExpression = JRCloneUtils.nullSafeClone(categoryAxisLabelExpression); + clone.valueAxisLabelExpression = JRCloneUtils.nullSafeClone(valueAxisLabelExpression); + clone.domainAxisMinValueExpression = JRCloneUtils.nullSafeClone(domainAxisMinValueExpression); + clone.domainAxisMaxValueExpression = JRCloneUtils.nullSafeClone(domainAxisMaxValueExpression); + clone.rangeAxisMinValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMinValueExpression); + clone.rangeAxisMaxValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMaxValueExpression); + clone.itemLabel = itemLabel == null ? null : itemLabel.clone(parentChart); + return clone; + } + + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private double xOffset = BarRenderer3D.DEFAULT_X_OFFSET; + /** + * @deprecated + */ + private double yOffset = BarRenderer3D.DEFAULT_Y_OFFSET; + /** + * @deprecated + */ + private boolean isShowLabels; + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_0) + { + xOffsetDouble = new Double(xOffset); + yOffsetDouble = new Double(yOffset); + showLabels = Boolean.valueOf(isShowLabels); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseBarPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseBarPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseBarPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseBarPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,416 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.awt.Color; +import java.io.IOException; +import java.io.ObjectInputStream; + +import net.sf.jasperreports.charts.ChartCopyObjectFactory; +import net.sf.jasperreports.charts.JRBarPlot; +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.base.JRBaseChartPlot; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRBaseBarPlot extends JRBaseChartPlot implements JRBarPlot +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_SHOW_LABELS = "isShowLabels"; + + public static final String PROPERTY_SHOW_TICK_LABELS = "isShowTickLabels"; + + public static final String PROPERTY_SHOW_TICK_MARKS = "isShowTickMarks"; + + protected JRExpression categoryAxisLabelExpression; + protected JRFont categoryAxisLabelFont; + protected Color categoryAxisLabelColor; + protected JRFont categoryAxisTickLabelFont; + protected Color categoryAxisTickLabelColor; + protected String categoryAxisTickLabelMask; + protected Boolean categoryAxisVerticalTickLabels; + protected Color categoryAxisLineColor; + + protected JRExpression valueAxisLabelExpression; + protected JRExpression rangeAxisMinValueExpression; + protected JRExpression rangeAxisMaxValueExpression; + protected JRExpression domainAxisMinValueExpression; + protected JRExpression domainAxisMaxValueExpression; + protected JRFont valueAxisLabelFont; + protected Color valueAxisLabelColor; + protected JRFont valueAxisTickLabelFont; + protected Color valueAxisTickLabelColor; + protected String valueAxisTickLabelMask; + protected Boolean valueAxisVerticalTickLabels; + protected Color valueAxisLineColor; + + protected Boolean showTickMarks; + protected Boolean showTickLabels; + protected Boolean showLabels; + + protected JRItemLabel itemLabel; + + + /** + * + */ + public JRBaseBarPlot(JRChartPlot plot, JRChart chart) + { + this(plot, chart, ChartCopyBaseObjectFactory.instance()); + } + + protected JRBaseBarPlot(JRChartPlot plot, JRChart chart, ChartCopyObjectFactory copyObjectFactory) + { + super(plot, chart); + + JRBarPlot barPlot = plot instanceof JRBarPlot ? (JRBarPlot)plot : null; + if (barPlot == null) + { + itemLabel = copyObjectFactory.copyItemLabel(null, chart); + } + else + { + categoryAxisLabelFont = barPlot.getCategoryAxisLabelFont(); + categoryAxisTickLabelFont = barPlot.getCategoryAxisTickLabelFont(); + valueAxisLabelFont = barPlot.getValueAxisLabelFont(); + valueAxisTickLabelFont = barPlot.getValueAxisTickLabelFont(); + itemLabel = copyObjectFactory.copyItemLabel(barPlot.getItemLabel(), chart); + } + } + + /** + * + */ + public JRBaseBarPlot(JRBarPlot barPlot, JRBaseObjectFactory factory) + { + super(barPlot, factory); + + showTickMarks = barPlot.getShowTickMarks(); + showTickLabels = barPlot.getShowTickLabels(); + showLabels = barPlot.getShowLabels(); + + categoryAxisLabelExpression = factory.getExpression( barPlot.getCategoryAxisLabelExpression() ); + categoryAxisLabelFont = factory.getFont(chart, barPlot.getCategoryAxisLabelFont()); + categoryAxisLabelColor = barPlot.getOwnCategoryAxisLabelColor(); + categoryAxisTickLabelFont = factory.getFont(chart, barPlot.getCategoryAxisTickLabelFont()); + categoryAxisTickLabelColor = barPlot.getOwnCategoryAxisTickLabelColor(); + categoryAxisTickLabelMask = barPlot.getCategoryAxisTickLabelMask(); + categoryAxisVerticalTickLabels = barPlot.getCategoryAxisVerticalTickLabels(); + categoryAxisLineColor = barPlot.getOwnCategoryAxisLineColor(); + labelRotationDouble = barPlot.getCategoryAxisTickLabelRotation(); + + valueAxisLabelExpression = factory.getExpression( barPlot.getValueAxisLabelExpression() ); + domainAxisMinValueExpression = factory.getExpression( barPlot.getDomainAxisMinValueExpression() ); + domainAxisMaxValueExpression = factory.getExpression( barPlot.getDomainAxisMaxValueExpression() ); + rangeAxisMinValueExpression = factory.getExpression( barPlot.getRangeAxisMinValueExpression() ); + rangeAxisMaxValueExpression = factory.getExpression( barPlot.getRangeAxisMaxValueExpression() ); + valueAxisLabelFont = factory.getFont(chart, barPlot.getValueAxisLabelFont()); + valueAxisLabelColor = barPlot.getOwnValueAxisLabelColor(); + valueAxisTickLabelFont = factory.getFont(chart, barPlot.getValueAxisTickLabelFont()); + valueAxisTickLabelColor = barPlot.getOwnValueAxisTickLabelColor(); + valueAxisTickLabelMask = barPlot.getValueAxisTickLabelMask(); + valueAxisVerticalTickLabels = barPlot.getValueAxisVerticalTickLabels(); + valueAxisLineColor = barPlot.getOwnValueAxisLineColor(); + + itemLabel = new JRBaseItemLabel(barPlot.getItemLabel(), factory); + } + + @Override + public JRExpression getCategoryAxisLabelExpression(){ + return categoryAxisLabelExpression; + } + + @Override + public JRFont getCategoryAxisLabelFont() + { + return categoryAxisLabelFont; + } + + @Override + public Color getCategoryAxisLabelColor() + { + return getStyleResolver().getCategoryAxisLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLabelColor() + { + return categoryAxisLabelColor; + } + + @Override + public JRFont getCategoryAxisTickLabelFont() + { + return categoryAxisTickLabelFont; + } + + @Override + public Color getCategoryAxisTickLabelColor() + { + return getStyleResolver().getCategoryAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisTickLabelColor() + { + return categoryAxisTickLabelColor; + } + + @Override + public String getCategoryAxisTickLabelMask() + { + return categoryAxisTickLabelMask; + } + + @Override + public Boolean getCategoryAxisVerticalTickLabels() + { + return categoryAxisVerticalTickLabels; + } + + @Override + public Double getCategoryAxisTickLabelRotation() + { + return labelRotationDouble; + } + + @Override + public void setCategoryAxisTickLabelRotation(Double labelRotationDouble) + { + Object old = this.labelRotationDouble; + this.labelRotationDouble = labelRotationDouble; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_ROTATION, old, this.labelRotationDouble); + } + + @Override + public Color getCategoryAxisLineColor() + { + return getStyleResolver().getCategoryAxisLineColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLineColor() + { + return categoryAxisLineColor; + } + + @Override + public JRExpression getValueAxisLabelExpression(){ + return valueAxisLabelExpression; + } + + @Override + public JRExpression getDomainAxisMinValueExpression(){ + return domainAxisMinValueExpression; + } + + @Override + public JRExpression getDomainAxisMaxValueExpression(){ + return domainAxisMaxValueExpression; + } + + @Override + public JRExpression getRangeAxisMinValueExpression(){ + return rangeAxisMinValueExpression; + } + + @Override + public JRExpression getRangeAxisMaxValueExpression(){ + return rangeAxisMaxValueExpression; + } + + @Override + public JRFont getValueAxisLabelFont() + { + return valueAxisLabelFont; + } + + @Override + public Color getValueAxisLabelColor() + { + return getStyleResolver().getValueAxisLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisLabelColor() + { + return valueAxisLabelColor; + } + + @Override + public JRFont getValueAxisTickLabelFont() + { + return valueAxisTickLabelFont; + } + + @Override + public Color getValueAxisTickLabelColor() + { + return getStyleResolver().getValueAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisTickLabelColor() + { + return valueAxisTickLabelColor; + } + + @Override + public String getValueAxisTickLabelMask() + { + return valueAxisTickLabelMask; + } + + @Override + public Boolean getValueAxisVerticalTickLabels() + { + return valueAxisVerticalTickLabels; + } + + @Override + public Color getValueAxisLineColor() + { + return getStyleResolver().getValueAxisLineColor(this, this); + } + + @Override + public Color getOwnValueAxisLineColor() + { + return valueAxisLineColor; + } + + @Override + public Boolean getShowLabels(){ + return showLabels; + } + + @Override + public JRItemLabel getItemLabel() + { + return itemLabel; + } + + @Override + public void setShowLabels( Boolean showLabels ){ + Boolean old = this.showLabels; + this.showLabels = showLabels; + getEventSupport().firePropertyChange(PROPERTY_SHOW_LABELS, old, this.showLabels); + } + + + @Override + public Boolean getShowTickMarks() + { + return showTickMarks; + } + + @Override + public void setShowTickMarks(Boolean isShowTickMarks) + { + Boolean old = this.showTickMarks; + this.showTickMarks = isShowTickMarks; + getEventSupport().firePropertyChange(PROPERTY_SHOW_TICK_MARKS, old, this.showTickMarks); + } + + @Override + public Boolean getShowTickLabels() + { + return showTickLabels; + } + + @Override + public void setShowTickLabels(Boolean showTickLabels) + { + Boolean old = this.showTickLabels; + this.showTickLabels = showTickLabels; + getEventSupport().firePropertyChange(PROPERTY_SHOW_TICK_LABELS, old, this.showTickLabels); + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public Object clone(JRChart parentChart) + { + JRBaseBarPlot clone = (JRBaseBarPlot)super.clone(parentChart); + clone.categoryAxisLabelExpression = JRCloneUtils.nullSafeClone(categoryAxisLabelExpression); + clone.valueAxisLabelExpression = JRCloneUtils.nullSafeClone(valueAxisLabelExpression); + clone.domainAxisMinValueExpression = JRCloneUtils.nullSafeClone(domainAxisMinValueExpression); + clone.domainAxisMaxValueExpression = JRCloneUtils.nullSafeClone(domainAxisMaxValueExpression); + clone.rangeAxisMinValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMinValueExpression); + clone.rangeAxisMaxValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMaxValueExpression); + clone.itemLabel = itemLabel == null ? null : itemLabel.clone(parentChart); + return clone; + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private boolean isShowTickMarks; + /** + * @deprecated + */ + private boolean isShowTickLabels = true; + /** + * @deprecated + */ + private boolean isShowLabels = true; + + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_0) + { + showTickMarks = Boolean.valueOf(isShowTickMarks); + showTickLabels = Boolean.valueOf(isShowTickLabels); + showLabels = Boolean.valueOf(isShowLabels); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseBubblePlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseBubblePlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseBubblePlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseBubblePlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,339 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.awt.Color; +import java.io.IOException; +import java.io.ObjectInputStream; + +import org.jfree.chart.renderer.xy.XYBubbleRenderer; + +import net.sf.jasperreports.charts.JRBubblePlot; +import net.sf.jasperreports.charts.type.ScaleTypeEnum; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.base.JRBaseChartPlot; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRBaseBubblePlot extends JRBaseChartPlot implements JRBubblePlot { + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_SCALE_TYPE = "scaleType"; + + protected JRExpression xAxisLabelExpression; + protected JRFont xAxisLabelFont; + protected Color xAxisLabelColor; + protected JRFont xAxisTickLabelFont; + protected Color xAxisTickLabelColor; + protected String xAxisTickLabelMask; + protected Boolean xAxisVerticalTickLabels; + protected Color xAxisLineColor; + + protected JRExpression yAxisLabelExpression; + protected JRFont yAxisLabelFont; + protected Color yAxisLabelColor; + protected JRFont yAxisTickLabelFont; + protected Color yAxisTickLabelColor; + protected String yAxisTickLabelMask; + protected Boolean yAxisVerticalTickLabels; + protected Color yAxisLineColor; + + protected JRExpression domainAxisMinValueExpression; + protected JRExpression domainAxisMaxValueExpression; + protected JRExpression rangeAxisMinValueExpression; + protected JRExpression rangeAxisMaxValueExpression; + protected ScaleTypeEnum scaleTypeValue; + + + /** + * + */ + public JRBaseBubblePlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + + JRBubblePlot bubblePlot = plot instanceof JRBubblePlot ? (JRBubblePlot)plot : null; + if (bubblePlot != null) + { + xAxisLabelFont = bubblePlot.getXAxisLabelFont(); + xAxisTickLabelFont = bubblePlot.getXAxisTickLabelFont(); + yAxisLabelFont = bubblePlot.getYAxisLabelFont(); + yAxisTickLabelFont = bubblePlot.getYAxisTickLabelFont(); + } + } + + + /** + * + */ + public JRBaseBubblePlot(JRBubblePlot bubblePlot, JRBaseObjectFactory factory ) + { + super( bubblePlot, factory ); + + scaleTypeValue = bubblePlot.getScaleTypeValue(); + + xAxisLabelExpression = factory.getExpression( bubblePlot.getXAxisLabelExpression() ); + xAxisLabelFont = factory.getFont(chart, bubblePlot.getXAxisLabelFont()); + xAxisLabelColor = bubblePlot.getOwnXAxisLabelColor(); + xAxisTickLabelFont = factory.getFont(chart, bubblePlot.getXAxisTickLabelFont()); + xAxisTickLabelColor = bubblePlot.getOwnXAxisTickLabelColor(); + xAxisTickLabelMask = bubblePlot.getXAxisTickLabelMask(); + xAxisVerticalTickLabels = bubblePlot.getXAxisVerticalTickLabels(); + xAxisLineColor = bubblePlot.getOwnXAxisLineColor(); + + yAxisLabelExpression = factory.getExpression( bubblePlot.getYAxisLabelExpression() ); + yAxisLabelFont = factory.getFont(chart, bubblePlot.getYAxisLabelFont()); + yAxisLabelColor = bubblePlot.getOwnYAxisLabelColor(); + yAxisTickLabelFont = factory.getFont(chart, bubblePlot.getYAxisTickLabelFont()); + yAxisTickLabelColor = bubblePlot.getOwnYAxisTickLabelColor(); + yAxisTickLabelMask = bubblePlot.getYAxisTickLabelMask(); + yAxisVerticalTickLabels = bubblePlot.getYAxisVerticalTickLabels(); + yAxisLineColor = bubblePlot.getOwnYAxisLineColor(); + + domainAxisMinValueExpression = factory.getExpression( bubblePlot.getDomainAxisMinValueExpression() ); + domainAxisMaxValueExpression = factory.getExpression( bubblePlot.getDomainAxisMaxValueExpression() ); + rangeAxisMinValueExpression = factory.getExpression( bubblePlot.getRangeAxisMinValueExpression() ); + rangeAxisMaxValueExpression = factory.getExpression( bubblePlot.getRangeAxisMaxValueExpression() ); + } + + @Override + public JRExpression getXAxisLabelExpression(){ + return xAxisLabelExpression; + } + + @Override + public JRFont getXAxisLabelFont() + { + return xAxisLabelFont; + } + + @Override + public Color getXAxisLabelColor() + { + return getStyleResolver().getXAxisLabelColor(this, this); + } + + @Override + public Color getOwnXAxisLabelColor() + { + return xAxisLabelColor; + } + + @Override + public JRFont getXAxisTickLabelFont() + { + return xAxisTickLabelFont; + } + + @Override + public Color getXAxisTickLabelColor() + { + return getStyleResolver().getXAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnXAxisTickLabelColor() + { + return xAxisTickLabelColor; + } + + @Override + public String getXAxisTickLabelMask() + { + return xAxisTickLabelMask; + } + + @Override + public Boolean getXAxisVerticalTickLabels() + { + return xAxisVerticalTickLabels; + } + + @Override + public Color getXAxisLineColor() + { + return getStyleResolver().getXAxisLineColor(this, this); + } + + @Override + public Color getOwnXAxisLineColor() + { + return xAxisLineColor; + } + + @Override + public JRExpression getYAxisLabelExpression(){ + return yAxisLabelExpression; + } + + @Override + public JRFont getYAxisLabelFont() + { + return yAxisLabelFont; + } + + @Override + public Color getYAxisLabelColor() + { + return getStyleResolver().getYAxisLabelColor(this, this); + } + + @Override + public Color getOwnYAxisLabelColor() + { + return yAxisLabelColor; + } + + @Override + public JRFont getYAxisTickLabelFont() + { + return yAxisTickLabelFont; + } + + @Override + public Color getYAxisTickLabelColor() + { + return getStyleResolver().getYAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnYAxisTickLabelColor() + { + return yAxisTickLabelColor; + } + + @Override + public String getYAxisTickLabelMask() + { + return yAxisTickLabelMask; + } + + @Override + public Boolean getYAxisVerticalTickLabels() + { + return yAxisVerticalTickLabels; + } + + @Override + public Color getYAxisLineColor() + { + return getStyleResolver().getYAxisLineColor(this, this); + } + + @Override + public Color getOwnYAxisLineColor() + { + return yAxisLineColor; + } + + @Override + public ScaleTypeEnum getScaleTypeValue(){ + return scaleTypeValue; + } + + @Override + public JRExpression getDomainAxisMinValueExpression(){ + return domainAxisMinValueExpression; + } + + @Override + public JRExpression getDomainAxisMaxValueExpression(){ + return domainAxisMaxValueExpression; + } + + @Override + public JRExpression getRangeAxisMinValueExpression(){ + return rangeAxisMinValueExpression; + } + + @Override + public JRExpression getRangeAxisMaxValueExpression(){ + return rangeAxisMaxValueExpression; + } + + @Override + public void setScaleType( ScaleTypeEnum scaleTypeValue ){ + ScaleTypeEnum old = this.scaleTypeValue; + this.scaleTypeValue = scaleTypeValue; + getEventSupport().firePropertyChange(PROPERTY_SCALE_TYPE, old, this.scaleTypeValue); + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public Object clone(JRChart parentChart) + { + JRBaseBubblePlot clone = (JRBaseBubblePlot)super.clone(parentChart); + clone.xAxisLabelExpression = JRCloneUtils.nullSafeClone(xAxisLabelExpression); + clone.yAxisLabelExpression = JRCloneUtils.nullSafeClone(yAxisLabelExpression); + clone.domainAxisMinValueExpression = JRCloneUtils.nullSafeClone(domainAxisMinValueExpression); + clone.domainAxisMaxValueExpression = JRCloneUtils.nullSafeClone(domainAxisMaxValueExpression); + clone.rangeAxisMinValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMinValueExpression); + clone.rangeAxisMaxValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMaxValueExpression); + return clone; + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private int scaleType = XYBubbleRenderer.SCALE_ON_RANGE_AXIS; + /** + * @deprecated + */ + private Integer scaleTypeInteger; + + @SuppressWarnings("deprecation") + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_0) + { + scaleTypeValue = ScaleTypeEnum.getByValue(scaleType); + } + else if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2) + { + scaleTypeValue = ScaleTypeEnum.getByValue(scaleTypeInteger); + scaleTypeInteger = null; + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseCandlestickPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseCandlestickPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseCandlestickPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseCandlestickPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,334 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.awt.Color; +import java.io.IOException; +import java.io.ObjectInputStream; + +import net.sf.jasperreports.charts.JRCandlestickPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.base.JRBaseChartPlot; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRBaseCandlestickPlot extends JRBaseChartPlot implements JRCandlestickPlot +{ + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_SHOW_VOLUME = "isShowVolume"; + + protected JRExpression timeAxisLabelExpression; + protected JRFont timeAxisLabelFont; + protected Color timeAxisLabelColor; + protected JRFont timeAxisTickLabelFont; + protected Color timeAxisTickLabelColor; + protected String timeAxisTickLabelMask; + protected Boolean timeAxisVerticalTickLabels; + protected Color timeAxisLineColor; + + protected JRExpression valueAxisLabelExpression; + protected JRExpression rangeAxisMinValueExpression; + protected JRExpression rangeAxisMaxValueExpression; + protected JRExpression domainAxisMinValueExpression; + protected JRExpression domainAxisMaxValueExpression; + protected JRFont valueAxisLabelFont; + protected Color valueAxisLabelColor; + protected JRFont valueAxisTickLabelFont; + protected Color valueAxisTickLabelColor; + protected String valueAxisTickLabelMask; + protected Boolean valueAxisVerticalTickLabels; + protected Color valueAxisLineColor; + + protected Boolean showVolume; + + /** + * + */ + protected JRBaseCandlestickPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + + JRCandlestickPlot candlestickPlot = plot instanceof JRCandlestickPlot ? (JRCandlestickPlot)plot : null; + if (candlestickPlot != null) + { + timeAxisLabelFont = candlestickPlot.getTimeAxisLabelFont(); + timeAxisTickLabelFont = candlestickPlot.getTimeAxisTickLabelFont(); + valueAxisLabelFont = candlestickPlot.getValueAxisLabelFont(); + valueAxisTickLabelFont = candlestickPlot.getValueAxisTickLabelFont(); + } + } + + + /** + * + */ + public JRBaseCandlestickPlot(JRCandlestickPlot candlestickPlot, JRBaseObjectFactory factory) + { + super(candlestickPlot, factory); + + showVolume = candlestickPlot.getShowVolume(); + + timeAxisLabelExpression = factory.getExpression( candlestickPlot.getTimeAxisLabelExpression() ); + timeAxisLabelFont = factory.getFont(chart, candlestickPlot.getTimeAxisLabelFont()); + timeAxisLabelColor = candlestickPlot.getOwnTimeAxisLabelColor(); + timeAxisTickLabelFont = factory.getFont(chart, candlestickPlot.getTimeAxisTickLabelFont()); + timeAxisTickLabelColor = candlestickPlot.getOwnTimeAxisTickLabelColor(); + timeAxisTickLabelMask = candlestickPlot.getTimeAxisTickLabelMask(); + timeAxisVerticalTickLabels = candlestickPlot.getTimeAxisVerticalTickLabels(); + timeAxisLineColor = candlestickPlot.getOwnTimeAxisLineColor(); + + valueAxisLabelExpression = factory.getExpression( candlestickPlot.getValueAxisLabelExpression() ); + domainAxisMinValueExpression = factory.getExpression( candlestickPlot.getDomainAxisMinValueExpression() ); + domainAxisMaxValueExpression = factory.getExpression( candlestickPlot.getDomainAxisMaxValueExpression() ); + rangeAxisMinValueExpression = factory.getExpression( candlestickPlot.getRangeAxisMinValueExpression() ); + rangeAxisMaxValueExpression = factory.getExpression( candlestickPlot.getRangeAxisMaxValueExpression() ); + valueAxisLabelFont = factory.getFont(chart, candlestickPlot.getValueAxisLabelFont()); + valueAxisLabelColor = candlestickPlot.getOwnValueAxisLabelColor(); + valueAxisTickLabelFont = factory.getFont(chart, candlestickPlot.getValueAxisTickLabelFont()); + valueAxisTickLabelColor = candlestickPlot.getOwnValueAxisTickLabelColor(); + valueAxisTickLabelMask = candlestickPlot.getValueAxisTickLabelMask(); + valueAxisVerticalTickLabels = candlestickPlot.getValueAxisVerticalTickLabels(); + valueAxisLineColor = candlestickPlot.getOwnValueAxisTickLabelColor(); + } + + + @Override + public JRExpression getTimeAxisLabelExpression(){ + return timeAxisLabelExpression; + } + + @Override + public JRFont getTimeAxisLabelFont() + { + return timeAxisLabelFont; + } + + @Override + public Color getTimeAxisLabelColor() + { + return getStyleResolver().getTimeAxisLabelColor(this, this); + } + + @Override + public Color getOwnTimeAxisLabelColor() + { + return timeAxisLabelColor; + } + + @Override + public JRFont getTimeAxisTickLabelFont() + { + return timeAxisTickLabelFont; + } + + @Override + public Color getTimeAxisTickLabelColor() + { + return getStyleResolver().getTimeAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnTimeAxisTickLabelColor() + { + return timeAxisTickLabelColor; + } + + @Override + public String getTimeAxisTickLabelMask() + { + return timeAxisTickLabelMask; + } + + @Override + public Boolean getTimeAxisVerticalTickLabels() + { + return timeAxisVerticalTickLabels; + } + + @Override + public Color getTimeAxisLineColor() + { + return getStyleResolver().getTimeAxisLineColor(this, this); + } + + @Override + public Color getOwnTimeAxisLineColor() + { + return timeAxisLineColor; + } + + @Override + public JRExpression getValueAxisLabelExpression(){ + return valueAxisLabelExpression; + } + + @Override + public JRExpression getDomainAxisMinValueExpression(){ + return domainAxisMinValueExpression; + } + + @Override + public JRExpression getDomainAxisMaxValueExpression(){ + return domainAxisMaxValueExpression; + } + + @Override + public JRExpression getRangeAxisMinValueExpression(){ + return rangeAxisMinValueExpression; + } + + @Override + public JRExpression getRangeAxisMaxValueExpression(){ + return rangeAxisMaxValueExpression; + } + + @Override + public JRFont getValueAxisLabelFont() + { + return valueAxisLabelFont; + } + + @Override + public Color getValueAxisLabelColor() + { + return getStyleResolver().getValueAxisLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisLabelColor() + { + return valueAxisLabelColor; + } + + @Override + public JRFont getValueAxisTickLabelFont() + { + return valueAxisTickLabelFont; + } + + @Override + public Color getValueAxisTickLabelColor() + { + return getStyleResolver().getValueAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisTickLabelColor() + { + return valueAxisTickLabelColor; + } + + @Override + public String getValueAxisTickLabelMask() + { + return valueAxisTickLabelMask; + } + + @Override + public Boolean getValueAxisVerticalTickLabels() + { + return valueAxisVerticalTickLabels; + } + + @Override + public Color getValueAxisLineColor() + { + return getStyleResolver().getValueAxisLineColor(this, this); + } + + @Override + public Color getOwnValueAxisLineColor() + { + return valueAxisLineColor; + } + + @Override + public Boolean getShowVolume() + { + return showVolume; + } + + + /** + * + */ + public void setShowVolume(Boolean showVolume) + { + Boolean old = this.showVolume; + this.showVolume = showVolume; + getEventSupport().firePropertyChange(PROPERTY_SHOW_VOLUME, old, this.showVolume); + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public Object clone(JRChart parentChart) + { + JRBaseCandlestickPlot clone = (JRBaseCandlestickPlot)super.clone(parentChart); + clone.timeAxisLabelExpression = JRCloneUtils.nullSafeClone(timeAxisLabelExpression); + clone.valueAxisLabelExpression = JRCloneUtils.nullSafeClone(valueAxisLabelExpression); + clone.domainAxisMinValueExpression = JRCloneUtils.nullSafeClone(domainAxisMinValueExpression); + clone.domainAxisMaxValueExpression = JRCloneUtils.nullSafeClone(domainAxisMaxValueExpression); + clone.rangeAxisMinValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMinValueExpression); + clone.rangeAxisMaxValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMaxValueExpression); + return clone; + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private boolean isShowVolume = true; + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_3) + { + showVolume = Boolean.valueOf(isShowVolume); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseCategoryDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseCategoryDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseCategoryDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseCategoryDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,120 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import net.sf.jasperreports.charts.JRCategoryDataset; +import net.sf.jasperreports.charts.JRCategorySeries; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseChartDataset; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRBaseCategoryDataset extends JRBaseChartDataset implements JRCategoryDataset +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + protected JRCategorySeries[] categorySeries; + + + /** + * + */ + public JRBaseCategoryDataset(JRChartDataset dataset) + { + super(dataset); + } + + + /** + * + */ + public JRBaseCategoryDataset(JRCategoryDataset dataset, JRBaseObjectFactory factory) + { + super(dataset, factory); + + /* */ + JRCategorySeries[] srcCategorySeries = dataset.getSeries(); + if (srcCategorySeries != null && srcCategorySeries.length > 0) + { + categorySeries = new JRCategorySeries[srcCategorySeries.length]; + for(int i = 0; i < categorySeries.length; i++) + { + categorySeries[i] = factory.getCategorySeries(srcCategorySeries[i]); + } + } + + } + + + @Override + public JRCategorySeries[] getSeries() + { + return categorySeries; + } + + + /* (non-Javadoc) + * @see net.sf.jasperreports.engine.JRChartDataset#getDatasetType() + */ + @Override + public byte getDatasetType() { + return JRChartDataset.CATEGORY_DATASET; + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + + @Override + public Object clone() + { + JRBaseCategoryDataset clone = (JRBaseCategoryDataset)super.clone(); + clone.categorySeries = JRCloneUtils.cloneArray(categorySeries); + return clone; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseCategorySeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseCategorySeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseCategorySeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseCategorySeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,132 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.io.Serializable; + +import net.sf.jasperreports.charts.JRCategorySeries; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRBaseCategorySeries implements JRCategorySeries, Serializable +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + protected JRExpression seriesExpression; + protected JRExpression categoryExpression; + protected JRExpression valueExpression; + protected JRExpression labelExpression; + protected JRHyperlink itemHyperlink; + + + /** + * + */ + protected JRBaseCategorySeries() + { + } + + + /** + * + */ + public JRBaseCategorySeries(JRCategorySeries categorySeries, JRBaseObjectFactory factory) + { + factory.put(categorySeries, this); + + seriesExpression = factory.getExpression(categorySeries.getSeriesExpression()); + categoryExpression = factory.getExpression(categorySeries.getCategoryExpression()); + valueExpression = factory.getExpression(categorySeries.getValueExpression()); + labelExpression = factory.getExpression(categorySeries.getLabelExpression()); + itemHyperlink = factory.getHyperlink(categorySeries.getItemHyperlink()); + } + + + @Override + public JRExpression getSeriesExpression() + { + return seriesExpression; + } + + @Override + public JRExpression getCategoryExpression() + { + return categoryExpression; + } + + @Override + public JRExpression getValueExpression() + { + return valueExpression; + } + + @Override + public JRExpression getLabelExpression() + { + return labelExpression; + } + + + @Override + public JRHyperlink getItemHyperlink() + { + return itemHyperlink; + } + + @Override + public Object clone() + { + JRBaseCategorySeries clone = null; + + try + { + clone = (JRBaseCategorySeries)super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new JRRuntimeException(e); + } + + clone.seriesExpression = JRCloneUtils.nullSafeClone(seriesExpression); + clone.categoryExpression = JRCloneUtils.nullSafeClone(categoryExpression); + clone.valueExpression = JRCloneUtils.nullSafeClone(valueExpression); + clone.labelExpression = JRCloneUtils.nullSafeClone(labelExpression); + clone.itemHyperlink = JRCloneUtils.nullSafeClone(itemHyperlink); + + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseChartAxis.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseChartAxis.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseChartAxis.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseChartAxis.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,154 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.Serializable; + +import net.sf.jasperreports.charts.JRChartAxis; +import net.sf.jasperreports.charts.type.AxisPositionEnum; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * Base read-only implementation of {@link JRChartAxis JRChartAxis}. + * + * @author Barry Klawans (barry@users.sourceforge.net) + */ +public class JRBaseChartAxis implements JRChartAxis, Serializable +{ + + /** + * Where to position the axis. + */ + protected AxisPositionEnum positionValue; + + /** + * The Chart object containing the dataset and plot to use with this axis. + */ + protected JRChart chart; + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + /** + * Construct a new axis that will be added to the specified chart. + */ + public JRBaseChartAxis() + { + } + + public JRBaseChartAxis(JRChartAxis axis, JRBaseObjectFactory factory) + { + factory.put(axis, this); + + this.positionValue = axis.getPositionValue(); + this.chart = (JRChart)factory.getVisitResult(axis.getChart()); + } + + /** + * Returns the position of this axis. + * + * @return the position of this axis + */ + @Override + public AxisPositionEnum getPositionValue() + { + return positionValue; + } + + /** + * Returns the chart that contains the dataset and plot to use for this + * axis. The plot is used to figure out how to render the dataset when + * adding to the multiple axis chart. + * + * @return the chart that contains the dataset and plot for this axis + */ + @Override + public JRChart getChart() + { + return chart; + } + + @Override + public Object clone() + { + JRBaseChartAxis clone = null; + + try + { + clone = (JRBaseChartAxis)super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new JRRuntimeException(e); + } + + clone.chart = JRCloneUtils.nullSafeClone(chart); + + return clone; + } + + @Override + public JRChartAxis clone(JRChart parentChart) + { + JRBaseChartAxis clone = (JRBaseChartAxis) clone(); + return clone; + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private byte position = AxisPositionEnum.LEFT_OR_TOP.getValue(); + /** + * @deprecated + */ + private Byte positionByte; + + @SuppressWarnings("deprecation") + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2) + { + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_3) + { + positionValue = AxisPositionEnum.getByValue(position); + } + else + { + positionValue = AxisPositionEnum.getByValue(positionByte); + positionByte = null; + } + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseDataRange.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseDataRange.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseDataRange.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseDataRange.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,134 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.io.Serializable; + +import net.sf.jasperreports.charts.JRDataRange; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * An immutable instantiation of a {@link net.sf.jasperreports.charts.JRDataRange JRDataRange}, suitable for holding + * a range. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRBaseDataRange implements JRDataRange, Serializable +{ + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + /** + * The expression used to calculate the lower bound of the range. + */ + protected JRExpression lowExpression; + + /** + * The expression used to calculate the upper bound of the range. + */ + protected JRExpression highExpression; + + + /** + * Constructs a copy of an existing range. + * + * @param dataRange the range to copy + */ + public JRBaseDataRange(JRDataRange dataRange) + { + if (dataRange != null) + { + this.lowExpression = dataRange.getLowExpression(); + this.highExpression = dataRange.getHighExpression(); + } +} + + /** + * Creates a copy of an existing range and registers all of the expressions + * with a factory object. Once the expressions have been registered they will + * be included when the report is compiled. + * + * @param dataRange the range to copy + * @param factory the factory to register the expressions with + */ + public JRBaseDataRange(JRDataRange dataRange, JRBaseObjectFactory factory) + { + factory.put(dataRange, this); + + lowExpression = factory.getExpression(dataRange.getLowExpression()); + highExpression = factory.getExpression(dataRange.getHighExpression()); + } + + + @Override + public JRExpression getLowExpression() + { + return lowExpression; + } + @Override + public JRExpression getHighExpression() + { + return highExpression; + } + + + /** + * Registers all of the expressions with the collector. If the expressions + * have been registered with one of the report's factory they will be included + * when the report is compiled. + * + * @param collector the expression collector to use + */ + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public Object clone() + { + JRBaseDataRange clone = null; + + try + { + clone = (JRBaseDataRange)super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new JRRuntimeException(e); + } + + clone.lowExpression = JRCloneUtils.nullSafeClone(lowExpression); + clone.highExpression = JRCloneUtils.nullSafeClone(highExpression); + + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseGanttDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseGanttDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseGanttDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseGanttDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,106 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import net.sf.jasperreports.charts.JRGanttDataset; +import net.sf.jasperreports.charts.JRGanttSeries; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseChartDataset; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.design.JRVerifier; + +/** + * @author Peter Risko (peter@risko.hu) + */ +//FIXME clone +public class JRBaseGanttDataset extends JRBaseChartDataset implements JRGanttDataset { + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + protected JRGanttSeries[] ganttSeries; + + /** + * + */ + public JRBaseGanttDataset(JRChartDataset dataset) + { + super(dataset); + } + + /** + * + */ + public JRBaseGanttDataset(JRGanttDataset dataset, JRBaseObjectFactory factory) + { + super(dataset, factory); + + /* */ + JRGanttSeries[] srcGanttSeries = dataset.getSeries(); + if (srcGanttSeries != null && srcGanttSeries.length > 0) + { + ganttSeries = new JRGanttSeries[srcGanttSeries.length]; + for(int i = 0; i < ganttSeries.length; i++) + { + ganttSeries[i] = factory.getGanttSeries(srcGanttSeries[i]); + } + } + + } + + + @Override + public JRGanttSeries[] getSeries() + { + return ganttSeries; + } + + + /* (non-Javadoc) + * @see net.sf.jasperreports.engine.JRChartDataset#getDatasetType() + */ + @Override + public byte getDatasetType() { + return JRChartDataset.GANTT_DATASET; + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseGanttSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseGanttSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseGanttSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseGanttSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,157 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.io.Serializable; + +import net.sf.jasperreports.charts.JRGanttSeries; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Peter Risko (peter@risko.hu) + */ +public class JRBaseGanttSeries implements JRGanttSeries, Serializable +{ + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + protected JRExpression seriesExpression; + protected JRExpression taskExpression; + protected JRExpression subtaskExpression; + protected JRExpression startDateExpression; + protected JRExpression endDateExpression; + protected JRExpression percentExpression; + protected JRExpression labelExpression; + protected JRHyperlink itemHyperlink; + + /** + * + */ + protected JRBaseGanttSeries() + { + } + + + /** + * + */ + public JRBaseGanttSeries(JRGanttSeries ganttSeries, JRBaseObjectFactory factory) + { + factory.put(ganttSeries, this); + + seriesExpression = factory.getExpression(ganttSeries.getSeriesExpression()); + taskExpression = factory.getExpression(ganttSeries.getTaskExpression()); + subtaskExpression = factory.getExpression(ganttSeries.getSubtaskExpression()); + startDateExpression = factory.getExpression(ganttSeries.getStartDateExpression()); + endDateExpression = factory.getExpression(ganttSeries.getEndDateExpression()); + percentExpression = factory.getExpression(ganttSeries.getPercentExpression()); + labelExpression = factory.getExpression(ganttSeries.getLabelExpression()); + itemHyperlink = factory.getHyperlink(ganttSeries.getItemHyperlink()); + } + + + @Override + public JRExpression getSeriesExpression() + { + return seriesExpression; + } + + @Override + public JRExpression getTaskExpression() + { + return taskExpression; + } + + @Override + public JRExpression getSubtaskExpression() + { + return subtaskExpression; + } + + @Override + public JRExpression getStartDateExpression() + { + return startDateExpression; + } + + @Override + public JRExpression getEndDateExpression() + { + return endDateExpression; + } + + @Override + public JRExpression getPercentExpression() + { + return percentExpression; + } + + @Override + public JRExpression getLabelExpression() + { + return labelExpression; + } + + + @Override + public JRHyperlink getItemHyperlink() + { + return itemHyperlink; + } + + + @Override + public Object clone() + { + JRBaseGanttSeries clone = null; + + try + { + clone = (JRBaseGanttSeries)super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new JRRuntimeException(e); + } + + clone.seriesExpression = JRCloneUtils.nullSafeClone(seriesExpression); + clone.taskExpression = JRCloneUtils.nullSafeClone(taskExpression); + clone.subtaskExpression = JRCloneUtils.nullSafeClone(subtaskExpression); + clone.startDateExpression = JRCloneUtils.nullSafeClone(startDateExpression); + clone.endDateExpression = JRCloneUtils.nullSafeClone(endDateExpression); + clone.percentExpression = JRCloneUtils.nullSafeClone(percentExpression); + clone.labelExpression = JRCloneUtils.nullSafeClone(labelExpression); + clone.itemHyperlink = JRCloneUtils.nullSafeClone(itemHyperlink); + return clone; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseHighLowDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseHighLowDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseHighLowDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseHighLowDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,178 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import net.sf.jasperreports.charts.JRHighLowDataset; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.base.JRBaseChartDataset; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRBaseHighLowDataset extends JRBaseChartDataset implements JRHighLowDataset +{ + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + protected JRExpression seriesExpression; + protected JRExpression dateExpression; + protected JRExpression highExpression; + protected JRExpression lowExpression; + protected JRExpression openExpression; + protected JRExpression closeExpression; + protected JRExpression volumeExpression; + private JRHyperlink itemHyperlink; + + + /** + * + */ + public JRBaseHighLowDataset(JRChartDataset dataset) + { + super(dataset); + } + + + /** + * + */ + public JRBaseHighLowDataset(JRHighLowDataset dataset, JRBaseObjectFactory factory) + { + super(dataset, factory); + + seriesExpression = factory.getExpression(dataset.getSeriesExpression()); + dateExpression = factory.getExpression(dataset.getDateExpression()); + highExpression = factory.getExpression(dataset.getHighExpression()); + lowExpression = factory.getExpression(dataset.getLowExpression()); + openExpression = factory.getExpression(dataset.getOpenExpression()); + closeExpression = factory.getExpression(dataset.getCloseExpression()); + volumeExpression = factory.getExpression(dataset.getVolumeExpression()); + itemHyperlink = factory.getHyperlink(dataset.getItemHyperlink()); + } + + + @Override + public JRExpression getSeriesExpression() + { + return seriesExpression; + } + + + @Override + public JRExpression getDateExpression() + { + return dateExpression; + } + + + @Override + public JRExpression getHighExpression() + { + return highExpression; + } + + + @Override + public JRExpression getLowExpression() + { + return lowExpression; + } + + + @Override + public JRExpression getOpenExpression() + { + return openExpression; + } + + + @Override + public JRExpression getCloseExpression() + { + return closeExpression; + } + + @Override + public JRExpression getVolumeExpression() + { + return volumeExpression; + } + + + /* (non-Javadoc) + * @see net.sf.jasperreports.engine.JRChartDataset#getDatasetType() + */ + @Override + public byte getDatasetType() { + return JRChartDataset.HIGHLOW_DATASET; + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public JRHyperlink getItemHyperlink() + { + return itemHyperlink; + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + + @Override + public Object clone() + { + JRBaseHighLowDataset clone = (JRBaseHighLowDataset)super.clone(); + clone.seriesExpression = JRCloneUtils.nullSafeClone(seriesExpression); + clone.dateExpression = JRCloneUtils.nullSafeClone(dateExpression); + clone.highExpression = JRCloneUtils.nullSafeClone(highExpression); + clone.lowExpression = JRCloneUtils.nullSafeClone(lowExpression); + clone.openExpression = JRCloneUtils.nullSafeClone(openExpression); + clone.closeExpression = JRCloneUtils.nullSafeClone(closeExpression); + clone.volumeExpression = JRCloneUtils.nullSafeClone(volumeExpression); + clone.itemHyperlink = JRCloneUtils.nullSafeClone(itemHyperlink); + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseHighLowPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseHighLowPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseHighLowPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseHighLowPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,360 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.awt.Color; +import java.io.IOException; +import java.io.ObjectInputStream; + +import net.sf.jasperreports.charts.JRHighLowPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.base.JRBaseChartPlot; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRBaseHighLowPlot extends JRBaseChartPlot implements JRHighLowPlot +{ + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_SHOW_CLOSE_TICKS = "isShowCloseTicks"; + + public static final String PROPERTY_SHOW_OPEN_TICKS = "isShowOpenTicks"; + + protected JRExpression timeAxisLabelExpression; + protected JRFont timeAxisLabelFont; + protected Color timeAxisLabelColor; + protected JRFont timeAxisTickLabelFont; + protected Color timeAxisTickLabelColor; + protected String timeAxisTickLabelMask; + protected Boolean timeAxisVerticalTickLabels; + protected Color timeAxisLineColor; + + protected JRExpression valueAxisLabelExpression; + protected JRExpression rangeAxisMinValueExpression; + protected JRExpression rangeAxisMaxValueExpression; + protected JRExpression domainAxisMinValueExpression; + protected JRExpression domainAxisMaxValueExpression; + protected JRFont valueAxisLabelFont; + protected Color valueAxisLabelColor; + protected JRFont valueAxisTickLabelFont; + protected Color valueAxisTickLabelColor; + protected String valueAxisTickLabelMask; + protected Boolean valueAxisVerticalTickLabels; + protected Color valueAxisLineColor; + + protected Boolean showOpenTicks; + protected Boolean showCloseTicks; + + + /** + * + */ + public JRBaseHighLowPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + + JRHighLowPlot highLowPlot = plot instanceof JRHighLowPlot ? (JRHighLowPlot)plot : null; + if (highLowPlot != null) + { + timeAxisLabelFont = highLowPlot.getTimeAxisLabelFont(); + timeAxisTickLabelFont = highLowPlot.getTimeAxisTickLabelFont(); + valueAxisLabelFont = highLowPlot.getValueAxisLabelFont(); + valueAxisTickLabelFont = highLowPlot.getValueAxisTickLabelFont(); + } + } + + + /** + * + */ + public JRBaseHighLowPlot(JRHighLowPlot highLowPlot, JRBaseObjectFactory factory) + { + super(highLowPlot, factory); + + showOpenTicks = highLowPlot.getShowOpenTicks(); + showCloseTicks = highLowPlot.getShowCloseTicks(); + + timeAxisLabelExpression = factory.getExpression( highLowPlot.getTimeAxisLabelExpression() ); + timeAxisLabelFont = factory.getFont(chart, highLowPlot.getTimeAxisLabelFont()); + timeAxisLabelColor = highLowPlot.getOwnTimeAxisLabelColor(); + timeAxisTickLabelFont = factory.getFont(chart, highLowPlot.getTimeAxisTickLabelFont()); + timeAxisTickLabelColor = highLowPlot.getOwnTimeAxisTickLabelColor(); + timeAxisTickLabelMask = highLowPlot.getTimeAxisTickLabelMask(); + timeAxisVerticalTickLabels = highLowPlot.getTimeAxisVerticalTickLabels(); + timeAxisLineColor = highLowPlot.getOwnTimeAxisLineColor(); + + valueAxisLabelExpression = factory.getExpression( highLowPlot.getValueAxisLabelExpression() ); + domainAxisMinValueExpression = factory.getExpression( highLowPlot.getDomainAxisMinValueExpression() ); + domainAxisMaxValueExpression = factory.getExpression( highLowPlot.getDomainAxisMaxValueExpression() ); + rangeAxisMinValueExpression = factory.getExpression( highLowPlot.getRangeAxisMinValueExpression() ); + rangeAxisMaxValueExpression = factory.getExpression( highLowPlot.getRangeAxisMaxValueExpression() ); + valueAxisLabelFont = factory.getFont(chart, highLowPlot.getValueAxisLabelFont()); + valueAxisLabelColor = highLowPlot.getOwnValueAxisLabelColor(); + valueAxisTickLabelFont = factory.getFont(chart, highLowPlot.getValueAxisTickLabelFont()); + valueAxisTickLabelColor = highLowPlot.getOwnValueAxisTickLabelColor(); + valueAxisTickLabelMask = highLowPlot.getValueAxisTickLabelMask(); + valueAxisVerticalTickLabels = highLowPlot.getValueAxisVerticalTickLabels(); + valueAxisLineColor = highLowPlot.getOwnValueAxisTickLabelColor(); + } + + + @Override + public JRExpression getTimeAxisLabelExpression(){ + return timeAxisLabelExpression; + } + + @Override + public JRFont getTimeAxisLabelFont() + { + return timeAxisLabelFont; + } + + @Override + public Color getTimeAxisLabelColor() + { + return getStyleResolver().getTimeAxisLabelColor(this, this); + } + + @Override + public Color getOwnTimeAxisLabelColor() + { + return timeAxisLabelColor; + } + + @Override + public JRFont getTimeAxisTickLabelFont() + { + return timeAxisTickLabelFont; + } + + @Override + public Color getTimeAxisTickLabelColor() + { + return getStyleResolver().getTimeAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnTimeAxisTickLabelColor() + { + return timeAxisTickLabelColor; + } + + @Override + public String getTimeAxisTickLabelMask() + { + return timeAxisTickLabelMask; + } + + @Override + public Boolean getTimeAxisVerticalTickLabels() + { + return timeAxisVerticalTickLabels; + } + + @Override + public Color getTimeAxisLineColor() + { + return getStyleResolver().getTimeAxisLineColor(this, this); + } + + @Override + public Color getOwnTimeAxisLineColor() + { + return timeAxisLineColor; + } + + @Override + public JRExpression getValueAxisLabelExpression(){ + return valueAxisLabelExpression; + } + + @Override + public JRExpression getDomainAxisMinValueExpression(){ + return domainAxisMinValueExpression; + } + + @Override + public JRExpression getDomainAxisMaxValueExpression(){ + return domainAxisMaxValueExpression; + } + + @Override + public JRExpression getRangeAxisMinValueExpression(){ + return rangeAxisMinValueExpression; + } + + @Override + public JRExpression getRangeAxisMaxValueExpression(){ + return rangeAxisMaxValueExpression; + } + @Override + public JRFont getValueAxisLabelFont() + { + return valueAxisLabelFont; + } + + @Override + public Color getValueAxisLabelColor() + { + return getStyleResolver().getValueAxisLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisLabelColor() + { + return valueAxisLabelColor; + } + + @Override + public JRFont getValueAxisTickLabelFont() + { + return valueAxisTickLabelFont; + } + + @Override + public Color getValueAxisTickLabelColor() + { + return getStyleResolver().getValueAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisTickLabelColor() + { + return valueAxisTickLabelColor; + } + + @Override + public String getValueAxisTickLabelMask() + { + return valueAxisTickLabelMask; + } + + @Override + public Boolean getValueAxisVerticalTickLabels() + { + return valueAxisVerticalTickLabels; + } + + @Override + public Color getValueAxisLineColor() + { + return getStyleResolver().getValueAxisLineColor(this, this); + } + + @Override + public Color getOwnValueAxisLineColor() + { + return valueAxisLineColor; + } + + @Override + public Boolean getShowOpenTicks() + { + return showOpenTicks; + } + + + /** + * + */ + public void setShowOpenTicks(Boolean showOpenTicks) + { + Boolean old = this.showOpenTicks; + this.showOpenTicks = showOpenTicks; + getEventSupport().firePropertyChange(PROPERTY_SHOW_OPEN_TICKS, old, this.showOpenTicks); + } + + @Override + public Boolean getShowCloseTicks() + { + return showCloseTicks; + } + + /** + * + */ + public void setShowCloseTicks(Boolean showCloseTicks) + { + Boolean old = this.showCloseTicks; + this.showCloseTicks = showCloseTicks; + getEventSupport().firePropertyChange(PROPERTY_SHOW_CLOSE_TICKS, old, this.showCloseTicks); + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public Object clone(JRChart parentChart) + { + JRBaseHighLowPlot clone = (JRBaseHighLowPlot)super.clone(parentChart); + clone.timeAxisLabelExpression = JRCloneUtils.nullSafeClone(timeAxisLabelExpression); + clone.valueAxisLabelExpression = JRCloneUtils.nullSafeClone(valueAxisLabelExpression); + clone.domainAxisMinValueExpression = JRCloneUtils.nullSafeClone(domainAxisMinValueExpression); + clone.domainAxisMaxValueExpression = JRCloneUtils.nullSafeClone(domainAxisMaxValueExpression); + clone.rangeAxisMinValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMinValueExpression); + clone.rangeAxisMaxValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMaxValueExpression); + return clone; + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private boolean isShowOpenTicks; + /** + * @deprecated + */ + private boolean isShowCloseTicks; + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_3) + { + showOpenTicks = Boolean.valueOf(isShowOpenTicks); + showCloseTicks = Boolean.valueOf(isShowCloseTicks); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseItemLabel.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseItemLabel.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseItemLabel.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseItemLabel.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,176 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.awt.Color; +import java.io.Serializable; + +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; + +/** + * An immutable representation of the formatting options for showing the + * item labels in a category plot. + * + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class JRBaseItemLabel implements JRItemLabel, Serializable +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + protected JRChart chart; + + /** + * The item label text color. + */ + protected Color color; + + /** + * The item label background color. + */ + protected Color backgroundColor; + + /** + * The formatting mask to use when writing the value. Must a pattern + * that is accepted by a code>java.text.DecimalFormat object. + */ +// protected String mask; + + /** + * The item label text font. + */ + protected JRFont font; + + + /** + * Constructs a copy of an existing item label specification. + * + * @param itemLabel the item label object to copy + * @param chart the parent chart + */ + public JRBaseItemLabel(JRItemLabel itemLabel, JRChart chart) + { + this.chart = chart; + + if (itemLabel != null) + { + color = itemLabel.getColor(); + backgroundColor = itemLabel.getBackgroundColor(); +// mask = itemLabel.getMask(); + font = itemLabel.getFont(); + } + } + + /** + * Constructs a copy of an existing item label specification and registers + * any expression in the new copy with the specified factory. + * + * @param itemLabel the item label object to copy + * @param factory the factory object to register expressions with + */ + public JRBaseItemLabel(JRItemLabel itemLabel, JRBaseObjectFactory factory) + { + factory.put(itemLabel, this); + + chart = (JRChart)factory.getVisitResult(itemLabel.getChart()); + + color = itemLabel.getColor(); + backgroundColor = itemLabel.getBackgroundColor(); +// mask = itemLabel.getMask(); + font = factory.getFont(chart, itemLabel.getFont()); + } + + + @Override + public JRChart getChart() + { + return chart; + } + + @Override + public Color getColor() + { + return color; + } + + @Override + public Color getBackgroundColor() + { + return backgroundColor; + } + /** + * + */ +// public String getMask() +// { +// return mask; +// } + @Override + public JRFont getFont() + { + return font; + } + + /** + * Adds all the expression used by this plot with the specified collector. + * All collected expression that are also registered with a factory will + * be included with the report is compiled. + * + * @param collector the expression collector to use + */ + public void collectExpressions(JRExpressionCollector collector) + { + } + + @Override + public Object clone() + { + try + { + return super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public JRItemLabel clone(JRChart parentChart) + { + JRBaseItemLabel clone = (JRBaseItemLabel) clone(); + clone.chart = parentChart; + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseLinePlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseLinePlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseLinePlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseLinePlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,360 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.awt.Color; +import java.io.IOException; +import java.io.ObjectInputStream; + +import net.sf.jasperreports.charts.JRLinePlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.base.JRBaseChartPlot; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRBaseLinePlot extends JRBaseChartPlot implements JRLinePlot { + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_SHOW_LINES = "isShowLines"; + + public static final String PROPERTY_SHOW_SHAPES = "isShowShapes"; + + protected JRExpression categoryAxisLabelExpression; + protected JRFont categoryAxisLabelFont; + protected Color categoryAxisLabelColor; + protected JRFont categoryAxisTickLabelFont; + protected Color categoryAxisTickLabelColor; + protected String categoryAxisTickLabelMask; + protected Boolean categoryAxisVerticalTickLabels; + protected Color categoryAxisLineColor; + + protected JRExpression valueAxisLabelExpression; + protected JRExpression rangeAxisMinValueExpression; + protected JRExpression rangeAxisMaxValueExpression; + protected JRExpression domainAxisMinValueExpression; + protected JRExpression domainAxisMaxValueExpression; + protected JRFont valueAxisLabelFont; + protected Color valueAxisLabelColor; + protected JRFont valueAxisTickLabelFont; + protected Color valueAxisTickLabelColor; + protected String valueAxisTickLabelMask; + protected Boolean valueAxisVerticalTickLabels; + protected Color valueAxisLineColor; + + Boolean showShapes; + Boolean showLines; + + + /** + * + */ + public JRBaseLinePlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + + JRLinePlot linePlot = plot instanceof JRLinePlot ? (JRLinePlot)plot : null; + if (linePlot != null) + { + categoryAxisLabelFont = linePlot.getCategoryAxisLabelFont(); + categoryAxisTickLabelFont = linePlot.getCategoryAxisTickLabelFont(); + valueAxisLabelFont = linePlot.getValueAxisLabelFont(); + valueAxisTickLabelFont = linePlot.getValueAxisTickLabelFont(); + } + } + + /** + * + */ + public JRBaseLinePlot(JRLinePlot linePlot, JRBaseObjectFactory factory ) + { + super(linePlot, factory); + + showShapes = linePlot.getShowShapes(); + showLines = linePlot.getShowLines(); + + categoryAxisLabelExpression = factory.getExpression( linePlot.getCategoryAxisLabelExpression() ); + categoryAxisLabelFont = factory.getFont(chart, linePlot.getCategoryAxisLabelFont()); + categoryAxisLabelColor = linePlot.getOwnCategoryAxisLabelColor(); + categoryAxisTickLabelFont = factory.getFont(chart, linePlot.getCategoryAxisTickLabelFont()); + categoryAxisTickLabelColor = linePlot.getOwnCategoryAxisTickLabelColor(); + categoryAxisTickLabelMask = linePlot.getCategoryAxisTickLabelMask(); + categoryAxisVerticalTickLabels = linePlot.getCategoryAxisVerticalTickLabels(); + categoryAxisLineColor = linePlot.getOwnCategoryAxisLineColor(); + labelRotationDouble = linePlot.getCategoryAxisTickLabelRotation(); + + valueAxisLabelExpression = factory.getExpression( linePlot.getValueAxisLabelExpression() ); + domainAxisMinValueExpression = factory.getExpression( linePlot.getDomainAxisMinValueExpression() ); + domainAxisMaxValueExpression = factory.getExpression( linePlot.getDomainAxisMaxValueExpression() ); + rangeAxisMinValueExpression = factory.getExpression( linePlot.getRangeAxisMinValueExpression() ); + rangeAxisMaxValueExpression = factory.getExpression( linePlot.getRangeAxisMaxValueExpression() ); + valueAxisLabelFont = factory.getFont(chart, linePlot.getValueAxisLabelFont()); + valueAxisLabelColor = linePlot.getOwnValueAxisLabelColor(); + valueAxisTickLabelFont = factory.getFont(chart, linePlot.getValueAxisTickLabelFont()); + valueAxisTickLabelColor = linePlot.getOwnValueAxisTickLabelColor(); + valueAxisTickLabelMask = linePlot.getValueAxisTickLabelMask(); + valueAxisVerticalTickLabels = linePlot.getValueAxisVerticalTickLabels(); + valueAxisLineColor = linePlot.getOwnValueAxisLineColor(); + } + + @Override + public JRExpression getCategoryAxisLabelExpression(){ + return categoryAxisLabelExpression; + } + + @Override + public JRFont getCategoryAxisLabelFont() + { + return categoryAxisLabelFont; + } + + @Override + public Color getCategoryAxisLabelColor() + { + return getStyleResolver().getCategoryAxisLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLabelColor() + { + return categoryAxisLabelColor; + } + + @Override + public JRFont getCategoryAxisTickLabelFont() + { + return categoryAxisTickLabelFont; + } + + @Override + public Color getCategoryAxisTickLabelColor() + { + return getStyleResolver().getCategoryAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisTickLabelColor() + { + return categoryAxisTickLabelColor; + } + + @Override + public String getCategoryAxisTickLabelMask() + { + return categoryAxisTickLabelMask; + } + + @Override + public Boolean getCategoryAxisVerticalTickLabels() + { + return categoryAxisVerticalTickLabels; + } + + @Override + public Double getCategoryAxisTickLabelRotation() + { + return labelRotationDouble; + } + + @Override + public void setCategoryAxisTickLabelRotation(Double labelRotationDouble) + { + Object old = this.labelRotationDouble; + this.labelRotationDouble = labelRotationDouble; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_ROTATION, old, this.labelRotationDouble); + } + + @Override + public Color getCategoryAxisLineColor() + { + return getStyleResolver().getCategoryAxisLineColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLineColor() + { + return categoryAxisLineColor; + } + + @Override + public JRExpression getValueAxisLabelExpression(){ + return valueAxisLabelExpression; + } + + @Override + public JRExpression getRangeAxisMinValueExpression(){ + return rangeAxisMinValueExpression; + } + + @Override + public JRExpression getRangeAxisMaxValueExpression(){ + return rangeAxisMaxValueExpression; + } + + @Override + public JRExpression getDomainAxisMinValueExpression(){ + return domainAxisMinValueExpression; + } + + @Override + public JRExpression getDomainAxisMaxValueExpression(){ + return domainAxisMaxValueExpression; + } + + @Override + public JRFont getValueAxisLabelFont() + { + return valueAxisLabelFont; + } + + @Override + public Color getValueAxisLabelColor() + { + return getStyleResolver().getValueAxisLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisLabelColor() + { + return valueAxisLabelColor; + } + + @Override + public JRFont getValueAxisTickLabelFont() + { + return valueAxisTickLabelFont; + } + + @Override + public Color getValueAxisTickLabelColor() + { + return getStyleResolver().getValueAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisTickLabelColor() + { + return valueAxisTickLabelColor; + } + + @Override + public String getValueAxisTickLabelMask() + { + return valueAxisTickLabelMask; + } + + @Override + public Boolean getValueAxisVerticalTickLabels() + { + return valueAxisVerticalTickLabels; + } + + @Override + public Color getValueAxisLineColor() + { + return getStyleResolver().getValueAxisLineColor(this, this); + } + + @Override + public Color getOwnValueAxisLineColor() + { + return valueAxisLineColor; + } + + @Override + public Boolean getShowShapes(){ + return showShapes; + } + + @Override + public Boolean getShowLines(){ + return showLines; + } + + @Override + public void setShowShapes( Boolean value ){ + Boolean old = this.showShapes; + this.showShapes = value; + getEventSupport().firePropertyChange(PROPERTY_SHOW_SHAPES, old, this.showShapes); + } + + @Override + public void setShowLines( Boolean value ){ + Boolean old = this.showLines; + this.showLines = value; + getEventSupport().firePropertyChange(PROPERTY_SHOW_SHAPES, old, this.showLines); + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public Object clone(JRChart parentChart) + { + JRBaseLinePlot clone = (JRBaseLinePlot)super.clone(parentChart); + clone.categoryAxisLabelExpression = JRCloneUtils.nullSafeClone(categoryAxisLabelExpression); + clone.valueAxisLabelExpression = JRCloneUtils.nullSafeClone(valueAxisLabelExpression); + clone.domainAxisMinValueExpression = JRCloneUtils.nullSafeClone(domainAxisMinValueExpression); + clone.domainAxisMaxValueExpression = JRCloneUtils.nullSafeClone(domainAxisMaxValueExpression); + clone.rangeAxisMinValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMinValueExpression); + clone.rangeAxisMaxValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMaxValueExpression); + return clone; + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private boolean isShowShapes = true; + /** + * @deprecated + */ + private boolean isShowLines = true; + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_3) + { + showShapes = Boolean.valueOf(isShowShapes); + showLines = Boolean.valueOf(isShowLines); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseMeterPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseMeterPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseMeterPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseMeterPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,320 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.awt.Color; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.util.Iterator; +import java.util.List; + +import net.sf.jasperreports.charts.JRDataRange; +import net.sf.jasperreports.charts.JRMeterPlot; +import net.sf.jasperreports.charts.JRValueDisplay; +import net.sf.jasperreports.charts.type.MeterShapeEnum; +import net.sf.jasperreports.charts.util.JRMeterInterval; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.base.JRBaseChartPlot; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * An immutable representation of the layout of a Meter chart. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRBaseMeterPlot extends JRBaseChartPlot implements JRMeterPlot +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + /** + * The range displayed by the Meter. + */ + protected JRDataRange dataRange; + + /** + * Formatting information for the textual display of the value. + */ + protected JRValueDisplay valueDisplay; + + /** + * The shape to use when drawing the Meter. Only applied if the meter is + * over 180 degrees wide and less than a full circle. + */ + protected MeterShapeEnum shapeValue; + + + /** + * The defined intervals for the Meter. Each interval indicates a + * subsection of the meter and a color to use for that section. + */ + protected List intervals = new java.util.ArrayList(); + + /** + * The extend of the meter face in degrees. It will always be centered + * around the straight up position. + */ + protected Integer meterAngleInteger; + + /** + * Optional description of what the meter is displaying. It will be + * appended to the textual representation of the value. + */ + protected String units; + + /** + * How often to draw ticks around the face of the meter. The interval + * is relative to the meter range - if the meter displays 100 to 200 and + * the tickInterval is 20, there will be 4 ticks at 120, 140, 160 and 180. + */ + protected Double tickIntervalDouble; + + /** + * The color to use for the face of the meter. + */ + protected Color meterBackgroundColor; + + /** + * The color to use for the pointer on the meter. + */ + protected Color needleColor; + + /** + * The color to use for each tick on the face of the meter. + */ + protected Color tickColor; + + /** + * The number of major ticks on the meter scale. + */ + protected Integer tickCount; + + /** + * The font to use when writing tick labels. + */ + protected JRFont tickLabelFont; + + + /** + * Constructs a copy of an existing meter. + * + * @param plot the plot to copy + */ + public JRBaseMeterPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + + JRMeterPlot meterPlot = plot instanceof JRMeterPlot ? (JRMeterPlot)plot : null; + if (meterPlot == null) + { + valueDisplay = new JRBaseValueDisplay(null, chart); + } + else + { + valueDisplay = new JRBaseValueDisplay(meterPlot.getValueDisplay(), chart); + tickLabelFont = meterPlot.getTickLabelFont(); + } + } + + /** + * Constructs a copy of an existing meter and registers all expressions + * maintained by the meter plot with a factory. + * + * @param meterPlot the meter to copy + * @param factory the factory to register expressions with + */ + public JRBaseMeterPlot(JRMeterPlot meterPlot, JRBaseObjectFactory factory) + { + super(meterPlot, factory); + + dataRange = new JRBaseDataRange(meterPlot.getDataRange(), factory); + valueDisplay = new JRBaseValueDisplay(meterPlot.getValueDisplay(), factory); + shapeValue = meterPlot.getShapeValue(); + List origIntervals = meterPlot.getIntervals(); + intervals.clear(); + if (origIntervals != null) + { + Iterator iter = origIntervals.iterator(); + while (iter.hasNext()) + { + JRMeterInterval interval = iter.next(); + intervals.add(new JRMeterInterval(interval, factory)); + } + } + + meterAngleInteger = meterPlot.getMeterAngleInteger(); + units = meterPlot.getUnits(); + tickIntervalDouble = meterPlot.getTickIntervalDouble(); + tickCount = meterPlot.getTickCount(); + meterBackgroundColor = meterPlot.getMeterBackgroundColor(); + needleColor = meterPlot.getNeedleColor(); + tickColor = meterPlot.getTickColor(); + tickLabelFont = factory.getFont(this.getChart(), meterPlot.getTickLabelFont()); + } + + @Override + public JRDataRange getDataRange() + { + return dataRange; + } + + @Override + public JRValueDisplay getValueDisplay() + { + return valueDisplay; + } + + @Override + public MeterShapeEnum getShapeValue() + { + return shapeValue; + } + + @Override + public List getIntervals(){ + return intervals; + } + + @Override + public Integer getMeterAngleInteger() + { + return meterAngleInteger; + } + + @Override + public String getUnits() + { + return units; + } + + @Override + public Double getTickIntervalDouble() + { + return tickIntervalDouble; + } + + @Override + public Color getMeterBackgroundColor() + { + return meterBackgroundColor; + } + + @Override + public Color getNeedleColor() + { + return needleColor; + } + + @Override + public Color getTickColor() + { + return tickColor; + } + + @Override + public Integer getTickCount() + { + return tickCount; + } + + @Override + public JRFont getTickLabelFont() + { + return tickLabelFont; + } + + /** + * Adds all the expression used by this plot with the specified collector. + * All collected expression that are also registered with a factory will + * be included with the report is compiled. + * + * @param collector the expression collector to use + */ + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public Object clone(JRChart parentChart) + { + JRBaseMeterPlot clone = (JRBaseMeterPlot)super.clone(parentChart); + clone.dataRange = JRCloneUtils.nullSafeClone(dataRange); + clone.valueDisplay = valueDisplay == null ? null : valueDisplay.clone(parentChart); + clone.intervals = JRCloneUtils.cloneList(intervals); + return clone; + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private byte shape = MeterShapeEnum.PIE.getValue(); + /** + * @deprecated + */ + private int meterAngle = 180; + /** + * @deprecated + */ + private double tickInterval = 10.0; + /** + * @deprecated + */ + private Byte shapeByte; + + @SuppressWarnings("deprecation") + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2) + { + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_3) + { + shapeValue = MeterShapeEnum.getByValue(shape); + meterAngleInteger = Integer.valueOf(meterAngle); + tickIntervalDouble = Double.valueOf(tickInterval); + } + else + { + shapeValue = MeterShapeEnum.getByValue(shapeByte); + shapeByte = null; + } + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseMultiAxisPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseMultiAxisPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseMultiAxisPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseMultiAxisPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,146 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.sf.jasperreports.charts.JRChartAxis; +import net.sf.jasperreports.charts.JRMultiAxisPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseChartPlot; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; + +/** + * An immutable representation of the layout options of a multiple axis chart. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRBaseMultiAxisPlot extends JRBaseChartPlot implements JRMultiAxisPlot +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + /** + * All the axes contained in this plot. Each entry indicates a chart containing + * the dataset and layout of that entry and where to draw that chart's range + * axis. All entries in the list are of the type + * {@link net.sf.jasperreports.charts.JRChartAxis JRChartAxis} + */ + protected List axes = new ArrayList(); + + + + /** + * Constructs a copy of an existing multiple axis chart plot. + * + * @param multiAxisPlot the plot to copy + */ + public JRBaseMultiAxisPlot(JRChartPlot multiAxisPlot, JRChart chart) + { + super(multiAxisPlot, chart); + } + + /** + * Creates a copy of an existing multiple axis chart plot and registers + * any expression contained in the plot with the specified factory. Since + * the plot contains multiple other charts nested inside of it all of the + * expressions used by those charts is also registered with the factory. + * + * @param multiAxisPlot the plot to copy + * @param factory the factory to register expressions with + */ + public JRBaseMultiAxisPlot(JRMultiAxisPlot multiAxisPlot, JRBaseObjectFactory factory) + { + super(multiAxisPlot, factory); + + List origAxes = multiAxisPlot.getAxes(); + axes.clear(); + if (origAxes != null) + { + Iterator iter = origAxes.iterator(); + while (iter.hasNext()) + { + JRChartAxis axis = iter.next(); + axes.add(factory.getChartAxis(axis)); + } + } + } + + + + @Override + public List getAxes() + { + return axes; + } + + /** + * Adds all the expression used by this plot with the specified collector. + * All collected expression that are also registered with a factory will + * be included with the report is compiled. + * + * @param collector the expression collector to use + */ + @Override + public void collectExpressions(JRExpressionCollector collector) + { + Iterator iter = axes.iterator(); + while (iter.hasNext()) + { + JRChartAxis axis = iter.next(); + collector.collect(axis.getChart()); + } + } + + @Override + public Object clone(JRChart parentChart) + { + JRBaseMultiAxisPlot clone = (JRBaseMultiAxisPlot)super.clone(parentChart); + List cloneAxes; + if (axes == null)// should not be null but it's protected so let's be safe + { + cloneAxes = null; + } + else + { + cloneAxes = new ArrayList(axes.size()); + for (JRChartAxis axis : axes) + { + JRChartAxis axisClone = axis == null ? null : axis.clone(parentChart); + cloneAxes.add(axisClone); + } + } + clone.axes = cloneAxes; + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePie3DPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePie3DPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePie3DPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePie3DPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,244 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.io.IOException; +import java.io.ObjectInputStream; + +import net.sf.jasperreports.charts.ChartCopyObjectFactory; +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.charts.JRPie3DPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseChartPlot; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRBasePie3DPlot extends JRBaseChartPlot implements JRPie3DPlot +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CIRCULAR = "isCircular"; + + public static final String PROPERTY_DEPTH_FACTOR = "depthFactor"; + + public static final String PROPERTY_LABEL_FORMAT = "labelFormat"; + public static final String PROPERTY_LEGEND_LABEL_FORMAT = "legendLabelFormat"; + public static final String PROPERTY_ITEM_LABEL = "itemLabel"; + public static final String PROPERTY_SHOW_LABELS = "isShowLabels"; + + protected Double depthFactorDouble; + protected Boolean circular; + protected String labelFormat; + protected String legendLabelFormat; + + protected JRItemLabel itemLabel; + protected Boolean showLabels; + + /** + * + */ + public JRBasePie3DPlot(JRChartPlot chartPlot, JRChart chart) + { + this(chartPlot, chart, ChartCopyBaseObjectFactory.instance()); + } + + protected JRBasePie3DPlot(JRChartPlot chartPlot, JRChart chart, ChartCopyObjectFactory copyObjectFactory) + { + super(chartPlot, chart); + + JRPie3DPlot pie3DPlot = chartPlot instanceof JRPie3DPlot ? (JRPie3DPlot)chartPlot : null; + + if (pie3DPlot == null) + { + itemLabel = copyObjectFactory.copyItemLabel(null, chart); + } + else + { + itemLabel = copyObjectFactory.copyItemLabel(pie3DPlot.getItemLabel(), chart); + } + } + + + /** + * + */ + public JRBasePie3DPlot(JRPie3DPlot pie3DPlot, JRBaseObjectFactory factory) + { + super(pie3DPlot, factory); + + depthFactorDouble = pie3DPlot.getDepthFactorDouble(); + circular = pie3DPlot.getCircular(); + labelFormat = pie3DPlot.getLabelFormat(); + legendLabelFormat = pie3DPlot.getLegendLabelFormat(); + itemLabel = new JRBaseItemLabel(pie3DPlot.getItemLabel(), factory); + showLabels = pie3DPlot.getShowLabels(); + } + + + @Override + public Double getDepthFactorDouble() + { + return depthFactorDouble; + } + + @Override + public JRItemLabel getItemLabel() + { + return itemLabel; + } + + /** + * + */ + public void setDepthFactor(Double depthFactor) + { + Double old = this.depthFactorDouble; + this.depthFactorDouble = depthFactor; + getEventSupport().firePropertyChange(PROPERTY_DEPTH_FACTOR, old, this.depthFactorDouble); + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + } + + + @Override + public Boolean getCircular() { + return circular; + } + + /** + * @param isCircular the isCircular to set + */ + public void setCircular(Boolean isCircular) { + Boolean old = this.circular; + this.circular = isCircular; + getEventSupport().firePropertyChange(PROPERTY_CIRCULAR, old, this.circular); + } + + /** + * @return the labelFormat + */ + @Override + public String getLabelFormat() { + return labelFormat; + } + + + /** + * @param labelFormat the labelFormat to set + */ + public void setLabelFormat(String labelFormat) { + String old = this.labelFormat; + this.labelFormat = labelFormat; + getEventSupport().firePropertyChange(PROPERTY_LABEL_FORMAT, old, this.labelFormat); + } + + + /** + * @return the legendLabelFormat + */ + @Override + public String getLegendLabelFormat() { + return legendLabelFormat; + } + + + /** + * @param legendLabelFormat the legendLabelFormat to set + */ + public void setLegendLabelFormat(String legendLabelFormat) { + String old = this.legendLabelFormat; + this.legendLabelFormat = legendLabelFormat; + getEventSupport().firePropertyChange(PROPERTY_LEGEND_LABEL_FORMAT, old, this.legendLabelFormat); + } + + /** + * @param itemLabel the itemLabel to set + */ + public void setItemLabel(JRItemLabel itemLabel) { + JRItemLabel old = this.itemLabel; + this.itemLabel = itemLabel; + getEventSupport().firePropertyChange(PROPERTY_ITEM_LABEL, old, this.itemLabel); + } + + @Override + public Boolean getShowLabels(){ + return showLabels; + } + + /** + * + */ + public void setShowLabels( Boolean showLabels ){ + Boolean old = this.showLabels; + this.showLabels = showLabels; + getEventSupport().firePropertyChange(PROPERTY_SHOW_LABELS, old, this.showLabels); + } + + @Override + public Object clone(JRChart parentChart) + { + JRBasePie3DPlot clone = (JRBasePie3DPlot) super.clone(parentChart); + clone.itemLabel = itemLabel == null ? null : itemLabel.clone(parentChart); + return clone; + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private double depthFactor = DEPTH_FACTOR_DEFAULT; + /** + * @deprecated + */ + private boolean isCircular; + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_3) + { + depthFactorDouble = new Double(depthFactor); + circular = Boolean.valueOf(isCircular); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePieDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePieDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePieDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePieDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,248 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.io.IOException; +import java.io.ObjectInputStream; + +import net.sf.jasperreports.charts.JRPieDataset; +import net.sf.jasperreports.charts.JRPieSeries; +import net.sf.jasperreports.charts.design.JRDesignPieSeries; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.base.JRBaseChartDataset; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRBasePieDataset extends JRBaseChartDataset implements JRPieDataset, JRChangeEventsSupport +{ + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_MIN_PERCENTAGE = "minPercentage"; + public static final String PROPERTY_MAX_COUNT = "maxCount"; + + private Float minPercentage; + private Integer maxCount; + + protected JRPieSeries[] pieSeries; + + protected JRExpression otherKeyExpression; + protected JRExpression otherLabelExpression; + private JRHyperlink otherSectionHyperlink; + + + /** + * + */ + public JRBasePieDataset(JRChartDataset dataset) + { + super(dataset); + } + + + /** + * + */ + public JRBasePieDataset(JRPieDataset dataset, JRBaseObjectFactory factory) + { + super(dataset, factory); + + minPercentage = dataset.getMinPercentage(); + maxCount = dataset.getMaxCount(); + + /* */ + JRPieSeries[] srcPieSeries = dataset.getSeries(); + if (srcPieSeries != null && srcPieSeries.length > 0) + { + pieSeries = new JRPieSeries[srcPieSeries.length]; + for(int i = 0; i < pieSeries.length; i++) + { + pieSeries[i] = factory.getPieSeries(srcPieSeries[i]); + } + } + + otherKeyExpression = factory.getExpression(dataset.getOtherKeyExpression()); + otherLabelExpression = factory.getExpression(dataset.getOtherLabelExpression()); + otherSectionHyperlink = factory.getHyperlink(dataset.getOtherSectionHyperlink()); + } + + + @Override + public Float getMinPercentage() + { + return minPercentage; + } + + @Override + public void setMinPercentage(Float minPercentage) + { + Object old = this.minPercentage; + this.minPercentage = minPercentage; + getEventSupport().firePropertyChange(PROPERTY_MIN_PERCENTAGE, old, this.minPercentage); + } + + @Override + public Integer getMaxCount() + { + return maxCount; + } + + @Override + public void setMaxCount(Integer maxCount) + { + Object old = this.maxCount; + this.maxCount = maxCount; + getEventSupport().firePropertyChange(PROPERTY_MAX_COUNT, old, this.maxCount); + } + + @Override + public JRPieSeries[] getSeries() + { + return pieSeries; + } + + @Override + public JRExpression getOtherKeyExpression() + { + return otherKeyExpression; + } + + + @Override + public JRExpression getOtherLabelExpression() + { + return otherLabelExpression; + } + + + @Override + public JRHyperlink getOtherSectionHyperlink() + { + return otherSectionHyperlink; + } + + + @Override + public byte getDatasetType() { + return JRChartDataset.PIE_DATASET; + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + @Override + public Object clone() + { + JRBasePieDataset clone = (JRBasePieDataset)super.clone(); + clone.pieSeries = JRCloneUtils.cloneArray(pieSeries); + clone.otherKeyExpression = JRCloneUtils.nullSafeClone(otherKeyExpression); + clone.otherLabelExpression = JRCloneUtils.nullSafeClone(otherLabelExpression); + clone.otherSectionHyperlink = JRCloneUtils.nullSafeClone(otherSectionHyperlink); + clone.eventSupport = null; + return clone; + } + + private transient JRPropertyChangeSupport eventSupport; + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + /* + * These fields are only for serialization backward compatibility. + */ + /** + * @deprecated + */ + private JRExpression keyExpression; + /** + * @deprecated + */ + private JRExpression valueExpression; + /** + * @deprecated + */ + private JRExpression labelExpression; + /** + * @deprecated + */ + private JRHyperlink sectionHyperlink; + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (pieSeries == null) + { + pieSeries = new JRPieSeries[1]; + + JRDesignPieSeries ps = new JRDesignPieSeries(); + ps.setKeyExpression(keyExpression); + ps.setValueExpression(valueExpression); + ps.setLabelExpression(labelExpression); + ps.setSectionHyperlink(sectionHyperlink); + pieSeries[0] = ps; + + keyExpression = null; + valueExpression = null; + labelExpression = null; + sectionHyperlink = null; + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePiePlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePiePlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePiePlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePiePlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,234 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.io.IOException; +import java.io.ObjectInputStream; + +import net.sf.jasperreports.charts.ChartCopyObjectFactory; +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.charts.JRPiePlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseChartPlot; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRBasePiePlot extends JRBaseChartPlot implements JRPiePlot +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CIRCULAR = "isCircular"; + + public static final String PROPERTY_LABEL_FORMAT = "labelFormat"; + public static final String PROPERTY_LEGEND_LABEL_FORMAT = "legendLabelFormat"; + public static final String PROPERTY_ITEM_LABEL = "itemLabel"; + + public static final String PROPERTY_SHOW_LABELS = "isShowLabels"; + /* + * README + * + * Make sure that all fields are read in readObject(). + */ + protected Boolean circular; + protected String labelFormat; + protected String legendLabelFormat; + + protected JRItemLabel itemLabel; + protected Boolean showLabels; + + /** + * + */ + public JRBasePiePlot(JRChartPlot chartPlot, JRChart chart) + { + this(chartPlot, chart, ChartCopyBaseObjectFactory.instance()); + } + + protected JRBasePiePlot(JRChartPlot chartPlot, JRChart chart, ChartCopyObjectFactory copyObjectFactory) + { + super(chartPlot, chart); + + JRPiePlot piePlot = chartPlot instanceof JRPiePlot ? (JRPiePlot)chartPlot : null; + + if (piePlot == null) + { + itemLabel = copyObjectFactory.copyItemLabel(null, chart); + } + else + { + itemLabel = copyObjectFactory.copyItemLabel(piePlot.getItemLabel(), chart); + } + } + + + /** + * + */ + public JRBasePiePlot(JRPiePlot piePlot, JRBaseObjectFactory factory) + { + super(piePlot, factory); + circular = piePlot.getCircular(); + labelFormat = piePlot.getLabelFormat(); + legendLabelFormat = piePlot.getLegendLabelFormat(); + itemLabel = new JRBaseItemLabel(piePlot.getItemLabel(), factory); + showLabels = piePlot.getShowLabels(); + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + } + + + /** + * @return the circular + */ + @Override + public Boolean getCircular() { + return circular; + } + + /** + * @param isCircular the isCircular to set + */ + public void setCircular(Boolean isCircular) { + Boolean old = this.circular; + this.circular = isCircular; + getEventSupport().firePropertyChange(PROPERTY_CIRCULAR, old, this.circular); + } + + + /** + * @return the labelFormat + */ + @Override + public String getLabelFormat() { + return labelFormat; + } + + + /** + * @param labelFormat the labelFormat to set + */ + public void setLabelFormat(String labelFormat) { + String old = this.labelFormat; + this.labelFormat = labelFormat; + getEventSupport().firePropertyChange(PROPERTY_LABEL_FORMAT, old, this.labelFormat); + } + + + /** + * @return the legendLabelFormat + */ + @Override + public String getLegendLabelFormat() { + return legendLabelFormat; + } + + @Override + public JRItemLabel getItemLabel() + { + return itemLabel; + } + + /** + * @param legendLabelFormat the legendLabelFormat to set + */ + public void setLegendLabelFormat(String legendLabelFormat) { + String old = this.legendLabelFormat; + this.legendLabelFormat = legendLabelFormat; + getEventSupport().firePropertyChange(PROPERTY_LEGEND_LABEL_FORMAT, old, this.legendLabelFormat); + } + + /** + * @param itemLabel the itemLabel to set + */ + public void setItemLabel(JRItemLabel itemLabel) { + JRItemLabel old = this.itemLabel; + this.itemLabel = itemLabel; + getEventSupport().firePropertyChange(PROPERTY_ITEM_LABEL, old, this.itemLabel); + } + + @Override + public Boolean getShowLabels(){ + return showLabels; + } + + /** + * + */ + public void setShowLabels( Boolean showLabels ){ + Boolean old = this.showLabels; + this.showLabels = showLabels; + getEventSupport().firePropertyChange(PROPERTY_SHOW_LABELS, old, this.showLabels); + } + + @Override + public Object clone(JRChart parentChart) + { + JRBasePiePlot clone = (JRBasePiePlot)super.clone(parentChart); + clone.itemLabel = itemLabel == null ? null : itemLabel.clone(parentChart); + return clone; + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + @SuppressWarnings("unused") + private boolean isCircular;//we need this field for fields.get("isCircular") + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + // this fixes a problem with JFreeChart that changed the default value of isCircular at some point. + // look into Git history for details + ObjectInputStream.GetField fields = in.readFields(); + //the following lines are required because above we called readFields(), not defaultReadObject() + labelFormat = (String) fields.get("labelFormat", null); + legendLabelFormat = (String) fields.get("legendLabelFormat", null); + itemLabel = (JRItemLabel) fields.get("itemLabel", null); + showLabels = (Boolean) fields.get("showLabels", null); + + PSEUDO_SERIAL_VERSION_UID = fields.get("PSEUDO_SERIAL_VERSION_UID", 0); + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_3) + { + boolean circularField = fields.get("isCircular", true); + circular = Boolean.valueOf(circularField); + } + else + { + circular = (Boolean) fields.get("circular", null); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePieSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePieSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePieSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBasePieSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,123 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.io.Serializable; + +import net.sf.jasperreports.charts.JRPieSeries; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRBasePieSeries implements JRPieSeries, Serializable +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + protected JRExpression keyExpression; + protected JRExpression valueExpression; + protected JRExpression labelExpression; + protected JRHyperlink sectionHyperlink; + + + /** + * + */ + protected JRBasePieSeries() + { + } + + + /** + * + */ + public JRBasePieSeries(JRPieSeries pieSeries, JRBaseObjectFactory factory) + { + factory.put(pieSeries, this); + + keyExpression = factory.getExpression(pieSeries.getKeyExpression()); + valueExpression = factory.getExpression(pieSeries.getValueExpression()); + labelExpression = factory.getExpression(pieSeries.getLabelExpression()); + sectionHyperlink = factory.getHyperlink(pieSeries.getSectionHyperlink()); + } + + + @Override + public JRExpression getKeyExpression() + { + return keyExpression; + } + + @Override + public JRExpression getValueExpression() + { + return valueExpression; + } + + @Override + public JRExpression getLabelExpression() + { + return labelExpression; + } + + + @Override + public JRHyperlink getSectionHyperlink() + { + return sectionHyperlink; + } + + @Override + public Object clone() + { + JRBasePieSeries clone = null; + + try + { + clone = (JRBasePieSeries)super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new JRRuntimeException(e); + } + + clone.keyExpression = JRCloneUtils.nullSafeClone(keyExpression); + clone.valueExpression = JRCloneUtils.nullSafeClone(valueExpression); + clone.labelExpression = JRCloneUtils.nullSafeClone(labelExpression); + clone.sectionHyperlink = JRCloneUtils.nullSafeClone(sectionHyperlink); + + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseScatterPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseScatterPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseScatterPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseScatterPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,347 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.awt.Color; +import java.io.IOException; +import java.io.ObjectInputStream; + +import net.sf.jasperreports.charts.JRScatterPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.base.JRBaseChartPlot; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRBaseScatterPlot extends JRBaseChartPlot implements JRScatterPlot { + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_SHOW_LINES = "isShowLines"; + + public static final String PROPERTY_SHOW_SHAPES = "isShowShapes"; + + protected JRExpression xAxisLabelExpression; + protected JRFont xAxisLabelFont; + protected Color xAxisLabelColor; + protected JRFont xAxisTickLabelFont; + protected Color xAxisTickLabelColor; + protected String xAxisTickLabelMask; + protected Boolean xAxisVerticalTickLabels; + protected Color xAxisLineColor; + + protected JRExpression yAxisLabelExpression; + protected JRFont yAxisLabelFont; + protected Color yAxisLabelColor; + protected JRFont yAxisTickLabelFont; + protected Color yAxisTickLabelColor; + protected String yAxisTickLabelMask; + protected Boolean yAxisVerticalTickLabels; + protected Color yAxisLineColor; + + protected JRExpression domainAxisMinValueExpression; + protected JRExpression domainAxisMaxValueExpression; + protected JRExpression rangeAxisMinValueExpression; + protected JRExpression rangeAxisMaxValueExpression; + + Boolean showShapes; + Boolean showLines; + + + /** + * + */ + public JRBaseScatterPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + + JRScatterPlot scatterPlot = plot instanceof JRScatterPlot ? (JRScatterPlot)plot : null; + if (scatterPlot != null) + { + xAxisLabelFont = scatterPlot.getXAxisLabelFont(); + xAxisTickLabelFont = scatterPlot.getXAxisTickLabelFont(); + yAxisLabelFont = scatterPlot.getYAxisLabelFont(); + yAxisTickLabelFont = scatterPlot.getYAxisTickLabelFont(); + } + } + + /** + * + */ + public JRBaseScatterPlot(JRScatterPlot scatterPlot, JRBaseObjectFactory factory ) + { + super(scatterPlot, factory ); + + showShapes = scatterPlot.getShowShapes(); + showLines = scatterPlot.getShowLines(); + + xAxisLabelExpression = factory.getExpression( scatterPlot.getXAxisLabelExpression() ); + xAxisLabelFont = factory.getFont(chart, scatterPlot.getXAxisLabelFont()); + xAxisLabelColor = scatterPlot.getOwnXAxisLabelColor(); + xAxisTickLabelFont = factory.getFont(chart, scatterPlot.getXAxisTickLabelFont()); + xAxisTickLabelColor = scatterPlot.getOwnXAxisTickLabelColor(); + xAxisTickLabelMask = scatterPlot.getXAxisTickLabelMask(); + xAxisVerticalTickLabels = scatterPlot.getXAxisVerticalTickLabels(); + xAxisLineColor = scatterPlot.getOwnXAxisLineColor(); + + yAxisLabelExpression = factory.getExpression( scatterPlot.getYAxisLabelExpression() ); + yAxisLabelFont = factory.getFont(chart, scatterPlot.getYAxisLabelFont()); + yAxisLabelColor = scatterPlot.getOwnYAxisLabelColor(); + yAxisTickLabelFont = factory.getFont(chart, scatterPlot.getYAxisTickLabelFont()); + yAxisTickLabelColor = scatterPlot.getOwnYAxisTickLabelColor(); + yAxisTickLabelMask = scatterPlot.getYAxisTickLabelMask(); + yAxisVerticalTickLabels = scatterPlot.getYAxisVerticalTickLabels(); + yAxisLineColor = scatterPlot.getOwnYAxisLineColor(); + + domainAxisMinValueExpression = factory.getExpression( scatterPlot.getDomainAxisMinValueExpression() ); + domainAxisMaxValueExpression = factory.getExpression( scatterPlot.getDomainAxisMaxValueExpression() ); + rangeAxisMinValueExpression = factory.getExpression( scatterPlot.getRangeAxisMinValueExpression() ); + rangeAxisMaxValueExpression = factory.getExpression( scatterPlot.getRangeAxisMaxValueExpression() ); + } + + @Override + public JRExpression getXAxisLabelExpression(){ + return xAxisLabelExpression; + } + + @Override + public JRFont getXAxisLabelFont() + { + return xAxisLabelFont; + } + + @Override + public Color getXAxisLabelColor() + { + return getStyleResolver().getXAxisLabelColor(this, this); + } + + @Override + public Color getOwnXAxisLabelColor() + { + return xAxisLabelColor; + } + + @Override + public JRFont getXAxisTickLabelFont() + { + return xAxisTickLabelFont; + } + + @Override + public Color getXAxisTickLabelColor() + { + return getStyleResolver().getXAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnXAxisTickLabelColor() + { + return xAxisTickLabelColor; + } + + @Override + public String getXAxisTickLabelMask() + { + return xAxisTickLabelMask; + } + + @Override + public Boolean getXAxisVerticalTickLabels() + { + return xAxisVerticalTickLabels; + } + + @Override + public Color getXAxisLineColor() + { + return getStyleResolver().getXAxisLineColor(this, this); + } + + @Override + public Color getOwnXAxisLineColor() + { + return xAxisLineColor; + } + + @Override + public JRExpression getYAxisLabelExpression() { + return yAxisLabelExpression; + } + + @Override + public JRFont getYAxisLabelFont() + { + return yAxisLabelFont; + } + + @Override + public Color getYAxisLabelColor() + { + return getStyleResolver().getYAxisLabelColor(this, this); + } + + @Override + public Color getOwnYAxisLabelColor() + { + return yAxisLabelColor; + } + + @Override + public JRFont getYAxisTickLabelFont() + { + return yAxisTickLabelFont; + } + + @Override + public Color getYAxisTickLabelColor() + { + return getStyleResolver().getYAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnYAxisTickLabelColor() + { + return yAxisTickLabelColor; + } + + @Override + public String getYAxisTickLabelMask() + { + return yAxisTickLabelMask; + } + + @Override + public Boolean getYAxisVerticalTickLabels() + { + return yAxisVerticalTickLabels; + } + + @Override + public Color getYAxisLineColor() + { + return getStyleResolver().getYAxisLineColor(this, this); + } + + @Override + public Color getOwnYAxisLineColor() + { + return yAxisLineColor; + } + + @Override + public Boolean getShowShapes(){ + return showShapes; + } + + @Override + public Boolean getShowLines(){ + return showLines; + } + + @Override + public JRExpression getDomainAxisMinValueExpression(){ + return domainAxisMinValueExpression; + } + + @Override + public JRExpression getDomainAxisMaxValueExpression(){ + return domainAxisMaxValueExpression; + } + + @Override + public JRExpression getRangeAxisMinValueExpression(){ + return rangeAxisMinValueExpression; + } + + @Override + public JRExpression getRangeAxisMaxValueExpression(){ + return rangeAxisMaxValueExpression; + } + + @Override + public void setShowShapes( Boolean value ){ + Boolean old = this.showShapes; + this.showShapes = value; + getEventSupport().firePropertyChange(PROPERTY_SHOW_SHAPES, old, this.showShapes); + } + + @Override + public void setShowLines( Boolean value ){ + Boolean old = this.showLines; + this.showLines = value; + getEventSupport().firePropertyChange(PROPERTY_SHOW_LINES, old, this.showLines); + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public Object clone(JRChart parentChart) + { + JRBaseScatterPlot clone = (JRBaseScatterPlot)super.clone(parentChart); + clone.xAxisLabelExpression = JRCloneUtils.nullSafeClone(xAxisLabelExpression); + clone.yAxisLabelExpression = JRCloneUtils.nullSafeClone(yAxisLabelExpression); + clone.domainAxisMinValueExpression = JRCloneUtils.nullSafeClone(domainAxisMinValueExpression); + clone.domainAxisMaxValueExpression = JRCloneUtils.nullSafeClone(domainAxisMaxValueExpression); + clone.rangeAxisMinValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMinValueExpression); + clone.rangeAxisMaxValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMaxValueExpression); + return clone; + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private boolean isShowShapes = true; + /** + * @deprecated + */ + private boolean isShowLines = true; + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_3) + { + showShapes = Boolean.valueOf(isShowShapes); + showLines = Boolean.valueOf(isShowLines); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseThermometerPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseThermometerPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseThermometerPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseThermometerPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,242 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.awt.Color; +import java.io.IOException; +import java.io.ObjectInputStream; + +import net.sf.jasperreports.charts.JRDataRange; +import net.sf.jasperreports.charts.JRThermometerPlot; +import net.sf.jasperreports.charts.JRValueDisplay; +import net.sf.jasperreports.charts.type.ValueLocationEnum; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseChartPlot; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * An immutable representation of the layout of a thermometer plot. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRBaseThermometerPlot extends JRBaseChartPlot implements JRThermometerPlot +{ + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + /** + * The range of values that can be displayed by this thermometer. Specifies + * the upper and lower bounds of the meter itself. + */ + protected JRDataRange dataRange; + + /** + * Formatting information for the textual display of the value, including + * font, color and a mask. + */ + protected JRValueDisplay valueDisplay; + + /** + * Specifies where the textual display of the value should be shown. + */ + protected ValueLocationEnum valueLocationObject; + + /** + * The default color to use for the mercury in the thermometer. + */ + protected Color mercuryColor; + + /** + * The boundaries of the low range. + */ + protected JRDataRange lowRange; + + /** + * The boundaries of the medium range. + */ + protected JRDataRange mediumRange; + + /** + * The boundaries of the high range. + */ + protected JRDataRange highRange; + + /** + * Constructs a new thermometer plot that is a copy of an existing one. + * + * @param plot the plot to copy + * @param chart the parent chart + */ + public JRBaseThermometerPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + + JRThermometerPlot thermoPlot = plot instanceof JRThermometerPlot ? (JRThermometerPlot)plot : null; + if (thermoPlot == null) + { + valueDisplay = new JRBaseValueDisplay(null, chart); + } + else + { + valueDisplay = new JRBaseValueDisplay(thermoPlot.getValueDisplay(), chart); + } + } + + /** + * Constructs a new plot that is a copy of an existing one, and registers + * all expression used by the plot with the specified factory. + * + * @param thermoPlot the plot to copy + * @param factory the factory to register any expressions with + */ + public JRBaseThermometerPlot(JRThermometerPlot thermoPlot, JRBaseObjectFactory factory) + { + super(thermoPlot, factory); + + dataRange = new JRBaseDataRange(thermoPlot.getDataRange(), factory); + + valueDisplay = new JRBaseValueDisplay(thermoPlot.getValueDisplay(), factory); + + valueLocationObject = thermoPlot.getValueLocationValue(); + + mercuryColor = thermoPlot.getMercuryColor(); + + if (thermoPlot.getLowRange() != null) + { + lowRange = new JRBaseDataRange(thermoPlot.getLowRange(), factory); + } + if (thermoPlot.getMediumRange() != null) + { + mediumRange = new JRBaseDataRange(thermoPlot.getMediumRange(), factory); + } + if (thermoPlot.getHighRange() != null) + { + highRange = new JRBaseDataRange(thermoPlot.getHighRange(), factory); + } + } + + @Override + public JRDataRange getDataRange() + { + return dataRange; + } + + @Override + public JRValueDisplay getValueDisplay() + { + return valueDisplay; + } + + @Override + public ValueLocationEnum getValueLocationValue() + { + return valueLocationObject; + } + + @Override + public Color getMercuryColor() + { + return mercuryColor; + } + + @Override + public JRDataRange getLowRange() + { + return lowRange; + } + + @Override + public JRDataRange getMediumRange() + { + return mediumRange; + } + + @Override + public JRDataRange getHighRange() + { + return highRange; + } + + /** + * Adds all the expression used by this plot with the specified collector. + * All collected expression that are also registered with a factory will + * be included with the report is compiled. + * + * @param collector the expression collector to use + */ + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public Object clone(JRChart parentChart) + { + JRBaseThermometerPlot clone = (JRBaseThermometerPlot)super.clone(parentChart); + clone.dataRange = JRCloneUtils.nullSafeClone(dataRange); + clone.valueDisplay = valueDisplay == null ? null : valueDisplay.clone(parentChart); + clone.lowRange = JRCloneUtils.nullSafeClone(lowRange); + clone.mediumRange = JRCloneUtils.nullSafeClone(mediumRange); + clone.highRange = JRCloneUtils.nullSafeClone(highRange); + return clone; + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private byte valueLocation = ValueLocationEnum.BULB.getValue(); + /** + * @deprecated + */ + private Byte valueLocationByte; + + + @SuppressWarnings("deprecation") + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_3) + { + valueLocationObject = ValueLocationEnum.getByValue(valueLocation); + } + else if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2) + { + valueLocationObject = ValueLocationEnum.getByValue(valueLocationByte); + valueLocationByte = null; + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimePeriodDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimePeriodDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimePeriodDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimePeriodDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,95 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import net.sf.jasperreports.charts.JRTimePeriodDataset; +import net.sf.jasperreports.charts.JRTimePeriodSeries; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseChartDataset; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRBaseTimePeriodDataset extends JRBaseChartDataset implements JRTimePeriodDataset { + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private JRTimePeriodSeries[] timePeriodSeries; + + protected JRBaseTimePeriodDataset( JRTimePeriodDataset dataset ){ + super( dataset ); + } + + public JRBaseTimePeriodDataset( JRTimePeriodDataset dataset, JRBaseObjectFactory factory ){ + super( dataset, factory ); + + JRTimePeriodSeries[] srcTimePeriodSeries = dataset.getSeries(); + + if( srcTimePeriodSeries != null && srcTimePeriodSeries.length > 0 ){ + timePeriodSeries = new JRTimePeriodSeries[srcTimePeriodSeries.length]; + for( int i = 0; i < timePeriodSeries.length; i++ ){ + timePeriodSeries[i] = factory.getTimePeriodSeries( srcTimePeriodSeries[i] ); + } + } + } + + @Override + public JRTimePeriodSeries[] getSeries(){ + return timePeriodSeries; + } + + @Override + public byte getDatasetType() { + return JRChartDataset.TIMEPERIOD_DATASET; + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + @Override + public Object clone() + { + JRBaseTimePeriodDataset clone = (JRBaseTimePeriodDataset)super.clone(); + clone.timePeriodSeries = JRCloneUtils.cloneArray(timePeriodSeries); + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimePeriodSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimePeriodSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimePeriodSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimePeriodSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,126 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.io.Serializable; + +import net.sf.jasperreports.charts.JRTimePeriodSeries; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRBaseTimePeriodSeries implements JRTimePeriodSeries, Serializable { + + /** + * + */ + private static final long serialVersionUID = 608;// too late to replace this now + + protected JRExpression seriesExpression; + + protected JRExpression startDateExpression; + + protected JRExpression endDateExpression; + + protected JRExpression valueExpression; + + protected JRExpression labelExpression; + + protected JRHyperlink itemHyperlink; + + + protected JRBaseTimePeriodSeries(){ + } + + public JRBaseTimePeriodSeries( JRTimePeriodSeries timePeriodSeries, JRBaseObjectFactory factory ){ + factory.put( timePeriodSeries, factory ); + + seriesExpression = factory.getExpression( timePeriodSeries.getSeriesExpression() ); + startDateExpression = factory.getExpression( timePeriodSeries.getStartDateExpression() ); + endDateExpression = factory.getExpression( timePeriodSeries.getEndDateExpression() ); + valueExpression = factory.getExpression( timePeriodSeries.getValueExpression() ); + labelExpression = factory.getExpression( timePeriodSeries.getLabelExpression() ); + itemHyperlink = factory.getHyperlink(timePeriodSeries.getItemHyperlink()); + } + + @Override + public JRExpression getSeriesExpression(){ + return seriesExpression; + } + + @Override + public JRExpression getStartDateExpression(){ + return startDateExpression; + } + + @Override + public JRExpression getEndDateExpression(){ + return endDateExpression; + } + + @Override + public JRExpression getValueExpression(){ + return valueExpression; + } + + @Override + public JRExpression getLabelExpression(){ + return labelExpression; + } + + @Override + public JRHyperlink getItemHyperlink() + { + return itemHyperlink; + } + + @Override + public Object clone() + { + JRBaseTimePeriodSeries clone = null; + + try + { + clone = (JRBaseTimePeriodSeries)super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new JRRuntimeException(e); + } + + clone.seriesExpression = JRCloneUtils.nullSafeClone(seriesExpression); + clone.startDateExpression = JRCloneUtils.nullSafeClone(startDateExpression); + clone.endDateExpression = JRCloneUtils.nullSafeClone(endDateExpression); + clone.valueExpression = JRCloneUtils.nullSafeClone(valueExpression); + clone.labelExpression = JRCloneUtils.nullSafeClone(labelExpression); + clone.itemHyperlink = JRCloneUtils.nullSafeClone(itemHyperlink); + + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimeSeriesDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimeSeriesDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimeSeriesDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimeSeriesDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,133 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import net.sf.jasperreports.charts.JRTimeSeries; +import net.sf.jasperreports.charts.JRTimeSeriesDataset; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseChartDataset; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRBaseTimeSeriesDataset extends JRBaseChartDataset implements JRTimeSeriesDataset, JRChangeEventsSupport { + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_TIME_PERIOD = "timePeriod"; + + private JRTimeSeries[] timeSeries; + private Class timePeriod; + + protected JRBaseTimeSeriesDataset( JRTimeSeriesDataset dataset ){ + super( dataset ); + } + + public JRBaseTimeSeriesDataset( JRTimeSeriesDataset dataset, JRBaseObjectFactory factory ){ + super( dataset, factory ); + + timePeriod = dataset.getTimePeriod(); + JRTimeSeries[] srcTimeSeries = dataset.getSeries(); + + if( srcTimeSeries != null && srcTimeSeries.length > 0 ){ + timeSeries = new JRTimeSeries[ srcTimeSeries.length ]; + for( int i = 0; i< timeSeries.length; i++ ){ + timeSeries[i] = factory.getTimeSeries( srcTimeSeries[i]); + } + } + } + + @Override + public JRTimeSeries[] getSeries(){ + return timeSeries; + } + + @Override + public Class getTimePeriod(){ + return timePeriod; + } + + @Override + public void setTimePeriod( Class timePeriod ){ + Object old = this.timePeriod; + this.timePeriod = timePeriod; + getEventSupport().firePropertyChange(PROPERTY_TIME_PERIOD, old, this.timePeriod); + } + + + @Override + public byte getDatasetType() { + return JRChartDataset.TIMESERIES_DATASET; + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + @Override + public Object clone() + { + JRBaseTimeSeriesDataset clone = (JRBaseTimeSeriesDataset)super.clone(); + clone.timeSeries = JRCloneUtils.cloneArray(timeSeries); + clone.eventSupport = null; + return clone; + } + + private transient JRPropertyChangeSupport eventSupport; + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimeSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimeSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimeSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimeSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,132 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.io.Serializable; + +import net.sf.jasperreports.charts.JRTimeSeries; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRBaseTimeSeries implements JRTimeSeries, Serializable +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + protected JRExpression seriesExpression; + protected JRExpression timePeriodExpression; + protected JRExpression valueExpression; + protected JRExpression labelExpression; + protected JRHyperlink itemHyperlink; + + + /** + * + */ + protected JRBaseTimeSeries() + { + } + + + /** + * + */ + public JRBaseTimeSeries(JRTimeSeries timeSeries, JRBaseObjectFactory factory) + { + factory.put(timeSeries, this); + + seriesExpression = factory.getExpression(timeSeries.getSeriesExpression()); + timePeriodExpression = factory.getExpression(timeSeries.getTimePeriodExpression()); + valueExpression = factory.getExpression(timeSeries.getValueExpression()); + labelExpression = factory.getExpression(timeSeries.getLabelExpression()); + itemHyperlink = factory.getHyperlink(timeSeries.getItemHyperlink()); + } + + + @Override + public JRExpression getSeriesExpression() + { + return seriesExpression; + } + + @Override + public JRExpression getTimePeriodExpression() + { + return timePeriodExpression; + } + + @Override + public JRExpression getValueExpression() + { + return valueExpression; + } + + @Override + public JRExpression getLabelExpression() + { + return labelExpression; + } + + + @Override + public JRHyperlink getItemHyperlink() + { + return itemHyperlink; + } + + @Override + public Object clone() + { + JRBaseTimeSeries clone = null; + + try + { + clone = (JRBaseTimeSeries)super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new JRRuntimeException(e); + } + + clone.seriesExpression = JRCloneUtils.nullSafeClone(seriesExpression); + clone.timePeriodExpression = JRCloneUtils.nullSafeClone(timePeriodExpression); + clone.valueExpression = JRCloneUtils.nullSafeClone(valueExpression); + clone.labelExpression = JRCloneUtils.nullSafeClone(labelExpression); + clone.itemHyperlink = JRCloneUtils.nullSafeClone(itemHyperlink); + + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimeSeriesPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimeSeriesPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimeSeriesPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseTimeSeriesPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,346 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.awt.Color; +import java.io.IOException; +import java.io.ObjectInputStream; + +import net.sf.jasperreports.charts.JRTimeSeriesPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.base.JRBaseChartPlot; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRBaseTimeSeriesPlot extends JRBaseChartPlot implements JRTimeSeriesPlot +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_SHOW_LINES = "isShowLines"; + + public static final String PROPERTY_SHOW_SHAPES = "isShowShapes"; + + protected JRExpression timeAxisLabelExpression; + protected JRFont timeAxisLabelFont; + protected Color timeAxisLabelColor; + protected JRFont timeAxisTickLabelFont; + protected Color timeAxisTickLabelColor; + protected String timeAxisTickLabelMask; + protected Boolean timeAxisVerticalTickLabels; + protected Color timeAxisLineColor; + + protected JRExpression valueAxisLabelExpression; + protected JRExpression rangeAxisMinValueExpression; + protected JRExpression rangeAxisMaxValueExpression; + protected JRExpression domainAxisMinValueExpression; + protected JRExpression domainAxisMaxValueExpression; + protected JRFont valueAxisLabelFont; + protected Color valueAxisLabelColor; + protected JRFont valueAxisTickLabelFont; + protected Color valueAxisTickLabelColor; + protected String valueAxisTickLabelMask; + protected Boolean valueAxisVerticalTickLabels; + protected Color valueAxisLineColor; + + Boolean showShapes; + Boolean showLines; + + /** + * + */ + protected JRBaseTimeSeriesPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + + JRTimeSeriesPlot timeSeriesPlot = plot instanceof JRTimeSeriesPlot ? (JRTimeSeriesPlot)plot : null; + if (timeSeriesPlot != null) + {//FIXMETHEME you could copy more things + timeAxisLabelFont = timeSeriesPlot.getTimeAxisLabelFont(); + timeAxisTickLabelFont = timeSeriesPlot.getTimeAxisTickLabelFont(); + valueAxisLabelFont = timeSeriesPlot.getValueAxisLabelFont(); + valueAxisTickLabelFont = timeSeriesPlot.getValueAxisTickLabelFont(); + } + } + + /** + * + */ + public JRBaseTimeSeriesPlot(JRTimeSeriesPlot plot, JRBaseObjectFactory factory) + { + super(plot, factory); + + showLines = plot.getShowLines(); + showShapes = plot.getShowShapes(); + + timeAxisLabelExpression = factory.getExpression( plot.getTimeAxisLabelExpression() ); + timeAxisLabelFont = factory.getFont(chart, plot.getTimeAxisLabelFont());//FIXMETHEME check this plot.getChart(); don't we get the design chart? + timeAxisLabelColor = plot.getOwnTimeAxisLabelColor(); + timeAxisTickLabelFont = factory.getFont(chart, plot.getTimeAxisTickLabelFont()); + timeAxisTickLabelColor = plot.getOwnTimeAxisTickLabelColor(); + timeAxisTickLabelMask = plot.getTimeAxisTickLabelMask(); + timeAxisVerticalTickLabels = plot.getTimeAxisVerticalTickLabels(); + timeAxisLineColor = plot.getOwnTimeAxisLineColor(); + + valueAxisLabelExpression = factory.getExpression( plot.getValueAxisLabelExpression() ); + domainAxisMinValueExpression = factory.getExpression( plot.getDomainAxisMinValueExpression() ); + domainAxisMaxValueExpression = factory.getExpression( plot.getDomainAxisMaxValueExpression() ); + rangeAxisMinValueExpression = factory.getExpression( plot.getRangeAxisMinValueExpression() ); + rangeAxisMaxValueExpression = factory.getExpression( plot.getRangeAxisMaxValueExpression() ); + valueAxisLabelFont = factory.getFont(chart, plot.getValueAxisLabelFont()); + valueAxisLabelColor = plot.getOwnValueAxisLabelColor(); + valueAxisTickLabelFont = factory.getFont(chart, plot.getValueAxisTickLabelFont()); + valueAxisTickLabelColor = plot.getOwnValueAxisTickLabelColor(); + valueAxisTickLabelMask = plot.getValueAxisTickLabelMask(); + valueAxisVerticalTickLabels = plot.getValueAxisVerticalTickLabels(); + valueAxisLineColor = plot.getOwnValueAxisTickLabelColor(); + } + + @Override + public JRExpression getTimeAxisLabelExpression(){ + return timeAxisLabelExpression; + } + + @Override + public JRFont getTimeAxisLabelFont() + { + return timeAxisLabelFont; + } + + @Override + public Color getTimeAxisLabelColor() + { + return getStyleResolver().getTimeAxisLabelColor(this, this); + } + + @Override + public Color getOwnTimeAxisLabelColor() + { + return timeAxisLabelColor; + } + + @Override + public JRFont getTimeAxisTickLabelFont() + { + return timeAxisTickLabelFont; + } + + @Override + public Color getTimeAxisTickLabelColor() + { + return getStyleResolver().getTimeAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnTimeAxisTickLabelColor() + { + return timeAxisTickLabelColor; + } + + @Override + public String getTimeAxisTickLabelMask() + { + return timeAxisTickLabelMask; + } + + @Override + public Boolean getTimeAxisVerticalTickLabels() + { + return timeAxisVerticalTickLabels; + } + + @Override + public Color getTimeAxisLineColor() + { + return getStyleResolver().getTimeAxisLineColor(this, this); + } + + @Override + public Color getOwnTimeAxisLineColor() + { + return timeAxisLineColor; + } + + @Override + public JRExpression getValueAxisLabelExpression(){ + return valueAxisLabelExpression; + } + + @Override + public JRExpression getDomainAxisMinValueExpression(){ + return domainAxisMinValueExpression; + } + + @Override + public JRExpression getDomainAxisMaxValueExpression(){ + return domainAxisMaxValueExpression; + } + + @Override + public JRExpression getRangeAxisMinValueExpression(){ + return rangeAxisMinValueExpression; + } + + @Override + public JRExpression getRangeAxisMaxValueExpression(){ + return rangeAxisMaxValueExpression; + } + + @Override + public JRFont getValueAxisLabelFont() + { + return valueAxisLabelFont; + } + + @Override + public Color getValueAxisLabelColor() + { + return getStyleResolver().getValueAxisLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisLabelColor() + { + return valueAxisLabelColor; + } + + @Override + public JRFont getValueAxisTickLabelFont() + { + return valueAxisTickLabelFont; + } + + @Override + public Color getValueAxisTickLabelColor() + { + return getStyleResolver().getValueAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisTickLabelColor() + { + return valueAxisTickLabelColor; + } + + @Override + public String getValueAxisTickLabelMask() + { + return valueAxisTickLabelMask; + } + + @Override + public Boolean getValueAxisVerticalTickLabels() + { + return valueAxisVerticalTickLabels; + } + + @Override + public Color getValueAxisLineColor() + { + return getStyleResolver().getValueAxisLineColor(this, this); + } + + @Override + public Color getOwnValueAxisLineColor() + { + return valueAxisLineColor; + } + + @Override + public Boolean getShowLines(){ + return showLines; + } + + @Override + public Boolean getShowShapes(){ + return showShapes; + } + + @Override + public void setShowLines( Boolean val ){ + Boolean old = this.showLines; + this.showLines = val; + getEventSupport().firePropertyChange(PROPERTY_SHOW_LINES, old, this.showLines); + } + + @Override + public void setShowShapes( Boolean val ){ + Boolean old = this.showShapes; + this.showShapes = val; + getEventSupport().firePropertyChange(PROPERTY_SHOW_SHAPES, old, this.showShapes); + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public Object clone(JRChart parentChart) + { + JRBaseTimeSeriesPlot clone = (JRBaseTimeSeriesPlot)super.clone(parentChart); + clone.timeAxisLabelExpression = JRCloneUtils.nullSafeClone(timeAxisLabelExpression); + clone.valueAxisLabelExpression = JRCloneUtils.nullSafeClone(valueAxisLabelExpression); + clone.domainAxisMinValueExpression = JRCloneUtils.nullSafeClone(domainAxisMinValueExpression); + clone.domainAxisMaxValueExpression = JRCloneUtils.nullSafeClone(domainAxisMaxValueExpression); + clone.rangeAxisMinValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMinValueExpression); + clone.rangeAxisMaxValueExpression = JRCloneUtils.nullSafeClone(rangeAxisMaxValueExpression); + return clone; + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private boolean isShowShapes = true; + /** + * @deprecated + */ + private boolean isShowLines = true; + + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_3) + { + showShapes = Boolean.valueOf(isShowShapes); + showLines = Boolean.valueOf(isShowLines); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseValueDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseValueDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseValueDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseValueDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,124 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import net.sf.jasperreports.charts.JRValueDataset; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseChartDataset; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + +/** + * An immutable version of a dataset that generates a single value. A value + * dataset is suitable for using with charts that show a single value against + * a potential range, such as meter chart or a thermometer chart. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRBaseValueDataset extends JRBaseChartDataset implements JRValueDataset +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + /** + * The expression that returns the single value contained in this dataset. + */ + protected JRExpression valueExpression; + + + /** + * Construct a new dataset that is a copy of an existing one. + * + * @param dataset the dataset to copy + */ + public JRBaseValueDataset(JRChartDataset dataset) + { + super(dataset); + } + + + /** + * Constructs a new dataset that is a copy of an existing one, and + * register all of the new dataset's expressions with the specified + * factory. + * + * @param dataset the datast to copy + * @param factory the factory to register the new dataset's expressions with + */ + public JRBaseValueDataset(JRValueDataset dataset, JRBaseObjectFactory factory) + { + super(dataset, factory); + + valueExpression = factory.getExpression(dataset.getValueExpression()); + } + + + @Override + public JRExpression getValueExpression() + { + return valueExpression; + } + + + @Override + public byte getDatasetType() { + return JRChartDataset.VALUE_DATASET; + } + + /** + * Adds all the expression used by this plot with the specified collector. + * All collected expression that are also registered with a factory will + * be included with the report is compiled. + * + * @param collector the expression collector to use + */ + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + @Override + public Object clone() + { + JRBaseValueDataset clone = (JRBaseValueDataset)super.clone(); + clone.valueExpression = JRCloneUtils.nullSafeClone(valueExpression); + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseValueDisplay.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseValueDisplay.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseValueDisplay.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseValueDisplay.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,162 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.awt.Color; +import java.io.Serializable; + +import net.sf.jasperreports.charts.JRValueDisplay; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; + +/** + * An immutable representation of the formatting options for showing the + * value of a value dataset. Used by charts that display a single value, + * such as a Meter or Thermometer. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRBaseValueDisplay implements JRValueDisplay, Serializable +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + protected JRChart chart; + + /** + * The color to use when writing the value. + */ + protected Color color; + + /** + * The formatting mask to use when writing the value. Must a pattern + * that is accepted by a code>java.text.DecimalFormat object. + */ + protected String mask; + + /** + * The font to use when writing the value. + */ + protected JRFont font; + + + /** + * Constructs a copy of an existing value format specification. + * + * @param valueDisplay the value formatting object to copy + * @param chart the parent chart + */ + public JRBaseValueDisplay(JRValueDisplay valueDisplay, JRChart chart)//FIXMECHART these two parameters are no longer used; first one is always null + { + this.chart = chart; + + if (valueDisplay != null) + { + color = valueDisplay.getColor(); + mask = valueDisplay.getMask(); + font = valueDisplay.getFont(); + } + } + + /** + * Constructs a copy of an existing value format specification and registers + * any expression in the new copy with the specified factory. + * + * @param valueDisplay the value formatting object to copy + * @param factory the factory object to register expressions with + */ + public JRBaseValueDisplay(JRValueDisplay valueDisplay, JRBaseObjectFactory factory) + { + factory.put(valueDisplay, this); + + chart = (JRChart)factory.getVisitResult(valueDisplay.getChart()); + + color = valueDisplay.getColor(); + mask = valueDisplay.getMask(); + font = factory.getFont(chart, valueDisplay.getFont()); + } + + + @Override + public JRChart getChart() + { + return chart; + } + + @Override + public Color getColor() + { + return color; + } + @Override + public String getMask() + { + return mask; + } + @Override + public JRFont getFont() + { + return font; + } + + /** + * Adds all the expression used by this plot with the specified collector. + * All collected expression that are also registered with a factory will + * be included with the report is compiled. + * + * @param collector the expression collector to use + */ + public void collectExpressions(JRExpressionCollector collector) + { + } + + @Override + public Object clone() + { + try + { + return super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public JRBaseValueDisplay clone(JRChart parentChart) + { + JRBaseValueDisplay clone = (JRBaseValueDisplay) clone(); + clone.chart = parentChart; + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXyDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXyDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXyDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXyDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,119 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import net.sf.jasperreports.charts.JRXyDataset; +import net.sf.jasperreports.charts.JRXySeries; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseChartDataset; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRBaseXyDataset extends JRBaseChartDataset implements JRXyDataset +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + protected JRXySeries[] xySeries; + + + /** + * + */ + public JRBaseXyDataset(JRChartDataset dataset) + { + super(dataset); + } + + + /** + * + */ + public JRBaseXyDataset(JRXyDataset dataset, JRBaseObjectFactory factory) + { + super(dataset, factory); + + /* */ + JRXySeries[] srcXySeries = dataset.getSeries(); + if (srcXySeries != null && srcXySeries.length > 0) + { + xySeries = new JRXySeries[srcXySeries.length]; + for(int i = 0; i < xySeries.length; i++) + { + xySeries[i] = factory.getXySeries(srcXySeries[i]); + } + } + + } + + + @Override + public JRXySeries[] getSeries() + { + return xySeries; + } + + + /* (non-Javadoc) + * @see net.sf.jasperreports.engine.JRChartDataset#getDatasetType() + */ + @Override + public byte getDatasetType() { + return JRChartDataset.XY_DATASET; + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + @Override + public Object clone() + { + JRBaseXyDataset clone = (JRBaseXyDataset)super.clone(); + clone.xySeries = JRCloneUtils.cloneArray(xySeries); + return clone; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXySeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXySeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXySeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXySeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,140 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.io.Serializable; + +import net.sf.jasperreports.charts.JRXySeries; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRBaseXySeries implements JRXySeries, Serializable +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + protected JRExpression seriesExpression; + protected JRExpression xValueExpression; + protected JRExpression yValueExpression; + protected JRExpression labelExpression; + protected JRHyperlink itemHyperlink; + protected Boolean autoSort; + + + /** + * + */ + protected JRBaseXySeries() + { + } + + + /** + * + */ + public JRBaseXySeries(JRXySeries xySeries, JRBaseObjectFactory factory) + { + factory.put(xySeries, this); + + seriesExpression = factory.getExpression(xySeries.getSeriesExpression()); + xValueExpression = factory.getExpression(xySeries.getXValueExpression()); + yValueExpression = factory.getExpression(xySeries.getYValueExpression()); + labelExpression = factory.getExpression(xySeries.getLabelExpression()); + itemHyperlink = factory.getHyperlink(xySeries.getItemHyperlink()); + autoSort = xySeries.getAutoSort(); + } + + + @Override + public JRExpression getSeriesExpression() + { + return seriesExpression; + } + + @Override + public JRExpression getXValueExpression() + { + return xValueExpression; + } + + @Override + public JRExpression getYValueExpression() + { + return yValueExpression; + } + + @Override + public JRExpression getLabelExpression() + { + return labelExpression; + } + + + @Override + public JRHyperlink getItemHyperlink() + { + return itemHyperlink; + } + + @Override + public Boolean getAutoSort() + { + return autoSort; + } + + @Override + public Object clone() + { + JRBaseXySeries clone = null; + + try + { + clone = (JRBaseXySeries)super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new JRRuntimeException(e); + } + + clone.seriesExpression = JRCloneUtils.nullSafeClone(seriesExpression); + clone.xValueExpression = JRCloneUtils.nullSafeClone(xValueExpression); + clone.yValueExpression = JRCloneUtils.nullSafeClone(yValueExpression); + clone.labelExpression = JRCloneUtils.nullSafeClone(labelExpression); + clone.itemHyperlink = JRCloneUtils.nullSafeClone(itemHyperlink); + + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXyzDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXyzDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXyzDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXyzDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,94 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import net.sf.jasperreports.charts.JRXyzDataset; +import net.sf.jasperreports.charts.JRXyzSeries; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseChartDataset; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRBaseXyzDataset extends JRBaseChartDataset implements JRXyzDataset { + + public static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + protected JRXyzSeries[] xyzSeries; + + + public JRBaseXyzDataset( JRChartDataset dataset){ + super( dataset); + } + + public JRBaseXyzDataset( JRXyzDataset dataset, JRBaseObjectFactory factory ){ + super( dataset, factory ); + + JRXyzSeries[] srcXyzSeries = dataset.getSeries(); + + if( srcXyzSeries != null && srcXyzSeries.length > 0 ){ + + xyzSeries = new JRXyzSeries[ srcXyzSeries.length ]; + for( int i = 0; i < srcXyzSeries.length; i++ ){ + xyzSeries[i] = factory.getXyzSeries( srcXyzSeries[i] ); + } + } + } + + @Override + public JRXyzSeries[] getSeries(){ + return xyzSeries; + } + + @Override + public byte getDatasetType() { + return JRChartDataset.XYZ_DATASET; + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + @Override + public Object clone() + { + JRBaseXyzDataset clone = (JRBaseXyzDataset)super.clone(); + clone.xyzSeries = JRCloneUtils.cloneArray(xyzSeries); + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXyzSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXyzSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXyzSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/JRBaseXyzSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,111 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.base; + +import java.io.Serializable; + +import net.sf.jasperreports.charts.JRXyzSeries; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRBaseXyzSeries implements JRXyzSeries, Serializable { + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + protected JRExpression seriesExpression; + protected JRExpression xValueExpression; + protected JRExpression yValueExpression; + protected JRExpression zValueExpression; + protected JRHyperlink itemHyperlink; + + public JRBaseXyzSeries(){ + } + + public JRBaseXyzSeries( JRXyzSeries xyzSeries, JRBaseObjectFactory factory ){ + factory.put( xyzSeries, this ); + + seriesExpression = factory.getExpression( xyzSeries.getSeriesExpression() ); + xValueExpression = factory.getExpression( xyzSeries.getXValueExpression() ); + yValueExpression = factory.getExpression( xyzSeries.getYValueExpression() ); + zValueExpression = factory.getExpression( xyzSeries.getZValueExpression() ); + itemHyperlink = factory.getHyperlink(xyzSeries.getItemHyperlink()); + } + + + @Override + public JRExpression getSeriesExpression(){ + return seriesExpression; + } + + @Override + public JRExpression getXValueExpression(){ + return xValueExpression; + } + + @Override + public JRExpression getYValueExpression(){ + return yValueExpression; + } + + @Override + public JRExpression getZValueExpression(){ + return zValueExpression; + } + + @Override + public JRHyperlink getItemHyperlink() + { + return itemHyperlink; + } + + @Override + public Object clone() + { + JRBaseXyzSeries clone = null; + + try + { + clone = (JRBaseXyzSeries)super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new JRRuntimeException(e); + } + + clone.seriesExpression = JRCloneUtils.nullSafeClone(seriesExpression); + clone.xValueExpression = JRCloneUtils.nullSafeClone(xValueExpression); + clone.yValueExpression = JRCloneUtils.nullSafeClone(yValueExpression); + clone.zValueExpression = JRCloneUtils.nullSafeClone(zValueExpression); + clone.itemHyperlink = JRCloneUtils.nullSafeClone(itemHyperlink); + + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/base/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/base/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +/** + * Contains base implementations for chart related interfaces. + */ +package net.sf.jasperreports.charts.base; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/ChartContext.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/ChartContext.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/ChartContext.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/ChartContext.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import java.util.Locale; +import java.util.TimeZone; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JasperReportsContext; + +import org.jfree.data.general.Dataset; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface ChartContext +{ + + /** + * + */ + public JasperReportsContext getJasperReportsContext(); + + /** + * + */ + public JRChart getChart(); + + /** + * + */ + public Dataset getDataset(); + + /** + * + */ + public Object getLabelGenerator(); + + /** + * + */ + public Locale getLocale(); + + public TimeZone getTimeZone(); + + /** + * + */ + public String evaluateTextExpression(JRExpression expression) throws JRException; + + /** + * + */ + public Object evaluateExpression(JRExpression expression) throws JRException; +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/ChartCopyObjectFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/ChartCopyObjectFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/ChartCopyObjectFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/ChartCopyObjectFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,36 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChart; + +/** + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public interface ChartCopyObjectFactory +{ + + JRItemLabel copyItemLabel(JRItemLabel itemLabel, JRChart chart); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/ChartThemeBundle.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/ChartThemeBundle.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/ChartThemeBundle.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/ChartThemeBundle.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface ChartThemeBundle +{ + + /** + * + */ + public String[] getChartThemeNames(); + + /** + * + */ + public ChartTheme getChartTheme(String themeName); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/ChartTheme.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/ChartTheme.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/ChartTheme.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/ChartTheme.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,59 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRException; + +import org.jfree.chart.JFreeChart; + +/** + * Chart themes give more control over chart output, including + * the creation of the JFreeChart object itself. Also, chart themes + * affect a whole range of chart types across multiple reports and are not necessarily tied to + * a specific chart element within a report. They can even apply globally to all charts within + * a given JasperReports deployment, applying a new look and feel to all charts created. + *
    + * A chart theme can be set globally using a configuration property within the + * jasperreports.properties file as follows: + *

    + * net.sf.jasperreports.chart.theme=<theme_name> + *

    + * The global chart theme can be overridden at report level using the following report + * property in the report template: + *

    + * <property name="net.sf.jasperreports.chart.theme" value="<theme_name>"/> + *

    + * If needed, at chart element level, the chart theme is specified using the theme attribute. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface ChartTheme +{ + + /** + * @return an org.jfree.chart.JFreeChart object representing the chart + */ + public JFreeChart createChart(ChartContext chartContext) throws JRException; + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/ChartCopyDesignObjectFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/ChartCopyDesignObjectFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/ChartCopyDesignObjectFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/ChartCopyDesignObjectFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.ChartCopyObjectFactory; +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.engine.JRChart; + +/** + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class ChartCopyDesignObjectFactory implements ChartCopyObjectFactory +{ + + private static final ChartCopyDesignObjectFactory INSTANCE = new ChartCopyDesignObjectFactory(); + + public static ChartCopyDesignObjectFactory instance() + { + return INSTANCE; + } + + @Override + public JRItemLabel copyItemLabel(JRItemLabel itemLabel, JRChart chart) + { + return new JRDesignItemLabel(itemLabel, chart); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignAreaPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignAreaPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignAreaPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignAreaPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,293 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.awt.Color; + +import net.sf.jasperreports.charts.base.JRBaseAreaPlot; +import net.sf.jasperreports.charts.util.JRAxisFormat; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRDesignAreaPlot extends JRBaseAreaPlot implements JRDesignCategoryPlot +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CATEGORY_AXIS_LABEL_COLOR = "categoryAxisLabelColor"; + + public static final String PROPERTY_CATEGORY_AXIS_LABEL_FONT = "categoryAxisLabelFont"; + + public static final String PROPERTY_CATEGORY_AXIS_LINE_COLOR = "categoryAxisLineColor"; + + public static final String PROPERTY_CATEGORY_AXIS_TICK_LABEL_COLOR = "categoryAxisTickLabelColor"; + + public static final String PROPERTY_CATEGORY_AXIS_TICK_LABEL_FONT = "categoryAxisTickLabelFont"; + + public static final String PROPERTY_CATEGORY_AXIS_TICK_LABEL_MASK = "categoryAxisTickLabelMask"; + + public static final String PROPERTY_CATEGORY_AXIS_VERTICAL_TICK_LABELS = "categoryAxisVerticalTickLabels"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_COLOR = "valueAxisLabelColor"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_FONT = "valueAxisLabelFont"; + + public static final String PROPERTY_VALUE_AXIS_LINE_COLOR = "valueAxisLineColor"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_COLOR = "valueAxisTickLabelColor"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_FONT = "valueAxisTickLabelFont"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_MASK = "valueAxisTickLabelMask"; + + public static final String PROPERTY_VALUE_AXIS_VERTICAL_TICK_LABELS = "valueAxisVerticalTickLabels"; + + + /** + * + */ + public JRDesignAreaPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + } + + + @Override + public void setCategoryAxisLabelExpression(JRExpression categoryAxisLabelExpression) + { + Object old = this.categoryAxisLabelExpression; + this.categoryAxisLabelExpression = categoryAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LABEL_EXPRESSION, old, this.categoryAxisLabelExpression); + } + + /** + * + */ + public void setCategoryAxisLabelFont(JRFont categoryAxisLabelFont) + { + Object old = this.categoryAxisLabelFont; + this.categoryAxisLabelFont = categoryAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LABEL_FONT, old, this.categoryAxisLabelFont); + } + + /** + * + */ + public void setCategoryAxisLabelColor(Color categoryAxisLabelColor)//FIXMECHART move the setters of axis format in interface and base class + { + Object old = this.categoryAxisLabelColor; + this.categoryAxisLabelColor = categoryAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LABEL_COLOR, old, this.categoryAxisLabelColor); + } + + /** + * + */ + public void setCategoryAxisTickLabelFont(JRFont categoryAxisTickLabelFont) + { + Object old = this.categoryAxisTickLabelFont; + this.categoryAxisTickLabelFont = categoryAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_FONT, old, this.categoryAxisTickLabelFont); + } + + /** + * + */ + public void setCategoryAxisTickLabelColor(Color categoryAxisTickLabelColor) + { + Object old = this.categoryAxisTickLabelColor; + this.categoryAxisTickLabelColor = categoryAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_COLOR, old, this.categoryAxisTickLabelColor); + } + + /** + * + */ + public void setCategoryAxisTickLabelMask(String categoryAxisTickLabelMask) + { + Object old = this.categoryAxisTickLabelMask; + this.categoryAxisTickLabelMask = categoryAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_MASK, old, this.categoryAxisTickLabelMask); + } + + /** + * + */ + public void setCategoryAxisVerticalTickLabels(Boolean categoryAxisVerticalTickLabels) + { + Object old = this.categoryAxisVerticalTickLabels; + this.categoryAxisVerticalTickLabels = categoryAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_VERTICAL_TICK_LABELS, old, this.categoryAxisVerticalTickLabels); + } + + /** + * + */ + public void setCategoryAxisLineColor(Color categoryAxisLineColor) + { + Object old = this.categoryAxisLineColor; + this.categoryAxisLineColor = categoryAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LINE_COLOR, old, this.categoryAxisLineColor); + } + + @Override + public void setValueAxisLabelExpression(JRExpression valueAxisLabelExpression) + { + Object old = this.valueAxisLabelExpression; + this.valueAxisLabelExpression = valueAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_EXPRESSION, old, this.valueAxisLabelExpression); + } + + @Override + public void setDomainAxisMinValueExpression(JRExpression domainAxisMinValueExpression) + { + Object old = this.domainAxisMinValueExpression; + this.domainAxisMinValueExpression = domainAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION, old, this.domainAxisMinValueExpression); + } + + @Override + public void setDomainAxisMaxValueExpression(JRExpression domainAxisMaxValueExpression) + { + Object old = this.domainAxisMaxValueExpression; + this.domainAxisMaxValueExpression = domainAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION, old, this.domainAxisMaxValueExpression); + } + + @Override + public void setRangeAxisMinValueExpression(JRExpression rangeAxisMinValueExpression) + { + Object old = this.rangeAxisMinValueExpression; + this.rangeAxisMinValueExpression = rangeAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION, old, this.rangeAxisMinValueExpression); + } + + @Override + public void setRangeAxisMaxValueExpression(JRExpression rangeAxisMaxValueExpression) + { + Object old = this.rangeAxisMaxValueExpression; + this.rangeAxisMaxValueExpression = rangeAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION, old, this.rangeAxisMaxValueExpression); + } + + /** + * + */ + public void setValueAxisLabelFont(JRFont valueAxisLabelFont) + { + Object old = this.valueAxisLabelFont; + this.valueAxisLabelFont = valueAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_FONT, old, this.valueAxisLabelFont); + } + + /** + * + */ + public void setValueAxisLabelColor(Color valueAxisLabelColor) + { + Object old = this.valueAxisLabelColor; + this.valueAxisLabelColor = valueAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_COLOR, old, this.valueAxisLabelColor); + } + + /** + * + */ + public void setValueAxisTickLabelFont(JRFont valueAxisTickLabelFont) + { + Object old = this.valueAxisTickLabelFont; + this.valueAxisTickLabelFont = valueAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_FONT, old, this.valueAxisTickLabelFont); + } + + /** + * + */ + public void setValueAxisTickLabelColor(Color valueAxisTickLabelColor) + { + Object old = this.valueAxisTickLabelColor; + this.valueAxisTickLabelColor = valueAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_COLOR, old, this.valueAxisTickLabelColor); + } + + /** + * + */ + public void setValueAxisTickLabelMask(String valueAxisTickLabelMask) + { + Object old = this.valueAxisTickLabelMask; + this.valueAxisTickLabelMask = valueAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_MASK, old, this.valueAxisTickLabelMask); + } + + /** + * + */ + public void setValueAxisVerticalTickLabels(Boolean valueAxisVerticalTickLabels) + { + Object old = this.valueAxisVerticalTickLabels; + this.valueAxisVerticalTickLabels = valueAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_VERTICAL_TICK_LABELS, old, this.valueAxisVerticalTickLabels); + } + + /** + * + */ + public void setValueAxisLineColor(Color valueAxisLineColor) + { + Object old = this.valueAxisLineColor; + this.valueAxisLineColor = valueAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LINE_COLOR, old, this.valueAxisLineColor); + } + + @Override + public void setCategoryAxisFormat(JRAxisFormat axisFormat) + { + setCategoryAxisLabelFont(axisFormat.getLabelFont()); + setCategoryAxisLabelColor(axisFormat.getLabelColor()); + setCategoryAxisTickLabelFont(axisFormat.getTickLabelFont()); + setCategoryAxisTickLabelColor(axisFormat.getTickLabelColor()); + setCategoryAxisTickLabelMask(axisFormat.getTickLabelMask()); + setCategoryAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setCategoryAxisLineColor(axisFormat.getLineColor()); + } + + @Override + public void setValueAxisFormat(JRAxisFormat axisFormat) + { + setValueAxisLabelFont(axisFormat.getLabelFont()); + setValueAxisLabelColor(axisFormat.getLabelColor()); + setValueAxisTickLabelFont(axisFormat.getTickLabelFont()); + setValueAxisTickLabelColor(axisFormat.getTickLabelColor()); + setValueAxisTickLabelMask(axisFormat.getTickLabelMask()); + setValueAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setValueAxisLineColor(axisFormat.getLineColor()); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignBar3DPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignBar3DPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignBar3DPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignBar3DPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,304 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.charts.base.JRBaseBar3DPlot; +import net.sf.jasperreports.charts.util.JRAxisFormat; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRDesignBar3DPlot extends JRBaseBar3DPlot implements JRDesignCategoryPlot +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CATEGORY_AXIS_LABEL_COLOR = "categoryAxisLabelColor"; + + public static final String PROPERTY_CATEGORY_AXIS_LABEL_FONT = "categoryAxisLabelFont"; + + public static final String PROPERTY_CATEGORY_AXIS_LINE_COLOR = "categoryAxisLineColor"; + + public static final String PROPERTY_CATEGORY_AXIS_TICK_LABEL_COLOR = "categoryAxisTickLabelColor"; + + public static final String PROPERTY_CATEGORY_AXIS_TICK_LABEL_FONT = "categoryAxisTickLabelFont"; + + public static final String PROPERTY_CATEGORY_AXIS_TICK_LABEL_MASK = "categoryAxisTickLabelMask"; + + public static final String PROPERTY_CATEGORY_AXIS_VERTICAL_TICK_LABELS = "categoryAxisVerticalTickLabels"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_COLOR = "valueAxisLabelColor"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_FONT = "valueAxisLabelFont"; + + public static final String PROPERTY_VALUE_AXIS_LINE_COLOR = "valueAxisLineColor"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_COLOR = "valueAxisTickLabelColor"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_FONT = "valueAxisTickLabelFont"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_MASK = "valueAxisTickLabelMask"; + + public static final String PROPERTY_VALUE_AXIS_VERTICAL_TICK_LABELS = "valueAxisVerticalTickLabels"; + + public static final String PROPERTY_ITEM_LABEL = "itemLabel"; + + /** + * + */ + public JRDesignBar3DPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart, ChartCopyDesignObjectFactory.instance()); + } + + @Override + public void setCategoryAxisLabelExpression(JRExpression categoryAxisLabelExpression) + { + Object old = this.categoryAxisLabelExpression; + this.categoryAxisLabelExpression = categoryAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LABEL_EXPRESSION, old, this.categoryAxisLabelExpression); + } + + /** + * + */ + public void setCategoryAxisLabelFont(JRFont categoryAxisLabelFont) + { + Object old = this.categoryAxisLabelFont; + this.categoryAxisLabelFont = categoryAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LABEL_FONT, old, this.categoryAxisLabelFont); + } + + /** + * + */ + public void setCategoryAxisLabelColor(Color categoryAxisLabelColor) + { + Object old = this.categoryAxisLabelColor; + this.categoryAxisLabelColor = categoryAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LABEL_COLOR, old, this.categoryAxisLabelColor); + } + + /** + * + */ + public void setCategoryAxisTickLabelFont(JRFont categoryAxisTickLabelFont) + { + Object old = this.categoryAxisTickLabelFont; + this.categoryAxisTickLabelFont = categoryAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_FONT, old, this.categoryAxisTickLabelFont); + } + + /** + * + */ + public void setCategoryAxisTickLabelColor(Color categoryAxisTickLabelColor) + { + Object old = this.categoryAxisTickLabelColor; + this.categoryAxisTickLabelColor = categoryAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_COLOR, old, this.categoryAxisTickLabelColor); + } + + /** + * + */ + public void setCategoryAxisTickLabelMask(String categoryAxisTickLabelMask) + { + Object old = this.categoryAxisTickLabelMask; + this.categoryAxisTickLabelMask = categoryAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_MASK, old, this.categoryAxisTickLabelMask); + } + + /** + * + */ + public void setCategoryAxisVerticalTickLabels(Boolean categoryAxisVerticalTickLabels) + { + Object old = this.categoryAxisVerticalTickLabels; + this.categoryAxisVerticalTickLabels = categoryAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_VERTICAL_TICK_LABELS, old, this.categoryAxisVerticalTickLabels); + } + + /** + * + */ + public void setCategoryAxisLineColor(Color categoryAxisLineColor) + { + Object old = this.categoryAxisLineColor; + this.categoryAxisLineColor = categoryAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LINE_COLOR, old, this.categoryAxisLineColor); + } + + @Override + public void setValueAxisLabelExpression(JRExpression valueAxisLabelExpression) + { + Object old = this.valueAxisLabelExpression; + this.valueAxisLabelExpression = valueAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_EXPRESSION, old, this.valueAxisLabelExpression); + } + + @Override + public void setDomainAxisMinValueExpression(JRExpression domainAxisMinValueExpression) + { + Object old = this.domainAxisMinValueExpression; + this.domainAxisMinValueExpression = domainAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION, old, this.domainAxisMinValueExpression); + } + + @Override + public void setDomainAxisMaxValueExpression(JRExpression domainAxisMaxValueExpression) + { + Object old = this.domainAxisMaxValueExpression; + this.domainAxisMaxValueExpression = domainAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION, old, this.domainAxisMaxValueExpression); + } + + @Override + public void setRangeAxisMinValueExpression(JRExpression rangeAxisMinValueExpression) + { + Object old = this.rangeAxisMinValueExpression; + this.rangeAxisMinValueExpression = rangeAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION, old, this.rangeAxisMinValueExpression); + } + + @Override + public void setRangeAxisMaxValueExpression(JRExpression rangeAxisMaxValueExpression) + { + Object old = this.rangeAxisMaxValueExpression; + this.rangeAxisMaxValueExpression = rangeAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION, old, this.rangeAxisMaxValueExpression); + } + + + /** + * + */ + public void setValueAxisLabelFont(JRFont valueAxisLabelFont) + { + Object old = this.valueAxisLabelFont; + this.valueAxisLabelFont = valueAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_FONT, old, this.valueAxisLabelFont); + } + + /** + * + */ + public void setValueAxisLabelColor(Color valueAxisLabelColor) + { + Object old = this.valueAxisLabelColor; + this.valueAxisLabelColor = valueAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_COLOR, old, this.valueAxisLabelColor); + } + + /** + * + */ + public void setValueAxisTickLabelFont(JRFont valueAxisTickLabelFont) + { + Object old = this.valueAxisTickLabelFont; + this.valueAxisTickLabelFont = valueAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_FONT, old, this.valueAxisTickLabelFont); + } + + /** + * + */ + public void setValueAxisTickLabelColor(Color valueAxisTickLabelColor) + { + Object old = this.valueAxisTickLabelColor; + this.valueAxisTickLabelColor = valueAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_COLOR, old, this.valueAxisTickLabelColor); + } + + /** + * + */ + public void setValueAxisTickLabelMask(String valueAxisTickLabelMask) + { + Object old = this.valueAxisTickLabelMask; + this.valueAxisTickLabelMask = valueAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_MASK, old, this.valueAxisTickLabelMask); + } + + /** + * + */ + public void setValueAxisVerticalTickLabels(Boolean valueAxisVerticalTickLabels) + { + Object old = this.valueAxisVerticalTickLabels; + this.valueAxisVerticalTickLabels = valueAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_VERTICAL_TICK_LABELS, old, this.valueAxisVerticalTickLabels); + } + + /** + * + */ + public void setValueAxisLineColor(Color valueAxisLineColor) + { + Object old = this.valueAxisLineColor; + this.valueAxisLineColor = valueAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LINE_COLOR, old, this.valueAxisLineColor); + } + + /** + * + */ + public void setItemLabel( JRItemLabel itemLabel ){ + JRItemLabel old = this.itemLabel; + this.itemLabel = itemLabel; + getEventSupport().firePropertyChange(PROPERTY_ITEM_LABEL, old, this.itemLabel); + } + + @Override + public void setCategoryAxisFormat(JRAxisFormat axisFormat) + { + setCategoryAxisLabelFont(axisFormat.getLabelFont()); + setCategoryAxisLabelColor(axisFormat.getLabelColor()); + setCategoryAxisTickLabelFont(axisFormat.getTickLabelFont()); + setCategoryAxisTickLabelColor(axisFormat.getTickLabelColor()); + setCategoryAxisTickLabelMask(axisFormat.getTickLabelMask()); + setCategoryAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setCategoryAxisLineColor(axisFormat.getLineColor()); + } + + @Override + public void setValueAxisFormat(JRAxisFormat axisFormat) + { + setValueAxisLabelFont(axisFormat.getLabelFont()); + setValueAxisLabelColor(axisFormat.getLabelColor()); + setValueAxisTickLabelFont(axisFormat.getTickLabelFont()); + setValueAxisTickLabelColor(axisFormat.getTickLabelColor()); + setValueAxisTickLabelMask(axisFormat.getTickLabelMask()); + setValueAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setValueAxisLineColor(axisFormat.getLineColor()); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignBarPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignBarPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignBarPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignBarPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,310 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.charts.base.JRBaseBarPlot; +import net.sf.jasperreports.charts.util.JRAxisFormat; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRDesignBarPlot extends JRBaseBarPlot implements JRDesignCategoryPlot +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CATEGORY_AXIS_LABEL_COLOR = "categoryAxisLabelColor"; + + public static final String PROPERTY_CATEGORY_AXIS_LABEL_FONT = "categoryAxisLabelFont"; + + public static final String PROPERTY_CATEGORY_AXIS_LINE_COLOR = "categoryAxisLineColor"; + + public static final String PROPERTY_CATEGORY_AXIS_TICK_LABEL_COLOR = "categoryAxisTickLabelColor"; + + public static final String PROPERTY_CATEGORY_AXIS_TICK_LABEL_FONT = "categoryAxisTickLabelFont"; + + public static final String PROPERTY_CATEGORY_AXIS_TICK_LABEL_MASK = "categoryAxisTickLabelMask"; + + public static final String PROPERTY_CATEGORY_AXIS_VERTICAL_TICK_LABELS = "categoryAxisVerticalTickLabels"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_COLOR = "valueAxisLabelColor"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_FONT = "valueAxisLabelFont"; + + public static final String PROPERTY_VALUE_AXIS_LINE_COLOR = "valueAxisLineColor"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_COLOR = "valueAxisTickLabelColor"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_FONT = "valueAxisTickLabelFont"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_MASK = "valueAxisTickLabelMask"; + + public static final String PROPERTY_VALUE_AXIS_VERTICAL_TICK_LABELS = "valueAxisVerticalTickLabels"; + + public static final String PROPERTY_ITEM_LABEL = "itemLabel"; + + /** + * + */ + public JRDesignBarPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart, ChartCopyDesignObjectFactory.instance()); + } + + + @Override + public void setCategoryAxisLabelExpression(JRExpression categoryAxisLabelExpression) + { + Object old = this.categoryAxisLabelExpression; + this.categoryAxisLabelExpression = categoryAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LABEL_EXPRESSION, old, this.categoryAxisLabelExpression); + } + + /** + * + */ + public void setCategoryAxisLabelFont(JRFont categoryAxisLabelFont) + { + Object old = this.categoryAxisLabelFont; + this.categoryAxisLabelFont = categoryAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LABEL_FONT, old, this.categoryAxisLabelFont); + } + + /** + * + */ + public void setCategoryAxisLabelColor(Color categoryAxisLabelColor) + { + Object old = this.categoryAxisLabelColor; + this.categoryAxisLabelColor = categoryAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LABEL_COLOR, old, this.categoryAxisLabelColor); + } + + /** + * + */ + public void setCategoryAxisTickLabelFont(JRFont categoryAxisTickLabelFont) + { + Object old = this.categoryAxisTickLabelFont; + this.categoryAxisTickLabelFont = categoryAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_FONT, old, this.categoryAxisTickLabelFont); + } + + /** + * + */ + public void setCategoryAxisTickLabelColor(Color categoryAxisTickLabelColor) + { + Object old = this.categoryAxisTickLabelColor; + this.categoryAxisTickLabelColor = categoryAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_COLOR, old, this.categoryAxisTickLabelColor); + } + + /** + * + */ + public void setCategoryAxisTickLabelMask(String categoryAxisTickLabelMask) + { + Object old = this.categoryAxisTickLabelMask; + this.categoryAxisTickLabelMask = categoryAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_MASK, old, this.categoryAxisTickLabelMask); + } + + /** + * + */ + public void setCategoryAxisVerticalTickLabels(Boolean categoryAxisVerticalTickLabels) + { + Object old = this.categoryAxisVerticalTickLabels; + this.categoryAxisVerticalTickLabels = categoryAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_VERTICAL_TICK_LABELS, old, this.categoryAxisVerticalTickLabels); + } + + /** + * + */ + public void setCategoryAxisLineColor(Color categoryAxisLineColor) + { + Object old = this.categoryAxisLineColor; + this.categoryAxisLineColor = categoryAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LINE_COLOR, old, this.categoryAxisLineColor); + } + + @Override + public void setValueAxisLabelExpression(JRExpression valueAxisLabelExpression) + { + Object old = this.valueAxisLabelExpression; + this.valueAxisLabelExpression = valueAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_EXPRESSION, old, this.valueAxisLabelExpression); + } + + @Override + public void setDomainAxisMinValueExpression(JRExpression domainAxisMinValueExpression) + { + Object old = this.domainAxisMinValueExpression; + this.domainAxisMinValueExpression = domainAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION, old, this.domainAxisMinValueExpression); + } + + @Override + public void setDomainAxisMaxValueExpression(JRExpression domainAxisMaxValueExpression) + { + Object old = this.domainAxisMaxValueExpression; + this.domainAxisMaxValueExpression = domainAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION, old, this.domainAxisMaxValueExpression); + } + + @Override + public void setRangeAxisMinValueExpression(JRExpression rangeAxisMinValueExpression) + { + Object old = this.rangeAxisMinValueExpression; + this.rangeAxisMinValueExpression = rangeAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION, old, this.rangeAxisMinValueExpression); + } + + @Override + public void setRangeAxisMaxValueExpression(JRExpression rangeAxisMaxValueExpression) + { + Object old = this.rangeAxisMaxValueExpression; + this.rangeAxisMaxValueExpression = rangeAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION, old, this.rangeAxisMaxValueExpression); + } + + /** + * + */ + public void setValueAxisLabelFont(JRFont valueAxisLabelFont) + { + Object old = this.valueAxisLabelFont; + this.valueAxisLabelFont = valueAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_FONT, old, this.valueAxisLabelFont); + } + + /** + * + */ + public void setValueAxisLabelColor(Color valueAxisLabelColor) + { + Object old = this.valueAxisLabelColor; + this.valueAxisLabelColor = valueAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_COLOR, old, this.valueAxisLabelColor); + } + + /** + * + */ + public void setValueAxisTickLabelFont(JRFont valueAxisTickLabelFont) + { + Object old = this.valueAxisTickLabelFont; + this.valueAxisTickLabelFont = valueAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_FONT, old, this.valueAxisTickLabelFont); + } + + /** + * + */ + public void setValueAxisTickLabelColor(Color valueAxisTickLabelColor) + { + Object old = this.valueAxisTickLabelColor; + this.valueAxisTickLabelColor = valueAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_COLOR, old, this.valueAxisTickLabelColor); + } + + /** + * + */ + public void setValueAxisTickLabelMask(String valueAxisTickLabelMask) + { + Object old = this.valueAxisTickLabelMask; + this.valueAxisTickLabelMask = valueAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_MASK, old, this.valueAxisTickLabelMask); + } + + /** + * + */ + public void setValueAxisVerticalTickLabels(Boolean valueAxisVerticalTickLabels) + { + Object old = this.valueAxisVerticalTickLabels; + this.valueAxisVerticalTickLabels = valueAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_VERTICAL_TICK_LABELS, old, this.valueAxisVerticalTickLabels); + } + + /** + * + */ + public void setValueAxisLineColor(Color valueAxisLineColor) + { + Object old = this.valueAxisLineColor; + this.valueAxisLineColor = valueAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LINE_COLOR, old, this.valueAxisLineColor); + } + + /** + * + */ + public void setItemLabel(JRItemLabel itemLabel) + { + Object old = this.itemLabel; + this.itemLabel = itemLabel; + getEventSupport().firePropertyChange(PROPERTY_ITEM_LABEL, old, this.itemLabel); + } + + @Override + public void setCategoryAxisFormat(JRAxisFormat axisFormat) + { + setCategoryAxisLabelFont(axisFormat.getLabelFont()); + setCategoryAxisLabelColor(axisFormat.getLabelColor()); + setCategoryAxisTickLabelFont(axisFormat.getTickLabelFont()); + setCategoryAxisTickLabelColor(axisFormat.getTickLabelColor()); + setCategoryAxisTickLabelMask(axisFormat.getTickLabelMask()); + setCategoryAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setCategoryAxisLineColor(axisFormat.getLineColor()); + } + + @Override + public void setValueAxisFormat(JRAxisFormat axisFormat) + { + setValueAxisLabelFont(axisFormat.getLabelFont()); + setValueAxisLabelColor(axisFormat.getLabelColor()); + setValueAxisTickLabelFont(axisFormat.getTickLabelFont()); + setValueAxisTickLabelColor(axisFormat.getTickLabelColor()); + setValueAxisTickLabelMask(axisFormat.getTickLabelMask()); + setValueAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setValueAxisLineColor(axisFormat.getLineColor()); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignBubblePlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignBubblePlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignBubblePlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignBubblePlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,319 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.awt.Color; + +import net.sf.jasperreports.charts.base.JRBaseBubblePlot; +import net.sf.jasperreports.charts.util.JRAxisFormat; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRDesignBubblePlot extends JRBaseBubblePlot { + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_X_AXIS_LABEL_COLOR = "xAxisLabelColor"; + + public static final String PROPERTY_X_AXIS_LABEL_EXPRESSION = "xAxisLabelExpression"; + + public static final String PROPERTY_X_AXIS_LABEL_FONT = "xAxisLabelFont"; + + public static final String PROPERTY_X_AXIS_LINE_COLOR = "xAxisLineColor"; + + public static final String PROPERTY_X_AXIS_TICK_LABEL_COLOR = "xAxisTickLabelColor"; + + public static final String PROPERTY_X_AXIS_TICK_LABEL_FONT = "xAxisTickLabelFont"; + + public static final String PROPERTY_X_AXIS_TICK_LABEL_MASK = "xAxisTickLabelMask"; + + public static final String PROPERTY_X_AXIS_VERTICAL_TICK_LABELS = "xAxisVerticalTickLabels"; + + public static final String PROPERTY_Y_AXIS_LABEL_COLOR = "yAxisLabelColor"; + + public static final String PROPERTY_Y_AXIS_LABEL_EXPRESSION = "yAxisLabelExpression"; + + public static final String PROPERTY_Y_AXIS_LABEL_FONT = "yAxisLabelFont"; + + public static final String PROPERTY_Y_AXIS_LINE_COLOR = "yAxisLineColor"; + + public static final String PROPERTY_Y_AXIS_TICK_LABEL_COLOR = "yAxisTickLabelColor"; + + public static final String PROPERTY_Y_AXIS_TICK_LABEL_FONT = "yAxisTickLabelFont"; + + public static final String PROPERTY_Y_AXIS_TICK_LABEL_MASK = "yAxisTickLabelMask"; + + public static final String PROPERTY_Y_AXIS_VERTICAL_TICK_LABELS = "yAxisVerticalTickLabels"; + + public static final String PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION = "domainAxisMinValueExpression"; + + public static final String PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION = "domainAxisMaxValueExpression"; + + public static final String PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION = "rangeAxisMinValueExpression"; + + public static final String PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION = "rangeAxisMaxValueExpression"; + + + /** + * + */ + public JRDesignBubblePlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + } + + + /** + * + */ + public void setXAxisLabelExpression( JRExpression xAxisLabelExpression ){ + Object old = this.xAxisLabelExpression; + this.xAxisLabelExpression = xAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_LABEL_EXPRESSION, old, this.xAxisLabelExpression); + } + + /** + * + */ + public void setXAxisLabelFont(JRFont xAxisLabelFont) + { + Object old = this.xAxisLabelFont; + this.xAxisLabelFont = xAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_LABEL_FONT, old, this.xAxisLabelFont); + } + + /** + * + */ + public void setXAxisLabelColor(Color xAxisLabelColor) + { + Object old = this.xAxisLabelColor; + this.xAxisLabelColor = xAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_LABEL_COLOR, old, this.xAxisLabelColor); + } + + /** + * + */ + public void setXAxisTickLabelFont(JRFont xAxisTickLabelFont) + { + Object old = this.xAxisTickLabelFont; + this.xAxisTickLabelFont = xAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_TICK_LABEL_FONT, old, this.xAxisTickLabelFont); + } + + /** + * + */ + public void setXAxisTickLabelColor(Color xAxisTickLabelColor) + { + Object old = this.xAxisTickLabelColor; + this.xAxisTickLabelColor = xAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_TICK_LABEL_COLOR, old, this.xAxisTickLabelColor); + } + + /** + * + */ + public void setXAxisTickLabelMask(String xAxisTickLabelMask) + { + Object old = this.xAxisTickLabelMask; + this.xAxisTickLabelMask = xAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_TICK_LABEL_MASK, old, this.xAxisTickLabelMask); + } + + /** + * + */ + public void setXAxisVerticalTickLabels(Boolean xAxisVerticalTickLabels) + { + Object old = this.xAxisVerticalTickLabels; + this.xAxisVerticalTickLabels = xAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_VERTICAL_TICK_LABELS, old, this.xAxisVerticalTickLabels); + } + + /** + * + */ + public void setXAxisLineColor(Color xAxisLineColor) + { + Object old = this.xAxisLineColor; + this.xAxisLineColor = xAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_LINE_COLOR, old, this.xAxisLineColor); + } + + /** + * + */ + public void setYAxisLabelExpression( JRExpression yAxisLabelExpression ){ + Object old = this.yAxisLabelExpression; + this.yAxisLabelExpression = yAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_LABEL_EXPRESSION, old, this.yAxisLabelExpression); + } + + /** + * + */ + public void setYAxisLabelFont(JRFont yAxisLabelFont) + { + Object old = this.yAxisLabelFont; + this.yAxisLabelFont = yAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_LABEL_FONT, old, this.yAxisLabelFont); + } + + /** + * + */ + public void setYAxisLabelColor(Color yAxisLabelColor) + { + Object old = this.yAxisLabelColor; + this.yAxisLabelColor = yAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_LABEL_COLOR, old, this.yAxisLabelColor); + } + + /** + * + */ + public void setYAxisTickLabelFont(JRFont yAxisTickLabelFont) + { + Object old = this.yAxisTickLabelFont; + this.yAxisTickLabelFont = yAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_TICK_LABEL_FONT, old, this.yAxisTickLabelFont); + } + + /** + * + */ + public void setYAxisTickLabelColor(Color yAxisTickLabelColor) + { + Object old = this.yAxisTickLabelColor; + this.yAxisTickLabelColor = yAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_TICK_LABEL_COLOR, old, this.yAxisTickLabelColor); + } + + /** + * + */ + public void setYAxisTickLabelMask(String yAxisTickLabelMask) + { + Object old = this.yAxisTickLabelMask; + this.yAxisTickLabelMask = yAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_TICK_LABEL_MASK, old, this.yAxisTickLabelMask); + } + + /** + * + */ + public void setYAxisVerticalTickLabels(Boolean yAxisVerticalTickLabels) + { + Object old = this.yAxisVerticalTickLabels; + this.yAxisVerticalTickLabels = yAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_VERTICAL_TICK_LABELS, old, this.yAxisVerticalTickLabels); + } + + /** + * + */ + public void setYAxisLineColor(Color yAxisLineColor) + { + Object old = this.yAxisLineColor; + this.yAxisLineColor = yAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_LINE_COLOR, old, this.yAxisLineColor); + } + + /** + * + */ + public void setXAxisFormat(JRAxisFormat axisFormat) + { + setXAxisLabelColor(axisFormat.getLabelColor()); + setXAxisLabelFont(axisFormat.getLabelFont()); + setXAxisTickLabelFont(axisFormat.getTickLabelFont()); + setXAxisTickLabelColor(axisFormat.getTickLabelColor()); + setXAxisTickLabelMask(axisFormat.getTickLabelMask()); + setXAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setXAxisLineColor(axisFormat.getLineColor()); + } + + /** + * + */ + public void setYAxisFormat(JRAxisFormat axisFormat) + { + setYAxisLabelColor(axisFormat.getLabelColor()); + setYAxisLabelFont(axisFormat.getLabelFont()); + setYAxisTickLabelFont(axisFormat.getTickLabelFont()); + setYAxisTickLabelColor(axisFormat.getTickLabelColor()); + setYAxisTickLabelMask(axisFormat.getTickLabelMask()); + setYAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setYAxisLineColor(axisFormat.getLineColor()); + } + + /** + * + */ + public void setDomainAxisMinValueExpression(JRExpression domainAxisMinValueExpression) + { + Object old = this.domainAxisMinValueExpression; + this.domainAxisMinValueExpression = domainAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION, old, this.domainAxisMinValueExpression); + } + + /** + * + */ + public void setDomainAxisMaxValueExpression(JRExpression domainAxisMaxValueExpression) + { + Object old = this.domainAxisMaxValueExpression; + this.domainAxisMaxValueExpression = domainAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION, old, this.domainAxisMaxValueExpression); + } + + /** + * + */ + public void setRangeAxisMinValueExpression(JRExpression rangeAxisMinValueExpression) + { + Object old = this.rangeAxisMinValueExpression; + this.rangeAxisMinValueExpression = rangeAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION, old, this.rangeAxisMinValueExpression); + } + + /** + * + */ + public void setRangeAxisMaxValueExpression(JRExpression rangeAxisMaxValueExpression) + { + Object old = this.rangeAxisMaxValueExpression; + this.rangeAxisMaxValueExpression = rangeAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION, old, this.rangeAxisMaxValueExpression); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCandlestickPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCandlestickPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCandlestickPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCandlestickPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,324 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.awt.Color; + +import net.sf.jasperreports.charts.base.JRBaseCandlestickPlot; +import net.sf.jasperreports.charts.util.JRAxisFormat; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRDesignCandlestickPlot extends JRBaseCandlestickPlot +{ + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_TIME_AXIS_LABEL_COLOR = "timeAxisLabelColor"; + + public static final String PROPERTY_TIME_AXIS_LABEL_EXPRESSION = "timeAxisLabelExpression"; + + public static final String PROPERTY_TIME_AXIS_LABEL_FONT = "timeAxisLabelFont"; + + public static final String PROPERTY_TIME_AXIS_LINE_COLOR = "timeAxisLineColor"; + + public static final String PROPERTY_TIME_AXIS_TICK_LABEL_COLOR = "timeAxisTickLabelColor"; + + public static final String PROPERTY_TIME_AXIS_TICK_LABEL_FONT = "timeAxisTickLabelFont"; + + public static final String PROPERTY_TIME_AXIS_TICK_LABEL_MASK = "timeAxisTickLabelMask"; + + public static final String PROPERTY_TIME_AXIS_VERTICAL_TICK_LABELS = "timeAxisVerticalTickLabels"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_COLOR = "valueAxisLabelColor"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_EXPRESSION = "valueAxisLabelExpression"; + + public static final String PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION = "domainAxisMinValueExpression"; + + public static final String PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION = "domainAxisMaxValueExpression"; + + public static final String PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION = "rangeAxisMinValueExpression"; + + public static final String PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION = "rangeAxisMaxValueExpression"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_FONT = "valueAxisLabelFont"; + + public static final String PROPERTY_VALUE_AXIS_LINE_COLOR = "valueAxisLineColor"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_COLOR = "valueAxisTickLabelColor"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_FONT = "valueAxisTickLabelFont"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_MASK = "valueAxisTickLabelMask"; + + public static final String PROPERTY_VALUE_AXIS_VERTICAL_TICK_LABELS = "valueAxisVerticalTickLabels"; + + + /** + * + */ + public JRDesignCandlestickPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + } + + + /** + * + */ + public void setTimeAxisLabelExpression( JRExpression timeAxisLabelExpression ){ + Object old = this.timeAxisLabelExpression; + this.timeAxisLabelExpression = timeAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_LABEL_EXPRESSION, old, this.timeAxisLabelExpression); + + } + + /** + * + */ + public void setTimeAxisLabelFont(JRFont timeAxisLabelFont) + { + Object old = this.timeAxisLabelFont; + this.timeAxisLabelFont = timeAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_LABEL_FONT, old, this.timeAxisLabelFont); + } + + /** + * + */ + public void setTimeAxisLabelColor(Color timeAxisLabelColor) + { + Object old = this.timeAxisLabelColor; + this.timeAxisLabelColor = timeAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_LABEL_COLOR, old, this.timeAxisLabelColor); + } + + /** + * + */ + public void setTimeAxisTickLabelFont(JRFont timeAxisTickLabelFont) + { + Object old = this.timeAxisTickLabelFont; + this.timeAxisTickLabelFont = timeAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_TICK_LABEL_FONT, old, this.timeAxisTickLabelFont); + } + + /** + * + */ + public void setTimeAxisTickLabelColor(Color timeAxisTickLabelColor) + { + Object old = this.timeAxisTickLabelColor; + this.timeAxisTickLabelColor = timeAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_TICK_LABEL_COLOR, old, this.timeAxisTickLabelColor); + } + + /** + * + */ + public void setTimeAxisTickLabelMask(String timeAxisTickLabelMask) + { + Object old = this.timeAxisTickLabelMask; + this.timeAxisTickLabelMask = timeAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_TICK_LABEL_MASK, old, this.timeAxisTickLabelMask); + } + + /** + * + */ + public void setTimeAxisVerticalTickLabels(Boolean timeAxisVerticalTickLabels) + { + Object old = this.timeAxisVerticalTickLabels; + this.timeAxisVerticalTickLabels = timeAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_VERTICAL_TICK_LABELS, old, this.timeAxisVerticalTickLabels); + } + + /** + * + */ + public void setTimeAxisLineColor(Color timeAxisLineColor) + { + Object old = this.timeAxisLineColor; + this.timeAxisLineColor = timeAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_LINE_COLOR, old, this.timeAxisLineColor); + } + + /** + * + */ + public void setValueAxisLabelExpression(JRExpression valueAxisLabelExpression) + { + Object old = this.valueAxisLabelExpression; + this.valueAxisLabelExpression = valueAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_EXPRESSION, old, this.valueAxisLabelExpression); + } + + /** + * + */ + public void setDomainAxisMinValueExpression(JRExpression domainAxisMinValueExpression) + { + Object old = this.domainAxisMinValueExpression; + this.domainAxisMinValueExpression = domainAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION, old, this.domainAxisMinValueExpression); + } + + /** + * + */ + public void setDomainAxisMaxValueExpression(JRExpression domainAxisMaxValueExpression) + { + Object old = this.domainAxisMaxValueExpression; + this.domainAxisMaxValueExpression = domainAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION, old, this.domainAxisMaxValueExpression); + } + + /** + * + */ + public void setRangeAxisMinValueExpression(JRExpression rangeAxisMinValueExpression) + { + Object old = this.rangeAxisMinValueExpression; + this.rangeAxisMinValueExpression = rangeAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION, old, this.rangeAxisMinValueExpression); + } + + /** + * + */ + public void setRangeAxisMaxValueExpression(JRExpression rangeAxisMaxValueExpression) + { + Object old = this.rangeAxisMaxValueExpression; + this.rangeAxisMaxValueExpression = rangeAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION, old, this.rangeAxisMaxValueExpression); + } + + /** + * + */ + public void setValueAxisLabelFont(JRFont valueAxisLabelFont) + { + Object old = this.valueAxisLabelFont; + this.valueAxisLabelFont = valueAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_FONT, old, this.valueAxisLabelFont); + } + + /** + * + */ + public void setValueAxisLabelColor(Color valueAxisLabelColor) + { + Object old = this.valueAxisLabelColor; + this.valueAxisLabelColor = valueAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_COLOR, old, this.valueAxisLabelColor); + } + + /** + * + */ + public void setValueAxisTickLabelFont(JRFont valueAxisTickLabelFont) + { + Object old = this.valueAxisTickLabelFont; + this.valueAxisTickLabelFont = valueAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_FONT, old, this.valueAxisTickLabelFont); + } + + /** + * + */ + public void setValueAxisTickLabelColor(Color valueAxisTickLabelColor) + { + Object old = this.valueAxisTickLabelColor; + this.valueAxisTickLabelColor = valueAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_COLOR, old, this.valueAxisTickLabelColor); + } + + /** + * + */ + public void setValueAxisTickLabelMask(String valueAxisTickLabelMask) + { + Object old = this.valueAxisTickLabelMask; + this.valueAxisTickLabelMask = valueAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_MASK, old, this.valueAxisTickLabelMask); + } + + /** + * + */ + public void setValueAxisVerticalTickLabels(Boolean valueAxisVerticalTickLabels) + { + Object old = this.valueAxisVerticalTickLabels; + this.valueAxisVerticalTickLabels = valueAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_VERTICAL_TICK_LABELS, old, this.valueAxisVerticalTickLabels); + } + + /** + * + */ + public void setValueAxisLineColor(Color valueAxisLineColor) + { + Object old = this.valueAxisLineColor; + this.valueAxisLineColor = valueAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LINE_COLOR, old, this.valueAxisLineColor); + } + + /** + * + */ + public void setTimeAxisFormat(JRAxisFormat axisFormat) + { + setTimeAxisLabelFont(axisFormat.getLabelFont()); + setTimeAxisLabelColor(axisFormat.getLabelColor()); + setTimeAxisTickLabelFont(axisFormat.getTickLabelFont()); + setTimeAxisTickLabelColor(axisFormat.getTickLabelColor()); + setTimeAxisTickLabelMask(axisFormat.getTickLabelMask()); + setTimeAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setTimeAxisLineColor(axisFormat.getLineColor()); + } + + /** + * + */ + public void setValueAxisFormat(JRAxisFormat axisFormat) + { + setValueAxisLabelFont(axisFormat.getLabelFont()); + setValueAxisLabelColor(axisFormat.getLabelColor()); + setValueAxisTickLabelFont(axisFormat.getTickLabelFont()); + setValueAxisTickLabelColor(axisFormat.getTickLabelColor()); + setValueAxisTickLabelMask(axisFormat.getTickLabelMask()); + setValueAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setValueAxisLineColor(axisFormat.getLineColor()); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCategoryDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCategoryDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCategoryDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCategoryDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,154 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.charts.JRCategoryDataset; +import net.sf.jasperreports.charts.JRCategorySeries; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.design.JRDesignChartDataset; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRDesignCategoryDataset extends JRDesignChartDataset implements JRCategoryDataset +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CATEGORY_SERIES = "categorySeries"; + + private List categorySeriesList = new ArrayList(); + + + /** + * + */ + public JRDesignCategoryDataset(JRChartDataset dataset) + { + super(dataset); + } + + + @Override + public JRCategorySeries[] getSeries() + { + JRCategorySeries[] categorySeriesArray = new JRCategorySeries[categorySeriesList.size()]; + + categorySeriesList.toArray(categorySeriesArray); + + return categorySeriesArray; + } + + + /** + * + */ + public List getSeriesList() + { + return categorySeriesList; + } + + + /** + * + */ + public void addCategorySeries(JRCategorySeries categorySeries) + { + categorySeriesList.add(categorySeries); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_CATEGORY_SERIES, + categorySeries, categorySeriesList.size() - 1); + } + + /** + * + */ + public void addCategorySeries(int index, JRCategorySeries categorySeries) + { + categorySeriesList.add(index, categorySeries); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_CATEGORY_SERIES, + categorySeries, index); + } + + /** + * + */ + public JRCategorySeries removeCategorySeries(JRCategorySeries categorySeries) + { + if (categorySeries != null) + { + int idx = categorySeriesList.indexOf(categorySeries); + if (idx >= 0) + { + categorySeriesList.remove(idx); + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_CATEGORY_SERIES, + categorySeries, idx); + } + } + + return categorySeries; + } + + + @Override + public byte getDatasetType() { + return JRChartDataset.CATEGORY_DATASET; + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + + @Override + public Object clone() + { + JRDesignCategoryDataset clone = (JRDesignCategoryDataset)super.clone(); + clone.categorySeriesList = JRCloneUtils.cloneList(categorySeriesList); + return clone; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCategoryPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCategoryPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCategoryPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCategoryPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.util.JRAxisFormat; +import net.sf.jasperreports.engine.JRExpression; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRDesignCategoryPlot +{ + + public static final String PROPERTY_CATEGORY_AXIS_LABEL_EXPRESSION = "categoryAxisLabelExpression"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_EXPRESSION = "valueAxisLabelExpression"; + + public static final String PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION = "domainAxisMinValueExpression"; + + public static final String PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION = "domainAxisMaxValueExpression"; + + public static final String PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION = "rangeAxisMinValueExpression"; + + public static final String PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION = "rangeAxisMaxValueExpression"; + + + /** + * + */ + public void setCategoryAxisLabelExpression(JRExpression categoryAxisLabelExpression); + + /** + * + */ + public void setValueAxisLabelExpression(JRExpression valueAxisLabelExpression); + + /** + * + */ + public void setDomainAxisMinValueExpression(JRExpression domainAxisMinValueExpression); + + /** + * + */ + public void setDomainAxisMaxValueExpression(JRExpression domainAxisMaxValueExpression); + + /** + * + */ + public void setRangeAxisMinValueExpression(JRExpression rangeAxisMinValueExpression); + + /** + * + */ + public void setRangeAxisMaxValueExpression(JRExpression rangeAxisMaxValueExpression); + + /** + * + */ + public void setCategoryAxisFormat(JRAxisFormat axisFormat); + + /** + * + */ + public void setValueAxisFormat(JRAxisFormat axisFormat); +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCategorySeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCategorySeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCategorySeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignCategorySeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,138 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.base.JRBaseCategorySeries; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; + + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRDesignCategorySeries extends JRBaseCategorySeries implements JRChangeEventsSupport +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CATEGORY_EXPRESSION = "categoryExpression"; + + public static final String PROPERTY_ITEM_HYPERLINK = "itemHyperlink"; + + public static final String PROPERTY_LABEL_EXPRESSION = "labelExpression"; + + public static final String PROPERTY_SERIES_EXPRESSION = "seriesExpression"; + + public static final String PROPERTY_VALUE_EXPRESSION = "valueExpression"; + + + /** + * + */ + public void setSeriesExpression(JRExpression seriesExpression) + { + Object old = this.seriesExpression; + this.seriesExpression = seriesExpression; + getEventSupport().firePropertyChange(PROPERTY_SERIES_EXPRESSION, old, this.seriesExpression); + } + + /** + * + */ + public void setCategoryExpression(JRExpression categoryExpression) + { + Object old = this.categoryExpression; + this.categoryExpression = categoryExpression; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_EXPRESSION, old, this.categoryExpression); + } + + /** + * + */ + public void setValueExpression(JRExpression valueExpression) + { + Object old = this.valueExpression; + this.valueExpression = valueExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_EXPRESSION, old, this.valueExpression); + } + + /** + * + */ + public void setLabelExpression(JRExpression labelExpression) + { + Object old = this.labelExpression; + this.labelExpression = labelExpression; + getEventSupport().firePropertyChange(PROPERTY_LABEL_EXPRESSION, old, this.labelExpression); + } + + + /** + * Sets the hyperlink specification for chart items. + * + * @param itemHyperlink the hyperlink specification + * @see #getItemHyperlink() + */ + public void setItemHyperlink(JRHyperlink itemHyperlink) + { + Object old = this.itemHyperlink; + this.itemHyperlink = itemHyperlink; + getEventSupport().firePropertyChange(PROPERTY_ITEM_HYPERLINK, old, this.itemHyperlink); + } + + + @Override + public Object clone() + { + JRDesignCategorySeries clone = (JRDesignCategorySeries)super.clone(); + clone.eventSupport = null; + return clone; + } + + + private transient JRPropertyChangeSupport eventSupport; + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignChartAxis.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignChartAxis.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignChartAxis.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignChartAxis.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,153 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.JRChartAxis; +import net.sf.jasperreports.charts.base.JRBaseChartAxis; +import net.sf.jasperreports.charts.type.AxisPositionEnum; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRElement; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; + +/** + * {@link JRChartAxis JRChartAxis} implementation to be used for report design. + * + * @author Barry Klawans (barry@users.sourceforge.net) + */ +public class JRDesignChartAxis extends JRBaseChartAxis implements JRChangeEventsSupport +{ + + public static final String PROPERTY_CHART = "chart"; + + public static final String PROPERTY_POSITION = "position"; + + /** + * The multiple axis chart that this axis belongs to. + */ + protected JRDesignChart parentChart; + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + /** + * Construct a new axis that will be added to the specified chart. + * + * @param parentChart the chart that the axis will be added to + */ + public JRDesignChartAxis(JRDesignChart parentChart) + { + this.parentChart = parentChart; + } + + /** + * Sets the position of this axis' value line relative to the multiple + * axis chart. + * + * @param positionValue the position of this axis + */ + public void setPosition(AxisPositionEnum positionValue) + { + AxisPositionEnum old = this.positionValue; + this.positionValue = positionValue; + getEventSupport().firePropertyChange(PROPERTY_POSITION, old, this.positionValue); + } + + /** + * Set the chart that contains the dataset and plot to use for this + * axis. The plot is used to figure out how to render the dataset (ie + * as a line or bar chart) when adding it to the multiple axis chart. + * + * @param chart the chart that contains the dataset and plot for this axis + */ + public void setChart(JRDesignChart chart) + { + // Override the chart elements that we are going to ignore, as they + // are supposed to be controlled by the multi chart's settings. + chart.setBackcolor(parentChart.getBackcolor()); + chart.setShowLegend(parentChart.getShowLegend()); + chart.setTitleExpression(parentChart.getTitleExpression()); + chart.setTitleFont(parentChart.getTitleFont()); + chart.setTitlePosition(parentChart.getTitlePositionValue()); + chart.setTitleColor(parentChart.getTitleColor()); + chart.setSubtitleExpression(parentChart.getSubtitleExpression()); + chart.setSubtitleFont(parentChart.getSubtitleFont()); + chart.setSubtitleColor(parentChart.getSubtitleColor()); + chart.setLegendColor(parentChart.getLegendColor()); + chart.setLegendBackgroundColor(parentChart.getLegendBackgroundColor()); + chart.setLegendFont(parentChart.getLegendFont()); + chart.setLegendPosition(parentChart.getLegendPositionValue()); + chart.setRenderType(parentChart.getRenderType()); + chart.setTheme(parentChart.getTheme()); + + Object old = this.chart; + this.chart = chart; + getEventSupport().firePropertyChange(PROPERTY_CHART, old, this.chart); + } + + /** + * Sets the chart that contains the dataset and plot for this axis. + * Identical to {@link #setChart} but is called by the XML digester + * when parsing the report source. + * + * @param element + */ + public void addElement(JRElement element) + { + setChart((JRDesignChart)element); + } + + @Override + public Object clone() + { + JRDesignChartAxis clone = (JRDesignChartAxis)super.clone(); + clone.eventSupport = null; + return clone; + } + + @Override + public JRChartAxis clone(JRChart parentChart) + { + JRDesignChartAxis clone = (JRDesignChartAxis) super.clone(parentChart); + clone.parentChart = (JRDesignChart) parentChart; + return clone; + } + + private transient JRPropertyChangeSupport eventSupport; + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignDataRange.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignDataRange.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignDataRange.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignDataRange.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,110 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.JRDataRange; +import net.sf.jasperreports.charts.base.JRBaseDataRange; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; + +/** + * Contains a range of values. Used to specify the set of acceptable values + * for a meter or thermometer, and to divide those charts up into subsections. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRDesignDataRange extends JRBaseDataRange implements JRChangeEventsSupport +{ + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_HIGH_EXPRESSION = "highExpression"; + + public static final String PROPERTY_LOW_EXPRESSION = "lowExpression"; + + + /** + * Constructs a new data range that is a copy of an existing one. + * + * @param dataRange the range to copy + */ + public JRDesignDataRange(JRDataRange dataRange) + { + super(dataRange); + } + + /** + * Sets the low expression of the range. The low expression is + * evaluted to get the lower bound of the range. + * + * @param lowExpression used to get the lower bound of the range + */ + public void setLowExpression(JRExpression lowExpression) + { + Object old = this.lowExpression; + this.lowExpression = lowExpression; + getEventSupport().firePropertyChange(PROPERTY_LOW_EXPRESSION, old, this.lowExpression); + } + + /** + * Sets the high expression of the range. The high expression is + * used to get the upper bound of the range. + * + * @param highExpression used to get the upper bound of the range + */ + public void setHighExpression(JRExpression highExpression) + { + Object old = this.highExpression; + this.highExpression = highExpression; + getEventSupport().firePropertyChange(PROPERTY_HIGH_EXPRESSION, old, this.highExpression); + } + + @Override + public Object clone() + { + JRDesignDataRange clone = (JRDesignDataRange)super.clone(); + clone.eventSupport = null; + return clone; + } + + private transient JRPropertyChangeSupport eventSupport; + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignGanttDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignGanttDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignGanttDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignGanttDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,139 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.charts.JRGanttDataset; +import net.sf.jasperreports.charts.JRGanttSeries; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.design.JRDesignChartDataset; +import net.sf.jasperreports.engine.design.JRVerifier; + +/** + * @author Peter Risko (peter@risko.hu) + */ +public class JRDesignGanttDataset extends JRDesignChartDataset implements JRGanttDataset { + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_GANTT_SERIES = "ganttSeries"; + + private List ganttSeriesList = new ArrayList(); + + + /** + * + */ + public JRDesignGanttDataset(JRChartDataset dataset) + { + super(dataset); + } + + + @Override + public JRGanttSeries[] getSeries() + { + JRGanttSeries[] ganttSeriesArray = new JRGanttSeries[ganttSeriesList.size()]; + + ganttSeriesList.toArray(ganttSeriesArray); + + return ganttSeriesArray; + } + + + /** + * + */ + public List getSeriesList() + { + return ganttSeriesList; + } + + + /** + * + */ + public void addGanttSeries(JRGanttSeries ganttSeries) + { + ganttSeriesList.add(ganttSeries); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_GANTT_SERIES, ganttSeries, ganttSeriesList.size() - 1); + } + + + /** + * + */ + public void addGanttSeries(int index, JRGanttSeries ganttSeries) + { + ganttSeriesList.add(index, ganttSeries); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_GANTT_SERIES, ganttSeries, index); + } + + + /** + * + */ + public JRGanttSeries removeGanttSeries(JRGanttSeries ganttSeries) + { + if (ganttSeries != null) + { + int idx = ganttSeriesList.indexOf(ganttSeries); + if (idx >= 0) + { + ganttSeriesList.remove(ganttSeries); + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_GANTT_SERIES, ganttSeries, idx); + } + } + return ganttSeries; + } + + + @Override + public byte getDatasetType() { + return JRChartDataset.GANTT_DATASET; + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignGanttSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignGanttSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignGanttSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignGanttSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,168 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.base.JRBaseGanttSeries; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; + +/** + * @author Peter Risko (peter@risko.hu) + */ +public class JRDesignGanttSeries extends JRBaseGanttSeries implements JRChangeEventsSupport +{ + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_SERIES_EXPRESSION = "seriesExpression"; + + public static final String PROPERTY_TASK_EXPRESSION = "taskExpression"; + + public static final String PROPERTY_SUBTASK_EXPRESSION = "subtaskExpression"; + + public static final String PROPERTY_START_DATE_EXPRESSION = "startDateExpression"; + + public static final String PROPERTY_END_DATE_EXPRESSION = "endDateExpression"; + + public static final String PROPERTY_PERCENT_EXPRESSION = "percentExpression"; + + public static final String PROPERTY_LABEL_EXPRESSION = "labelExpression";//FIXMEGANTT check what label is used for + + public static final String PROPERTY_ITEM_HYPERLINK = "itemHyperlink"; + + + /** + * + */ + public void setSeriesExpression(JRExpression seriesExpression) + { + Object old = this.seriesExpression; + this.seriesExpression = seriesExpression; + getEventSupport().firePropertyChange(PROPERTY_SERIES_EXPRESSION, old, this.seriesExpression); + } + + /** + * + */ + public void setTaskExpression(JRExpression taskExpression) + { + Object old = this.taskExpression; + this.taskExpression = taskExpression; + getEventSupport().firePropertyChange(PROPERTY_TASK_EXPRESSION, old, this.taskExpression); + } + + /** + * + */ + public void setSubtaskExpression(JRExpression subtaskExpression) + { + Object old = this.subtaskExpression; + this.subtaskExpression = subtaskExpression; + getEventSupport().firePropertyChange(PROPERTY_SUBTASK_EXPRESSION, old, this.subtaskExpression); + } + + /** + * + */ + public void setStartDateExpression(JRExpression startDateExpression) + { + Object old = this.startDateExpression; + this.startDateExpression = startDateExpression; + getEventSupport().firePropertyChange(PROPERTY_START_DATE_EXPRESSION, old, this.startDateExpression); + } + + /** + * + */ + public void setEndDateExpression(JRExpression endDateExpression) + { + Object old = this.endDateExpression; + this.endDateExpression = endDateExpression; + getEventSupport().firePropertyChange(PROPERTY_END_DATE_EXPRESSION, old, this.endDateExpression); + } + + /** + * + */ + public void setPercentExpression(JRExpression percentExpression) + { + Object old = this.percentExpression; + this.percentExpression = percentExpression; + getEventSupport().firePropertyChange(PROPERTY_PERCENT_EXPRESSION, old, this.percentExpression); + } + + /** + * + */ + public void setLabelExpression(JRExpression labelExpression) + { + Object old = this.labelExpression; + this.labelExpression = labelExpression; + getEventSupport().firePropertyChange(PROPERTY_LABEL_EXPRESSION, old, this.labelExpression); + } + + + /** + * Sets the hyperlink specification for chart items. + * + * @param itemHyperlink the hyperlink specification + * @see #getItemHyperlink() + */ + public void setItemHyperlink(JRHyperlink itemHyperlink) + { + Object old = this.itemHyperlink; + this.itemHyperlink = itemHyperlink; + getEventSupport().firePropertyChange(PROPERTY_ITEM_HYPERLINK, old, this.itemHyperlink); + } + + @Override + public Object clone() + { + JRDesignGanttSeries clone = (JRDesignGanttSeries)super.clone(); + clone.eventSupport = null; + return clone; + } + + private transient JRPropertyChangeSupport eventSupport; + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignHighLowDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignHighLowDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignHighLowDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignHighLowDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,242 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.JRHighLowDataset; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.design.JRDesignChartDataset; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRDesignHighLowDataset extends JRDesignChartDataset implements JRHighLowDataset //FIXMECHART why is this different? +{ + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CLOSE_EXPRESSION = "closeExpression"; + + public static final String PROPERTY_DATE_EXPRESSION = "dateExpression"; + + public static final String PROPERTY_HIGH_EXPRESSION = "highExpression"; + + public static final String PROPERTY_ITEM_HYPERLINK = "itemHyperlink"; + + public static final String PROPERTY_LOW_EXPRESSION = "lowExpression"; + + public static final String PROPERTY_OPEN_EXPRESSION = "openExpression"; + + public static final String PROPERTY_SERIES_EXPRESSION = "seriesExpression"; + + public static final String PROPERTY_VOLUME_EXPRESSION = "volumeExpression"; + + protected JRExpression seriesExpression; + protected JRExpression dateExpression; + protected JRExpression highExpression; + protected JRExpression lowExpression; + protected JRExpression openExpression; + protected JRExpression closeExpression; + protected JRExpression volumeExpression; + private JRHyperlink itemHyperlink; + + + /** + * + */ + public JRDesignHighLowDataset(JRChartDataset dataset) + { + super(dataset); + } + + + @Override + public JRExpression getSeriesExpression() + { + return seriesExpression; + } + + + public void setSeriesExpression(JRExpression seriesExpression) + { + Object old = this.seriesExpression; + this.seriesExpression = seriesExpression; + getEventSupport().firePropertyChange(PROPERTY_SERIES_EXPRESSION, old, this.seriesExpression); + } + + @Override + public JRExpression getDateExpression() + { + return dateExpression; + } + + + public void setDateExpression(JRExpression dateExpression) + { + Object old = this.dateExpression; + this.dateExpression = dateExpression; + getEventSupport().firePropertyChange(PROPERTY_DATE_EXPRESSION, old, this.dateExpression); + } + + + @Override + public JRExpression getHighExpression() + { + return highExpression; + } + + + public void setHighExpression(JRExpression highExpression) + { + Object old = this.highExpression; + this.highExpression = highExpression; + getEventSupport().firePropertyChange(PROPERTY_HIGH_EXPRESSION, old, this.highExpression); + } + + + @Override + public JRExpression getLowExpression() + { + return lowExpression; + } + + + public void setLowExpression(JRExpression lowExpression) + { + Object old = this.lowExpression; + this.lowExpression = lowExpression; + getEventSupport().firePropertyChange(PROPERTY_LOW_EXPRESSION, old, this.lowExpression); + } + + + @Override + public JRExpression getOpenExpression() + { + return openExpression; + } + + + public void setOpenExpression(JRExpression openExpression) + { + Object old = this.openExpression; + this.openExpression = openExpression; + getEventSupport().firePropertyChange(PROPERTY_OPEN_EXPRESSION, old, this.openExpression); + } + + + @Override + public JRExpression getCloseExpression() + { + return closeExpression; + } + + + public void setCloseExpression(JRExpression closeExpression) + { + Object old = this.closeExpression; + this.closeExpression = closeExpression; + getEventSupport().firePropertyChange(PROPERTY_CLOSE_EXPRESSION, old, this.closeExpression); + } + + + @Override + public JRExpression getVolumeExpression() + { + return volumeExpression; + } + + + public void setVolumeExpression(JRExpression volumeExpression) + { + Object old = this.volumeExpression; + this.volumeExpression = volumeExpression; + getEventSupport().firePropertyChange(PROPERTY_VOLUME_EXPRESSION, old, this.volumeExpression); + } + + @Override + public byte getDatasetType() { + return JRChartDataset.HIGHLOW_DATASET; + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public JRHyperlink getItemHyperlink() + { + return itemHyperlink; + } + + + /** + * Sets the hyperlink specification for chart items. + * + * @param itemHyperlink the hyperlink specification + * @see #getItemHyperlink() + */ + public void setItemHyperlink(JRHyperlink itemHyperlink) + { + Object old = this.itemHyperlink; + this.itemHyperlink = itemHyperlink; + getEventSupport().firePropertyChange(PROPERTY_ITEM_HYPERLINK, old, this.itemHyperlink); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + + @Override + public Object clone() + { + JRDesignHighLowDataset clone = (JRDesignHighLowDataset)super.clone(); + clone.seriesExpression = JRCloneUtils.nullSafeClone(seriesExpression); + clone.dateExpression = JRCloneUtils.nullSafeClone(dateExpression); + clone.highExpression = JRCloneUtils.nullSafeClone(highExpression); + clone.lowExpression = JRCloneUtils.nullSafeClone(lowExpression); + clone.openExpression = JRCloneUtils.nullSafeClone(openExpression); + clone.closeExpression = JRCloneUtils.nullSafeClone(closeExpression); + clone.volumeExpression = JRCloneUtils.nullSafeClone(volumeExpression); + clone.itemHyperlink = JRCloneUtils.nullSafeClone(itemHyperlink); + return clone; + } +} + diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignHighLowPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignHighLowPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignHighLowPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignHighLowPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,325 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.awt.Color; + +import net.sf.jasperreports.charts.base.JRBaseHighLowPlot; +import net.sf.jasperreports.charts.util.JRAxisFormat; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRDesignHighLowPlot extends JRBaseHighLowPlot +{ + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_TIME_AXIS_LABEL_COLOR = "timeAxisLabelColor"; + + public static final String PROPERTY_TIME_AXIS_LABEL_EXPRESSION = "timeAxisLabelExpression"; + + public static final String PROPERTY_TIME_AXIS_LABEL_FONT = "timeAxisLabelFont"; + + public static final String PROPERTY_TIME_AXIS_LINE_COLOR = "timeAxisLineColor"; + + public static final String PROPERTY_TIME_AXIS_TICK_LABEL_COLOR = "timeAxisTickLabelColor"; + + public static final String PROPERTY_TIME_AXIS_TICK_LABEL_FONT = "timeAxisTickLabelFont"; + + public static final String PROPERTY_TIME_AXIS_TICK_LABEL_MASK = "timeAxisTickLabelMask"; + + public static final String PROPERTY_TIME_AXIS_VERTICAL_TICK_LABELS = "timeAxisVerticalTickLabels"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_COLOR = "valueAxisLabelColor"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_EXPRESSION = "valueAxisLabelExpression"; + + public static final String PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION = "domainAxisMinValueExpression"; + + public static final String PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION = "domainAxisMaxValueExpression"; + + public static final String PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION = "rangeAxisMinValueExpression"; + + public static final String PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION = "rangeAxisMaxValueExpression"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_FONT = "valueAxisLabelFont"; + + public static final String PROPERTY_VALUE_AXIS_LINE_COLOR = "valueAxisLineColor"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_COLOR = "valueAxisTickLabelColor"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_FONT = "valueAxisTickLabelFont"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_MASK = "valueAxisTickLabelMask"; + + public static final String PROPERTY_VALUE_AXIS_VERTICAL_TICK_LABELS = "valueAxisVerticalTickLabels"; + + + /** + * + */ + public JRDesignHighLowPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + } + + + /** + * + */ + public void setTimeAxisLabelExpression( JRExpression timeAxisLabelExpression ){ + Object old = this.timeAxisLabelExpression; + this.timeAxisLabelExpression = timeAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_LABEL_EXPRESSION, old, this.timeAxisLabelExpression); + + } + + /** + * + */ + public void setTimeAxisLabelFont(JRFont timeAxisLabelFont) + { + Object old = this.timeAxisLabelFont; + this.timeAxisLabelFont = timeAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_LABEL_FONT, old, this.timeAxisLabelFont); + } + + /** + * + */ + public void setTimeAxisLabelColor(Color timeAxisLabelColor) + { + Object old = this.timeAxisLabelColor; + this.timeAxisLabelColor = timeAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_LABEL_COLOR, old, this.timeAxisLabelColor); + } + + /** + * + */ + public void setTimeAxisTickLabelFont(JRFont timeAxisTickLabelFont) + { + Object old = this.timeAxisTickLabelFont; + this.timeAxisTickLabelFont = timeAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_TICK_LABEL_FONT, old, this.timeAxisTickLabelFont); + } + + /** + * + */ + public void setTimeAxisTickLabelColor(Color timeAxisTickLabelColor) + { + Object old = this.timeAxisTickLabelColor; + this.timeAxisTickLabelColor = timeAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_TICK_LABEL_COLOR, old, this.timeAxisTickLabelColor); + } + + /** + * + */ + public void setTimeAxisTickLabelMask(String timeAxisTickLabelMask) + { + Object old = this.timeAxisTickLabelMask; + this.timeAxisTickLabelMask = timeAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_TICK_LABEL_MASK, old, this.timeAxisTickLabelMask); + } + + /** + * + */ + public void setTimeAxisVerticalTickLabels(Boolean timeAxisVerticalTickLabels) + { + Object old = this.timeAxisVerticalTickLabels; + this.timeAxisVerticalTickLabels = timeAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_VERTICAL_TICK_LABELS, old, this.timeAxisVerticalTickLabels); + } + + /** + * + */ + public void setTimeAxisLineColor(Color timeAxisLineColor) + { + Object old = this.timeAxisLineColor; + this.timeAxisLineColor = timeAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_LINE_COLOR, old, this.timeAxisLineColor); + } + + /** + * + */ + public void setValueAxisLabelExpression(JRExpression valueAxisLabelExpression) + { + Object old = this.valueAxisLabelExpression; + this.valueAxisLabelExpression = valueAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_EXPRESSION, old, this.valueAxisLabelExpression); + } + + /** + * + */ + public void setDomainAxisMinValueExpression(JRExpression domainAxisMinValueExpression) + { + Object old = this.domainAxisMinValueExpression; + this.domainAxisMinValueExpression = domainAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION, old, this.domainAxisMinValueExpression); + } + + /** + * + */ + public void setDomainAxisMaxValueExpression(JRExpression domainAxisMaxValueExpression) + { + Object old = this.domainAxisMaxValueExpression; + this.domainAxisMaxValueExpression = domainAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION, old, this.domainAxisMaxValueExpression); + } + + /** + * + */ + public void setRangeAxisMinValueExpression(JRExpression rangeAxisMinValueExpression) + { + Object old = this.rangeAxisMinValueExpression; + this.rangeAxisMinValueExpression = rangeAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION, old, this.rangeAxisMinValueExpression); + } + + /** + * + */ + public void setRangeAxisMaxValueExpression(JRExpression rangeAxisMaxValueExpression) + { + Object old = this.rangeAxisMaxValueExpression; + this.rangeAxisMaxValueExpression = rangeAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION, old, this.rangeAxisMaxValueExpression); + } + + /** + * + */ + public void setValueAxisLabelFont(JRFont valueAxisLabelFont) + { + Object old = this.valueAxisLabelFont; + this.valueAxisLabelFont = valueAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_FONT, old, this.valueAxisLabelFont); + } + + /** + * + */ + public void setValueAxisLabelColor(Color valueAxisLabelColor) + { + Object old = this.valueAxisLabelColor; + this.valueAxisLabelColor = valueAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_COLOR, old, this.valueAxisLabelColor); + } + + /** + * + */ + public void setValueAxisTickLabelFont(JRFont valueAxisTickLabelFont) + { + Object old = this.valueAxisTickLabelFont; + this.valueAxisTickLabelFont = valueAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_FONT, old, this.valueAxisTickLabelFont); + } + + /** + * + */ + public void setValueAxisTickLabelColor(Color valueAxisTickLabelColor) + { + Object old = this.valueAxisTickLabelColor; + this.valueAxisTickLabelColor = valueAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_COLOR, old, this.valueAxisTickLabelColor); + } + + /** + * + */ + public void setValueAxisTickLabelMask(String valueAxisTickLabelMask) + { + Object old = this.valueAxisTickLabelMask; + this.valueAxisTickLabelMask = valueAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_MASK, old, this.valueAxisTickLabelMask); + } + + /** + * + */ + public void setValueAxisVerticalTickLabels(Boolean valueAxisVerticalTickLabels) + { + Object old = this.valueAxisVerticalTickLabels; + this.valueAxisVerticalTickLabels = valueAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_VERTICAL_TICK_LABELS, old, this.valueAxisVerticalTickLabels); + } + + /** + * + */ + public void setValueAxisLineColor(Color valueAxisLineColor) + { + Object old = this.valueAxisLineColor; + this.valueAxisLineColor = valueAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LINE_COLOR, old, this.valueAxisLineColor); + } + + /** + * + */ + public void setTimeAxisFormat(JRAxisFormat axisFormat) + { + setTimeAxisLabelFont(axisFormat.getLabelFont()); + setTimeAxisLabelColor(axisFormat.getLabelColor()); + setTimeAxisTickLabelFont(axisFormat.getTickLabelFont()); + setTimeAxisTickLabelColor(axisFormat.getTickLabelColor()); + setTimeAxisTickLabelMask(axisFormat.getTickLabelMask()); + setTimeAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setTimeAxisLineColor(axisFormat.getLineColor()); + } + + /** + * + */ + public void setValueAxisFormat(JRAxisFormat axisFormat) + { + setValueAxisLabelFont(axisFormat.getLabelFont()); + setValueAxisLabelColor(axisFormat.getLabelColor()); + setValueAxisTickLabelFont(axisFormat.getTickLabelFont()); + setValueAxisTickLabelColor(axisFormat.getTickLabelColor()); + setValueAxisTickLabelMask(axisFormat.getTickLabelMask()); + setValueAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setValueAxisLineColor(axisFormat.getLineColor()); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignItemLabel.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignItemLabel.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignItemLabel.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignItemLabel.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,140 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.charts.base.JRBaseItemLabel; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; + +/** + * An object that specifies how an item label should be displayed. Used with + * category plots such as a bar or pie plot. + * + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class JRDesignItemLabel extends JRBaseItemLabel implements JRChangeEventsSupport +{ + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_COLOR = "color"; + + public static final String PROPERTY_BACKGROUND_COLOR = "backgroundColor"; + + public static final String PROPERTY_FONT = "font"; + +// public static final String PROPERTY_MASK = "mask"; + + + /** + * Constructs a new item label that is a copy of an existing one. + * + * @param itemLabel the item label to copy + */ + public JRDesignItemLabel(JRItemLabel itemLabel, JRChart chart)//FIXMECHART this should be very similar to font; just a container, with unimportant design object + { + super(itemLabel, chart); + } + + /** + * Sets the color to use when displaying the value. + * + * @param color the color to use when displaying the value + */ + public void setColor(Color color) + { + Object old = this.color; + this.color = color; + getEventSupport().firePropertyChange(PROPERTY_COLOR, old, this.color); + } + + /** + * Sets the background color to use when displaying the value. + * + * @param backgroundColor the background color to use when displaying the value + */ + public void setBackgroundColor(Color backgroundColor) + { + Object old = this.backgroundColor; + this.backgroundColor = backgroundColor; + getEventSupport().firePropertyChange(PROPERTY_BACKGROUND_COLOR, old, this.backgroundColor); + } + + /** + * Sets the formatting mask to use when displaying the value. This mask will + * be used to create a java.text.DecimalFormat object. + * + * @param mask the formatting mask to use when displaying the value + */ +// public void setMask(String mask) +// { +// Object old = this.mask; +// this.mask = mask; +// getEventSupport().firePropertyChange(PROPERTY_MASK, old, this.mask); +// } + + /** + * Sets the font to use when displaying the value. + * + * @param font the font to use when displaying the value + */ + public void setFont(JRFont font) + { + Object old = this.font; + this.font = font; + getEventSupport().firePropertyChange(PROPERTY_FONT, old, this.font); + } + + @Override + public Object clone() + { + JRDesignItemLabel clone = (JRDesignItemLabel)super.clone(); + clone.eventSupport = null; + return clone; + } + + private transient JRPropertyChangeSupport eventSupport; + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignLinePlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignLinePlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignLinePlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignLinePlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,293 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.awt.Color; + +import net.sf.jasperreports.charts.base.JRBaseLinePlot; +import net.sf.jasperreports.charts.util.JRAxisFormat; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRDesignLinePlot extends JRBaseLinePlot implements JRDesignCategoryPlot +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CATEGORY_AXIS_LABEL_COLOR = "categoryAxisLabelColor"; + + public static final String PROPERTY_CATEGORY_AXIS_LABEL_FONT = "categoryAxisLabelFont"; + + public static final String PROPERTY_CATEGORY_AXIS_LINE_COLOR = "categoryAxisLineColor"; + + public static final String PROPERTY_CATEGORY_AXIS_TICK_LABEL_COLOR = "categoryAxisTickLabelColor"; + + public static final String PROPERTY_CATEGORY_AXIS_TICK_LABEL_FONT = "categoryAxisTickLabelFont"; + + public static final String PROPERTY_CATEGORY_AXIS_TICK_LABEL_MASK = "categoryAxisTickLabelMask"; + + public static final String PROPERTY_CATEGORY_AXIS_VERTICAL_TICK_LABELS = "categoryAxisVerticalTickLabels"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_COLOR = "valueAxisLabelColor"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_FONT = "valueAxisLabelFont"; + + public static final String PROPERTY_VALUE_AXIS_LINE_COLOR = "valueAxisLineColor"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_COLOR = "valueAxisTickLabelColor"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_FONT = "valueAxisTickLabelFont"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_MASK = "valueAxisTickLabelMask"; + + public static final String PROPERTY_VALUE_AXIS_VERTICAL_TICK_LABELS = "valueAxisVerticalTickLabels"; + + + /** + * + */ + public JRDesignLinePlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + } + + + @Override + public void setCategoryAxisLabelExpression(JRExpression categoryAxisLabelExpression) + { + Object old = this.categoryAxisLabelExpression; + this.categoryAxisLabelExpression = categoryAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LABEL_EXPRESSION, old, this.categoryAxisLabelExpression); + } + + /** + * + */ + public void setCategoryAxisLabelFont(JRFont categoryAxisLabelFont) + { + Object old = this.categoryAxisLabelFont; + this.categoryAxisLabelFont = categoryAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LABEL_FONT, old, this.categoryAxisLabelFont); + } + + /** + * + */ + public void setCategoryAxisLabelColor(Color categoryAxisLabelColor) + { + Object old = this.categoryAxisLabelColor; + this.categoryAxisLabelColor = categoryAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LABEL_COLOR, old, this.categoryAxisLabelColor); + } + + /** + * + */ + public void setCategoryAxisTickLabelFont(JRFont categoryAxisTickLabelFont) + { + Object old = this.categoryAxisTickLabelFont; + this.categoryAxisTickLabelFont = categoryAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_FONT, old, this.categoryAxisTickLabelFont); + } + + /** + * + */ + public void setCategoryAxisTickLabelColor(Color categoryAxisTickLabelColor) + { + Object old = this.categoryAxisTickLabelColor; + this.categoryAxisTickLabelColor = categoryAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_COLOR, old, this.categoryAxisTickLabelColor); + } + + /** + * + */ + public void setCategoryAxisTickLabelMask(String categoryAxisTickLabelMask) + { + Object old = this.categoryAxisTickLabelMask; + this.categoryAxisTickLabelMask = categoryAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_MASK, old, this.categoryAxisTickLabelMask); + } + + /** + * + */ + public void setCategoryAxisVerticalTickLabels(Boolean categoryAxisVerticalTickLabels) + { + Object old = this.categoryAxisVerticalTickLabels; + this.categoryAxisVerticalTickLabels = categoryAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_VERTICAL_TICK_LABELS, old, this.categoryAxisVerticalTickLabels); + } + + /** + * + */ + public void setCategoryAxisLineColor(Color categoryAxisLineColor) + { + Object old = this.categoryAxisLineColor; + this.categoryAxisLineColor = categoryAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_LINE_COLOR, old, this.categoryAxisLineColor); + } + + @Override + public void setValueAxisLabelExpression(JRExpression valueAxisLabelExpression) + { + Object old = this.valueAxisLabelExpression; + this.valueAxisLabelExpression = valueAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_EXPRESSION, old, this.valueAxisLabelExpression); + } + + @Override + public void setDomainAxisMinValueExpression(JRExpression domainAxisMinValueExpression) + { + Object old = this.domainAxisMinValueExpression; + this.domainAxisMinValueExpression = domainAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION, old, this.domainAxisMinValueExpression); + } + + @Override + public void setDomainAxisMaxValueExpression(JRExpression domainAxisMaxValueExpression) + { + Object old = this.domainAxisMaxValueExpression; + this.domainAxisMaxValueExpression = domainAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION, old, this.domainAxisMaxValueExpression); + } + + @Override + public void setRangeAxisMinValueExpression(JRExpression rangeAxisMinValueExpression) + { + Object old = this.rangeAxisMinValueExpression; + this.rangeAxisMinValueExpression = rangeAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION, old, this.rangeAxisMinValueExpression); + } + + @Override + public void setRangeAxisMaxValueExpression(JRExpression rangeAxisMaxValueExpression) + { + Object old = this.rangeAxisMaxValueExpression; + this.rangeAxisMaxValueExpression = rangeAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION, old, this.rangeAxisMaxValueExpression); + } + + /** + * + */ + public void setValueAxisLabelFont(JRFont valueAxisLabelFont) + { + Object old = this.valueAxisLabelFont; + this.valueAxisLabelFont = valueAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_FONT, old, this.valueAxisLabelFont); + } + + /** + * + */ + public void setValueAxisLabelColor(Color valueAxisLabelColor) + { + Object old = this.valueAxisLabelColor; + this.valueAxisLabelColor = valueAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_COLOR, old, this.valueAxisLabelColor); + } + + /** + * + */ + public void setValueAxisTickLabelFont(JRFont valueAxisTickLabelFont) + { + Object old = this.valueAxisTickLabelFont; + this.valueAxisTickLabelFont = valueAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_FONT, old, this.valueAxisTickLabelFont); + } + + /** + * + */ + public void setValueAxisTickLabelColor(Color valueAxisTickLabelColor) + { + Object old = this.valueAxisTickLabelColor; + this.valueAxisTickLabelColor = valueAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_COLOR, old, this.valueAxisTickLabelColor); + } + + /** + * + */ + public void setValueAxisTickLabelMask(String valueAxisTickLabelMask) + { + Object old = this.valueAxisTickLabelMask; + this.valueAxisTickLabelMask = valueAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_MASK, old, this.valueAxisTickLabelMask); + } + + /** + * + */ + public void setValueAxisVerticalTickLabels(Boolean valueAxisVerticalTickLabels) + { + Object old = this.valueAxisVerticalTickLabels; + this.valueAxisVerticalTickLabels = valueAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_VERTICAL_TICK_LABELS, old, this.valueAxisVerticalTickLabels); + } + + /** + * + */ + public void setValueAxisLineColor(Color valueAxisLineColor) + { + Object old = this.valueAxisLineColor; + this.valueAxisLineColor = valueAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LINE_COLOR, old, this.valueAxisLineColor); + } + + @Override + public void setCategoryAxisFormat(JRAxisFormat axisFormat) + { + setCategoryAxisLabelFont(axisFormat.getLabelFont()); + setCategoryAxisLabelColor(axisFormat.getLabelColor()); + setCategoryAxisTickLabelFont(axisFormat.getTickLabelFont()); + setCategoryAxisTickLabelColor(axisFormat.getTickLabelColor()); + setCategoryAxisTickLabelMask(axisFormat.getTickLabelMask()); + setCategoryAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setCategoryAxisLineColor(axisFormat.getLineColor()); + } + + @Override + public void setValueAxisFormat(JRAxisFormat axisFormat) + { + setValueAxisLabelFont(axisFormat.getLabelFont()); + setValueAxisLabelColor(axisFormat.getLabelColor()); + setValueAxisTickLabelFont(axisFormat.getTickLabelFont()); + setValueAxisTickLabelColor(axisFormat.getTickLabelColor()); + setValueAxisTickLabelMask(axisFormat.getTickLabelMask()); + setValueAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setValueAxisLineColor(axisFormat.getLineColor()); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignMeterPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignMeterPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignMeterPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignMeterPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,269 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.awt.Color; +import java.util.ArrayList; +import java.util.Collection; + +import net.sf.jasperreports.charts.JRDataRange; +import net.sf.jasperreports.charts.JRValueDisplay; +import net.sf.jasperreports.charts.base.JRBaseMeterPlot; +import net.sf.jasperreports.charts.base.JRBaseValueDisplay; +import net.sf.jasperreports.charts.type.MeterShapeEnum; +import net.sf.jasperreports.charts.util.JRMeterInterval; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRFont; + +/** + * A meter plot that displays a single value against a range of values. The + * range can be further subdivided into multiple color coded regions. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRDesignMeterPlot extends JRBaseMeterPlot +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_DATA_RANGE = "dataRange"; + + public static final String PROPERTY_METER_ANGLE = "meterAngle"; + + public static final String PROPERTY_METER_BACKGROUND_COLOR = "meterBackgroundColor"; + + public static final String PROPERTY_NEEDLE_COLOR = "needleColor"; + + public static final String PROPERTY_SHAPE = "shape"; + + public static final String PROPERTY_TICK_COLOR = "tickColor"; + + public static final String PROPERTY_TICK_COUNT = "tickCount"; + + public static final String PROPERTY_TICK_INTERVAL = "tickInterval"; + + public static final String PROPERTY_UNITS = "units"; + + public static final String PROPERTY_VALUE_DISPLAY = "valueDisplay"; + + public static final String PROPERTY_INTERVALS = "intervals"; + + public static final String PROPERTY_TICK_LABEL_FONT = "tickLabelFont"; + + + /** + * Construct a new meter plot by copying an existing one. + * + * @param plot the plot to copy + */ + public JRDesignMeterPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + } + + /** + * Sets the range of values that the meter can display. Before changing + * this for an existing meter you should clear any existing intervals to + * ensure that you don't end up with intervals that are outside of the new + * range. + * + * @param dataRange the range of values that the meter can display + */ + public void setDataRange(JRDataRange dataRange) throws JRException + { + Object old = this.dataRange; + this.dataRange = dataRange; + getEventSupport().firePropertyChange(PROPERTY_DATA_RANGE, old, this.dataRange); + } + + /** + * Sets the value display formatting options. + * + * @param valueDisplay how to show the textual representation of the value + */ + public void setValueDisplay(JRValueDisplay valueDisplay) + { + Object old = this.valueDisplay; + this.valueDisplay = new JRBaseValueDisplay(valueDisplay, getChart()); + getEventSupport().firePropertyChange(PROPERTY_VALUE_DISPLAY, old, this.valueDisplay); + } + + /** + * Sets the shape of the meter. + * + * @param shape the shape of the meter + * @throws JRException invalid shape was specified + */ + public void setShape(MeterShapeEnum shape) throws JRException + { + MeterShapeEnum old = this.shapeValue; + this.shapeValue = shape; + getEventSupport().firePropertyChange(PROPERTY_SHAPE, old, this.shapeValue); + } + + /** + * Adds an interval to the meter. An interval is used to indicate a + * section of the meter. + * + * @param interval the interval to add to the meter + */ + public void addInterval(JRMeterInterval interval) + { + intervals.add(interval); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_INTERVALS, interval, intervals.size() - 1); + } + + /** + * Removes all the intervals for the meter. + */ + public void clearIntervals() + { + setIntervals(null); + } + + /** + * Sets the meter intervals. + * + * @param intervals the list of meter intervals ({@link JRMeterInterval} instances) + * @see #addInterval(JRMeterInterval) + */ + public void setIntervals(Collection intervals) + { + Object old = new ArrayList(this.intervals); + this.intervals.clear(); + if (intervals != null) + { + this.intervals.addAll(intervals); + } + getEventSupport().firePropertyChange(PROPERTY_INTERVALS, old, this.intervals); + } + + /** + * Sets the size of the meter face in degrees. + * + * @param meterAngle the size of the meter in degrees + */ + public void setMeterAngle(Integer meterAngle) + { + Integer old = this.meterAngleInteger; + this.meterAngleInteger = meterAngle; + getEventSupport().firePropertyChange(PROPERTY_METER_ANGLE, old, this.meterAngleInteger); + } + + /** + * Sets the units string to use. This string is appended to the value + * when it is displayed. + * + * @param units the units string to use + */ + public void setUnits(String units) + { + Object old = this.units; + this.units = units; + getEventSupport().firePropertyChange(PROPERTY_UNITS, old, this.units); + } + + /** + * Sets the space between tick marks on the face of the meter. The + * spacing is relative to the range of the meter. If the meter is + * displaying the range 100 to 200 and the tick interval is 20, four + * tick marks will be shown, one each at 120, 140, 160 and 180. + * + * @param tickInterval the space between tick marks on the meter + */ + public void setTickInterval(Double tickInterval) + { + Double old = this.tickIntervalDouble; + this.tickIntervalDouble = tickInterval; + getEventSupport().firePropertyChange(PROPERTY_TICK_INTERVAL, old, this.tickIntervalDouble); + } + + /** + * Sets the color to use for the meter face. + * + * @param meterBackgroundColor the color to use for the meter face + */ + public void setMeterBackgroundColor(Color meterBackgroundColor) + { + Object old = this.meterBackgroundColor; + this.meterBackgroundColor = meterBackgroundColor; + getEventSupport().firePropertyChange(PROPERTY_METER_BACKGROUND_COLOR, old, this.meterBackgroundColor); + } + + /** + * Sets the color to use for the meter pointer. + * + * @param needleColor the color to use for the meter pointer + */ + public void setNeedleColor(Color needleColor) + { + Object old = this.needleColor; + this.needleColor = needleColor; + getEventSupport().firePropertyChange(PROPERTY_NEEDLE_COLOR, old, this.needleColor); + } + + /** + * Sets the color to use when drawing tick marks on the meter. + * + * @param tickColor the color to use when drawing tick marks + */ + public void setTickColor(Color tickColor) + { + Object old = this.tickColor; + this.tickColor = tickColor; + getEventSupport().firePropertyChange(PROPERTY_TICK_COLOR, old, this.tickColor); + } + + /** + * Sets the number of major tick marks on the meter scale. + * + * @param tickCount the number of major tick marks + */ + public void setTickCount(Integer tickCount) + { + Object old = this.tickCount; + this.tickCount = tickCount; + getEventSupport().firePropertyChange(PROPERTY_TICK_COUNT, old, this.tickCount); + } + + /** + * Sets the font to use when displaying the tick label. + * + * @param tickLabelFont the font to use when displaying the tick label + */ + public void setTickLabelFont(JRFont tickLabelFont) + { + Object old = this.tickLabelFont; + this.tickLabelFont = tickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_TICK_LABEL_FONT, old, this.tickLabelFont); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignMultiAxisPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignMultiAxisPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignMultiAxisPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignMultiAxisPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,153 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.sf.jasperreports.charts.JRChartAxis; +import net.sf.jasperreports.charts.base.JRBaseMultiAxisPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.design.JRDesignChart; + +/** + * Contains information on how a multiple axis chart should be + * displayed. This information overrides the display information + * for all the charts sharing the single domain axis in the multiple + * axis chart. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRDesignMultiAxisPlot extends JRBaseMultiAxisPlot +{ + + public static final String PROPERTY_CHART = "chart"; + + public static final String PROPERTY_AXES = "axes"; + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + + /** + * Constructs a new plot by copying an existing one. + * + * @param multiAxisPlot the plot to copy + */ + public JRDesignMultiAxisPlot(JRChartPlot multiAxisPlot, JRChart chart) + { + super(multiAxisPlot, chart); + } + + /** + * Adds an axis to the plot. The axis contains the complete information on + * the data and rendering to use as well as where to draw the axis. + * + * @param axis the axis to add to the plot + */ + public void addAxis(JRChartAxis axis) + { + axes.add(axis); + if (axes.size() == 1) + { + ((JRDesignChart) getChart()).setDataset(axis.getChart().getDataset()); + } + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_AXES, axis, axes.size() - 1); + } + + /** + * Adds an axis to the plot. The axis contains the complete information on + * the data and rendering to use as well as where to draw the axis. + * + * @param axis the axis to add to the plot + */ + public void addAxis(int index, JRChartAxis axis) + { + axes.add(index, axis); + if (axes.size() == 1) + { + ((JRDesignChart) getChart()).setDataset(axis.getChart().getDataset()); + } + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_AXES, axis, index); + } + + /** + * + */ + public JRChartAxis removeAxis(JRChartAxis axis) + { + if (axis != null) + { + int idx = axes.indexOf(axis); + if (idx >= 0) + { + axes.remove(idx); + ((JRDesignChart) getChart()).setDataset(axis.getChart().getDataset()); + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_AXES, axis, idx); + } + } + + return axis; + } + /** + * Removes all the axes from the plot. + */ + public void clearAxes() + { + List tmpList = new ArrayList(axes); + for(Iterator it = tmpList.iterator(); it.hasNext();){ + removeAxis(it.next()); + } + ((JRDesignChart) getChart()).setDataset(null); + } +// +// /** +// * Returns the definition of the multiple axis chart. This is separate +// * from and distinct that the definition of the nested charts. +// * +// * @return the chart object for this plot +// */ +// public JRChart getChart() +// { +// return chart; +// } + + /** + * Sets the chart object that this plot belongs to. The chart object defines + * all the information about the multiple axis chart. + * + * @param chart the chart that this plot belongs to + */ + public void setChart(JRDesignChart chart) + { + Object old = this.chart; + this.chart = chart; + getEventSupport().firePropertyChange(PROPERTY_CHART, old, this.chart); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPie3DPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPie3DPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPie3DPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPie3DPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,53 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.base.JRBasePie3DPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; + + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRDesignPie3DPlot extends JRBasePie3DPlot +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + + /** + * + */ + public JRDesignPie3DPlot(JRChartPlot pie3DPlot, JRChart chart) + { + super(pie3DPlot, chart, ChartCopyDesignObjectFactory.instance()); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPieDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPieDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPieDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPieDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,378 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.charts.JRPieDataset; +import net.sf.jasperreports.charts.JRPieSeries; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.design.JRDesignChartDataset; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRDesignPieDataset extends JRDesignChartDataset implements JRPieDataset +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_MIN_PERCENTAGE = "minPercentage"; + public static final String PROPERTY_MAX_COUNT = "maxCount"; + public static final String PROPERTY_PIE_SERIES = "pieSeries"; + public static final String PROPERTY_KEY_EXPRESSION = "keyExpression"; + public static final String PROPERTY_VALUE_EXPRESSION = "valueExpression"; + public static final String PROPERTY_LABEL_EXPRESSION = "labelExpression"; + public static final String PROPERTY_SECTION_HYPERLINK = "sectionHyperlink"; + public static final String PROPERTY_OTHER_KEY_EXPRESSION = "otherKeyExpression"; + public static final String PROPERTY_OTHER_LABEL_EXPRESSION = "otherLabelExpression"; + public static final String PROPERTY_OTHER_SECTION_HYPERLINK = "otherSectionHyperlink"; + + private Float minPercentage; + private Integer maxCount; + + private List pieSeriesList = new ArrayList(); + + protected JRExpression otherKeyExpression; + protected JRExpression otherLabelExpression; + private JRHyperlink otherSectionHyperlink; + + + /** + * + */ + public JRDesignPieDataset(JRChartDataset dataset) + { + super(dataset); + } + + + @Override + public Float getMinPercentage() + { + return minPercentage; + } + + @Override + public void setMinPercentage(Float minPercentage) + { + Object old = this.minPercentage; + this.minPercentage = minPercentage; + getEventSupport().firePropertyChange(PROPERTY_MIN_PERCENTAGE, old, this.minPercentage); + } + + @Override + public Integer getMaxCount() + { + return maxCount; + } + + @Override + public void setMaxCount(Integer maxCount) + { + Object old = this.maxCount; + this.maxCount = maxCount; + getEventSupport().firePropertyChange(PROPERTY_MAX_COUNT, old, this.maxCount); + } + + @Override + public JRPieSeries[] getSeries() + { + JRPieSeries[] pieSeriesArray = new JRPieSeries[pieSeriesList.size()]; + + pieSeriesList.toArray(pieSeriesArray); + + return pieSeriesArray; + } + + + /** + * + */ + public List getSeriesList() + { + return pieSeriesList; + } + + + /** + * + */ + public void addPieSeries(JRPieSeries pieSeries) + { + pieSeriesList.add(pieSeries); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_PIE_SERIES, + pieSeries, pieSeriesList.size() - 1); + } + + /** + * + */ + public void addPieSeries(int index, JRPieSeries pieSeries) + { + pieSeriesList.add(index, pieSeries); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_PIE_SERIES, + pieSeries, index); + } + + /** + * + */ + public JRPieSeries removePieSeries(JRPieSeries pieSeries) + { + if (pieSeries != null) + { + int idx = pieSeriesList.indexOf(pieSeries); + if (idx >= 0) + { + pieSeriesList.remove(idx); + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_PIE_SERIES, + pieSeries, idx); + } + } + + return pieSeries; + } + + + /** + * @deprecated Replaced by {@link #getSeries()}. + */ + public JRExpression getKeyExpression() + { + return pieSeriesList.size() > 0 ? (pieSeriesList.get(0)).getKeyExpression() : null; + } + + /** + * @deprecated Replaced by {@link #getSeries()}. + */ + public void setKeyExpression(JRExpression keyExpression) + { + if (pieSeriesList.size() == 0) + { + addPieSeries(new JRDesignPieSeries()); + } + ((JRDesignPieSeries)pieSeriesList.get(0)).setKeyExpression(keyExpression); + } + + /** + * @deprecated Replaced by {@link #getSeries()}. + */ + public JRExpression getValueExpression() + { + return pieSeriesList.size() > 0 ? (pieSeriesList.get(0)).getValueExpression() : null; + } + + /** + * @deprecated Replaced by {@link #getSeries()}. + */ + public void setValueExpression(JRExpression valueExpression) + { + if (pieSeriesList.size() == 0) + { + addPieSeries(new JRDesignPieSeries()); + } + ((JRDesignPieSeries)pieSeriesList.get(0)).setValueExpression(valueExpression); + } + + /** + * @deprecated Replaced by {@link #getSeries()}. + */ + public JRExpression getLabelExpression() + { + return pieSeriesList.size() > 0 ? (pieSeriesList.get(0)).getLabelExpression() : null; + } + + /** + * @deprecated Replaced by {@link #getSeries()}. + */ + public void setLabelExpression(JRExpression labelExpression) + { + if (pieSeriesList.size() == 0) + { + addPieSeries(new JRDesignPieSeries()); + } + ((JRDesignPieSeries)pieSeriesList.get(0)).setLabelExpression(labelExpression); + } + + /** + * @deprecated Replaced by {@link #getSeries()}. + */ + public JRHyperlink getSectionHyperlink() + { + return pieSeriesList.size() > 0 ? (pieSeriesList.get(0)).getSectionHyperlink() : null; + } + + + /** + * @deprecated Replaced by {@link #getSeries()}. + */ + public void setSectionHyperlink(JRHyperlink sectionHyperlink) + { + if (pieSeriesList.size() == 0) + { + addPieSeries(new JRDesignPieSeries()); + } + ((JRDesignPieSeries)pieSeriesList.get(0)).setSectionHyperlink(sectionHyperlink); + } + + + @Override + public JRExpression getOtherKeyExpression() + { + return otherKeyExpression; + } + + /** + * + */ + public void setOtherKeyExpression(JRExpression otherKeyExpression) + { + Object old = this.otherKeyExpression; + this.otherKeyExpression = otherKeyExpression; + getEventSupport().firePropertyChange(PROPERTY_OTHER_KEY_EXPRESSION, old, this.otherKeyExpression); + } + + @Override + public JRExpression getOtherLabelExpression() + { + return otherLabelExpression; + } + + /** + * + */ + public void setOtherLabelExpression(JRExpression otherLabelExpression) + { + Object old = this.otherLabelExpression; + this.otherLabelExpression = otherLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_OTHER_LABEL_EXPRESSION, old, this.otherLabelExpression); + } + + @Override + public JRHyperlink getOtherSectionHyperlink() + { + return otherSectionHyperlink; + } + + /** + * + */ + public void setOtherSectionHyperlink(JRHyperlink otherSectionHyperlink) + { + Object old = this.otherSectionHyperlink; + this.otherSectionHyperlink = otherSectionHyperlink; + getEventSupport().firePropertyChange(PROPERTY_OTHER_SECTION_HYPERLINK, old, this.otherSectionHyperlink); + } + + + @Override + public byte getDatasetType() { + return JRChartDataset.PIE_DATASET; + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + + @Override + public Object clone() + { + JRDesignPieDataset clone = (JRDesignPieDataset)super.clone(); + clone.pieSeriesList = JRCloneUtils.cloneList(pieSeriesList); + clone.otherKeyExpression = JRCloneUtils.nullSafeClone(otherKeyExpression); + clone.otherLabelExpression = JRCloneUtils.nullSafeClone(otherLabelExpression); + clone.otherSectionHyperlink = JRCloneUtils.nullSafeClone(otherSectionHyperlink); + return clone; + } + + /* + * These fields are only for serialization backward compatibility. + */ + /** + * @deprecated + */ + private JRExpression keyExpression; + /** + * @deprecated + */ + private JRExpression valueExpression; + /** + * @deprecated + */ + private JRExpression labelExpression; + /** + * @deprecated + */ + private JRHyperlink sectionHyperlink; + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (pieSeriesList == null) + { + pieSeriesList = new ArrayList(); + + JRDesignPieSeries ps = new JRDesignPieSeries(); + ps.setKeyExpression(keyExpression); + ps.setValueExpression(valueExpression); + ps.setLabelExpression(labelExpression); + ps.setSectionHyperlink(sectionHyperlink); + pieSeriesList.add(ps); + + keyExpression = null; + valueExpression = null; + labelExpression = null; + sectionHyperlink = null; + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPiePlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPiePlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPiePlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPiePlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,53 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.base.JRBasePiePlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; + + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRDesignPiePlot extends JRBasePiePlot +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + + /** + * + */ + public JRDesignPiePlot(JRChartPlot piePlot, JRChart chart) + { + super(piePlot, chart, ChartCopyDesignObjectFactory.instance()); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPieSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPieSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPieSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignPieSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,124 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.base.JRBasePieSeries; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; + + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRDesignPieSeries extends JRBasePieSeries implements JRChangeEventsSupport +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_KEY_EXPRESSION = "keyExpression"; + + public static final String PROPERTY_SECTION_HYPERLINK = "sectionHyperlink"; + + public static final String PROPERTY_LABEL_EXPRESSION = "labelExpression"; + + public static final String PROPERTY_VALUE_EXPRESSION = "valueExpression"; + + + /** + * + */ + public void setKeyExpression(JRExpression keyExpression) + { + Object old = this.keyExpression; + this.keyExpression = keyExpression; + getEventSupport().firePropertyChange(PROPERTY_KEY_EXPRESSION, old, this.keyExpression); + } + + /** + * + */ + public void setValueExpression(JRExpression valueExpression) + { + Object old = this.valueExpression; + this.valueExpression = valueExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_EXPRESSION, old, this.valueExpression); + } + + /** + * + */ + public void setLabelExpression(JRExpression labelExpression) + { + Object old = this.labelExpression; + this.labelExpression = labelExpression; + getEventSupport().firePropertyChange(PROPERTY_LABEL_EXPRESSION, old, this.labelExpression); + } + + + /** + * Sets the hyperlink specification for pie chart sections. + * + * @param sectionHyperlink the hyperlink specification + * @see #getSectionHyperlink() + */ + public void setSectionHyperlink(JRHyperlink sectionHyperlink) + { + Object old = this.sectionHyperlink; + this.sectionHyperlink = sectionHyperlink; + getEventSupport().firePropertyChange(PROPERTY_SECTION_HYPERLINK, old, this.sectionHyperlink); + } + + @Override + public Object clone() + { + JRDesignPieSeries clone = (JRDesignPieSeries)super.clone(); + clone.eventSupport = null; + return clone; + } + + private transient JRPropertyChangeSupport eventSupport; + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignScatterPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignScatterPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignScatterPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignScatterPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,319 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.awt.Color; + +import net.sf.jasperreports.charts.base.JRBaseScatterPlot; +import net.sf.jasperreports.charts.util.JRAxisFormat; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRDesignScatterPlot extends JRBaseScatterPlot { + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_X_AXIS_LABEL_COLOR = "xAxisLabelColor"; + + public static final String PROPERTY_X_AXIS_LABEL_EXPRESSION = "xAxisLabelExpression"; + + public static final String PROPERTY_X_AXIS_LABEL_FONT = "xAxisLabelFont"; + + public static final String PROPERTY_X_AXIS_LINE_COLOR = "xAxisLineColor"; + + public static final String PROPERTY_X_AXIS_TICK_LABEL_COLOR = "xAxisTickLabelColor"; + + public static final String PROPERTY_X_AXIS_TICK_LABEL_FONT = "xAxisTickLabelFont"; + + public static final String PROPERTY_X_AXIS_TICK_LABEL_MASK = "xAxisTickLabelMask"; + + public static final String PROPERTY_X_AXIS_VERTICAL_TICK_LABELS = "xAxisVerticalTickLabels"; + + public static final String PROPERTY_Y_AXIS_LABEL_COLOR = "yAxisLabelColor"; + + public static final String PROPERTY_Y_AXIS_LABEL_EXPRESSION = "yAxisLabelExpression"; + + public static final String PROPERTY_Y_AXIS_LABEL_FONT = "yAxisLabelFont"; + + public static final String PROPERTY_Y_AXIS_LINE_COLOR = "yAxisLineColor"; + + public static final String PROPERTY_Y_AXIS_TICK_LABEL_COLOR = "yAxisTickLabelColor"; + + public static final String PROPERTY_Y_AXIS_TICK_LABEL_FONT = "yAxisTickLabelFont"; + + public static final String PROPERTY_Y_AXIS_TICK_LABEL_MASK = "yAxisTickLabelMask"; + + public static final String PROPERTY_Y_AXIS_VERTICAL_TICK_LABELS = "yAxisVerticalTickLabels"; + + public static final String PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION = "domainAxisMinValueExpression"; + + public static final String PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION = "domainAxisMaxValueExpression"; + + public static final String PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION = "rangeAxisMinValueExpression"; + + public static final String PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION = "rangeAxisMaxValueExpression"; + + + /** + * + */ + public JRDesignScatterPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + } + + + /** + * + */ + public void setXAxisLabelExpression( JRExpression xAxisLabelExpression ){ + Object old = this.xAxisLabelExpression; + this.xAxisLabelExpression = xAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_LABEL_EXPRESSION, old, this.xAxisLabelExpression); + } + + /** + * + */ + public void setXAxisLabelFont(JRFont xAxisLabelFont) + { + Object old = this.xAxisLabelFont; + this.xAxisLabelFont = xAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_LABEL_FONT, old, this.xAxisLabelFont); + } + + /** + * + */ + public void setXAxisLabelColor(Color xAxisLabelColor) + { + Object old = this.xAxisLabelColor; + this.xAxisLabelColor = xAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_LABEL_COLOR, old, this.xAxisLabelColor); + } + + /** + * + */ + public void setXAxisTickLabelFont(JRFont xAxisTickLabelFont) + { + Object old = this.xAxisTickLabelFont; + this.xAxisTickLabelFont = xAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_TICK_LABEL_FONT, old, this.xAxisTickLabelFont); + } + + /** + * + */ + public void setXAxisTickLabelColor(Color xAxisTickLabelColor) + { + Object old = this.xAxisTickLabelColor; + this.xAxisTickLabelColor = xAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_TICK_LABEL_COLOR, old, this.xAxisTickLabelColor); + } + + /** + * + */ + public void setXAxisTickLabelMask(String xAxisTickLabelMask) + { + Object old = this.xAxisTickLabelMask; + this.xAxisTickLabelMask = xAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_TICK_LABEL_MASK, old, this.xAxisTickLabelMask); + } + + /** + * + */ + public void setXAxisVerticalTickLabels(Boolean xAxisVerticalTickLabels) + { + Object old = this.xAxisVerticalTickLabels; + this.xAxisVerticalTickLabels = xAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_VERTICAL_TICK_LABELS, old, this.xAxisVerticalTickLabels); + } + + /** + * + */ + public void setXAxisLineColor(Color xAxisLineColor) + { + Object old = this.xAxisLineColor; + this.xAxisLineColor = xAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_X_AXIS_LINE_COLOR, old, this.xAxisLineColor); + } + + /** + * + */ + public void setYAxisLabelExpression( JRExpression yAxisLabelExpression ){ + Object old = this.yAxisLabelExpression; + this.yAxisLabelExpression = yAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_LABEL_EXPRESSION, old, this.yAxisLabelExpression); + } + + /** + * + */ + public void setYAxisLabelFont(JRFont yAxisLabelFont) + { + Object old = this.yAxisLabelFont; + this.yAxisLabelFont = yAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_LABEL_FONT, old, this.yAxisLabelFont); + } + + /** + * + */ + public void setYAxisLabelColor(Color yAxisLabelColor) + { + Object old = this.yAxisLabelColor; + this.yAxisLabelColor = yAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_LABEL_COLOR, old, this.yAxisLabelColor); + } + + /** + * + */ + public void setYAxisTickLabelFont(JRFont yAxisTickLabelFont) + { + Object old = this.yAxisTickLabelFont; + this.yAxisTickLabelFont = yAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_TICK_LABEL_FONT, old, this.yAxisTickLabelFont); + } + + /** + * + */ + public void setYAxisTickLabelColor(Color yAxisTickLabelColor) + { + Object old = this.yAxisTickLabelColor; + this.yAxisTickLabelColor = yAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_TICK_LABEL_COLOR, old, this.yAxisTickLabelColor); + } + + /** + * + */ + public void setYAxisTickLabelMask(String yAxisTickLabelMask) + { + Object old = this.yAxisTickLabelMask; + this.yAxisTickLabelMask = yAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_TICK_LABEL_MASK, old, this.yAxisTickLabelMask); + } + + /** + * + */ + public void setYAxisVerticalTickLabels(Boolean yAxisVerticalTickLabels) + { + Object old = this.yAxisVerticalTickLabels; + this.yAxisVerticalTickLabels = yAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_VERTICAL_TICK_LABELS, old, this.yAxisVerticalTickLabels); + } + + /** + * + */ + public void setYAxisLineColor(Color yAxisLineColor) + { + Object old = this.yAxisLineColor; + this.yAxisLineColor = yAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_Y_AXIS_LINE_COLOR, old, this.yAxisLineColor); + } + + /** + * + */ + public void setXAxisFormat(JRAxisFormat axisFormat) + { + setXAxisLabelColor(axisFormat.getLabelColor()); + setXAxisLabelFont(axisFormat.getLabelFont()); + setXAxisTickLabelFont(axisFormat.getTickLabelFont()); + setXAxisTickLabelColor(axisFormat.getTickLabelColor()); + setXAxisTickLabelMask(axisFormat.getTickLabelMask()); + setXAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setXAxisLineColor(axisFormat.getLineColor()); + } + + /** + * + */ + public void setYAxisFormat(JRAxisFormat axisFormat) + { + setYAxisLabelColor(axisFormat.getLabelColor()); + setYAxisLabelFont(axisFormat.getLabelFont()); + setYAxisTickLabelFont(axisFormat.getTickLabelFont()); + setYAxisTickLabelColor(axisFormat.getTickLabelColor()); + setYAxisTickLabelMask(axisFormat.getTickLabelMask()); + setYAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setYAxisLineColor(axisFormat.getLineColor()); + } + + /** + * + */ + public void setRangeAxisMinValueExpression(JRExpression rangeAxisMinValueExpression) + { + Object old = this.rangeAxisMinValueExpression; + this.rangeAxisMinValueExpression = rangeAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION, old, this.rangeAxisMinValueExpression); + } + + /** + * + */ + public void setRangeAxisMaxValueExpression(JRExpression rangeAxisMaxValueExpression) + { + Object old = this.rangeAxisMaxValueExpression; + this.rangeAxisMaxValueExpression = rangeAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION, old, this.rangeAxisMaxValueExpression); + } + + /** + * + */ + public void setDomainAxisMinValueExpression(JRExpression domainAxisMinValueExpression) + { + Object old = this.domainAxisMinValueExpression; + this.domainAxisMinValueExpression = domainAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION, old, this.domainAxisMinValueExpression); + } + + /** + * + */ + public void setDomainAxisMaxValueExpression(JRExpression domainAxisMaxValueExpression) + { + Object old = this.domainAxisMaxValueExpression; + this.domainAxisMaxValueExpression = domainAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION, old, this.domainAxisMaxValueExpression); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignThermometerPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignThermometerPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignThermometerPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignThermometerPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,163 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRDataRange; +import net.sf.jasperreports.charts.JRValueDisplay; +import net.sf.jasperreports.charts.base.JRBaseThermometerPlot; +import net.sf.jasperreports.charts.base.JRBaseValueDisplay; +import net.sf.jasperreports.charts.type.ValueLocationEnum; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; + +/** + * The layout options of a thermometer chart. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRDesignThermometerPlot extends JRBaseThermometerPlot +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_DATA_RANGE = "dataRange"; + + public static final String PROPERTY_HIGH_RANGE = "highRange"; + + public static final String PROPERTY_LOW_RANGE = "lowRange"; + + public static final String PROPERTY_MEDIUM_RANGE = "mediumRange"; + + public static final String PROPERTY_MERCURY_COLOR = "mercuryColor"; + + public static final String PROPERTY_VALUE_DISPLAY = "valueDisplay"; + + public static final String PROPERTY_VALUE_LOCATION = "valueLocation"; + + + /** + * Constructs a new plot that is a copy of an existing one. + * + * @param plot the plot to copy + */ + public JRDesignThermometerPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + } + + /** + * Sets the range of values that can be displayed by this thermometer. + * Specifies the upper and lower bounds of the display area of the meter. + * + * @param dataRange the range of values to display + */ + public void setDataRange(JRDataRange dataRange) + { + Object old = this.dataRange; + this.dataRange = dataRange; + getEventSupport().firePropertyChange(PROPERTY_DATA_RANGE, old, this.dataRange); + } + + /** + * Sets the formatting option for the textual display of the + * value. + * + * @param valueDisplay the value display formatting options + */ + public void setValueDisplay(JRValueDisplay valueDisplay) + { + Object old = this.valueDisplay; + this.valueDisplay = new JRBaseValueDisplay(valueDisplay, getChart()); + getEventSupport().firePropertyChange(PROPERTY_VALUE_DISPLAY, old, this.valueDisplay); + } + + + /** + * Sets where to show the textual display of the value. + * + * @param valueLocationObject where to show the textual display of the value + */ + public void setValueLocation(ValueLocationEnum valueLocationObject) + { + ValueLocationEnum old = this.valueLocationObject; + this.valueLocationObject = valueLocationObject; + getEventSupport().firePropertyChange(PROPERTY_VALUE_LOCATION, old, this.valueLocationObject); + } + + /** + * Sets the default color of the mercury in the thermometer. This color + * will be used when the value is not in a specified range. + * + * @param mercuryColor the default color of the mercury + */ + public void setMercuryColor(Color mercuryColor) + { + Object old = this.mercuryColor; + this.mercuryColor = mercuryColor; + getEventSupport().firePropertyChange(PROPERTY_MERCURY_COLOR, old, this.mercuryColor); + } + + /** + * Specifies the low range of the thermometer. + * + * @param lowRange the low range of the thermometer + */ + public void setLowRange(JRDataRange lowRange) + { + Object old = this.lowRange; + this.lowRange = lowRange; + getEventSupport().firePropertyChange(PROPERTY_LOW_RANGE, old, this.lowRange); + } + + /** + * Specifies the medium range of the thermometer. + * + * @param mediumRange the medium range of the thermometer + */ + public void setMediumRange(JRDataRange mediumRange) + { + Object old = this.mediumRange; + this.mediumRange = mediumRange; + getEventSupport().firePropertyChange(PROPERTY_MEDIUM_RANGE, old, this.mediumRange); + } + + /** + * Specifies the high range of the thermometer. + * + * @param highRange the high range of the thermometer + */ + public void setHighRange(JRDataRange highRange) + { + Object old = this.highRange; + this.highRange = highRange; + getEventSupport().firePropertyChange(PROPERTY_HIGH_RANGE, old, this.highRange); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimePeriodDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimePeriodDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimePeriodDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimePeriodDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,143 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.charts.JRTimePeriodDataset; +import net.sf.jasperreports.charts.JRTimePeriodSeries; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.design.JRDesignChartDataset; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRDesignTimePeriodDataset extends JRDesignChartDataset implements JRTimePeriodDataset { + + /** + * + */ + public static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_TIME_PERIODS_SERIES = "timePeriodSeries"; + + private List timePeriodSeriesList = new ArrayList(); + + + /** + * + */ + public JRDesignTimePeriodDataset(JRChartDataset dataset) + { + super( dataset ); + } + + @Override + public JRTimePeriodSeries[] getSeries() + { + JRTimePeriodSeries[] timePeriodSeriesArray = new JRTimePeriodSeries[timePeriodSeriesList.size()]; + timePeriodSeriesList.toArray(timePeriodSeriesArray); + + return timePeriodSeriesArray; + } + + /** + * + */ + public List getSeriesList() + { + return timePeriodSeriesList; + } + + /** + * + */ + public void addTimePeriodSeries( JRTimePeriodSeries timePeriodSeries ) + { + timePeriodSeriesList.add(timePeriodSeries); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_TIME_PERIODS_SERIES, + timePeriodSeries, timePeriodSeriesList.size() - 1); + } + + /** + * + */ + public void addTimePeriodSeries(int index, JRTimePeriodSeries timePeriodSeries ) + { + timePeriodSeriesList.add(index, timePeriodSeries); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_TIME_PERIODS_SERIES, + timePeriodSeries, index); + } + + /** + * + */ + public JRTimePeriodSeries removeTimePeriodSeries(JRTimePeriodSeries timePeriodSeries) + { + if( timePeriodSeries != null) + { + int idx = timePeriodSeriesList.indexOf(timePeriodSeries); + if (idx >= 0) + { + timePeriodSeriesList.remove(idx); + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_TIME_PERIODS_SERIES, + timePeriodSeries, idx); + } + } + + return timePeriodSeries; + } + + @Override + public byte getDatasetType() + { + return JRChartDataset.TIMEPERIOD_DATASET; + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + @Override + public Object clone() + { + JRDesignTimePeriodDataset clone = (JRDesignTimePeriodDataset)super.clone(); + clone.timePeriodSeriesList = JRCloneUtils.cloneList(timePeriodSeriesList); + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimePeriodSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimePeriodSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimePeriodSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimePeriodSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,136 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.base.JRBaseTimePeriodSeries; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRDesignTimePeriodSeries extends JRBaseTimePeriodSeries implements JRChangeEventsSupport { + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_END_DATE_EXPRESSION = "endDateExpression"; + + public static final String PROPERTY_ITEM_HYPERLINK = "itemHyperlink"; + + public static final String PROPERTY_LABEL_EXPRESSION = "labelExpression"; + + public static final String PROPERTY_SERIES_EXPRESSION = "seriesExpression"; + + public static final String PROPERTY_START_DATE_EXPRESSION = "startDateExpression"; + + public static final String PROPERTY_VALUE_EXPRESSION = "valueExpression"; + + /** + * + */ + public void setSeriesExpression( JRExpression seriesExpression ){ + Object old = this.seriesExpression; + this.seriesExpression = seriesExpression; + getEventSupport().firePropertyChange(PROPERTY_SERIES_EXPRESSION, old, this.seriesExpression); + } + + /** + * + */ + public void setStartDateExpression( JRExpression startDateExpression ){ + Object old = this.startDateExpression; + this.startDateExpression = startDateExpression; + getEventSupport().firePropertyChange(PROPERTY_START_DATE_EXPRESSION, old, this.startDateExpression); + } + + /** + * + */ + public void setEndDateExpression( JRExpression endDateExpression ){ + Object old = this.endDateExpression; + this.endDateExpression = endDateExpression; + getEventSupport().firePropertyChange(PROPERTY_END_DATE_EXPRESSION, old, this.endDateExpression); + } + + /** + * + */ + public void setValueExpression( JRExpression valueExpression ){ + Object old = this.valueExpression; + this.valueExpression = valueExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_EXPRESSION, old, this.valueExpression); + } + + /** + * + */ + public void setLabelExpression( JRExpression labelExpression ){ + Object old = this.labelExpression; + this.labelExpression = labelExpression; + getEventSupport().firePropertyChange(PROPERTY_LABEL_EXPRESSION, old, this.labelExpression); + } + + /** + * Sets the hyperlink specification for chart items. + * + * @param itemHyperlink the hyperlink specification + * @see #getItemHyperlink() + */ + public void setItemHyperlink(JRHyperlink itemHyperlink) + { + Object old = this.itemHyperlink; + this.itemHyperlink = itemHyperlink; + getEventSupport().firePropertyChange(PROPERTY_ITEM_HYPERLINK, old, this.itemHyperlink); + } + + @Override + public Object clone() + { + JRDesignTimePeriodSeries clone = (JRDesignTimePeriodSeries)super.clone(); + clone.eventSupport = null; + return clone; + } + + private transient JRPropertyChangeSupport eventSupport; + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimeSeriesDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimeSeriesDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimeSeriesDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimeSeriesDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,159 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.charts.JRTimeSeries; +import net.sf.jasperreports.charts.JRTimeSeriesDataset; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.design.JRDesignChartDataset; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRDesignTimeSeriesDataset extends JRDesignChartDataset implements JRTimeSeriesDataset { + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_TIME_PERIOD = "timePeriod"; + + public static final String PROPERTY_TIME_SERIES = "timeSeries"; + + private List timeSeriesList = new ArrayList(); + private Class timePeriod; + + + /** + * + */ + public JRDesignTimeSeriesDataset( JRChartDataset dataset ) + { + super( dataset ); + } + + @Override + public JRTimeSeries[] getSeries() + { + JRTimeSeries[] timeSeriesArray = new JRTimeSeries[ timeSeriesList.size() ]; + timeSeriesList.toArray( timeSeriesArray ); + + return timeSeriesArray; + } + + /** + * + */ + public List getSeriesList() + { + return timeSeriesList; + } + + /** + * + */ + public void addTimeSeries( JRTimeSeries timeSeries ) + { + timeSeriesList.add( timeSeries ); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_TIME_SERIES, + timeSeries, timeSeriesList.size() - 1); + } + + /** + * + */ + public void addTimeSeries(int index, JRTimeSeries timeSeries ) + { + timeSeriesList.add(index, timeSeries ); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_TIME_SERIES, + timeSeries, index); + } + + /** + * + */ + public JRTimeSeries removeTimeSeries( JRTimeSeries timeSeries ) + { + if( timeSeries != null) + { + int idx = timeSeriesList.indexOf(timeSeries); + if (idx >= 0) + { + timeSeriesList.remove(idx); + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_TIME_SERIES, timeSeries, idx); + } + } + + return timeSeries; + } + + @Override + public Class getTimePeriod() + { + return timePeriod; + } + + @Override + public void setTimePeriod( Class timePeriod ) + { + Object old = this.timePeriod; + this.timePeriod = timePeriod; + getEventSupport().firePropertyChange(PROPERTY_TIME_PERIOD, old, this.timePeriod); + } + + @Override + public byte getDatasetType() + { + return JRChartDataset.TIMESERIES_DATASET; + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + @Override + public Object clone() + { + JRDesignTimeSeriesDataset clone = (JRDesignTimeSeriesDataset)super.clone(); + clone.timeSeriesList = JRCloneUtils.cloneList(timeSeriesList); + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimeSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimeSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimeSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimeSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,130 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.base.JRBaseTimeSeries; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; + + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRDesignTimeSeries extends JRBaseTimeSeries implements JRChangeEventsSupport +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_ITEM_HYPERLINK = "itemHyperlink"; + + public static final String PROPERTY_LABEL_EXPRESSION = "labelExpression"; + + public static final String PROPERTY_SERIES_EXPRESSION = "seriesExpression"; + + public static final String PROPERTY_TIME_PERIOD_EXPRESSION = "timePeriodExpression"; + + public static final String PROPERTY_VALUE_EXPRESSION = "valueExpression"; + + + /** + * + */ + public void setSeriesExpression(JRExpression seriesExpression) + { + Object old = this.seriesExpression; + this.seriesExpression = seriesExpression; + getEventSupport().firePropertyChange(PROPERTY_SERIES_EXPRESSION, old, this.seriesExpression); + } + + /** + * + */ + public void setTimePeriodExpression(JRExpression timePeriodExpression) + { + Object old = this.timePeriodExpression; + this.timePeriodExpression = timePeriodExpression; + getEventSupport().firePropertyChange(PROPERTY_TIME_PERIOD_EXPRESSION, old, this.timePeriodExpression); + } + + /** + * + */ + public void setValueExpression(JRExpression valueExpression) + { + Object old = this.valueExpression; + this.valueExpression = valueExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_EXPRESSION, old, this.valueExpression); + } + + /** + * + */ + public void setLabelExpression(JRExpression labelExpression) + { + Object old = this.labelExpression; + this.labelExpression = labelExpression; + getEventSupport().firePropertyChange(PROPERTY_LABEL_EXPRESSION, old, this.labelExpression); + } + + + public void setItemHyperlink(JRHyperlink itemHyperlink) + { + Object old = this.itemHyperlink; + this.itemHyperlink = itemHyperlink; + getEventSupport().firePropertyChange(PROPERTY_ITEM_HYPERLINK, old, this.itemHyperlink); + } + + @Override + public Object clone() + { + JRDesignTimeSeries clone = (JRDesignTimeSeries)super.clone(); + clone.eventSupport = null; + return clone; + } + + private transient JRPropertyChangeSupport eventSupport; + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimeSeriesPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimeSeriesPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimeSeriesPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignTimeSeriesPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,319 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.awt.Color; + +import net.sf.jasperreports.charts.base.JRBaseTimeSeriesPlot; +import net.sf.jasperreports.charts.util.JRAxisFormat; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ + +public class JRDesignTimeSeriesPlot extends JRBaseTimeSeriesPlot { + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_TIME_AXIS_LABEL_COLOR = "timeAxisLabelColor"; + + public static final String PROPERTY_TIME_AXIS_LABEL_EXPRESSION = "timeAxisLabelExpression"; + + public static final String PROPERTY_TIME_AXIS_LABEL_FONT = "timeAxisLabelFont"; + + public static final String PROPERTY_TIME_AXIS_LINE_COLOR = "timeAxisLineColor"; + + public static final String PROPERTY_TIME_AXIS_TICK_LABEL_COLOR = "timeAxisTickLabelColor"; + + public static final String PROPERTY_TIME_AXIS_TICK_LABEL_FONT = "timeAxisTickLabelFont"; + + public static final String PROPERTY_TIME_AXIS_TICK_LABEL_MASK = "timeAxisTickLabelMask"; + + public static final String PROPERTY_TIME_AXIS_VERTICAL_TICK_LABELS = "timeAxisVerticalTickLabels"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_COLOR = "valueAxisLabelColor"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_EXPRESSION = "valueAxisLabelExpression"; + + public static final String PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION = "domainAxisMinValueExpression"; + + public static final String PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION = "domainAxisMaxValueExpression"; + + public static final String PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION = "rangeAxisMinValueExpression"; + + public static final String PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION = "rangeAxisMaxValueExpression"; + + public static final String PROPERTY_VALUE_AXIS_LABEL_FONT = "valueAxisLabelFont"; + + public static final String PROPERTY_VALUE_AXIS_LINE_COLOR = "valueAxisLineColor"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_COLOR = "valueAxisTickLabelColor"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_FONT = "valueAxisTickLabelFont"; + + public static final String PROPERTY_VALUE_AXIS_TICK_LABEL_MASK = "valueAxisTickLabelMask"; + + public static final String PROPERTY_VALUE_AXIS_VERTICAL_TICK_LABELS = "valueAxisVerticalTickLabels"; + + /** + * + */ + public JRDesignTimeSeriesPlot(JRChartPlot plot, JRChart chart) + { + super(plot, chart); + } + + /** + * + */ + public void setTimeAxisLabelExpression( JRExpression timeAxisLabelExpression ){ + Object old = this.timeAxisLabelExpression; + this.timeAxisLabelExpression = timeAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_LABEL_EXPRESSION, old, this.timeAxisLabelExpression); + + } + + /** + * + */ + public void setTimeAxisLabelFont(JRFont timeAxisLabelFont) + { + Object old = this.timeAxisLabelFont; + this.timeAxisLabelFont = timeAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_LABEL_FONT, old, this.timeAxisLabelFont); + } + + /** + * + */ + public void setTimeAxisLabelColor(Color timeAxisLabelColor) + { + Object old = this.timeAxisLabelColor; + this.timeAxisLabelColor = timeAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_LABEL_COLOR, old, this.timeAxisLabelColor); + } + + /** + * + */ + public void setTimeAxisTickLabelFont(JRFont timeAxisTickLabelFont) + { + Object old = this.timeAxisTickLabelFont; + this.timeAxisTickLabelFont = timeAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_TICK_LABEL_FONT, old, this.timeAxisTickLabelFont); + } + + /** + * + */ + public void setTimeAxisTickLabelColor(Color timeAxisTickLabelColor) + { + Object old = this.timeAxisTickLabelColor; + this.timeAxisTickLabelColor = timeAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_TICK_LABEL_COLOR, old, this.timeAxisTickLabelColor); + } + + /** + * + */ + public void setTimeAxisTickLabelMask(String timeAxisTickLabelMask) + { + Object old = this.timeAxisTickLabelMask; + this.timeAxisTickLabelMask = timeAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_TICK_LABEL_MASK, old, this.timeAxisTickLabelMask); + } + + /** + * + */ + public void setTimeAxisVerticalTickLabels(Boolean timeAxisVerticalTickLabels) + { + Object old = this.timeAxisVerticalTickLabels; + this.timeAxisVerticalTickLabels = timeAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_VERTICAL_TICK_LABELS, old, this.timeAxisVerticalTickLabels); + } + + /** + * + */ + public void setTimeAxisLineColor(Color timeAxisLineColor) + { + Object old = this.timeAxisLineColor; + this.timeAxisLineColor = timeAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_TIME_AXIS_LINE_COLOR, old, this.timeAxisLineColor); + } + + /** + * + */ + public void setValueAxisLabelExpression(JRExpression valueAxisLabelExpression) + { + Object old = this.valueAxisLabelExpression; + this.valueAxisLabelExpression = valueAxisLabelExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_EXPRESSION, old, this.valueAxisLabelExpression); + } + + /** + * + */ + public void setDomainAxisMinValueExpression(JRExpression domainAxisMinValueExpression) + { + Object old = this.domainAxisMinValueExpression; + this.domainAxisMinValueExpression = domainAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MINVALUE_EXPRESSION, old, this.domainAxisMinValueExpression); + } + + /** + * + */ + public void setDomainAxisMaxValueExpression(JRExpression domainAxisMaxValueExpression) + { + Object old = this.domainAxisMaxValueExpression; + this.domainAxisMaxValueExpression = domainAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_DOMAIN_AXIS_MAXVALUE_EXPRESSION, old, this.domainAxisMaxValueExpression); + } + + /** + * + */ + public void setRangeAxisMinValueExpression(JRExpression rangeAxisMinValueExpression) + { + Object old = this.rangeAxisMinValueExpression; + this.rangeAxisMinValueExpression = rangeAxisMinValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MINVALUE_EXPRESSION, old, this.rangeAxisMinValueExpression); + } + + /** + * + */ + public void setRangeAxisMaxValueExpression(JRExpression rangeAxisMaxValueExpression) + { + Object old = this.rangeAxisMaxValueExpression; + this.rangeAxisMaxValueExpression = rangeAxisMaxValueExpression; + getEventSupport().firePropertyChange(PROPERTY_RANGE_AXIS_MAXVALUE_EXPRESSION, old, this.rangeAxisMaxValueExpression); + } + + /** + * + */ + public void setValueAxisLabelFont(JRFont valueAxisLabelFont) + { + Object old = this.valueAxisLabelFont; + this.valueAxisLabelFont = valueAxisLabelFont; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_FONT, old, this.valueAxisLabelFont); + } + + /** + * + */ + public void setValueAxisLabelColor(Color valueAxisLabelColor) + { + Object old = this.valueAxisLabelColor; + this.valueAxisLabelColor = valueAxisLabelColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LABEL_COLOR, old, this.valueAxisLabelColor); + } + + /** + * + */ + public void setValueAxisTickLabelFont(JRFont valueAxisTickLabelFont) + { + Object old = this.valueAxisTickLabelFont; + this.valueAxisTickLabelFont = valueAxisTickLabelFont; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_FONT, old, this.valueAxisTickLabelFont); + } + + /** + * + */ + public void setValueAxisTickLabelColor(Color valueAxisTickLabelColor) + { + Object old = this.valueAxisTickLabelColor; + this.valueAxisTickLabelColor = valueAxisTickLabelColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_COLOR, old, this.valueAxisTickLabelColor); + } + + /** + * + */ + public void setValueAxisTickLabelMask(String valueAxisTickLabelMask) + { + Object old = this.valueAxisTickLabelMask; + this.valueAxisTickLabelMask = valueAxisTickLabelMask; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_TICK_LABEL_MASK, old, this.valueAxisTickLabelMask); + } + + /** + * + */ + public void setValueAxisVerticalTickLabels(Boolean valueAxisVerticalTickLabels) + { + Object old = this.valueAxisVerticalTickLabels; + this.valueAxisVerticalTickLabels = valueAxisVerticalTickLabels; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_VERTICAL_TICK_LABELS, old, this.valueAxisVerticalTickLabels); + } + + /** + * + */ + public void setValueAxisLineColor(Color valueAxisLineColor) + { + Object old = this.valueAxisLineColor; + this.valueAxisLineColor = valueAxisLineColor; + getEventSupport().firePropertyChange(PROPERTY_VALUE_AXIS_LINE_COLOR, old, this.valueAxisLineColor); + } + + /** + * + */ + public void setTimeAxisFormat(JRAxisFormat axisFormat) + { + setTimeAxisLabelFont(axisFormat.getLabelFont()); + setTimeAxisLabelColor(axisFormat.getLabelColor()); + setTimeAxisTickLabelFont(axisFormat.getTickLabelFont()); + setTimeAxisTickLabelColor(axisFormat.getTickLabelColor()); + setTimeAxisTickLabelMask(axisFormat.getTickLabelMask()); + setTimeAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setTimeAxisLineColor(axisFormat.getLineColor()); + } + + /** + * + */ + public void setValueAxisFormat(JRAxisFormat axisFormat) + { + setValueAxisLabelFont(axisFormat.getLabelFont()); + setValueAxisLabelColor(axisFormat.getLabelColor()); + setValueAxisTickLabelFont(axisFormat.getTickLabelFont()); + setValueAxisTickLabelColor(axisFormat.getTickLabelColor()); + setValueAxisTickLabelMask(axisFormat.getTickLabelMask()); + setValueAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); + setValueAxisLineColor(axisFormat.getLineColor()); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignValueDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignValueDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignValueDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignValueDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,140 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.JRValueDataset; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.design.JRDesignChartDataset; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.type.ResetTypeEnum; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + +/** + * A data set that contains a single value. A value + * dataset is suitable for using with charts that show a single value against + * a potential range, such as meter chart or a thermometer chart. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRDesignValueDataset extends JRDesignChartDataset implements JRValueDataset +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_VALUE_EXPRESSION = "valueExpression"; + + /** + * The expression that returns the single value contained in this dataset. + */ + protected JRExpression valueExpression; + + + /** + * Construct a new dataset that is a copy of an existing one. + * + * @param dataset the dataset to copy + */ + public JRDesignValueDataset(JRChartDataset dataset) + { + super(dataset); + + if (dataset == null) + { + // value datasets hold a single value hence a reset type other + // than None doesn't make sense + // setting None as default reset type so that it doesn't need to be + // explicitly set in order for the dataset to work as expected + this.resetTypeValue = ResetTypeEnum.NONE; + } + } + + @Override + public JRExpression getValueExpression() + { + return valueExpression; + } + + + /** + * Sets the expression that indicates the value held by this dataset. + * + * @param valueExpression the expression that returns the value held by + * this dataset + */ + public void setValueExpression(JRExpression valueExpression) + { + Object old = this.valueExpression; + this.valueExpression = valueExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_EXPRESSION, old, this.valueExpression); + } + + + + /** + * Returns the type of this dataset. + * + * @return the type of this dataset - always + * {@link net.sf.jasperreports.engine.JRChartDataset#VALUE_DATASET VALUE_DATASET} + */ + @Override + public byte getDatasetType() { + return JRChartDataset.VALUE_DATASET; + } + + /** + * Adds all the expression used by this plot with the specified collector. + * All collected expression that are also registered with a factory will + * be included with the report is compiled. + * + * @param collector the expression collector to use + */ + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + + @Override + public Object clone() + { + JRDesignValueDataset clone = (JRDesignValueDataset)super.clone(); + clone.valueExpression = JRCloneUtils.nullSafeClone(valueExpression); + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignValueDisplay.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignValueDisplay.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignValueDisplay.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignValueDisplay.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,126 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRValueDisplay; +import net.sf.jasperreports.charts.base.JRBaseValueDisplay; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; + +/** + * An object that specifies how a single value should be displayed. Used with + * charts such as a meter or thermometer that display a single value. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRDesignValueDisplay extends JRBaseValueDisplay implements JRChangeEventsSupport +{ + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_COLOR = "color"; + + public static final String PROPERTY_FONT = "font"; + + public static final String PROPERTY_MASK = "mask"; + + + /** + * Constructs a new value display that is a copy of an existing one. + * + * @param valueDisplay the display to copy + */ + public JRDesignValueDisplay(JRValueDisplay valueDisplay, JRChart chart)//FIXMECHART this should be very similar to font; just a container, with unimportant design object + { + super(valueDisplay, chart); + } + + /** + * Sets the color to use when displaying the value. + * + * @param color the color to use when displaying the value + */ + public void setColor(Color color) + { + Object old = this.color; + this.color = color; + getEventSupport().firePropertyChange(PROPERTY_COLOR, old, this.color); + } + + /** + * Sets the formatting mask to use when displaying the value. This mask will + * be used to create a java.text.DecimalFormat object. + * + * @param mask the formatting mask to use when displaying the value + */ + public void setMask(String mask) + { + Object old = this.mask; + this.mask = mask; + getEventSupport().firePropertyChange(PROPERTY_MASK, old, this.mask); + } + + /** + * Sets the font to use when displaying the value. + * + * @param font the font to use when displaying the value + */ + public void setFont(JRFont font) + { + Object old = this.font; + this.font = font; + getEventSupport().firePropertyChange(PROPERTY_FONT, old, this.font); + } + + @Override + public Object clone() + { + JRDesignValueDisplay clone = (JRDesignValueDisplay)super.clone(); + clone.eventSupport = null; + return clone; + } + + private transient JRPropertyChangeSupport eventSupport; + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXyDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXyDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXyDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXyDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,153 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.charts.JRXyDataset; +import net.sf.jasperreports.charts.JRXySeries; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.design.JRDesignChartDataset; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.util.JRCloneUtils; + + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRDesignXyDataset extends JRDesignChartDataset implements JRXyDataset +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_XY_SERIES = "xySeries"; + + private List xySeriesList = new ArrayList(); + + + /** + * + */ + public JRDesignXyDataset(JRChartDataset dataset) + { + super(dataset); + } + + + @Override + public JRXySeries[] getSeries() + { + JRXySeries[] xySeriesArray = new JRXySeries[xySeriesList.size()]; + + xySeriesList.toArray(xySeriesArray); + + return xySeriesArray; + } + + + /** + * + */ + public List getSeriesList() + { + return xySeriesList; + } + + + /** + * + */ + public void addXySeries(JRXySeries xySeries) + { + xySeriesList.add(xySeries); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_XY_SERIES, + xySeries, xySeriesList.size() - 1); + } + + /** + * + */ + public void addXySeries(int index, JRXySeries xySeries) + { + xySeriesList.add(index, xySeries); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_XY_SERIES, + xySeries, index); + } + + + /** + * + */ + public JRXySeries removeXySeries(JRXySeries xySeries) + { + if (xySeries != null) + { + int idx = xySeriesList.indexOf(xySeries); + if (idx >= 0) + { + xySeriesList.remove(idx); + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_XY_SERIES, xySeries, idx); + } + } + + return xySeries; + } + + + @Override + public byte getDatasetType() { + return JRChartDataset.XY_DATASET; + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + + @Override + public Object clone() + { + JRDesignXyDataset clone = (JRDesignXyDataset)super.clone(); + clone.xySeriesList = JRCloneUtils.cloneList(xySeriesList); + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXySeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXySeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXySeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXySeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,149 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.base.JRBaseXySeries; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; + + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRDesignXySeries extends JRBaseXySeries implements JRChangeEventsSupport +{ + + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_ITEM_HYPERLINK = "itemHyperlink"; + + public static final String PROPERTY_LABEL_EXPRESSION = "labelExpression"; + + public static final String PROPERTY_SERIES_EXPRESSION = "seriesExpression"; + + public static final String PROPERTY_X_VALUE_EXPRESSION = "xValueExpression"; + + public static final String PROPERTY_Y_VALUE_EXPRESSION = "yValueExpression"; + + public static final String PROPERTY_AUTO_SORT = "autoSort"; + + + /** + * + */ + public void setSeriesExpression(JRExpression seriesExpression) + { + Object old = this.seriesExpression; + this.seriesExpression = seriesExpression; + getEventSupport().firePropertyChange(PROPERTY_SERIES_EXPRESSION, old, this.seriesExpression); + } + + /** + * + */ + public void setXValueExpression(JRExpression xValueExpression) + { + Object old = this.xValueExpression; + this.xValueExpression = xValueExpression; + getEventSupport().firePropertyChange(PROPERTY_X_VALUE_EXPRESSION, old, this.xValueExpression); + } + + /** + * + */ + public void setYValueExpression(JRExpression yValueExpression) + { + Object old = this.yValueExpression; + this.yValueExpression = yValueExpression; + getEventSupport().firePropertyChange(PROPERTY_Y_VALUE_EXPRESSION, old, this.yValueExpression); + } + + /** + * + */ + public void setLabelExpression(JRExpression labelExpression) + { + Object old = this.labelExpression; + this.labelExpression = labelExpression; + getEventSupport().firePropertyChange(PROPERTY_LABEL_EXPRESSION, old, this.labelExpression); + } + + + /** + * Sets the hyperlink specification for chart items. + * + * @param itemHyperlink the hyperlink specification + * @see #getItemHyperlink() + */ + public void setItemHyperlink(JRHyperlink itemHyperlink) + { + Object old = this.itemHyperlink; + this.itemHyperlink = itemHyperlink; + getEventSupport().firePropertyChange(PROPERTY_ITEM_HYPERLINK, old, this.itemHyperlink); + } + + /** + * + */ + public void setAutoSort(Boolean autoSort) + { + Object old = this.autoSort; + this.autoSort = autoSort; + getEventSupport().firePropertyChange(PROPERTY_AUTO_SORT, old, this.autoSort); + } + + + @Override + public Object clone() + { + JRDesignXySeries clone = (JRDesignXySeries)super.clone(); + clone.eventSupport = null; + return clone; + } + + private transient JRPropertyChangeSupport eventSupport; + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXyzDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXyzDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXyzDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXyzDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,138 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.charts.JRXyzDataset; +import net.sf.jasperreports.charts.JRXyzSeries; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.design.JRDesignChartDataset; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRDesignXyzDataset extends JRDesignChartDataset implements JRXyzDataset { + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_XYZ_SERIES = "xyzSeries"; + + private List xyzSeriesList = new ArrayList(); + + + /** + * + */ + public JRDesignXyzDataset(JRChartDataset dataset) + { + super(dataset); + } + + + @Override + public JRXyzSeries[] getSeries() + { + JRXyzSeries[] xyzSeriesArray = new JRXyzSeries[ xyzSeriesList.size() ]; + xyzSeriesList.toArray( xyzSeriesArray ); + + return xyzSeriesArray; + } + + /** + * + */ + public List getSeriesList() + { + return xyzSeriesList; + } + + /** + * + */ + public void addXyzSeries( JRXyzSeries xyzSeries ) + { + xyzSeriesList.add( xyzSeries ); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_XYZ_SERIES, + xyzSeries, xyzSeriesList.size() - 1); + } + + /** + * + */ + public void addXyzSeries(int index, JRXyzSeries xyzSeries ) + { + xyzSeriesList.add(index, xyzSeries ); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_XYZ_SERIES, + xyzSeries, index); + } + + /** + * + */ + public JRXyzSeries removeXyzSeries( JRXyzSeries xyzSeries ) + { + if( xyzSeries != null ){ + int idx = xyzSeriesList.indexOf(xyzSeries); + if (idx >= 0) { + xyzSeriesList.remove(idx); + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_XYZ_SERIES, xyzSeries, idx); + } + } + + return xyzSeries; + } + + @Override + public byte getDatasetType() { + return JRChartDataset.XYZ_DATASET; + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + + @Override + public Object clone() + { + JRDesignXyzDataset clone = (JRDesignXyzDataset)super.clone(); + clone.xyzSeriesList = JRCloneUtils.cloneList(xyzSeriesList); + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXyzSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXyzSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXyzSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/JRDesignXyzSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,111 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.design; + +import net.sf.jasperreports.charts.base.JRBaseXyzSeries; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRDesignXyzSeries extends JRBaseXyzSeries implements JRChangeEventsSupport { + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_ITEM_HYPERLINK = "itemHyperlink"; + + public static final String PROPERTY_SERIES_EXPRESSION = "seriesExpression"; + + public static final String PROPERTY_X_VALUE_EXPRESSION = "xValueExpression"; + + public static final String PROPERTY_Y_VALUE_EXPRESSION = "yValueExpression"; + + public static final String PROPERTY_Z_VALUE_EXPRESSION = "zValueExpression"; + + public void setSeriesExpression( JRExpression seriesExpression ){ + Object old = this.seriesExpression; + this.seriesExpression = seriesExpression; + getEventSupport().firePropertyChange(PROPERTY_SERIES_EXPRESSION, old, this.seriesExpression); + } + + public void setXValueExpression( JRExpression xValueExpression ){ + Object old = this.xValueExpression; + this.xValueExpression = xValueExpression; + getEventSupport().firePropertyChange(PROPERTY_X_VALUE_EXPRESSION, old, this.xValueExpression); + } + + public void setYValueExpression( JRExpression yValueExpression ){ + Object old = this.yValueExpression; + this.yValueExpression = yValueExpression; + getEventSupport().firePropertyChange(PROPERTY_Y_VALUE_EXPRESSION, old, this.yValueExpression); + } + + public void setZValueExpression( JRExpression zValueExpression ){ + Object old = this.zValueExpression; + this.zValueExpression = zValueExpression; + getEventSupport().firePropertyChange(PROPERTY_Z_VALUE_EXPRESSION, old, this.zValueExpression); + } + + /** + * Sets the hyperlink specification for chart items. + * + * @param itemHyperlink the hyperlink specification + * @see #getItemHyperlink() + */ + public void setItemHyperlink(JRHyperlink itemHyperlink) + { + Object old = this.itemHyperlink; + this.itemHyperlink = itemHyperlink; + getEventSupport().firePropertyChange(PROPERTY_ITEM_HYPERLINK, old, this.itemHyperlink); + } + + @Override + public Object clone() + { + JRDesignXyzSeries clone = (JRDesignXyzSeries)super.clone(); + clone.eventSupport = null; + return clone; + } + + private transient JRPropertyChangeSupport eventSupport; + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/design/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/design/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +/** + * Contains design time implementations for chart related interfaces. + */ +package net.sf.jasperreports.charts.design; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillAreaPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillAreaPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillAreaPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillAreaPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,285 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRAreaPlot; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.fill.JRFillChartPlot; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRFillAreaPlot extends JRFillChartPlot implements JRAreaPlot +{ + + /** + * + */ + protected JRFont categoryAxisLabelFont; + protected Color categoryAxisLabelColor; + protected JRFont categoryAxisTickLabelFont; + protected Color categoryAxisTickLabelColor; + protected Color categoryAxisLineColor; + + protected JRFont valueAxisLabelFont; + protected Color valueAxisLabelColor; + protected JRFont valueAxisTickLabelFont; + protected Color valueAxisTickLabelColor; + protected Color valueAxisLineColor; + + + /** + * + */ + public JRFillAreaPlot( JRAreaPlot areaPlot, JRFillObjectFactory factory ) + { + super( areaPlot, factory ); + + //FIXME should the font use the fill chart? + categoryAxisLabelFont = factory.getFont(areaPlot.getChart(), areaPlot.getCategoryAxisLabelFont()); + categoryAxisLabelColor = areaPlot.getOwnCategoryAxisLabelColor(); + categoryAxisTickLabelFont = factory.getFont(areaPlot.getChart(), areaPlot.getCategoryAxisTickLabelFont()); + categoryAxisTickLabelColor = areaPlot.getOwnCategoryAxisTickLabelColor(); + categoryAxisLineColor = areaPlot.getOwnCategoryAxisLineColor(); + + valueAxisLabelFont = factory.getFont(areaPlot.getChart(), areaPlot.getValueAxisLabelFont()); + valueAxisLabelColor = areaPlot.getOwnValueAxisLabelColor(); + valueAxisTickLabelFont = factory.getFont(areaPlot.getChart(), areaPlot.getValueAxisTickLabelFont()); + valueAxisTickLabelColor = areaPlot.getOwnValueAxisTickLabelColor(); + valueAxisLineColor = areaPlot.getOwnValueAxisLineColor(); + } + + @Override + public JRExpression getCategoryAxisLabelExpression() + { + return ((JRAreaPlot)parent).getCategoryAxisLabelExpression(); + } + + @Override + public JRFont getCategoryAxisLabelFont() + { + return categoryAxisLabelFont; + } + + @Override + public Color getCategoryAxisLabelColor() + { + return getStyleResolver().getCategoryAxisLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLabelColor() + { + return categoryAxisLabelColor; + } + + /** + * + */ + public void setCategoryAxisLabelColor(Color color) + { + } + + @Override + public JRFont getCategoryAxisTickLabelFont() + { + return categoryAxisTickLabelFont; + } + + @Override + public Color getCategoryAxisTickLabelColor() + { + return getStyleResolver().getCategoryAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisTickLabelColor() + { + return categoryAxisTickLabelColor; + } + + /** + * + */ + public void setCategoryAxisTickLabelColor(Color color) + { + } + + @Override + public String getCategoryAxisTickLabelMask() + { + return ((JRAreaPlot)parent).getCategoryAxisTickLabelMask(); + } + + @Override + public Boolean getCategoryAxisVerticalTickLabels() + { + return ((JRAreaPlot)parent).getCategoryAxisVerticalTickLabels(); + } + + @Override + public Double getCategoryAxisTickLabelRotation() + { + return ((JRAreaPlot)parent).getCategoryAxisTickLabelRotation(); + } + + @Override + public void setCategoryAxisTickLabelRotation(Double labelRotation) + { + } + + @Override + public Color getCategoryAxisLineColor() + { + return getStyleResolver().getCategoryAxisLineColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLineColor() + { + return categoryAxisLineColor; + } + + /** + * + */ + public void setCategoryAxisLineColor(Color color) + { + } + + @Override + public JRExpression getValueAxisLabelExpression() + { + return ((JRAreaPlot)parent).getValueAxisLabelExpression(); + } + + @Override + public JRExpression getDomainAxisMinValueExpression() + { + return ((JRAreaPlot)parent).getDomainAxisMinValueExpression(); + } + + @Override + public JRExpression getDomainAxisMaxValueExpression() + { + return ((JRAreaPlot)parent).getDomainAxisMaxValueExpression(); + } + + @Override + public JRExpression getRangeAxisMinValueExpression() + { + return ((JRAreaPlot)parent).getRangeAxisMinValueExpression(); + } + + @Override + public JRExpression getRangeAxisMaxValueExpression() + { + return ((JRAreaPlot)parent).getRangeAxisMaxValueExpression(); + } + + @Override + public JRFont getValueAxisLabelFont() + { + return valueAxisLabelFont; + } + + @Override + public Color getValueAxisLabelColor() + { + return getStyleResolver().getValueAxisLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisLabelColor() + { + return valueAxisLabelColor; + } + + /** + * + */ + public void setValueAxisLabelColor(Color color) + { + } + + @Override + public JRFont getValueAxisTickLabelFont() + { + return valueAxisTickLabelFont; + } + + @Override + public Color getValueAxisTickLabelColor() + { + return getStyleResolver().getValueAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisTickLabelColor() + { + return valueAxisTickLabelColor; + } + + /** + * + */ + public void setValueAxisTickLabelColor(Color color) + { + } + + @Override + public String getValueAxisTickLabelMask() + { + return ((JRAreaPlot)parent).getValueAxisTickLabelMask(); + } + + @Override + public Boolean getValueAxisVerticalTickLabels() + { + return ((JRAreaPlot)parent).getValueAxisVerticalTickLabels(); + } + + @Override + public Color getValueAxisLineColor() + { + return getStyleResolver().getValueAxisLineColor(this, this); + } + + @Override + public Color getOwnValueAxisLineColor() + { + return valueAxisLineColor; + } + + /** + * + */ + public void setValueAxisLineColor(Color color) + { + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillBar3DPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillBar3DPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillBar3DPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillBar3DPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,323 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRBar3DPlot; +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.fill.JRFillChartPlot; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRFillBar3DPlot extends JRFillChartPlot implements JRBar3DPlot +{ + + /** + * + */ + protected JRFont categoryAxisLabelFont; + protected Color categoryAxisLabelColor; + protected JRFont categoryAxisTickLabelFont; + protected Color categoryAxisTickLabelColor; + protected Color categoryAxisLineColor; + + protected JRFont valueAxisLabelFont; + protected Color valueAxisLabelColor; + protected JRFont valueAxisTickLabelFont; + protected Color valueAxisTickLabelColor; + protected Color valueAxisLineColor; + + + /** + * + */ + public JRFillBar3DPlot( JRBar3DPlot barPlot, JRFillObjectFactory factory ){ + super( barPlot, factory ); + + categoryAxisLabelFont = factory.getFont(barPlot.getChart(), barPlot.getCategoryAxisLabelFont()); + categoryAxisLabelColor = barPlot.getOwnCategoryAxisLabelColor(); + categoryAxisTickLabelFont = factory.getFont(barPlot.getChart(), barPlot.getCategoryAxisTickLabelFont()); + categoryAxisTickLabelColor = barPlot.getOwnCategoryAxisTickLabelColor(); + categoryAxisLineColor = barPlot.getOwnCategoryAxisLineColor(); + + valueAxisLabelFont = factory.getFont(barPlot.getChart(), barPlot.getValueAxisLabelFont()); + valueAxisLabelColor = barPlot.getOwnValueAxisLabelColor(); + valueAxisTickLabelFont = factory.getFont(barPlot.getChart(), barPlot.getValueAxisTickLabelFont()); + valueAxisTickLabelColor = barPlot.getOwnValueAxisTickLabelColor(); + valueAxisLineColor = barPlot.getOwnValueAxisLineColor(); + } + + @Override + public JRExpression getCategoryAxisLabelExpression() + { + return ((JRBar3DPlot)parent).getCategoryAxisLabelExpression(); + } + + @Override + public JRFont getCategoryAxisLabelFont() + { + return categoryAxisLabelFont; + } + + @Override + public Color getCategoryAxisLabelColor() + { + return getStyleResolver().getCategoryAxisLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLabelColor() + { + return categoryAxisLabelColor; + } + + /** + * + */ + public void setCategoryAxisLabelColor(Color color) + { + } + + @Override + public JRFont getCategoryAxisTickLabelFont() + { + return categoryAxisTickLabelFont; + } + + @Override + public Color getCategoryAxisTickLabelColor() + { + return getStyleResolver().getCategoryAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisTickLabelColor() + { + return categoryAxisTickLabelColor; + } + + /** + * + */ + public void setCategoryAxisTickLabelColor(Color color) + { + } + + @Override + public String getCategoryAxisTickLabelMask() + { + return ((JRBar3DPlot)parent).getCategoryAxisTickLabelMask(); + } + + @Override + public Boolean getCategoryAxisVerticalTickLabels() + { + return ((JRBar3DPlot)parent).getCategoryAxisVerticalTickLabels(); + } + + @Override + public Double getCategoryAxisTickLabelRotation() + { + return ((JRBar3DPlot)parent).getCategoryAxisTickLabelRotation(); + } + + @Override + public void setCategoryAxisTickLabelRotation(Double labelRotation) + { + } + + @Override + public Color getCategoryAxisLineColor() + { + return getStyleResolver().getCategoryAxisLineColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLineColor() + { + return categoryAxisLineColor; + } + + /** + * + */ + public void setCategoryAxisLineColor(Color color) + { + } + + @Override + public JRExpression getValueAxisLabelExpression() + { + return ((JRBar3DPlot)parent).getValueAxisLabelExpression(); + } + + @Override + public JRExpression getDomainAxisMinValueExpression() + { + return ((JRBar3DPlot)parent).getDomainAxisMinValueExpression(); + } + + @Override + public JRExpression getDomainAxisMaxValueExpression() + { + return ((JRBar3DPlot)parent).getDomainAxisMaxValueExpression(); + } + + @Override + public JRExpression getRangeAxisMinValueExpression() + { + return ((JRBar3DPlot)parent).getRangeAxisMinValueExpression(); + } + + @Override + public JRExpression getRangeAxisMaxValueExpression() + { + return ((JRBar3DPlot)parent).getRangeAxisMaxValueExpression(); + } + + @Override + public JRFont getValueAxisLabelFont() + { + return valueAxisLabelFont; + } + + @Override + public Color getValueAxisLabelColor() + { + return getStyleResolver().getValueAxisLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisLabelColor() + { + return valueAxisLabelColor; + } + + /** + * + */ + public void setValueAxisLabelColor(Color color) + { + } + + @Override + public JRFont getValueAxisTickLabelFont() + { + return valueAxisTickLabelFont; + } + + @Override + public Color getValueAxisTickLabelColor() + { + return getStyleResolver().getValueAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisTickLabelColor() + { + return valueAxisTickLabelColor; + } + + /** + * + */ + public void setValueAxisTickLabelColor(Color color) + { + } + + @Override + public String getValueAxisTickLabelMask() + { + return ((JRBar3DPlot)parent).getValueAxisTickLabelMask(); + } + + @Override + public Boolean getValueAxisVerticalTickLabels() + { + return ((JRBar3DPlot)parent).getValueAxisVerticalTickLabels(); + } + + @Override + public Color getValueAxisLineColor() + { + return getStyleResolver().getValueAxisLineColor(this, this); + } + + @Override + public Color getOwnValueAxisLineColor() + { + return valueAxisLineColor; + } + + /** + * + */ + public void setValueAxisLineColor(Color color) + { + } + + @Override + public Double getXOffsetDouble(){ + return ((JRBar3DPlot)parent).getXOffsetDouble(); + } + + @Override + public void setXOffset( Double xOffset ){ + } + + @Override + public Double getYOffsetDouble(){ + return ((JRBar3DPlot)parent).getYOffsetDouble(); + } + + @Override + public void setYOffset( Double yOffset ){ + } + + @Override + public Boolean getShowLabels(){ + return ((JRBar3DPlot)parent).getShowLabels(); + } + + @Override + public JRItemLabel getItemLabel() + { + return ((JRBar3DPlot)parent).getItemLabel(); + } + + /** + * + */ + public void setItemLabel( JRItemLabel itemLabel ){ + } + + @Override + public void setShowLabels( Boolean isShowLabels ){ + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillBarPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillBarPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillBarPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillBarPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,335 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRBarPlot; +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.fill.JRFillChartPlot; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRFillBarPlot extends JRFillChartPlot implements JRBarPlot +{ + + + /** + * + */ + protected JRFont categoryAxisLabelFont; + protected Color categoryAxisLabelColor; + protected JRFont categoryAxisTickLabelFont; + protected Color categoryAxisTickLabelColor; + protected Color categoryAxisLineColor; + + protected JRFont valueAxisLabelFont; + protected Color valueAxisLabelColor; + protected JRFont valueAxisTickLabelFont; + protected Color valueAxisTickLabelColor; + protected Color valueAxisLineColor; + + + /** + * + */ + public JRFillBarPlot( + JRBarPlot barPlot, + JRFillObjectFactory factory + ) + { + super(barPlot, factory); + + categoryAxisLabelFont = factory.getFont(barPlot.getChart(), barPlot.getCategoryAxisLabelFont()); + categoryAxisLabelColor = barPlot.getOwnCategoryAxisLabelColor(); + categoryAxisTickLabelFont = factory.getFont(barPlot.getChart(), barPlot.getCategoryAxisTickLabelFont()); + categoryAxisTickLabelColor = barPlot.getOwnCategoryAxisTickLabelColor(); + categoryAxisLineColor = barPlot.getOwnCategoryAxisLineColor(); + + valueAxisLabelFont = factory.getFont(barPlot.getChart(), barPlot.getValueAxisLabelFont()); + valueAxisLabelColor = barPlot.getOwnValueAxisLabelColor(); + valueAxisTickLabelFont = factory.getFont(barPlot.getChart(), barPlot.getValueAxisTickLabelFont()); + valueAxisTickLabelColor = barPlot.getOwnValueAxisTickLabelColor(); + valueAxisLineColor = barPlot.getOwnValueAxisLineColor(); + + } + + + @Override + public JRExpression getCategoryAxisLabelExpression() + { + return ((JRBarPlot)parent).getCategoryAxisLabelExpression(); + } + + @Override + public JRFont getCategoryAxisLabelFont() + { + return categoryAxisLabelFont; + } + + @Override + public Color getCategoryAxisLabelColor() + { + return getStyleResolver().getCategoryAxisLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLabelColor() + { + return categoryAxisLabelColor; + } + + /** + * + */ + public void setCategoryAxisLabelColor(Color color) + { + } + + @Override + public JRFont getCategoryAxisTickLabelFont() + { + return categoryAxisTickLabelFont; + } + + @Override + public Color getCategoryAxisTickLabelColor() + { + return getStyleResolver().getCategoryAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisTickLabelColor() + { + return categoryAxisTickLabelColor; + } + + @Override + public JRItemLabel getItemLabel() + { + return ((JRBarPlot)parent).getItemLabel(); + } + /** + * + */ + public void setItemLabel( JRItemLabel itemLabel ){ + } + + /** + * + */ + public void setCategoryAxisTickLabelColor(Color color) + { + } + + @Override + public String getCategoryAxisTickLabelMask() + { + return ((JRBarPlot)parent).getCategoryAxisTickLabelMask(); + } + + @Override + public Boolean getCategoryAxisVerticalTickLabels() + { + return ((JRBarPlot)parent).getCategoryAxisVerticalTickLabels(); + } + + @Override + public Double getCategoryAxisTickLabelRotation() + { + return ((JRBarPlot)parent).getCategoryAxisTickLabelRotation(); + } + + @Override + public void setCategoryAxisTickLabelRotation(Double labelRotation) + { + } + + @Override + public Color getCategoryAxisLineColor() + { + return getStyleResolver().getCategoryAxisLineColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLineColor() + { + return categoryAxisLineColor; + } + + /** + * + */ + public void setCategoryAxisLineColor(Color color) + { + } + + @Override + public JRExpression getValueAxisLabelExpression() + { + return ((JRBarPlot)parent).getValueAxisLabelExpression(); + } + + @Override + public JRExpression getDomainAxisMinValueExpression() + { + return ((JRBarPlot)parent).getDomainAxisMinValueExpression(); + } + + @Override + public JRExpression getDomainAxisMaxValueExpression() + { + return ((JRBarPlot)parent).getDomainAxisMaxValueExpression(); + } + + @Override + public JRExpression getRangeAxisMinValueExpression() + { + return ((JRBarPlot)parent).getRangeAxisMinValueExpression(); + } + + @Override + public JRExpression getRangeAxisMaxValueExpression() + { + return ((JRBarPlot)parent).getRangeAxisMaxValueExpression(); + } + + @Override + public JRFont getValueAxisLabelFont() + { + return valueAxisLabelFont; + } + + @Override + public Color getValueAxisLabelColor() + { + return getStyleResolver().getValueAxisLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisLabelColor() + { + return valueAxisLabelColor; + } + + /** + * + */ + public void setValueAxisLabelColor(Color color) + { + } + + @Override + public JRFont getValueAxisTickLabelFont() + { + return valueAxisTickLabelFont; + } + + @Override + public Color getValueAxisTickLabelColor() + { + return getStyleResolver().getValueAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisTickLabelColor() + { + return valueAxisTickLabelColor; + } + + /** + * + */ + public void setValueAxisTickLabelColor(Color color) + { + } + + @Override + public String getValueAxisTickLabelMask() + { + return ((JRBarPlot)parent).getValueAxisTickLabelMask(); + } + + @Override + public Boolean getValueAxisVerticalTickLabels() + { + return ((JRBarPlot)parent).getValueAxisVerticalTickLabels(); + } + + @Override + public Color getValueAxisLineColor() + { + return getStyleResolver().getValueAxisLineColor(this, this); + } + + @Override + public Color getOwnValueAxisLineColor() + { + return valueAxisLineColor; + } + + /** + * + */ + public void setValueAxisLineColor(Color color) + { + } + + @Override + public Boolean getShowTickMarks() + { + return ((JRBarPlot)parent).getShowTickMarks(); + } + + @Override + public void setShowTickMarks(Boolean isShowTickMarks) + { + } + + @Override + public Boolean getShowTickLabels() + { + return ((JRBarPlot)parent).getShowTickLabels(); + } + + @Override + public void setShowTickLabels(Boolean isShowTickLabels) + { + } + + @Override + public Boolean getShowLabels(){ + return ((JRBarPlot)parent).getShowLabels(); + } + + @Override + public void setShowLabels( Boolean isShowLabels ){ + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillBubblePlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillBubblePlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillBubblePlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillBubblePlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,244 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRBubblePlot; +import net.sf.jasperreports.charts.type.ScaleTypeEnum; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.fill.JRFillChartPlot; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRFillBubblePlot extends JRFillChartPlot implements JRBubblePlot +{ + + /** + * + */ + protected JRFont xAxisLabelFont; + protected Color xAxisLabelColor; + protected JRFont xAxisTickLabelFont; + protected Color xAxisTickLabelColor; + protected Color xAxisLineColor; + + protected JRFont yAxisLabelFont; + protected Color yAxisLabelColor; + protected JRFont yAxisTickLabelFont; + protected Color yAxisTickLabelColor; + protected Color yAxisLineColor; + + + /** + * + */ + public JRFillBubblePlot( JRBubblePlot bubblePlot, JRFillObjectFactory factory ){ + super( bubblePlot, factory ); + + xAxisLabelFont = factory.getFont(bubblePlot.getChart(), bubblePlot.getXAxisLabelFont()); + xAxisLabelColor = bubblePlot.getOwnXAxisLabelColor(); + xAxisTickLabelFont = factory.getFont(bubblePlot.getChart(), bubblePlot.getXAxisTickLabelFont()); + xAxisTickLabelColor = bubblePlot.getOwnXAxisTickLabelColor(); + xAxisLineColor = bubblePlot.getOwnXAxisLineColor(); + + yAxisLabelFont = factory.getFont(bubblePlot.getChart(), bubblePlot.getYAxisLabelFont()); + yAxisLabelColor = bubblePlot.getOwnYAxisLabelColor(); + yAxisTickLabelFont = factory.getFont(bubblePlot.getChart(), bubblePlot.getYAxisTickLabelFont()); + yAxisTickLabelColor = bubblePlot.getOwnYAxisTickLabelColor(); + yAxisLineColor = bubblePlot.getOwnYAxisLineColor(); + } + + @Override + public JRExpression getXAxisLabelExpression() + { + return ((JRBubblePlot)parent).getXAxisLabelExpression(); + } + + @Override + public JRFont getXAxisLabelFont() + { + return xAxisLabelFont; + } + + @Override + public Color getXAxisLabelColor() + { + return getStyleResolver().getXAxisLabelColor(this, this); + } + + @Override + public Color getOwnXAxisLabelColor() + { + return xAxisLabelColor; + } + + @Override + public JRFont getXAxisTickLabelFont() + { + return xAxisTickLabelFont; + } + + @Override + public Color getXAxisTickLabelColor() + { + return getStyleResolver().getXAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnXAxisTickLabelColor() + { + return xAxisTickLabelColor; + } + + @Override + public String getXAxisTickLabelMask() + { + return ((JRBubblePlot)parent).getXAxisTickLabelMask(); + } + + @Override + public Boolean getXAxisVerticalTickLabels() + { + return ((JRBubblePlot)parent).getXAxisVerticalTickLabels(); + } + + @Override + public Color getXAxisLineColor() + { + return getStyleResolver().getXAxisLineColor(this, this); + } + + @Override + public Color getOwnXAxisLineColor() + { + return xAxisLineColor; + } + + @Override + public JRExpression getYAxisLabelExpression() + { + return ((JRBubblePlot)parent).getYAxisLabelExpression(); + } + + @Override + public JRFont getYAxisLabelFont() + { + return yAxisLabelFont; + } + + @Override + public Color getYAxisLabelColor() + { + return getStyleResolver().getYAxisLabelColor(this, this); + } + + @Override + public Color getOwnYAxisLabelColor() + { + return yAxisLabelColor; + } + + @Override + public JRFont getYAxisTickLabelFont() + { + return yAxisTickLabelFont; + } + + @Override + public Color getYAxisTickLabelColor() + { + return getStyleResolver().getYAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnYAxisTickLabelColor() + { + return yAxisTickLabelColor; + } + + @Override + public String getYAxisTickLabelMask() + { + return ((JRBubblePlot)parent).getYAxisTickLabelMask(); + } + + @Override + public Boolean getYAxisVerticalTickLabels() + { + return ((JRBubblePlot)parent).getYAxisVerticalTickLabels(); + } + + @Override + public Color getYAxisLineColor() + { + return getStyleResolver().getYAxisLineColor(this, this); + } + + @Override + public Color getOwnYAxisLineColor() + { + return yAxisLineColor; + } + + @Override + public ScaleTypeEnum getScaleTypeValue() + { + return ((JRBubblePlot)parent).getScaleTypeValue(); + } + + @Override + public void setScaleType( ScaleTypeEnum scaleType ) + { + throw new UnsupportedOperationException(); + } + + @Override + public JRExpression getDomainAxisMinValueExpression() + { + return ((JRBubblePlot)parent).getDomainAxisMinValueExpression(); + } + + @Override + public JRExpression getDomainAxisMaxValueExpression() + { + return ((JRBubblePlot)parent).getDomainAxisMaxValueExpression(); + } + + @Override + public JRExpression getRangeAxisMinValueExpression() + { + return ((JRBubblePlot)parent).getRangeAxisMinValueExpression(); + } + + @Override + public JRExpression getRangeAxisMaxValueExpression() + { + return ((JRBubblePlot)parent).getRangeAxisMaxValueExpression(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillCandlestickPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillCandlestickPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillCandlestickPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillCandlestickPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,284 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRCandlestickPlot; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.fill.JRFillChartPlot; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRFillCandlestickPlot extends JRFillChartPlot implements JRCandlestickPlot +{ + + /** + * + */ + protected JRFont timeAxisLabelFont; + protected Color timeAxisLabelColor; + protected JRFont timeAxisTickLabelFont; + protected Color timeAxisTickLabelColor; + protected Color timeAxisLineColor; + + protected JRFont valueAxisLabelFont; + protected Color valueAxisLabelColor; + protected JRFont valueAxisTickLabelFont; + protected Color valueAxisTickLabelColor; + protected Color valueAxisLineColor; + + + /** + * + */ + public JRFillCandlestickPlot( + JRCandlestickPlot candlestickPlot, + JRFillObjectFactory factory + ) + { + super(candlestickPlot, factory); + + timeAxisLabelFont = factory.getFont(candlestickPlot.getChart(), candlestickPlot.getTimeAxisLabelFont()); + timeAxisLabelColor = candlestickPlot.getOwnTimeAxisLabelColor(); + timeAxisTickLabelFont = factory.getFont(candlestickPlot.getChart(), candlestickPlot.getTimeAxisTickLabelFont()); + timeAxisTickLabelColor = candlestickPlot.getOwnTimeAxisTickLabelColor(); + timeAxisLineColor = candlestickPlot.getOwnTimeAxisLineColor(); + + valueAxisLabelFont = factory.getFont(candlestickPlot.getChart(), candlestickPlot.getValueAxisLabelFont()); + valueAxisLabelColor = candlestickPlot.getOwnValueAxisLabelColor(); + valueAxisTickLabelFont = factory.getFont(candlestickPlot.getChart(), candlestickPlot.getValueAxisTickLabelFont()); + valueAxisTickLabelColor = candlestickPlot.getOwnValueAxisTickLabelColor(); + valueAxisLineColor = candlestickPlot.getOwnValueAxisTickLabelColor(); + } + + @Override + public JRExpression getTimeAxisLabelExpression() + { + return ((JRCandlestickPlot)parent).getTimeAxisLabelExpression(); + } + + @Override + public JRFont getTimeAxisLabelFont() + { + return timeAxisLabelFont; + } + + @Override + public Color getTimeAxisLabelColor() + { + return getStyleResolver().getTimeAxisLabelColor(this, this); + } + + @Override + public Color getOwnTimeAxisLabelColor() + { + return timeAxisLabelColor; + } + + /** + * + */ + public void setTimeAxisLabelColor(Color color) + { + } + + @Override + public JRFont getTimeAxisTickLabelFont() + { + return timeAxisTickLabelFont; + } + + @Override + public Color getTimeAxisTickLabelColor() + { + return getStyleResolver().getTimeAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnTimeAxisTickLabelColor() + { + return timeAxisTickLabelColor; + } + + /** + * + */ + public void setTimeAxisTickLabelColor(Color color) + { + } + + @Override + public String getTimeAxisTickLabelMask() + { + return ((JRCandlestickPlot)parent).getTimeAxisTickLabelMask(); + } + + @Override + public Boolean getTimeAxisVerticalTickLabels() + { + return ((JRCandlestickPlot)parent).getTimeAxisVerticalTickLabels(); + } + + @Override + public Color getTimeAxisLineColor() + { + return getStyleResolver().getTimeAxisLineColor(this, this); + } + + @Override + public Color getOwnTimeAxisLineColor() + { + return timeAxisLineColor; + } + + /** + * + */ + public void setTimeAxisLineColor(Color color) + { + } + + @Override + public JRExpression getValueAxisLabelExpression() + { + return ((JRCandlestickPlot)parent).getValueAxisLabelExpression(); + } + + @Override + public JRExpression getDomainAxisMinValueExpression() + { + return ((JRCandlestickPlot)parent).getDomainAxisMinValueExpression(); + } + + @Override + public JRExpression getDomainAxisMaxValueExpression() + { + return ((JRCandlestickPlot)parent).getDomainAxisMaxValueExpression(); + } + + @Override + public JRExpression getRangeAxisMinValueExpression() + { + return ((JRCandlestickPlot)parent).getRangeAxisMinValueExpression(); + } + + @Override + public JRExpression getRangeAxisMaxValueExpression() + { + return ((JRCandlestickPlot)parent).getRangeAxisMaxValueExpression(); + } + + @Override + public JRFont getValueAxisLabelFont() + { + return valueAxisLabelFont; + } + + @Override + public Color getValueAxisLabelColor() + { + return getStyleResolver().getValueAxisLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisLabelColor() + { + return valueAxisLabelColor; + } + + /** + * + */ + public void setValueAxisLabelColor(Color color) + { + } + + @Override + public JRFont getValueAxisTickLabelFont() + { + return valueAxisTickLabelFont; + } + + @Override + public Color getValueAxisTickLabelColor() + { + return getStyleResolver().getValueAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisTickLabelColor() + { + return valueAxisTickLabelColor; + } + + /** + * + */ + public void setValueAxisTickLabelColor(Color color) + { + } + + @Override + public String getValueAxisTickLabelMask() + { + return ((JRCandlestickPlot)parent).getValueAxisTickLabelMask(); + } + + @Override + public Boolean getValueAxisVerticalTickLabels() + { + return ((JRCandlestickPlot)parent).getValueAxisVerticalTickLabels(); + } + + @Override + public Color getValueAxisLineColor() + { + return getStyleResolver().getValueAxisLineColor(this, this); + } + + @Override + public Color getOwnValueAxisLineColor() + { + return valueAxisLineColor; + } + + /** + * + */ + public void setValueAxisLineColor(Color color) + { + } + + @Override + public Boolean getShowVolume() + { + return ((JRCandlestickPlot)parent).getShowVolume(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillCategoryDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillCategoryDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillCategoryDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillCategoryDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,227 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.util.HashMap; +import java.util.Map; + +import net.sf.jasperreports.charts.JRCategoryDataset; +import net.sf.jasperreports.charts.JRCategorySeries; +import net.sf.jasperreports.charts.util.CategoryLabelGenerator; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillChartDataset; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +import org.jfree.data.category.DefaultCategoryDataset; +import org.jfree.data.general.Dataset; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRFillCategoryDataset extends JRFillChartDataset implements JRCategoryDataset +{ + + public static final String EXCEPTION_MESSAGE_KEY_SERIES_NULL_NAME = "charts.category.dataset.series.null.name"; + + /** + * + */ + protected JRFillCategorySeries[] categorySeries; + + private DefaultCategoryDataset dataset; + private Map, Map, String>> labelsMap; + + private Map, Map, JRPrintHyperlink>> itemHyperlinks; + + + /** + * + */ + public JRFillCategoryDataset( + JRCategoryDataset categoryDataset, + JRFillObjectFactory factory + ) + { + super(categoryDataset, factory); + + /* */ + JRCategorySeries[] srcCategorySeries = categoryDataset.getSeries(); + if (srcCategorySeries != null && srcCategorySeries.length > 0) + { + categorySeries = new JRFillCategorySeries[srcCategorySeries.length]; + for(int i = 0; i < categorySeries.length; i++) + { + categorySeries[i] = (JRFillCategorySeries)factory.getCategorySeries(srcCategorySeries[i]); + } + } + } + + + @Override + public JRCategorySeries[] getSeries() + { + return categorySeries; + } + + + @Override + protected void customInitialize() + { + dataset = null; + labelsMap = null; + itemHyperlinks = null; + } + + @Override + protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException + { + if (categorySeries != null && categorySeries.length > 0) + { + for(int i = 0; i < categorySeries.length; i++) + { + categorySeries[i].evaluate(calculator); + } + } + } + + @Override + protected void customIncrement() + { + if (categorySeries != null && categorySeries.length > 0) + { + if (dataset == null) + { + dataset = new DefaultCategoryDataset(); + labelsMap = new HashMap, Map, String>>(); + itemHyperlinks = new HashMap, Map, JRPrintHyperlink>>(); + } + + for(int i = 0; i < categorySeries.length; i++) + { + JRFillCategorySeries crtCategorySeries = categorySeries[i]; + + Comparable seriesName = crtCategorySeries.getSeries(); + if (seriesName == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_SERIES_NULL_NAME, + (Object[])null + ); + } + + dataset.addValue( + crtCategorySeries.getValue(), + crtCategorySeries.getSeries(), + crtCategorySeries.getCategory() + ); + + if (crtCategorySeries.getLabelExpression() != null) + { + Map, String> seriesLabels = labelsMap.get(seriesName); + if (seriesLabels == null) + { + seriesLabels = new HashMap, String>(); + labelsMap.put(seriesName, seriesLabels); + } + + seriesLabels.put(crtCategorySeries.getCategory(), crtCategorySeries.getLabel()); + } + + if (crtCategorySeries.hasItemHyperlinks()) + { + Map, JRPrintHyperlink> seriesLinks = itemHyperlinks.get(seriesName); + if (seriesLinks == null) + { + seriesLinks = new HashMap, JRPrintHyperlink>(); + itemHyperlinks.put(seriesName, seriesLinks); + } + seriesLinks.put(crtCategorySeries.getCategory(), crtCategorySeries.getPrintItemHyperlink()); + } + } + } + } + + @Override + public Dataset getCustomDataset() + { + return dataset; + } + + + @Override + public byte getDatasetType() { + return JRChartDataset.CATEGORY_DATASET; + } + + + @Override + public Object getLabelGenerator() + { + return new CategoryLabelGenerator(labelsMap, getLocale()); + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + public Map, Map, JRPrintHyperlink>> getItemHyperlinks() + { + return itemHyperlinks; + } + + + public boolean hasItemHyperlinks() + { + boolean foundLinks = false; + if (categorySeries != null && categorySeries.length > 0) + { + for (int i = 0; i < categorySeries.length && !foundLinks; i++) + { + JRFillCategorySeries serie = categorySeries[i]; + foundLinks = serie.hasItemHyperlinks(); + } + } + return foundLinks; + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillCategorySeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillCategorySeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillCategorySeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillCategorySeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,185 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import net.sf.jasperreports.charts.JRCategorySeries; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRHyperlinkHelper; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRFillCategorySeries implements JRCategorySeries +{ + + /** + * + */ + protected JRCategorySeries parent; + + private Comparable series; + private Comparable category; + private Number value; + private String label; + private JRPrintHyperlink itemHyperlink; + + + /** + * + */ + public JRFillCategorySeries( + JRCategorySeries categorySeries, + JRFillObjectFactory factory + ) + { + factory.put(categorySeries, this); + + parent = categorySeries; + } + + + @Override + public JRExpression getSeriesExpression() + { + return parent.getSeriesExpression(); + } + + @Override + public JRExpression getCategoryExpression() + { + return parent.getCategoryExpression(); + } + + @Override + public JRExpression getValueExpression() + { + return parent.getValueExpression(); + } + + @Override + public JRExpression getLabelExpression() + { + return parent.getLabelExpression(); + } + + + /** + * + */ + public Comparable getSeries() + { + return series; + } + + /** + * + */ + public Comparable getCategory() + { + return category; + } + + /** + * + */ + public Number getValue() + { + return value; + } + + /** + * + */ + public String getLabel() + { + return label; + } + + public JRPrintHyperlink getPrintItemHyperlink() + { + return itemHyperlink; + } + + + /** + * + */ + public void evaluate(JRCalculator calculator) throws JRExpressionEvalException + { + series = (Comparable)calculator.evaluate(getSeriesExpression()); + category = (Comparable)calculator.evaluate(getCategoryExpression()); + value = (Number)calculator.evaluate(getValueExpression()); + label = (String)calculator.evaluate(getLabelExpression()); + + if (hasItemHyperlinks()) + { + evaluateItemHyperlink(calculator); + } + } + + + public void evaluateItemHyperlink(JRCalculator calculator) throws JRExpressionEvalException + { + try + { + itemHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getItemHyperlink(), calculator, JRExpression.EVALUATION_DEFAULT); + } + catch (JRExpressionEvalException e) + { + throw e; + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + + public boolean hasItemHyperlinks() + { + return !JRHyperlinkHelper.isEmpty(getItemHyperlink()); + } + + + @Override + public JRHyperlink getItemHyperlink() + { + return parent.getItemHyperlink(); + } + + @Override + public Object clone() + { + throw new UnsupportedOperationException(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillChartAxis.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillChartAxis.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillChartAxis.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillChartAxis.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,95 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import net.sf.jasperreports.charts.JRChartAxis; +import net.sf.jasperreports.charts.type.AxisPositionEnum; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.fill.JRFillChart; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * Describes an axis that can be added to a multiple axis chart. The name + * "axis" is a bit of a misnomer, as it really contains information about + * a new dataset to plot, the axis to plot it against, and how to render that + * dataset. + * + * @author Barry Klawans (barry@users.sourceforge.net) + */ +public class JRFillChartAxis implements JRChartAxis +{ + + protected JRChartAxis parent; + + /** + * The filled version of the chart field. Contains evaluated + * expressions and data. + */ + protected JRFillChart fillChart; + + + public JRFillChartAxis(JRChartAxis axis, JRFillObjectFactory factory) + { + factory.put(axis, this); + + this.parent = axis; + this.fillChart = (JRFillChart)factory.getVisitResult(axis.getChart()); + } + + /** + * Return the filled version of the chart with the dataset and plot for + * this axis. + * + * @return the filled version of the chart with the dataset and plot for + * this axis + */ + public JRFillChart getFillChart() + { + return fillChart; + } + + @Override + public JRChart getChart() + { + return parent.getChart(); + } + + @Override + public AxisPositionEnum getPositionValue() + { + return parent.getPositionValue(); + } + + @Override + public Object clone() + { + throw new UnsupportedOperationException(); + } + + @Override + public JRChartAxis clone(JRChart parentChart) + { + throw new UnsupportedOperationException(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillDataRange.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillDataRange.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillDataRange.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillDataRange.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import net.sf.jasperreports.charts.JRDataRange; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRFillDataRange implements JRDataRange +{ + protected JRDataRange parent; + + /** + * + */ + public JRFillDataRange(JRDataRange dataRange, JRFillObjectFactory factory) + { + factory.put(dataRange, this); + parent = dataRange; + } + + @Override + public JRExpression getLowExpression() + { + return parent.getLowExpression(); + } + + @Override + public JRExpression getHighExpression() + { + return parent.getHighExpression(); + } + + @Override + public Object clone() + { + throw new UnsupportedOperationException(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillGanttDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillGanttDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillGanttDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillGanttDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,274 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.charts.JRGanttDataset; +import net.sf.jasperreports.charts.JRGanttSeries; +import net.sf.jasperreports.charts.util.CategoryLabelGenerator; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillChartDataset; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; +import net.sf.jasperreports.engine.util.Pair; + +import org.jfree.data.gantt.Task; +import org.jfree.data.gantt.TaskSeries; +import org.jfree.data.gantt.TaskSeriesCollection; +import org.jfree.data.general.Dataset; +import org.jfree.data.time.SimpleTimePeriod; + +/** + * @author Peter Risko (peter@risko.hu) + */ +public class JRFillGanttDataset extends JRFillChartDataset implements JRGanttDataset { + + /** + * + */ + protected JRFillGanttSeries[] ganttSeries; + + private List> seriesNames; + private Map, TaskSeries> seriesMap; + private Map, Map, String>> labelsMap; + + private Map, Map> itemHyperlinks; + + + /** + * + */ + public JRFillGanttDataset( + JRGanttDataset ganttDataset, + JRFillObjectFactory factory + ) + { + super(ganttDataset, factory); + + /* */ + JRGanttSeries[] srcGanttSeries = ganttDataset.getSeries(); + if (srcGanttSeries != null && srcGanttSeries.length > 0) + { + ganttSeries = new JRFillGanttSeries[srcGanttSeries.length]; + for(int i = 0; i < ganttSeries.length; i++) + { + ganttSeries[i] = (JRFillGanttSeries)factory.getGanttSeries(srcGanttSeries[i]); + } + } + } + + + @Override + public JRGanttSeries[] getSeries() + { + return ganttSeries; + } + + + @Override + protected void customInitialize() + { + seriesNames = null; + seriesMap = null; + labelsMap = null; + itemHyperlinks = null; + } + + + @Override + protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException + { + if (ganttSeries != null && ganttSeries.length > 0) + { + for(int i = 0; i < ganttSeries.length; i++) + { + ganttSeries[i].evaluate(calculator); + } + } + } + + + @Override + protected void customIncrement() + { + if (ganttSeries != null && ganttSeries.length > 0) + { + if (seriesNames == null) + { + seriesNames = new ArrayList>(); + seriesMap = new HashMap, TaskSeries>(); + labelsMap = new HashMap, Map, String>>(); + itemHyperlinks = new HashMap, Map>(); + } + + for(int i = 0; i < ganttSeries.length; i++) + { + JRFillGanttSeries crtGanttSeries = ganttSeries[i]; + + Comparable seriesName = crtGanttSeries.getSeries(); + TaskSeries taskSrs = seriesMap.get(seriesName); + if (taskSrs == null) + { + taskSrs = new TaskSeries((String)seriesName); + seriesNames.add(seriesName); + seriesMap.put(seriesName, taskSrs); + } + + // create task + Task task = taskSrs.get(crtGanttSeries.getTask()); + if(task == null) { + task = new Task(crtGanttSeries.getTask(), + crtGanttSeries.getStartDate(), + crtGanttSeries.getEndDate()); + taskSrs.add(task); + } + // create subtask + Task subtask = new Task(crtGanttSeries.getSubtask(), + crtGanttSeries.getStartDate(), + crtGanttSeries.getEndDate()); + // NOTE: For correct scaling/plotting JFreeChart needs the subtasks + // to be 'inside' of the containing task. + // Therefore the earliest subtask startvalue + // is set as startvalue for the whole task, and the + // latest subtask endvalue set as endvalue for the + // whole task. + if(subtask.getDuration().getStart().before(task.getDuration().getStart())) { + task.setDuration(new SimpleTimePeriod(subtask.getDuration().getStart(), task.getDuration().getEnd())); + } + if(subtask.getDuration().getEnd().after(task.getDuration().getEnd())) { + task.setDuration(new SimpleTimePeriod(task.getDuration().getStart(), subtask.getDuration().getEnd())); + } + Number percent = crtGanttSeries.getPercent(); + if (percent != null) + { + subtask.setPercentComplete(percent.doubleValue()); + } + task.addSubtask(subtask); + + if (crtGanttSeries.getLabelExpression() != null) + { + Map, String> seriesLabels = labelsMap.get(seriesName); + if (seriesLabels == null) + { + seriesLabels = new HashMap, String>(); + labelsMap.put(seriesName, seriesLabels); + } + + // TODO: is it OK like this? + //seriesLabels.put(crtXySeries.getXValue(), crtXySeries.getLabel()); + seriesLabels.put(crtGanttSeries.getTask(), crtGanttSeries.getLabel()); + } + + if (crtGanttSeries.hasItemHyperlinks()) + { + Map seriesLinks = itemHyperlinks.get(seriesName); + if (seriesLinks == null) + { + seriesLinks = new HashMap(); + itemHyperlinks.put(seriesName, seriesLinks); + } + // TODO: ?? not sure how to do + //Pair xyKey = new Pair(crtXySeries.getXValue(), crtXySeries.getYValue()); + //seriesLinks.put(xyKey, crtXySeries.getPrintItemHyperlink()); + Pair taskSubtaskKey = new Pair(crtGanttSeries.getTask(), crtGanttSeries.getSubtask()); + seriesLinks.put(taskSubtaskKey, crtGanttSeries.getPrintItemHyperlink()); + } + } + } + } + + + @Override + public Dataset getCustomDataset() + { + TaskSeriesCollection dataset = new TaskSeriesCollection(); + if (seriesNames != null) + { + for(int i = 0; i < seriesNames.size(); i++) + { + Comparable seriesName = seriesNames.get(i); + dataset.add(seriesMap.get(seriesName)); + } + } + return dataset; + } + + + @Override + public byte getDatasetType() { + return JRChartDataset.GANTT_DATASET; + } + + + @Override + public Object getLabelGenerator(){ + return new CategoryLabelGenerator(labelsMap, getLocale()); + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + public Map, Map> getItemHyperlinks() + { + return itemHyperlinks; + } + + + public boolean hasItemHyperlinks() + { + boolean foundLinks = false; + if (ganttSeries != null && ganttSeries.length > 0) + { + for (int i = 0; i < ganttSeries.length && !foundLinks; i++) + { + JRFillGanttSeries series = ganttSeries[i]; + foundLinks = series.hasItemHyperlinks(); + } + } + return foundLinks; + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillGanttSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillGanttSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillGanttSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillGanttSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,219 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.util.Date; + +import net.sf.jasperreports.charts.JRGanttSeries; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author Peter Risko (peter@risko.hu) + */ +public class JRFillGanttSeries implements JRGanttSeries { + + /** + * + */ + protected JRGanttSeries parent; + + private Comparable series; + private String task; + private String subtask; + private Date startDate; + private Date endDate; + private Number percent; + private String label; + private JRPrintHyperlink itemHyperlink; + + + /** + * + */ + public JRFillGanttSeries( + JRGanttSeries ganttSeries, + JRFillObjectFactory factory + ) + { + factory.put(ganttSeries, this); + + parent = ganttSeries; + } + + + @Override + public JRExpression getSeriesExpression() + { + return parent.getSeriesExpression(); + } + + @Override + public JRExpression getStartDateExpression(){ + return parent.getStartDateExpression(); + } + + @Override + public JRExpression getEndDateExpression(){ + return parent.getEndDateExpression(); + } + + @Override + public JRExpression getTaskExpression() + { + return parent.getTaskExpression(); + } + + @Override + public JRExpression getSubtaskExpression() + { + return parent.getSubtaskExpression(); + } + + @Override + public JRExpression getPercentExpression() + { + return parent.getPercentExpression(); + } + + @Override + public JRExpression getLabelExpression() + { + return parent.getLabelExpression(); + } + + + /** + * + */ + protected Comparable getSeries() + { + return series; + } + + protected Date getStartDate(){ + return startDate; + } + + protected Date getEndDate(){ + return endDate; + } + + /** + * + */ + protected String getTask() + { + return task; + } + + /** + * + */ + protected String getSubtask() + { + return subtask; + } + + /** + * + */ + protected Number getPercent() + { + return percent; + } + + /** + * + */ + protected String getLabel() + { + return label; + } + + protected JRPrintHyperlink getPrintItemHyperlink() + { + return itemHyperlink; + } + + + /** + * + */ + protected void evaluate(JRCalculator calculator) throws JRExpressionEvalException + { + series = (Comparable)calculator.evaluate(getSeriesExpression()); + startDate = (Date)calculator.evaluate( getStartDateExpression() ); + endDate = (Date)calculator.evaluate( getEndDateExpression() ); + task = (String)calculator.evaluate(getTaskExpression()); + subtask = (String)calculator.evaluate(getSubtaskExpression()); + percent = (Number)calculator.evaluate(getPercentExpression()); + label = (String)calculator.evaluate(getLabelExpression()); + + if (hasItemHyperlinks()) + { + evaluateItemHyperlink(calculator); + } + } + + + protected void evaluateItemHyperlink(JRCalculator calculator) throws JRExpressionEvalException + { + try + { + itemHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getItemHyperlink(), calculator, JRExpression.EVALUATION_DEFAULT); + } + catch (JRExpressionEvalException e) + { + throw e; + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + + @Override + public JRHyperlink getItemHyperlink() + { + return parent.getItemHyperlink(); + } + + + public boolean hasItemHyperlinks() + { + return getItemHyperlink() != null; + } + + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillHighLowDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillHighLowDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillHighLowDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillHighLowDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,374 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import net.sf.jasperreports.charts.JRHighLowDataset; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRHyperlinkHelper; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillChartDataset; +import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +import org.jfree.data.general.Dataset; +import org.jfree.data.xy.DefaultHighLowDataset; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRFillHighLowDataset extends JRFillChartDataset implements JRHighLowDataset +{ + public static final String EXCEPTION_MESSAGE_KEY_SERIES_NULL_CLOSE_VALUE = "charts.high.low.dataset.series.null.close.value"; + public static final String EXCEPTION_MESSAGE_KEY_SERIES_NULL_DATE_VALUE = "charts.high.low.dataset.series.null.date.value"; + public static final String EXCEPTION_MESSAGE_KEY_SERIES_NULL_HIGH_VALUE = "charts.high.low.dataset.series.null.high.value"; + public static final String EXCEPTION_MESSAGE_KEY_SERIES_NULL_LOW_VALUE = "charts.high.low.dataset.series.null.low.value"; + public static final String EXCEPTION_MESSAGE_KEY_SERIES_NULL_OPEN_VALUE = "charts.high.low.dataset.series.null.open.value"; + public static final String EXCEPTION_MESSAGE_KEY_SERIES_NULL_VOLUME_VALUE = "charts.high.low.dataset.series.null.volume.value"; + + /** + * + */ + private String series; + private List elements = new ArrayList(); + private Date date; + private Number high; + private Number low; + private Number open; + private Number close; + private Number volume; + + private JRPrintHyperlink itemHyperlink; + private List itemHyperlinks; + + + /** + * + */ + public JRFillHighLowDataset(JRHighLowDataset dataset, JRFillObjectFactory factory) + { + super(dataset, factory); + } + + + @Override + protected void customInitialize() + { + elements = new ArrayList(); + itemHyperlinks = new ArrayList(); + } + + + @Override + protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException + { + series = (String) calculator.evaluate(getSeriesExpression()); + date = (Date) calculator.evaluate(getDateExpression()); + high = (Number) calculator.evaluate(getHighExpression()); + low = (Number) calculator.evaluate(getLowExpression()); + open = (Number) calculator.evaluate(getOpenExpression()); + close = (Number) calculator.evaluate(getCloseExpression()); + volume = (Number) calculator.evaluate(getVolumeExpression()); + + if (hasItemHyperlink()) + { + evaluateSectionHyperlink(calculator); + } + } + + + protected void evaluateSectionHyperlink(JRCalculator calculator) throws JRExpressionEvalException + { + try + { + itemHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getItemHyperlink(), calculator, JRExpression.EVALUATION_DEFAULT); + } + catch (JRExpressionEvalException e) + { + throw e; + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + + @Override + protected void customIncrement() + { + elements.add(new HighLowElement(date, high, low, open, close, volume)); + + if (hasItemHyperlink()) + { + itemHyperlinks.add(itemHyperlink); + } + } + + + @Override + public Dataset getCustomDataset() + { + int size = elements.size(); + if (size > 0) + { + Date[] dateArray = new Date[size]; + double[] highArray = new double[size]; + double[] lowArray = new double[size]; + double[] openArray = new double[size]; + double[] closeArray = new double[size]; + double[] volumeArray = new double[size]; + + for (int i = 0; i < elements.size(); i++) { + HighLowElement bean = elements.get(i); + dateArray[i] = new Date(bean.getDate().getTime()); + highArray[i] = bean.getHigh().doubleValue(); + lowArray[i] = bean.getLow().doubleValue(); + openArray[i] = bean.getOpen().doubleValue(); + closeArray[i] = bean.getClose().doubleValue(); + volumeArray[i] = bean.getVolume().doubleValue(); + } + + return new DefaultHighLowDataset(series, dateArray, highArray, lowArray, openArray, closeArray, volumeArray); + } + + return null; + } + + + @Override + public Object getLabelGenerator() + { + return null; + } + + + @Override + public JRExpression getSeriesExpression() + { + return ((JRHighLowDataset)parent).getSeriesExpression(); + } + + + @Override + public JRExpression getDateExpression() + { + return ((JRHighLowDataset)parent).getDateExpression(); + } + + + @Override + public JRExpression getHighExpression() + { + return ((JRHighLowDataset)parent).getHighExpression(); + } + + + @Override + public JRExpression getLowExpression() + { + return ((JRHighLowDataset)parent).getLowExpression(); + } + + + @Override + public JRExpression getOpenExpression() + { + return ((JRHighLowDataset)parent).getOpenExpression(); + } + + + @Override + public JRExpression getCloseExpression() + { + return ((JRHighLowDataset)parent).getCloseExpression(); + } + + + @Override + public JRExpression getVolumeExpression() + { + return ((JRHighLowDataset)parent).getVolumeExpression(); + } + + /** + * + */ + private static class HighLowElement + { + Date date; + Number high; + Number low; + Number open; + Number close; + Number volume; + + + public HighLowElement( + Date date, + Number high, + Number low, + Number open, + Number close, + Number volume + ) + { + if (date == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_SERIES_NULL_DATE_VALUE, + (Object[])null); + } + this.date = date; + + if (high == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_SERIES_NULL_HIGH_VALUE, + (Object[])null); + } + this.high = high; + + if (low == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_SERIES_NULL_LOW_VALUE, + (Object[])null); + } + this.low = low; + + if (open == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_SERIES_NULL_OPEN_VALUE, + (Object[])null); + } + this.open = open; + + if (close == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_SERIES_NULL_CLOSE_VALUE, + (Object[])null); + } + this.close = close; + + if (volume == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_SERIES_NULL_VOLUME_VALUE, + (Object[])null); + } + this.volume = volume; + } + + + public Date getDate() + { + return date; + } + + public Number getHigh() + { + return high; + } + + public Number getLow() + { + return low; + } + + public Number getOpen() + { + return open; + } + + public Number getClose() + { + return close; + } + + public Number getVolume() + { + return volume; + } + } + + @Override + public byte getDatasetType() { + return JRChartDataset.HIGHLOW_DATASET; + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + @Override + public JRHyperlink getItemHyperlink() + { + return ((JRHighLowDataset) parent).getItemHyperlink(); + } + + + public boolean hasItemHyperlink() + { + return !JRHyperlinkHelper.isEmpty(getItemHyperlink()); + } + + + public List getItemHyperlinks() + { + return itemHyperlinks; + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillHighLowPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillHighLowPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillHighLowPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillHighLowPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,289 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRHighLowPlot; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.fill.JRFillChartPlot; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRFillHighLowPlot extends JRFillChartPlot implements JRHighLowPlot +{ + + /** + * + */ + protected JRFont timeAxisLabelFont; + protected Color timeAxisLabelColor; + protected JRFont timeAxisTickLabelFont; + protected Color timeAxisTickLabelColor; + protected Color timeAxisLineColor; + + protected JRFont valueAxisLabelFont; + protected Color valueAxisLabelColor; + protected JRFont valueAxisTickLabelFont; + protected Color valueAxisTickLabelColor; + protected Color valueAxisLineColor; + + + /** + * + */ + public JRFillHighLowPlot( + JRHighLowPlot highLowPlot, + JRFillObjectFactory factory + ) + { + super(highLowPlot, factory); + + timeAxisLabelFont = factory.getFont(highLowPlot.getChart(), highLowPlot.getTimeAxisLabelFont()); + timeAxisLabelColor = highLowPlot.getOwnTimeAxisLabelColor(); + timeAxisTickLabelFont = factory.getFont(highLowPlot.getChart(), highLowPlot.getTimeAxisTickLabelFont()); + timeAxisTickLabelColor = highLowPlot.getOwnTimeAxisTickLabelColor(); + timeAxisLineColor = highLowPlot.getOwnTimeAxisLineColor(); + + valueAxisLabelFont = factory.getFont(highLowPlot.getChart(), highLowPlot.getValueAxisLabelFont()); + valueAxisLabelColor = highLowPlot.getOwnValueAxisLabelColor(); + valueAxisTickLabelFont = factory.getFont(highLowPlot.getChart(), highLowPlot.getValueAxisTickLabelFont()); + valueAxisTickLabelColor = highLowPlot.getOwnValueAxisTickLabelColor(); + valueAxisLineColor = highLowPlot.getOwnValueAxisTickLabelColor(); + } + + @Override + public JRExpression getTimeAxisLabelExpression() + { + return ((JRHighLowPlot)parent).getTimeAxisLabelExpression(); + } + + @Override + public JRFont getTimeAxisLabelFont() + { + return timeAxisLabelFont; + } + + @Override + public Color getTimeAxisLabelColor() + { + return getStyleResolver().getTimeAxisLabelColor(this, this); + } + + @Override + public Color getOwnTimeAxisLabelColor() + { + return timeAxisLabelColor; + } + + /** + * + */ + public void setTimeAxisLabelColor(Color color) + { + } + + @Override + public JRFont getTimeAxisTickLabelFont() + { + return timeAxisTickLabelFont; + } + + @Override + public Color getTimeAxisTickLabelColor() + { + return getStyleResolver().getTimeAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnTimeAxisTickLabelColor() + { + return timeAxisTickLabelColor; + } + + /** + * + */ + public void setTimeAxisTickLabelColor(Color color) + { + } + + @Override + public String getTimeAxisTickLabelMask() + { + return ((JRHighLowPlot)parent).getTimeAxisTickLabelMask(); + } + + @Override + public Boolean getTimeAxisVerticalTickLabels() + { + return ((JRHighLowPlot)parent).getTimeAxisVerticalTickLabels(); + } + + @Override + public Color getTimeAxisLineColor() + { + return getStyleResolver().getTimeAxisLineColor(this, this); + } + + @Override + public Color getOwnTimeAxisLineColor() + { + return timeAxisLineColor; + } + + /** + * + */ + public void setTimeAxisLineColor(Color color) + { + } + + @Override + public JRExpression getValueAxisLabelExpression() + { + return ((JRHighLowPlot)parent).getValueAxisLabelExpression(); + } + + @Override + public JRExpression getDomainAxisMinValueExpression() + { + return ((JRHighLowPlot)parent).getDomainAxisMinValueExpression(); + } + + @Override + public JRExpression getDomainAxisMaxValueExpression() + { + return ((JRHighLowPlot)parent).getDomainAxisMaxValueExpression(); + } + + @Override + public JRExpression getRangeAxisMinValueExpression() + { + return ((JRHighLowPlot)parent).getRangeAxisMinValueExpression(); + } + + @Override + public JRExpression getRangeAxisMaxValueExpression() + { + return ((JRHighLowPlot)parent).getRangeAxisMaxValueExpression(); + } + + @Override + public JRFont getValueAxisLabelFont() + { + return valueAxisLabelFont; + } + + @Override + public Color getValueAxisLabelColor() + { + return getStyleResolver().getValueAxisLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisLabelColor() + { + return valueAxisLabelColor; + } + + /** + * + */ + public void setValueAxisLabelColor(Color color) + { + } + + @Override + public JRFont getValueAxisTickLabelFont() + { + return valueAxisTickLabelFont; + } + + @Override + public Color getValueAxisTickLabelColor() + { + return getStyleResolver().getValueAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisTickLabelColor() + { + return valueAxisTickLabelColor; + } + + /** + * + */ + public void setValueAxisTickLabelColor(Color color) + { + } + + @Override + public String getValueAxisTickLabelMask() + { + return ((JRHighLowPlot)parent).getValueAxisTickLabelMask(); + } + + @Override + public Boolean getValueAxisVerticalTickLabels() + { + return ((JRHighLowPlot)parent).getValueAxisVerticalTickLabels(); + } + + @Override + public Color getValueAxisLineColor() + { + return getStyleResolver().getValueAxisLineColor(this, this); + } + + @Override + public Color getOwnValueAxisLineColor() + { + return valueAxisLineColor; + } + + /** + * + */ + public void setValueAxisLineColor(Color color) + { + } + + @Override + public Boolean getShowOpenTicks() + { + return ((JRHighLowPlot)parent).getShowOpenTicks(); + } + + @Override + public Boolean getShowCloseTicks() + { + return ((JRHighLowPlot)parent).getShowCloseTicks(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillItemLabel.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillItemLabel.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillItemLabel.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillItemLabel.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,103 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class JRFillItemLabel implements JRItemLabel +{ + + /** + * + */ + protected JRItemLabel parent; + + /** + * + */ + protected JRChart chart; + + /** + * + */ + public JRFillItemLabel(JRItemLabel itemLabel, JRFillObjectFactory factory) + { + factory.put(itemLabel, this); + + parent = itemLabel; + + chart = (JRChart)factory.getVisitResult(itemLabel.getChart()); + } + + @Override + public JRChart getChart() + { + return chart; + } + + @Override + public Color getColor() + { + return parent.getColor(); + } + + @Override + public Color getBackgroundColor() + { + return parent.getBackgroundColor(); + } + + /** + * + */ +// public String getMask(){ +// return parent.getMask(); +// } + + @Override + public JRFont getFont() + { + return parent.getFont(); + } + + @Override + public Object clone() + { + throw new UnsupportedOperationException(); + } + + @Override + public JRItemLabel clone(JRChart parentChart) + { + throw new UnsupportedOperationException(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillLinePlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillLinePlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillLinePlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillLinePlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,303 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRLinePlot; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.fill.JRFillChartPlot; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRFillLinePlot extends JRFillChartPlot implements JRLinePlot +{ + + /** + * + */ + protected JRFont categoryAxisLabelFont; + protected Color categoryAxisLabelColor; + protected JRFont categoryAxisTickLabelFont; + protected Color categoryAxisTickLabelColor; + protected Color categoryAxisLineColor; + + protected JRFont valueAxisLabelFont; + protected Color valueAxisLabelColor; + protected JRFont valueAxisTickLabelFont; + protected Color valueAxisTickLabelColor; + protected Color valueAxisLineColor; + + + /** + * + */ + public JRFillLinePlot( JRLinePlot plot, JRFillObjectFactory factory ) + { + super( plot, factory ); + + categoryAxisLabelFont = factory.getFont(plot.getChart(), plot.getCategoryAxisLabelFont()); + categoryAxisLabelColor = plot.getOwnCategoryAxisLabelColor(); + categoryAxisTickLabelFont = factory.getFont(plot.getChart(), plot.getCategoryAxisTickLabelFont()); + categoryAxisTickLabelColor = plot.getOwnCategoryAxisTickLabelColor(); + categoryAxisLineColor = plot.getOwnCategoryAxisLineColor(); + + valueAxisLabelFont = factory.getFont(plot.getChart(), plot.getValueAxisLabelFont()); + valueAxisLabelColor = plot.getOwnValueAxisLabelColor(); + valueAxisTickLabelFont = factory.getFont(plot.getChart(), plot.getValueAxisTickLabelFont()); + valueAxisTickLabelColor = plot.getOwnValueAxisTickLabelColor(); + valueAxisLineColor = plot.getOwnValueAxisLineColor(); + } + + @Override + public JRExpression getCategoryAxisLabelExpression() + { + return ((JRLinePlot)parent).getCategoryAxisLabelExpression(); + } + + @Override + public JRFont getCategoryAxisLabelFont() + { + return categoryAxisLabelFont; + } + + @Override + public Color getCategoryAxisLabelColor() + { + return getStyleResolver().getCategoryAxisLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLabelColor() + { + return categoryAxisLabelColor; + } + + /** + * + */ + public void setCategoryAxisLabelColor(Color color) + { + } + + @Override + public JRFont getCategoryAxisTickLabelFont() + { + return categoryAxisTickLabelFont; + } + + @Override + public Color getCategoryAxisTickLabelColor() + { + return getStyleResolver().getCategoryAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnCategoryAxisTickLabelColor() + { + return categoryAxisTickLabelColor; + } + + /** + * + */ + public void setCategoryAxisTickLabelColor(Color color) + { + } + + @Override + public String getCategoryAxisTickLabelMask() + { + return ((JRLinePlot)parent).getCategoryAxisTickLabelMask(); + } + + @Override + public Boolean getCategoryAxisVerticalTickLabels() + { + return ((JRLinePlot)parent).getCategoryAxisVerticalTickLabels(); + } + + @Override + public Double getCategoryAxisTickLabelRotation() + { + return ((JRLinePlot)parent).getCategoryAxisTickLabelRotation(); + } + + @Override + public void setCategoryAxisTickLabelRotation(Double labelRotation) + { + } + + @Override + public Color getCategoryAxisLineColor() + { + return getStyleResolver().getCategoryAxisLineColor(this, this); + } + + @Override + public Color getOwnCategoryAxisLineColor() + { + return categoryAxisLineColor; + } + + /** + * + */ + public void setCategoryAxisLineColor(Color color) + { + } + + @Override + public JRExpression getValueAxisLabelExpression() + { + return ((JRLinePlot)parent).getValueAxisLabelExpression(); + } + + @Override + public JRExpression getDomainAxisMinValueExpression() + { + return ((JRLinePlot)parent).getDomainAxisMinValueExpression(); + } + + @Override + public JRExpression getDomainAxisMaxValueExpression() + { + return ((JRLinePlot)parent).getDomainAxisMaxValueExpression(); + } + + @Override + public JRExpression getRangeAxisMinValueExpression() + { + return ((JRLinePlot)parent).getRangeAxisMinValueExpression(); + } + + @Override + public JRExpression getRangeAxisMaxValueExpression() + { + return ((JRLinePlot)parent).getRangeAxisMaxValueExpression(); + } + + @Override + public JRFont getValueAxisLabelFont() + { + return valueAxisLabelFont; + } + + @Override + public Color getValueAxisLabelColor() + { + return getStyleResolver().getValueAxisLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisLabelColor() + { + return valueAxisLabelColor; + } + + /** + * + */ + public void setValueAxisLabelColor(Color color) + { + } + + @Override + public JRFont getValueAxisTickLabelFont() + { + return valueAxisTickLabelFont; + } + + @Override + public Color getValueAxisTickLabelColor() + { + return getStyleResolver().getValueAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisTickLabelColor() + { + return valueAxisTickLabelColor; + } + + /** + * + */ + public void setValueAxisTickLabelColor(Color color) + { + } + + @Override + public String getValueAxisTickLabelMask() + { + return ((JRLinePlot)parent).getValueAxisTickLabelMask(); + } + + @Override + public Boolean getValueAxisVerticalTickLabels() + { + return ((JRLinePlot)parent).getValueAxisVerticalTickLabels(); + } + + @Override + public Color getValueAxisLineColor() + { + return getStyleResolver().getValueAxisLineColor(this, this); + } + + @Override + public Color getOwnValueAxisLineColor() + { + return valueAxisLineColor; + } + + /** + * + */ + public void setValueAxisLineColor(Color color) + { + } + + @Override + public Boolean getShowShapes(){ + return ((JRLinePlot)parent).getShowShapes(); + } + + @Override + public void setShowShapes( Boolean value ){ + } + + @Override + public Boolean getShowLines(){ + return ((JRLinePlot)parent).getShowLines(); + } + + @Override + public void setShowLines( Boolean value ){ + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillMeterPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillMeterPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillMeterPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillMeterPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,122 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import net.sf.jasperreports.charts.JRDataRange; +import net.sf.jasperreports.charts.JRMeterPlot; +import net.sf.jasperreports.charts.JRValueDisplay; +import net.sf.jasperreports.charts.type.MeterShapeEnum; +import net.sf.jasperreports.charts.util.JRMeterInterval; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.fill.JRFillChartPlot; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +import java.awt.Color; +import java.util.List; + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRFillMeterPlot extends JRFillChartPlot implements JRMeterPlot +{ + + /** + * + */ + public JRFillMeterPlot(JRMeterPlot meterPlot, JRFillObjectFactory factory) + { + super(meterPlot, factory); + } + + @Override + public JRDataRange getDataRange() + { + return ((JRMeterPlot)parent).getDataRange(); + } + + @Override + public JRValueDisplay getValueDisplay() + { + return ((JRMeterPlot)parent).getValueDisplay(); + } + + @Override + public MeterShapeEnum getShapeValue() + { + return ((JRMeterPlot)parent).getShapeValue(); + } + + @Override + public List getIntervals(){ + return ((JRMeterPlot)parent).getIntervals(); + } + + @Override + public Integer getMeterAngleInteger() + { + return ((JRMeterPlot)parent).getMeterAngleInteger(); + } + + @Override + public String getUnits() + { + return ((JRMeterPlot)parent).getUnits(); + } + + @Override + public Double getTickIntervalDouble() + { + return ((JRMeterPlot)parent).getTickIntervalDouble(); + } + + @Override + public Color getMeterBackgroundColor() + { + return ((JRMeterPlot)parent).getMeterBackgroundColor(); + } + + @Override + public Color getNeedleColor() + { + return ((JRMeterPlot)parent).getNeedleColor(); + } + + @Override + public Color getTickColor() + { + return ((JRMeterPlot)parent).getTickColor(); + } + + @Override + public Integer getTickCount() + { + return ((JRMeterPlot)parent).getTickCount(); + } + + @Override + public JRFont getTickLabelFont() + { + return ((JRMeterPlot)parent).getTickLabelFont(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillMultiAxisPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillMultiAxisPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillMultiAxisPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillMultiAxisPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,80 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import net.sf.jasperreports.charts.JRChartAxis; +import net.sf.jasperreports.charts.JRMultiAxisPlot; +import net.sf.jasperreports.engine.fill.JRFillBand; +import net.sf.jasperreports.engine.fill.JRFillChartDataset; +import net.sf.jasperreports.engine.fill.JRFillChartPlot; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRFillMultiAxisPlot extends JRFillChartPlot implements JRMultiAxisPlot +{ + + private List axes; + + public JRFillMultiAxisPlot(JRMultiAxisPlot multiAxisPlot, JRFillObjectFactory factory) + { + super(multiAxisPlot, factory); + + List parentAxes = multiAxisPlot.getAxes(); + this.axes = new ArrayList(parentAxes.size()); + Iterator iter = parentAxes.iterator(); + while (iter.hasNext()) + { + JRChartAxis axis = iter.next(); + this.axes.add(factory.getChartAxis(axis)); + } + } + + @Override + protected void setBand(JRFillBand band) + { + super.setBand(band); + + for (JRChartAxis axis : axes) + { + ((JRFillChartAxis) axis).fillChart.setBand(band); + } + } + + @Override + public List getAxes() + { + return axes; + } + + public JRFillChartDataset getMainDataset() + { + return (JRFillChartDataset) ((JRFillChartAxis) axes.get(0)).getFillChart().getDataset(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPie3DPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPie3DPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPie3DPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPie3DPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.charts.JRPie3DPlot; +import net.sf.jasperreports.engine.fill.JRFillChartPlot; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRFillPie3DPlot extends JRFillChartPlot implements JRPie3DPlot +{ + + + /** + * + */ + public JRFillPie3DPlot( + JRPie3DPlot pie3DPlot, + JRFillObjectFactory factory + ) + { + super(pie3DPlot, factory); + } + + + @Override + public Double getDepthFactorDouble() + { + return ((JRPie3DPlot)parent).getDepthFactorDouble(); + } + + @Override + public Boolean getCircular() + { + return ((JRPie3DPlot)parent).getCircular(); + } + + @Override + public String getLabelFormat() + { + return ((JRPie3DPlot)parent).getLabelFormat(); + } + + @Override + public String getLegendLabelFormat() + { + return ((JRPie3DPlot)parent).getLegendLabelFormat(); + } + + @Override + public JRItemLabel getItemLabel() + { + return ((JRPie3DPlot)parent).getItemLabel(); + } + + @Override + public Boolean getShowLabels() + { + return ((JRPie3DPlot)parent).getShowLabels(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPieDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPieDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPieDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPieDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,359 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.charts.JRPieDataset; +import net.sf.jasperreports.charts.JRPieSeries; +import net.sf.jasperreports.charts.util.PieLabelGenerator; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRHyperlinkHelper; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillChartDataset; +import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +import org.jfree.data.general.Dataset; +import org.jfree.data.general.DefaultPieDataset; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRFillPieDataset extends JRFillChartDataset implements JRPieDataset +{ + /** + * + */ + public static final String EXCEPTION_MESSAGE_KEY_DUPLICATED_KEY = "charts.pie.dataset.duplicated.key"; + public static final String EXCEPTION_MESSAGE_KEY_NULL_KEY = "charts.pie.dataset.null.key"; + + /** + * + */ + protected JRFillPieSeries[] pieSeries; + + /** + * + */ + private Map, Number> values; + private Map, String> labels; + private Map, JRPrintHyperlink> sectionHyperlinks; + private boolean ignoreDuplicatedKey = false; + + private Comparable otherKey; + private String otherLabel; + private JRPrintHyperlink otherSectionHyperlink; + + + /** + * + */ + public JRFillPieDataset( + JRPieDataset pieDataset, + JRFillObjectFactory factory + ) + { + super(pieDataset, factory); + + /* */ + JRPieSeries[] srcPieSeries = pieDataset.getSeries(); + if (srcPieSeries != null && srcPieSeries.length > 0) + { + pieSeries = new JRFillPieSeries[srcPieSeries.length]; + for(int i = 0; i < pieSeries.length; i++) + { + pieSeries[i] = (JRFillPieSeries)factory.getPieSeries(srcPieSeries[i]); + } + } + } + + + @Override + public Float getMinPercentage() + { + return ((JRPieDataset)parent).getMinPercentage(); + } + + @Override + public void setMinPercentage(Float minPercentage) + { + } + + @Override + public Integer getMaxCount() + { + return ((JRPieDataset)parent).getMaxCount(); + } + + @Override + public void setMaxCount(Integer maxCount) + { + } + + @Override + public JRPieSeries[] getSeries() + { + return pieSeries; + } + + @Override + public JRExpression getOtherKeyExpression() + { + return ((JRPieDataset)parent).getOtherKeyExpression(); + } + + @Override + public JRExpression getOtherLabelExpression() + { + return ((JRPieDataset)parent).getOtherLabelExpression(); + } + + @Override + public JRHyperlink getOtherSectionHyperlink() + { + return ((JRPieDataset) parent).getOtherSectionHyperlink(); + } + + + @Override + protected void customInitialize() + { + values = new LinkedHashMap, Number>(); + labels = new HashMap, String>(); + sectionHyperlinks = new HashMap, JRPrintHyperlink>(); + + // read property here because fill dataset is null on constructor + ignoreDuplicatedKey = + getFiller().getPropertiesUtil().getBooleanProperty( + getFillDataset(), + PROPERTY_IGNORE_DUPLICATED_KEY, + false + ); + } + + @Override + protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException + { + if (pieSeries != null && pieSeries.length > 0) + { + for(int i = 0; i < pieSeries.length; i++) + { + pieSeries[i].evaluate(calculator); + } + } + + otherKey = (String)calculator.evaluate(getOtherKeyExpression()); + otherLabel = (String)calculator.evaluate(getOtherLabelExpression()); + + if (!JRHyperlinkHelper.isEmpty(getOtherSectionHyperlink())) + { + evaluateOtherSectionHyperlink(calculator); + } + } + + + protected void evaluateOtherSectionHyperlink(JRCalculator calculator) throws JRExpressionEvalException + { + try + { + otherSectionHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getOtherSectionHyperlink(), calculator, JRExpression.EVALUATION_DEFAULT); + } + catch (JRExpressionEvalException e) + { + throw e; + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + protected void customIncrement() + { + if (pieSeries != null && pieSeries.length > 0) + { + for(int i = 0; i < pieSeries.length; i++) + { + JRFillPieSeries crtPieSeries = pieSeries[i]; + + Comparable key = crtPieSeries.getKey(); + if (key == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_NULL_KEY, + (Object[])null + ); + } + + if ( + !ignoreDuplicatedKey + && values.containsKey(key) + ) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_DUPLICATED_KEY, + new Object[]{key} + ); + } + + values.put(key, crtPieSeries.getValue()); + + if (crtPieSeries.getLabelExpression() != null) + { + labels.put(key, crtPieSeries.getLabel()); + } + + if (crtPieSeries.hasSectionHyperlinks()) + { + sectionHyperlinks.put(key, crtPieSeries.getPrintSectionHyperlink()); + } + } + } + } + + @Override + public Dataset getCustomDataset() + { + double total = 0; + List sortedValues = new ArrayList(); + for(Number nv: values.values()) + { + double dvalue = nv.doubleValue(); + total += dvalue; + sortedValues.add(dvalue); + } + Collections.sort(sortedValues); + + Double minValue = null; + if (getMinPercentage() != null && getMinPercentage().intValue() >= 0 && getMinPercentage().intValue() <= 100)//FIXMENOW why intValue? + { + minValue = new Double((getMinPercentage().doubleValue() * total) / 100); + } + if (getMaxCount() != null && getMaxCount().intValue() >= 0 && getMaxCount().intValue() <= values.size()) + { + Double minValue2 = sortedValues.get(sortedValues.size() - getMaxCount().intValue()); + minValue = minValue != null && minValue.doubleValue() > minValue2.doubleValue() ? minValue : minValue2; + } + + int otherCount = 0; + Comparable lastOtherKey = null; + Number lastOtherValue = null; + double otherTotal = 0; + + DefaultPieDataset dataset = new DefaultPieDataset(); + for(Iterator> it = values.keySet().iterator(); it.hasNext();) + { + Comparable key = it.next(); + Number value = values.get(key); + + if ( + minValue == null + || value.doubleValue() >= minValue.doubleValue() + ) + { + dataset.setValue(key, value); + } + else + { + otherCount++; + lastOtherKey = key; + lastOtherValue = value; + otherTotal += value.doubleValue(); + } + } + if (otherCount == 1) + { + dataset.setValue(lastOtherKey, lastOtherValue); + } + else if (otherCount > 1) + { + otherKey = otherKey == null ? "Other" : otherKey; + dataset.setValue(otherKey, new Double(otherTotal)); + labels.put(otherKey, otherLabel); + + if (!JRHyperlinkHelper.isEmpty(getOtherSectionHyperlink())) + { + sectionHyperlinks.put(otherKey, otherSectionHyperlink); + } + } + + return dataset; + } + + + /* (non-Javadoc) + * @see net.sf.jasperreports.engine.JRChartDataset#getDatasetType() + */ + @Override + public byte getDatasetType() { + return JRChartDataset.PIE_DATASET; + } + + + @Override + public Object getLabelGenerator()//FIXMECHART is this OK? + { + JRExpression labelExpression = (pieSeries != null && pieSeries.length > 0 ? pieSeries[0].getLabelExpression() : null); + return (labelExpression == null) ? null : new PieLabelGenerator( labels ); + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + public Map, JRPrintHyperlink> getSectionHyperlinks() + { + return sectionHyperlinks; + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPiePlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPiePlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPiePlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPiePlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,79 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import net.sf.jasperreports.charts.JRItemLabel; +import net.sf.jasperreports.charts.JRPiePlot; +import net.sf.jasperreports.engine.fill.JRFillChartPlot; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRFillPiePlot extends JRFillChartPlot implements JRPiePlot +{ + + + /** + * + */ + public JRFillPiePlot( + JRPiePlot piePlot, + JRFillObjectFactory factory + ) + { + super(piePlot, factory); + } + + @Override + public Boolean getCircular() + { + return ((JRPiePlot)parent).getCircular(); + } + + @Override + public String getLabelFormat() + { + return ((JRPiePlot)parent).getLabelFormat(); + } + + @Override + public String getLegendLabelFormat() + { + return ((JRPiePlot)parent).getLegendLabelFormat(); + } + + @Override + public JRItemLabel getItemLabel() + { + return ((JRPiePlot)parent).getItemLabel(); + } + + @Override + public Boolean getShowLabels(){ + return ((JRPiePlot)parent).getShowLabels(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPieSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPieSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPieSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillPieSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,172 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import net.sf.jasperreports.charts.JRPieSeries; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRHyperlinkHelper; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRFillPieSeries implements JRPieSeries +{ + + /** + * + */ + protected JRPieSeries parent; + + private Comparable key; + private Number value; + private String label; + private JRPrintHyperlink sectionHyperlink; + + + /** + * + */ + public JRFillPieSeries( + JRPieSeries pieSeries, + JRFillObjectFactory factory + ) + { + factory.put(pieSeries, this); + + parent = pieSeries; + } + + + @Override + public JRExpression getKeyExpression() + { + return parent.getKeyExpression(); + } + + @Override + public JRExpression getValueExpression() + { + return parent.getValueExpression(); + } + + @Override + public JRExpression getLabelExpression() + { + return parent.getLabelExpression(); + } + + + /** + * + */ + protected Comparable getKey() + { + return key; + } + + /** + * + */ + protected Number getValue() + { + return value; + } + + /** + * + */ + protected String getLabel() + { + return label; + } + + /** + * + */ + protected JRPrintHyperlink getPrintSectionHyperlink() + { + return sectionHyperlink; + } + + + /** + * + */ + protected void evaluate(JRCalculator calculator) throws JRExpressionEvalException + { + key = (Comparable)calculator.evaluate(getKeyExpression()); + value = (Number)calculator.evaluate(getValueExpression()); + label = (String)calculator.evaluate(getLabelExpression()); + + if (hasSectionHyperlinks()) + { + evaluateSectionHyperlink(calculator); + } + } + + + protected void evaluateSectionHyperlink(JRCalculator calculator) throws JRExpressionEvalException + { + try + { + sectionHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getSectionHyperlink(), calculator, JRExpression.EVALUATION_DEFAULT); + } + catch (JRExpressionEvalException e) + { + throw e; + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + + public boolean hasSectionHyperlinks() + { + return !JRHyperlinkHelper.isEmpty(getSectionHyperlink()); + } + + + @Override + public JRHyperlink getSectionHyperlink() + { + return parent.getSectionHyperlink(); + } + + @Override + public Object clone() + { + throw new UnsupportedOperationException(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillScatterPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillScatterPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillScatterPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillScatterPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,248 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRScatterPlot; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.fill.JRFillChartPlot; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRFillScatterPlot extends JRFillChartPlot implements JRScatterPlot { + + /** + * + */ + protected JRFont xAxisLabelFont; + protected Color xAxisLabelColor; + protected JRFont xAxisTickLabelFont; + protected Color xAxisTickLabelColor; + protected Color xAxisLineColor; + + protected JRFont yAxisLabelFont; + protected Color yAxisLabelColor; + protected JRFont yAxisTickLabelFont; + protected Color yAxisTickLabelColor; + protected Color yAxisLineColor; + + + /** + * + */ + public JRFillScatterPlot( JRScatterPlot plot, JRFillObjectFactory factory ){ + super( plot, factory ); + + xAxisLabelFont = factory.getFont(plot.getChart(), plot.getXAxisLabelFont()); + xAxisLabelColor = plot.getOwnXAxisLabelColor(); + xAxisTickLabelFont = factory.getFont(plot.getChart(), plot.getXAxisTickLabelFont()); + xAxisTickLabelColor = plot.getOwnXAxisTickLabelColor(); + xAxisLineColor = plot.getOwnXAxisLineColor(); + + yAxisLabelFont = factory.getFont(plot.getChart(), plot.getYAxisLabelFont()); + yAxisLabelColor = plot.getOwnYAxisLabelColor(); + yAxisTickLabelFont = factory.getFont(plot.getChart(), plot.getYAxisTickLabelFont()); + yAxisTickLabelColor = plot.getOwnYAxisTickLabelColor(); + yAxisLineColor = plot.getOwnYAxisLineColor(); + } + + @Override + public JRExpression getXAxisLabelExpression() + { + return ((JRScatterPlot)parent).getXAxisLabelExpression(); + } + + @Override + public JRFont getXAxisLabelFont() + { + return xAxisLabelFont; + } + + @Override + public Color getXAxisLabelColor() + { + return getStyleResolver().getXAxisLabelColor(this, this); + } + + @Override + public Color getOwnXAxisLabelColor() + { + return xAxisLabelColor; + } + + @Override + public JRFont getXAxisTickLabelFont() + { + return xAxisTickLabelFont; + } + + @Override + public Color getXAxisTickLabelColor() + { + return getStyleResolver().getXAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnXAxisTickLabelColor() + { + return xAxisTickLabelColor; + } + + @Override + public String getXAxisTickLabelMask() + { + return ((JRScatterPlot)parent).getXAxisTickLabelMask(); + } + + @Override + public Boolean getXAxisVerticalTickLabels() + { + return ((JRScatterPlot)parent).getXAxisVerticalTickLabels(); + } + + @Override + public Color getXAxisLineColor() + { + return getStyleResolver().getXAxisLineColor(this, this); + } + + @Override + public Color getOwnXAxisLineColor() + { + return xAxisLineColor; + } + + @Override + public JRExpression getYAxisLabelExpression() + { + return ((JRScatterPlot)parent).getYAxisLabelExpression(); + } + + @Override + public JRFont getYAxisLabelFont() + { + return yAxisLabelFont; + } + + @Override + public Color getYAxisLabelColor() + { + return getStyleResolver().getYAxisLabelColor(this, this); + } + + @Override + public Color getOwnYAxisLabelColor() + { + return yAxisLabelColor; + } + + @Override + public JRFont getYAxisTickLabelFont() + { + return yAxisTickLabelFont; + } + + @Override + public Color getYAxisTickLabelColor() + { + return getStyleResolver().getYAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnYAxisTickLabelColor() + { + return yAxisTickLabelColor; + } + + @Override + public String getYAxisTickLabelMask() + { + return ((JRScatterPlot)parent).getYAxisTickLabelMask(); + } + + @Override + public Boolean getYAxisVerticalTickLabels() + { + return ((JRScatterPlot)parent).getYAxisVerticalTickLabels(); + } + + @Override + public Color getYAxisLineColor() + { + return getStyleResolver().getYAxisLineColor(this, this); + } + + @Override + public Color getOwnYAxisLineColor() + { + return yAxisLineColor; + } + + @Override + public Boolean getShowShapes(){ + return ((JRScatterPlot)parent).getShowShapes(); + } + + @Override + public void setShowShapes( Boolean value ){ + } + + @Override + public Boolean getShowLines(){ + return ((JRScatterPlot)parent).getShowLines(); + } + + @Override + public void setShowLines( Boolean value ){ + } + + @Override + public JRExpression getDomainAxisMinValueExpression() + { + return ((JRScatterPlot)parent).getDomainAxisMinValueExpression(); + } + + @Override + public JRExpression getDomainAxisMaxValueExpression() + { + return ((JRScatterPlot)parent).getDomainAxisMaxValueExpression(); + } + + @Override + public JRExpression getRangeAxisMinValueExpression() + { + return ((JRScatterPlot)parent).getRangeAxisMinValueExpression(); + } + + @Override + public JRExpression getRangeAxisMaxValueExpression() + { + return ((JRScatterPlot)parent).getRangeAxisMaxValueExpression(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillThermometerPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillThermometerPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillThermometerPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillThermometerPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,93 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRDataRange; +import net.sf.jasperreports.charts.JRThermometerPlot; +import net.sf.jasperreports.charts.JRValueDisplay; +import net.sf.jasperreports.charts.type.ValueLocationEnum; +import net.sf.jasperreports.engine.fill.JRFillChartPlot; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRFillThermometerPlot extends JRFillChartPlot implements JRThermometerPlot +{ + + + + /** + * + */ + public JRFillThermometerPlot(JRThermometerPlot thermoPlot, JRFillObjectFactory factory) + { + super(thermoPlot, factory); + } + + + @Override + public JRDataRange getDataRange() + { + return ((JRThermometerPlot)parent).getDataRange(); + } + + @Override + public JRValueDisplay getValueDisplay() + { + return ((JRThermometerPlot)parent).getValueDisplay(); + } + + @Override + public ValueLocationEnum getValueLocationValue() + { + return ((JRThermometerPlot)parent).getValueLocationValue(); + } + + @Override + public Color getMercuryColor() + { + return ((JRThermometerPlot)parent).getMercuryColor(); + } + + @Override + public JRDataRange getLowRange() + { + return ((JRThermometerPlot)parent).getLowRange(); + } + + @Override + public JRDataRange getMediumRange() + { + return ((JRThermometerPlot)parent).getMediumRange(); + } + + @Override + public JRDataRange getHighRange() + { + return ((JRThermometerPlot)parent).getHighRange(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimePeriodDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimePeriodDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimePeriodDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimePeriodDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,250 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.charts.JRTimePeriodDataset; +import net.sf.jasperreports.charts.JRTimePeriodSeries; +import net.sf.jasperreports.charts.util.TimePeriodDatasetLabelGenerator; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillChartDataset; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +import org.jfree.data.general.Dataset; +import org.jfree.data.time.SimpleTimePeriod; +import org.jfree.data.time.TimePeriod; +import org.jfree.data.time.TimePeriodValues; +import org.jfree.data.time.TimePeriodValuesCollection; + + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRFillTimePeriodDataset extends JRFillChartDataset implements JRTimePeriodDataset +{ + + public static final String EXCEPTION_MESSAGE_KEY_SERIES_NULL_NAME = "charts.time.period.dataset.series.null.name"; + + /** + * + */ + protected JRFillTimePeriodSeries[] timePeriodSeries; + + private List> seriesNames; + private Map, TimePeriodValues> seriesMap; + private Map, Map> labelsMap; + private Map, Map> itemHyperlinks; + + + /** + * + */ + public JRFillTimePeriodDataset( + JRTimePeriodDataset timePeriodDataset, + JRFillObjectFactory factory + ) + { + super(timePeriodDataset, factory); + + JRTimePeriodSeries[] srcTimePeriodSeries = timePeriodDataset.getSeries(); + if (srcTimePeriodSeries != null && srcTimePeriodSeries.length > 0) + { + timePeriodSeries = new JRFillTimePeriodSeries[srcTimePeriodSeries.length]; + for (int i = 0; i < timePeriodSeries.length; i++) + { + timePeriodSeries[i] = + (JRFillTimePeriodSeries)factory.getTimePeriodSeries(srcTimePeriodSeries[i]); + } + } + } + + @Override + public JRTimePeriodSeries[] getSeries() + { + return timePeriodSeries; + } + + @Override + protected void customInitialize() + { + seriesNames = null; + seriesMap = null; + labelsMap = null; + itemHyperlinks = null; + } + + @Override + protected void customEvaluate(JRCalculator calculator) + throws JRExpressionEvalException + { + if (timePeriodSeries != null && timePeriodSeries.length > 0) + { + for (int i = 0; i < timePeriodSeries.length; i++) + { + timePeriodSeries[i].evaluate(calculator); + } + } + } + + @Override + protected void customIncrement() + { + if (timePeriodSeries != null && timePeriodSeries.length > 0) + { + if (seriesNames == null) + { + seriesNames = new ArrayList>(); + seriesMap = new HashMap, TimePeriodValues>(); + labelsMap = new HashMap, Map>(); + itemHyperlinks = new HashMap, Map>(); + } + + for (int i = 0; i < timePeriodSeries.length; i++) + { + JRFillTimePeriodSeries crtTimePeriodSeries = timePeriodSeries[i]; + + Comparable seriesName = crtTimePeriodSeries.getSeries(); + if (seriesName == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_SERIES_NULL_NAME, + (Object[])null + ); + } + + TimePeriodValues timePeriodValues = seriesMap.get(seriesName); + if (timePeriodValues == null) + { + timePeriodValues = new TimePeriodValues(seriesName.toString()); + seriesNames.add(seriesName); + seriesMap.put(seriesName, timePeriodValues); + } + + SimpleTimePeriod stp = + new SimpleTimePeriod( + crtTimePeriodSeries.getStartDate(), + crtTimePeriodSeries.getEndDate() + ); + + timePeriodValues.add(stp, crtTimePeriodSeries.getValue()); + + if (crtTimePeriodSeries.getLabelExpression() != null) + { + Map seriesLabels = labelsMap.get(seriesName); + if (seriesLabels == null) + { + seriesLabels = new HashMap(); + labelsMap.put(seriesName, seriesLabels); + } + + seriesLabels.put(stp, crtTimePeriodSeries.getLabel()); + } + + if (crtTimePeriodSeries.hasItemHyperlink()) + { + Map seriesLinks = itemHyperlinks.get(seriesName); + if (seriesLinks == null) + { + seriesLinks = new HashMap(); + itemHyperlinks.put(seriesName, seriesLinks); + } + + seriesLinks.put(stp, crtTimePeriodSeries.getPrintItemHyperlink()); + } + } + } + } + + @Override + public Dataset getCustomDataset() + { + TimePeriodValuesCollection dataset = new TimePeriodValuesCollection(); + if (seriesNames != null) + { + for(int i = 0; i < seriesNames.size(); i++) + { + Comparable seriesName = seriesNames.get(i); + dataset.addSeries(seriesMap.get(seriesName)); + } + } + return dataset; + } + + @Override + public byte getDatasetType() + { + return JRChartDataset.TIMEPERIOD_DATASET; + } + + @Override + public Object getLabelGenerator() + { + return new TimePeriodDatasetLabelGenerator(labelsMap, getLocale()); + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + public boolean hasItemHyperlinks() + { + boolean foundLinks = false; + if (timePeriodSeries != null && timePeriodSeries.length > 0) + { + for (int i = 0; i < timePeriodSeries.length && !foundLinks; i++) + { + foundLinks = timePeriodSeries[i].hasItemHyperlink(); + } + } + return foundLinks; + } + + + public Map, Map> getItemHyperlinks() + { + return itemHyperlinks; + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimePeriodSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimePeriodSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimePeriodSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimePeriodSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,163 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.util.Date; + +import net.sf.jasperreports.charts.JRTimePeriodSeries; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRHyperlinkHelper; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRFillTimePeriodSeries implements JRTimePeriodSeries { + + /** + * + */ + protected JRTimePeriodSeries parent; + + private Comparable series; + private Date startDate; + private Date endDate; + private Number value; + private String label; + private JRPrintHyperlink itemHyperlink; + + + public JRFillTimePeriodSeries( JRTimePeriodSeries timePeriodSeries, JRFillObjectFactory factory ){ + factory.put( timePeriodSeries, this ); + parent = timePeriodSeries; + } + + + @Override + public JRExpression getSeriesExpression(){ + return parent.getSeriesExpression(); + } + + @Override + public JRExpression getStartDateExpression(){ + return parent.getStartDateExpression(); + } + + @Override + public JRExpression getEndDateExpression(){ + return parent.getEndDateExpression(); + } + + @Override + public JRExpression getValueExpression(){ + return parent.getValueExpression(); + } + + @Override + public JRExpression getLabelExpression(){ + return parent.getLabelExpression(); + } + + protected Comparable getSeries(){ + return series; + } + + protected Date getStartDate(){ + return startDate; + } + + protected Date getEndDate(){ + return endDate; + } + + protected Number getValue(){ + return value; + } + + protected String getLabel(){ + return label; + } + + protected void evaluate( JRCalculator calculator ) throws JRExpressionEvalException { + series = (Comparable)calculator.evaluate( getSeriesExpression() ); + startDate = (Date)calculator.evaluate( getStartDateExpression() ); + endDate = (Date)calculator.evaluate( getEndDateExpression() ); + value= (Number)calculator.evaluate( getValueExpression() ); + label = (String)calculator.evaluate( getLabelExpression() ); + + if (hasItemHyperlink()) + { + evaluateItemHyperlink(calculator); + } + } + + + protected void evaluateItemHyperlink(JRCalculator calculator) throws JRExpressionEvalException + { + try + { + itemHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getItemHyperlink(), calculator, JRExpression.EVALUATION_DEFAULT); + } + catch (JRExpressionEvalException e) + { + throw e; + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + + @Override + public JRHyperlink getItemHyperlink() + { + return parent.getItemHyperlink(); + } + + + public boolean hasItemHyperlink() + { + return !JRHyperlinkHelper.isEmpty(getItemHyperlink()); + } + + + public JRPrintHyperlink getPrintItemHyperlink() + { + return itemHyperlink; + } + + + @Override + public Object clone() + { + throw new UnsupportedOperationException(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimeSeriesDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimeSeriesDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimeSeriesDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimeSeriesDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,255 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.charts.JRTimeSeries; +import net.sf.jasperreports.charts.JRTimeSeriesDataset; +import net.sf.jasperreports.charts.util.TimeSeriesLabelGenerator; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillChartDataset; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +import org.jfree.data.general.Dataset; +import org.jfree.data.time.RegularTimePeriod; +import org.jfree.data.time.TimeSeries; +import org.jfree.data.time.TimeSeriesCollection; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRFillTimeSeriesDataset extends JRFillChartDataset implements JRTimeSeriesDataset +{ + + public static final String EXCEPTION_MESSAGE_KEY_SERIES_NULL_NAME = "charts.time.series.dataset.series.null.name"; + + /** + * + */ + protected JRFillTimeSeries[] timeSeries; + + private List> seriesNames; + private Map, TimeSeries> seriesMap; + private Map, Map> labelsMap; + private Map, Map> itemHyperlinks; + + + public JRFillTimeSeriesDataset( + JRTimeSeriesDataset timeSeriesDataset, + JRFillObjectFactory factory + ) + { + super( timeSeriesDataset, factory ); + + JRTimeSeries[] srcTimeSeries = timeSeriesDataset.getSeries(); + if( srcTimeSeries != null && srcTimeSeries.length > 0) + { + timeSeries = new JRFillTimeSeries[srcTimeSeries.length]; + for (int i = 0; i < timeSeries.length; i++) + { + timeSeries[i] = (JRFillTimeSeries)factory.getTimeSeries(srcTimeSeries[i]); + } + } + } + + @Override + public JRTimeSeries[] getSeries() + { + return timeSeries; + } + + @Override + protected void customInitialize() + { + seriesNames = null; + seriesMap = null; + labelsMap = null; + itemHyperlinks = null; + } + + @Override + protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException + { + if(timeSeries != null && timeSeries.length > 0) + { + for (int i = 0; i < timeSeries.length; i++) + { + timeSeries[i].evaluate( calculator ); + } + } + } + + + @Override + protected void customIncrement() + { + if (timeSeries != null && timeSeries.length > 0) + { + if (seriesNames == null) + { + seriesNames = new ArrayList>(); + seriesMap = new HashMap, TimeSeries>(); + labelsMap = new HashMap, Map>(); + itemHyperlinks = new HashMap, Map>(); + } + + for (int i = 0; i < timeSeries.length; i++) + { + JRFillTimeSeries crtTimeSeries = timeSeries[i]; + + Comparable seriesName = crtTimeSeries.getSeries(); + if (seriesName == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_SERIES_NULL_NAME, + (Object[])null + ); + } + + TimeSeries series = seriesMap.get(seriesName); + if(series == null) + { + series = new TimeSeries(seriesName.toString(), getTimePeriod()); + seriesNames.add(seriesName); + seriesMap.put(seriesName, series); + } + + RegularTimePeriod tp = + RegularTimePeriod.createInstance( + getTimePeriod(), + crtTimeSeries.getTimePeriod(), + getTimeZone() + ); + + series.addOrUpdate(tp, crtTimeSeries.getValue()); + + if (crtTimeSeries.getLabelExpression() != null) + { + Map seriesLabels = labelsMap.get(seriesName); + if (seriesLabels == null) + { + seriesLabels = new HashMap(); + labelsMap.put(seriesName, seriesLabels); + } + + seriesLabels.put(tp, crtTimeSeries.getLabel()); + } + + if (crtTimeSeries.hasItemHyperlink()) + { + Map seriesLinks = itemHyperlinks.get(seriesName); + if (seriesLinks == null) + { + seriesLinks = new HashMap(); + itemHyperlinks.put(seriesName, seriesLinks); + } + seriesLinks.put(tp, crtTimeSeries.getPrintItemHyperlink()); + } + } + } + } + + @Override + public Dataset getCustomDataset() + { + TimeSeriesCollection dataset = new TimeSeriesCollection(getTimeZone()); + if (seriesNames != null) + { + for(int i = 0; i < seriesNames.size(); i++) + { + Comparable seriesName = seriesNames.get(i); + dataset.addSeries(seriesMap.get(seriesName)); + } + } + return dataset; + } + + + @Override + public Class getTimePeriod() { + return ((JRTimeSeriesDataset)parent).getTimePeriod(); + } + + @Override + public void setTimePeriod(Class timePeriod) { + } + + @Override + public byte getDatasetType() { + return JRChartDataset.TIMESERIES_DATASET; + } + + + @Override + public Object getLabelGenerator(){ + return new TimeSeriesLabelGenerator(labelsMap, getLocale());//FIXMETHEME this and other similar implementations should be able to return null and chart themes should be protected agains null; + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + public Map, Map> getItemHyperlinks() + { + return itemHyperlinks; + } + + + public boolean hasItemHyperlinks() + { + boolean foundLinks = false; + if (timeSeries != null && timeSeries.length > 0) + { + for (int i = 0; i < timeSeries.length && !foundLinks; i++) + { + foundLinks = timeSeries[i].hasItemHyperlink(); + } + } + return foundLinks; + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimeSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimeSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimeSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimeSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,188 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.util.Date; + +import net.sf.jasperreports.charts.JRTimeSeries; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRHyperlinkHelper; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRFillTimeSeries implements JRTimeSeries +{ + + /** + * + */ + protected JRTimeSeries parent; + + private Comparable series; + private Date timePeriod; + private Number value; + private String label; + private JRPrintHyperlink itemHyperlink; + + + /** + * + */ + public JRFillTimeSeries( + JRTimeSeries timeSeries, + JRFillObjectFactory factory + ) + { + factory.put(timeSeries, this); + + parent = timeSeries; + } + + + @Override + public JRExpression getSeriesExpression() + { + return parent.getSeriesExpression(); + } + + @Override + public JRExpression getTimePeriodExpression() + { + return parent.getTimePeriodExpression(); + } + + @Override + public JRExpression getValueExpression() + { + return parent.getValueExpression(); + } + + @Override + public JRExpression getLabelExpression() + { + return parent.getLabelExpression(); + } + + + /** + * + */ + protected Comparable getSeries() + { + return series; + } + + /** + * + */ + protected Date getTimePeriod() + { + return timePeriod; + } + + /** + * + */ + protected Number getValue() + { + return value; + } + + /** + * + */ + protected String getLabel() + { + return label; + } + + + /** + * + */ + protected void evaluate(JRCalculator calculator) throws JRExpressionEvalException + { + series = (Comparable)calculator.evaluate(getSeriesExpression()); + timePeriod = (Date)calculator.evaluate(getTimePeriodExpression()); + value = (Number)calculator.evaluate(getValueExpression()); + label = (String)calculator.evaluate(getLabelExpression()); + + if (hasItemHyperlink()) + { + evaluateItemHyperlink(calculator); + } + } + + + protected void evaluateItemHyperlink(JRCalculator calculator) throws JRExpressionEvalException + { + try + { + itemHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getItemHyperlink(), calculator, JRExpression.EVALUATION_DEFAULT); + } + catch (JRExpressionEvalException e) + { + throw e; + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + + @Override + public JRHyperlink getItemHyperlink() + { + return parent.getItemHyperlink(); + } + + + public boolean hasItemHyperlink() + { + return !JRHyperlinkHelper.isEmpty(getItemHyperlink()); + } + + + public JRPrintHyperlink getPrintItemHyperlink() + { + return itemHyperlink; + } + + @Override + public Object clone() + { + throw new UnsupportedOperationException(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimeSeriesPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimeSeriesPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimeSeriesPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillTimeSeriesPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,284 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRTimeSeriesPlot; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.fill.JRFillChartPlot; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ + +public class JRFillTimeSeriesPlot extends JRFillChartPlot implements JRTimeSeriesPlot { + + /** + * + */ + protected JRFont timeAxisLabelFont; + protected Color timeAxisLabelColor; + protected JRFont timeAxisTickLabelFont; + protected Color timeAxisTickLabelColor; + protected Color timeAxisLineColor; + + protected JRFont valueAxisLabelFont; + protected Color valueAxisLabelColor; + protected JRFont valueAxisTickLabelFont; + protected Color valueAxisTickLabelColor; + protected Color valueAxisLineColor; + + + /** + * + */ + public JRFillTimeSeriesPlot( JRTimeSeriesPlot plot, JRFillObjectFactory factory ) + { + super(plot, factory); + + timeAxisLabelFont = factory.getFont(plot.getChart(), plot.getTimeAxisLabelFont()); + timeAxisLabelColor = plot.getOwnTimeAxisLabelColor(); + timeAxisTickLabelFont = factory.getFont(plot.getChart(), plot.getTimeAxisTickLabelFont()); + timeAxisTickLabelColor = plot.getOwnTimeAxisTickLabelColor(); + timeAxisLineColor = plot.getOwnTimeAxisLineColor(); + + valueAxisLabelFont = factory.getFont(plot.getChart(), plot.getValueAxisLabelFont()); + valueAxisLabelColor = plot.getOwnValueAxisLabelColor(); + valueAxisTickLabelFont = factory.getFont(plot.getChart(), plot.getValueAxisTickLabelFont()); + valueAxisTickLabelColor = plot.getOwnValueAxisTickLabelColor(); + valueAxisLineColor = plot.getOwnValueAxisTickLabelColor(); + } + + @Override + public JRExpression getTimeAxisLabelExpression() + { + return ((JRTimeSeriesPlot)parent).getTimeAxisLabelExpression(); + } + + @Override + public JRFont getTimeAxisLabelFont() + { + return timeAxisLabelFont; + } + + @Override + public Color getTimeAxisLabelColor() + { + return getStyleResolver().getTimeAxisLabelColor(this, this); + } + + @Override + public Color getOwnTimeAxisLabelColor() + { + return timeAxisLabelColor; + } + + /** + * + */ + public void setTimeAxisLabelColor(Color color) + { + } + + @Override + public JRFont getTimeAxisTickLabelFont() + { + return timeAxisTickLabelFont; + } + + @Override + public Color getTimeAxisTickLabelColor() + { + return getStyleResolver().getTimeAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnTimeAxisTickLabelColor() + { + return timeAxisTickLabelColor; + } + + /** + * + */ + public void setTimeAxisTickLabelColor(Color color) + { + } + + @Override + public String getTimeAxisTickLabelMask() + { + return ((JRTimeSeriesPlot)parent).getTimeAxisTickLabelMask(); + } + + @Override + public Boolean getTimeAxisVerticalTickLabels() + { + return ((JRTimeSeriesPlot)parent).getTimeAxisVerticalTickLabels(); + } + + @Override + public Color getTimeAxisLineColor() + { + return getStyleResolver().getTimeAxisLineColor(this, this); + } + + @Override + public Color getOwnTimeAxisLineColor() + { + return timeAxisLineColor; + } + + /** + * + */ + public void setTimeAxisLineColor(Color color) + { + } + + @Override + public JRExpression getValueAxisLabelExpression() + { + return ((JRTimeSeriesPlot)parent).getValueAxisLabelExpression(); + } + + @Override + public JRExpression getDomainAxisMinValueExpression() + { + return ((JRTimeSeriesPlot)parent).getDomainAxisMinValueExpression(); + } + + @Override + public JRExpression getDomainAxisMaxValueExpression() + { + return ((JRTimeSeriesPlot)parent).getDomainAxisMaxValueExpression(); + } + + @Override + public JRExpression getRangeAxisMinValueExpression() + { + return ((JRTimeSeriesPlot)parent).getRangeAxisMinValueExpression(); + } + + @Override + public JRExpression getRangeAxisMaxValueExpression() + { + return ((JRTimeSeriesPlot)parent).getRangeAxisMaxValueExpression(); + } + + @Override + public JRFont getValueAxisLabelFont() + { + return valueAxisLabelFont; + } + + @Override + public Color getValueAxisLabelColor() + { + return getStyleResolver().getValueAxisLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisLabelColor() + { + return valueAxisLabelColor; + } + + /** + * + */ + public void setValueAxisLabelColor(Color color) + { + } + + @Override + public JRFont getValueAxisTickLabelFont() + { + return valueAxisTickLabelFont; + } + + @Override + public Color getValueAxisTickLabelColor() + { + return getStyleResolver().getValueAxisTickLabelColor(this, this); + } + + @Override + public Color getOwnValueAxisTickLabelColor() + { + return valueAxisTickLabelColor; + } + + /** + * + */ + public void setValueAxisTickLabelColor(Color color) + { + } + + @Override + public String getValueAxisTickLabelMask() + { + return ((JRTimeSeriesPlot)parent).getValueAxisTickLabelMask(); + } + + @Override + public Boolean getValueAxisVerticalTickLabels() + { + return ((JRTimeSeriesPlot)parent).getValueAxisVerticalTickLabels(); + } + + @Override + public Color getValueAxisLineColor() + { + return getStyleResolver().getValueAxisLineColor(this, this); + } + + @Override + public Color getOwnValueAxisLineColor() + { + return valueAxisLineColor; + } + + @Override + public Boolean getShowLines(){ + return ((JRTimeSeriesPlot)parent).getShowLines(); + } + + @Override + public void setShowLines(Boolean showLines){ + } + + @Override + public Boolean getShowShapes(){ + return ((JRTimeSeriesPlot)parent).getShowShapes(); + } + + @Override + public void setShowShapes(Boolean showLines){ + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillValueDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillValueDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillValueDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillValueDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,116 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import net.sf.jasperreports.charts.JRValueDataset; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillChartDataset; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +import org.jfree.data.general.Dataset; +import org.jfree.data.general.DefaultValueDataset; + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRFillValueDataset extends JRFillChartDataset implements JRValueDataset +{ + + private Number value; + + /** + * + */ + private DefaultValueDataset valueDataset = new DefaultValueDataset(); + + + /** + * + */ + public JRFillValueDataset(JRValueDataset valueDataset, + JRFillObjectFactory factory) + { + super(valueDataset, factory); + } + + @Override + public JRExpression getValueExpression() + { + return ((JRValueDataset)parent).getValueExpression(); + } + + + @Override + protected void customInitialize() + { + valueDataset = new DefaultValueDataset(); + } + + @Override + protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException + { + value = (Number)calculator.evaluate(getValueExpression()); + } + + @Override + protected void customIncrement() + { + valueDataset.setValue(value); + } + + @Override + public Dataset getCustomDataset() + { + return valueDataset; + } + + @Override + public Object getLabelGenerator() + { + return null; + } + + @Override + public byte getDatasetType() { + return JRChartDataset.VALUE_DATASET; + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillValueDisplay.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillValueDisplay.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillValueDisplay.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillValueDisplay.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,95 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.awt.Color; + +import net.sf.jasperreports.charts.JRValueDisplay; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRFillValueDisplay implements JRValueDisplay +{ + + /** + * + */ + protected JRValueDisplay parent; + + /** + * + */ + protected JRChart chart; + + /** + * + */ + public JRFillValueDisplay(JRValueDisplay valueDisplay, JRFillObjectFactory factory) + { + factory.put(valueDisplay, this); + + parent = valueDisplay; + + chart = (JRChart)factory.getVisitResult(valueDisplay.getChart()); + } + + @Override + public JRChart getChart() + { + return chart; + } + + @Override + public Color getColor() + { + return parent.getColor(); + } + + @Override + public String getMask(){ + return parent.getMask(); + } + + @Override + public JRFont getFont() + { + return parent.getFont(); + } + + @Override + public Object clone() + { + throw new UnsupportedOperationException(); + } + + @Override + public JRValueDisplay clone(JRChart parentChart) + { + throw new UnsupportedOperationException(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXyDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXyDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXyDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXyDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,243 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.charts.JRXyDataset; +import net.sf.jasperreports.charts.JRXySeries; +import net.sf.jasperreports.charts.util.XYDatasetLabelGenerator; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillChartDataset; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; +import net.sf.jasperreports.engine.util.Pair; + +import org.jfree.data.general.Dataset; +import org.jfree.data.xy.XYSeries; +import org.jfree.data.xy.XYSeriesCollection; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRFillXyDataset extends JRFillChartDataset implements JRXyDataset +{ + + /** + * + */ + protected JRFillXySeries[] xySeries; + + private List> seriesNames; + private Map, XYSeries> seriesMap; + private Map, Map> labelsMap; + + private Map, Map> itemHyperlinks; + + + /** + * + */ + public JRFillXyDataset( + JRXyDataset xyDataset, + JRFillObjectFactory factory + ) + { + super(xyDataset, factory); + + /* */ + JRXySeries[] srcXySeries = xyDataset.getSeries(); + if (srcXySeries != null && srcXySeries.length > 0) + { + xySeries = new JRFillXySeries[srcXySeries.length]; + for(int i = 0; i < xySeries.length; i++) + { + xySeries[i] = (JRFillXySeries)factory.getXySeries(srcXySeries[i]); + } + } + } + + + @Override + public JRXySeries[] getSeries() + { + return xySeries; + } + + + @Override + protected void customInitialize() + { + seriesNames = null; + seriesMap = null; + labelsMap = null; + itemHyperlinks = null; + } + + + @Override + protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException + { + if (xySeries != null && xySeries.length > 0) + { + for(int i = 0; i < xySeries.length; i++) + { + xySeries[i].evaluate(calculator); + } + } + } + + + @Override + protected void customIncrement() + { + if (xySeries != null && xySeries.length > 0) + { + if (seriesNames == null) + { + seriesNames = new ArrayList>(); + seriesMap = new HashMap, XYSeries>(); + labelsMap = new HashMap, Map>(); + itemHyperlinks = new HashMap, Map>(); + } + + for(int i = 0; i < xySeries.length; i++) + { + JRFillXySeries crtXySeries = xySeries[i]; + + Comparable seriesName = crtXySeries.getSeries(); + XYSeries xySrs = seriesMap.get(seriesName); + if (xySrs == null) + { + boolean autoSort = crtXySeries.getAutoSort() == null ? true : crtXySeries.getAutoSort(); + xySrs = new XYSeries(seriesName, autoSort); + seriesNames.add(seriesName); + seriesMap.put(seriesName, xySrs); + } + + xySrs.addOrUpdate( + crtXySeries.getXValue(), + crtXySeries.getYValue() + ); + + if (crtXySeries.getLabelExpression() != null) + { + Map seriesLabels = labelsMap.get(seriesName); + if (seriesLabels == null) + { + seriesLabels = new HashMap(); + labelsMap.put(seriesName, seriesLabels); + } + + seriesLabels.put(crtXySeries.getXValue(), crtXySeries.getLabel()); + } + + if (crtXySeries.hasItemHyperlinks()) + { + Map seriesLinks = itemHyperlinks.get(seriesName); + if (seriesLinks == null) + { + seriesLinks = new HashMap(); + itemHyperlinks.put(seriesName, seriesLinks); + } + Pair xyKey = new Pair(crtXySeries.getXValue(), crtXySeries.getYValue()); + seriesLinks.put(xyKey, crtXySeries.getPrintItemHyperlink()); + } + } + } + } + + + @Override + public Dataset getCustomDataset() + { + XYSeriesCollection dataset = new XYSeriesCollection(); + if (seriesNames != null) + { + for(int i = 0; i < seriesNames.size(); i++) + { + Comparable seriesName = seriesNames.get(i); + dataset.addSeries(seriesMap.get(seriesName)); + } + } + return dataset; + } + + + @Override + public byte getDatasetType() { + return JRChartDataset.XY_DATASET; + } + + + @Override + public Object getLabelGenerator(){ + return new XYDatasetLabelGenerator(labelsMap, getLocale()); + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + public Map, Map> getItemHyperlinks() + { + return itemHyperlinks; + } + + + public boolean hasItemHyperlinks() + { + boolean foundLinks = false; + if (xySeries != null && xySeries.length > 0) + { + for (int i = 0; i < xySeries.length && !foundLinks; i++) + { + JRFillXySeries serie = xySeries[i]; + foundLinks = serie.hasItemHyperlinks(); + } + } + return foundLinks; + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXySeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXySeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXySeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXySeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,193 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import net.sf.jasperreports.charts.JRXySeries; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRHyperlinkHelper; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRFillXySeries implements JRXySeries +{ + + /** + * + */ + protected JRXySeries parent; + + private Comparable series; + private Number xValue; + private Number yValue; + private String label; + private JRPrintHyperlink itemHyperlink; + private Boolean autoSort; + + + /** + * + */ + public JRFillXySeries( + JRXySeries xySeries, + JRFillObjectFactory factory + ) + { + factory.put(xySeries, this); + + parent = xySeries; + } + + + @Override + public JRExpression getSeriesExpression() + { + return parent.getSeriesExpression(); + } + + @Override + public JRExpression getXValueExpression() + { + return parent.getXValueExpression(); + } + + @Override + public JRExpression getYValueExpression() + { + return parent.getYValueExpression(); + } + + @Override + public JRExpression getLabelExpression() + { + return parent.getLabelExpression(); + } + + + @Override + public Boolean getAutoSort() + { + return parent.getAutoSort(); + } + + + /** + * + */ + protected Comparable getSeries() + { + return series; + } + + /** + * + */ + protected Number getXValue() + { + return xValue; + } + + /** + * + */ + protected Number getYValue() + { + return yValue; + } + + /** + * + */ + protected String getLabel() + { + return label; + } + + protected JRPrintHyperlink getPrintItemHyperlink() + { + return itemHyperlink; + } + + + /** + * + */ + protected void evaluate(JRCalculator calculator) throws JRExpressionEvalException + { + series = (Comparable)calculator.evaluate(getSeriesExpression()); + xValue = (Number)calculator.evaluate(getXValueExpression()); + yValue = (Number)calculator.evaluate(getYValueExpression()); + label = (String)calculator.evaluate(getLabelExpression()); + + if (hasItemHyperlinks()) + { + evaluateItemHyperlink(calculator); + } + } + + + protected void evaluateItemHyperlink(JRCalculator calculator) throws JRExpressionEvalException + { + try + { + itemHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getItemHyperlink(), calculator, JRExpression.EVALUATION_DEFAULT); + } + catch (JRExpressionEvalException e) + { + throw e; + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + + @Override + public JRHyperlink getItemHyperlink() + { + return parent.getItemHyperlink(); + } + + + public boolean hasItemHyperlinks() + { + return !JRHyperlinkHelper.isEmpty(getItemHyperlink()); + } + + @Override + public Object clone() + { + throw new UnsupportedOperationException(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXyzDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXyzDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXyzDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXyzDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,190 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import java.util.HashMap; +import java.util.Map; + +import net.sf.jasperreports.charts.JRXyzDataset; +import net.sf.jasperreports.charts.JRXyzSeries; +import net.sf.jasperreports.charts.util.DefaultXYZDataset; +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillChartDataset; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; +import net.sf.jasperreports.engine.util.Pair; + +import org.jfree.data.general.Dataset; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRFillXyzDataset extends JRFillChartDataset implements JRXyzDataset { + + public static final String EXCEPTION_MESSAGE_KEY_SERIES_NULL_NAME = "charts.xyz.dataset.series.null.name"; + + protected JRFillXyzSeries[] xyzSeries; + + private DefaultXYZDataset dataset; + + private Map, Map> itemHyperlinks; + + + public JRFillXyzDataset(JRXyzDataset xyzDataset, JRFillObjectFactory factory) + { + super( xyzDataset, factory ); + + JRXyzSeries[] srcXyzSeries = xyzDataset.getSeries(); + if(srcXyzSeries != null && srcXyzSeries.length > 0) + { + xyzSeries = new JRFillXyzSeries[srcXyzSeries.length]; + for(int i = 0; i < xyzSeries.length; i++) + { + xyzSeries[i] = (JRFillXyzSeries)factory.getXyzSeries( srcXyzSeries[i]); + } + } + } + + @Override + public JRXyzSeries[] getSeries(){ + return xyzSeries; + } + + @Override + protected void customInitialize() + { + dataset = new DefaultXYZDataset(); + itemHyperlinks = new HashMap, Map>(); + } + + @Override + protected void customEvaluate( JRCalculator calculator ) throws JRExpressionEvalException + { + if (xyzSeries != null && xyzSeries.length > 0) + { + for (int i = 0; i < xyzSeries.length; i++) + { + xyzSeries[i].evaluate( calculator ); + } + } + } + + @Override + protected void customIncrement() + { + if (xyzSeries != null && xyzSeries .length > 0) + { + for (int i = 0; i < xyzSeries.length; i++) + { + JRFillXyzSeries crtXyzSeries = xyzSeries[i]; + + Comparable seriesName = crtXyzSeries.getSeries(); + if (seriesName == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_SERIES_NULL_NAME, + (Object[])null + ); + } + + dataset.addValue( + crtXyzSeries.getSeries(), + crtXyzSeries.getXValue(), + crtXyzSeries.getYValue(), + crtXyzSeries.getZValue() + ); + + if (crtXyzSeries.hasItemHyperlinks()) + { + Map seriesLinks = itemHyperlinks.get(crtXyzSeries.getSeries()); + if (seriesLinks == null) + { + seriesLinks = new HashMap(); + itemHyperlinks.put(crtXyzSeries.getSeries(), seriesLinks); + } + Pair xyKey = new Pair(crtXyzSeries.getXValue(), crtXyzSeries.getYValue()); + seriesLinks.put(xyKey, crtXyzSeries.getPrintItemHyperlink()); + } + } + } + } + + @Override + public Object getLabelGenerator() + { + return null; + } + + @Override + public Dataset getCustomDataset() { + return dataset; + } + + @Override + public byte getDatasetType() { + return JRChartDataset.XYZ_DATASET; + } + + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + collector.collect(this); + } + + + public boolean hasItemHyperlinks() + { + boolean foundLinks = false; + if (xyzSeries != null && xyzSeries.length > 0) + { + for (int i = 0; i < xyzSeries.length && !foundLinks; i++) + { + JRFillXyzSeries serie = xyzSeries[i]; + foundLinks = serie.hasItemHyperlinks(); + } + } + return foundLinks; + } + + + public Map, Map> getItemHyperlinks() + { + return itemHyperlinks; + } + + + @Override + public void validate(JRVerifier verifier) + { + verifier.verify(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXyzSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXyzSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXyzSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/JRFillXyzSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,142 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.fill; + +import net.sf.jasperreports.charts.JRXyzSeries; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRHyperlinkHelper; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRFillXyzSeries implements JRXyzSeries { + + JRXyzSeries parent; + + private Comparable series; + private Number xValue; + private Number yValue; + private Number zValue; + private JRPrintHyperlink itemHyperlink; + + public JRFillXyzSeries( JRXyzSeries xyzSeries, JRFillObjectFactory factory ){ + factory.put( xyzSeries, this ); + parent = xyzSeries; + } + + @Override + public JRExpression getSeriesExpression(){ + return parent.getSeriesExpression(); + } + + @Override + public JRExpression getXValueExpression(){ + return parent.getXValueExpression(); + } + + @Override + public JRExpression getYValueExpression(){ + return parent.getYValueExpression(); + } + + @Override + public JRExpression getZValueExpression(){ + return parent.getZValueExpression(); + } + + + protected Comparable getSeries(){ + return series; + } + + protected Number getXValue(){ + return xValue; + } + + protected Number getYValue(){ + return yValue; + } + + protected Number getZValue(){ + return zValue; + } + + protected JRPrintHyperlink getPrintItemHyperlink() + { + return itemHyperlink; + } + + protected void evaluate( JRCalculator calculator ) throws JRExpressionEvalException { + series = (Comparable)calculator.evaluate( getSeriesExpression() ); + xValue = (Number)calculator.evaluate( getXValueExpression() ); + yValue = (Number)calculator.evaluate( getYValueExpression() ); + zValue = (Number)calculator.evaluate( getZValueExpression() ); + + if (hasItemHyperlinks()) + { + evaluateItemHyperlink(calculator); + } + } + + protected void evaluateItemHyperlink(JRCalculator calculator) throws JRExpressionEvalException + { + try + { + itemHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getItemHyperlink(), calculator, JRExpression.EVALUATION_DEFAULT); + } + catch (JRExpressionEvalException e) + { + throw e; + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public JRHyperlink getItemHyperlink() + { + return parent.getItemHyperlink(); + } + + public boolean hasItemHyperlinks() + { + return !JRHyperlinkHelper.isEmpty(getItemHyperlink()); + } + + @Override + public Object clone() + { + throw new UnsupportedOperationException(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/fill/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/fill/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +/** + * Contains fill time implementations for chart related interfaces. + */ +package net.sf.jasperreports.charts.fill; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRAreaPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRAreaPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRAreaPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRAreaPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,36 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + + +/** + * Area charts and Stacked Area charts rely on this plot to render their axes and items. This + * kind of plot allows users to specify only the labels for both axes and their format. + * Currently no other settings are necessary. + * + * @author Flavus Sana (flavius_sana@users.sourceforge.net) + */ +public interface JRAreaPlot extends JRCategoryPlot +{ +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRBar3DPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRBar3DPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRBar3DPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRBar3DPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,79 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + + + +/** + * Type of plot + * used to render Bar 3D and the Stacked Bar 3D charts. + *
    + * Like the {@link net.sf.jasperreports.charts.JRBarPlot JRBarPlot}, the JRBar3DPlot + * allows customization of the labels for both of its axes and the display of the item labels + * + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public interface JRBar3DPlot extends JRCategoryPlot +{ + + /** + * @return the x offset + */ + public Double getXOffsetDouble(); + + /** + * @return a {@link net.sf.jasperreports.charts.JRItemLabel JRItemLabel} object + * representing the item label + */ + public JRItemLabel getItemLabel(); + + /** + * Sets the x offset + * @param xOffset the x offset + */ + public void setXOffset(Double xOffset); + + /** + * @return the y offset + */ + public Double getYOffsetDouble(); + + /** + * Sets the y offset + * @param yOffset the y offset + */ + public void setYOffset(Double yOffset); + + /** + * @return a flag that specifies whether the labels are to be shown or not + */ + public Boolean getShowLabels(); + + /** + * Sets a flag that specifies whether the labels are to be shown or not + * @param isShowLabels the show labels flag + */ + public void setShowLabels(Boolean isShowLabels); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRBarPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRBarPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRBarPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRBarPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + + + +/** + * Type of plot used to render Bar, Stacked Bar, and XY Bar charts. + * It is a {@link net.sf.jasperreports.charts.JRCategoryPlot JRCategoryPlot} that exposes + * specific settings for showing/hiding axis labels, tick marks and tick labels. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRBarPlot extends JRCategoryPlot +{ + + /** + * @return a flag that specifies whether the tick marks are to be shown or not + */ + public Boolean getShowTickMarks(); + + /** + * Sets a flag that specifies whether the tick marks are to be shown or not + * @param isShowTickMarks the show tick marks flag + */ + public void setShowTickMarks(Boolean isShowTickMarks); + + /** + * @return a flag that specifies whether the tick labels are to be shown or not + */ + public Boolean getShowTickLabels(); + + /** + * @return a {@link net.sf.jasperreports.charts.JRItemLabel JRItemLabel} object + * representing the item label + */ + public JRItemLabel getItemLabel(); + + /** + * Sets a flag that specifies whether the tick labels are to be shown or not + * @param isShowTickLabels the show tick labels flag + */ + public void setShowTickLabels(Boolean isShowTickLabels); + + /** + * @return a flag that specifies whether the labels are to be shown or not + */ + public Boolean getShowLabels(); + + /** + * Sets a flag that specifies whether the labels are to be shown or not + * @param isShowLabels the show labels flag + */ + public void setShowLabels( Boolean isShowLabels ); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRBubblePlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRBubblePlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRBubblePlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRBubblePlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,103 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.charts.type.ScaleTypeEnum; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRExpression; + +/** + * Only Bubble charts use this type of plot. Like all other two-axis plots, it lets users control + * the labels displayed for each axis. + *
    + * The plot draws an ellipse for each item present in the dataset for a given series. Usually + * this is a circle whose radius is specified by the Z value in that chart item. However, the + * plot needs to know whether the Z value is proportional to its corresponding X value or to + * its corresponding Y value in order to calculate the actual size of the bubble. + *
    + * The type of bubble scaling is specified by the scaleType attribute that the plot exposes: + *
      + *
    • Range axis scaling: The bubble is a circle with the radius proportional to the Y + * value for each item (scaleType="RangeAxis").
    • + *
    • Domain axis scaling: The bubble is a circle with the radius proportional to the + * X value for each item (scaleType="DomainAxis").
    • + *
    • Scaling on both axes: The bubble is an ellipse with the height proportional to + * the Y value and the width proportional to the X value for each item + * (scaleType="BothAxes").
    • + *
    + * By default, bubbles scale on the range axis. + * + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public interface JRBubblePlot extends JRChartPlot, JRXAxisFormat, JRYAxisFormat +{ + + /** + * @return the x axis label expression + */ + public JRExpression getXAxisLabelExpression(); + + /** + * @return the y axis label expression + */ + public JRExpression getYAxisLabelExpression(); + + /** + * @return the scale type. Possible values are: + *
      + *
    • {@link net.sf.jasperreports.charts.type.ScaleTypeEnum#ON_BOTH_AXES ON_BOTH_AXES}
    • + *
    • {@link net.sf.jasperreports.charts.type.ScaleTypeEnum#ON_DOMAIN_AXIS ON_DOMAIN_AXIS}
    • + *
    • {@link net.sf.jasperreports.charts.type.ScaleTypeEnum#ON_RANGE_AXIS ON_RANGE_AXIS}
    • + *
    + * @see net.sf.jasperreports.charts.type.ScaleTypeEnum + */ + public ScaleTypeEnum getScaleTypeValue(); + + /** + * Sets the scale type. + * @param scaleType the scale type + */ + public void setScaleType(ScaleTypeEnum scaleType); + + /** + * @return the minimum value expression for the domain axis + */ + public JRExpression getDomainAxisMinValueExpression(); + + /** + * @return the maximum value expression for the domain axis + */ + public JRExpression getDomainAxisMaxValueExpression(); + + /** + * @return the minimum value expression for the range axis + */ + public JRExpression getRangeAxisMinValueExpression(); + + /** + * @return the maximum value expression for the range axis + */ + public JRExpression getRangeAxisMaxValueExpression(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRCandlestickPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRCandlestickPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRCandlestickPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRCandlestickPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRExpression; + + +/** + * The Candlestick plot is also an axis-oriented plot and allows you to customize axis labels + * using expressions. It can be used only in combination with a Candlestick chart. + *
    + * The Candlestick chart uses a High-Low dataset, but unlike the High-Low chart, the + * Candlestick chart can make use of the volume value inside each dataset item. + *
    + * The volume value is displayed as the body of the candlestick figure rendered for each + * item. The volume is displayed by default in a Candlestick chart but can be suppressed by + * setting the isShowVolume flag to false. + * + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public interface JRCandlestickPlot extends JRChartPlot, JRTimeAxisFormat, JRValueAxisFormat +{ + + /** + * + */ + public JRExpression getTimeAxisLabelExpression(); + + /** + * + */ + public JRExpression getValueAxisLabelExpression(); + + /** + * + */ + public JRExpression getDomainAxisMinValueExpression(); + + /** + * + */ + public JRExpression getDomainAxisMaxValueExpression(); + + /** + * + */ + public JRExpression getRangeAxisMinValueExpression(); + + /** + * + */ + public JRExpression getRangeAxisMaxValueExpression(); + + /** + * + */ + public Boolean getShowVolume(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRCategoryAxisFormat.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRCategoryAxisFormat.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRCategoryAxisFormat.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRCategoryAxisFormat.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,102 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import java.awt.Color; + +import net.sf.jasperreports.engine.JRFont; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRCategoryAxisFormat +{ + + public static final String PROPERTY_CATEGORY_AXIS_TICK_LABEL_ROTATION = "categoryAxisTickLabelRotation"; + + /** + * + */ + public JRFont getCategoryAxisLabelFont(); + + /** + * + */ + public Color getCategoryAxisLabelColor(); + + /** + * + */ + public Color getOwnCategoryAxisLabelColor(); + + /** + * + */ + public JRFont getCategoryAxisTickLabelFont(); + + /** + * + */ + public Color getCategoryAxisTickLabelColor(); + + /** + * + */ + public Color getOwnCategoryAxisTickLabelColor(); + + /** + * + */ + public String getCategoryAxisTickLabelMask(); + + /** + * + */ + public Boolean getCategoryAxisVerticalTickLabels(); + + /** + * + */ + public Color getCategoryAxisLineColor(); + + /** + * + */ + public Color getOwnCategoryAxisLineColor(); + + /** + * Gets the angle in degrees to rotate the data axis labels. The range is -360 to 360. A positive value angles + * the label so it reads downwards wile a negative value angles the label so it reads upwards. Only charts that + * use a category based axis (such as line or bar charts) support label rotation. + */ + public Double getCategoryAxisTickLabelRotation(); + + /** + * Sets the angle in degrees to rotate the data axis labels. The range is -360 to 360. A positive value angles + * the label so it reads downwards wile a negative value angles the label so it reads upwards. Only charts that + * use a category based axis (such as line or bar charts) support label rotation. + */ + public void setCategoryAxisTickLabelRotation(Double labelRotation); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRCategoryDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRCategoryDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRCategoryDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRCategoryDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartDataset; + + +/** + * This dataset accommodates one or more data series consisting of values associated with + * categories. It is used to render Bar, Bar 3D, Stacked Bar, Line, Area, and Stacked Area + * charts + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRCategoryDataset extends JRChartDataset +{ + + /** + * @return an array of {@link JRCategorySeries} objects representing the + * series for category charts + * + * @see JRCategorySeries + */ + public JRCategorySeries[] getSeries(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRCategoryPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRCategoryPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRCategoryPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRCategoryPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,67 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRExpression; + +/** + * Type of plot used for rendering category charts. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRCategoryPlot extends JRChartPlot, JRCategoryAxisFormat, JRValueAxisFormat +{ + + /** + * @return the category axis label expression + */ + public JRExpression getCategoryAxisLabelExpression(); + + /** + * @return the value axis label expression + */ + public JRExpression getValueAxisLabelExpression(); + + /** + * @return the minimum value expression for the domain axis + */ + public JRExpression getDomainAxisMinValueExpression(); + + /** + * @return the maximum value expression for the domain axis + */ + public JRExpression getDomainAxisMaxValueExpression(); + + /** + * @return the minimum value expression for the range axis + */ + public JRExpression getRangeAxisMinValueExpression(); + + /** + * @return the maximum value expression for the range axis + */ + public JRExpression getRangeAxisMaxValueExpression(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRCategorySeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRCategorySeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRCategorySeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRCategorySeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,80 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; + + +/** + * Represents the series for any Category dataset. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRCategorySeries extends JRCloneable +{ + + /** + * @return the expression of the series name. The value of this expression can be any + * java.lang.Comparable object. + *
    + * Note that this expression may return different values with each iteration, which in turn + * will result in the dataset having multiple category series, even though a single + * <categorySeries> tag was used inside <categoryDataset>. However, this + * expression usually returns a java.lang.String constant, and there are several + * <categorySeries> tags that introduce multiple category series in the dataset. + */ + public JRExpression getSeriesExpression(); + + /** + * @return the expression of the name of the category for each value inside the series + * specified by the series expression. Categories are java.lang.Comparable objects + * (not necessarily java.lang.String objects). + */ + public JRExpression getCategoryExpression(); + + /** + * @return the value expression, a java.lang.Number value for each category in the specified series. + */ + public JRExpression getValueExpression(); + + /** + * @return the label expression. If present, this expression allows + * customization of the item labels in the chart. + */ + public JRExpression getLabelExpression(); + + + /** + * Returns the hyperlink specification for chart items. + *

    + * The hyperlink will be evaluated for every chart item and an image map will be created for the chart. + *

    + * + * @return hyperlink specification for chart items + */ + public JRHyperlink getItemHyperlink(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRChartAxis.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRChartAxis.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRChartAxis.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRChartAxis.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.charts.type.AxisPositionEnum; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRCloneable; + +/** + * Describes an axis that can be added to a multiple axis chart. The name + * "axis" is a bit of a misnomer, as it really contains information about + * a new dataset to plot, the axis to plot it against, and how to render that + * dataset. + * + * @author Barry Klawans (barry@users.sourceforge.net) + */ + + +public interface JRChartAxis extends JRCloneable +{ + /** + * Gets the position of this axis. + * + * @return the position of this axis + */ + public AxisPositionEnum getPositionValue(); + + + /** + * Returns the chart that contains the dataset and plot to use for this + * axis. The plot is used to figure out how to render the dataset when + * adding to the multiple axis chart. + * + * @return the chart that contains the dataset and plot for this axis + */ + public JRChart getChart(); + + public JRChartAxis clone(JRChart parentChart); +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRCommonLinePlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRCommonLinePlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRCommonLinePlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRCommonLinePlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,62 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + + +/** + * Type of the plot used to render Line, XY Line and Scatter charts. + *
    + * It exposes the following specific settings: + *
      + *
    • the show lines flag
    • + *
    • the show shapes flag
    • + *
    + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRCommonLinePlot +{ + + /** + * @return the show lines flag + */ + public Boolean getShowLines(); + + /** + * Sets the show lines flag + * @param isShowLines the show lines flag + */ + public void setShowLines(Boolean isShowLines); + + /** + * @return the show shapes flag + */ + public Boolean getShowShapes(); + + /** + * Sets the show shapes flag + * @param isShowShapes the show shapes flag + */ + public void setShowShapes(Boolean isShowShapes); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRDataRange.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRDataRange.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRDataRange.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRDataRange.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRExpression; + + +/** + * Represents a numeric range. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public interface JRDataRange extends JRCloneable +{ + /** + * Returns the expression that generates the lower bound of the range. + * + * @return the expression that generates the lower bound of the range + */ + public JRExpression getLowExpression(); + + /** + * Returns the expression that generates the upper bound of the range. + * + * @return the expression that generates the upper bound of the range + */ + public JRExpression getHighExpression(); +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRGanttDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRGanttDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRGanttDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRGanttDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartDataset; + +/** + * This dataset accommodates one or more data series consisting of values associated with + * tasks and subtasks. It is used to render the Gantt chart. + * + * @author Peter Risko (peter@risko.hu) + */ +public interface JRGanttDataset extends JRChartDataset { + + /** + * @return an array of {@link JRGanttSeries} objects representing the + * series for the Gantt chart + * @see JRGanttSeries + */ + public JRGanttSeries[] getSeries(); + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRGanttSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRGanttSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRGanttSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRGanttSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; + +/** + * Represents the series for the Gantt dataset. + * + * @author Peter Risko (peter@risko.hu) + */ +public interface JRGanttSeries { + + /** + * @return the expression of the series name + */ + public JRExpression getSeriesExpression(); + + /** + * @return the expression of the task name + */ + public JRExpression getTaskExpression(); + + /** + * @return the expression of the subtask name + */ + public JRExpression getSubtaskExpression(); + + /** + * @return the start date expression + */ + public JRExpression getStartDateExpression(); + + /** + * @return the end date expression + */ + public JRExpression getEndDateExpression(); + + /** + * @return the task percent expression + */ + public JRExpression getPercentExpression(); + + /** + * @return the label expression + */ + public JRExpression getLabelExpression(); + + + /** + * Returns the hyperlink specification for chart items. + *

    + * The hyperlink will be evaluated for every chart item and an image map will be created for the chart. + *

    + * + * @return hyperlink specification for chart items + */ + public JRHyperlink getItemHyperlink(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRHighLowDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRHighLowDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRHighLowDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRHighLowDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,102 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; + + +/** + * Although the name of this dataset is "High-Low", it can actually hold a series of + * (x, high, low, open, close, volume) items. It is used in combination with either + * a High-Low or a Candlestick chart. + * + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public interface JRHighLowDataset extends JRChartDataset +{ + /** + * @return the expression of the series name. Currently only one series is supported inside + * a High-Low or Candlestick chart. This limitation is documented inside JFreeChart, the + * library used for the built-in chart support. However, this single series must + * be identified by a java.lang.Comparable value returned by this expression, + * and it must also be used as the series name in the chart's legend. + */ + public JRExpression getSeriesExpression(); + + + /** + * @return the expression of the date to which the current + * (high, low, open, close, volume) item refers. + */ + public JRExpression getDateExpression(); + + + /** + * @return a numeric expression that will be part of the data item added to + * the series when the dataset gets incremented. + */ + public JRExpression getHighExpression(); + + + /** + * @return a numeric expression that will be part of the data item added to + * the series when the dataset gets incremented. + */ + public JRExpression getLowExpression(); + + + /** + * @return a numeric expression that will be part of the data item added to + * the series when the dataset gets incremented. + */ + public JRExpression getOpenExpression(); + + + /** + * @return a numeric expression that will be part of the data item added to + * the series when the dataset gets incremented. + */ + public JRExpression getCloseExpression(); + + + /** + * @return a numeric expression representing the volume value to use for the current + * data item. It is used only for Candlestick charts. + */ + public JRExpression getVolumeExpression(); + + + /** + * Returns the hyperlink specification for chart items. + *

    + * The hyperlink will be evaluated for every chart item and a image map will be created for the chart. + *

    + * + * @return hyperlink specification for chart items + */ + public JRHyperlink getItemHyperlink(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRHighLowPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRHighLowPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRHighLowPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRHighLowPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,85 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRExpression; + + +/** + * Used only in combination with High-Low charts, this type of plot lets users customize + * the labels for both axes, like all the other axis-oriented plots. + *
    + * This special type of plot draws the items as vertical lines that start at the high value and + * go downward to the low value. On each line the plot displays by default small ticks to + * indicate the open and close values corresponding to the current item. To suppress these + * ticks, set to false the two flags available inside the plot definition: isShowCloseTicks + * and isShowOpenTicks. + * + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public interface JRHighLowPlot extends JRChartPlot, JRTimeAxisFormat, JRValueAxisFormat +{ + + /** + * + */ + public JRExpression getTimeAxisLabelExpression(); + + /** + * + */ + public JRExpression getValueAxisLabelExpression(); + + /** + * + */ + public JRExpression getDomainAxisMinValueExpression(); + + /** + * + */ + public JRExpression getDomainAxisMaxValueExpression(); + + /** + * + */ + public JRExpression getRangeAxisMinValueExpression(); + + /** + * + */ + public JRExpression getRangeAxisMaxValueExpression(); + + /** + * + */ + public Boolean getShowOpenTicks(); + + /** + * + */ + public Boolean getShowCloseTicks(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRItemLabel.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRItemLabel.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRItemLabel.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRItemLabel.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,72 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import java.awt.Color; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRFont; + + +/** + * Contains the formatting option for the textual + * representation of item labels in a category plot + * + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public interface JRItemLabel extends JRCloneable +{ + /** + * @return the chart the current item label belongs to. + */ + public JRChart getChart(); + + /** + * @return the item label font. Allows full font customization for the item label. + */ + public JRFont getFont(); + + /** + * @return the item label text color + */ + public Color getColor(); + + /** + * @return the item label background color + */ + public Color getBackgroundColor(); + + /** + * Returns the item label formatting mask. + * The mask will be specified using the patterns defined + * in java.text.DecimalFormat. + * + * @return the item label formatting mask + */ +// public String getMask(); + + public JRItemLabel clone(JRChart parentChart); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRLinePlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRLinePlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRLinePlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRLinePlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + + +/** + * Type of plot used to render Line charts. + * + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public interface JRLinePlot extends JRCategoryPlot, JRCommonLinePlot +{ +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRMeterPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRMeterPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRMeterPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRMeterPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,142 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import java.awt.Color; +import java.util.List; + +import net.sf.jasperreports.charts.type.MeterShapeEnum; +import net.sf.jasperreports.charts.util.JRMeterInterval; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRFont; + + +/** + * This type of plot can be used only for Meter charts and + * represents the display options of a Meter Chart. A meter chart consists of a dial, + * a needle pointing to the current value on the dial, and the value itself. The Meter plot + * can be broken up into shaded regions to highlight portions of the range. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public interface JRMeterPlot extends JRChartPlot +{ + /** + * Returns the range of values that the Meter can display. + * + * @return the range of values that the Meter can display + */ + public JRDataRange getDataRange(); + + /** + * Returns a description of how the value of the Meter is displayed. This includes + * any font and color information, the location of the value, a formatting mask and + * an optional "units" string to append to the value. + * + * @return a description of how the value of the Meter is displayed. + */ + public JRValueDisplay getValueDisplay(); + + /** + * Returns the shape of the Meter. The shape is only relevant if the Meter face is + * over 180 degrees wide, and controls how the portion of the circle described by the + * Meter but outside of the Meter is drawn. (If the meter is 240 degrees wide the shape + * setting controls how the remaining 120 degrees is displayed.) + *

    + * The value returned is one of the shape constants defined in {@link MeterShapeEnum}. + * + * @return a description of how the value of the Meter is displayed. + */ + public MeterShapeEnum getShapeValue(); + + /** + * Returns a list of all the intervals contained in this Meter. The return value is never + * null but can be an empty list. Each element in the list is a + * {@link net.sf.jasperreports.charts.util.JRMeterInterval JRMeterInterval} + * + * @return a list of all the intervals contained in this Meter + */ + public List getIntervals(); + + /** + * Returns the size of the Meter face in degrees. By default + * the meter dial is a semicircle. + * + * @return the size of the Meter face in degrees + */ + public Integer getMeterAngleInteger(); + + /** + * Returns the name of the units that the Meter is displaying. This value will be + * appended to the value when displayed. + * + * @return the name of the units that the Meter is displaying + */ + public String getUnits(); + + /** + * Returns the spacing between the ticks on the face of the meter. The spacing is relative + * to the range that the meter is displaying - if the range is 0 to 500 and the tick interval + * is 50 then 10 ticks will be displayed. + * + * @return the spacing between the ticks on the face of the meter + */ + public Double getTickIntervalDouble(); + + /** + * Returns the number of major ticks on the meter scale. + * + * @return the spacing between the ticks on the face of the meter + */ + public Integer getTickCount(); + + /** + * Returns the background color of the meter. This is the color of the meter's face. + * + * @return the background color of the meter. + */ + public Color getMeterBackgroundColor(); + + /** + * Returns the color used when drawing the meter's pointer. + * + * @return the color used when drawing the meter's pointer + */ + public Color getNeedleColor(); + + /** + * Returns the color used when drawing tick marks on the meter. + * + * @return the color used when drawing tick marks on the meter + */ + public Color getTickColor(); + + /** + * Returns the font used to write tick labels on the meter. + * + * @return the font used to write tick labels on the meter + */ + public JRFont getTickLabelFont(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRMultiAxisPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRMultiAxisPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRMultiAxisPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRMultiAxisPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartPlot; + +import java.util.List; + + +/** + * Represents the display options and nested charts of a multiple axis chart. + * The display options set at the root of a multiple axis chart override the + * options set in the nested charts. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public interface JRMultiAxisPlot extends JRChartPlot +{ + /** + * Returns a List of all the children axis. Each element is of type + * {@link net.sf.jasperreports.charts.JRChartAxis JRChartAxis}. + */ + public List getAxes(); +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRPie3DPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRPie3DPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRPie3DPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRPie3DPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,80 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartPlot; + + +/** + * Type of plot used for rendering Pie 3D charts. + *
    + * Special settings that the Pie 3D plot exposes are: + *
      + *
    • the circular flag
    • + *
    • the depth factor
    • + *
    • the label format
    • + *
    • the legend label format
    • + *
    • the item label
    • + *
    • the showLabels flag
    • + *
    + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRPie3DPlot extends JRChartPlot +{ + + public static final double DEPTH_FACTOR_DEFAULT = 0.2; + + /** + * @return a numeric value ranging from 0 to 1 that represents the depth of the pie as + * a percentage of the height of the plot area. + */ + public Double getDepthFactorDouble(); + + /** + * @return a flag that specifies a circular form for the 3D pie + */ + public Boolean getCircular(); + + /** + * @return the format pattern for labels + */ + public String getLabelFormat(); + + /** + * @return the format pattern for legend labels + */ + public String getLegendLabelFormat(); + + /** + * @return a {@link net.sf.jasperreports.charts.JRItemLabel JRItemLabel} object + * representing the item label + */ + public JRItemLabel getItemLabel(); + + /** + * @return a flag that specifies whether labels are to be shown or not + */ + public Boolean getShowLabels(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRPieDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRPieDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRPieDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRPieDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,89 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRPropertiesUtil; + + +/** + * This dataset is useful for rendering Pie or Pie 3D charts. Data required for such charts + * comes in the form of key-value pairs. Each pair represents a slice in the pie chart. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRPieDataset extends JRChartDataset +{ + /** + * + */ + public static final String PROPERTY_IGNORE_DUPLICATED_KEY = JRPropertiesUtil.PROPERTY_PREFIX + "chart.pie.ignore.duplicated.key"; + + /** + * + */ + public Float getMinPercentage(); + + /** + * + */ + public void setMinPercentage(Float minPercentage); + + /** + * + */ + public Integer getMaxCount(); + + /** + * + */ + public void setMaxCount(Integer maxCount); + + /** + * @return an array of {@link JRPieSeries} objects representing the + * series for the Pie or Pie 3D chart + * @see JRPieSeries + */ + public JRPieSeries[] getSeries(); + + /** + * + */ + public JRExpression getOtherKeyExpression(); + + /** + * + */ + public JRExpression getOtherLabelExpression(); + + /** + * Returns the hyperlink specification for the special Other chart section, if present. + * + * @return hyperlink specification for the Other chart section + */ + public JRHyperlink getOtherSectionHyperlink(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRPiePlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRPiePlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRPiePlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRPiePlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,70 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartPlot; + + +/** + * Type of plot used for rendering Pie charts. + *
    + * Special settings that the Pie plot exposes are: + *
      + *
    • the circular flag
    • + *
    • the label format
    • + *
    • the legend label format
    • + *
    • the item label
    • + *
    • the showLabels flag
    • + *
    + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRPiePlot extends JRChartPlot +{ + /** + * @return a flag that specifies a circular form for the pie + */ + public Boolean getCircular(); + + /** + * @return the format pattern for labels + */ + public String getLabelFormat(); + + /** + * @return the format pattern for legend labels + */ + public String getLegendLabelFormat(); + + /** + * @return a {@link net.sf.jasperreports.charts.JRItemLabel JRItemLabel} object + * representing the item label + */ + public JRItemLabel getItemLabel(); + + /** + * @return a flag that specifies whether labels are to be shown or not + */ + public Boolean getShowLabels(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRPieSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRPieSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRPieSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRPieSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,69 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; + + +/** + * Represents the series for the Pie dataset. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRPieSeries extends JRCloneable +{ + + /** + * @return a java.lang.Comparable object representing + * the categories that will make up the slices in the pie chart. + */ + public JRExpression getKeyExpression(); + + /** + * @return a numeric expression that produces the values corresponding + * to each category/key in the dataset. + */ + public JRExpression getValueExpression(); + + /** + * @return the label expression. If this expression is missing, the chart + * will display default labels for each slice in the pie chart. Use this + * expression, which returns java.lang.String values, to customize + * the item labels for the pie chart. + */ + public JRExpression getLabelExpression(); + + /** + * Returns the hyperlink specification for chart sections. + *

    + * The hyperlink will be evaluated for every chart section and an image map will be created for the chart. + *

    + * + * @return hyperlink specification for chart sections + */ + public JRHyperlink getSectionHyperlink(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRScatterPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRScatterPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRScatterPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRScatterPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,70 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRExpression; + +/** + * Scatter plots are used only with Scatter charts. They render items as points on a two-axis + * plot area. This plot closely resembles the Line plot, in that it lets users + * configure the labels for both axes, the rendering of lines to unite the item points, and the + * rendering of the small shapes that mark each item point on the target plot area. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRScatterPlot extends JRChartPlot, JRXAxisFormat, JRYAxisFormat, JRCommonLinePlot +{ + + /** + * @return the x axis label expression + */ + public JRExpression getXAxisLabelExpression(); + + /** + * @return the y axis label expression + */ + public JRExpression getYAxisLabelExpression(); + + /** + * @return the minimum value expression for the domain axis + */ + public JRExpression getDomainAxisMinValueExpression(); + + /** + * @return the maximum value expression for the domain axis + */ + public JRExpression getDomainAxisMaxValueExpression(); + + /** + * @return the minimum value expression for the range axis + */ + public JRExpression getRangeAxisMinValueExpression(); + + /** + * @return the maximum value expression for the range axis + */ + public JRExpression getRangeAxisMaxValueExpression(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRThermometerPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRThermometerPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRThermometerPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRThermometerPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,94 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import java.awt.Color; + +import net.sf.jasperreports.charts.type.ValueLocationEnum; +import net.sf.jasperreports.engine.JRChartPlot; + +/** + * Represents the display options of a Thermometer chart. A Thermometer chart + * consists of the outline of a thermometer, a scale showing the reading of + * the thermometer, three optional ranges corresponding to "good", "warning" + * and "critical", and the textual display of the value. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public interface JRThermometerPlot extends JRChartPlot +{ + /** + * Returns the range of values displayed by this thermometer. This range + * corresponds with the scale on the thermometer. + * + * @return the range of values displayed by this thermometer + */ + public JRDataRange getDataRange(); + + /** + * Returns formatting information for the textual representation of the value. + * + * @return formatting information for the value + */ + public JRValueDisplay getValueDisplay(); + + /** + * Returns the location where the value of the thermometer will be shown. The + * return value will be one of {@link net.sf.jasperreports.charts.type.ValueLocationEnum#NONE NONE}, + * {@link net.sf.jasperreports.charts.type.ValueLocationEnum#LEFT LEFT}, {@link net.sf.jasperreports.charts.type.ValueLocationEnum#RIGHT RIGHT} or + * {@link net.sf.jasperreports.charts.type.ValueLocationEnum#BULB BULB}. + * + * @return the location where the value of the thermometer will be shown + */ + public ValueLocationEnum getValueLocationValue(); + + /** + * Returns the color of the "mercury" in the thermometer when the value is + * not in a defined range. + * + * @return the default color of the mercury in the thermometer + */ + public Color getMercuryColor(); + + /** + * Returns the low range, or null if undefined. + * + * @return the low range, or null if undefined. + */ + public JRDataRange getLowRange(); + + /** + * Returns the medium range, or null if undefined. + * + * @return the medium range, or null if undefined. + */ + public JRDataRange getMediumRange(); + + /** + * Returns the high range, or null if undefined. + * + * @return the high range, or null if undefined. + */ + public JRDataRange getHighRange(); +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRTimeAxisFormat.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRTimeAxisFormat.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRTimeAxisFormat.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRTimeAxisFormat.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import java.awt.Color; + +import net.sf.jasperreports.engine.JRFont; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRTimeAxisFormat +{ + + /** + * + */ + public JRFont getTimeAxisLabelFont(); + + /** + * + */ + public Color getTimeAxisLabelColor(); + + /** + * + */ + public Color getOwnTimeAxisLabelColor(); + + /** + * + */ + public JRFont getTimeAxisTickLabelFont(); + + /** + * + */ + public Color getTimeAxisTickLabelColor(); + + /** + * + */ + public Color getOwnTimeAxisTickLabelColor(); + + /** + * + */ + public String getTimeAxisTickLabelMask(); + + /** + * + */ + public Boolean getTimeAxisVerticalTickLabels(); + + /** + * + */ + public Color getTimeAxisLineColor(); + + /** + * + */ + public Color getOwnTimeAxisLineColor(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRTimePeriodDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRTimePeriodDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRTimePeriodDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRTimePeriodDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,46 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartDataset; + +/** + * The Time Period dataset is very much like the Time Series dataset in that it wraps series + * consisting of (time period, numeric value) pairs. The only difference is that in this case + * the time periods are not chosen from a predefined list but can be arbitrary time intervals. + * This kind of dataset is for use only with XY Bar charts. + * + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + * @see JRTimeSeriesDataset + */ +public interface JRTimePeriodDataset extends JRChartDataset { + + /** + * @return an array of {@link JRTimePeriodSeries} objects representing the + * series for the Time Period chart + * @see JRTimePeriodSeries + */ + public JRTimePeriodSeries[] getSeries(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRTimePeriodSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRTimePeriodSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRTimePeriodSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRTimePeriodSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; + +/** + * Represents the series for the Time Period dataset. + * + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public interface JRTimePeriodSeries extends JRCloneable +{ + + /** + * @return a java.lang.Comparable object that identifies each series. + */ + public JRExpression getSeriesExpression(); + + /** + * @return a java.util.Date expression representing the + * start of the time period + */ + public JRExpression getStartDateExpression(); + + /** + * @return a java.util.Date expression representing the + * end of the time period + */ + public JRExpression getEndDateExpression(); + + /** + * @return a numeric expression representing the value associated with the time period. + */ + public JRExpression getValueExpression(); + + /** + * @return the label expression. If present, its values will be used to customize + * item labels in the resulting chart. + */ + public JRExpression getLabelExpression(); + + + /** + * Returns the hyperlink specification for chart items. + *

    + * The hyperlink will be evaluated for every chart item and a image map will be created for the chart. + *

    + * + * @return hyperlink specification for chart items + */ + public JRHyperlink getItemHyperlink(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRTimeSeriesDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRTimeSeriesDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRTimeSeriesDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRTimeSeriesDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartDataset; + +/** + * This dataset wraps one or multiple time series. A time series consists of + * (time period, numeric value) pairs. The Time Series dataset can be used with + * Times Series and XY Bar charts. + * + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public interface JRTimeSeriesDataset extends JRChartDataset { + + /** + * @return an array of {@link JRTimeSeries} objects representing the + * series for the Time Series chart + * @see JRTimeSeries + */ + public JRTimeSeries[] getSeries(); + + /** + * + * @return the time period. Specifies the type of the data series inside + * the dataset. Time series can contain numeric values associated with + * days, months, years, or other predefined time periods. + * @see net.sf.jasperreports.charts.type.TimePeriodEnum + */ + public Class getTimePeriod(); + + /** + * + * @param timePeriod the time period associated with + * days, months, years, or other predefined time periods. + * @see net.sf.jasperreports.charts.type.TimePeriodEnum + */ + public void setTimePeriod(Class timePeriod); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRTimeSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRTimeSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRTimeSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRTimeSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; + + +/** + * Represents the series for the Time Series dataset. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRTimeSeries extends JRCloneable +{ + + /** + * @return a java.lang.Comparable object representing + * the expression of the series name. Specifies the series to which + * to add the current value pair when incrementing the dataset. + */ + public JRExpression getSeriesExpression(); + + /** + * @return a java.util.Date expression from which the engine + * will extract the corresponding time period depending on the value set + * for the timePeriod attribute. + * @see JRTimeSeriesDataset#getTimePeriod() + */ + public JRExpression getTimePeriodExpression(); + + /** + * @return a numeric expression representing the + * value to associate with the corresponding time period value when + * incrementing the current series of the dataset. + */ + public JRExpression getValueExpression(); + + /** + * @return the label expression. If present, it helps + * customize the item labels inside charts. + */ + public JRExpression getLabelExpression(); + + + /** + * Returns the hyperlink specification for chart items. + *

    + * The hyperlink will be evaluated for every chart item and a image map will be created for the chart. + *

    + * + * @return hyperlink specification for chart items + */ + public JRHyperlink getItemHyperlink(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRTimeSeriesPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRTimeSeriesPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRTimeSeriesPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRTimeSeriesPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,70 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.JRExpression; + +/** + * This type of plot is similar to the Line plot and Scatter plot in that it lets users configure + * the labels for both axes, the rendering of lines to connect the item points, and the rendering + * of the small shapes that mark each item point on the target plot area. It is used only in + * combination with Time Series charts. + * + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public interface JRTimeSeriesPlot extends JRChartPlot, JRTimeAxisFormat, JRValueAxisFormat, JRCommonLinePlot +{ + + /** + * @return the time axis label expression + */ + public JRExpression getTimeAxisLabelExpression(); + + /** + * @return the value axis label expression + */ + public JRExpression getValueAxisLabelExpression(); + + /** + * @return the minimum value expression for the domain axis + */ + public JRExpression getDomainAxisMinValueExpression(); + + /** + * @return the maximum value expression for the domain axis + */ + public JRExpression getDomainAxisMaxValueExpression(); + + /** + * @return the minimum value expression for the range axis + */ + public JRExpression getRangeAxisMinValueExpression(); + + /** + * @return the maximum value expression for the range axis + */ + public JRExpression getRangeAxisMaxValueExpression(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRValueAxisFormat.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRValueAxisFormat.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRValueAxisFormat.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRValueAxisFormat.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,85 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import java.awt.Color; + +import net.sf.jasperreports.engine.JRFont; + +/** + * @author Flavus Sana (flavius_sana@users.sourceforge.net) + */ +public interface JRValueAxisFormat +{ + + /** + * + */ + public JRFont getValueAxisLabelFont(); + + /** + * + */ + public Color getValueAxisLabelColor(); + + /** + * + */ + public Color getOwnValueAxisLabelColor(); + + /** + * + */ + public JRFont getValueAxisTickLabelFont(); + + /** + * + */ + public Color getValueAxisTickLabelColor(); + + /** + * + */ + public Color getOwnValueAxisTickLabelColor(); + + /** + * + */ + public String getValueAxisTickLabelMask(); + + /** + * + */ + public Boolean getValueAxisVerticalTickLabels(); + + /** + * + */ + public Color getValueAxisLineColor(); + + /** + * + */ + public Color getOwnValueAxisLineColor(); +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRValueDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRValueDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRValueDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRValueDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartDataset; +import net.sf.jasperreports.engine.JRExpression; + + +/** + * This class represents a dataset that consists of a single + * value. It is used by Meter and Thermometer charts, which + * plot a single value against a range. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public interface JRValueDataset extends JRChartDataset +{ + + /** + * Returns the expression that indicates the value held + * by this dataset. + * + * @return the expression that indicates the value held by + * this dataset + */ + public JRExpression getValueExpression(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRValueDisplay.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRValueDisplay.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRValueDisplay.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRValueDisplay.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,72 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRFont; + +import java.awt.Color; + + +/** + * Represents the formatting option for the textual + * representation of a value displayed in a Meter or + * Thermometer chart. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public interface JRValueDisplay extends JRCloneable +{ + /** + * + */ + public JRChart getChart(); + + /** + * Returns the color to use when writing the value. + * + * @return the color to use when writing the value + */ + public Color getColor(); + + /** + * Returns the formatting mask to use when writing the value. + * The mask will be specified using the patterns defined + * in java.text.DecimalFormat. + * + * @return the formatting mask to use when writing the value + */ + public String getMask(); + + /** + * Returns the font to use when writing the value. + * + * @return the font to use when writing the value + */ + public JRFont getFont(); + + public JRValueDisplay clone(JRChart parentChart); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRXAxisFormat.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRXAxisFormat.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRXAxisFormat.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRXAxisFormat.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,86 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import java.awt.Color; + +import net.sf.jasperreports.engine.JRFont; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRXAxisFormat +{ + + /** + * + */ + public JRFont getXAxisLabelFont(); + + /** + * + */ + public Color getXAxisLabelColor(); + + /** + * + */ + public Color getOwnXAxisLabelColor(); + + /** + * + */ + public JRFont getXAxisTickLabelFont(); + + /** + * + */ + public Color getXAxisTickLabelColor(); + + /** + * + */ + public Color getOwnXAxisTickLabelColor(); + + /** + * + */ + public String getXAxisTickLabelMask(); + + /** + * + */ + public Boolean getXAxisVerticalTickLabels(); + + /** + * + */ + public Color getXAxisLineColor(); + + /** + * + */ + public Color getOwnXAxisLineColor(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRXyDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRXyDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRXyDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRXyDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartDataset; + + +/** + * This dataset is a wrapper for data series made of (x, y) value pairs and is used for + * rendering XY Bar, XY Line, XY Area, and Scatter Plot charts. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRXyDataset extends JRChartDataset +{ + + /** + * @return an array of {@link JRXySeries} objects representing the + * series for the XY charts. + * @see JRXySeries + */ + public JRXySeries[] getSeries(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRXySeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRXySeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRXySeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRXySeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; + + +/** + * Represents the series for the XY dataset. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRXySeries extends JRCloneable +{ + + /** + * @return a java.lang.Comparable object that identifies + * a certain data series in the overall dataset. It can return different values, + * which will result in the dataset containing multiple series even when a single + * <xySeries> tag is used inside the <xyDataset> tag. + */ + public JRExpression getSeriesExpression(); + + /** + * @return a numeric expression representing the X value from the (x, y) pair + * that will be added to the current data series. + */ + public JRExpression getXValueExpression(); + + /** + * @return a numeric expression representing the Y value from the (x, y) pair + * that will be added to the current data series. + */ + public JRExpression getYValueExpression(); + + /** + * @return the label expression. If present, it helps + * customize the item labels inside charts. + */ + public JRExpression getLabelExpression(); + + + /** + * Returns the hyperlink specification for chart items. + *

    + * The hyperlink will be evaluated for every chart item and a image map will be created for the chart. + *

    + * + * @return hyperlink specification for chart items + */ + public JRHyperlink getItemHyperlink(); + + /** + * + */ + public Boolean getAutoSort(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRXyzDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRXyzDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRXyzDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRXyzDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRChartDataset; + +/** + * The XYZ dataset wraps series consisting of (x, y, z) items. + * It is used only by the Bubble chart + * + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public interface JRXyzDataset extends JRChartDataset { + + /** + * @return an array of {@link JRXyzSeries} objects representing the + * series for the XYZ charts. + * @see JRXyzSeries + */ + public JRXyzSeries[] getSeries(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRXyzSeries.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRXyzSeries.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRXyzSeries.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRXyzSeries.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,72 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRHyperlink; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public interface JRXyzSeries extends JRCloneable +{ + /** + * @return a java.lang.Comparable object that identifies + * a certain data series in the overall dataset. It can return different values, + * which will result in the dataset containing multiple series even when a single + * <xyzSeries> tag is used inside the <xyzDataset> tag. + */ + public JRExpression getSeriesExpression(); + + /** + * @return a numeric expression representing the X value from the (x, y, z) item + * that will be added to the current data series. + */ + public JRExpression getXValueExpression(); + + /** + * @return a numeric expression representing the Y value from the (x, y, z) item + * that will be added to the current data series. + */ + public JRExpression getYValueExpression(); + + /** + * @return a numeric expression representing the Z value from the (x, y, z) item + * that will be added to the current data series. + */ + public JRExpression getZValueExpression(); + + + /** + * Returns the hyperlink specification for chart items. + *

    + * The hyperlink will be evaluated for every chart item and a image map will be created for the chart. + *

    + * + * @return hyperlink specification for chart items + */ + public JRHyperlink getItemHyperlink(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRYAxisFormat.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRYAxisFormat.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/JRYAxisFormat.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/JRYAxisFormat.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,86 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts; + +import java.awt.Color; + +import net.sf.jasperreports.engine.JRFont; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface JRYAxisFormat +{ + + /** + * + */ + public JRFont getYAxisLabelFont(); + + /** + * + */ + public Color getYAxisLabelColor(); + + /** + * + */ + public Color getOwnYAxisLabelColor(); + + /** + * + */ + public JRFont getYAxisTickLabelFont(); + + /** + * + */ + public Color getYAxisTickLabelColor(); + + /** + * + */ + public Color getOwnYAxisTickLabelColor(); + + /** + * + */ + public String getYAxisTickLabelMask(); + + /** + * + */ + public Boolean getYAxisVerticalTickLabels(); + + /** + * + */ + public Color getYAxisLineColor(); + + /** + * + */ + public Color getOwnYAxisLineColor(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,200 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +/** + * Contains interfaces for chart plots and chart datasets. + *
    + *

    The Built-In Chart Component

    + * JasperReports provides built-in support for charts using the chart component based on the + * JFreeChart library. It exposes a limited set of visual + * properties that the charting package actually supports. This limited set should be + * sufficient for the majority of users, and in the future it may be extended to accommodate + * community feedback and requests. + *
    + * With the built-in chart component, users only have to apply the desired visual settings and + * define the expressions that will help the engine build the chart dataset incrementally + * during the iteration through the report data source. + *
    + * When including and configuring a chart component, three entities are involved: + *
      + *
    • The overall chart component
    • + *
    • The chart dataset (which groups chart data-related settings)
    • + *
    • The chart plot (which groups visual settings related to the way the chart items are rendered)
    • + *
    + * JasperReports currently supports the following types of charts: Pie, Pie 3D, Bar, Bar 3D, + * XY Bar, Stacked Bar, Stacked Bar 3D, Line, XY Line, Area, Stacked Area, XY Area, Scatter Plot, + * Bubble, Time Series, High-Low-Open-Close, Candlestick and Gantt. + *
    + * For each type of chart there is a special JRXML tag that groups various chart settings, + * including the dataset and the plot. + *
    + *

    Chart Properties

    + * All chart types have a common set of properties. Charts are normal report elements, so + * they share some of their properties with all the other report elements. Charts are also + * box elements and can have hyperlinks associated with them. + *
    + * Charts resemble text fields and images in that they can postpone their actual rendering + * until all the data needed for this operation becomes available to the reporting engine. + * Data needed by a chart is gathered by the associated dataset during iteration through the + * report data. However, there are situations that require displaying charts at the beginning of a document, + * where the necessary data is not yet available, given the way the engine process data and + * renders the final document. + *
    + * In such cases, the chart evaluation can be postponed using the evaluationTime and + * evaluationGroup attributes, which work in the same manner as for text fields and + * images. + *
    + * Chart-specific settings that apply to all types of charts are grouped under a special + * JRXML tag called <chart>: + *
      + *
    • isShowLegend: flag attribute that specifies if the legend is visible on the chart
    • + *
    • customizerClass: attribute that specifies the name of a chart customizer class
    • + *
    • renderType: attribute that specifies the chart rendering type
    • + *
    • theme: attribute that specifies the name of a custom chart theme
    • + *
    • chartTitle: element to customize the chart title
    • + *
    • chartSubtitle: element to customize the chart subtitle
    • + *
    • chartLegend: element to customize the chart legend
    • + *
    + *

    Chart Rendering

    + * In generated reports the output produced by a chart element is an image element. Image elements are drawn using + * implementations of the {@link net.sf.jasperreports.engine.Renderable Renderable} interface. + * The renderType attribute specifies the renderer implementation that will be used to render the + * chart during export or report display. By default, JasperReports recognizes the following values for this attribute: + *
      + *
    • draw: the chart is drawn directly on the target graphic context using the JFreeChart API
    • + *
    • image: an image is first produced from the chart and this image in turn gets rendered onto the target graphic context
    • + *
    • svg: the chart is transformed into the SVG format and from that format is then rendered onto the target graphic context
    • + *
    + *

    Chart Title, Subtitle and Legend

    + * All charts can have a title, a subtitle and a legend. All of them are optional and can be customized + * for color, font, and position. + *
    + *

    Chart Customizer and Chart Themes

    + * To provide full control over chart customization even when using the built-in chart + * component, JasperReports can make use of either a chart theme implementation, or of a + * chart customizer implementation associated with the chart element, or both. + *
    + * Chart themes are a more recent addition to the library and in a way they deprecate the + * chart customizers because they bring enhanced capabilities in controlling chart output. + *
    + * A chart customizer is an implementation of the + * {@link net.sf.jasperreports.engine.JRChartCustomizer JRChartCustomizer} interface that is associated + * with the chart element using the customizerClass attribute. The easiest way to + * implement this interface is by extending the + * {@link net.sf.jasperreports.engine.JRAbstractChartCustomizer JRAbstractChartCustomizer} class and thus + * having access to parameters, fields, and variables, for more flexible chart customization + * based on report data. + *
    + * Chart customizer only allow modifying the + * JFreeChart object that is created externally and passed in to them. + *
    + * Chart themes give more control over chart output, including + * the creation of the JFreeChart object itself. Also, chart themes + * affect a whole range of chart types across multiple reports and are not necessarily tied to + * a specific chart element within a report. They can even apply globally to all charts within + * a given JasperReports deployment, applying a new look and feel to all charts created. + *
    + * A chart theme can be set globally using a configuration property within the + * jasperreports.properties file as follows: + *

    + * net.sf.jasperreports.chart.theme=theme_name + *

    + * The global chart theme can be overridden at report level using the following report + * property in the report template: + *

    + * <property name="net.sf.jasperreports.chart.theme" value="theme_name"/> + *

    + * If needed, at chart element level, the chart theme is specified using the theme attribute. + *
    + *

    Chart Datasets

    + * One of the most important considerations when putting a chart element into a report + * template is the data mapping. The chart will need to extract its data from whatever data is + * available inside the report at runtime. + *
    + * The data-oriented component for mapping report data and retrieving chart data at runtime is + * the chart dataset. A chart dataset is an entity that somewhat resembles a report variable because it gets + * initialized and incremented at specified moments during the report-filling process and + * iteration through the report data source. + *
    + * Like a report variable, at any moment a chart dataset holds a certain value, which is a complex data + * structure that gets incremented and will be used for rendering the chart at the appropriate moment. + *
    + * Several types of chart datasets are available in JasperReports because each type of chart + * works with certain datasets: Pie, Category, XY, Time Series, Time Period, XYZ, High-Low and Gantt. + *
    + * The JasperReports object model uses the + * {@link net.sf.jasperreports.engine.JRChartDataset JRChartDataset} interface to define chart datasets. + * There are implementations of this interface for each of the aforementioned dataset types. + * All chart datasets initialize and increment in the same way, and differ only in the type of + * data or data series they map. + * Common dataset properties are grouped under the <dataset> tag in JRXML format. + *
    + *

    Chart Plot

    + * The chart plot is the area of the chart on which the axes and items are rendered. Plots + * differ based on the type of chart. Some plots specialize in drawing pies; others specialize + * in drawing bar items or lines. + *
    + * Each type of plot comes with its own set of properties or attributes for customizing the + * chart's appearance and behavior. + *
    + * There is, however, a subset of plot properties common to all plot types, exposed in the + * {@link net.sf.jasperreports.engine.JRChartPlot JRChartPlot} interface. They are grouped + * under the <plot> tag in JRXML and can be part of any chart/plot definition in the report + * template: + *
    + *
    Plot Background Color
    + *
    The backcolor attribute can be used to specify the color used for drawing the plot's area background.
    + *
    Plot Orientation
    + *
    Some types of plots can draw their items either vertically or horizontally. For instance, Bar charts can display + * either vertical or horizontal bars. Pie charts do not use this setting, but since the majority of charts do have a + * concept of orientation, the attribute was included among the common plot settings.
    + *
    Plot Transparency
    + *
    When filling up the background with a specified color or drawing items on the target device, the plot can use a + * customizable degree of transparency, which you can control using the backgroundAlpha and foregroundAlpha + * attributes. These attributes accept numeric values ranging from 0 to 1. The default for both attributes is 1, which means + * drawings on the plot area are opaque.
    + *
    Label Rotation
    + *
    The text labels on the x axis of a chart can be rotated clockwise or counterclockwise by setting a positive or a + * negative numeric value representing the number of degrees to the labelRotation attribute of the plot. This attribute + * applies only to charts for which the x axis is not numeric or does not display dates.
    + *
    Series Colors
    + *
    To control the color of each series in a chart displaying multiple series, you can use the <seriesColor> + * tag available at the chart-plot level. If only one <seriesColor> tag is specified, it becomes the color + * of the first series. If more than one <seriesColor> tag is specified, the chart will cycle through the + * supplied colors. + *
    + * Pie charts do not have multiple series, but they do need different colors for each slice, so the specified colors + * will be used. Meter and Thermometer charts do not have series and will ignore any <seriesColor> settings. + *
    + * When used in a chart that is part of a Multiaxis chart, the series colors are treated a bit differently. The default + * color series to cycle through is defined in the plot of the Multiaxis chart, and the color series for the nested charts + * define series colors for that chart only. This is useful when a Multiaxis chart contains several line charts, each with + * one series. By default every line will be the first in its plot and will have the first color defined in the Multiaxis + * plot, so every line will be the same color. To solve this, a <seriesColor> can be set for each nested + * chart to override the default colors. + *
    + * All series colors are sorted by the value of the seriesOrder attribute and appear in that order when coloring the series.
    + *
    + * + */ +package net.sf.jasperreports.charts; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/AxisPositionEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/AxisPositionEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/AxisPositionEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/AxisPositionEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,106 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.type; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.JREnum; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public enum AxisPositionEnum implements JREnum +{ + /** + * Position the axis to the left of a VERTICAL chart or on the top + * of a HORIZONTAL chart. + */ + LEFT_OR_TOP((byte)1, "leftOrTop"), + + /** + * Position the axis to the right of a VERTICAL chart or on the bottom + * of a HORIZONTAL chart. + */ + RIGHT_OR_BOTTOM((byte)2, "rightOrBottom"); + + /** + * + */ + private final transient byte value; + private final transient String name; + + private AxisPositionEnum(byte value, String name) + { + this.value = value; + this.name = name; + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + @Override + public Byte getValueByte() + { + return new Byte(value); + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + @Override + public final byte getValue() + { + return value; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static AxisPositionEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + public static AxisPositionEnum getByValue(Byte value) + { + return (AxisPositionEnum)EnumUtil.getByValue(values(), value); + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + public static AxisPositionEnum getByValue(byte value) + { + return getByValue(new Byte(value)); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/EdgeEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/EdgeEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/EdgeEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/EdgeEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,115 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.type; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.JREnum; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public enum EdgeEnum implements JREnum +{ + /** + * + */ + TOP((byte)1, "Top"), + + /** + * + */ + BOTTOM((byte)2, "Bottom"), + + /** + * + */ + LEFT((byte)3, "Left"), + + /** + * + */ + RIGHT((byte)4, "Right"); + + + /** + * + */ + private final transient byte value; + private final transient String name; + + private EdgeEnum(byte value, String name) + { + this.value = value; + this.name = name; + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + @Override + public Byte getValueByte() + { + return new Byte(value); + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + @Override + public final byte getValue() + { + return value; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static EdgeEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + public static EdgeEnum getByValue(Byte value) + { + return (EdgeEnum)EnumUtil.getByValue(values(), value); + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + public static EdgeEnum getByValue(byte value) + { + return getByValue(new Byte(value)); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/MeterShapeEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/MeterShapeEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/MeterShapeEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/MeterShapeEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,118 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.type; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.JREnum; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public enum MeterShapeEnum implements JREnum +{ + /** + * The portion of the circle described by the Meter that is not occupied by the + * Meter is drawn as a chord. (A straight line connects the ends.) + */ + CHORD((byte)0, "chord"), + + /** + * The portion of the circle described by the Meter that is not occupied by the + * Meter is drawn as a circle. + */ + CIRCLE((byte)1, "circle"), + + /** + * The portion of the circle described by the Meter that is not occupied by the + * Meter is not drawn. + */ + PIE((byte)2, "pie"), + + /** + * The portion of the circle described by the Meter that is not occupied by the + * Meter is drawn as a circle, and handled with specific dial objects. + */ + DIAL((byte)3, "dial"); + + /** + * + */ + private final transient byte value; + private final transient String name; + + private MeterShapeEnum(byte value, String name) + { + this.value = value; + this.name = name; + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + @Override + public Byte getValueByte() + { + return new Byte(value); + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + @Override + public final byte getValue() + { + return value; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static MeterShapeEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + public static MeterShapeEnum getByValue(Byte value) + { + return (MeterShapeEnum)EnumUtil.getByValue(values(), value); + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + public static MeterShapeEnum getByValue(byte value) + { + return getByValue(new Byte(value)); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +/** + * Contains enum types used by the built-in chart component. + */ +package net.sf.jasperreports.charts.type; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/PlotOrientationEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/PlotOrientationEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/PlotOrientationEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/PlotOrientationEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,100 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.type; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + +import org.jfree.chart.plot.PlotOrientation; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public enum PlotOrientationEnum implements NamedEnum +{ + /** + * + */ + HORIZONTAL(PlotOrientation.HORIZONTAL, "Horizontal"), + + /** + * + */ + VERTICAL(PlotOrientation.VERTICAL, "Vertical"); + + + /** + * + */ + private final transient PlotOrientation value; + private final transient String name; + + private PlotOrientationEnum(PlotOrientation orientation, String name) + { + this.value = orientation; + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public final PlotOrientation getOrientation() + { + return this.value; + } + + /** + * + */ + public static PlotOrientationEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + public static PlotOrientationEnum getByValue(PlotOrientation orientation) + { + PlotOrientationEnum[] values = values(); + if (values != null && orientation != null) + { + for(PlotOrientationEnum e:values) + { + if (orientation.equals(e.getOrientation())) + { + return e; + } + } + } + return null; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/ScaleTypeEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/ScaleTypeEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/ScaleTypeEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/ScaleTypeEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,92 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.type; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedValueEnum; + +import org.jfree.chart.renderer.xy.XYBubbleRenderer; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public enum ScaleTypeEnum implements NamedValueEnum +{ + /** + * + */ + ON_BOTH_AXES((byte)XYBubbleRenderer.SCALE_ON_BOTH_AXES, "BothAxes"), + + /** + * + */ + ON_DOMAIN_AXIS((byte)XYBubbleRenderer.SCALE_ON_DOMAIN_AXIS, "DomainAxis"), + + /** + * + */ + ON_RANGE_AXIS((byte)XYBubbleRenderer.SCALE_ON_RANGE_AXIS, "RangeAxis"); + + + /** + * + */ + private final transient int value; + private final transient String name; + + private ScaleTypeEnum(int value, String name) + { + this.value = value; + this.name = name; + } + + @Override + public final Integer getValue() + { + return value; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static ScaleTypeEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + public static ScaleTypeEnum getByValue(Integer value) + { + return EnumUtil.getByValue(values(), value); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/TimePeriodEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/TimePeriodEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/TimePeriodEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/TimePeriodEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,144 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.type; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + +import org.jfree.data.time.Day; +import org.jfree.data.time.Hour; +import org.jfree.data.time.Millisecond; +import org.jfree.data.time.Minute; +import org.jfree.data.time.Month; +import org.jfree.data.time.Quarter; +import org.jfree.data.time.Second; +import org.jfree.data.time.Week; +import org.jfree.data.time.Year; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public enum TimePeriodEnum implements NamedEnum +{ + /** + * + */ + YEAR(Year.class, "Year"), + + /** + * + */ + QUARTER(Quarter.class, "Quarter"), + + /** + * + */ + MONTH(Month.class, "Month"), + + /** + * + */ + WEEK(Week.class, "Week"), + + /** + * + */ + DAY(Day.class, "Day"), + + /** + * + */ + HOUR(Hour.class, "Hour"), + + /** + * + */ + MINUTE(Minute.class, "Minute"), + + /** + * + */ + SECOND(Second.class, "Second"), + + /** + * + */ + MILLISECOND(Millisecond.class, "Milisecond");//FIXMENOW should we fix this spelling error? + + + /** + * + */ + private final transient Class value; + private final transient String name; + + private TimePeriodEnum(Class clazz, String name) + { + this.value = clazz; + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public final Class getTimePeriod() + { + return this.value; + } + + /** + * + */ + public static TimePeriodEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } + + /** + * + */ + public static TimePeriodEnum getByValue(Class clazz) + { + TimePeriodEnum[] values = values(); + if (values != null && clazz != null) + { + for(TimePeriodEnum e:values) + { + if (clazz.getName().equals(e.getTimePeriod().getName())) + { + return e; + } + } + } + return null; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/ValueLocationEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/ValueLocationEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/type/ValueLocationEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/type/ValueLocationEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,117 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.type; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.JREnum; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public enum ValueLocationEnum implements JREnum +{ + /** + * The value should not be displayed. + */ + NONE((byte)0, "none"), + + /** + * The value should be displayed to the left of the thermometer. + */ + LEFT((byte)1, "left"), + + /** + * The value should be displayed to the right of the thermometer. + */ + RIGHT((byte)2, "right"), + + /** + * The value should be displayed in the bulb of the thermometer. When + * using this option make sure the font is small enough or the value short + * enough so the value fits in the bulb. + */ + BULB((byte)3, "bulb"); + + + /** + * + */ + private final transient byte value; + private final transient String name; + + private ValueLocationEnum(byte value, String name) + { + this.value = value; + this.name = name; + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + @Override + public Byte getValueByte() + { + return new Byte(value); + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + @Override + public final byte getValue() + { + return value; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static ValueLocationEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + public static ValueLocationEnum getByValue(Byte value) + { + return (ValueLocationEnum)EnumUtil.getByValue(values(), value); + } + + /** + * @deprecated Used only by deprecated serialized fields. + */ + public static ValueLocationEnum getByValue(byte value) + { + return getByValue(new Byte(value)); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/AbstractChartRenderableFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/AbstractChartRenderableFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/AbstractChartRenderableFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/AbstractChartRenderableFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public abstract class AbstractChartRenderableFactory implements ChartRenderableFactory +{ +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/CategoryChartHyperlinkProvider.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/CategoryChartHyperlinkProvider.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/CategoryChartHyperlinkProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/CategoryChartHyperlinkProvider.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,74 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.util.Map; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRPrintHyperlink; + +import org.jfree.chart.entity.CategoryItemEntity; +import org.jfree.chart.entity.ChartEntity; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class CategoryChartHyperlinkProvider implements ChartHyperlinkProvider +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private Map,Map,JRPrintHyperlink>> itemHyperlinks; + + public CategoryChartHyperlinkProvider(Map,Map,JRPrintHyperlink>> itemHyperlinks) + { + this.itemHyperlinks = itemHyperlinks; + } + + + @Override + public JRPrintHyperlink getEntityHyperlink(ChartEntity entity) + { + JRPrintHyperlink printHyperlink = null; + if (hasHyperlinks() && entity instanceof CategoryItemEntity) + { + CategoryItemEntity itemEntity = (CategoryItemEntity) entity; + Comparable serie = itemEntity.getRowKey(); + Map,JRPrintHyperlink> serieHyperlinks = itemHyperlinks.get(serie); + if (serieHyperlinks != null) + { + Comparable category = itemEntity.getColumnKey(); + printHyperlink = serieHyperlinks.get(category); + } + } + return printHyperlink; + } + + @Override + public boolean hasHyperlinks() + { + return itemHyperlinks != null && itemHyperlinks.size() > 0; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/CategoryLabelGenerator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/CategoryLabelGenerator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/CategoryLabelGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/CategoryLabelGenerator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,70 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.text.NumberFormat; +import java.util.Locale; +import java.util.Map; + +import net.sf.jasperreports.engine.JRConstants; + +import org.jfree.chart.labels.StandardCategoryItemLabelGenerator; +import org.jfree.data.category.CategoryDataset; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class CategoryLabelGenerator extends StandardCategoryItemLabelGenerator +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private Map, Map, String>> labelsMap; + + public CategoryLabelGenerator(Map, Map, String>> labelsMap) + { + this(labelsMap, Locale.getDefault()); + } + + public CategoryLabelGenerator(Map, Map, String>> labelsMap, Locale locale) + { + super(DEFAULT_LABEL_FORMAT_STRING, + NumberFormat.getNumberInstance(locale), + NumberFormat.getPercentInstance(locale)); + + this.labelsMap = labelsMap; + } + + @Override + public String generateLabel(CategoryDataset dataset, int series, int category) + { + Comparable seriesName = dataset.getRowKey(series); + Map, String> labels = labelsMap.get(seriesName); + if(labels != null) + { + return labels.get(dataset.getColumnKey(category)); + } + return super.generateLabel(dataset, series, category); + } +} \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/ChartHyperlinkProvider.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/ChartHyperlinkProvider.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/ChartHyperlinkProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/ChartHyperlinkProvider.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.io.Serializable; + +import net.sf.jasperreports.engine.JRPrintHyperlink; + +import org.jfree.chart.entity.ChartEntity; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface ChartHyperlinkProvider extends Serializable +{ + public JRPrintHyperlink getEntityHyperlink(ChartEntity entity); + + public boolean hasHyperlinks(); +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/ChartRenderableFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/ChartRenderableFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/ChartRenderableFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/ChartRenderableFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.awt.geom.Rectangle2D; + +import org.jfree.chart.JFreeChart; + +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.renderers.Renderable; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface ChartRenderableFactory +{ + /** + * + */ + public static final String PROPERTY_CHART_RENDERER_FACTORY_PREFIX = JRPropertiesUtil.PROPERTY_PREFIX + "chart.renderer.factory."; + + public Renderable getRenderable( + JasperReportsContext jasperReportsContext, + JFreeChart chart, + ChartHyperlinkProvider chartHyperlinkProvider, + Rectangle2D rectangle + ); +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/ChartUtil.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/ChartUtil.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/ChartUtil.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/ChartUtil.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,460 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.awt.Graphics2D; +import java.awt.geom.Rectangle2D; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.StringTokenizer; + +import org.jfree.chart.ChartRenderingInfo; +import org.jfree.chart.JFreeChart; +import org.jfree.chart.axis.NumberAxis; +import org.jfree.chart.axis.NumberTickUnit; +import org.jfree.chart.axis.TickUnit; +import org.jfree.chart.axis.TickUnitSource; +import org.jfree.chart.axis.TickUnits; +import org.jfree.chart.entity.ChartEntity; +import org.jfree.chart.entity.EntityCollection; +import org.jfree.data.Range; + +import net.sf.jasperreports.charts.ChartTheme; +import net.sf.jasperreports.charts.ChartThemeBundle; +import net.sf.jasperreports.engine.DefaultJasperReportsContext; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.JRPrintImageArea; +import net.sf.jasperreports.engine.JRPrintImageAreaHyperlink; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.fill.DefaultChartTheme; +import net.sf.jasperreports.engine.util.JRSingletonCache; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public final class ChartUtil +{ + public static final String EXCEPTION_MESSAGE_KEY_CHART_THEME_NOT_FOUND = "charts.util.chart.theme.not.found"; + public static final String EXCEPTION_MESSAGE_KEY_RENDERER_FACTORY_NOT_SPECIFIED = "charts.util.renderer.factory.not.specified"; + /** + * + */ + private static final JRSingletonCache CHART_RENDERABLE_FACTORY_CACHE = + new JRSingletonCache(ChartRenderableFactory.class); + + protected static final double AUTO_TICK_UNIT_THRESHOLD = 1e12; + protected static final double AUTO_TICK_UNIT_FACTOR = 1000d; + + private JasperReportsContext jasperReportsContext; + + + /** + * + */ + private ChartUtil(JasperReportsContext jasperReportsContext) + { + this.jasperReportsContext = jasperReportsContext; + } + + + /** + * + */ + private static ChartUtil getDefaultInstance()//FIXMECONTEXT check this use of this + { + return new ChartUtil(DefaultJasperReportsContext.getInstance()); + } + + + /** + * + */ + public static ChartUtil getInstance(JasperReportsContext jasperReportsContext) + { + return new ChartUtil(jasperReportsContext); + } + + + /** + * + */ + public static List getImageAreaHyperlinks( + JFreeChart chart, + ChartHyperlinkProvider chartHyperlinkProvider, + Graphics2D grx, + Rectangle2D renderingArea + )// throws JRException + { + List areaHyperlinks = null; + + if (chartHyperlinkProvider != null && chartHyperlinkProvider.hasHyperlinks()) + { + ChartRenderingInfo renderingInfo = new ChartRenderingInfo(); + + if (grx == null) + { + chart.createBufferedImage((int) renderingArea.getWidth(), (int) renderingArea.getHeight(), renderingInfo); + } + else + { + chart.draw(grx, renderingArea, renderingInfo); + } + + EntityCollection entityCollection = renderingInfo.getEntityCollection(); + if (entityCollection != null && entityCollection.getEntityCount() > 0) + { + areaHyperlinks = new ArrayList(entityCollection.getEntityCount()); + + for (@SuppressWarnings("unchecked") + Iterator it = entityCollection.iterator(); it.hasNext();) + { + ChartEntity entity = it.next(); + JRPrintHyperlink printHyperlink = chartHyperlinkProvider.getEntityHyperlink(entity); + if (printHyperlink != null) + { + JRPrintImageArea area = getImageArea(entity); + + JRPrintImageAreaHyperlink areaHyperlink = new JRPrintImageAreaHyperlink(); + areaHyperlink.setArea(area); + areaHyperlink.setHyperlink(printHyperlink); + areaHyperlinks.add(areaHyperlink); + } + } + } + } + + return areaHyperlinks; + } + + private static JRPrintImageArea getImageArea(ChartEntity entity) + { + JRPrintImageArea area = new JRPrintImageArea(); + area.setShape(JRPrintImageArea.getShape(entity.getShapeType())); + + int[] coordinates = getCoordinates(entity); + if (coordinates != null) + { + area.setCoordinates(coordinates); + } + return area; + } + + private static int[] getCoordinates(ChartEntity entity) + { + int[] coordinates = null; + String shapeCoords = entity.getShapeCoords(); + if (shapeCoords != null && shapeCoords.length() > 0) + { + StringTokenizer tokens = new StringTokenizer(shapeCoords, ","); + coordinates = new int[tokens.countTokens()]; + int idx = 0; + while (tokens.hasMoreTokens()) + { + String coord = tokens.nextToken(); + coordinates[idx] = Integer.parseInt(coord); + ++idx; + } + } + return coordinates; + } + + /** + * + */ + public ChartTheme getTheme(String themeName) + { + if (themeName == null) + { + return new DefaultChartTheme(); + } + + List themeBundles = jasperReportsContext.getExtensions(ChartThemeBundle.class); + for (Iterator it = themeBundles.iterator(); it.hasNext();) + { + ChartThemeBundle bundle = it.next(); + ChartTheme chartTheme = bundle.getChartTheme(themeName); + if (chartTheme != null) + { + return chartTheme; + } + } + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_CHART_THEME_NOT_FOUND, + new Object[]{themeName}); + } + + /** + * @deprecated Replaced by {@link #getTheme(String)}. + */ + public static ChartTheme getChartTheme(String themeName) + { + return getDefaultInstance().getTheme(themeName); + } + + /** + * + */ + public ChartRenderableFactory getChartRenderableFactory(String renderType) + { + String factoryClass = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(ChartRenderableFactory.PROPERTY_CHART_RENDERER_FACTORY_PREFIX + renderType); + if (factoryClass == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_RENDERER_FACTORY_NOT_SPECIFIED, + new Object[]{renderType}); + } + + try + { + return CHART_RENDERABLE_FACTORY_CACHE.getCachedInstance(factoryClass); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + /** + * @deprecated replaced by {@link #createIntegerTickUnits(Locale)} + */ + @Deprecated + public TickUnitSource createIntegerTickUnits() + { + return createIntegerTickUnits(Locale.getDefault()); + } + + public TickUnitSource createIntegerTickUnits(Locale locale) + { + DecimalFormatSymbols formatSymbols = DecimalFormatSymbols.getInstance(locale); + + // copied from NumberAxis.createIntegerTickUnits() to preserve backward behaviour + TickUnits units = new TickUnits(); + DecimalFormat df0 = new DecimalFormat("0", formatSymbols); + DecimalFormat df1 = new DecimalFormat("#,##0", formatSymbols); + units.add(new NumberTickUnit(1, df0)); + units.add(new NumberTickUnit(2, df0)); + units.add(new NumberTickUnit(5, df0)); + units.add(new NumberTickUnit(10, df0)); + units.add(new NumberTickUnit(20, df0)); + units.add(new NumberTickUnit(50, df0)); + units.add(new NumberTickUnit(100, df0)); + units.add(new NumberTickUnit(200, df0)); + units.add(new NumberTickUnit(500, df0)); + units.add(new NumberTickUnit(1000, df1)); + units.add(new NumberTickUnit(2000, df1)); + units.add(new NumberTickUnit(5000, df1)); + units.add(new NumberTickUnit(10000, df1)); + units.add(new NumberTickUnit(20000, df1)); + units.add(new NumberTickUnit(50000, df1)); + units.add(new NumberTickUnit(100000, df1)); + units.add(new NumberTickUnit(200000, df1)); + units.add(new NumberTickUnit(500000, df1)); + units.add(new NumberTickUnit(1000000, df1)); + units.add(new NumberTickUnit(2000000, df1)); + units.add(new NumberTickUnit(5000000, df1)); + units.add(new NumberTickUnit(10000000, df1)); + units.add(new NumberTickUnit(20000000, df1)); + units.add(new NumberTickUnit(50000000, df1)); + units.add(new NumberTickUnit(100000000, df1)); + units.add(new NumberTickUnit(200000000, df1)); + units.add(new NumberTickUnit(500000000, df1)); + units.add(new NumberTickUnit(1000000000, df1)); + units.add(new NumberTickUnit(2000000000, df1)); + units.add(new NumberTickUnit(5000000000.0, df1)); + units.add(new NumberTickUnit(10000000000.0, df1)); + + // adding further values by default because 1E10 is not enough for some people + // using getNumberInstance because that's what NumberAxis.createIntegerTickUnits does + units.add(new NumberTickUnit(20000000000L, df1)); + units.add(new NumberTickUnit(50000000000L, df1)); + units.add(new NumberTickUnit(100000000000L, df1)); + units.add(new NumberTickUnit(200000000000L, df1)); + units.add(new NumberTickUnit(500000000000L, df1)); + units.add(new NumberTickUnit(1000000000000L, df1)); + units.add(new NumberTickUnit(2000000000000L, df1)); + units.add(new NumberTickUnit(5000000000000L, df1)); + units.add(new NumberTickUnit(10000000000000L, df1)); + units.add(new NumberTickUnit(20000000000000L, df1)); + units.add(new NumberTickUnit(50000000000000L, df1)); + units.add(new NumberTickUnit(100000000000000L, df1)); + units.add(new NumberTickUnit(200000000000000L, df1)); + units.add(new NumberTickUnit(500000000000000L, df1)); + units.add(new NumberTickUnit(1000000000000000L, df1)); + units.add(new NumberTickUnit(2000000000000000L, df1)); + units.add(new NumberTickUnit(5000000000000000L, df1)); + units.add(new NumberTickUnit(10000000000000000L, df1)); + units.add(new NumberTickUnit(20000000000000000L, df1)); + units.add(new NumberTickUnit(50000000000000000L, df1)); + units.add(new NumberTickUnit(100000000000000000L, df1)); + units.add(new NumberTickUnit(200000000000000000L, df1)); + units.add(new NumberTickUnit(500000000000000000L, df1)); + units.add(new NumberTickUnit(1000000000000000000L, df1)); + units.add(new NumberTickUnit(2000000000000000000L, df1)); + units.add(new NumberTickUnit(5000000000000000000L, df1)); + + return units; + } + + /** + * @deprecated replaced by {@link #createStandardTickUnits(Locale)} + */ + @Deprecated + public TickUnitSource createStandardTickUnits() + { + return createStandardTickUnits(Locale.getDefault()); + } + + public TickUnitSource createStandardTickUnits(Locale locale) + { + DecimalFormatSymbols formatSymbols = DecimalFormatSymbols.getInstance(locale); + + //copied from NumberAxis.createStandardTickUnits() to preserve backward behaviour + TickUnits units = new TickUnits(); + DecimalFormat df0 = new DecimalFormat("0.00000000", formatSymbols); + DecimalFormat df1 = new DecimalFormat("0.0000000", formatSymbols); + DecimalFormat df2 = new DecimalFormat("0.000000", formatSymbols); + DecimalFormat df3 = new DecimalFormat("0.00000", formatSymbols); + DecimalFormat df4 = new DecimalFormat("0.0000", formatSymbols); + DecimalFormat df5 = new DecimalFormat("0.000", formatSymbols); + DecimalFormat df6 = new DecimalFormat("0.00", formatSymbols); + DecimalFormat df7 = new DecimalFormat("0.0", formatSymbols); + DecimalFormat df8 = new DecimalFormat("#,##0", formatSymbols); + //these two are probably not needed + DecimalFormat df9 = new DecimalFormat("#,###,##0", formatSymbols); + DecimalFormat df10 = new DecimalFormat("#,###,###,##0", formatSymbols); + + // we can add the units in any order, the TickUnits collection will + // sort them... + units.add(new NumberTickUnit(0.0000001, df1)); + units.add(new NumberTickUnit(0.000001, df2)); + units.add(new NumberTickUnit(0.00001, df3)); + units.add(new NumberTickUnit(0.0001, df4)); + units.add(new NumberTickUnit(0.001, df5)); + units.add(new NumberTickUnit(0.01, df6)); + units.add(new NumberTickUnit(0.1, df7)); + units.add(new NumberTickUnit(1, df8)); + units.add(new NumberTickUnit(10, df8)); + units.add(new NumberTickUnit(100, df8)); + units.add(new NumberTickUnit(1000, df8)); + units.add(new NumberTickUnit(10000, df8)); + units.add(new NumberTickUnit(100000, df8)); + units.add(new NumberTickUnit(1000000, df9)); + units.add(new NumberTickUnit(10000000, df9)); + units.add(new NumberTickUnit(100000000, df9)); + units.add(new NumberTickUnit(1000000000, df10)); + units.add(new NumberTickUnit(10000000000.0, df10)); + units.add(new NumberTickUnit(100000000000.0, df10)); + + units.add(new NumberTickUnit(0.00000025, df0)); + units.add(new NumberTickUnit(0.0000025, df1)); + units.add(new NumberTickUnit(0.000025, df2)); + units.add(new NumberTickUnit(0.00025, df3)); + units.add(new NumberTickUnit(0.0025, df4)); + units.add(new NumberTickUnit(0.025, df5)); + units.add(new NumberTickUnit(0.25, df6)); + units.add(new NumberTickUnit(2.5, df7)); + units.add(new NumberTickUnit(25, df8)); + units.add(new NumberTickUnit(250, df8)); + units.add(new NumberTickUnit(2500, df8)); + units.add(new NumberTickUnit(25000, df8)); + units.add(new NumberTickUnit(250000, df8)); + units.add(new NumberTickUnit(2500000, df9)); + units.add(new NumberTickUnit(25000000, df9)); + units.add(new NumberTickUnit(250000000, df9)); + units.add(new NumberTickUnit(2500000000.0, df10)); + units.add(new NumberTickUnit(25000000000.0, df10)); + units.add(new NumberTickUnit(250000000000.0, df10)); + + units.add(new NumberTickUnit(0.0000005, df1)); + units.add(new NumberTickUnit(0.000005, df2)); + units.add(new NumberTickUnit(0.00005, df3)); + units.add(new NumberTickUnit(0.0005, df4)); + units.add(new NumberTickUnit(0.005, df5)); + units.add(new NumberTickUnit(0.05, df6)); + units.add(new NumberTickUnit(0.5, df7)); + units.add(new NumberTickUnit(5L, df8)); + units.add(new NumberTickUnit(50L, df8)); + units.add(new NumberTickUnit(500L, df8)); + units.add(new NumberTickUnit(5000L, df8)); + units.add(new NumberTickUnit(50000L, df8)); + units.add(new NumberTickUnit(500000L, df8)); + units.add(new NumberTickUnit(5000000L, df9)); + units.add(new NumberTickUnit(50000000L, df9)); + units.add(new NumberTickUnit(500000000L, df9)); + units.add(new NumberTickUnit(5000000000L, df10)); + units.add(new NumberTickUnit(50000000000L, df10)); + units.add(new NumberTickUnit(500000000000L, df10)); + + // adding further values by default because 5E11 is not enough for some people + units.add(new NumberTickUnit(1000000000000L, df8)); + units.add(new NumberTickUnit(2500000000000L, df8)); + units.add(new NumberTickUnit(5000000000000L, df8)); + units.add(new NumberTickUnit(10000000000000L, df8)); + units.add(new NumberTickUnit(25000000000000L, df8)); + units.add(new NumberTickUnit(50000000000000L, df8)); + units.add(new NumberTickUnit(100000000000000L, df8)); + units.add(new NumberTickUnit(250000000000000L, df8)); + units.add(new NumberTickUnit(500000000000000L, df8)); + units.add(new NumberTickUnit(1000000000000000L, df8)); + units.add(new NumberTickUnit(2500000000000000L, df8)); + units.add(new NumberTickUnit(5000000000000000L, df8)); + units.add(new NumberTickUnit(10000000000000000L, df8)); + units.add(new NumberTickUnit(25000000000000000L, df8)); + units.add(new NumberTickUnit(50000000000000000L, df8)); + units.add(new NumberTickUnit(100000000000000000L, df8)); + units.add(new NumberTickUnit(250000000000000000L, df8)); + units.add(new NumberTickUnit(500000000000000000L, df8)); + units.add(new NumberTickUnit(1000000000000000000L, df8)); + units.add(new NumberTickUnit(2500000000000000000L, df8)); + units.add(new NumberTickUnit(5000000000000000000L, df8)); + + return units; + } + + public void setAutoTickUnit(NumberAxis numberAxis) + { + if (numberAxis.isAutoTickUnitSelection()) + { + Range range = numberAxis.getRange(); + if (range.getLength() >= AUTO_TICK_UNIT_THRESHOLD) + { + // this is a workaround for a floating point error makes JFreeChart + // select tick units that are too small when the values are very large + double autoSize = range.getLength() / AUTO_TICK_UNIT_THRESHOLD; + TickUnit unit = numberAxis.getStandardTickUnits().getCeilingTickUnit(autoSize); + numberAxis.setTickUnit((NumberTickUnit) unit, false, false); + } + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/DefaultXYZDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/DefaultXYZDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/DefaultXYZDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/DefaultXYZDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,149 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.sf.jasperreports.engine.JRConstants; + +import org.jfree.data.xy.AbstractXYZDataset; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class DefaultXYZDataset extends AbstractXYZDataset +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + /** + * + */ + List dataset = null; + + /** + * + */ + public DefaultXYZDataset() + { + dataset = new ArrayList(); + } + + /** + * + */ + public void addValue( Comparable series, Number xValue, Number yValue, Number zValue ){ + boolean found = false; + for( Iterator it = dataset.iterator(); it.hasNext(); ){ + XYZElement element = it.next(); + if( element.getSeries().equals( series )){ + element.addElement( xValue, yValue, zValue ); + found = true; + } + } + + if( !found ){ + XYZElement element = new XYZElement(); + element.setSeries( series ); + element.addElement( xValue, yValue, zValue ); + + dataset.add( element ); + } + } + + /** + * + */ + @Override + public int getSeriesCount() { + int retVal = 0; + if( dataset != null ){ + retVal = dataset.size(); + } + + return retVal; + } + + @Override + public Number getZ(int series, int index ) { + Number retVal = null; + if( dataset != null ){ + if( series < getSeriesCount() ){ + XYZElement element = dataset.get( series ); + retVal = element.getZElement( index ); + } + } + return retVal; + } + + @Override + public int getItemCount(int series ) { + int retVal = 0; + if( dataset != null ){ + if( series < getSeriesCount() ){ + XYZElement element = dataset.get( series ); + retVal = element.getCount(); + } + } + return retVal; + } + + @Override + public Number getX(int series, int index ) { + Number retVal = null; + if( dataset != null ){ + if( series < getSeriesCount() ){ + XYZElement element = dataset.get( series ); + retVal = element.getXElement( index ); + } + } + return retVal; + } + + @Override + public Number getY(int series, int index ) { + Number retVal = null; + if( dataset != null ){ + if( series < getSeriesCount() ){ + XYZElement element = dataset.get( series ); + retVal = element.getYElement( index ); + } + } + return retVal; + } + + @Override + public Comparable getSeriesKey(int index) { + String retVal = null; + if( dataset != null ){ + if( index < getSeriesCount() ){ + XYZElement element = dataset.get( index ); + retVal = element.getSeries().toString(); + } + } + return retVal; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/DrawChartRendererFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/DrawChartRendererFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/DrawChartRendererFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/DrawChartRendererFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.awt.geom.Rectangle2D; + +import org.jfree.chart.JFreeChart; + +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.renderers.Renderable; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class DrawChartRendererFactory extends AbstractChartRenderableFactory +{ + + @Override + public Renderable getRenderable( + JasperReportsContext jasperReportsContext, + JFreeChart chart, + ChartHyperlinkProvider chartHyperlinkProvider, + Rectangle2D rectangle + ) + { + return new DrawChartRendererImpl(chart, chartHyperlinkProvider); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/DrawChartRendererImpl.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/DrawChartRendererImpl.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/DrawChartRendererImpl.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/DrawChartRendererImpl.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.awt.Graphics2D; +import java.awt.geom.Rectangle2D; +import java.util.List; + +import org.jfree.chart.JFreeChart; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRPrintImageAreaHyperlink; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.renderers.AbstractRenderer; +import net.sf.jasperreports.renderers.AreaHyperlinksRenderable; +import net.sf.jasperreports.renderers.Graphics2DRenderable; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class DrawChartRendererImpl extends AbstractRenderer implements AreaHyperlinksRenderable, Graphics2DRenderable +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private JFreeChart chart; + private ChartHyperlinkProvider chartHyperlinkProvider; + + public DrawChartRendererImpl(JFreeChart chart, ChartHyperlinkProvider chartHyperlinkProvider) + { + this.chart = chart; + this.chartHyperlinkProvider = chartHyperlinkProvider; + } + + @Override + public void render(JasperReportsContext jasperReportsContext, Graphics2D grx, Rectangle2D rectangle) + { + if (chart != null) + { + chart.draw(grx, rectangle); + } + } + + @Override + public List getImageAreaHyperlinks(Rectangle2D renderingArea) throws JRException + { + return ChartUtil.getImageAreaHyperlinks(chart, chartHyperlinkProvider, null, renderingArea); + } + + @Override + public boolean hasImageAreaHyperlinks() + { + return chartHyperlinkProvider != null && chartHyperlinkProvider.hasHyperlinks(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/DrawChartRenderer.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/DrawChartRenderer.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/DrawChartRenderer.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/DrawChartRenderer.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,105 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.awt.Graphics2D; +import java.awt.geom.Dimension2D; +import java.awt.geom.Rectangle2D; +import java.util.List; + +import org.jfree.chart.JFreeChart; + +import net.sf.jasperreports.engine.ImageMapRenderable; +import net.sf.jasperreports.engine.JRAbstractSvgRenderer; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRPrintImageAreaHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.renderers.DimensionRenderable; +import net.sf.jasperreports.renderers.Graphics2DRenderable; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated Replaced by {@link DrawChartRendererImpl}. + */ +public class DrawChartRenderer extends JRAbstractSvgRenderer implements ImageMapRenderable, Graphics2DRenderable, DimensionRenderable +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private JFreeChart chart; + private ChartHyperlinkProvider chartHyperlinkProvider; + + public DrawChartRenderer(JFreeChart chart, ChartHyperlinkProvider chartHyperlinkProvider) + { + this.chart = chart; + this.chartHyperlinkProvider = chartHyperlinkProvider; + } + + @Override + public Dimension2D getDimension(JasperReportsContext jasperReportsContext) + { + return null; + } + + @Override + public void render(JasperReportsContext jasperReportsContext, Graphics2D grx, Rectangle2D rectangle) + { + if (chart != null) + { + chart.draw(grx, rectangle); + } + } + + /** + * @deprecated To be removed. + */ + @Override + public List renderWithHyperlinks(Graphics2D grx, Rectangle2D rectangle) + { + try + { + render(grx, rectangle); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + + return ChartUtil.getImageAreaHyperlinks(chart, chartHyperlinkProvider, grx, rectangle); + } + + @Override + public List getImageAreaHyperlinks(Rectangle2D renderingArea) throws JRException + { + return ChartUtil.getImageAreaHyperlinks(chart, chartHyperlinkProvider, null, renderingArea); + } + + @Override + public boolean hasImageAreaHyperlinks() + { + return chartHyperlinkProvider != null && chartHyperlinkProvider.hasHyperlinks(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/HighLowChartHyperlinkProvider.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/HighLowChartHyperlinkProvider.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/HighLowChartHyperlinkProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/HighLowChartHyperlinkProvider.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,72 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.util.List; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRPrintHyperlink; + +import org.jfree.chart.entity.ChartEntity; +import org.jfree.chart.entity.XYItemEntity; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class HighLowChartHyperlinkProvider implements ChartHyperlinkProvider +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private List itemHyperlinks; + + public HighLowChartHyperlinkProvider(List itemHyperlinks) + { + this.itemHyperlinks = itemHyperlinks; + } + + + @Override + public JRPrintHyperlink getEntityHyperlink(ChartEntity entity) + { + JRPrintHyperlink printHyperlink = null; + if (hasHyperlinks() && entity instanceof XYItemEntity) + { + XYItemEntity itemEntity = (XYItemEntity) entity; + int item = itemEntity.getItem(); + if (item >= 0 && item < itemHyperlinks.size()) + { + printHyperlink = itemHyperlinks.get(item); + } + } + return printHyperlink; + } + + @Override + public boolean hasHyperlinks() + { + return itemHyperlinks != null && itemHyperlinks.size() > 0; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/ImageChartRendererFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/ImageChartRendererFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/ImageChartRendererFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/ImageChartRendererFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,99 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.awt.Graphics2D; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.util.List; + +import org.jfree.chart.JFreeChart; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRPrintImageAreaHyperlink; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.type.ImageTypeEnum; +import net.sf.jasperreports.engine.util.JRImageLoader; +import net.sf.jasperreports.renderers.Renderable; +import net.sf.jasperreports.renderers.SimpleDataRenderer; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class ImageChartRendererFactory extends AbstractChartRenderableFactory +{ + + @Override + public Renderable getRenderable( + JasperReportsContext jasperReportsContext, + JFreeChart chart, + ChartHyperlinkProvider chartHyperlinkProvider, + Rectangle2D rectangle + ) + { + int dpi = JRPropertiesUtil.getInstance(jasperReportsContext).getIntegerProperty(Renderable.PROPERTY_IMAGE_DPI, 72); + double scale = dpi/72d; + + BufferedImage bi = + new BufferedImage( + (int) (scale * (int)rectangle.getWidth()), + (int) (scale * rectangle.getHeight()), + BufferedImage.TYPE_INT_ARGB + ); + + List areaHyperlinks = null; + + Graphics2D grx = bi.createGraphics(); + try + { + grx.scale(scale, scale); + + if (chartHyperlinkProvider != null && chartHyperlinkProvider.hasHyperlinks()) + { + areaHyperlinks = ChartUtil.getImageAreaHyperlinks(chart, chartHyperlinkProvider, grx, rectangle); + } + else + { + chart.draw(grx, rectangle); + } + } + finally + { + grx.dispose(); + } + + try + { + return new SimpleDataRenderer(JRImageLoader.getInstance(jasperReportsContext).loadBytesFromAwtImage(bi, ImageTypeEnum.PNG), areaHyperlinks); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/JRAxisFormat.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/JRAxisFormat.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/JRAxisFormat.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/JRAxisFormat.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,217 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.awt.Color; +import java.io.Serializable; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRFont; + +/** + * Represents all the formatting options of a chart axis. The axis can be either a domain or + * a range axis, and any options that do not apply to the current axis are simply ignored. + * + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRAxisFormat implements Serializable +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + /** + * The color to use when writing the label of the axis. + */ + protected Color labelColor; + + /** + * The font to use when writing the label of the axis. + */ + protected JRFont labelFont; + + /** + * The color to use when writing the label of each tick mark. Ignored if tick marks are + * disabled. + */ + protected Color tickLabelColor; + + /** + * The font to use when writing the label of each tick mark. Ignored if tick marks + * are disabled. + */ + protected JRFont tickLabelFont; + + /** + * The mask to use for formatting the label of each tick mark. Ignored if tick marks + * are disabled, or if the axis being formatted is not either numeric or a date axis. + */ + protected String tickLabelMask; + + /** + * Flag to force rendering the tick labels rotated 90 degrees. + */ + protected Boolean verticalTickLabels; + + /** + * The color to use when drawing the axis line and tick marks, if enabled. + */ + protected Color lineColor; + + /** + * Constructor. + * + */ + public JRAxisFormat() {} + + /** + * Returns the color used when writing the label of the axis. + * + * @return the color used when writing the label of the axis + */ + public Color getLabelColor() + { + return labelColor; + } + + /** + * Sets the color used when writing the label of the axis. + * + * @param labelColor the color to use when writing the label of the axis + */ + public void setLabelColor(Color labelColor) + { + this.labelColor = labelColor; + } + + /** + * Returns the font used when writing the label of the axis. + * + * @return the font used when writing the label of the axis + */ + public JRFont getLabelFont() + { + return labelFont; + } + + /** + * Sets the font used when writing the label of the axis. + * + * @param labelFont the font to use when writing the label of the axis + */ + public void setLabelFont(JRFont labelFont) + { + this.labelFont = labelFont; + } + + /** + * Returns the color used when drawing the axis. This color is used for both + * the axis line itself and any tick marks present on the axis. + * + * @return the color used when drawing the axis. + */ + public Color getLineColor() { + return lineColor; + } + + /** + * Sets the color used when drawing the axis. This color is used for both + * the axis line itself and any tick marks present on the axis. + * + * @param lineColor the color to use when drawing the axis. + */ + public void setLineColor(Color lineColor) { + this.lineColor = lineColor; + } + + /** + * Returns the color used when writing the label of each tick mark. + * + * @return the color used when writing the label of each tick mark + */ + public Color getTickLabelColor() { + return tickLabelColor; + } + + /** + * Sets the color to use when writing the label of each tick mark. + * + * @param tickLabelColor the color to use when writing the label of each tick mark + */ + public void setTickLabelColor(Color tickLabelColor) { + this.tickLabelColor = tickLabelColor; + } + + /** + * Returns the font used when writing the label of each tick mark. + * + * @return the font used when writing the label of each tick mark + */ + public JRFont getTickLabelFont() { + return tickLabelFont; + } + + /** + * Sets the font to use when writing the label of each tick mark. + * + * @param tickLabelFont the font to use when writing the label of each tick mark + */ + public void setTickLabelFont(JRFont tickLabelFont) { + this.tickLabelFont = tickLabelFont; + } + + /** + * Returns the formatting mask used when writing the label of each tick mark. + * + * @return the formatting mask used when writing the label of each tick mark + */ + public String getTickLabelMask() { + return tickLabelMask; + } + + /** + * Sets the formatting mask to user when writing the label of each tick mark. + * + * @param mask the formatting mask to use when writing the label of each tick mark + */ + public void setTickLabelMask(String mask) { + this.tickLabelMask = mask; + } + + /** + * + */ + public Boolean getVerticalTickLabels() + { + return verticalTickLabels; + } + + /** + * + */ + public void setVerticalTickLabel(Boolean verticalTickLabels) + { + this.verticalTickLabels = verticalTickLabels; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/JRMeterInterval.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/JRMeterInterval.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/JRMeterInterval.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/JRMeterInterval.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,219 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.awt.Color; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.Serializable; + +import net.sf.jasperreports.charts.JRDataRange; +import net.sf.jasperreports.charts.base.JRBaseDataRange; +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * Defines a subsection of a meter chart. This section has its own range, + * a label, and can shade a section of the meter face with its own color. + * Common usages are to show "critical", "warning" and "good" ranges. + * + * @author Barry Klawans (barry@users.sourceforge.net) + */ + + +public class JRMeterInterval implements JRCloneable, Serializable +{ + public static final double DEFAULT_TRANSPARENCY = 1.0; + + /** + * The range of this interval. Must be inside the meter's range. + */ + protected JRDataRange dataRange; + + /** + * The label of this interval. Only appears in the meter's legend. + */ + protected String label; + + /** + * Color to use to shade in this region on the meter's face. + */ + protected Color backgroundColor; + + /** + * Transparency of the interval's color. 1.0 is fully opaque, 0.0 is + * fully transparent. + */ + protected Double alphaDouble; + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + /** + * Construct an empty interval. + */ + public JRMeterInterval() + { + } + + /** + * Construct a new interval by copying an existing one. + * + * @param meterInterval the interval to copy + * @param factory factory object to register expressions with + */ + public JRMeterInterval(JRMeterInterval meterInterval, JRBaseObjectFactory factory) + { + dataRange = new JRBaseDataRange(meterInterval.getDataRange(), factory); + label = meterInterval.getLabel(); + backgroundColor = meterInterval.getBackgroundColor(); + alphaDouble = meterInterval.getAlphaDouble(); + } + + /** + * Returns the range this interval is for. + * + * @return the range of this interval + */ + public JRDataRange getDataRange() + { + return dataRange; + } + + /** + * Sets the range for this interval. The range must be inside the + * range of the meter we are going to add the interval to. + * + * @param dataRange the range of this interval + */ + public void setDataRange(JRDataRange dataRange) + { + this.dataRange = dataRange; + } + + /** + * The text describing this range. This text only appears in the + * meter's legend. + * + * @return the text describing this range + */ + public String getLabel() + { + return label; + } + + /** + * Sets the textual description of this range. This text only appears + * in the meter's legend. + * + * @param label the textual description of this range + */ + public void setLabel(String label) + { + this.label = label; + } + + /** + * Returns the color used to shade this interval. + * + * @return the color used to shade this interval + */ + public Color getBackgroundColor() + { + return backgroundColor; + } + + /** + * Specifies the color to use to shade this interval. + * + * @param backgroundColor the color to use to shade this interval + */ + public void setBackgroundColor(Color backgroundColor) + { + this.backgroundColor = backgroundColor; + } + + /** + * Returns the transparency of the interval color, with 0.0 being fully + * transparent and 1.0 being fully opaque. + * + * @return the transparency + */ + public Double getAlphaDouble() + { + return alphaDouble; + } + + /** + * Sets the transparency of the interval color, with 0.0 being fully + * transparent and 1.0 being fully opaque. + * + * @param alpha the transparency of the interval color + */ + public void setAlpha(Double alpha) + { + this.alphaDouble = alpha; + } + + @Override + public Object clone() + { + JRMeterInterval clone = null; + + try + { + clone = (JRMeterInterval)super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new JRRuntimeException(e); + } + + clone.dataRange = JRCloneUtils.nullSafeClone(dataRange); + + return clone; + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private double alpha = DEFAULT_TRANSPARENCY; + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_3) + { + alphaDouble = new Double(alpha); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/MultiAxisChartHyperlinkProvider.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/MultiAxisChartHyperlinkProvider.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/MultiAxisChartHyperlinkProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/MultiAxisChartHyperlinkProvider.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,137 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRPrintHyperlink; + +import org.jfree.chart.entity.CategoryItemEntity; +import org.jfree.chart.entity.ChartEntity; +import org.jfree.chart.entity.XYItemEntity; +import org.jfree.data.general.Dataset; + +/** + * A chart item hyperlink provider used for multiple axis charts. + * + * A separate hyperlink provider can be set for each axis/dataset in the + * multi chart. This provider then resolves the provider for each + * chart entity and delegates the hyperlink retrieval to it. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class MultiAxisChartHyperlinkProvider implements ChartHyperlinkProvider +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private Map datasetProviders = new HashMap(); + + /** + * Creates a multiple axis chart hyperlink provider. + */ + public MultiAxisChartHyperlinkProvider() + { + } + + /** + * Registers a hyperlink provider for a specific dataset. + * + * The dataset will be used to determine a provider for a chart entity. + * + * @param dataset the dataset + * @param provider the hyperlink provider + */ + public void addHyperlinkProvider(Dataset dataset, ChartHyperlinkProvider provider) + { + datasetProviders.put(dataset, provider); + } + + /** + * Returns true if any of the registered providers has hyperlinks. + */ + @Override + public boolean hasHyperlinks() + { + boolean hasHyperlinks = false; + if (!datasetProviders.isEmpty()) + { + for (Iterator it = datasetProviders.values().iterator(); it.hasNext();) + { + ChartHyperlinkProvider provider = it.next(); + if (provider.hasHyperlinks()) + { + hasHyperlinks = true; + break; + } + } + } + return hasHyperlinks; + } + + /** + * Determines the provider for the chart entity based on its dataset, + * and delegates the call to it. + */ + @Override + public JRPrintHyperlink getEntityHyperlink(ChartEntity entity) + { + JRPrintHyperlink hyperlink = null; + ChartHyperlinkProvider provider = resolveEntityProvider(entity); + if (provider != null && provider.hasHyperlinks()) + { + hyperlink = provider.getEntityHyperlink(entity); + } + return hyperlink; + } + + protected ChartHyperlinkProvider resolveEntityProvider(ChartEntity entity) + { + ChartHyperlinkProvider provider = null; + Dataset dataset = getEntityDataset(entity); + if (dataset != null) + { + provider = datasetProviders.get(dataset); + } + return provider; + } + + protected Dataset getEntityDataset(ChartEntity entity) + { + Dataset dataset = null; + if (entity instanceof CategoryItemEntity) + { + dataset = ((CategoryItemEntity) entity).getDataset(); + } + else if (entity instanceof XYItemEntity) + { + dataset = ((XYItemEntity) entity).getDataset(); + } + return dataset; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +/** + * Contains utility classes for complex chart customization. + */ +package net.sf.jasperreports.charts.util; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/PieChartHyperlinkProvider.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/PieChartHyperlinkProvider.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/PieChartHyperlinkProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/PieChartHyperlinkProvider.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,67 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.util.Map; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRPrintHyperlink; + +import org.jfree.chart.entity.ChartEntity; +import org.jfree.chart.entity.PieSectionEntity; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class PieChartHyperlinkProvider implements ChartHyperlinkProvider +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private Map, JRPrintHyperlink> sectionHyperlinks; + + public PieChartHyperlinkProvider(Map, JRPrintHyperlink> sectionHyperlinks) + { + this.sectionHyperlinks = sectionHyperlinks; + } + + + @Override + public JRPrintHyperlink getEntityHyperlink(ChartEntity entity) + { + JRPrintHyperlink printHyperlink = null; + if (hasHyperlinks() && entity instanceof PieSectionEntity) + { + PieSectionEntity pieEntity = (PieSectionEntity) entity; + printHyperlink = sectionHyperlinks.get(pieEntity.getSectionKey()); + } + return printHyperlink; + } + + @Override + public boolean hasHyperlinks() + { + return sectionHyperlinks != null && sectionHyperlinks.size() > 0; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/PieLabelGenerator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/PieLabelGenerator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/PieLabelGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/PieLabelGenerator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.io.Serializable; +import java.text.AttributedString; +import java.util.Map; + +import net.sf.jasperreports.engine.JRConstants; + +import org.jfree.chart.labels.PieSectionLabelGenerator; +import org.jfree.data.general.PieDataset; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class PieLabelGenerator implements PieSectionLabelGenerator, Serializable +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private Map, String> labels; + + public PieLabelGenerator( Map, String> labels ) + { + this.labels = labels; + } + + @Override + public String generateSectionLabel(PieDataset arg0, @SuppressWarnings("rawtypes") Comparable arg1) + { + return labels.get( arg1 ); + } + + @Override + public AttributedString generateAttributedSectionLabel(PieDataset arg0, @SuppressWarnings("rawtypes") Comparable arg1) + { + return new AttributedString(generateSectionLabel(arg0, arg1));//FIXMECHART check this + } +} \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/SvgChartRendererFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/SvgChartRendererFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/SvgChartRendererFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/SvgChartRendererFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,100 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.awt.geom.Rectangle2D; +import java.io.StringWriter; +import java.io.UnsupportedEncodingException; +import java.util.List; + +import org.apache.batik.dom.GenericDOMImplementation; +import org.apache.batik.svggen.SVGGraphics2D; +import org.apache.batik.svggen.SVGGraphics2DIOException; +import org.jfree.chart.JFreeChart; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; + +import net.sf.jasperreports.engine.JRPrintImageAreaHyperlink; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.renderers.Renderable; +import net.sf.jasperreports.renderers.SimpleRenderToImageAwareDataRenderer; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class SvgChartRendererFactory extends AbstractChartRenderableFactory +{ + + @Override + public Renderable getRenderable( + JasperReportsContext jasperReportsContext, + JFreeChart chart, + ChartHyperlinkProvider chartHyperlinkProvider, + Rectangle2D rectangle + ) + { + DOMImplementation domImpl = + GenericDOMImplementation.getDOMImplementation(); + Document document = + domImpl.createDocument(null, "svg", null); + SVGGraphics2D grx = + new SVGGraphics2D(document); + + grx.setSVGCanvasSize(rectangle.getBounds().getSize()); + + List areaHyperlinks = null; + + if (chartHyperlinkProvider != null && chartHyperlinkProvider.hasHyperlinks()) + { + areaHyperlinks = ChartUtil.getImageAreaHyperlinks(chart, chartHyperlinkProvider, grx, rectangle); + } + else + { + chart.draw(grx, rectangle); + } + + try + { + StringWriter swriter = new StringWriter(); + grx.stream(swriter); + byte[] svgData = null; + try + { + svgData = swriter.getBuffer().toString().getBytes("UTF-8"); + } + catch (UnsupportedEncodingException e) + { + throw new JRRuntimeException(e); + } + return new SimpleRenderToImageAwareDataRenderer(svgData, areaHyperlinks); + } + catch (SVGGraphics2DIOException e) + { + throw new JRRuntimeException(e); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/TimePeriodChartHyperlinkProvider.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/TimePeriodChartHyperlinkProvider.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/TimePeriodChartHyperlinkProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/TimePeriodChartHyperlinkProvider.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.util.Map; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRPrintHyperlink; + +import org.jfree.chart.entity.ChartEntity; +import org.jfree.chart.entity.XYItemEntity; +import org.jfree.data.time.TimePeriod; +import org.jfree.data.time.TimePeriodValues; +import org.jfree.data.time.TimePeriodValuesCollection; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class TimePeriodChartHyperlinkProvider implements ChartHyperlinkProvider +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private Map, Map> itemHyperlinks; + + public TimePeriodChartHyperlinkProvider(Map, Map> itemHyperlinks) + { + this.itemHyperlinks = itemHyperlinks; + } + + + @Override + public JRPrintHyperlink getEntityHyperlink(ChartEntity entity) + { + JRPrintHyperlink printHyperlink = null; + if (hasHyperlinks() && entity instanceof XYItemEntity) + { + XYItemEntity itemEntity = (XYItemEntity) entity; + TimePeriodValuesCollection dataset = (TimePeriodValuesCollection) itemEntity.getDataset(); + TimePeriodValues series = dataset.getSeries(itemEntity.getSeriesIndex()); + Map serieHyperlinks = itemHyperlinks.get(series.getKey()); + if (serieHyperlinks != null) + { + TimePeriod timePeriod = series.getTimePeriod(itemEntity.getItem()); + printHyperlink = serieHyperlinks.get(timePeriod); + } + } + return printHyperlink; + } + + @Override + public boolean hasHyperlinks() + { + return itemHyperlinks != null && itemHyperlinks.size() > 0; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/TimePeriodDatasetLabelGenerator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/TimePeriodDatasetLabelGenerator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/TimePeriodDatasetLabelGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/TimePeriodDatasetLabelGenerator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,72 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.text.NumberFormat; +import java.util.Locale; +import java.util.Map; + +import net.sf.jasperreports.engine.JRConstants; + +import org.jfree.chart.labels.StandardXYItemLabelGenerator; +import org.jfree.data.time.TimePeriod; +import org.jfree.data.time.TimePeriodValuesCollection; +import org.jfree.data.xy.XYDataset; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class TimePeriodDatasetLabelGenerator extends StandardXYItemLabelGenerator +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private Map, Map> labelsMap; + + public TimePeriodDatasetLabelGenerator(Map, Map> labelsMap) + { + this(labelsMap, Locale.getDefault()); + } + + public TimePeriodDatasetLabelGenerator(Map, Map> labelsMap, Locale locale) + { + super(DEFAULT_ITEM_LABEL_FORMAT, + NumberFormat.getInstance(locale), + NumberFormat.getInstance(locale)); + + this.labelsMap = labelsMap; + } + + @Override + public String generateLabel(XYDataset dataset, int series, int item) + { + Comparable seriesName = dataset.getSeriesKey(series); + Map labels = labelsMap.get(seriesName); + if(labels != null) + { + return labels.get(((TimePeriodValuesCollection)dataset).getSeries(series).getTimePeriod(item)); + } + return super.generateLabel( dataset, series, item ); + } +} \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/TimeSeriesChartHyperlinkProvider.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/TimeSeriesChartHyperlinkProvider.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/TimeSeriesChartHyperlinkProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/TimeSeriesChartHyperlinkProvider.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.util.Map; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRPrintHyperlink; + +import org.jfree.chart.entity.ChartEntity; +import org.jfree.chart.entity.XYItemEntity; +import org.jfree.data.time.RegularTimePeriod; +import org.jfree.data.time.TimeSeries; +import org.jfree.data.time.TimeSeriesCollection; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class TimeSeriesChartHyperlinkProvider implements ChartHyperlinkProvider +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private Map, Map> itemHyperlinks; + + public TimeSeriesChartHyperlinkProvider(Map, Map> itemHyperlinks) + { + this.itemHyperlinks = itemHyperlinks; + } + + + @Override + public JRPrintHyperlink getEntityHyperlink(ChartEntity entity) + { + JRPrintHyperlink printHyperlink = null; + if (hasHyperlinks() && entity instanceof XYItemEntity) + { + XYItemEntity itemEntity = (XYItemEntity) entity; + TimeSeriesCollection dataset = (TimeSeriesCollection) itemEntity.getDataset(); + TimeSeries series = dataset.getSeries(itemEntity.getSeriesIndex()); + Map serieHyperlinks = itemHyperlinks.get(series.getKey()); + if (serieHyperlinks != null) + { + RegularTimePeriod timePeriod = series.getTimePeriod(itemEntity.getItem()); + printHyperlink = serieHyperlinks.get(timePeriod); + } + } + return printHyperlink; + } + + @Override + public boolean hasHyperlinks() + { + return itemHyperlinks != null && itemHyperlinks.size() > 0; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/TimeSeriesLabelGenerator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/TimeSeriesLabelGenerator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/TimeSeriesLabelGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/TimeSeriesLabelGenerator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,72 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.text.NumberFormat; +import java.util.Locale; +import java.util.Map; + +import net.sf.jasperreports.engine.JRConstants; + +import org.jfree.chart.labels.StandardXYItemLabelGenerator; +import org.jfree.data.time.RegularTimePeriod; +import org.jfree.data.time.TimeSeriesCollection; +import org.jfree.data.xy.XYDataset; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class TimeSeriesLabelGenerator extends StandardXYItemLabelGenerator +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private Map, Map> labelsMap; + + public TimeSeriesLabelGenerator(Map, Map> labelsMap) + { + this(labelsMap, Locale.getDefault()); + } + + public TimeSeriesLabelGenerator(Map, Map> labelsMap, Locale locale) + { + super(DEFAULT_ITEM_LABEL_FORMAT, + NumberFormat.getInstance(locale), + NumberFormat.getInstance(locale)); + + this.labelsMap = labelsMap; + } + + @Override + public String generateLabel(XYDataset dataset, int series, int item) + { + Comparable seriesName = dataset.getSeriesKey(series); + Map labels = labelsMap.get(seriesName); + if(labels != null) + { + return labels.get(((TimeSeriesCollection)dataset).getSeries(series).getTimePeriod(item)); + } + return super.generateLabel( dataset, series, item ); + } +} \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/XYChartHyperlinkProvider.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/XYChartHyperlinkProvider.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/XYChartHyperlinkProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/XYChartHyperlinkProvider.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,79 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.util.Map; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRPrintHyperlink; +import net.sf.jasperreports.engine.util.Pair; + +import org.jfree.chart.entity.ChartEntity; +import org.jfree.chart.entity.XYItemEntity; +import org.jfree.data.xy.XYDataset; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class XYChartHyperlinkProvider implements ChartHyperlinkProvider +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private Map, Map> itemHyperlinks; + + public XYChartHyperlinkProvider(Map, Map> itemHyperlinks) + { + this.itemHyperlinks = itemHyperlinks; + } + + + @Override + public JRPrintHyperlink getEntityHyperlink(ChartEntity entity) + { + JRPrintHyperlink printHyperlink = null; + if (hasHyperlinks() && entity instanceof XYItemEntity) + { + XYItemEntity itemEntity = (XYItemEntity) entity; + XYDataset dataset = itemEntity.getDataset(); + Comparable serie = dataset.getSeriesKey(itemEntity.getSeriesIndex()); + Map serieHyperlinks = itemHyperlinks.get(serie); + if (serieHyperlinks != null) + { + Number x = dataset.getX(itemEntity.getSeriesIndex(), itemEntity.getItem()); + Number y = dataset.getY(itemEntity.getSeriesIndex(), itemEntity.getItem()); + Pair xyKey = new Pair(x, y); + printHyperlink = serieHyperlinks.get(xyKey); + } + } + return printHyperlink; + } + + @Override + public boolean hasHyperlinks() + { + return itemHyperlinks != null && itemHyperlinks.size() > 0; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/XYDatasetLabelGenerator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/XYDatasetLabelGenerator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/XYDatasetLabelGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/XYDatasetLabelGenerator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,71 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.text.NumberFormat; +import java.util.Locale; +import java.util.Map; + +import net.sf.jasperreports.engine.JRConstants; + +import org.jfree.chart.labels.StandardXYItemLabelGenerator; +import org.jfree.data.xy.XYDataset; +import org.jfree.data.xy.XYSeriesCollection; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class XYDatasetLabelGenerator extends StandardXYItemLabelGenerator +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private Map, Map> labelsMap; + + public XYDatasetLabelGenerator(Map, Map> labelsMap) + { + this(labelsMap, Locale.getDefault()); + } + + public XYDatasetLabelGenerator(Map, Map> labelsMap, Locale locale) + { + super(DEFAULT_ITEM_LABEL_FORMAT, + NumberFormat.getInstance(locale), + NumberFormat.getInstance(locale)); + + this.labelsMap = labelsMap; + } + + @Override + public String generateLabel(XYDataset dataset, int series, int item) + { + Comparable seriesName = dataset.getSeriesKey(series); + Map labels = labelsMap.get(seriesName); + if(labels != null) + { + return labels.get(((XYSeriesCollection)dataset).getX(series, item)); + } + return super.generateLabel( dataset, series, item ); + } +} \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/XYZElement.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/XYZElement.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/util/XYZElement.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/util/XYZElement.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,89 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.util; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.engine.JRConstants; + + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class XYZElement implements Serializable { + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private Comparable series; + private List xElements; + private List yElements; + private List zElements; + + public XYZElement(){ + xElements = new ArrayList(); + yElements = new ArrayList(); + zElements = new ArrayList(); + } + + public void setSeries( Comparable series ){ + this.series = series; + } + + public Comparable getSeries(){ + return series; + } + + public void addElement( Number xElement, Number yElement, Number zElement ){ + xElements.add( xElement ); + yElements.add( yElement ); + zElements.add( zElement ); + + } + + + public Number getXElement( int index ){ + return xElements.get( index ); + } + + public Number getYElement( int index ){ + return yElements.get( index ); + } + + public Number getZElement( int index ){ + return zElements.get( index ); + } + + + public int getCount(){ + int retVal = 0; + if( xElements != null ){ + retVal = xElements.size(); + } + + return retVal; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRAreaChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRAreaChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRAreaChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRAreaChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRAreaChartFactory extends JRBaseFactory { + + /** + * Creates an Area chart which is a combination of a Pie dataset and a Pie plot. + * @return an instance of {@link net.sf.jasperreports.engine.design.JRDesignChart JRDesignChart} + * representing the Area chart + */ + @Override + public Object createObject( Attributes atts ){ + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart areaChart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_AREA); + + return areaChart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRAreaPlotFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRAreaPlotFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRAreaPlotFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRAreaPlotFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignAreaPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRAreaPlotFactory extends JRBaseFactory { + + @Override + public Object createObject( Attributes attrs ){ + JRChart chart = (JRChart)digester.peek(); + JRDesignAreaPlot plot = (JRDesignAreaPlot)chart.getPlot(); + + return plot; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRBar3DChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRBar3DChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRBar3DChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRBar3DChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRBar3DChartFactory extends JRBaseFactory { + + @Override + public Object createObject( Attributes attrs ){ + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_BAR3D); + + return chart; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRBar3DPlotFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRBar3DPlotFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRBar3DPlotFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRBar3DPlotFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,64 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignBar3DPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRBar3DPlotFactory extends JRBaseFactory { + private static final String ATTRIBUTE_xOffset = "xOffset"; + private static final String ATTRIBUTE_yOffset = "yOffset"; + private static final String ATTRIBUTE_isShowLabels = "isShowLabels"; + + @Override + public Object createObject(Attributes atts) + { + JRChart chart = (JRChart) digester.peek(); + JRDesignBar3DPlot plot = (JRDesignBar3DPlot)chart.getPlot(); + + String xOffset = atts.getValue(ATTRIBUTE_xOffset); + if (xOffset != null && xOffset.length() > 0) { + plot.setXOffset(Double.valueOf(xOffset)); + } + + String yOffset = atts.getValue(ATTRIBUTE_yOffset); + if (yOffset != null && yOffset.length() > 0) { + plot.setYOffset(Double.valueOf(yOffset)); + } + + String isShowLabels = atts.getValue( ATTRIBUTE_isShowLabels ); + if( isShowLabels != null && isShowLabels.length() > 0 ){ + plot.setShowLabels(Boolean.valueOf(isShowLabels)); + } + + return plot; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRBarChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRBarChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRBarChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRBarChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRBarChartFactory extends JRBaseFactory +{ + @Override + public Object createObject(Attributes atts) + { + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_BAR); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRBarPlotFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRBarPlotFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRBarPlotFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRBarPlotFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,65 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignBarPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRBarPlotFactory extends JRBaseFactory +{ + private static final String ATTRIBUTE_isShowTickMarks = "isShowTickMarks"; + private static final String ATTRIBUTE_isShowTickLabels = "isShowTickLabels"; + private static final String ATTRIBUTE_isShowLabels = "isShowLabels"; + + @Override + public Object createObject(Attributes atts) + { + JRChart chart = (JRChart) digester.peek(); + JRDesignBarPlot plot = (JRDesignBarPlot)chart.getPlot(); + + String isShowTickMarks = atts.getValue(ATTRIBUTE_isShowTickMarks); + if (isShowTickMarks != null && isShowTickMarks.length() > 0) { + plot.setShowTickMarks(Boolean.valueOf(isShowTickMarks)); + } + + String isShowTickLabels = atts.getValue(ATTRIBUTE_isShowTickLabels); + if (isShowTickLabels != null && isShowTickLabels.length() > 0) { + plot.setShowTickLabels(Boolean.valueOf(isShowTickLabels)); + } + + String isShowLabels = atts.getValue( ATTRIBUTE_isShowLabels ); + if( isShowLabels != null && isShowLabels.length() > 0 ){ + plot.setShowLabels(Boolean.valueOf(isShowLabels)); + } + + return plot; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRBubbleChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRBubbleChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRBubbleChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRBubbleChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ + +public class JRBubbleChartFactory extends JRBaseFactory { + + @Override + public Object createObject( Attributes attrs ){ + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_BUBBLE); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRBubblePlotFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRBubblePlotFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRBubblePlotFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRBubblePlotFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignBubblePlot; +import net.sf.jasperreports.charts.type.ScaleTypeEnum; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRBubblePlotFactory extends JRBaseFactory { + + private static final String ATTRIBUTE_scaleType = "scaleType"; + + @Override + public Object createObject( Attributes attributes ){ + JRChart chart = (JRChart)digester.peek(); + JRDesignBubblePlot plot = (JRDesignBubblePlot)chart.getPlot(); + + + ScaleTypeEnum scaleType = ScaleTypeEnum.getByName(attributes.getValue(ATTRIBUTE_scaleType)); + if( scaleType != null ){ + plot.setScaleType( scaleType ); + } + + return plot; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRCandlestickChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRCandlestickChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRCandlestickChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRCandlestickChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRCandlestickChartFactory extends JRBaseFactory +{ + @Override + public Object createObject(Attributes atts) + { + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_CANDLESTICK); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRCandlestickPlotFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRCandlestickPlotFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRCandlestickPlotFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRCandlestickPlotFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignCandlestickPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRCandlestickPlotFactory extends JRBaseFactory +{ + + private static final String ATTRIBUTE_isShowVolume = "isShowVolume"; + + + @Override + public Object createObject(Attributes atts) + { + JRChart chart = (JRChart) digester.peek(); + JRDesignCandlestickPlot plot = (JRDesignCandlestickPlot)chart.getPlot(); + + String isShowVolume = atts.getValue(ATTRIBUTE_isShowVolume); + if (isShowVolume != null && isShowVolume.length() > 0) { + plot.setShowVolume(Boolean.valueOf(isShowVolume)); + } + + return plot; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRCategoryDatasetFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRCategoryDatasetFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRCategoryDatasetFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRCategoryDatasetFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRCategoryDatasetFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) + { + JRChart chart = (JRChart) digester.peek(); + return chart.getDataset(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRCategorySeriesFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRCategorySeriesFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRCategorySeriesFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRCategorySeriesFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignCategorySeries; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRCategorySeriesFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) + { + return new JRDesignCategorySeries(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRChartAxisFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRChartAxisFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRChartAxisFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRChartAxisFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignChartAxis; +import net.sf.jasperreports.charts.type.AxisPositionEnum; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRChartAxisFactory extends JRBaseFactory +{ + public static final String ELEMENT_axis = "axis"; + public static final String ATTRIBUTE_position = "position"; + + @Override + public Object createObject(Attributes atts) throws JRException + { + JRDesignChart parentChart = (JRDesignChart)digester.peek(1); + JRDesignChartAxis axis = new JRDesignChartAxis(parentChart); + + AxisPositionEnum position = AxisPositionEnum.getByName(atts.getValue(ATTRIBUTE_position)); + + if (position != null) + { + axis.setPosition(position); + } + + return axis; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRDataRangeFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRDataRangeFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRDataRangeFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRDataRangeFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignDataRange; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRDataRangeFactory extends JRBaseFactory +{ + @Override + public Object createObject(Attributes atts) + { + return new JRDesignDataRange(null); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRGanttChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRGanttChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRGanttChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRGanttChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Peter Risko (peter@risko.hu) + */ +public class JRGanttChartFactory extends JRBaseFactory { + + @Override + public Object createObject( Attributes attrs ){ + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_GANTT); + + return chart; + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRGanttDatasetFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRGanttDatasetFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRGanttDatasetFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRGanttDatasetFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,56 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignGanttDataset; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Peter Risko (peter@risko.hu) + */ +public class JRGanttDatasetFactory extends JRBaseFactory { + + @Override + public Object createObject(Attributes atts) + { + JRDesignChart chart = (JRDesignChart) digester.peek(); + + JRDesignGanttDataset dataset = null; + + if( chart.getDataset() == null ){ + dataset = new JRDesignGanttDataset( chart.getDataset() ); + } + else { + dataset = (JRDesignGanttDataset)chart.getDataset(); + } + + chart.setDataset( dataset ); + return dataset; + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRGanttSeriesFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRGanttSeriesFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRGanttSeriesFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRGanttSeriesFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignGanttSeries; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Peter Risko (peter@risko.hu) + */ +public class JRGanttSeriesFactory extends JRBaseFactory { + + @Override + public Object createObject(Attributes atts) + { + return new JRDesignGanttSeries(); + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRHighLowChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRHighLowChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRHighLowChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRHighLowChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRHighLowChartFactory extends JRBaseFactory +{ + @Override + public Object createObject(Attributes atts) + { + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_HIGHLOW); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRHighLowDatasetFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRHighLowDatasetFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRHighLowDatasetFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRHighLowDatasetFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRHighLowDatasetFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) + { + JRChart chart = (JRChart) digester.peek(); + return chart.getDataset(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRHighLowPlotFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRHighLowPlotFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRHighLowPlotFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRHighLowPlotFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignHighLowPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRHighLowPlotFactory extends JRBaseFactory +{ + + private static final String ATTRIBUTE_isShowOpenTicks = "isShowOpenTicks"; + private static final String ATTRIBUTE_isShowCloseTicks = "isShowCloseTicks"; + + + @Override + public Object createObject(Attributes atts) + { + JRChart chart = (JRChart) digester.peek(); + JRDesignHighLowPlot plot = (JRDesignHighLowPlot)chart.getPlot(); + + String isShowOpenTicks = atts.getValue(ATTRIBUTE_isShowOpenTicks); + if (isShowOpenTicks != null && isShowOpenTicks.length() > 0) { + plot.setShowOpenTicks(Boolean.valueOf(isShowOpenTicks)); + } + + String isShowCloseTicks = atts.getValue(ATTRIBUTE_isShowCloseTicks); + if (isShowCloseTicks != null && isShowCloseTicks.length() > 0) { + plot.setShowCloseTicks(Boolean.valueOf(isShowCloseTicks)); + } + + return plot; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRItemLabelFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRItemLabelFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRItemLabelFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRItemLabelFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,67 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignItemLabel; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.util.JRColorUtil; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class JRItemLabelFactory extends JRBaseFactory +{ + private static final String ATTRIBUTE_color = "color"; + private static final String ATTRIBUTE_backgroundColor = "backgroundColor"; +// private static final String ATTRIBUTE_mask = "mask"; + + @Override + public Object createObject(Attributes atts) + { + JRDesignItemLabel itemLabel = new JRDesignItemLabel(null, ((JRChartPlot)digester.peek()).getChart()); + + String color = atts.getValue(ATTRIBUTE_color); + if (color != null && color.length() > 0) + { + itemLabel.setColor(JRColorUtil.getColor(color, null)); + } + + String backgroundColor = atts.getValue(ATTRIBUTE_backgroundColor); + if (backgroundColor != null && backgroundColor.length() > 0) + { + itemLabel.setBackgroundColor(JRColorUtil.getColor(backgroundColor, null)); + } + +// String mask = atts.getValue(ATTRIBUTE_mask); +// if (mask != null && mask.length() > 0) +// { +// itemLabel.setMask(mask); +// } + return itemLabel; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRLineChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRLineChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRLineChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRLineChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,46 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRLineChartFactory extends JRBaseFactory { + + @Override + public Object createObject( Attributes attrs ){ + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_LINE); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRLinePlotFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRLinePlotFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRLinePlotFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRLinePlotFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,56 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignLinePlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRLinePlotFactory extends JRBaseFactory { + private static final String ATTRIBUTE_isShowShapes = "isShowShapes"; + private static final String ATTRIBUTE_isShowLines = "isShowLines"; + + @Override + public Object createObject( Attributes attrs ){ + JRChart chart = (JRChart)digester.peek(); + JRDesignLinePlot plot = (JRDesignLinePlot)chart.getPlot(); + + String isShowShapes = attrs.getValue( ATTRIBUTE_isShowShapes ); + if( isShowShapes != null && isShowShapes.length() > 0 ){ + plot.setShowShapes(Boolean.valueOf(isShowShapes) ); + } + + String isShowLines = attrs.getValue( ATTRIBUTE_isShowLines ); + if( isShowLines != null && isShowLines.length() > 0 ){ + plot.setShowLines(Boolean.valueOf(isShowLines) ); + } + + return plot; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRMeterChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRMeterChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRMeterChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRMeterChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRMeterChartFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) + { + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_METER); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRMeterIntervalFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRMeterIntervalFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRMeterIntervalFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRMeterIntervalFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,67 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.util.JRMeterInterval; +import net.sf.jasperreports.engine.util.JRColorUtil; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRMeterIntervalFactory extends JRBaseFactory +{ + private static final String ATTRIBUTE_label = "label"; + private static final String ATTRIBUTE_color = "color"; + private static final String ATTRIBUTE_alpha = "alpha"; + + @Override + public Object createObject(Attributes atts) + { + JRMeterInterval interval = new JRMeterInterval(); + + String value = atts.getValue(ATTRIBUTE_label); + if (value != null && value.length() > 0) + { + interval.setLabel(value); + } + + value = atts.getValue(ATTRIBUTE_color); + if (value != null && value.length() > 0) + { + interval.setBackgroundColor(JRColorUtil.getColor(value, null)); + } + + value = atts.getValue(ATTRIBUTE_alpha); + if (value != null && value.length() > 0) + { + interval.setAlpha(Double.valueOf(value)); + } + + return interval; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRMeterPlotFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRMeterPlotFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRMeterPlotFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRMeterPlotFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,108 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignMeterPlot; +import net.sf.jasperreports.charts.type.MeterShapeEnum; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.util.JRColorUtil; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRMeterPlotFactory extends JRBaseFactory +{ + public static final String ELEMENT_meterPlot = "meterPlot"; + + public static final String ATTRIBUTE_shape = "shape"; + public static final String ATTRIBUTE_angle = "angle"; + public static final String ATTRIBUTE_units = "units"; + public static final String ATTRIBUTE_tickInterval = "tickInterval"; + public static final String ATTRIBUTE_meterColor = "meterColor"; + public static final String ATTRIBUTE_needleColor = "needleColor"; + public static final String ATTRIBUTE_tickColor = "tickColor"; + public static final String ATTRIBUTE_tickCount = "tickCount"; + + @Override + public Object createObject(Attributes atts) throws JRException + { + JRChart chart = (JRChart)digester.peek(); + JRDesignMeterPlot meterPlot = (JRDesignMeterPlot)chart.getPlot(); + + MeterShapeEnum shape = MeterShapeEnum.getByName(atts.getValue(ATTRIBUTE_shape)); + if (shape != null) + { + meterPlot.setShape(shape); + } + + String angle = atts.getValue(ATTRIBUTE_angle); + if (angle != null && angle.length() > 0) + { + meterPlot.setMeterAngle(Integer.valueOf(angle)); + } + + String units = atts.getValue(ATTRIBUTE_units); + if (units != null && units.length() > 0) + { + meterPlot.setUnits(units); + } + + String tickInterval = atts.getValue(ATTRIBUTE_tickInterval); + if (tickInterval != null && tickInterval.length() > 0) + { + meterPlot.setTickInterval(Double.valueOf(tickInterval)); + } + + String meterColor = atts.getValue(ATTRIBUTE_meterColor); + if (meterColor != null && meterColor.length() > 0) + { + meterPlot.setMeterBackgroundColor(JRColorUtil.getColor(meterColor, null)); + } + + String needleColor = atts.getValue(ATTRIBUTE_needleColor); + if (needleColor != null && needleColor.length() > 0) + { + meterPlot.setNeedleColor(JRColorUtil.getColor(needleColor, null)); + } + + String tickColor = atts.getValue(ATTRIBUTE_tickColor); + if (tickColor != null && tickColor.length() > 0) + { + meterPlot.setTickColor(JRColorUtil.getColor(tickColor, null)); + } + + String tickCount = atts.getValue(ATTRIBUTE_tickCount); + if (tickCount != null && tickCount.length() > 0) + { + meterPlot.setTickCount(Integer.valueOf(tickCount)); + } + + return meterPlot; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRMultiAxisChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRMultiAxisChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRMultiAxisChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRMultiAxisChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRMultiAxisChartFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) + { + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_MULTI_AXIS); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRMultiAxisPlotFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRMultiAxisPlotFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRMultiAxisPlotFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRMultiAxisPlotFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignMultiAxisPlot; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRMultiAxisPlotFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) throws JRException + { + JRDesignChart chart = (JRDesignChart)digester.peek(); + JRDesignMultiAxisPlot multiAxisPlot = (JRDesignMultiAxisPlot)chart.getPlot(); + multiAxisPlot.setChart(chart); + + + return multiAxisPlot; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRPie3DChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRPie3DChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRPie3DChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRPie3DChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRPie3DChartFactory extends JRBaseFactory +{ + @Override + public Object createObject(Attributes atts) + { + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_PIE3D); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRPie3DPlotFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRPie3DPlotFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRPie3DPlotFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRPie3DPlotFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,71 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignPie3DPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; +import net.sf.jasperreports.engine.xml.JRXmlConstants; + +import org.xml.sax.Attributes; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRPie3DPlotFactory extends JRBaseFactory +{ + /** + * + */ + private static final String ATTRIBUTE_depthFactor = "depthFactor"; + private static final String ATTRIBUTE_isShowLabels = "isShowLabels"; + + @Override + public Object createObject(Attributes atts) + { + JRChart chart = (JRChart) digester.peek(); + JRDesignPie3DPlot pie3DPlot = (JRDesignPie3DPlot)chart.getPlot(); + + String depthFactor = atts.getValue(ATTRIBUTE_depthFactor); + if (depthFactor != null && depthFactor.length() > 0) + { + pie3DPlot.setDepthFactor(Double.valueOf(depthFactor)); + } + + String isCircular = atts.getValue(JRXmlConstants.ATTRIBUTE_isCircular); + if (isCircular != null && isCircular.length() > 0) { + pie3DPlot.setCircular(Boolean.valueOf(isCircular)); + } + + pie3DPlot.setLabelFormat(atts.getValue(JRXmlConstants.ATTRIBUTE_labelFormat)); + pie3DPlot.setLegendLabelFormat(atts.getValue(JRXmlConstants.ATTRIBUTE_legendLabelFormat)); + + String isShowLabels = atts.getValue( ATTRIBUTE_isShowLabels ); + if( isShowLabels != null && isShowLabels.length() > 0 ){ + pie3DPlot.setShowLabels(Boolean.valueOf(isShowLabels)); + } + return pie3DPlot; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRPieChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRPieChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRPieChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRPieChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRPieChartFactory extends JRBaseFactory +{ + @Override + public Object createObject(Attributes atts) + { + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_PIE); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRPieDatasetFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRPieDatasetFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRPieDatasetFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRPieDatasetFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,62 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignPieDataset; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRPieDatasetFactory extends JRBaseFactory +{ + private static final String ATTRIBUTE_minPercentage = "minPercentage"; + private static final String ATTRIBUTE_maxCount = "maxCount"; + + @Override + public Object createObject(Attributes attrs) + { + JRChart chart = (JRChart) digester.peek(); + JRDesignPieDataset dataset = (JRDesignPieDataset)chart.getDataset(); + + String minPercentage = attrs.getValue(ATTRIBUTE_minPercentage); + if(minPercentage != null && minPercentage.length() > 0) + { + dataset.setMinPercentage(Float.valueOf(minPercentage)); + } + + String maxCount = attrs.getValue(ATTRIBUTE_maxCount); + if(maxCount != null && maxCount.length() > 0) + { + dataset.setMaxCount(Integer.valueOf(maxCount)); + } + + return dataset; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRPiePlotFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRPiePlotFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRPiePlotFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRPiePlotFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,62 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignPiePlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; +import net.sf.jasperreports.engine.xml.JRXmlConstants; + +import org.xml.sax.Attributes; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRPiePlotFactory extends JRBaseFactory +{ + private static final String ATTRIBUTE_isShowLabels = "isShowLabels"; + + @Override + public Object createObject(Attributes atts) + { + JRChart chart = (JRChart) digester.peek(); + JRDesignPiePlot piePlot = (JRDesignPiePlot)chart.getPlot(); + + String isCircular = atts.getValue(JRXmlConstants.ATTRIBUTE_isCircular); + if (isCircular != null && isCircular.length() > 0) { + piePlot.setCircular(Boolean.valueOf(isCircular)); + } + + piePlot.setLabelFormat(atts.getValue(JRXmlConstants.ATTRIBUTE_labelFormat)); + piePlot.setLegendLabelFormat(atts.getValue(JRXmlConstants.ATTRIBUTE_legendLabelFormat)); + + String isShowLabels = atts.getValue( ATTRIBUTE_isShowLabels ); + if( isShowLabels != null && isShowLabels.length() > 0 ){ + piePlot.setShowLabels(Boolean.valueOf(isShowLabels)); + } + + return piePlot; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRPieSeriesFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRPieSeriesFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRPieSeriesFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRPieSeriesFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignPieSeries; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRPieSeriesFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) + { + return new JRDesignPieSeries(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRScatterChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRScatterChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRScatterChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRScatterChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,46 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRScatterChartFactory extends JRBaseFactory { + + @Override + public Object createObject( Attributes attrs ){ + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_SCATTER); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRScatterPlotFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRScatterPlotFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRScatterPlotFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRScatterPlotFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,56 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignScatterPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRScatterPlotFactory extends JRBaseFactory { + private static final String ATTRIBUTE_isShowShapes = "isShowShapes"; + private static final String ATTRIBUTE_isShowLines = "isShowLines"; + + @Override + public Object createObject( Attributes attrs ){ + JRChart chart = (JRChart)digester.peek(); + JRDesignScatterPlot plot = (JRDesignScatterPlot)chart.getPlot(); + + String isShowShapes = attrs.getValue( ATTRIBUTE_isShowShapes ); + if( isShowShapes != null && isShowShapes.length() > 0 ){ + plot.setShowShapes(Boolean.valueOf(isShowShapes) ); + } + + String isShowLines = attrs.getValue( ATTRIBUTE_isShowLines ); + if( isShowLines != null && isShowLines.length() > 0 ){ + plot.setShowLines(Boolean.valueOf(isShowLines) ); + } + + return plot; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRStackedAreaChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRStackedAreaChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRStackedAreaChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRStackedAreaChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Sanda Zaharia (shertage@users.sourceforge.net) + */ +public class JRStackedAreaChartFactory extends JRBaseFactory +{ + @Override + public Object createObject(Attributes atts) + { + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_STACKEDAREA); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRStackedBar3DChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRStackedBar3DChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRStackedBar3DChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRStackedBar3DChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRStackedBar3DChartFactory extends JRBaseFactory +{ + @Override + public Object createObject(Attributes atts) + { + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_STACKEDBAR3D); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRStackedBarChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRStackedBarChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRStackedBarChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRStackedBarChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Ionut Nedelcu (ionutned@users.sourceforge.net) + */ +public class JRStackedBarChartFactory extends JRBaseFactory +{ + @Override + public Object createObject(Attributes atts) + { + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_STACKEDBAR); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRThermometerChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRThermometerChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRThermometerChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRThermometerChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRThermometerChartFactory extends JRBaseFactory +{ + @Override + public Object createObject(Attributes atts) + { + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_THERMOMETER); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRThermometerPlotFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRThermometerPlotFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRThermometerPlotFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRThermometerPlotFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,79 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignThermometerPlot; +import net.sf.jasperreports.charts.type.ValueLocationEnum; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.util.JRColorUtil; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRThermometerPlotFactory extends JRBaseFactory +{ + public static final String EXCEPTION_MESSAGE_KEY_INVALID_VALUE_LOCATION = "charts.thermometer.plot.invalid.value.location"; + + public static final String ELEMENT_thermometerPlot = "thermometerPlot"; + public static final String ELEMENT_lowRange = "lowRange"; + public static final String ELEMENT_mediumRange = "mediumRange"; + public static final String ELEMENT_highRange = "highRange"; + + public static final String ATTRIBUTE_valueLocation = "valueLocation"; + public static final String ATTRIBUTE_mercuryColor = "mercuryColor"; + + @Override + public Object createObject(Attributes atts) throws JRException + { + JRChart chart = (JRChart)digester.peek(); + JRDesignThermometerPlot thermometerPlot = (JRDesignThermometerPlot)chart.getPlot(); + + String location = atts.getValue(ATTRIBUTE_valueLocation); + ValueLocationEnum loc = ValueLocationEnum.getByName(atts.getValue(ATTRIBUTE_valueLocation)); + if (loc == null) + { + throw + new JRException( + EXCEPTION_MESSAGE_KEY_INVALID_VALUE_LOCATION, + new Object[]{location}); + } + else + { + thermometerPlot.setValueLocation(loc); + } + + String mercuryColor = atts.getValue(ATTRIBUTE_mercuryColor); + if (mercuryColor != null && mercuryColor.length() > 0) + { + thermometerPlot.setMercuryColor(JRColorUtil.getColor(mercuryColor, null)); + } + + return thermometerPlot; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimePeriodDatasetFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimePeriodDatasetFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimePeriodDatasetFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimePeriodDatasetFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + + +import net.sf.jasperreports.charts.design.JRDesignTimePeriodDataset; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRTimePeriodDatasetFactory extends JRBaseFactory { + + @Override + public Object createObject( Attributes attrs ){ + JRDesignChart chart = (JRDesignChart)digester.peek(); + + JRDesignTimePeriodDataset dataset; + JRDesignTimePeriodDataset chartDataset = (JRDesignTimePeriodDataset) chart.getDataset(); + if(chartDataset == null){ + dataset = new JRDesignTimePeriodDataset(chartDataset); + } + else { + dataset = chartDataset; + } + + chart.setDataset(dataset); + + return dataset; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimePeriodSeriesFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimePeriodSeriesFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimePeriodSeriesFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimePeriodSeriesFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignTimePeriodSeries; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRTimePeriodSeriesFactory extends JRBaseFactory +{ + + @Override + public Object createObject( Attributes attrs ) + { + return new JRDesignTimePeriodSeries(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRTimeSeriesChartFactory extends JRBaseFactory { + @Override + public Object createObject( Attributes attrs ){ + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_TIMESERIES ); + + return chart; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesDatasetFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesDatasetFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesDatasetFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesDatasetFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + + +import net.sf.jasperreports.charts.design.JRDesignTimeSeriesDataset; +import net.sf.jasperreports.charts.type.TimePeriodEnum; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRTimeSeriesDatasetFactory extends JRBaseFactory { + + private static final String ATTRIBUTE_timePeriod = "timePeriod"; + + @Override + public Object createObject( Attributes attrs ){ + JRDesignChart chart = (JRDesignChart)digester.peek(); + + JRDesignTimeSeriesDataset dataset = null; + + if( chart.getDataset() == null ){ + dataset = new JRDesignTimeSeriesDataset( chart.getDataset() ); + } + else { + dataset = (JRDesignTimeSeriesDataset)chart.getDataset(); + } + + + TimePeriodEnum timePeriod = TimePeriodEnum.getByName(attrs.getValue(ATTRIBUTE_timePeriod)); + if( timePeriod != null) + { + dataset.setTimePeriod(timePeriod.getTimePeriod()); + } + + + chart.setDataset( dataset ); + + return dataset; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignTimeSeries; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRTimeSeriesFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) + { + return new JRDesignTimeSeries(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesPlotFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesPlotFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesPlotFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRTimeSeriesPlotFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignTimeSeriesPlot; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRTimeSeriesPlotFactory extends JRBaseFactory { + + private static final String ATTRIBUTE_isShowShapes = "isShowShapes"; + private static final String ATTRIBUTE_isShowLines = "isShowLines"; + + @Override + public Object createObject( Attributes attrs ){ + JRChart chart = (JRChart)digester.peek(); + JRDesignTimeSeriesPlot plot = (JRDesignTimeSeriesPlot)chart.getPlot(); + + String isShowShapes = attrs.getValue( ATTRIBUTE_isShowShapes ); + if( isShowShapes != null && isShowShapes.length() > 0 ){ + plot.setShowShapes(Boolean.valueOf(isShowShapes)); + } + + String isShowLines = attrs.getValue( ATTRIBUTE_isShowLines ); + if( isShowLines != null && isShowLines.length() > 0 ){ + plot.setShowLines(Boolean.valueOf(isShowLines) ); + } + + return plot; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRValueDatasetFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRValueDatasetFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRValueDatasetFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRValueDatasetFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRValueDatasetFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) + { + JRChart chart = (JRChart) digester.peek(); + return chart.getDataset(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRValueDisplayFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRValueDisplayFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRValueDisplayFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRValueDisplayFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignValueDisplay; +import net.sf.jasperreports.engine.JRChartPlot; +import net.sf.jasperreports.engine.util.JRColorUtil; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Barry Klawans (bklawans@users.sourceforge.net) + */ +public class JRValueDisplayFactory extends JRBaseFactory +{ + private static final String ATTRIBUTE_color = "color"; + private static final String ATTRIBUTE_mask = "mask"; + + @Override + public Object createObject(Attributes atts) + { + JRDesignValueDisplay valueDisplay = new JRDesignValueDisplay(null, ((JRChartPlot)digester.peek()).getChart()); + + String color = atts.getValue(ATTRIBUTE_color); + if (color != null && color.length() > 0) + { + valueDisplay.setColor(JRColorUtil.getColor(color, null)); + } + + String mask = atts.getValue(ATTRIBUTE_mask); + if (mask != null && mask.length() > 0) + { + valueDisplay.setMask(mask); + } + + return valueDisplay; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyAreaChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyAreaChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyAreaChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyAreaChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,46 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRXyAreaChartFactory extends JRBaseFactory { + + @Override + public Object createObject( Attributes atts ){ + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_XYAREA); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyBarChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyBarChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyBarChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyBarChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRXyBarChartFactory extends JRBaseFactory +{ + @Override + public Object createObject(Attributes atts) + { + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_XYBAR); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyDatasetFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyDatasetFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyDatasetFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyDatasetFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignXyDataset; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRXyDatasetFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) + { + JRDesignChart chart = (JRDesignChart) digester.peek(); + + JRDesignXyDataset dataset = null; + + if( chart.getDataset() == null ){ + dataset = new JRDesignXyDataset( chart.getDataset() ); + } + else { + dataset = (JRDesignXyDataset)chart.getDataset(); + } + + chart.setDataset( dataset ); + return dataset; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyLineChartFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyLineChartFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyLineChartFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyLineChartFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,46 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.design.JRDesignChart; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRXyLineChartFactory extends JRBaseFactory { + + @Override + public Object createObject( Attributes attrs ){ + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_XYLINE); + + return chart; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRXySeriesFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRXySeriesFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRXySeriesFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRXySeriesFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignXySeries; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class JRXySeriesFactory extends JRBaseFactory +{ + private static final String ATTRIBUTE_autoSort = "autoSort"; + + @Override + public Object createObject(Attributes atts) + { + JRDesignXySeries xySeries = new JRDesignXySeries(); + String autoSort = atts.getValue( ATTRIBUTE_autoSort ); + if( autoSort != null && autoSort.length() > 0 ){ + xySeries.setAutoSort(Boolean.valueOf(autoSort) ); + } + + return xySeries; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyzDatasetFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyzDatasetFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyzDatasetFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyzDatasetFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Flavius Sana (flavius_sana@users.sourceforge.net) + */ +public class JRXyzDatasetFactory extends JRBaseFactory { + + @Override + public Object createObject( Attributes attrs ){ + JRChart chart = (JRChart)digester.peek(); + return chart.getDataset(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyzSeriesFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyzSeriesFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyzSeriesFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/JRXyzSeriesFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.charts.xml; + +import net.sf.jasperreports.charts.design.JRDesignXyzSeries; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Flavius Sana (flavius_sana@user.sourceforge.net) + */ +public class JRXyzSeriesFactory extends JRBaseFactory +{ + + @Override + public Object createObject( Attributes attrs ) + { + return new JRDesignXyzSeries(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/charts/xml/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/charts/xml/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +/** + * Contains classes for loading chart related tags from report templates XML files. + */ +package net.sf.jasperreports.charts.xml; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/GroovyEvaluator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/GroovyEvaluator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/GroovyEvaluator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/GroovyEvaluator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,184 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.compilers; + +import groovy.lang.ExpandoMetaClass; +import groovy.lang.GroovyObject; +import groovy.lang.MetaClass; +import groovy.lang.MetaMethod; +import groovy.lang.MissingMethodException; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.fill.JREvaluator; +import net.sf.jasperreports.engine.fill.JasperReportsContextAware; +import net.sf.jasperreports.functions.FunctionSupport; +import net.sf.jasperreports.functions.FunctionsUtil; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.codehaus.groovy.runtime.DefaultGroovyMethods; +import org.codehaus.groovy.runtime.MethodClosure; +import org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod; + +/** + * Groovy expression evaluator that compiles expressions at fill time. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + * @see JRGroovyCompiler + */ +public abstract class GroovyEvaluator extends JREvaluator implements JasperReportsContextAware +{ + + private static final Log log = LogFactory.getLog(GroovyEvaluator.class); + public static final String EXCEPTION_MESSAGE_KEY_FUNCTION_NOT_FOUND = "compilers.groovy.function.not.found"; + + private FunctionsUtil functionsUtil; + + private List functionMethods = new ArrayList(); + + @Override + public void setJasperReportsContext(JasperReportsContext context) + { + this.functionsUtil = FunctionsUtil.getInstance(context); + } + + protected Object functionCall(String methodName, Object[] args) + { + Method functionMethod = functionsUtil.getMethod4Function(methodName); + if (functionMethod == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_FUNCTION_NOT_FOUND, + new Object[]{methodName}); + } + + // we're relying on this, if we'll ever resolve functions to methods + // that have different names we need to adapt the code + assert functionMethod.getName().equals(methodName); + + Class functionClass = functionMethod.getDeclaringClass(); + MetaClass functionMetaClass = DefaultGroovyMethods.getMetaClass(functionClass); + + MethodClosure functionMethodClosure = null; + if (FunctionSupport.class.isAssignableFrom(functionClass)) + { + // search for an instance method that applies to the arguments + MetaMethod metaMethod = functionMetaClass.getMetaMethod(methodName, args); + if (metaMethod != null && metaMethod.isPublic()) + { + @SuppressWarnings("unchecked") + FunctionSupport functionObject = getFunctionSupport((Class) functionClass); + functionMethodClosure = new MethodClosure(functionObject, methodName); + + if (log.isDebugEnabled()) + { + log.debug("found public instance method " + metaMethod + " in class " + functionClass); + } + } + } + + if (functionMethodClosure == null) + { + // searching for a static method that applies to the arguments + MetaMethod metaMethod = functionMetaClass.getStaticMetaMethod(methodName, args); + if (metaMethod != null && metaMethod.isPublic()) + { + // creating a static method closure + functionMethodClosure = new MethodClosure(functionClass, methodName); + + if (log.isDebugEnabled()) + { + log.debug("found public static method " + metaMethod + " in class " + functionClass); + } + } + } + + if (functionMethodClosure == null) + { + // we didn't find a public instance/static method that applies to the arguments + throw new MissingMethodException(methodName, functionMetaClass.getTheClass(), args); + } + + // adding the function methods for the name to the list of registered methods. + // we need to add all the methods with the same name in the beginning because once we add one method + // methodMissing might no longer be called. + // we need to reregister all methods on each new method since we create ExpandoMetaClass from scratch. + addFunctionClosureMethods(functionMethodClosure, methodName); + + // adding the methods to the evaluator MetaClass so that it doesn't go again into methodMissing + ExpandoMetaClass extendedMetaClass = new ExpandoMetaClass(getClass(), false); + registerMethods(extendedMetaClass); + extendedMetaClass.initialize(); + DefaultGroovyMethods.setMetaClass((GroovyObject) this, extendedMetaClass); + + // returning what we have to return + return functionMethodClosure.call(args); + } + + protected void addFunctionClosureMethods(MethodClosure methodClosure, String functionName) + { + // calling registerInstanceMethod(String, Closure) would register all methods, but we only want public methods + List closureMethods = ClosureMetaMethod.createMethodList(functionName, getClass(), methodClosure); + for (MetaMethod metaMethod : closureMethods) + { + if (!(metaMethod instanceof ClosureMetaMethod)) + { + // should not happen + log.warn("Got unexpected closure method " + metaMethod + " of type " + metaMethod.getClass().getName()); + continue; + } + + ClosureMetaMethod closureMethod = (ClosureMetaMethod) metaMethod; + if (!closureMethod.getDoCall().isPublic()) + { + if (log.isDebugEnabled()) + { + log.debug("method " + closureMethod.getDoCall() + " is not public, not registering"); + } + continue; + } + + if (log.isDebugEnabled()) + { + log.debug("creating closure method for " + closureMethod.getDoCall()); + } + + functionMethods.add(closureMethod); + } + } + + protected void registerMethods(ExpandoMetaClass extendedMetaClass) + { + for (ClosureMetaMethod closureMethod : functionMethods) + { + extendedMetaClass.registerInstanceMethod(closureMethod); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCallableThisDecorator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCallableThisDecorator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCallableThisDecorator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCallableThisDecorator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.compilers; + +import org.mozilla.javascript.Callable; +import org.mozilla.javascript.Context; +import org.mozilla.javascript.Scriptable; + +/** + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class JavaScriptCallableThisDecorator implements Callable +{ + + private final Callable decorated; + private final Scriptable thisTarget; + + public JavaScriptCallableThisDecorator(Callable decorated, + Scriptable thisTarget) + { + this.decorated = decorated; + this.thisTarget = thisTarget; + } + + @Override + public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) + { + return decorated.call(cx, scope, thisTarget, args); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptClassCompiler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptClassCompiler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptClassCompiler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptClassCompiler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,314 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.compilers; + +import java.io.File; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.mozilla.javascript.CompilerEnvirons; +import org.mozilla.javascript.Context; +import org.mozilla.javascript.ContextFactory; +import org.mozilla.javascript.EvaluatorException; +import org.mozilla.javascript.optimizer.ClassCompiler; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.design.JRCompilationUnit; +import net.sf.jasperreports.engine.util.CompositeExpressionChunkVisitor; +import net.sf.jasperreports.engine.util.JRExpressionUtil; + +/** + * Compiler for reports that use JavaScript as expression language. + * + * This implementation produces Java bytecode for the expressions. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + * @see JavaScriptCompiledData + * @see JavaScriptCompiledEvaluator + */ +public class JavaScriptClassCompiler extends JavaScriptCompilerBase +{ + + /** + * Property that determines the optimization level to use when compiling expressions + * into Java bytecode. + * + * See + */ + public static final String PROPERTY_OPTIMIZATION_LEVEL = JRPropertiesUtil.PROPERTY_PREFIX + + "javascript.class.compiler.optimization.level"; + + /** + * Property that determines the maximum number of report expressions that will be included + * in a single generated Java class. + */ + public static final String PROPERTY_EXPRESSIONS_PER_SCRIPT = JRPropertiesUtil.PROPERTY_PREFIX + + "javascript.class.compiler.expressions.per.script"; + + /** + * Property that determines the maximum size of a script that will be compiled into + * a single Java class. + */ + public static final String PROPERTY_SCRIPT_MAX_SIZE = JRPropertiesUtil.PROPERTY_PREFIX + + "javascript.class.compiler.script.max.size"; + + private static final Log log = LogFactory.getLog(JavaScriptClassCompiler.class); + + public static final String EXCEPTION_MESSAGE_KEY_UNEXPECTED_CLASS_NAME = "compilers.javascript.unexpected.class.name"; + public static final String EXCEPTION_MESSAGE_KEY_UNEXPECTED_CLASSES_LENGTH = "compilers.javascript.unexpected.classes.length"; + + /** + * Creates a JavaScript compiler. + */ + public JavaScriptClassCompiler(JasperReportsContext jasperReportsContext) + { + super(jasperReportsContext); + } + + @Override + protected String compileUnits(JRCompilationUnit[] units, String classpath, + File tempDirFile) throws JRException + { + Context context = ContextFactory.getGlobal().enterContext(); + try + { + JRPropertiesUtil properties = JRPropertiesUtil.getInstance(jasperReportsContext); + int expressionsPerScript = properties.getIntegerProperty(PROPERTY_EXPRESSIONS_PER_SCRIPT); + int scriptMaxLength = properties.getIntegerProperty(PROPERTY_SCRIPT_MAX_SIZE); + + int optimizationLevel = properties.getIntegerProperty(PROPERTY_OPTIMIZATION_LEVEL); + context.setOptimizationLevel(optimizationLevel); + context.getWrapFactory().setJavaPrimitiveWrap(false); + + Errors errors = new Errors(); + + CompilerEnvirons compilerEnv = new CompilerEnvirons(); + compilerEnv.initFromContext(context); + + // we're using the context to compile the expressions in interpreted mode to catch syntax errors + context.setOptimizationLevel(-1); + + for (int i = 0; i < units.length; i++) + { + JRCompilationUnit unit = units[i]; + CompileSources compileSources = new CompileSources(expressionsPerScript, scriptMaxLength); + JavaScriptCompiledData compiledData = new JavaScriptCompiledData(); + + for (Iterator it = unit.getExpressions().iterator(); it.hasNext();) + { + JRExpression expr = it.next(); + int id = unit.getCompileTask().getExpressionId(expr).intValue(); + + ScriptExpressionVisitor defaultVisitor = defaultExpressionCreator(); + JRExpressionUtil.visitChunks(expr, defaultVisitor); + String defaultExpression = defaultVisitor.getScript(); + + //compile the default expression to catch syntax errors + try + { + context.compileString(defaultExpression, "expression", 0, null); + } + catch (EvaluatorException e) + { + errors.addError(e); + } + + if (!errors.hasErrors()) + { + ScriptExpressionVisitor oldVisitor = oldExpressionCreator(); + ScriptExpressionVisitor estimatedVisitor = estimatedExpressionCreator(); + JRExpressionUtil.visitChunks(expr, new CompositeExpressionChunkVisitor(oldVisitor, estimatedVisitor)); + + int defaultExpressionIdx = compileSources.addExpression(defaultExpression); + int oldExpressionIdx = compileSources.addExpression(oldVisitor.getScript()); + int estimatedExpressionIdx = compileSources.addExpression(estimatedVisitor.getScript()); + + compiledData.addExpression(id, defaultExpressionIdx, oldExpressionIdx, estimatedExpressionIdx); + } + } + + if (!errors.hasErrors()) + { + compileScripts(unit, compilerEnv, compileSources, compiledData); + unit.setCompileData(compiledData); + } + } + + return errors.errorMessage(); + } + finally + { + Context.exit(); + } + } + + protected void compileScripts(JRCompilationUnit unit, CompilerEnvirons compilerEnv, + CompileSources compileSources, JavaScriptCompiledData compiledData) + { + List scripts = compileSources.getScripts(); + int scriptIndex = 0; + for (String scriptSource : scripts) + { + String scriptClassName = unit.getName() + "_" + scriptIndex; + + if (log.isTraceEnabled()) + { + log.trace("compiling script with name " + scriptClassName + + "\n" + scriptSource); + } + + ClassCompiler compiler = new ClassCompiler(compilerEnv); + // this should not fail since we've already separately compiled the default expression + Object[] compilationResult = compiler.compileToClassFiles(scriptSource, unit.getName(), 0, scriptClassName); + if (compilationResult.length != 2) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_UNEXPECTED_CLASSES_LENGTH, + new Object[]{compilationResult.length}); + } + if (!scriptClassName.equals(compilationResult[0])) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_UNEXPECTED_CLASS_NAME, + new Object[]{compilationResult[0], scriptClassName}); + } + + byte[] compiledClass = (byte[]) compilationResult[1]; + compiledData.addClass(scriptClassName, compiledClass); + + ++scriptIndex; + } + } + + protected static class CompileSources + { + private final int expressionsPerSource; + private final int scriptMaxLength; + + private final Map expressionIndexes = new HashMap(); + private final List scriptSources = new LinkedList(); + private int currentScriptIndex = 0; + private int currentExpressionId = 0; + private StringBuilder currentScriptSource; + + public CompileSources(int expressionsPerSource, int scriptMaxLength) + { + this.expressionsPerSource = expressionsPerSource; + this.scriptMaxLength = scriptMaxLength; + + currentScriptSource = initScriptSource(); + } + + private StringBuilder initScriptSource() + { + StringBuilder source = new StringBuilder(1024); + source.append("switch("); + source.append(JavaScriptCompiledEvaluator.EXPRESSION_ID_VAR); + source.append("){\n"); + return source; + } + + public Integer expressionIndex(String expression) + { + return expressionIndexes.get(expression); + } + + public int addExpression(String expression) + { + Integer existingIdx = expressionIndexes.get(expression); + if (existingIdx != null) + { + return existingIdx; + } + + String expressionFragment = "case " + currentExpressionId + ":\n" + + expression + "\nbreak\n"; + + if (currentExpressionId >= expressionsPerSource + || currentScriptSource.length() + expressionFragment.length() > scriptMaxLength) + { + addScriptSource(); + + // currentExpressionId has changed + expressionFragment = "case " + currentExpressionId + ":\n" + + expression + "\nbreak\n"; + } + + currentScriptSource.append(expressionFragment); + + int expressionIdx = JavaScriptCompiledData.makeExpressionIndex(currentScriptIndex, currentExpressionId); + ++currentExpressionId; + expressionIndexes.put(expression, expressionIdx); + + if (log.isTraceEnabled()) + { + log.trace("expression index " + expressionIdx + " for expression " + expression); + } + return expressionIdx; + } + + protected void addScriptSource() + { + closeCurrentScript(); + + currentScriptSource = initScriptSource(); + ++currentScriptIndex; + currentExpressionId = 0; + } + + protected void closeCurrentScript() + { + if (currentExpressionId > 0) + { + currentScriptSource.append("}"); + String scriptSource = currentScriptSource.toString(); + scriptSources.add(scriptSource); + + if (log.isDebugEnabled()) + { + log.debug("created script of length " + scriptSource.length() + + ", expression count " + currentExpressionId); + } + } + } + + public List getScripts() + { + closeCurrentScript(); + return scriptSources; + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptClassLoader.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptClassLoader.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptClassLoader.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptClassLoader.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,138 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.compilers; + +import net.sf.jasperreports.compilers.JavaScriptCompiledData.CompiledClass; +import net.sf.jasperreports.engine.JRRuntimeException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.mozilla.javascript.DefiningClassLoader; +import org.mozilla.javascript.Script; +import org.mozilla.javascript.optimizer.Codegen; + +/** + * Class loader used to load classes generated for JavaScript expression evaluation. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + * @see JavaScriptCompiledEvaluator + */ +public class JavaScriptClassLoader extends DefiningClassLoader +{ + + private static final Log log = LogFactory.getLog(JavaScriptClassLoader.class); + + public static final String EXCEPTION_MESSAGE_KEY_INSTANCE_ERROR = "compilers.javascript.instance.error"; + public static final String EXCEPTION_MESSAGE_KEY_LOAD_ERROR = "compilers.javascript.load.error"; + + public JavaScriptClassLoader() + { + super(Codegen.class.getClassLoader()); + } + + public Script createScript(int classIndex, JavaScriptCompiledData compiledData) + { + CompiledClass compiledClass = compiledData.getCompiledClass(classIndex); + Class scriptClass = loadExpressionClass(compiledClass); + try + { + Script script = scriptClass.newInstance(); + return script; + } + catch (InstantiationException e) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_INSTANCE_ERROR, + new Object[]{compiledClass.getClassName()}, + e); + } + catch (IllegalAccessException e) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_INSTANCE_ERROR, + new Object[]{compiledClass.getClassName()}, + e); + } + } + + protected synchronized Class loadExpressionClass(CompiledClass compiledClass) + { + String className = compiledClass.getClassName(); + + // first check if the class is already loaded + Class scriptClass = findLoadedClass(className); + if (scriptClass == null) + { + if (log.isDebugEnabled()) + { + log.debug("loading script class " + className); + } + + try + { + scriptClass = defineClass(className, compiledClass.getClassBytes()); + linkClass(scriptClass); + } + catch (SecurityException e) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_LOAD_ERROR, + new Object[]{className}, + e); + } + catch (IllegalArgumentException e) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_LOAD_ERROR, + new Object[]{className}, + e); + } + } + + return (Class) scriptClass; + } + + @Override + public String toString() + { + return getClass().getSimpleName() + '@' + hashCode(); + } + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if (log.isDebugEnabled()) + { + log.debug("finalized " + this); + } + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompileData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompileData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompileData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompileData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,116 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.compilers; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReport; + +/** + * Compile data for reports that use JavaScript as expression language. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + * @see JasperReport#getCompileData() + * @see JavaScriptCompiler + */ +public class JavaScriptCompileData implements Serializable +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + public static final String EXCEPTION_MESSAGE_KEY_EXPRESSION_NOT_FOUND = "compilers.javascript.expression.not.found"; + + protected static class Expression implements Serializable + { + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private final String defaultExpression; + private final String oldExpression; + private final String estimatedExpression; + + public Expression(String defaultExpression, String estimatedExpression, String oldExpression) + { + this.defaultExpression = defaultExpression; + this.estimatedExpression = estimatedExpression; + this.oldExpression = oldExpression; + } + + public String getDefaultExpression() + { + return defaultExpression; + } + + public String getOldExpression() + { + return oldExpression; + } + + public String getEstimatedExpression() + { + return estimatedExpression; + } + } + + private final List expressions = new ArrayList(); + + public void addExpression(int expressionId, Expression expression) + { + for (int idx = expressions.size(); idx <= expressionId; ++idx) + { + expressions.add(idx, null); + } + expressions.set(expressionId, expression); + } + + public void addExpression(int expressionId, + String defaultExpression, String estimatedExpression, String oldExpression) + { + Expression expression = new Expression(defaultExpression, estimatedExpression, oldExpression); + addExpression(expressionId, expression); + } + + public Expression getExpression(int id) + { + if (id >= expressions.size()) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_EXPRESSION_NOT_FOUND, + new Object[]{id}); + } + Expression expr = expressions.get(id); + if (expr == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_EXPRESSION_NOT_FOUND, + new Object[]{id}); + } + return expr; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompiledData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompiledData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompiledData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompiledData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,167 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.compilers; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRRuntimeException; + +/** + * Compiled Java code for reports that use JavaScript as expression language. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + * @see JavaScriptClassCompiler + */ +public class JavaScriptCompiledData implements Serializable +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + public static final String EXCEPTION_MESSAGE_KEY_TOO_MANY_EXPRESSIONs = "compilers.javascript.too.many.expressions"; + + protected static class ExpressionIndexes implements Serializable + { + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private final int defaultExpressionIdx; + private final int oldExpressionIdx; + private final int estimatedExpressionIdx; + + public ExpressionIndexes(int defaultExpressionIdx, int oldExpressionIdx, int estimatedExpressionIdx) + { + this.defaultExpressionIdx = defaultExpressionIdx; + this.oldExpressionIdx = oldExpressionIdx; + this.estimatedExpressionIdx = estimatedExpressionIdx; + } + + public int getDefaultExpressionIndex() + { + return defaultExpressionIdx; + } + + public int getOldExpressionIndex() + { + return oldExpressionIdx; + } + + public int getEstimatedExpressionIndex() + { + return estimatedExpressionIdx; + } + } + + protected static class CompiledClass implements Serializable + { + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private final String className; + private final byte[] classBytes; + + public CompiledClass(String className, byte[] classBytes) + { + this.className = className; + this.classBytes = classBytes; + } + + public String getClassName() + { + return className; + } + + public byte[] getClassBytes() + { + return classBytes; + } + } + + protected static int makeExpressionIndex(int scriptIndex, int expressionId) + { + if (scriptIndex > 0x7fff || expressionId > 0x7fff) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_TOO_MANY_EXPRESSIONs, + (Object[])null); + } + + return ((scriptIndex & 0x7fff) << 16) | (expressionId & 0x7fff); + } + + protected static int scriptIndex(int expressionIndex) + { + return (expressionIndex >> 16) & 0x7fff; + } + + protected static int expressionId(int expressionIndex) + { + return expressionIndex & 0x7fff; + } + + private final List expressionIndexes = new ArrayList(); + private final List compiledClasses = new ArrayList(1); + + public void addExpression(int expressionId, + int defaultExpressionIdx, int oldExpressionIdx, int estimatedExpressionIdx) + { + for (int idx = expressionIndexes.size(); idx <= expressionId; ++idx) + { + expressionIndexes.add(idx, null); + } + + ExpressionIndexes expressionData = new ExpressionIndexes(defaultExpressionIdx, oldExpressionIdx, estimatedExpressionIdx); + expressionIndexes.set(expressionId, expressionData); + } + + public ExpressionIndexes getExpression(int id) + { + if (id >= expressionIndexes.size()) + { + throw + new JRRuntimeException( + JavaScriptCompileData.EXCEPTION_MESSAGE_KEY_EXPRESSION_NOT_FOUND, + new Object[]{id}); + } + ExpressionIndexes expr = expressionIndexes.get(id); + if (expr == null) + { + throw + new JRRuntimeException( + JavaScriptCompileData.EXCEPTION_MESSAGE_KEY_EXPRESSION_NOT_FOUND, + new Object[]{id}); + } + return expr; + } + + public void addClass(String className, byte[] data) + { + compiledClasses.add(new CompiledClass(className, data)); + } + + public CompiledClass getCompiledClass(int classIndex) + { + return compiledClasses.get(classIndex); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompiledEvaluator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompiledEvaluator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompiledEvaluator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompiledEvaluator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,173 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.compilers; + +import java.util.HashMap; +import java.util.Map; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.fill.JREvaluator; +import net.sf.jasperreports.engine.fill.JRFillField; +import net.sf.jasperreports.engine.fill.JRFillParameter; +import net.sf.jasperreports.engine.fill.JRFillVariable; +import net.sf.jasperreports.engine.fill.JasperReportsContextAware; +import net.sf.jasperreports.functions.FunctionsUtil; + +import org.apache.commons.collections.map.ReferenceMap; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.mozilla.javascript.Script; + +/** + * JavaScript expression evaluator that uses Java bytecode compiled by {@link JavaScriptClassCompiler}. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class JavaScriptCompiledEvaluator extends JREvaluator implements JasperReportsContextAware +{ + + private static final Log log = LogFactory.getLog(JavaScriptCompiledEvaluator.class); + + protected static final String EXPRESSION_ID_VAR = "_jreid"; + + private static final ReferenceMap scriptClassLoaders = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT); + + protected static JavaScriptClassLoader getScriptClassLoader(String unitName) + { + JavaScriptClassLoader loader; + boolean created = false; + synchronized (scriptClassLoaders) + { + loader = (JavaScriptClassLoader) scriptClassLoaders.get(unitName); + if (loader == null) + { + loader = new JavaScriptClassLoader(); + scriptClassLoaders.put(unitName, loader); + created = true; + } + } + + if (created && log.isDebugEnabled()) + { + log.debug("created script class loader " + loader + " for " + unitName); + } + return loader; + } + + private final JasperReportsContext jasperReportsContext; + private final String unitName; + private final JavaScriptCompiledData compiledData; + private FunctionsUtil functionsUtil; + private JavaScriptEvaluatorScope evaluatorScope; + + private final Map scripts = new HashMap(); + + + /** + * Create a JavaScript expression evaluator. + * + * @param jasperReportsContext + * @param unitName + * @param compiledData the report compile data + */ + public JavaScriptCompiledEvaluator(JasperReportsContext jasperReportsContext, String unitName, JavaScriptCompiledData compiledData) + { + this.jasperReportsContext = jasperReportsContext; + this.unitName = unitName; + this.compiledData = compiledData; + } + + @Override + public void setJasperReportsContext(JasperReportsContext context) + { + this.functionsUtil = FunctionsUtil.getInstance(context); + } + + @Override + protected void customizedInit( + Map parametersMap, + Map fieldsMap, + Map variablesMap + ) throws JRException + { + evaluatorScope = new JavaScriptEvaluatorScope(jasperReportsContext, this, functionsUtil); + evaluatorScope.init(parametersMap, fieldsMap, variablesMap); + } + + @Override + protected Object evaluate(int id) throws Throwable //NOSONAR + { + JavaScriptCompiledData.ExpressionIndexes expression = getExpression(id); + return evaluateExpression(expression.getDefaultExpressionIndex()); + } + + @Override + protected Object evaluateEstimated(int id) throws Throwable //NOSONAR + { + JavaScriptCompiledData.ExpressionIndexes expression = getExpression(id); + return evaluateExpression(expression.getEstimatedExpressionIndex()); + } + + @Override + protected Object evaluateOld(int id) throws Throwable //NOSONAR + { + JavaScriptCompiledData.ExpressionIndexes expression = getExpression(id); + return evaluateExpression(expression.getOldExpressionIndex()); + } + + protected JavaScriptCompiledData.ExpressionIndexes getExpression(int id) + { + return compiledData.getExpression(id); + } + + protected Object evaluateExpression(int expressionIndex) + { + int scriptIndex = JavaScriptCompiledData.scriptIndex(expressionIndex); + Script script = scripts.get(scriptIndex); + if (script == null) + { + if (log.isTraceEnabled()) + { + log.trace("creating script for expression index " + expressionIndex + + ", script index " + scriptIndex); + } + + JavaScriptClassLoader scriptClassLoader = getScriptClassLoader(unitName); + script = scriptClassLoader.createScript(scriptIndex, compiledData); + scripts.put(scriptIndex, script); + } + + int expressionId = JavaScriptCompiledData.expressionId(expressionIndex); + evaluatorScope.setScopeVariable(EXPRESSION_ID_VAR, expressionId); + Object value = evaluatorScope.evaluateExpression(script); + if (log.isTraceEnabled()) + { + log.trace("expression with index " + expressionIndex + ", id " + expressionId + + " evaluated to " + value); + } + return value; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompilerBase.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompilerBase.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompilerBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompilerBase.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,239 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.compilers; + +import java.io.Serializable; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.mozilla.javascript.EvaluatorException; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpressionChunk; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.design.JRAbstractCompiler; +import net.sf.jasperreports.engine.design.JRCompilationSourceCode; +import net.sf.jasperreports.engine.design.JRSourceCompileTask; +import net.sf.jasperreports.engine.fill.JREvaluator; +import net.sf.jasperreports.engine.util.ExpressionChunkVisitor; +import net.sf.jasperreports.engine.util.JRStringUtil; + +/** + * Base compiler class for reports that use JavaScript as expression language. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public abstract class JavaScriptCompilerBase extends JRAbstractCompiler +{ + + private static final Log log = LogFactory.getLog(JavaScriptCompilerBase.class); + public static final String EXCEPTION_MESSAGE_KEY_INVALID_COMPILE_DATA_TYPE = "compilers.invalid.data.type"; + + /** + * Creates a JavaScript compiler. + */ + protected JavaScriptCompilerBase(JasperReportsContext jasperReportsContext) + { + super(jasperReportsContext, false); + } + + @Override + protected void checkLanguage(String language) throws JRException + { + //NOOP + } + + @Override + protected JRCompilationSourceCode generateSourceCode( + JRSourceCompileTask sourceTask) throws JRException + { + //no source code + return null; + } + + @Override + protected String getSourceFileName(String unitName) + { + return unitName + ".js"; + } + + @Override + protected JREvaluator loadEvaluator(Serializable compileData, + String unitName) throws JRException + { + if (compileData instanceof JavaScriptCompileData) + { + if (log.isDebugEnabled()) + { + log.debug("JavaScriptCompileData found for " + unitName); + } + + JavaScriptCompileData jsCompileData = (JavaScriptCompileData) compileData; + return new JavaScriptEvaluator(jasperReportsContext, jsCompileData); + } + + if (compileData instanceof JavaScriptCompiledData) + { + JavaScriptCompiledData jsCompiledData = (JavaScriptCompiledData) compileData; + return new JavaScriptCompiledEvaluator(jasperReportsContext, unitName, jsCompiledData); + } + + throw + new JRException( + EXCEPTION_MESSAGE_KEY_INVALID_COMPILE_DATA_TYPE, + new Object[]{compileData.getClass().getName()}); + } + + protected ScriptExpressionVisitor defaultExpressionCreator() + { + return new ScriptExpressionVisitor("getValue", "getValue"); + } + + protected ScriptExpressionVisitor oldExpressionCreator() + { + return new ScriptExpressionVisitor("getOldValue", "getOldValue"); + } + + protected ScriptExpressionVisitor estimatedExpressionCreator() + { + return new ScriptExpressionVisitor("getValue", "getEstimatedValue"); + } + + protected static String getParameterVar(String name) + { + return "param_" + JRStringUtil.getJavaIdentifier(name); + } + + protected static String getVariableVar(String name) + { + return "var_" + JRStringUtil.getJavaIdentifier(name); + } + + protected static String getFieldVar(String name) + { + return "field_" + JRStringUtil.getJavaIdentifier(name); + } + + protected static class ScriptExpressionVisitor implements ExpressionChunkVisitor + { + private final String fieldMethod; + private final String variableMethod; + protected final StringBuilder script = new StringBuilder(); + + public ScriptExpressionVisitor(String fieldMethod, String variableMethod) + { + this.fieldMethod = fieldMethod; + this.variableMethod = variableMethod; + } + + public String getScript() + { + if (script.length() == 0) + { + // empty expression, should evaluate to null + return "null"; + } + + return script.toString(); + } + + @Override + public void visitTextChunk(JRExpressionChunk chunk) + { + script.append(chunk.getText()); + } + + @Override + public void visitParameterChunk(JRExpressionChunk chunk) + { + String paramName = getParameterVar(chunk.getText()); + script.append(paramName); + script.append(".getValue()"); + } + + @Override + public void visitFieldChunk(JRExpressionChunk chunk) + { + String fieldName = getFieldVar(chunk.getText()); + script.append(fieldName).append('.').append(fieldMethod).append("()"); + } + + @Override + public void visitVariableChunk(JRExpressionChunk chunk) + { + String varName = getVariableVar(chunk.getText()); + script.append(varName).append('.').append(variableMethod).append("()"); + } + + @Override + public void visitResourceChunk(JRExpressionChunk chunk) + { + String key = chunk.getText(); + script.append(JavaScriptEvaluatorScope.EVALUATOR_VAR); + script.append(".str('"); + script.append(JRStringUtil.escapeJavaScript(key)); + script.append("')"); + } + } + + protected static class Errors + { + private final StringBuilder errors = new StringBuilder(); + private int errorCount = 0; + + public void addError(EvaluatorException error) + { + ++errorCount; + + errors.append(errorCount); + errors.append(". "); + String message = error.getMessage(); + errors.append(message); + errors.append(" at column "); + errors.append(error.columnNumber()); + String lineSource = error.lineSource(); + if (lineSource != null) + { + errors.append(" in line\n"); + errors.append(lineSource); + } + errors.append("\n"); + } + + public boolean hasErrors() + { + return errorCount > 0; + } + + public String errorMessage() + { + String errorsMessage = null; + if (errorCount > 0) + { + errorsMessage = errorCount + " error(s):\n" + errors; + } + return errorsMessage; + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompiler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompiler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompiler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptCompiler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,121 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.compilers; + +import java.io.File; +import java.util.Iterator; + +import org.mozilla.javascript.Context; +import org.mozilla.javascript.ContextFactory; +import org.mozilla.javascript.EvaluatorException; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.design.JRCompilationUnit; +import net.sf.jasperreports.engine.util.CompositeExpressionChunkVisitor; +import net.sf.jasperreports.engine.util.JRExpressionUtil; + +/** + * Compiler for reports that use JavaScript as expression language. + * + * This implementation produces evaluators that compile expressions at fill time. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + * @see JavaScriptEvaluator + * @see JavaScriptClassCompiler + */ +public class JavaScriptCompiler extends JavaScriptCompilerBase +{ + + /** + * Creates a JavaScript compiler. + */ + public JavaScriptCompiler(JasperReportsContext jasperReportsContext) + { + super(jasperReportsContext); + } + + @Override + protected void checkLanguage(String language) throws JRException + { + //NOOP + } + + @Override + protected String compileUnits(JRCompilationUnit[] units, String classpath, + File tempDirFile) throws JRException + { + Context context = ContextFactory.getGlobal().enterContext(); + try + { + Errors errors = new Errors(); + for (int i = 0; i < units.length; i++) + { + JRCompilationUnit unit = units[i]; + JavaScriptCompileData compileData = new JavaScriptCompileData(); + for (Iterator it = unit.getExpressions().iterator(); it.hasNext();) + { + JRExpression expr = it.next(); + int id = unit.getCompileTask().getExpressionId(expr).intValue(); + + ScriptExpressionVisitor defaultVisitor = defaultExpressionCreator(); + JRExpressionUtil.visitChunks(expr, defaultVisitor); + String defaultExpression = defaultVisitor.getScript(); + + //compile the default expression to catch syntax errors + try + { + context.compileString(defaultExpression, "expression", 0, null); + } + catch (EvaluatorException e) + { + errors.addError(e); + } + + if (!errors.hasErrors()) + { + ScriptExpressionVisitor oldVisitor = oldExpressionCreator(); + ScriptExpressionVisitor estimatedVisitor = estimatedExpressionCreator(); + JRExpressionUtil.visitChunks(expr, new CompositeExpressionChunkVisitor(oldVisitor, estimatedVisitor)); + + compileData.addExpression(id, defaultExpression, estimatedVisitor.getScript(), oldVisitor.getScript()); + } + } + + if (!errors.hasErrors()) + { + unit.setCompileData(compileData); + } + } + + return errors.errorMessage(); + } + finally + { + Context.exit(); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptEvaluator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptEvaluator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptEvaluator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptEvaluator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,121 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.compilers; + +import java.util.Map; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.fill.JREvaluator; +import net.sf.jasperreports.engine.fill.JRFillField; +import net.sf.jasperreports.engine.fill.JRFillParameter; +import net.sf.jasperreports.engine.fill.JRFillVariable; +import net.sf.jasperreports.engine.fill.JasperReportsContextAware; +import net.sf.jasperreports.functions.FunctionsUtil; + +/** + * JavaScript expression evaluator that compiles expressions at fill time. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + * @see JavaScriptCompiler + */ +public class JavaScriptEvaluator extends JREvaluator implements JasperReportsContextAware +{ + + /** + * Property that determines the optimization level used when compiling expressions. + * + * See + */ + public static final String PROPERTY_OPTIMIZATION_LEVEL = JRPropertiesUtil.PROPERTY_PREFIX + + "javascript.evaluator.optimization.level"; + + public static final String EXCEPTION_MESSAGE_KEY_EVALUATOR_LOAD_ERROR = "compilers.javascript.evaluator.load.error"; + + private final JasperReportsContext jrContext; + private final JavaScriptCompileData compileData; + private FunctionsUtil functionsUtil; + private JavaScriptEvaluatorScope evaluatorScope; + + /** + * Create a JavaScript expression evaluator. + * + * @param compileData the report compile data + */ + public JavaScriptEvaluator(JasperReportsContext jrContext, JavaScriptCompileData compileData) + { + this.jrContext = jrContext; + this.compileData = compileData; + } + + @Override + public void setJasperReportsContext(JasperReportsContext context) + { + this.functionsUtil = FunctionsUtil.getInstance(context); + } + + @Override + protected void customizedInit( + Map parametersMap, + Map fieldsMap, + Map variablesMap + ) throws JRException + { + evaluatorScope = new JavaScriptEvaluatorScope(jrContext, this, functionsUtil); + evaluatorScope.init(parametersMap, fieldsMap, variablesMap); + } + + @Override + protected Object evaluate(int id) throws Throwable //NOSONAR + { + JavaScriptCompileData.Expression expression = getExpression(id); + return evaluateExpression(expression.getDefaultExpression()); + } + + @Override + protected Object evaluateEstimated(int id) throws Throwable //NOSONAR + { + JavaScriptCompileData.Expression expression = getExpression(id); + return evaluateExpression(expression.getEstimatedExpression()); + } + + @Override + protected Object evaluateOld(int id) throws Throwable //NOSONAR + { + JavaScriptCompileData.Expression expression = getExpression(id); + return evaluateExpression(expression.getOldExpression()); + } + + protected JavaScriptCompileData.Expression getExpression(int id) + { + return compileData.getExpression(id); + } + + protected Object evaluateExpression(String expression) + { + return evaluatorScope.evaluateExpression(expression); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptEvaluatorScope.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptEvaluatorScope.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptEvaluatorScope.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptEvaluatorScope.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,297 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.compilers; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.fill.JREvaluator; +import net.sf.jasperreports.engine.fill.JRFillField; +import net.sf.jasperreports.engine.fill.JRFillParameter; +import net.sf.jasperreports.engine.fill.JRFillVariable; +import net.sf.jasperreports.functions.FunctionsUtil; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.mozilla.javascript.Context; +import org.mozilla.javascript.ContextFactory; +import org.mozilla.javascript.EvaluatorException; +import org.mozilla.javascript.Script; +import org.mozilla.javascript.ScriptableObject; + +/** + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class JavaScriptEvaluatorScope +{ + private static final Log log = LogFactory.getLog(JavaScriptEvaluatorScope.class); + + protected static final String EVALUATOR_VAR = "_jreval"; + + /** + * Base JavaScript value class. + */ + public abstract static class JSValue + { + private final ScriptableObject scope; + + protected JSValue(ScriptableObject scope) + { + this.scope = scope; + } + + protected final Object toJSValue(Object value) + { + return Context.javaToJS(value, scope); + } + } + + /** + * Parameter class used in JavaScript expressions. + */ + public static class JSParameter extends JSValue + { + private final JRFillParameter parameter; + + public JSParameter(JRFillParameter parameter, ScriptableObject scope) + { + super(scope); + this.parameter = parameter; + } + + public Object getValue() + { + return toJSValue(parameter.getValue()); + } + } + + /** + * Field class used in JavaScript expressions. + */ + public static class JSField extends JSValue + { + private final JRFillField field; + + public JSField(JRFillField field, ScriptableObject scope) + { + super(scope); + this.field = field; + } + + public Object getValue() + { + return toJSValue(field.getValue()); + } + + public Object getOldValue() + { + return toJSValue(field.getOldValue()); + } + } + + /** + * Variable class used in JavaScript expressions. + */ + public static class JSVariable extends JSValue + { + private final JRFillVariable variable; + + public JSVariable(JRFillVariable variable, ScriptableObject scope) + { + super(scope); + this.variable = variable; + } + + public Object getValue() + { + return toJSValue(variable.getValue()); + } + + public Object getOldValue() + { + return toJSValue(variable.getOldValue()); + } + + public Object getEstimatedValue() + { + return toJSValue(variable.getEstimatedValue()); + } + } + + private Context context; + private ScriptableObject scope; + private Map compiledExpressions = new HashMap(); + + public JavaScriptEvaluatorScope(JasperReportsContext jrContext, JREvaluator evaluator, FunctionsUtil functionsUtil) + { + context = enter(null); + + int optimizationLevel = JRPropertiesUtil.getInstance(jrContext).getIntegerProperty(JavaScriptEvaluator.PROPERTY_OPTIMIZATION_LEVEL); + if (log.isDebugEnabled()) + { + log.debug("optimization level " + optimizationLevel); + } + context.setOptimizationLevel(optimizationLevel); + + context.getWrapFactory().setJavaPrimitiveWrap(false); + + JavaScriptFunctionsObject functionsObject = new JavaScriptFunctionsObject(context, functionsUtil, evaluator); + this.scope = context.initStandardObjects(); + // is this OK? the original prototype set by initStandardObjects is lost, and functionsObject has no prototype. + // seems to be fine for now, if not we could try setting the Object prototype to functionsObject. + this.scope.setPrototype(functionsObject); + + this.scope.put(EVALUATOR_VAR, this.scope, evaluator); + + // exiting for now because we will enter later in ensureContext(), possibly on other thread + Context.exit(); + } + + public void init(Map parametersMap, + Map fieldsMap, + Map variablesMap) + { + for (Iterator> it = parametersMap.entrySet().iterator(); it.hasNext();) + { + Map.Entry entry = it.next(); + String name = entry.getKey(); + JRFillParameter param = entry.getValue(); + JSParameter jsParam = new JSParameter(param, scope); + scope.put(JavaScriptCompiler.getParameterVar(name), scope, jsParam); + } + + for (Iterator> it = variablesMap.entrySet().iterator(); it.hasNext();) + { + Map.Entry entry = it.next(); + String name = entry.getKey(); + JRFillVariable var = entry.getValue(); + JSVariable jsVar = new JSVariable(var, scope); + scope.put(JavaScriptCompiler.getVariableVar(name), scope, jsVar); + } + + if (fieldsMap != null) + { + for (Iterator> it = fieldsMap.entrySet().iterator(); it.hasNext();) + { + Map.Entry entry = it.next(); + String name = entry.getKey(); + JRFillField field = entry.getValue(); + JSField jsField = new JSField(field, scope); + scope.put(JavaScriptCompiler.getFieldVar(name), scope, jsField); + } + } + + } + + protected void ensureContext() + { + enter(context); + } + + public Object evaluateExpression(Script expression) + { + ensureContext(); + + Object value = expression.exec(context, scope); + + Object javaValue; + // not converting Number objects because the generic conversion call below + // always converts to Double + if (value == null || value instanceof Number) + { + javaValue = value; + } + else + { + try + { + javaValue = Context.jsToJava(value, Object.class); + } + catch (EvaluatorException e) + { + throw new JRRuntimeException(e); + } + } + return javaValue; + } + + public Object evaluateExpression(String expression) + { + Script compiledExpression = getCompiledExpression(expression); + return evaluateExpression(compiledExpression); + } + + public void setScopeVariable(String name, Object value) + { + scope.put(name, scope, value); + } + + protected Script getCompiledExpression(String expression) + { + Script compiledExpression = compiledExpressions.get(expression); + if (compiledExpression == null) + { + if (log.isTraceEnabled()) + { + log.trace("compiling expression " + expression); + } + + ensureContext(); + + compiledExpression = context.compileString(expression, "expression", 0, null); + compiledExpressions.put(expression, compiledExpression); + } + return compiledExpression; + } + + // enter a precreated context, or a new one if null is passed + protected static Context enter(Context context) + { + Context currentContext = Context.getCurrentContext(); + if (context != null && context == currentContext) + { + // already the current context + return currentContext; + } + + // exit the current context if any + if (currentContext != null) + { + Context.exit(); + } + + Context newContext = ContextFactory.getGlobal().enterContext(context); + + if (log.isDebugEnabled()) + { + log.debug("entered context " + newContext + ", requested " + context); + } + + return newContext; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptFunctionsObject.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptFunctionsObject.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptFunctionsObject.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JavaScriptFunctionsObject.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,220 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.compilers; + +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Map; + +import net.sf.jasperreports.engine.fill.JREvaluator; +import net.sf.jasperreports.functions.FunctionSupport; +import net.sf.jasperreports.functions.FunctionsUtil; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.mozilla.javascript.Callable; +import org.mozilla.javascript.Context; +import org.mozilla.javascript.Scriptable; + +/** + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class JavaScriptFunctionsObject implements Scriptable +{ + + private static final Log log = LogFactory.getLog(JavaScriptFunctionsObject.class); + + private final Context context; + private final FunctionsUtil functionsUtil; + private final JREvaluator evaluator; + private final Map functions; + + private Scriptable prototype; + private Scriptable parentScope; + + public JavaScriptFunctionsObject(Context context, FunctionsUtil functionsUtil, JREvaluator evaluator) + { + this.context = context; + this.functionsUtil = functionsUtil; + this.evaluator = evaluator; + this.functions = new HashMap(); + } + + @Override + public String getClassName() + { + return "JRFunctions"; + } + + @Override + public Object get(String name, Scriptable start) + { + Object function = resolveFunction(name, start); + return function; + } + + protected Object resolveFunction(String name, Scriptable start) + { + Object function = functions.get(name); + if (function != null) + { + return function; + } + + // remembering not found functions as well so that we don't look them up several times + function = NOT_FOUND; + + Method method = functionsUtil.getMethod4Function(name); + if (method != null) + { + Class functionClass = method.getDeclaringClass(); + if (FunctionSupport.class.isAssignableFrom(functionClass)) + { + // instance method, create the instance + @SuppressWarnings("unchecked") + FunctionSupport functionSupport = evaluator.getFunctionSupport( + (Class) functionClass); + + // wrap the function support as a JavaScript object + final Scriptable functionScriptable = context.getWrapFactory().wrapAsJavaObject( + context, start, functionSupport, functionClass); + // get the JavaScript method + Object functionCall = functionScriptable.get(name, start); + if (functionCall instanceof Callable)//this should be the case normally + { + Callable functionCallable = (Callable) functionCall; + // wrap the method so that it uses functionScriptable as this object + function = new JavaScriptCallableThisDecorator(functionCallable, functionScriptable); + } + } + else + { + // static method + // wrap the class + Scriptable functionScriptable = context.getWrapFactory().wrapJavaClass(context, start, functionClass); + // get the static JavaScript method + Object functionCall = functionScriptable.get(name, start); + if (functionCall instanceof Callable)//this should be the case normally + { + function = functionCall; + } + } + + if (function == NOT_FOUND && log.isDebugEnabled()) + { + // should not happen normally + log.debug("did not find JavaScript function " + name + " in class " + functionClass.getName()); + } + } + + functions.put(name, function); + return function; + } + + @Override + public Object get(int index, Scriptable start) + { + return NOT_FOUND; + } + + @Override + public boolean has(String name, Scriptable start) + { + Object function = resolveFunction(name, start); + return function != NOT_FOUND; + } + + @Override + public boolean has(int index, Scriptable start) + { + return false; + } + + @Override + public void put(String name, Scriptable start, Object value) + { + throw new UnsupportedOperationException(); + } + + @Override + public void put(int index, Scriptable start, Object value) + { + throw new UnsupportedOperationException(); + } + + @Override + public void delete(String name) + { + throw new UnsupportedOperationException(); + } + + @Override + public void delete(int index) + { + throw new UnsupportedOperationException(); + } + + @Override + public Scriptable getPrototype() + { + return prototype; + } + + @Override + public void setPrototype(Scriptable prototype) + { + this.prototype = prototype; + } + + @Override + public Scriptable getParentScope() + { + return parentScope; + } + + @Override + public void setParentScope(Scriptable parent) + { + this.parentScope = parent; + } + + @Override + public Object[] getIds() + { + return new Object[0]; + } + + @Override + public Object getDefaultValue(Class hint) + { + return "[object JRFunctions]"; + } + + @Override + public boolean hasInstance(Scriptable instance) + { + return false; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JRBshCompiler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JRBshCompiler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JRBshCompiler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JRBshCompiler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,148 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.compilers; + +import java.io.File; +import java.io.Serializable; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRReport; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.design.JRAbstractCompiler; +import net.sf.jasperreports.engine.design.JRCompilationSourceCode; +import net.sf.jasperreports.engine.design.JRCompilationUnit; +import net.sf.jasperreports.engine.design.JRDefaultCompilationSourceCode; +import net.sf.jasperreports.engine.design.JRSourceCompileTask; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JREvaluator; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated To be removed. + */ +public class JRBshCompiler extends JRAbstractCompiler +{ + /** + * A constant used to specify that the language used by expressions is BeanShell script. + */ + public static final String LANGUAGE_BSH = "bsh"; + + + /** + * + */ + public JRBshCompiler(JasperReportsContext jasperReportsContext) + { + super(jasperReportsContext, false); + } + + + @Override + protected JREvaluator loadEvaluator(Serializable compileData, String unitName) throws JRException + { + return new JRBshEvaluator((String) compileData); + } + + + @Override + protected void checkLanguage(String language) throws JRException + { + if ( + !LANGUAGE_BSH.equals(language) + && !JRReport.LANGUAGE_JAVA.equals(language) + ) + { + throw + new JRException( + EXCEPTION_MESSAGE_KEY_LANGUAGE_NOT_SUPPORTED, + new Object[]{language, LANGUAGE_BSH, JRReport.LANGUAGE_JAVA}); + } + } + + + @Override + protected JRCompilationSourceCode generateSourceCode(JRSourceCompileTask sourceTask) throws JRException + { + return new JRDefaultCompilationSourceCode(JRBshGenerator.generateScript(sourceTask), null); + } + + + @Override + protected String compileUnits(JRCompilationUnit[] units, String classpath, File tempDirFile) throws JRException + { + verifyScripts(units); + + for (int i = 0; i < units.length; i++) + { + String script = units[i].getSourceCode(); + units[i].setCompileData(script); + } + + return null; + } + + + private void verifyScripts(JRCompilationUnit[] units) throws JRException + { + ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + + // trick for detecting the Ant class loader + try + { + classLoader.loadClass(JRCalculator.class.getName()); + } + catch(ClassNotFoundException e) + { + classLoader = getClass().getClassLoader(); + } + + ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader(); + try + { + Thread.currentThread().setContextClassLoader(classLoader); + + for (int i = 0; i < units.length; i++) + { + String script = units[i].getSourceCode(); + + JRBshEvaluator bshEvaluator = new JRBshEvaluator(script); + bshEvaluator.verify(units[i].getExpressions()); + } + } + finally + { + Thread.currentThread().setContextClassLoader(oldContextClassLoader); + } + } + + + @Override + protected String getSourceFileName(String unitName) + { + return unitName + ".bsh"; + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JRBshEvaluator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JRBshEvaluator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JRBshEvaluator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JRBshEvaluator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,245 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.compilers; + +import java.io.IOException; +import java.io.LineNumberReader; +import java.io.StringReader; +import java.util.Collection; +import java.util.Iterator; +import java.util.Map; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.fill.JREvaluator; +import net.sf.jasperreports.engine.fill.JRFillField; +import net.sf.jasperreports.engine.fill.JRFillParameter; +import net.sf.jasperreports.engine.fill.JRFillVariable; +import bsh.EvalError; +import bsh.Interpreter; +import bsh.TargetError; + + +/** + * BeanShell expression evaluator that compiles expressions at fill time. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @see JRBshCompiler + * @deprecated To be removed. + */ +public class JRBshEvaluator extends JREvaluator +{ + + public static final String EXCEPTION_MESSAGE_KEY_INITIALIZING_REPORT_CALCULATOR = "compilers.beanshell.initializing.report.calculator"; + public static final String EXCEPTION_MESSAGE_KEY_EXPRESSIONS_EVALUATING_ERROR = "compilers.beanshell.expressions.evaluating.error"; + public static final String EXCEPTION_MESSAGE_KEY_EXPRESSIONS_TESTING_ERROR = "compilers.beanshell.expressions.testing.error"; + + /** + * + */ + private String bshScript; + private Interpreter interpreter; + + + /** + * + */ + public JRBshEvaluator(String bshScript) throws JRException + { + super(); + + this.bshScript = bshScript; + + interpreter = new Interpreter(); + + interpreter.setClassLoader(Thread.currentThread().getContextClassLoader()); + + try + { + interpreter.eval(new StringReader(bshScript)); + } + catch(EvalError e) + { + throw + new JRException( + EXCEPTION_MESSAGE_KEY_EXPRESSIONS_EVALUATING_ERROR, + new Object[]{e.getMessage(), e.getErrorLineNumber(), extractLineContent(e)}); + } + } + + + /** + * + */ + public void verify(Collection expressions) throws JRException + { + try + { + interpreter.eval("bshEvaluator = createBshEvaluator()"); + + if (expressions != null) + { + for(Iterator it = expressions.iterator(); it.hasNext();) + { + JRExpression expression = (JRExpression)it.next(); + interpreter.eval("bshEvaluator.evaluateOld(" + expression.getId() + ")"); + } + } + } + catch(TargetError te) + { + //ignore + } + catch(EvalError e) + { + throw + new JRException( + EXCEPTION_MESSAGE_KEY_EXPRESSIONS_TESTING_ERROR, + new Object[]{e.getMessage(), e.getErrorLineNumber(), extractLineContent(e)}); + } + } + + + @Override + protected void customizedInit( + Map pars, + Map fldsm, + Map varsm + ) throws JRException + { + try + { + interpreter.set("calculator", this); + interpreter.set("fldsm", fldsm); + interpreter.set("varsm", varsm); + interpreter.set("parsm", pars); + interpreter.eval("bshEvaluator = createBshEvaluator()"); + interpreter.eval("bshEvaluator.init(calculator, parsm, fldsm, varsm)"); + } + catch(EvalError e) + { + throw + new JRException( + EXCEPTION_MESSAGE_KEY_INITIALIZING_REPORT_CALCULATOR, + null, + e); + } + } + + + @Override + protected Object evaluateOld(int id) throws Throwable //NOSONAR + { + try + { + return interpreter.eval("bshEvaluator.evaluateOld(" + id + ")"); + } + catch(TargetError te) + { + throw te.getTarget(); + } + catch(EvalError ee) + { + throw ee; + } + } + + + @Override + protected Object evaluateEstimated(int id) throws Throwable //NOSONAR + { + try + { + return interpreter.eval("bshEvaluator.evaluateEstimated(" + id + ")"); + } + catch(TargetError te) + { + throw te.getTarget(); + } + catch(EvalError ee) + { + throw ee; + } + } + + + @Override + protected Object evaluate(int id) throws Throwable //NOSONAR + { + try + { + return interpreter.eval("bshEvaluator.evaluate(" + id + ")"); + } + catch(TargetError te) + { + throw te.getTarget(); + } + catch(EvalError ee) + { + throw ee; + } + } + + + /** + * + */ + private String extractLineContent(EvalError e) + { + String lineContent = ""; + + LineNumberReader reader = null; + + try + { + reader = new LineNumberReader(new StringReader(bshScript)); + int lineNumber = e.getErrorLineNumber(); + + for(int i = 0; i < lineNumber; i++) + { + lineContent = reader.readLine(); + } + } + catch(IOException ioe) + { + } + finally + { + if (reader != null) + { + try + { + reader.close(); + } + catch(IOException ioe) + { + } + } + } + + return lineContent; + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JRBshGenerator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JRBshGenerator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JRBshGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JRBshGenerator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,483 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/* + * Contributors: + * Gaganis Giorgos - gaganis@users.sourceforge.net + */ +package net.sf.jasperreports.compilers; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionChunk; +import net.sf.jasperreports.engine.JRField; +import net.sf.jasperreports.engine.JRParameter; +import net.sf.jasperreports.engine.JRVariable; +import net.sf.jasperreports.engine.design.JRSourceCompileTask; +import net.sf.jasperreports.engine.util.JRStringUtil; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated To be removed. + */ +public class JRBshGenerator +{ + + private static Map fieldPrefixMap; + private static Map variablePrefixMap; + private static Map methodSuffixMap; + + + /** + * + */ + protected final JRSourceCompileTask sourceTask; + + protected Map parametersMap; + protected Map fieldsMap; + protected Map variablesMap; + protected JRVariable[] variables; + + static + { + fieldPrefixMap = new HashMap(); + fieldPrefixMap.put(new Byte(JRExpression.EVALUATION_OLD), "Old"); + fieldPrefixMap.put(new Byte(JRExpression.EVALUATION_ESTIMATED), ""); + fieldPrefixMap.put(new Byte(JRExpression.EVALUATION_DEFAULT), ""); + + variablePrefixMap = new HashMap(); + variablePrefixMap.put(new Byte(JRExpression.EVALUATION_OLD), "Old"); + variablePrefixMap.put(new Byte(JRExpression.EVALUATION_ESTIMATED), "Estimated"); + variablePrefixMap.put(new Byte(JRExpression.EVALUATION_DEFAULT), ""); + + methodSuffixMap = new HashMap(); + methodSuffixMap.put(new Byte(JRExpression.EVALUATION_OLD), "Old"); + methodSuffixMap.put(new Byte(JRExpression.EVALUATION_ESTIMATED), "Estimated"); + methodSuffixMap.put(new Byte(JRExpression.EVALUATION_DEFAULT), ""); + } + + + protected JRBshGenerator(JRSourceCompileTask sourceTask) + { + this.sourceTask = sourceTask; + + this.parametersMap = sourceTask.getParametersMap(); + this.fieldsMap = sourceTask.getFieldsMap(); + this.variablesMap = sourceTask.getVariablesMap(); + this.variables = sourceTask.getVariables(); + } + + + /** + * + */ + public static String generateScript(JRSourceCompileTask sourceTask) + { + JRBshGenerator generator = new JRBshGenerator(sourceTask); + return generator.generateScript(); + } + + + protected String generateScript() + { + StringBuilder sb = new StringBuilder(); + + generateScriptStart(sb); + + generateDeclarations(sb); + generateInitMethod(sb); + + sb.append("\n"); + sb.append("\n"); + + List expressions = sourceTask.getExpressions(); + sb.append(generateMethod(JRExpression.EVALUATION_DEFAULT, expressions)); + if (sourceTask.isOnlyDefaultEvaluation()) + { + List empty = new ArrayList(); + sb.append(generateMethod(JRExpression.EVALUATION_OLD, empty)); + sb.append(generateMethod(JRExpression.EVALUATION_ESTIMATED, empty)); + } + else + { + sb.append(generateMethod(JRExpression.EVALUATION_OLD, expressions)); + sb.append(generateMethod(JRExpression.EVALUATION_ESTIMATED, expressions)); + } + + generateScriptEnd(sb); + + return sb.toString(); + } + + + protected final void generateScriptStart(StringBuilder sb) + { + /* */ + sb.append("//\n"); + sb.append("// Generated by JasperReports - "); + sb.append((new SimpleDateFormat()).format(new java.util.Date())); + sb.append("\n"); + sb.append("//\n"); + sb.append("import net.sf.jasperreports.engine.*;\n"); + sb.append("import net.sf.jasperreports.engine.fill.*;\n"); + sb.append("\n"); + sb.append("import java.util.*;\n"); + sb.append("import java.math.*;\n"); + sb.append("import java.text.*;\n"); + sb.append("import java.io.*;\n"); + sb.append("import java.net.*;\n"); + sb.append("\n"); + + /* */ + String[] imports = sourceTask.getImports(); + if (imports != null && imports.length > 0) + { + for (int i = 0; i < imports.length; i++) + { + sb.append("import "); + sb.append(imports[i]); + sb.append(";\n"); + } + } + + /* */ + sb.append("\n"); + sb.append("\n"); + sb.append("createBshEvaluator()\n"); + sb.append("{\n"); + sb.append("\n"); + sb.append("\n"); + sb.append(" JREvaluator evaluator = null;\n"); + sb.append("\n"); + } + + + protected final void generateDeclarations(StringBuilder sb) + { + /* */ + if (parametersMap != null && parametersMap.size() > 0) + { + Collection parameterNames = parametersMap.keySet(); + for (Iterator it = parameterNames.iterator(); it.hasNext();) + { + sb.append(" JRFillParameter parameter_"); + sb.append(JRStringUtil.getJavaIdentifier(it.next())); + sb.append(" = null;\n"); + } + } + + /* */ + sb.append("\n"); + + /* */ + if (fieldsMap != null && fieldsMap.size() > 0) + { + Collection fieldNames = fieldsMap.keySet(); + for (Iterator it = fieldNames.iterator(); it.hasNext();) + { + sb.append(" JRFillField field_"); + sb.append(JRStringUtil.getJavaIdentifier(it.next())); + sb.append(" = null;\n"); + } + } + + /* */ + sb.append("\n"); + + /* */ + if (variables != null && variables.length > 0) + { + for (int i = 0; i < variables.length; i++) + { + sb.append(" JRFillVariable variable_"); + sb.append(JRStringUtil.getJavaIdentifier(variables[i].getName())); + sb.append(" = null;\n"); + } + } + } + + + protected final void generateInitMethod(StringBuilder sb) + { + /* */ + sb.append("\n"); + sb.append("\n"); + sb.append(" init(\n"); + sb.append(" JREvaluator evaluator,\n"); + sb.append(" Map parsm,\n"); + sb.append(" Map fldsm,\n"); + sb.append(" Map varsm\n"); + sb.append(" )\n"); + sb.append(" {\n"); + sb.append(" super.evaluator = evaluator;\n"); + sb.append("\n"); + + /* */ + if (parametersMap != null && parametersMap.size() > 0) + { + Collection parameterNames = parametersMap.keySet(); + String parameterName = null; + for (Iterator it = parameterNames.iterator(); it.hasNext();) + { + parameterName = it.next(); + sb.append(" super.parameter_"); + sb.append(JRStringUtil.getJavaIdentifier(parameterName)); + sb.append(" = (JRFillParameter)parsm.get(\""); + sb.append(JRStringUtil.escapeJavaStringLiteral(parameterName)); + sb.append("\");\n"); + } + } + + /* */ + sb.append("\n"); + + /* */ + if (fieldsMap != null && fieldsMap.size() > 0) + { + Collection fieldNames = fieldsMap.keySet(); + String fieldName = null; + for (Iterator it = fieldNames.iterator(); it.hasNext();) + { + fieldName = it.next(); + sb.append(" super.field_"); + sb.append(JRStringUtil.getJavaIdentifier(fieldName)); + sb.append(" = (JRFillField)fldsm.get(\""); + sb.append(JRStringUtil.escapeJavaStringLiteral(fieldName)); + sb.append("\");\n"); + } + } + + /* */ + sb.append("\n"); + + /* */ + if (variables != null && variables.length > 0) + { + String variableName = null; + for (int i = 0; i < variables.length; i++) + { + variableName = variables[i].getName(); + sb.append(" super.variable_"); + sb.append(JRStringUtil.getJavaIdentifier(variableName)); + sb.append(" = (JRFillVariable)varsm.get(\""); + sb.append(JRStringUtil.escapeJavaStringLiteral(variableName)); + sb.append("\");\n"); + } + } + + /* */ + sb.append(" }\n"); + } + + + protected void generateScriptEnd(StringBuilder sb) + { + sb.append("\n"); + sb.append(" str(String key)\n"); + sb.append(" {\n"); + sb.append(" return super.evaluator.str(key);\n"); + sb.append(" }\n"); + sb.append("\n"); + sb.append(" msg(String pattern, Object arg0)\n"); + sb.append(" {\n"); + sb.append(" return super.evaluator.msg(pattern, arg0);\n"); + sb.append(" }\n"); + sb.append("\n"); + sb.append(" msg(String pattern, Object arg0, Object arg1)\n"); + sb.append(" {\n"); + sb.append(" return super.evaluator.msg(pattern, arg0, arg1);\n"); + sb.append(" }\n"); + sb.append("\n"); + sb.append(" msg(String pattern, Object arg0, Object arg1, Object arg2)\n"); + sb.append(" {\n"); + sb.append(" return super.evaluator.msg(pattern, arg0, arg1, arg2);\n"); + sb.append(" }\n"); + sb.append("\n"); + sb.append(" msg(String pattern, Object[] args)\n"); + sb.append(" {\n"); + sb.append(" return super.evaluator.msg(pattern, args);\n"); + sb.append(" }\n"); + sb.append("\n"); + sb.append(" return this;\n"); + sb.append("}\n"); + } + + + /** + * + */ + protected final String generateMethod(byte evaluationType, List expressionsList) + { + StringBuilder sb = new StringBuilder(); + + /* */ + sb.append(" Object evaluate"); + sb.append(methodSuffixMap.get(new Byte(evaluationType))); + sb.append("(int id)\n"); + sb.append(" {\n"); + sb.append(" Object value = null;\n"); + sb.append("\n"); + sb.append(" switch (id)\n"); + sb.append(" {\n"); + + if (expressionsList != null && !expressionsList.isEmpty()) + { + JRExpression expression = null; + for (Iterator it = expressionsList.iterator(); it.hasNext();) + { + expression = it.next(); + + sb.append(" case "); + sb.append(sourceTask.getExpressionId(expression)); + sb.append(" :\n"); + sb.append(" {\n"); + sb.append(" value = "); + sb.append(this.generateExpression(expression, evaluationType)); + sb.append(";\n"); + sb.append(" break;\n"); + sb.append(" }\n"); + } + } + + /* */ + sb.append(" default :\n"); + sb.append(" {\n"); + sb.append(" }\n"); + sb.append(" }\n"); + sb.append(" \n"); + sb.append(" return value;\n"); + sb.append(" }\n"); + sb.append("\n"); + sb.append("\n"); + + return sb.toString(); + } + + + /** + * + */ + private String generateExpression( + JRExpression expression, + byte evaluationType + ) + { + JRParameter jrParameter = null; + JRField jrField = null; + JRVariable jrVariable = null; + + StringBuilder sb = new StringBuilder(); + + JRExpressionChunk[] chunks = expression.getChunks(); + JRExpressionChunk chunk = null; + String chunkText = null; + if (chunks != null && chunks.length > 0) + { + for(int i = 0; i < chunks.length; i++) + { + chunk = chunks[i]; + + chunkText = chunk.getText(); + if (chunkText == null) + { + chunkText = ""; + } + + switch (chunk.getType()) + { + case JRExpressionChunk.TYPE_TEXT : + { + sb.append(chunkText); + break; + } + case JRExpressionChunk.TYPE_PARAMETER : + { + jrParameter = parametersMap.get(chunkText); + + sb.append("(("); + sb.append(jrParameter.getValueClassName()); + sb.append(")super.parameter_"); + sb.append(JRStringUtil.getJavaIdentifier(chunkText)); + sb.append(".getValue())"); + + break; + } + case JRExpressionChunk.TYPE_FIELD : + { + jrField = fieldsMap.get(chunkText); + + sb.append("(("); + sb.append(jrField.getValueClassName()); + sb.append(")super.field_"); + sb.append(JRStringUtil.getJavaIdentifier(chunkText)); + sb.append(".get"); + sb.append(fieldPrefixMap.get(new Byte(evaluationType))); + sb.append("Value())"); + + break; + } + case JRExpressionChunk.TYPE_VARIABLE : + { + jrVariable = variablesMap.get(chunkText); + + sb.append("(("); + sb.append(jrVariable.getValueClassName()); + sb.append(")super.variable_"); + sb.append(JRStringUtil.getJavaIdentifier(chunkText)); + sb.append(".get"); + sb.append(variablePrefixMap.get(new Byte(evaluationType))); + sb.append("Value())"); + + break; + } + case JRExpressionChunk.TYPE_RESOURCE : + { + jrParameter = parametersMap.get(chunkText); + + sb.append("super.evaluator.str(\""); + sb.append(chunkText); + sb.append("\")"); + + break; + } + } + } + } + + if (sb.length() == 0) + { + sb.append("null"); + } + + return sb.toString(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JRGroovyCompiler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JRGroovyCompiler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JRGroovyCompiler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JRGroovyCompiler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,194 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/* + * Contributors: + * Peter Severin - peter_p_s@users.sourceforge.net + */ +package net.sf.jasperreports.compilers; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.UnsupportedEncodingException; +import java.util.HashMap; +import java.util.Map; + +import org.codehaus.groovy.ast.ClassNode; +import org.codehaus.groovy.control.CompilationFailedException; +import org.codehaus.groovy.control.CompilationUnit; +import org.codehaus.groovy.control.CompilerConfiguration; +import org.codehaus.groovy.control.Phases; + +import groovyjarjarasm.asm.ClassVisitor; +import groovyjarjarasm.asm.ClassWriter; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRReport; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.design.JRAbstractJavaCompiler; +import net.sf.jasperreports.engine.design.JRCompilationSourceCode; +import net.sf.jasperreports.engine.design.JRCompilationUnit; +import net.sf.jasperreports.engine.design.JRDefaultCompilationSourceCode; +import net.sf.jasperreports.engine.design.JRSourceCompileTask; + +/** + * Calculator compiler that uses groovy to compile expressions. + * + * @author Teodor Danciu (teodord@users.sourceforge.net), Peter Severin (peter_p_s@users.sourceforge.net) + */ +public class JRGroovyCompiler extends JRAbstractJavaCompiler +{ + + protected static final String SOURCE_ENCODING = "UTF-8"; + public static final String EXCEPTION_MESSAGE_KEY_COMPILING_EXPRESSIONS_CLASS_FILE = "compilers.compiling.expressions.class.file"; + public static final String EXCEPTION_MESSAGE_KEY_TOO_FEW_CLASSES_GENERATED = "compilers.groovy.too.few.classes.generated"; + public static final String EXCEPTION_MESSAGE_KEY_TOO_MANY_CLASSES_GENERATED = "compilers.groovy.too.many.classes.generated"; + + /** + * + */ + public JRGroovyCompiler(JasperReportsContext jasperReportsContext) + { + super(jasperReportsContext, false); + } + + + @Override + protected String compileUnits(JRCompilationUnit[] units, String classpath, File tempDirFile) throws JRException + { + CompilerConfiguration config = new CompilerConfiguration(); + config.setSourceEncoding(SOURCE_ENCODING); + //config.setClasspath(classpath); + CompilationUnit unit = new CompilationUnit(config); + + for (int i = 0; i < units.length; i++) + { + try + { + byte[] sourceBytes = units[i].getSourceCode().getBytes(SOURCE_ENCODING); + unit.addSource("calculator_" + units[i].getName(), new ByteArrayInputStream(sourceBytes)); + } + catch (UnsupportedEncodingException e) + { + throw new JRRuntimeException(e); + } + } + + ClassCollector collector = new ClassCollector(); + unit.setClassgenCallback(collector); + try + { + unit.compile(Phases.CLASS_GENERATION); + } + catch (CompilationFailedException e) + { + throw + new JRException( + EXCEPTION_MESSAGE_KEY_COMPILING_EXPRESSIONS_CLASS_FILE, + new Object[] { e.toString()}, + e); + } + + if (collector.classes.size() < units.length) + { + throw + new JRException( + EXCEPTION_MESSAGE_KEY_TOO_FEW_CLASSES_GENERATED, + (Object[])null); + } + else if (collector.classCount > units.length) + { + throw + new JRException( + EXCEPTION_MESSAGE_KEY_TOO_MANY_CLASSES_GENERATED, + (Object[])null); + } + + for (int i = 0; i < units.length; i++) + { + units[i].setCompileData(collector.classes.get(units[i].getName())); + } + + return null; + } + + + /** + * + */ + private static class ClassCollector extends CompilationUnit.ClassgenCallback + { + public Map classes = new HashMap(); + public int classCount; + + /** + * @see org.codehaus.groovy.control.CompilationUnit.ClassgenCallback#call( + * groovyjarjarasm.asm.ClassVisitor, + * org.codehaus.groovy.ast.ClassNode) + */ + @Override + public void call(ClassVisitor writer, ClassNode node) throws CompilationFailedException + { + classCount++; + String name = node.getName(); + if (!classes.containsKey(name)) + { + byte[] bytes = ((ClassWriter) writer).toByteArray(); + classes.put(name, bytes); + } + } + } + + + @Override + protected void checkLanguage(String language) throws JRException + { + if ( + !JRReport.LANGUAGE_GROOVY.equals(language) + && !JRReport.LANGUAGE_JAVA.equals(language) + ) + { + throw + new JRException( + EXCEPTION_MESSAGE_KEY_LANGUAGE_NOT_SUPPORTED, + new Object[]{language, JRReport.LANGUAGE_GROOVY, JRReport.LANGUAGE_JAVA}); + } + } + + + @Override + protected JRCompilationSourceCode generateSourceCode(JRSourceCompileTask sourceTask) throws JRException + { + return new JRDefaultCompilationSourceCode(JRGroovyGenerator.generateClass(sourceTask), null); + } + + + @Override + protected String getSourceFileName(String unitName) + { + return unitName + ".groovy"; + } + + +} \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JRGroovyGenerator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JRGroovyGenerator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/JRGroovyGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/JRGroovyGenerator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,689 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/* + * Contributors: + * Peter Severin - peter_p_s@users.sourceforge.net + * Gaganis Giorgos - gaganis@users.sourceforge.net + */ +package net.sf.jasperreports.compilers; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionChunk; +import net.sf.jasperreports.engine.JRField; +import net.sf.jasperreports.engine.JRParameter; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRVariable; +import net.sf.jasperreports.engine.design.JRSourceCompileTask; +import net.sf.jasperreports.engine.util.JRStringUtil; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net), Peter Severin (peter_p_s@users.sourceforge.net) + */ +public class JRGroovyGenerator +{ + + public static final String PROPERTY_MAX_METHOD_SIZE = JRPropertiesUtil.PROPERTY_PREFIX + "compiler.max.groovy.method.size"; + + /** + * + */ + private static final int EXPR_MAX_COUNT_PER_METHOD = 100; + + private static Map fieldPrefixMap; + private static Map variablePrefixMap; + private static Map methodSuffixMap; + + static + { + fieldPrefixMap = new HashMap(); + fieldPrefixMap.put(new Byte(JRExpression.EVALUATION_OLD), "Old"); + fieldPrefixMap.put(new Byte(JRExpression.EVALUATION_ESTIMATED), ""); + fieldPrefixMap.put(new Byte(JRExpression.EVALUATION_DEFAULT), ""); + + variablePrefixMap = new HashMap(); + variablePrefixMap.put(new Byte(JRExpression.EVALUATION_OLD), "Old"); + variablePrefixMap.put(new Byte(JRExpression.EVALUATION_ESTIMATED), "Estimated"); + variablePrefixMap.put(new Byte(JRExpression.EVALUATION_DEFAULT), ""); + + methodSuffixMap = new HashMap(); + methodSuffixMap.put(new Byte(JRExpression.EVALUATION_OLD), "Old"); + methodSuffixMap.put(new Byte(JRExpression.EVALUATION_ESTIMATED), "Estimated"); + methodSuffixMap.put(new Byte(JRExpression.EVALUATION_DEFAULT), ""); + } + + /** + * + */ + protected final JRSourceCompileTask sourceTask; + + private final int maxMethodSize; + + protected Map parametersMap; + protected Map fieldsMap; + protected Map variablesMap; + protected JRVariable[] variables; + + protected JRGroovyGenerator(JRSourceCompileTask sourceTask) + { + this.sourceTask = sourceTask; + + this.parametersMap = sourceTask.getParametersMap(); + this.fieldsMap = sourceTask.getFieldsMap(); + this.variablesMap = sourceTask.getVariablesMap(); + this.variables = sourceTask.getVariables(); + + JRPropertiesUtil properties = JRPropertiesUtil.getInstance(sourceTask.getJasperReportsContext()); + maxMethodSize = properties.getIntegerProperty(PROPERTY_MAX_METHOD_SIZE, Integer.MAX_VALUE); + } + + + /** + * + */ + public static String generateClass(JRSourceCompileTask sourceTask) throws JRException + { + JRGroovyGenerator generator = new JRGroovyGenerator(sourceTask); + return generator.generateClass(); + } + + + protected String generateClass() throws JRException + { + StringBuilder sb = new StringBuilder(); + + generateClassStart(sb); + + generateDeclarations(sb); + + generateInitMethod(sb); + generateInitParamsMethod(sb); + if (fieldsMap != null) + { + generateInitFieldsMethod(sb); + } + generateInitVarsMethod(sb); + + List expressions = sourceTask.getExpressions(); + sb.append(this.generateMethod(JRExpression.EVALUATION_DEFAULT, expressions)); + if (sourceTask.isOnlyDefaultEvaluation()) + { + List empty = new ArrayList(); + sb.append(this.generateMethod(JRExpression.EVALUATION_OLD, empty)); + sb.append(this.generateMethod(JRExpression.EVALUATION_ESTIMATED, empty)); + } + else + { + sb.append(this.generateMethod(JRExpression.EVALUATION_OLD, expressions)); + sb.append(this.generateMethod(JRExpression.EVALUATION_ESTIMATED, expressions)); + } + + sb.append("}\n"); + + return sb.toString(); + } + + + private void generateInitMethod(StringBuilder sb) + { + sb.append("\n"); + sb.append("\n"); + sb.append(" /**\n"); + sb.append(" *\n"); + sb.append(" */\n"); + sb.append(" void customizedInit(\n"); + sb.append(" Map pm,\n"); + sb.append(" Map fm,\n"); + sb.append(" Map vm\n"); + sb.append(" )\n"); + sb.append(" {\n"); + sb.append(" initParams(pm);\n"); + if (fieldsMap != null) + { + sb.append(" initFields(fm);\n"); + } + sb.append(" initVars(vm);\n"); + sb.append(" }\n"); + sb.append("\n"); + sb.append("\n"); + } + + + protected final void generateClassStart(StringBuilder sb) + { + /* */ + sb.append("/*\n"); + sb.append(" * Generated by JasperReports - "); + sb.append((new SimpleDateFormat()).format(new java.util.Date())); + sb.append("\n"); + sb.append(" */\n"); + sb.append("import net.sf.jasperreports.engine.*;\n"); + sb.append("import net.sf.jasperreports.engine.fill.*;\n"); + sb.append("\n"); + sb.append("import java.util.*;\n"); + sb.append("import java.math.*;\n"); + sb.append("import java.text.*;\n"); + sb.append("import java.io.*;\n"); + sb.append("import java.net.*;\n"); + sb.append("\n"); + + /* */ + String[] imports = sourceTask.getImports(); + if (imports != null && imports.length > 0) + { + for (int i = 0; i < imports.length; i++) + { + sb.append("import "); + sb.append(imports[i]); + sb.append(";\n"); + } + } + + /* */ + sb.append("\n"); + sb.append("\n"); + sb.append("/**\n"); + sb.append(" *\n"); + sb.append(" */\n"); + sb.append("class "); + sb.append(sourceTask.getUnitName()); + sb.append(" extends net.sf.jasperreports.compilers.GroovyEvaluator\n"); + sb.append("{\n"); + sb.append("\n"); + sb.append( + " def methodMissing(String name, args) {\n" + + " return functionCall(name, args);\n" + + " }\n"); + sb.append("\n"); + sb.append(" /**\n"); + sb.append(" *\n"); + sb.append(" */\n"); + } + + + protected final void generateDeclarations(StringBuilder sb) + { + if (parametersMap != null && parametersMap.size() > 0) + { + Collection parameterNames = parametersMap.keySet(); + for (Iterator it = parameterNames.iterator(); it.hasNext();) + { + sb.append(" private JRFillParameter parameter_"); + sb.append(JRStringUtil.getJavaIdentifier(it.next())); + sb.append(" = null;\n"); + } + } + + if (fieldsMap != null && fieldsMap.size() > 0) + { + Collection fieldNames = fieldsMap.keySet(); + for (Iterator it = fieldNames.iterator(); it.hasNext();) + { + sb.append(" private JRFillField field_"); + sb.append(JRStringUtil.getJavaIdentifier(it.next())); + sb.append(" = null;\n"); + } + } + + if (variables != null && variables.length > 0) + { + for (int i = 0; i < variables.length; i++) + { + sb.append(" private JRFillVariable variable_"); + sb.append(JRStringUtil.getJavaIdentifier(variables[i].getName())); + sb.append(" = null;\n"); + } + } + } + + + protected final void generateInitParamsMethod(StringBuilder sb) throws JRException + { + Iterator parIt = null; + if (parametersMap != null && parametersMap.size() > 0) + { + parIt = parametersMap.keySet().iterator(); + } + else + { + Set emptySet = Collections.emptySet(); + parIt = emptySet.iterator(); + } + generateInitParamsMethod(sb, parIt, 0); + } + + + protected final void generateInitFieldsMethod(StringBuilder sb) throws JRException + { + Iterator fieldIt = null; + if (fieldsMap != null && fieldsMap.size() > 0) + { + fieldIt = fieldsMap.keySet().iterator(); + } + else + { + Set emptySet = Collections.emptySet(); + fieldIt = emptySet.iterator(); + } + generateInitFieldsMethod(sb, fieldIt, 0); + } + + + protected final void generateInitVarsMethod(StringBuilder sb) throws JRException + { + Iterator varIt = null; + if (variables != null && variables.length > 0) + { + varIt = Arrays.asList(variables).iterator(); + } + else + { + List emptyList = Collections.emptyList(); + varIt = emptyList.iterator(); + } + generateInitVarsMethod(sb, varIt, 0); + } + + + /** + * + */ + private void generateInitParamsMethod(StringBuilder sb, Iterator it, int index) throws JRException + { + sb.append(" /**\n"); + sb.append(" *\n"); + sb.append(" */\n"); + sb.append(" void initParams"); + if(index > 0) + { + sb.append(index); + } + sb.append("(Map pm)\n"); + sb.append(" {\n"); + for (int i = 0; i < EXPR_MAX_COUNT_PER_METHOD && it.hasNext(); i++) + { + String parameterName = it.next(); + sb.append(" parameter_"); + sb.append(JRStringUtil.getJavaIdentifier(parameterName)); + sb.append(" = (JRFillParameter)pm.get(\""); + sb.append(JRStringUtil.escapeJavaStringLiteral(parameterName)); + sb.append("\");\n"); + } + if(it.hasNext()) + { + sb.append(" initParams"); + sb.append(index + 1); + sb.append("(pm);\n"); + } + sb.append(" }\n"); + sb.append("\n"); + sb.append("\n"); + + if(it.hasNext()) + { + generateInitParamsMethod(sb, it, index + 1); + } + } + + + /** + * + */ + private void generateInitFieldsMethod(StringBuilder sb, Iterator it, int index) throws JRException + { + sb.append(" /**\n"); + sb.append(" *\n"); + sb.append(" */\n"); + sb.append(" void initFields"); + if(index > 0) + { + sb.append(index); + } + sb.append("(Map fm)\n"); + sb.append(" {\n"); + for (int i = 0; i < EXPR_MAX_COUNT_PER_METHOD && it.hasNext(); i++) + { + String fieldName = it.next(); + sb.append(" field_"); + sb.append(JRStringUtil.getJavaIdentifier(fieldName)); + sb.append(" = (JRFillField)fm.get(\""); + sb.append(JRStringUtil.escapeJavaStringLiteral(fieldName)); + sb.append("\");\n"); + } + if(it.hasNext()) + { + sb.append(" initFields"); + sb.append(index + 1); + sb.append("(fm);\n"); + } + sb.append(" }\n"); + sb.append("\n"); + sb.append("\n"); + + if(it.hasNext()) + { + generateInitFieldsMethod(sb, it, index + 1); + } + } + + + /** + * + */ + private void generateInitVarsMethod(StringBuilder sb, Iterator it, int index) throws JRException + { + sb.append(" /**\n"); + sb.append(" *\n"); + sb.append(" */\n"); + sb.append(" void initVars"); + if(index > 0) + { + sb.append(index); + } + sb.append("(Map vm)\n"); + sb.append(" {\n"); + for (int i = 0; i < EXPR_MAX_COUNT_PER_METHOD && it.hasNext(); i++) + { + String variableName = it.next().getName(); + sb.append(" variable_"); + sb.append(JRStringUtil.getJavaIdentifier(variableName)); + sb.append(" = (JRFillVariable)vm.get(\""); + sb.append(JRStringUtil.escapeJavaStringLiteral(variableName)); + sb.append("\");\n"); + } + if(it.hasNext()) + { + sb.append(" initVars"); + sb.append(index + 1); + sb.append("(vm);\n"); + } + sb.append(" }\n"); + sb.append("\n"); + sb.append("\n"); + + if(it.hasNext()) + { + generateInitVarsMethod(sb, it, index + 1); + } + } + + + /** + * + */ + protected final String generateMethod(byte evaluationType, List expressionsList) throws JRException + { + StringBuilder sb = new StringBuilder(); + + if (expressionsList != null && !expressionsList.isEmpty()) + { + sb.append(generateMethod(expressionsList.iterator(), evaluationType)); + } + else + { + /* */ + sb.append(" /**\n"); + sb.append(" *\n"); + sb.append(" */\n"); + sb.append(" Object evaluate"); + sb.append(methodSuffixMap.get(new Byte(evaluationType))); + sb.append("(int id)\n"); + sb.append(" {\n"); + sb.append(" return null;\n"); + sb.append(" }\n"); + sb.append("\n"); + sb.append("\n"); + } + + return sb.toString(); + } + + + /** + * + */ + private String generateMethod(Iterator it, byte evaluationType) throws JRException + { + int methodIndex = 0; + StringBuilder sb = new StringBuilder(); + + writeMethodHeader(sb, evaluationType, methodIndex); + ++methodIndex; + + StringBuilder methodBuffer = new StringBuilder(); + StringBuilder expressionBuffer = new StringBuilder(); + int methodExpressionIndex = 0; + while (it.hasNext()) + { + JRExpression expression = it.next(); + expressionBuffer.setLength(0); + writeExpression(expressionBuffer, expression, evaluationType); + + if (methodExpressionIndex >= EXPR_MAX_COUNT_PER_METHOD //FIXME use a property for this + || (methodExpressionIndex > 0 && methodBuffer.length() + expressionBuffer.length() > maxMethodSize)) + { + // end the current method + + //NB: relying on the fact that the expression ids are in ascending order + //FIXME investigate if using a main method that directly delegates to the other methods is better + writeNextMethodCall(sb, evaluationType, methodIndex, sourceTask.getExpressionId(expression)); + + sb.append(methodBuffer); + methodBuffer.setLength(0); + writeMethodEnd(sb); + + // start a new method + writeMethodHeader(sb, evaluationType, methodIndex); + ++methodIndex; + methodExpressionIndex = 0; + } + + // write expression to current method + if (methodExpressionIndex > 0) + { + methodBuffer.append(" "); + methodBuffer.append("else "); + } + methodBuffer.append(expressionBuffer); + ++methodExpressionIndex; + } + + sb.append(" "); + sb.append(methodBuffer); + writeMethodEnd(sb); + + return sb.toString(); + } + + protected void writeMethodHeader(StringBuilder sb, byte evaluationType, int methodIndex) + { + /* */ + sb.append(" /**\n"); + sb.append(" *\n"); + sb.append(" */\n"); + sb.append(" Object evaluate"); + sb.append( methodSuffixMap.get(new Byte(evaluationType))); + if (methodIndex > 0) + { + sb.append(methodIndex); + } + sb.append("(int id)\n"); + sb.append(" {\n"); + sb.append(" Object value = null;\n"); + sb.append("\n"); + } + + protected void writeMethodEnd(StringBuilder sb) + { + sb.append("\n"); + sb.append(" return value;\n"); + sb.append(" }\n"); + sb.append("\n"); + sb.append("\n"); + } + + protected void writeNextMethodCall(StringBuilder sb, byte evaluationType, int methodIndex, int startId) + { + sb.append(" if (id >= "); + sb.append(startId); + sb.append(")\n"); + sb.append(" {\n"); + sb.append(" value = evaluate"); + sb.append(methodSuffixMap.get(new Byte(evaluationType))); + sb.append(methodIndex); + sb.append("(id);\n"); + sb.append(" }\n"); + sb.append(" else "); + } + + protected void writeExpression(StringBuilder expressionBuffer, JRExpression expression, byte evaluationType) + { + expressionBuffer.append("if (id == "); + expressionBuffer.append(sourceTask.getExpressionId(expression)); + expressionBuffer.append(")\n"); + expressionBuffer.append(" {\n"); + expressionBuffer.append(" value = ("); + expressionBuffer.append(this.generateExpression(expression, evaluationType)); + expressionBuffer.append(");\n"); + expressionBuffer.append(" }\n"); + } + + /** + * + */ + private String generateExpression( + JRExpression expression, + byte evaluationType + ) + { + StringBuilder sb = new StringBuilder(); + + JRExpressionChunk[] chunks = expression.getChunks(); + if (chunks != null && chunks.length > 0) + { + for(int i = 0; i < chunks.length; i++) + { + JRExpressionChunk chunk = chunks[i]; + + String chunkText = chunk.getText(); + if (chunkText == null) + { + chunkText = ""; + } + + switch (chunk.getType()) + { + case JRExpressionChunk.TYPE_TEXT : + { + sb.append(chunkText); + break; + } + case JRExpressionChunk.TYPE_PARAMETER : + { + JRParameter jrParameter = parametersMap.get(chunkText); + + sb.append("("); + if (!"java.lang.Object".equals(jrParameter.getValueClassName())) + { + sb.append("("); + sb.append(jrParameter.getValueClassName()); + sb.append(")"); + } + sb.append("parameter_"); + sb.append(JRStringUtil.getJavaIdentifier(chunkText)); + sb.append(".getValue())"); + + break; + } + case JRExpressionChunk.TYPE_FIELD : + { + JRField jrField = fieldsMap.get(chunkText); + + sb.append("("); + if (!"java.lang.Object".equals(jrField.getValueClassName())) + { + sb.append("("); + sb.append(jrField.getValueClassName()); + sb.append(")"); + } + sb.append("field_"); + sb.append(JRStringUtil.getJavaIdentifier(chunkText)); + sb.append(".get"); + sb.append(fieldPrefixMap.get(new Byte(evaluationType))); + sb.append("Value())"); + + break; + } + case JRExpressionChunk.TYPE_VARIABLE : + { + JRVariable jrVariable = variablesMap.get(chunkText); + + sb.append("("); + if (!"java.lang.Object".equals(jrVariable.getValueClassName())) + { + sb.append("("); + sb.append(jrVariable.getValueClassName()); + sb.append(")"); + } + sb.append("variable_"); + sb.append(JRStringUtil.getJavaIdentifier(chunkText)); + sb.append(".get"); + sb.append(variablePrefixMap.get(new Byte(evaluationType))); + sb.append("Value())"); + + break; + } + case JRExpressionChunk.TYPE_RESOURCE : + { + sb.append("str(\""); + sb.append(chunkText); + sb.append("\")"); + + break; + } + } + } + } + + if (sb.length() == 0) + { + sb.append("null"); + } + + return sb.toString(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/compilers/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/compilers/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,84 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** + * Contains classes for report compiling and expressions evaluating. + *
    + *

    Compiling Report Templates

    + * Source report templates, created either by using the API or by parsing JRXML files, are + * subject to the report compilation process before they are filled with data. + *

    + * This is necessary to make various consistency validations and to incorporate into these + * report templates data used to evaluate all report expressions at runtime. + *

    + * The compilation process transforms + * {@link net.sf.jasperreports.engine.design.JasperDesign JasperDesign} objects into + * {@link net.sf.jasperreports.engine.JasperReport JasperReport} objects. Both classes are + * implementations of the same basic {@link net.sf.jasperreports.engine.JRReport JRReport} + * interface. However, {@link net.sf.jasperreports.engine.JasperReport JasperReport} objects cannot be modified once they are produced, + * while {@link net.sf.jasperreports.engine.design.JasperDesign JasperDesign} objects can. This is because some modifications made on the + * report template would probably require re-validation, or if a report expression is + * modified, the compiler-associated data stored inside the report template would have to be + * updated. + *

    + * {@link net.sf.jasperreports.engine.design.JasperDesign JasperDesign} objects are produced when parsing JRXML files using the + * {@link net.sf.jasperreports.engine.xml.JRXmlLoader JRXmlLoader} or created directly by the parent + * application if dynamic report templates are required. The GUI tools for editing + * JasperReports templates also work with this class to make in-memory modifications to + * the report templates before storing them on disk. + *

    + * A {@link net.sf.jasperreports.engine.design.JasperDesign JasperDesign} object must be subject to the report compilation process to produce a + * {@link net.sf.jasperreports.engine.JasperReport JasperReport} object. + *

    + * Central to this process is the {@link net.sf.jasperreports.engine.design.JRCompiler JRCompiler} + * interface, which defines two methods, one being the following: + *

    + *
    + * public JasperReport compileReport(JasperDesign design) throws JRException;
    + * There are several implementations for this compiler interface depending on the language + * used for the report expressions or the mechanism used for their runtime evaluation. + *

    + *

    Expressions Scripting Language

    + * The default language for the report expressions is Java, but report expressions + * can be written in Groovy, JavaScript or any other scripting language as long as a report + * compiler implementation that can evaluate them at runtime is available. + *

    + * JasperReports currently ships report compiler implementations for the Groovy scripting + * language (http://groovy.codehaus.org), + * JavaScript (http://www.mozilla.org/rhino), and + * the BeanShell scripting library (http://www.beanshell.org). + * The compiler implementation classes are: + *

      + *
    • {@link net.sf.jasperreports.compilers.JRGroovyCompiler JRGroovyCompiler}
    • + *
    • {@link net.sf.jasperreports.compilers.JavaScriptCompiler JavaScriptCompiler}
    • + *
    • {@link net.sf.jasperreports.compilers.JRBshCompiler JRBshCompiler}
    • + *
    + * Historically, these compiler implementations used to be shipped as separate samples, + * but now they are part of the core library. + *

    + *

    Related Documentation

    + * JasperReports Tutorial + +*/ +package net.sf.jasperreports.compilers; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/AbstractComponentXmlWriter.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/AbstractComponentXmlWriter.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/AbstractComponentXmlWriter.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/AbstractComponentXmlWriter.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,141 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components; + +import java.io.IOException; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRReport; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.component.ComponentKey; +import net.sf.jasperreports.engine.component.ComponentXmlWriter; +import net.sf.jasperreports.engine.util.JRXmlWriteHelper; +import net.sf.jasperreports.engine.util.VersionComparator; +import net.sf.jasperreports.engine.util.XmlNamespace; +import net.sf.jasperreports.engine.xml.JRXmlBaseWriter; +import net.sf.jasperreports.engine.xml.JRXmlWriter; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @see ComponentsExtensionsRegistryFactory + */ +public abstract class AbstractComponentXmlWriter implements ComponentXmlWriter +{ + /** + * + */ + public static final String PROPERTY_COMPONENTS_PREFIX = JRPropertiesUtil.PROPERTY_PREFIX + "components."; + + /** + * + */ + public static final String PROPERTY_COMPONENTS_VERSION_SUFFIX = ".version"; + + protected final JasperReportsContext jasperReportsContext; + protected final VersionComparator versionComparator; + + /** + * + */ + public AbstractComponentXmlWriter(JasperReportsContext jasperReportsContext) + { + this.jasperReportsContext = jasperReportsContext; + this.versionComparator = new VersionComparator(); + } + + /** + * + */ + public static String getVersion(JasperReportsContext jasperReportsContext, JRComponentElement componentElement, JRXmlWriter reportWriter) + { + String version = null; + + ComponentKey componentKey = componentElement.getComponentKey(); + String versionProperty = PROPERTY_COMPONENTS_PREFIX + componentKey.getName() + PROPERTY_COMPONENTS_VERSION_SUFFIX; + + if (componentElement.getPropertiesMap().containsProperty(versionProperty)) + { + version = componentElement.getPropertiesMap().getProperty(versionProperty); + } + else + { + JRReport report = reportWriter.getReport(); + version = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(report, versionProperty); + + if (version == null) + { + version = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(report, JRXmlBaseWriter.PROPERTY_REPORT_VERSION); + } + } + + return version; + } + + /** + * + */ + protected boolean isNewerVersionOrEqual(JRComponentElement componentElement, JRXmlWriter reportWriter, String oldVersion) //FIXMEVERSION can we pass something else then reportWriter? + { + return versionComparator.compare(getVersion(jasperReportsContext, componentElement, reportWriter), oldVersion) >= 0; + } + + /* + * + */ + protected boolean isOlderVersionThan(JRComponentElement componentElement, JRXmlWriter reportWriter, String version) + { + return versionComparator.compare(getVersion(jasperReportsContext, componentElement, reportWriter), version) < 0; + } + + @SuppressWarnings("deprecation") + protected void writeExpression(String name, JRExpression expression, boolean writeClass, JRComponentElement componentElement, JRXmlWriter reportWriter) throws IOException + { + JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); + if(isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_4_1_1)) + { + writer.writeExpression(name, expression); + } + else + { + writer.writeExpression(name, expression, writeClass); + } + } + + @SuppressWarnings("deprecation") + protected void writeExpression(String name, XmlNamespace namespace, JRExpression expression, boolean writeClass, JRComponentElement componentElement, JRXmlWriter reportWriter) throws IOException + { + JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); + if(isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_4_1_1)) + { + writer.writeExpression(name, namespace, expression); + } + else + { + writer.writeExpression(name, namespace, expression, writeClass); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueCompiler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueCompiler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueCompiler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueCompiler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,94 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barbecue; + +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.component.ComponentCompiler; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarbecueCompiler implements ComponentCompiler +{ + + @Override + public void collectExpressions(Component component, JRExpressionCollector collector) + { + BarbecueComponent barcode = (BarbecueComponent) component; + collector.addExpression(barcode.getCodeExpression()); + collector.addExpression(barcode.getApplicationIdentifierExpression()); + } + + @Override + public Component toCompiledComponent(Component component, + JRBaseObjectFactory baseFactory) + { + BarbecueComponent barcode = (BarbecueComponent) component; + return new StandardBarbecueComponent(barcode, baseFactory); + } + + @Override + public void verify(Component component, JRVerifier verifier) + { + BarbecueComponent barcode = (BarbecueComponent) component; + + String type = barcode.getType(); + if (type == null) + { + verifier.addBrokenRule("No barcode type set", barcode); + } + + JRExpression codeExpression = barcode.getCodeExpression(); + if (codeExpression == null) + { + verifier.addBrokenRule("Barcode expression is null", barcode); + } + + EvaluationTimeEnum evaluationTime = barcode.getEvaluationTimeValue(); + if (evaluationTime == EvaluationTimeEnum.AUTO) + { + verifier.addBrokenRule("Auto evaluation time is not supported for barcodes", barcode); + } + else if (evaluationTime == EvaluationTimeEnum.GROUP) + { + String evaluationGroup = barcode.getEvaluationGroup(); + if (evaluationGroup == null || evaluationGroup.length() == 0) + { + verifier.addBrokenRule("No evaluation group set for barcode", barcode); + } + else if (!verifier.getReportDesign().getGroupsMap().containsKey(evaluationGroup)) + { + verifier.addBrokenRule("Barcode evaluation group \"" + + evaluationGroup + " not found", barcode); + } + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barbecue; + +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.component.ContextAwareComponent; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; +import net.sf.jasperreports.engine.type.RotationEnum; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public interface BarbecueComponent extends ContextAwareComponent, JRCloneable +{ + //TODO scale type, alignment + + String getType(); + + JRExpression getApplicationIdentifierExpression(); + + //TODO use Object? + JRExpression getCodeExpression(); + + boolean isDrawText(); + + boolean isChecksumRequired(); + + Integer getBarWidth(); + + Integer getBarHeight(); + + EvaluationTimeEnum getEvaluationTimeValue(); + + String getEvaluationGroup(); + + RotationEnum getRotation(); + + RotationEnum getOwnRotation(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueDesignConverter.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueDesignConverter.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueDesignConverter.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueDesignConverter.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,113 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barbecue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRPrintElement; +import net.sf.jasperreports.engine.base.JRBasePrintImage; +import net.sf.jasperreports.engine.component.ComponentDesignConverter; +import net.sf.jasperreports.engine.convert.ReportConverter; +import net.sf.jasperreports.engine.type.ScaleImageEnum; +import net.sf.jasperreports.engine.util.JRExpressionUtil; +import net.sourceforge.barbecue.Barcode; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarbecueDesignConverter implements ComponentDesignConverter +{ + + private static final Log log = LogFactory.getLog(BarbecueDesignConverter.class); + + private static final String DEFAULT_PREVIEW_CODE = "01234567890"; + + @Override + public JRPrintElement convert(ReportConverter reportConverter, + JRComponentElement element) + { + BarbecueComponent component = (BarbecueComponent) element.getComponent(); + if (component == null || component.getType() == null) + { + return null; + } + + try + { + JRBasePrintImage image = new JRBasePrintImage( + reportConverter.getDefaultStyleProvider()); + reportConverter.copyBaseAttributes(element, image); + image.setScaleImage(ScaleImageEnum.RETAIN_SHAPE); + + String code = null; + if (component.getCodeExpression() != null) + { + code = JRExpressionUtil.getSimpleExpressionText( + component.getCodeExpression()); + } + if (code == null) + { + //TODO custom default code + code = DEFAULT_PREVIEW_CODE; + } + + String applicationIdentifier = null; + if (component.getApplicationIdentifierExpression() != null) + { + applicationIdentifier = JRExpressionUtil.getSimpleExpressionText( + component.getApplicationIdentifierExpression()); + } + //TODO custom default app id + + BarcodeInfo barcodeInfo = new BarcodeInfo(); + barcodeInfo.setType(component.getType()); + barcodeInfo.setCode(code); + barcodeInfo.setApplicationIdentifier(applicationIdentifier); + barcodeInfo.setDrawText(component.isDrawText()); + barcodeInfo.setRequiresChecksum(component.isChecksumRequired()); + barcodeInfo.setBarWidth(component.getBarWidth()); + barcodeInfo.setBarHeight(component.getBarHeight()); + + Barcode barcode = BarcodeProviders.createBarcode(barcodeInfo); + BarbecueRendererImpl renderer = new BarbecueRendererImpl(barcode); + renderer.setRotation(BarbecueStyleResolver.getRotationValue(element)); + image.setRenderer(renderer); + return image; + } + catch (Exception e) + { + if (log.isDebugEnabled()) + { + log.debug("Error while previewing barcode", e); + } + + return null; + } + + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueFillComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueFillComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueFillComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueFillComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,167 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barbecue; + +import java.util.HashMap; +import java.util.Map; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRPrintElement; +import net.sf.jasperreports.engine.JRStyle; +import net.sf.jasperreports.engine.component.BaseFillComponent; +import net.sf.jasperreports.engine.component.FillPrepareResult; +import net.sf.jasperreports.engine.fill.JRTemplateImage; +import net.sf.jasperreports.engine.fill.JRTemplatePrintImage; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; +import net.sf.jasperreports.engine.type.ScaleImageEnum; +import net.sf.jasperreports.engine.util.JRStringUtil; +import net.sourceforge.barbecue.Barcode; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarbecueFillComponent extends BaseFillComponent +{ + + private final BarbecueComponent barcodeComponent; + + private final Map printTemplates = new HashMap(); + + private String code; + private String applicationIdentifier; + + public BarbecueFillComponent(BarbecueComponent barcode) + { + this.barcodeComponent = barcode; + } + + protected BarbecueComponent getBarcode() + { + return barcodeComponent; + } + + @Override + public void evaluate(byte evaluation) throws JRException + { + if (isEvaluateNow()) + { + evaluateBarcode(evaluation); + } + } + + protected void evaluateBarcode(byte evaluation) throws JRException + { + code = JRStringUtil.getString(fillContext.evaluate(barcodeComponent.getCodeExpression(), evaluation)); + + applicationIdentifier = JRStringUtil.getString(fillContext.evaluate(barcodeComponent.getApplicationIdentifierExpression(), evaluation)); + } + + protected boolean isEvaluateNow() + { + return barcodeComponent.getEvaluationTimeValue() == EvaluationTimeEnum.NOW; + } + + @Override + public FillPrepareResult prepare(int availableHeight) + { + //FIXMENOW do like for map and spider chart, because it crashes with null code one evaluationTime != NOW; check barbecue too + return isEvaluateNow() && code == null + ? FillPrepareResult.NO_PRINT_NO_OVERFLOW + : FillPrepareResult.PRINT_NO_STRETCH; + } + + @Override + public JRPrintElement fill() + { + JRTemplateImage templateImage = getTemplateImage(); + + JRTemplatePrintImage image = new JRTemplatePrintImage(templateImage, printElementOriginator); + JRComponentElement element = fillContext.getComponentElement(); + image.setUUID(element.getUUID()); + image.setX(element.getX()); + image.setY(fillContext.getElementPrintY()); + image.setWidth(element.getWidth()); + image.setHeight(element.getHeight()); + + if (isEvaluateNow()) + { + setBarcodeImage(image); + } + else + { + fillContext.registerDelayedEvaluation(image, + barcodeComponent.getEvaluationTimeValue(), + barcodeComponent.getEvaluationGroup()); + } + + return image; + } + + @Override + public void evaluateDelayedElement(JRPrintElement element, byte evaluation) + throws JRException + { + evaluateBarcode(evaluation); + setBarcodeImage((JRTemplatePrintImage) element); + } + + protected void setBarcodeImage(JRTemplatePrintImage image) + { + BarcodeInfo barcodeInfo = new BarcodeInfo(); + barcodeInfo.setType(barcodeComponent.getType()); + barcodeInfo.setCode(code); + barcodeInfo.setApplicationIdentifier(applicationIdentifier); + barcodeInfo.setDrawText(barcodeComponent.isDrawText()); + barcodeInfo.setRequiresChecksum(barcodeComponent.isChecksumRequired()); + barcodeInfo.setBarWidth(barcodeComponent.getBarWidth()); + barcodeInfo.setBarHeight(barcodeComponent.getBarHeight()); + + Barcode barcode = BarcodeProviders.createBarcode(barcodeInfo); + BarbecueRendererImpl renderer = new BarbecueRendererImpl(barcode); + renderer.setRotation(BarbecueStyleResolver.getRotationValue(fillContext.getComponentElement())); + + image.setRenderer(renderer); + } + + protected JRTemplateImage getTemplateImage() + { + JRStyle elementStyle = fillContext.getElementStyle(); + JRTemplateImage templateImage = printTemplates.get(elementStyle); + if (templateImage == null) + { + templateImage = new JRTemplateImage( + fillContext.getElementOrigin(), + fillContext.getDefaultStyleProvider()); + templateImage.setStyle(elementStyle); + templateImage.setScaleImage(ScaleImageEnum.RETAIN_SHAPE); + + templateImage = deduplicate(templateImage); + printTemplates.put(elementStyle, templateImage); + } + return templateImage; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueFillFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueFillFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueFillFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueFillFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barbecue; + +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.component.ComponentFillFactory; +import net.sf.jasperreports.engine.component.FillComponent; +import net.sf.jasperreports.engine.fill.JRFillCloneFactory; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarbecueFillFactory implements ComponentFillFactory +{ + + @Override + public FillComponent toFillComponent(Component component, + JRFillObjectFactory factory) + { + BarbecueComponent barcode = (BarbecueComponent) component; + return new BarbecueFillComponent(barcode); + } + + @Override + public FillComponent cloneFillComponent(FillComponent component, + JRFillCloneFactory factory) + { + BarbecueFillComponent fillBarcode = (BarbecueFillComponent) component; + return new BarbecueFillComponent(fillBarcode.getBarcode()); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueRendererImpl.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueRendererImpl.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueRendererImpl.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueRendererImpl.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,160 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barbecue; + +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.geom.AffineTransform; +import java.awt.geom.Dimension2D; +import java.awt.geom.Rectangle2D; + +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.type.RotationEnum; +import net.sf.jasperreports.renderers.AbstractRenderer; +import net.sf.jasperreports.renderers.DimensionRenderable; +import net.sf.jasperreports.renderers.Graphics2DRenderable; +import net.sourceforge.barbecue.Barcode; +import net.sourceforge.barbecue.output.OutputException; + + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarbecueRendererImpl extends AbstractRenderer implements Graphics2DRenderable, DimensionRenderable +{ + + private static final long serialVersionUID = 1L; + + private Barcode barcode; + + private RotationEnum rotation; + + public BarbecueRendererImpl(Barcode barcode) + { + this.barcode = barcode; + } + + @Override + public Dimension2D getDimension(JasperReportsContext jasperReportsContext) + { + if (rotation != null) + { + switch(rotation) + { + case LEFT: + case RIGHT: + return new Dimension((int)barcode.getSize().getHeight(),(int)barcode.getSize().getWidth()); + default: + return barcode.getSize(); + } + } else + { + return barcode.getSize(); + } + } + + @Override + public void render(JasperReportsContext jasperReportsContext, Graphics2D grx, Rectangle2D rectangle) + { + AffineTransform origTransform = grx.getTransform(); + try + { + Dimension size = barcode.getSize(); + + if (rotation != null) + { + switch (rotation) + { + case LEFT: + grx.translate(rectangle.getX(), rectangle.getY() + rectangle.getHeight()); + grx.rotate((-1) * Math.PI / 2); + if (rectangle.getWidth() != size.getHeight() + || rectangle.getHeight() != size.getWidth()) + { + grx.scale(rectangle.getHeight() / size.getWidth(), + rectangle.getWidth() / size.getHeight()); + + } + break; + case RIGHT: + grx.translate(rectangle.getX() + rectangle.getWidth(), rectangle.getY()); + grx.rotate(Math.PI / 2); + if (rectangle.getWidth() != size.getHeight() + || rectangle.getHeight() != size.getWidth()) + { + grx.scale(rectangle.getHeight() / size.getWidth(), + rectangle.getWidth() / size.getHeight()); + + } + break; + case UPSIDE_DOWN: + grx.translate(rectangle.getX() + rectangle.getWidth(), rectangle.getY() + rectangle.getHeight()); + grx.rotate(Math.PI); + if (rectangle.getWidth() != size.getWidth() + || rectangle.getHeight() != size.getHeight()) + { + grx.scale(rectangle.getWidth() / size.getWidth(), + rectangle.getHeight() / size.getHeight()); + } + break; + case NONE: + grx.translate(rectangle.getX(), rectangle.getY()); + if (rectangle.getWidth() != size.getWidth() + || rectangle.getHeight() != size.getHeight()) + { + grx.scale(rectangle.getWidth() / size.getWidth(), + rectangle.getHeight() / size.getHeight()); + } + break; + } + } else + { + grx.translate(rectangle.getX(), rectangle.getY()); + if (rectangle.getWidth() != size.getWidth() + || rectangle.getHeight() != size.getHeight()) + { + grx.scale(rectangle.getWidth() / size.getWidth(), + rectangle.getHeight() / size.getHeight()); + } + } + + barcode.draw(grx, 0, 0); + } + catch (OutputException e) + { + throw new JRRuntimeException(e); + } + finally + { + grx.setTransform(origTransform); + } + } + + public void setRotation(RotationEnum rotation){ + this.rotation = rotation; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueRenderer.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueRenderer.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueRenderer.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueRenderer.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,161 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barbecue; + +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.geom.AffineTransform; +import java.awt.geom.Dimension2D; +import java.awt.geom.Rectangle2D; + +import net.sf.jasperreports.engine.JRAbstractSvgRenderer; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.type.RotationEnum; +import net.sf.jasperreports.renderers.DimensionRenderable; +import net.sf.jasperreports.renderers.Graphics2DRenderable; +import net.sourceforge.barbecue.Barcode; +import net.sourceforge.barbecue.output.OutputException; + + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + * @deprecated Replaced by {@link BarbecueRendererImpl}. + */ +public class BarbecueRenderer extends JRAbstractSvgRenderer implements Graphics2DRenderable, DimensionRenderable +{ + + private static final long serialVersionUID = 1L; + + private Barcode barcode; + + private RotationEnum rotation; + + public BarbecueRenderer(Barcode barcode) + { + this.barcode = barcode; + } + + @Override + public Dimension2D getDimension(JasperReportsContext jasperReportsContext) + { + if (rotation != null) + { + switch(rotation) + { + case LEFT: + case RIGHT: + return new Dimension((int)barcode.getSize().getHeight(),(int)barcode.getSize().getWidth()); + default: + return barcode.getSize(); + } + } else + { + return barcode.getSize(); + } + } + + @Override + public void render(JasperReportsContext jasperReportsContext, Graphics2D grx, Rectangle2D rectangle) + { + AffineTransform origTransform = grx.getTransform(); + try + { + Dimension size = barcode.getSize(); + + if (rotation != null) + { + switch (rotation) + { + case LEFT: + grx.translate(rectangle.getX(), rectangle.getY() + rectangle.getHeight()); + grx.rotate((-1) * Math.PI / 2); + if (rectangle.getWidth() != size.getHeight() + || rectangle.getHeight() != size.getWidth()) + { + grx.scale(rectangle.getHeight() / size.getWidth(), + rectangle.getWidth() / size.getHeight()); + + } + break; + case RIGHT: + grx.translate(rectangle.getX() + rectangle.getWidth(), rectangle.getY()); + grx.rotate(Math.PI / 2); + if (rectangle.getWidth() != size.getHeight() + || rectangle.getHeight() != size.getWidth()) + { + grx.scale(rectangle.getHeight() / size.getWidth(), + rectangle.getWidth() / size.getHeight()); + + } + break; + case UPSIDE_DOWN: + grx.translate(rectangle.getX() + rectangle.getWidth(), rectangle.getY() + rectangle.getHeight()); + grx.rotate(Math.PI); + if (rectangle.getWidth() != size.getWidth() + || rectangle.getHeight() != size.getHeight()) + { + grx.scale(rectangle.getWidth() / size.getWidth(), + rectangle.getHeight() / size.getHeight()); + } + break; + case NONE: + grx.translate(rectangle.getX(), rectangle.getY()); + if (rectangle.getWidth() != size.getWidth() + || rectangle.getHeight() != size.getHeight()) + { + grx.scale(rectangle.getWidth() / size.getWidth(), + rectangle.getHeight() / size.getHeight()); + } + break; + } + } else + { + grx.translate(rectangle.getX(), rectangle.getY()); + if (rectangle.getWidth() != size.getWidth() + || rectangle.getHeight() != size.getHeight()) + { + grx.scale(rectangle.getWidth() / size.getWidth(), + rectangle.getHeight() / size.getHeight()); + } + } + + barcode.draw(grx, 0, 0); + } + catch (OutputException e) + { + throw new JRRuntimeException(e); + } + finally + { + grx.setTransform(origTransform); + } + } + + public void setRotation(RotationEnum rotation){ + this.rotation = rotation; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueStyleResolver.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueStyleResolver.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueStyleResolver.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarbecueStyleResolver.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barbecue; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRDefaultStyleProvider; +import net.sf.jasperreports.engine.JRStyle; +import net.sf.jasperreports.engine.type.RotationEnum; +import net.sf.jasperreports.engine.util.StyleResolver; + +/** + * + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public final class BarbecueStyleResolver { + + private BarbecueStyleResolver() + { + } + + /** + * + */ + public static StyleResolver getStyleResolver(JRComponentElement element) + { + if (element != null) + { + JRDefaultStyleProvider defaultStyleProvider = element.getDefaultStyleProvider(); + if (defaultStyleProvider != null) + { + return defaultStyleProvider.getStyleResolver(); + } + } + return StyleResolver.getInstance(); + } + + /** + * + */ + public static RotationEnum getRotationValue(JRComponentElement element) + { + RotationEnum ownRotation = ((BarbecueComponent)element.getComponent()).getOwnRotation(); + if (ownRotation != null) { + return ownRotation; + } + JRStyle style = getStyleResolver(element).getBaseStyle(element); + if (style != null) { + RotationEnum rotation = style.getRotationValue(); + if (rotation != null) { + return rotation; + } + } + return RotationEnum.NONE; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarcodeInfo.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarcodeInfo.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarcodeInfo.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarcodeInfo.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,111 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barbecue; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarcodeInfo +{ + + private String type; + private String code; + private String applicationIdentifier; + private boolean drawText; + private boolean requiresChecksum; + private Integer barWidth; + private Integer barHeight; + + public String getCode() + { + return code; + } + + public void setCode(String code) + { + this.code = code; + } + + public boolean isDrawText() + { + return drawText; + } + + public void setDrawText(boolean drawText) + { + this.drawText = drawText; + } + + public Integer getBarWidth() + { + return barWidth; + } + + public void setBarWidth(Integer barWidth) + { + this.barWidth = barWidth; + } + + public Integer getBarHeight() + { + return barHeight; + } + + public void setBarHeight(Integer barHeight) + { + this.barHeight = barHeight; + } + + public String getType() + { + return type; + } + + public void setType(String type) + { + this.type = type; + } + + public boolean getRequiresChecksum() + { + return requiresChecksum; + } + + public void setRequiresChecksum(boolean requiresChecksum) + { + this.requiresChecksum = requiresChecksum; + } + + public String getApplicationIdentifier() + { + return applicationIdentifier; + } + + public void setApplicationIdentifier(String applicationIdentifier) + { + this.applicationIdentifier = applicationIdentifier; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarcodeProvider.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarcodeProvider.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarcodeProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarcodeProvider.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barbecue; + +import net.sourceforge.barbecue.Barcode; +import net.sourceforge.barbecue.BarcodeException; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public interface BarcodeProvider +{ + + Barcode createBarcode(BarcodeInfo barcodeInfo) throws BarcodeException; + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarcodeProviders.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarcodeProviders.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BarcodeProviders.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BarcodeProviders.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,414 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barbecue; + +import java.util.HashMap; +import java.util.Map; + +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sourceforge.barbecue.Barcode; +import net.sourceforge.barbecue.BarcodeException; +import net.sourceforge.barbecue.BarcodeFactory; +import net.sourceforge.barbecue.linear.ean.UCCEAN128Barcode; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public final class BarcodeProviders +{ + public static final String EXCEPTION_MESSAGE_KEY_BARCODE_PROVIDER_NOT_FOUND = "components.barbecue.barcode.provider.not.found"; + public static final String EXCEPTION_MESSAGE_KEY_ERROR_CREATING_BARCODE = "components.barbecue.error.creating.barcode"; + + private static Map providers; + + private static synchronized void initProviders() + { + if (providers != null) + { + return; + } + + providers = new HashMap(); + providers.put("2of7", new Barcode2of7Provider()); + providers.put("3of9", new Barcode3of9Provider()); + providers.put("Bookland", new BooklandProvider()); + providers.put("Codabar", new CodabarProvider()); + providers.put("Code128", new Code128Provider()); + providers.put("Code128A", new Code128AProvider()); + providers.put("Code128B", new Code128Provider()); + providers.put("Code128C", new Code128CProvider()); + providers.put("Code39", new Code39Provider()); + providers.put("Code39 (Extended)", + new Code39ExtendedProvider()); + providers.put("EAN128", new EAN128Provider()); + providers.put("EAN13", new EAN13Provider()); + providers.put("GlobalTradeItemNumber", + new GlobalTradeItemNumberProvider()); + providers.put("Int2of5", new Int2of5Provider()); + providers.put("Monarch", new MonarchProvider()); + providers.put("NW7", new NW7Provider()); + providers.put("PDF417", new PDF417Provider()); + providers.put("PostNet", new PostNetProvider()); + providers.put("RandomWeightUPCA", new RandomWeightUPCAProvider()); + providers.put("SCC14ShippingCode", + new SCC14ShippingCodeProvider()); + providers.put("ShipmentIdentificationNumber", + new ShipmentIdentificationNumberProvider()); + providers.put("SSCC18", new SSCC18Provider()); + providers.put("Std2of5", new Std2of5Provider()); + providers.put("UCC128", new UCC128Provider()); + providers.put("UPCA", new UPCAProvider()); + providers.put("USD3", new USD3Provider()); + providers.put("USD4", new USD4Provider()); + providers.put("USPS", new USPSProvider()); + } + + public static boolean isTypeSupported(String type) + { + initProviders(); + + return providers.containsKey(type); + } + + public static Barcode createBarcode(BarcodeInfo barcodeInfo) + { + initProviders(); + + BarcodeProvider provider = providers.get( + barcodeInfo.getType()); + if (provider == null) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_BARCODE_PROVIDER_NOT_FOUND, + new Object[]{barcodeInfo.getType()}); + } + try + { + return provider.createBarcode(barcodeInfo); + } + catch (BarcodeException e) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_ERROR_CREATING_BARCODE, + (Object[])null, + e); + } + } + + public static class Barcode2of7Provider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.create2of7(barcodeInfo.getCode()); + } + } + + public static class Barcode3of9Provider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.create3of9(barcodeInfo.getCode(), + barcodeInfo.getRequiresChecksum()); + } + } + + public static class BooklandProvider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createBookland(barcodeInfo.getCode()); + } + } + + public static class CodabarProvider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createCodabar(barcodeInfo.getCode()); + } + } + + public static class Code128Provider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createCode128(barcodeInfo.getCode()); + } + } + + public static class Code128AProvider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createCode128A(barcodeInfo.getCode()); + } + } + + public static class Code128BProvider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createCode128B(barcodeInfo.getCode()); + } + } + + public static class Code128CProvider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createCode128C(barcodeInfo.getCode()); + } + } + + public static class Code39Provider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createCode39(barcodeInfo.getCode(), + barcodeInfo.getRequiresChecksum()); + } + } + + public static class Code39ExtendedProvider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return new net.sourceforge.barbecue.linear.code39.Code39Barcode( + barcodeInfo.getCode(), barcodeInfo.getRequiresChecksum(), true); + } + } + + public static class EAN128Provider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createEAN128(barcodeInfo.getCode()); + } + } + + public static class EAN13Provider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createEAN13(barcodeInfo.getCode()); + } + } + + public static class GlobalTradeItemNumberProvider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createGlobalTradeItemNumber(barcodeInfo.getCode()); + } + } + + public static class Int2of5Provider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createInt2of5( + barcodeInfo.getCode(), barcodeInfo.getRequiresChecksum()); + } + } + + public static class MonarchProvider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createMonarch(barcodeInfo.getCode()); + } + } + + public static class NW7Provider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createNW7(barcodeInfo.getCode()); + } + } + + public static class PDF417Provider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createPDF417(barcodeInfo.getCode()); + } + } + + public static class PostNetProvider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createPostNet(barcodeInfo.getCode()); + } + } + + public static class RandomWeightUPCAProvider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createRandomWeightUPCA(barcodeInfo.getCode()); + } + } + + public static class SCC14ShippingCodeProvider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createSCC14ShippingCode(barcodeInfo.getCode()); + } + } + + public static class ShipmentIdentificationNumberProvider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createShipmentIdentificationNumber(barcodeInfo.getCode()); + } + } + + public static class SSCC18Provider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return new UCCEAN128Barcode(UCCEAN128Barcode.SSCC_18_AI, + barcodeInfo.getCode(), + barcodeInfo.getRequiresChecksum()); + } + } + + public static class Std2of5Provider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createStd2of5(barcodeInfo.getCode(), + barcodeInfo.getRequiresChecksum()); + } + } + + public static class UCC128Provider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return new UCCEAN128Barcode(barcodeInfo.getApplicationIdentifier(), + barcodeInfo.getCode(), barcodeInfo.getRequiresChecksum()); + } + } + + public static class UPCAProvider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createUPCA(barcodeInfo.getCode()); + } + } + + public static class USD3Provider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createUSD3(barcodeInfo.getCode(), + barcodeInfo.getRequiresChecksum()); + } + } + + public static class USD4Provider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createUSD4(barcodeInfo.getCode()); + } + } + + public static class USPSProvider extends BaseBarcodeProvider + { + @Override + protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + return BarcodeFactory.createUSPS(barcodeInfo.getCode()); + } + } + + private BarcodeProviders() + { + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BaseBarcodeProvider.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BaseBarcodeProvider.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/BaseBarcodeProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/BaseBarcodeProvider.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,56 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barbecue; + +import net.sourceforge.barbecue.Barcode; +import net.sourceforge.barbecue.BarcodeException; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public abstract class BaseBarcodeProvider implements BarcodeProvider +{ + + @Override + public Barcode createBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException + { + Barcode barcode = createBaseBarcode(barcodeInfo); + barcode.setDrawingText(barcodeInfo.isDrawText()); + if (barcodeInfo.getBarWidth() != null) + { + barcode.setBarWidth(barcodeInfo.getBarWidth().intValue()); + } + if (barcodeInfo.getBarHeight() != null) + { + barcode.setBarHeight(barcodeInfo.getBarHeight().intValue()); + } + return barcode; + } + + protected abstract Barcode createBaseBarcode(BarcodeInfo barcodeInfo) + throws BarcodeException; + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,76 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** +* Contains classes for the built-in Barbecue component. +*
    +*

    The Barbecue Component

    +* This component uses the Barbecue library +* (http://barbecue.sourceforge.net). Its barcodes can be embedded in +* reports via a uniform component element that specifies common attributes and +* determines the barcode type via a special attribute. +*

    +* The JRXML structure of a barcode component is listed in the JasperReports components schema. The XML element +* belongs to the http://jasperreports.sourceforge.net/jasperreports/components namespace, +* which is the namespace of the component elements built into JasperReports. +*

    +* The type of the barcode is given by the mandatory type attribute. The supported types +* are listed in the JRXML structure as values allowed for this attribute. For the most part, +* they correspond to the Barbecue barcode factory methods. +*

    +* The data/text to be encoded in a barcode is provided by the code expression, which is +* expected to evaluate to a java.lang.String object. If the expression evaluates to null +* and the barcode does not have delayed evaluation, the element will not +* generate an image in the filled report. +*

    +* A second expression is used to provide an application identifier for the generic UCC 128 +* barcode type. The expression should not be used for any other barcode type. Note that +* the list of supported barcode types includes types for specific UCC 128 application +* domains: EAN 128, USPS, Shipment Identification Number, SSCC 18, SCC 14, and +* Global Trade Item Number. +*

    +* Further attributes influence which barcode is displayed and how it is displayed. The +* drawText attribute specifies whether or not the encoded data should be shown +* underneath the barcode; the barWidth attribute can be used to set a desired width of +* the thinnest bar, the barHeight attribute can specify the height of the bars, and the +* checksumRequired attribute determines whether a check digit is to be included in the +* barcode for the types that support it. +*

    +* The evaluationTime and evaluationGroup attributes allow the barcode to be +* evaluated after the band on which it is placed has been rendered. This attribute functions +* in the same way as for text fields and images, with the exception that Auto evaluation +* type is not supported. +*

    +* On the API side, the Barbecue component is represented by the +* {@link net.sf.jasperreports.components.barbecue.BarbecueComponent BarbecueComponent} +* interface, whose default implementation is +* {@link net.sf.jasperreports.components.barbecue.StandardBarbecueComponent StandardBarbecueComponent}. +*

    +* When the report is filled, a barcode renderer of type +* {@link net.sf.jasperreports.components.barbecue.BarbecueRenderer BarbecueRenderer} is +* created. It is used for the image included in the generated report. The image takes its +* scale type from the RetainShape attribute and its size from the size defined +* for the barcode element in the report. +*/ +package net.sf.jasperreports.components.barbecue; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/StandardBarbecueComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/StandardBarbecueComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barbecue/StandardBarbecueComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barbecue/StandardBarbecueComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,312 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barbecue; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.Serializable; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.component.BaseComponentContext; +import net.sf.jasperreports.engine.component.ComponentContext; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; +import net.sf.jasperreports.engine.type.RotationEnum; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class StandardBarbecueComponent implements BarbecueComponent, Serializable, JRChangeEventsSupport +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_TYPE = "type"; + public static final String PROPERTY_CODE_EXPRESSION = "codeExpression"; + public static final String PROPERTY_APPLICATION_IDENTIFIER_EXPRESSION = "applicationIdentifierExpression"; + public static final String PROPERTY_DRAW_TEXT = "drawText"; + public static final String PROPERTY_CHECKSUM_REQUIRED = "checksumRequired"; + public static final String PROPERTY_BAR_WIDTH = "barWidth"; + public static final String PROPERTY_BAR_HEIGTH = "barHeight"; + public static final String PROPERTY_EVALUATION_TIME = "evaluationTime"; + public static final String PROPERTY_EVALUATION_GROUP = "evaluationGroup"; + public static final String PROPERTY_ROTATION = "rotation"; + + private String type; + private JRExpression codeExpression; + private JRExpression applicationIdentifierExpression; + private boolean drawText; + private boolean checksumRequired; + private Integer barWidth; + private Integer barHeight; + +// private RotationEnum rotation = RotationEnum.NONE; + private RotationEnum rotation; + + private EvaluationTimeEnum evaluationTimeValue = EvaluationTimeEnum.NOW; + private String evaluationGroup; + + private ComponentContext context; + + private transient JRPropertyChangeSupport eventSupport; + + public StandardBarbecueComponent() + { + } + + public StandardBarbecueComponent(BarbecueComponent barcode, JRBaseObjectFactory objectFactory) + { + this.type = barcode.getType(); + this.codeExpression = objectFactory.getExpression( + barcode.getCodeExpression()); + this.applicationIdentifierExpression = objectFactory.getExpression( + barcode.getApplicationIdentifierExpression()); + this.drawText = barcode.isDrawText(); + this.checksumRequired = barcode.isChecksumRequired(); + this.barWidth = barcode.getBarWidth(); + this.barHeight = barcode.getBarHeight(); + this.evaluationTimeValue= barcode.getEvaluationTimeValue(); + this.evaluationGroup = barcode.getEvaluationGroup(); + this.rotation = barcode.getOwnRotation(); + + this.context = new BaseComponentContext(barcode.getContext(), objectFactory); + } + + @Override + public void setContext(ComponentContext context) + { + this.context = context; + } + + @Override + public ComponentContext getContext() + { + return context; + } + + @Override + public JRExpression getCodeExpression() + { + return codeExpression; + } + + public void setCodeExpression(JRExpression codeExpression) + { + Object old = this.codeExpression; + this.codeExpression = codeExpression; + getEventSupport().firePropertyChange(PROPERTY_CODE_EXPRESSION, + old, this.codeExpression); + } + + @Override + public String getType() + { + return type; + } + + public void setType(String type) + { + Object old = this.type; + this.type = type; + getEventSupport().firePropertyChange(PROPERTY_TYPE, + old, this.type); + } + + @Override + public JRExpression getApplicationIdentifierExpression() + { + return applicationIdentifierExpression; + } + + public void setApplicationIdentifierExpression( + JRExpression applicationIdentifierExpression) + { + Object old = this.applicationIdentifierExpression; + this.applicationIdentifierExpression = applicationIdentifierExpression; + getEventSupport().firePropertyChange(PROPERTY_APPLICATION_IDENTIFIER_EXPRESSION, + old, this.applicationIdentifierExpression); + } + + @Override + public Integer getBarWidth() + { + return barWidth; + } + + public void setBarWidth(Integer barWidth) + { + Object old = this.barWidth; + this.barWidth = barWidth; + getEventSupport().firePropertyChange(PROPERTY_BAR_WIDTH, + old, this.barWidth); + } + + @Override + public Integer getBarHeight() + { + return barHeight; + } + + public void setBarHeight(Integer barHeight) + { + Object old = this.barHeight; + this.barHeight = barHeight; + getEventSupport().firePropertyChange(PROPERTY_BAR_HEIGTH, + old, this.barHeight); + } + + @Override + public RotationEnum getRotation(){ + return BarbecueStyleResolver.getRotationValue(getContext().getComponentElement()); + } + + @Override + public RotationEnum getOwnRotation(){ + return rotation; + } + + public void setRotation(RotationEnum rotation){ + Object old = this.rotation; + this.rotation = rotation; + getEventSupport().firePropertyChange(PROPERTY_ROTATION, + old, this.rotation); + } + + @Override + public boolean isChecksumRequired() + { + return checksumRequired; + } + + public void setChecksumRequired(boolean checksumRequired) + { + boolean old = this.checksumRequired; + this.checksumRequired = checksumRequired; + getEventSupport().firePropertyChange(PROPERTY_CHECKSUM_REQUIRED, + old, this.checksumRequired); + } + + @Override + public boolean isDrawText() + { + return drawText; + } + + public void setDrawText(boolean drawText) + { + boolean old = this.drawText; + this.drawText = drawText; + getEventSupport().firePropertyChange(PROPERTY_DRAW_TEXT, + old, this.drawText); + } + + @Override + public EvaluationTimeEnum getEvaluationTimeValue() + { + return evaluationTimeValue; + } + + public void setEvaluationTimeValue(EvaluationTimeEnum evaluationTimeValue) + { + Object old = this.evaluationTimeValue; + this.evaluationTimeValue = evaluationTimeValue; + getEventSupport().firePropertyChange(PROPERTY_EVALUATION_TIME, + old, this.evaluationTimeValue); + } + + @Override + public String getEvaluationGroup() + { + return evaluationGroup; + } + + public void setEvaluationGroup(String evaluationGroup) + { + Object old = this.evaluationGroup; + this.evaluationGroup = evaluationGroup; + getEventSupport().firePropertyChange(PROPERTY_EVALUATION_GROUP, + old, this.evaluationGroup); + } + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + @Override + public Object clone() + { + StandardBarbecueComponent clone = null; + try + { + clone = (StandardBarbecueComponent) super.clone(); + } + catch (CloneNotSupportedException e) + { + // never + throw new JRRuntimeException(e); + } + clone.codeExpression = JRCloneUtils.nullSafeClone(codeExpression); + clone.applicationIdentifierExpression = JRCloneUtils.nullSafeClone(applicationIdentifierExpression); + //FIXMENOW should context be cloned? + clone.eventSupport = null; + return clone; + } + + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private byte evaluationTime; + + @SuppressWarnings("deprecation") + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2) + { + evaluationTimeValue = EvaluationTimeEnum.getByValue(evaluationTime); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/AbstractBarcodeEvaluator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/AbstractBarcodeEvaluator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/AbstractBarcodeEvaluator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/AbstractBarcodeEvaluator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,521 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import org.krysalis.barcode4j.BaselineAlignment; +import org.krysalis.barcode4j.ChecksumMode; +import org.krysalis.barcode4j.HumanReadablePlacement; +import org.krysalis.barcode4j.impl.AbstractBarcodeBean; +import org.krysalis.barcode4j.impl.codabar.CodabarBean; +import org.krysalis.barcode4j.impl.code128.Code128Bean; +import org.krysalis.barcode4j.impl.code128.EAN128Bean; +import org.krysalis.barcode4j.impl.code39.Code39Bean; +import org.krysalis.barcode4j.impl.datamatrix.DataMatrixBean; +import org.krysalis.barcode4j.impl.datamatrix.SymbolShapeHint; +import org.krysalis.barcode4j.impl.fourstate.AbstractFourStateBean; +import org.krysalis.barcode4j.impl.fourstate.RoyalMailCBCBean; +import org.krysalis.barcode4j.impl.fourstate.USPSIntelligentMailBean; +import org.krysalis.barcode4j.impl.int2of5.Interleaved2Of5Bean; +import org.krysalis.barcode4j.impl.pdf417.PDF417Bean; +import org.krysalis.barcode4j.impl.postnet.POSTNETBean; +import org.krysalis.barcode4j.impl.upcean.EAN13Bean; +import org.krysalis.barcode4j.impl.upcean.EAN8Bean; +import org.krysalis.barcode4j.impl.upcean.UPCABean; +import org.krysalis.barcode4j.impl.upcean.UPCEBean; +import org.krysalis.barcode4j.tools.UnitConv; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRDefaultStyleProvider; +import net.sf.jasperreports.engine.JRStyle; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.renderers.Renderable; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public abstract class AbstractBarcodeEvaluator implements BarcodeVisitor +{ + + protected final JasperReportsContext jasperReportsContext; + protected final JRComponentElement componentElement; + protected final BarcodeComponent barcodeComponent; + protected final JRDefaultStyleProvider defaultStyleProvider; + + protected String message; + protected AbstractBarcodeBean barcodeBean; + protected QRCodeBean qrCodeBean; + protected Renderable renderable; + + protected AbstractBarcodeEvaluator( + JasperReportsContext jasperReportsContext, + JRComponentElement componentElement, + JRDefaultStyleProvider defaultStyleProvider + ) + { + this.jasperReportsContext = jasperReportsContext; + this.componentElement = componentElement; + this.barcodeComponent = (BarcodeComponent) componentElement.getComponent(); + this.defaultStyleProvider = defaultStyleProvider; + } + + public void evaluateBarcode() + { + barcodeComponent.receive(this); + } + + public Renderable getRenderable() + { + return renderable; + } + + protected void evaluateBarcodeRenderable(BarcodeComponent barcodeComponent) + { + BarcodeImageProducer imageProducer = + BarcodeUtils.getInstance(jasperReportsContext).getProducer( + componentElement); + renderable = imageProducer.createImage( + jasperReportsContext, + componentElement, + barcodeBean, message); + } + + protected void evaluateBarcodeRenderable(QRCodeBean qrCodeBean) + { + QRCodeImageProducer imageProducer = + BarcodeUtils.getInstance(jasperReportsContext).getQRCodeProducer( + componentElement); + renderable = imageProducer.createImage( + jasperReportsContext, + componentElement, + qrCodeBean, message); + } + + protected void setBaseAttributes(Barcode4jComponent barcodeComponent) + { + JRStyle style = getElementStyle(); + if (style != null) + { + String fontName = style.getFontName(); + if (fontName != null) + { + barcodeBean.setFontName(fontName); + } + + Float fontSize = style.getFontsize(); + if (fontSize != null) + { + double barFontSize = UnitConv.pt2mm(fontSize.floatValue()); + barcodeBean.setFontSize(barFontSize); + } + } + + Double moduleWidth = barcodeComponent.getModuleWidth(); + if (moduleWidth != null) + { + barcodeBean.setModuleWidth(UnitConv.pt2mm(moduleWidth.doubleValue())); + } + + TextPositionEnum textPlacement = barcodeComponent.getTextPositionValue(); + if (textPlacement != null) + { + barcodeBean.setMsgPosition( + HumanReadablePlacement.byName(textPlacement.getName())); + } + + Double quietZone = barcodeComponent.getQuietZone(); + if (quietZone != null) + { + barcodeBean.doQuietZone(true); + barcodeBean.setQuietZone(UnitConv.pt2mm(quietZone.doubleValue())); + } + + Double vQuietZone = barcodeComponent.getVerticalQuietZone(); + if (vQuietZone != null) + { + barcodeBean.setVerticalQuietZone(UnitConv.pt2mm(vQuietZone.doubleValue())); + } + + // FIXME DataMatrix? + double barcodeHeight; + if (BarcodeUtils.isVertical(barcodeComponent)) + { + barcodeHeight = UnitConv.pt2mm(componentElement.getWidth()); + } + else + { + barcodeHeight = UnitConv.pt2mm(componentElement.getHeight()); + } + barcodeBean.setHeight(barcodeHeight); + } + + protected JRStyle getElementStyle() + { + JRStyle style = componentElement.getStyle(); + if (style == null) + { + style = defaultStyleProvider.getDefaultStyle(); + } + return style; + } + + @Override + public void visitCodabar(CodabarComponent codabar) + { + CodabarBean codabarBean = new CodabarBean(); + barcodeBean = codabarBean; + evaluateCodabar(codabar); + setBaseAttributes(codabar); + if (codabar.getWideFactor() != null) + { + codabarBean.setWideFactor(codabar.getWideFactor().doubleValue()); + } + evaluateBarcodeRenderable(codabar); + } + + protected abstract void evaluateCodabar(CodabarComponent codabar); + + @Override + public void visitCode128(Code128Component code128) + { + barcodeBean = new Code128Bean(); + evaluateCode128(code128); + setBaseAttributes(code128); + evaluateBarcodeRenderable(code128); + } + + protected abstract void evaluateCode128(Code128Component code128); + + @Override + public void visitDataMatrix(DataMatrixComponent dataMatrix) + { + DataMatrixBean dataMatrixBean = new DataMatrixBean(); + barcodeBean = dataMatrixBean; + evaluateDataMatrix(dataMatrix); + setBaseAttributes(dataMatrix); + if (dataMatrix.getShape() != null) + { + dataMatrixBean.setShape(SymbolShapeHint.byName(dataMatrix.getShape())); + } + evaluateBarcodeRenderable(dataMatrix); + } + + protected abstract void evaluateDataMatrix(DataMatrixComponent dataMatrix); + + @Override + public void visitEANCode128(EAN128Component ean128) + { + EAN128Bean ean128Bean = new EAN128Bean(); + barcodeBean = ean128Bean; + evaluateEANCode128(ean128); + setBaseAttributes(ean128); + if (ean128.getChecksumMode() != null) + { + ean128Bean.setChecksumMode(ChecksumMode.byName(ean128.getChecksumMode())); + } + evaluateBarcodeRenderable(ean128); + } + + protected abstract void evaluateEANCode128(EAN128Component ean128); + + @Override + public void visitCode39(Code39Component code39) + { + Code39Bean code39Bean = new Code39Bean(); + barcodeBean = code39Bean; + evaluateCode39(code39); + setBaseAttributes(code39); + if (code39.getChecksumMode() != null) + { + code39Bean.setChecksumMode(ChecksumMode.byName(code39.getChecksumMode())); + } + if (code39.isDisplayChecksum() != null) + { + code39Bean.setDisplayChecksum(code39.isDisplayChecksum().booleanValue()); + } + if (code39.isDisplayStartStop() != null) + { + code39Bean.setDisplayStartStop(code39.isDisplayStartStop().booleanValue()); + } + if (code39.isExtendedCharSetEnabled() != null) + { + code39Bean.setExtendedCharSetEnabled(code39.isExtendedCharSetEnabled().booleanValue()); + } + if (code39.getIntercharGapWidth() != null) + { + code39Bean.setIntercharGapWidth(code39.getIntercharGapWidth().doubleValue()); + } + if (code39.getWideFactor() != null) + { + code39Bean.setWideFactor(code39.getWideFactor().doubleValue()); + } + evaluateBarcodeRenderable(code39); + } + + protected abstract void evaluateCode39(Code39Component code39); + + protected abstract void evaluateInterleaved2Of5(Interleaved2Of5Component interleaved2Of5); + + @Override + public void visitInterleaved2Of5(Interleaved2Of5Component interleaved2Of5) + { + Interleaved2Of5Bean interleaved2Of5Bean = new Interleaved2Of5Bean(); + barcodeBean = interleaved2Of5Bean; + evaluateInterleaved2Of5(interleaved2Of5); + setBaseAttributes(interleaved2Of5); + if (interleaved2Of5.getChecksumMode() != null) + { + interleaved2Of5Bean.setChecksumMode(ChecksumMode.byName(interleaved2Of5.getChecksumMode())); + } + if (interleaved2Of5.isDisplayChecksum() != null) + { + interleaved2Of5Bean.setDisplayChecksum(interleaved2Of5.isDisplayChecksum().booleanValue()); + } + if (interleaved2Of5.getWideFactor() != null) + { + interleaved2Of5Bean.setWideFactor(interleaved2Of5.getWideFactor().doubleValue()); + } + evaluateBarcodeRenderable(interleaved2Of5); + } + + @Override + public void visitUPCA(UPCAComponent upcA) + { + UPCABean upcABean = new UPCABean(); + barcodeBean = upcABean; + evaluateUPCA(upcA); + setBaseAttributes(upcA); + if (upcA.getChecksumMode() != null) + { + upcABean.setChecksumMode(ChecksumMode.byName(upcA.getChecksumMode())); + } + evaluateBarcodeRenderable(upcA); + } + + protected abstract void evaluateUPCA(UPCAComponent upcA); + + @Override + public void visitUPCE(UPCEComponent upcE) + { + UPCEBean upcEBean = new UPCEBean(); + barcodeBean = upcEBean; + evaluateUPCE(upcE); + setBaseAttributes(upcE); + if (upcE.getChecksumMode() != null) + { + upcEBean.setChecksumMode(ChecksumMode.byName(upcE.getChecksumMode())); + } + evaluateBarcodeRenderable(upcE); + } + + protected abstract void evaluateUPCE(UPCEComponent upcE); + + @Override + public void visitEAN13(EAN13Component ean13) + { + EAN13Bean ean13Bean = new EAN13Bean(); + barcodeBean = ean13Bean; + evaluateEAN13(ean13); + setBaseAttributes(ean13); + if (ean13.getChecksumMode() != null) + { + ean13Bean.setChecksumMode(ChecksumMode.byName(ean13.getChecksumMode())); + } + evaluateBarcodeRenderable(ean13); + } + + protected abstract void evaluateEAN13(EAN13Component ean13); + + @Override + public void visitEAN8(EAN8Component ean8) + { + EAN8Bean ean8Bean = new EAN8Bean(); + barcodeBean = ean8Bean; + evaluateEAN8(ean8); + setBaseAttributes(ean8); + if (ean8.getChecksumMode() != null) + { + ean8Bean.setChecksumMode(ChecksumMode.byName(ean8.getChecksumMode())); + } + evaluateBarcodeRenderable(ean8); + } + + protected abstract void evaluateEAN8(EAN8Component ean8); + + @Override + public void visitRoyalMailCustomer( + RoyalMailCustomerComponent royalMailCustomer) + { + RoyalMailCBCBean mailBean = new RoyalMailCBCBean(); + barcodeBean = mailBean; + evaluateRoyalMailCustomer(royalMailCustomer); + setBaseAttributes(royalMailCustomer); + setFourStateAttributes(royalMailCustomer, mailBean); + evaluateBarcodeRenderable(royalMailCustomer); + } + + protected void setFourStateAttributes( + FourStateBarcodeComponent barcodeComponent, + AbstractFourStateBean barcodeBean) + { + if (barcodeComponent.getChecksumMode() != null) + { + barcodeBean.setChecksumMode( + ChecksumMode.byName(barcodeComponent.getChecksumMode())); + } + + if (barcodeComponent.getAscenderHeight() != null) + { + barcodeBean.setAscenderHeight( + UnitConv.pt2mm(barcodeComponent.getAscenderHeight().doubleValue())); + } + + if (barcodeComponent.getIntercharGapWidth() != null) + { + barcodeBean.setIntercharGapWidth( + UnitConv.pt2mm(barcodeComponent.getIntercharGapWidth().doubleValue())); + } + + if (barcodeComponent.getTrackHeight() != null) + { + barcodeBean.setTrackHeight( + UnitConv.pt2mm(barcodeComponent.getTrackHeight().doubleValue())); + } + } + + protected abstract void evaluateRoyalMailCustomer( + RoyalMailCustomerComponent royalMailCustomer); + + @Override + public void visitUSPSIntelligentMail( + USPSIntelligentMailComponent intelligentMail) + { + USPSIntelligentMailBean mailBean = new USPSIntelligentMailBean(); + barcodeBean = mailBean; + evaluateUSPSIntelligentMail(intelligentMail); + setBaseAttributes(intelligentMail); + setFourStateAttributes(intelligentMail, mailBean); + evaluateBarcodeRenderable(intelligentMail); + } + + protected abstract void evaluateUSPSIntelligentMail( + USPSIntelligentMailComponent intelligentMail); + + @Override + public void visitPostnet(POSTNETComponent postnet) + { + POSTNETBean postnetBean = new POSTNETBean(); + barcodeBean = postnetBean; + evaluatePOSTNET(postnet); + setBaseAttributes(postnet); + + if (postnet.getShortBarHeight() != null) + { + postnetBean.setShortBarHeight( + UnitConv.pt2mm(postnet.getShortBarHeight().doubleValue())); + } + + if (postnet.getBaselinePosition() != null) + { + postnetBean.setBaselinePosition( + BaselineAlignment.byName(postnet.getBaselinePosition())); + } + + if (postnet.getChecksumMode() != null) + { + postnetBean.setChecksumMode( + ChecksumMode.byName(postnet.getChecksumMode())); + } + + if (postnet.getDisplayChecksum() != null) + { + postnetBean.setDisplayChecksum( + postnet.getDisplayChecksum().booleanValue()); + } + + if (postnet.getIntercharGapWidth() != null) + { + postnetBean.setIntercharGapWidth( + UnitConv.pt2mm(postnet.getIntercharGapWidth().doubleValue())); + } + evaluateBarcodeRenderable(postnet); + } + + protected abstract void evaluatePOSTNET( + POSTNETComponent intelligentMail); + + @Override + public void visitPDF417(PDF417Component pdf417) + { + PDF417Bean pdf417Bean = new PDF417Bean(); + barcodeBean = pdf417Bean; + evaluatePDF417(pdf417); + setBaseAttributes(pdf417); + + if (pdf417.getMinColumns() != null) + { + pdf417Bean.setMinCols(pdf417.getMinColumns().intValue()); + } + if (pdf417.getMaxColumns() != null) + { + pdf417Bean.setMaxCols(pdf417.getMaxColumns().intValue()); + } + if (pdf417.getMinRows() != null) + { + pdf417Bean.setMinRows(pdf417.getMinRows().intValue()); + } + if (pdf417.getMaxRows() != null) + { + pdf417Bean.setMaxRows(pdf417.getMaxRows().intValue()); + } + if (pdf417.getWidthToHeightRatio() != null) + { + pdf417Bean.setWidthToHeightRatio( + pdf417.getWidthToHeightRatio().doubleValue()); + } + if (pdf417.getErrorCorrectionLevel() != null) + { + pdf417Bean.setErrorCorrectionLevel( + pdf417.getErrorCorrectionLevel().intValue()); + } + evaluateBarcodeRenderable(pdf417); + } + + protected abstract void evaluatePDF417(PDF417Component pdf417); + + @Override + public void visitQRCode(QRCodeComponent qrCode) + { + qrCodeBean = new QRCodeBean(); + + evaluateQRCode(qrCode); + + qrCodeBean.setMargin(qrCode.getMargin()); + qrCodeBean.setErrorCorrectionLevel(qrCode.getErrorCorrectionLevel()); + evaluateBarcodeRenderable(qrCodeBean); + } + + protected abstract void evaluateQRCode(QRCodeComponent qrCode); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/Barcode4jComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/Barcode4jComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/Barcode4jComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/Barcode4jComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,218 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import java.io.IOException; +import java.io.ObjectInputStream.GetField; + +import org.krysalis.barcode4j.HumanReadablePlacement; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public abstract class Barcode4jComponent extends BarcodeComponent +{ + public static final String PROPERTY_ORIENTATION = "orientation"; + public static final String PROPERTY_PATTERN_EXPRESSION = "patternExpression"; + public static final String PROPERTY_MODULE_WIDTH = "moduleWidth"; + public static final String PROPERTY_TEXT_POSITION = "textPosition"; + public static final String PROPERTY_QUIET_ZONE = "quietZone"; + public static final String PROPERTY_VERTICAL_QUIET_ZONE = "verticalQuietZone"; + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private OrientationEnum orientationValue; + private JRExpression patternExpression; + private Double moduleWidth; + private TextPositionEnum textPositionValue; + private Double quietZone; + private Double verticalQuietZone; + + public Barcode4jComponent() + { + } + + /** + * @deprecated Replaced by {@link #getOrientationValue()}. + */ + public int getOrientation() + { + return getOrientationValue().getValue(); + } + + /** + * @deprecated Replaced by {@link #setOrientation(OrientationEnum)}. + */ + public void setOrientation(int orientation) + { + setOrientation(OrientationEnum.getByValue(orientation)); + } + + public OrientationEnum getOrientationValue() + { + return orientationValue == null ? OrientationEnum.UP : orientationValue; + } + + /** + * Used only for the sake of digester. + * @deprecated Replaced by {@link #setOrientation(OrientationEnum)}. + */ + public void setOrientationValue(OrientationEnum orientationValue) + { + setOrientation(orientationValue); + } + + public void setOrientation(OrientationEnum orientationValue) + { + OrientationEnum old = this.orientationValue; + this.orientationValue = orientationValue; + getEventSupport().firePropertyChange(PROPERTY_ORIENTATION, + old, this.orientationValue); + } + + public JRExpression getPatternExpression() + { + return patternExpression; + } + + public void setPatternExpression(JRExpression patternExpression) + { + Object old = this.patternExpression; + this.patternExpression = patternExpression; + getEventSupport().firePropertyChange(PROPERTY_PATTERN_EXPRESSION, + old, this.patternExpression); + } + + public Double getModuleWidth() + { + return moduleWidth; + } + + public void setModuleWidth(Double moduleWidth) + { + Object old = this.moduleWidth; + this.moduleWidth = moduleWidth; + getEventSupport().firePropertyChange(PROPERTY_MODULE_WIDTH, + old, this.moduleWidth); + } + + /** + * @deprecated Replaced by {@link #getTextPositionValue()}. + */ + public String getTextPosition() + { + return getTextPositionValue() == null ? null : getTextPositionValue().getName(); + } + + /** + * @deprecated Replaced by {@link #setTextPosition(TextPositionEnum)}. + */ + public void setTextPosition(String textPosition) + { + setTextPosition(TextPositionEnum.getByName(textPosition)); + } + + public TextPositionEnum getTextPositionValue() + { + return textPositionValue; + } + + /** + * Used only for the sake of digester. + * @deprecated Replaced by {@link #setTextPosition(TextPositionEnum)}. + */ + public void setTextPositionValue(TextPositionEnum textPositionValue) + { + setTextPosition(textPositionValue); + } + + public void setTextPosition(TextPositionEnum textPositionValue) + { + Object old = this.textPositionValue; + this.textPositionValue = textPositionValue; + getEventSupport().firePropertyChange(PROPERTY_TEXT_POSITION, + old, this.textPositionValue); + } + + /** + * @deprecated Replaced by {@link #setTextPosition(TextPositionEnum)}. + */ + public void setTextPosition(HumanReadablePlacement textPosition) + { + setTextPosition(textPosition == null ? null : textPosition.getName()); + } + + @Override + public Object clone() + { + Barcode4jComponent clone = (Barcode4jComponent) super.clone(); + + clone.patternExpression = JRCloneUtils.nullSafeClone(patternExpression); + + return clone; + } + + public Double getQuietZone() + { + return quietZone; + } + + public void setQuietZone(Double quietZone) + { + Object old = this.quietZone; + this.quietZone = quietZone; + getEventSupport().firePropertyChange(PROPERTY_QUIET_ZONE, + old, this.quietZone); + } + + public Double getVerticalQuietZone() + { + return verticalQuietZone; + } + + public void setVerticalQuietZone(Double verticalQuietZone) + { + Object old = this.verticalQuietZone; + this.verticalQuietZone = verticalQuietZone; + getEventSupport().firePropertyChange(PROPERTY_VERTICAL_QUIET_ZONE, + old, this.verticalQuietZone); + } + + protected final void copyBarcodeComponentFields(GetField fields) throws IOException + { + int orientation = fields.get("orientation", 0); + this.orientationValue = OrientationEnum.getByValue(orientation); + this.patternExpression = (JRExpression) fields.get("patternExpression", null); + this.moduleWidth = (Double) fields.get("moduleWidth", null); + String textPosition = (String) fields.get("textPosition", null); + this.textPositionValue = TextPositionEnum.getByName(textPosition); + this.quietZone = (Double) fields.get("quietZone", null); + this.verticalQuietZone = (Double) fields.get("verticalQuietZone", null); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeCompiler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeCompiler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeCompiler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeCompiler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.component.ComponentCompiler; +import net.sf.jasperreports.engine.design.JRVerifier; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarcodeCompiler implements ComponentCompiler +{ + + @Override + public void collectExpressions(Component component, JRExpressionCollector collector) + { + BarcodeComponent barcode = (BarcodeComponent) component; + barcode.receive(new BarcodeExpressionCollector(collector)); + } + + @Override + public Component toCompiledComponent(Component component, + JRBaseObjectFactory baseFactory) + { + BarcodeComponent barcode = (BarcodeComponent) component; + CompiledBarcodeFactory factory = new CompiledBarcodeFactory(baseFactory); + return factory.toCompiledComponent(barcode); + } + + @Override + public void verify(Component component, JRVerifier verifier) + { + BarcodeComponent barcode = (BarcodeComponent) component; + BarcodeVerifier barcodeVerifier = new BarcodeVerifier(verifier); + barcode.receive(barcodeVerifier); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,206 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectInputStream.GetField; +import java.io.Serializable; + +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public abstract class BarcodeComponent implements Component, Serializable, JRCloneable, JRChangeEventsSupport +{ + + public static final String PROPERTY_PREFIX = + JRPropertiesUtil.PROPERTY_PREFIX + "components.barcode4j."; + + /** + * @deprecated Replaced by {@link OrientationEnum#UP}. + */ + public static final int ORIENTATION_UP = 0; + /** + * @deprecated Replaced by {@link OrientationEnum#LEFT}. + */ + public static final int ORIENTATION_LEFT = 90; + /** + * @deprecated Replaced by {@link OrientationEnum#DOWN}. + */ + public static final int ORIENTATION_DOWN = 180; + /** + * @deprecated Replaced by {@link OrientationEnum#RIGHT}. + */ + public static final int ORIENTATION_RIGHT = 270; + + public static final String PROPERTY_EVALUATION_TIME = "evaluationTime"; + public static final String PROPERTY_EVALUATION_GROUP = "evaluationGroup"; + public static final String PROPERTY_CODE_EXPRESSION = "codeExpression"; + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + private transient JRPropertyChangeSupport eventSupport; + + private EvaluationTimeEnum evaluationTimeValue; + private String evaluationGroup; + + private JRExpression codeExpression; + + public BarcodeComponent() + { + } + + public EvaluationTimeEnum getEvaluationTimeValue() + { + return evaluationTimeValue == null ? EvaluationTimeEnum.NOW : evaluationTimeValue; + } + + public void setEvaluationTimeValue(EvaluationTimeEnum evaluationTimeValue) + { + Object old = this.evaluationTimeValue; + this.evaluationTimeValue = evaluationTimeValue; + getEventSupport().firePropertyChange(PROPERTY_EVALUATION_TIME, + old, this.evaluationTimeValue); + } + + public String getEvaluationGroup() + { + return evaluationGroup; + } + + public void setEvaluationGroup(String evaluationGroup) + { + Object old = this.evaluationGroup; + this.evaluationGroup = evaluationGroup; + getEventSupport().firePropertyChange(PROPERTY_EVALUATION_GROUP, + old, this.evaluationGroup); + } + + public JRExpression getCodeExpression() + { + return codeExpression; + } + + public void setCodeExpression(JRExpression codeExpression) + { + Object old = this.codeExpression; + this.codeExpression = codeExpression; + getEventSupport().firePropertyChange(PROPERTY_CODE_EXPRESSION, + old, this.codeExpression); + } + + @Override + public Object clone() + { + BarcodeComponent clone = null; + try + { + clone = (BarcodeComponent) super.clone(); + } + catch (CloneNotSupportedException e) + { + // never + throw new JRRuntimeException(e); + } + clone.codeExpression = JRCloneUtils.nullSafeClone(codeExpression); + clone.eventSupport = null; + return clone; + } + + protected BarcodeComponent cloneObject() //FIXMENOW where is this method coming from? + { + BarcodeComponent clone = null; + try + { + clone = (BarcodeComponent)super.clone(); + clone.eventSupport = null; + } + catch (CloneNotSupportedException e) + { + // never + throw new JRRuntimeException(e); + } + return clone; + } + + public abstract void receive(BarcodeVisitor visitor); + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + + @SuppressWarnings("deprecation") + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + GetField fields = in.readFields(); + this.PSEUDO_SERIAL_VERSION_UID = fields.get("PSEUDO_SERIAL_VERSION_UID", 0); + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2) + { + byte evaluationTime = fields.get("evaluationTime", (byte) 0); + this.evaluationTimeValue = EvaluationTimeEnum.getByValue(evaluationTime); + } + else + { + this.evaluationTimeValue = (EvaluationTimeEnum) fields.get("evaluationTimeValue", null); + } + this.evaluationGroup = (String) fields.get("evaluationGroup", null); + this.codeExpression = (JRExpression) fields.get("codeExpression", null); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_6_0_2 + && this instanceof Barcode4jComponent) + { + //up to 6.0.0 this class had several fields that were moved to Barcode4jComponent in 6.0.2. + //copying the values to the Barcode4jComponent fields. + Barcode4jComponent barcode4jComponent = (Barcode4jComponent) this; + barcode4jComponent.copyBarcodeComponentFields(fields); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeDesignConverter.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeDesignConverter.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeDesignConverter.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeDesignConverter.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,85 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRPrintElement; +import net.sf.jasperreports.engine.base.JRBasePrintImage; +import net.sf.jasperreports.engine.component.ComponentDesignConverter; +import net.sf.jasperreports.engine.convert.ReportConverter; +import net.sf.jasperreports.engine.type.ScaleImageEnum; +import net.sf.jasperreports.renderers.Renderable; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarcodeDesignConverter implements ComponentDesignConverter +{ + + private static final Log log = LogFactory.getLog(BarcodeDesignConverter.class); + + @Override + public JRPrintElement convert(ReportConverter reportConverter, + JRComponentElement element) + { + JRBasePrintImage printImage = new JRBasePrintImage( + reportConverter.getDefaultStyleProvider()); + reportConverter.copyBaseAttributes(element, printImage); + printImage.setScaleImage(ScaleImageEnum.RETAIN_SHAPE); + + Renderable barcodeImage = evaluateBarcode(reportConverter, element); + printImage.setRenderer(barcodeImage); + + return printImage; + } + + protected Renderable evaluateBarcode(ReportConverter reportConverter, + JRComponentElement element) + { + try + { + BarcodeDesignEvaluator evaluator = + new BarcodeDesignEvaluator( + reportConverter.getJasperReportsContext(), + element, + reportConverter.getDefaultStyleProvider() + ); + return evaluator.evaluateImage(); + } + catch (Exception e) + { + if (log.isWarnEnabled()) + { + log.warn("Failed to create barcode preview", e); + } + + return null; + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeDesignEvaluator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeDesignEvaluator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeDesignEvaluator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeDesignEvaluator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,247 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import org.krysalis.barcode4j.ChecksumMode; +import org.krysalis.barcode4j.impl.code128.EAN128Bean; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRDefaultStyleProvider; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.util.JRExpressionUtil; +import net.sf.jasperreports.renderers.Renderable; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarcodeDesignEvaluator extends AbstractBarcodeEvaluator +{ + + public BarcodeDesignEvaluator( + JasperReportsContext jasperReportsContext, + JRComponentElement componentElement, + JRDefaultStyleProvider defaultStyleProvider + ) + { + super(jasperReportsContext, componentElement, defaultStyleProvider); + } + + public Renderable evaluateImage() + { + evaluateBarcode(); + + return renderable; + } + + protected void evaluateBaseBarcode(BarcodeComponent barcodeComponent, + String defaultMessage) + { + message = evaluateStringExpression(barcodeComponent.getCodeExpression(), + defaultMessage); + } + + protected void evaluateBaseBarcode(Barcode4jComponent barcodeComponent, + String defaultMessage) + { + evaluateBaseBarcode((BarcodeComponent)barcodeComponent, defaultMessage); + + String pattern = evaluateStringExpression( + barcodeComponent.getPatternExpression(), null); + if (pattern != null) + { + barcodeBean.setPattern(pattern); + } + } + + protected String evaluateStringExpression(JRExpression expression, String defaultValue) + { + String value = JRExpressionUtil.getSimpleExpressionText(expression); + if (value == null) + { + value = defaultValue; + } + return value; + } + + @Override + protected void evaluateCodabar(CodabarComponent codabar) + { + evaluateBaseBarcode(codabar, "0123456789"); + } + + @Override + protected void evaluateCode128(Code128Component code128) + { + evaluateBaseBarcode(code128, "0123456789"); + } + + @Override + protected void evaluateDataMatrix(DataMatrixComponent dataMatrix) + { + evaluateBaseBarcode(dataMatrix, "0123456789"); + } + + @Override + protected void evaluateEANCode128(EAN128Component ean128) + { + evaluateBaseBarcode(ean128, "0101234567890128"); + String template = evaluateStringExpression( + ean128.getTemplateExpression(), null); + if (template != null) + { + ((EAN128Bean)barcodeBean).setTemplate(template); + } + } + + @Override + protected void evaluateCode39(Code39Component code39) + { + evaluateBaseBarcode(code39, "01234567892"); + } + + @Override + protected void evaluateUPCA(UPCAComponent upcA) + { + String defaultMessage; + String checksumMode = upcA.getChecksumMode(); + if (checksumMode != null + && checksumMode.equals(ChecksumMode.CP_ADD.getName())) + { + defaultMessage = "01234567890"; + } + else + { + defaultMessage = "012345678905"; + } + + evaluateBaseBarcode(upcA, defaultMessage); + } + + @Override + protected void evaluateUPCE(UPCEComponent upcE) + { + String defaultMessage; + String checksumMode = upcE.getChecksumMode(); + if (checksumMode != null + && checksumMode.equals(ChecksumMode.CP_ADD.getName())) + { + defaultMessage = "0123413"; + } + else + { + defaultMessage = "01234133"; + } + + evaluateBaseBarcode(upcE, defaultMessage); + } + + @Override + protected void evaluateEAN13(EAN13Component ean13) + { + String defaultMessage; + String checksumMode = ean13.getChecksumMode(); + if (checksumMode != null + && checksumMode.equals(ChecksumMode.CP_ADD.getName())) + { + defaultMessage = "012345678901"; + } + else + { + defaultMessage = "0123456789012"; + } + + evaluateBaseBarcode(ean13, defaultMessage); + } + + @Override + protected void evaluateEAN8(EAN8Component ean8) + { + String defaultMessage; + String checksumMode = ean8.getChecksumMode(); + if (checksumMode != null + && checksumMode.equals(ChecksumMode.CP_ADD.getName())) + { + defaultMessage = "0123456"; + } + else + { + defaultMessage = "01234565"; + } + + evaluateBaseBarcode(ean8, defaultMessage); + } + + @Override + protected void evaluateInterleaved2Of5(Interleaved2Of5Component interleaved2Of5) + { + evaluateBaseBarcode(interleaved2Of5, "0123456784"); + } + + @Override + protected void evaluateRoyalMailCustomer( + RoyalMailCustomerComponent royalMailCustomer) + { + String defaultMessage; + String checksumMode = royalMailCustomer.getChecksumMode(); + if (checksumMode != null + && checksumMode.equals(ChecksumMode.CP_CHECK.getName())) + { + defaultMessage = "01234Q"; + } + else + { + defaultMessage = "01234"; + } + + evaluateBaseBarcode(royalMailCustomer, defaultMessage); + } + + @Override + protected void evaluateUSPSIntelligentMail( + USPSIntelligentMailComponent intelligentMail) + { + evaluateBaseBarcode(intelligentMail, + "00040123456200800001987654321"); + } + + @Override + protected void evaluatePOSTNET(POSTNETComponent intelligentMail) + { + evaluateBaseBarcode(intelligentMail, "01234"); + } + + @Override + protected void evaluatePDF417(PDF417Component pdf417) + { + evaluateBaseBarcode(pdf417, "01234"); + } + + @Override + protected void evaluateQRCode(QRCodeComponent qrCode) + { + evaluateBaseBarcode(qrCode, "0123456789"); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeEvaluator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeEvaluator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeEvaluator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeEvaluator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,181 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.component.FillContext; +import net.sf.jasperreports.engine.util.JRStringUtil; + +import org.krysalis.barcode4j.impl.code128.EAN128Bean; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarcodeEvaluator extends AbstractBarcodeEvaluator +{ + + private final FillContext fillContext; + private final byte evaluationType; + + public BarcodeEvaluator(FillContext fillContext, byte evaluationType) + { + super( + fillContext.getFiller().getJasperReportsContext(), + fillContext.getComponentElement(), + fillContext.getDefaultStyleProvider() + ); + + this.fillContext = fillContext; + this.evaluationType = evaluationType; + } + + protected void evaluateBaseBarcode(BarcodeComponent barcodeComponent) + { + message = JRStringUtil.getString(evaluateExpression(barcodeComponent.getCodeExpression())); + } + + protected void evaluateBaseBarcode(Barcode4jComponent barcodeComponent) + { + evaluateBaseBarcode((BarcodeComponent)barcodeComponent); + + String pattern = JRStringUtil.getString(evaluateExpression(barcodeComponent.getPatternExpression())); + if (pattern != null) + { + barcodeBean.setPattern(pattern); + } + } + + protected Object evaluateExpression(JRExpression expression) + { + try + { + return fillContext.evaluate(expression, evaluationType); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + protected void evaluateCodabar(CodabarComponent codabar) + { + evaluateBaseBarcode(codabar); + } + + @Override + protected void evaluateCode128(Code128Component code128) + { + evaluateBaseBarcode(code128); + } + + @Override + protected void evaluateDataMatrix(DataMatrixComponent dataMatrix) + { + evaluateBaseBarcode(dataMatrix); + } + + @Override + protected void evaluateEANCode128(EAN128Component ean128) + { + evaluateBaseBarcode(ean128); + String template = JRStringUtil.getString(evaluateExpression(ean128.getTemplateExpression())); + if (template != null) + { + ((EAN128Bean)barcodeBean).setTemplate(template); + } + } + + @Override + protected void evaluateCode39(Code39Component code39) + { + evaluateBaseBarcode(code39); + } + + @Override + protected void evaluateUPCA(UPCAComponent upcA) + { + evaluateBaseBarcode(upcA); + } + + @Override + protected void evaluateUPCE(UPCEComponent upcE) + { + evaluateBaseBarcode(upcE); + } + + @Override + protected void evaluateEAN13(EAN13Component ean13) + { + evaluateBaseBarcode(ean13); + } + + @Override + protected void evaluateEAN8(EAN8Component ean8) + { + evaluateBaseBarcode(ean8); + } + + @Override + protected void evaluateInterleaved2Of5(Interleaved2Of5Component interleaved2Of5) + { + evaluateBaseBarcode(interleaved2Of5); + } + + @Override + protected void evaluateRoyalMailCustomer( + RoyalMailCustomerComponent royalMailCustomer) + { + evaluateBaseBarcode(royalMailCustomer); + } + + @Override + protected void evaluateUSPSIntelligentMail( + USPSIntelligentMailComponent intelligentMail) + { + evaluateBaseBarcode(intelligentMail); + } + + @Override + protected void evaluatePOSTNET(POSTNETComponent intelligentMail) + { + evaluateBaseBarcode(intelligentMail); + } + + @Override + protected void evaluatePDF417(PDF417Component pdf417) + { + evaluateBaseBarcode(pdf417); + } + + @Override + protected void evaluateQRCode(QRCodeComponent qrCode) + { + evaluateBaseBarcode(qrCode); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeExpressionCollector.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeExpressionCollector.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeExpressionCollector.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeExpressionCollector.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,64 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRExpressionCollector; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarcodeExpressionCollector extends UniformBarcodeVisitor +{ + + private final JRExpressionCollector collector; + + public BarcodeExpressionCollector(JRExpressionCollector collector) + { + this.collector = collector; + } + + @Override + protected void visitBarcode(BarcodeComponent barcode) + { + collector.addExpression(barcode.getCodeExpression()); + } + + @Override + protected void visitBarcode(Barcode4jComponent barcode) + { + visitBarcode((BarcodeComponent)barcode); + + collector.addExpression(barcode.getPatternExpression()); + } + + @Override + public void visitEANCode128(EAN128Component ean128) + { + super.visitEANCode128(ean128); + + collector.addExpression(ean128.getTemplateExpression()); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeFillComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeFillComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeFillComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeFillComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,162 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import java.util.HashMap; +import java.util.Map; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRPrintElement; +import net.sf.jasperreports.engine.JRStyle; +import net.sf.jasperreports.engine.component.BaseFillComponent; +import net.sf.jasperreports.engine.component.FillPrepareResult; +import net.sf.jasperreports.engine.fill.JRTemplateImage; +import net.sf.jasperreports.engine.fill.JRTemplatePrintImage; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; +import net.sf.jasperreports.engine.type.ScaleImageEnum; +import net.sf.jasperreports.export.HtmlReportConfiguration; +import net.sf.jasperreports.renderers.Renderable; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarcodeFillComponent extends BaseFillComponent +{ + + private final BarcodeComponent barcodeComponent; + + private final Map printTemplates = new HashMap(); + private Renderable renderable; + + + public BarcodeFillComponent(BarcodeComponent barcodeComponent) + { + this.barcodeComponent = barcodeComponent; + } + + public BarcodeFillComponent(BarcodeFillComponent barcode) + { + this.barcodeComponent = barcode.barcodeComponent; + } + + @Override + public void evaluate(byte evaluation) throws JRException + { + if (isEvaluateNow()) + { + evaluateBarcode(evaluation); + } + } + + protected boolean isEvaluateNow() + { + return barcodeComponent.getEvaluationTimeValue() + == EvaluationTimeEnum.NOW; + } + + protected void evaluateBarcode(byte evaluation) + { + BarcodeEvaluator evaluator = new BarcodeEvaluator(fillContext, evaluation); + evaluator.evaluateBarcode(); + renderable = evaluator.getRenderable(); + } + + @Override + public FillPrepareResult prepare(int availableHeight) + { + if (isEvaluateNow() && renderable == null) + { + return FillPrepareResult.NO_PRINT_NO_OVERFLOW; + } + + return FillPrepareResult.PRINT_NO_STRETCH; + } + + @Override + public JRPrintElement fill() + { + JRTemplateImage templateImage = getTemplateImage(); + + JRTemplatePrintImage image = new JRTemplatePrintImage(templateImage, printElementOriginator); + JRComponentElement element = fillContext.getComponentElement(); + image.setUUID(element.getUUID()); + image.setX(element.getX()); + image.setY(fillContext.getElementPrintY()); + image.setWidth(element.getWidth()); + image.setHeight(element.getHeight()); + image.getPropertiesMap().setProperty(HtmlReportConfiguration.PROPERTY_EMBED_IMAGE, Boolean.TRUE.toString()); + image.getPropertiesMap().setProperty(HtmlReportConfiguration.PROPERTY_EMBEDDED_SVG_USE_FONTS, Boolean.TRUE.toString()); + + if (isEvaluateNow()) + { + setBarcodeImage(image); + } + else + { + fillContext.registerDelayedEvaluation(image, + barcodeComponent.getEvaluationTimeValue(), + barcodeComponent.getEvaluationGroup()); + } + + return image; + } + + protected JRTemplateImage getTemplateImage() + { + JRStyle elementStyle = fillContext.getElementStyle(); + JRTemplateImage templateImage = printTemplates.get(elementStyle); + if (templateImage == null) + { + templateImage = new JRTemplateImage( + fillContext.getElementOrigin(), + fillContext.getDefaultStyleProvider()); + templateImage.setElement(fillContext.getComponentElement()); + templateImage.setStyle(elementStyle);//already set by setElement, but keeping for safety + templateImage.setScaleImage(ScaleImageEnum.RETAIN_SHAPE); + + templateImage = deduplicate(templateImage); + printTemplates.put(elementStyle, templateImage); + } + return templateImage; + } + + protected void setBarcodeImage(JRTemplatePrintImage image) + { + if (renderable != null) + { + image.setRenderer(renderable); + } + } + + @Override + public void evaluateDelayedElement(JRPrintElement element, byte evaluation) + throws JRException + { + evaluateBarcode(evaluation); + setBarcodeImage((JRTemplatePrintImage) element); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeFillFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeFillFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeFillFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeFillFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.component.ComponentFillFactory; +import net.sf.jasperreports.engine.component.FillComponent; +import net.sf.jasperreports.engine.fill.JRFillCloneFactory; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarcodeFillFactory implements ComponentFillFactory +{ + + @Override + public FillComponent toFillComponent(Component component, + JRFillObjectFactory factory) + { + BarcodeComponent barcode = (BarcodeComponent) component; + return new BarcodeFillComponent(barcode); + } + + @Override + public FillComponent cloneFillComponent(FillComponent component, + JRFillCloneFactory factory) + { + BarcodeFillComponent barcode = (BarcodeFillComponent) component; + return new BarcodeFillComponent(barcode); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeImageProducer.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeImageProducer.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeImageProducer.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeImageProducer.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import org.krysalis.barcode4j.BarcodeGenerator; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.renderers.Renderable; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public interface BarcodeImageProducer +{ + + String PROPERTY_IMAGE_PRODUCER = + BarcodeComponent.PROPERTY_PREFIX + "image.producer"; + + String PROPERTY_PREFIX_IMAGE_PRODUCER = + BarcodeComponent.PROPERTY_PREFIX + "image.producer."; + + Renderable createImage( + JasperReportsContext jasperReportsContext, + JRComponentElement componentElement, + BarcodeGenerator barcode, + String message + ); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeRasterizedImageProducer.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeRasterizedImageProducer.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeRasterizedImageProducer.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeRasterizedImageProducer.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,93 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; + +import org.krysalis.barcode4j.BarcodeGenerator; +import org.krysalis.barcode4j.output.bitmap.BitmapCanvasProvider; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.renderers.SimpleDataRenderer; +import net.sf.jasperreports.renderers.Renderable; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarcodeRasterizedImageProducer implements BarcodeImageProducer +{ + + public static final String PROPERTY_RESOLUTION = + BarcodeComponent.PROPERTY_PREFIX + "image.resolution"; + + public static final String PROPERTY_GRAY = + BarcodeComponent.PROPERTY_PREFIX + "image.gray"; + + public static final String PROPERTY_ANTIALIAS = + BarcodeComponent.PROPERTY_PREFIX + "image.antiAlias"; + + @Override + public Renderable createImage( + JasperReportsContext jasperReportsContext, + JRComponentElement componentElement, + BarcodeGenerator barcode, + String message + ) + { + try + { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + + int resolution = JRPropertiesUtil.getInstance(jasperReportsContext).getIntegerProperty( + componentElement, PROPERTY_RESOLUTION, 300); + boolean gray = JRPropertiesUtil.getInstance(jasperReportsContext).getBooleanProperty( + componentElement, PROPERTY_GRAY, true); + boolean antiAlias = JRPropertiesUtil.getInstance(jasperReportsContext).getBooleanProperty( + componentElement, PROPERTY_ANTIALIAS, true); + int imageType = gray ? BufferedImage.TYPE_BYTE_GRAY + : BufferedImage.TYPE_BYTE_BINARY; + + BitmapCanvasProvider provider = + new BitmapCanvasProvider( + out, "image/x-png", resolution, imageType, antiAlias, + ((Barcode4jComponent)componentElement.getComponent()).getOrientationValue().getValue() + ); + barcode.generateBarcode(provider, message); + provider.finish(); + + byte[] imageData = out.toByteArray(); + return SimpleDataRenderer.getInstance(imageData); + } + catch (Exception e) + { + throw new JRRuntimeException(e); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeSVGImageProducer.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeSVGImageProducer.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeSVGImageProducer.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeSVGImageProducer.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,85 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import java.io.ByteArrayOutputStream; + +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.krysalis.barcode4j.BarcodeGenerator; +import org.krysalis.barcode4j.output.svg.SVGCanvasProvider; +import org.w3c.dom.Document; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.renderers.Renderable; +import net.sf.jasperreports.renderers.SimpleRenderToImageAwareDataRenderer; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarcodeSVGImageProducer implements BarcodeImageProducer +{ + + @Override + public Renderable createImage( + JasperReportsContext jasperReportsContext, + JRComponentElement componentElement, + BarcodeGenerator barcode, + String message + ) + { + try + { + SVGCanvasProvider provider = + new SVGCanvasProvider( + false, + ((Barcode4jComponent)componentElement.getComponent()).getOrientationValue().getValue() + ); + barcode.generateBarcode(provider, message); + Document svgDoc = provider.getDOM(); + + Source source = new DOMSource(svgDoc); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + Result output = new StreamResult(baos); + Transformer transformer = TransformerFactory.newInstance() + .newTransformer(); + transformer.transform(source, output); + + return SimpleRenderToImageAwareDataRenderer.getInstance(baos.toByteArray()); + } + catch (Exception e) + { + throw new JRRuntimeException(e); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeUtils.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeUtils.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeUtils.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeUtils.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,124 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRPropertiesHolder; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.util.JRSingletonCache; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public final class BarcodeUtils +{ + protected static JRSingletonCache imageProducerCache = + new JRSingletonCache(BarcodeImageProducer.class); + + protected static JRSingletonCache qrCodeProducerCache = + new JRSingletonCache(QRCodeImageProducer.class); + + private JasperReportsContext jasperReportsContext; + + + /** + * + */ + private BarcodeUtils(JasperReportsContext jasperReportsContext) + { + this.jasperReportsContext = jasperReportsContext; + } + + + /** + * + */ + public static BarcodeUtils getInstance(JasperReportsContext jasperReportsContext) + { + return new BarcodeUtils(jasperReportsContext); + } + + + /** + * + */ + public BarcodeImageProducer getProducer(JRPropertiesHolder propertiesHolder) + { + String producerProperty = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(propertiesHolder, + BarcodeImageProducer.PROPERTY_IMAGE_PRODUCER); + + String producerClass = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(propertiesHolder, + BarcodeImageProducer.PROPERTY_PREFIX_IMAGE_PRODUCER + producerProperty); + if (producerClass == null) + { + producerClass = producerProperty; + } + + try + { + return imageProducerCache.getCachedInstance(producerClass); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + + /** + * + */ + public QRCodeImageProducer getQRCodeProducer(JRPropertiesHolder propertiesHolder) + { + String producerProperty = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(propertiesHolder, + BarcodeImageProducer.PROPERTY_IMAGE_PRODUCER); + + String producerClass = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(propertiesHolder, + QRCodeImageProducer.PROPERTY_PREFIX_QRCODE_PRODUCER + producerProperty); + if (producerClass == null) + { + producerClass = producerProperty; + } + + try + { + return qrCodeProducerCache.getCachedInstance(producerClass); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + + public static boolean isVertical(Barcode4jComponent barcode) + { + OrientationEnum orientation = barcode.getOrientationValue(); + return orientation == OrientationEnum.LEFT + || orientation == OrientationEnum.RIGHT; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeVerifier.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeVerifier.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeVerifier.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeVerifier.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,217 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; + +import org.krysalis.barcode4j.BaselineAlignment; +import org.krysalis.barcode4j.ChecksumMode; +import org.krysalis.barcode4j.impl.datamatrix.SymbolShapeHint; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarcodeVerifier implements BarcodeVisitor +{ + + private final JRVerifier verifier; + + public BarcodeVerifier(JRVerifier verifier) + { + this.verifier = verifier; + } + + protected void verifyBarcode(BarcodeComponent barcode) + { + JRExpression codeExpression = barcode.getCodeExpression(); + if (codeExpression == null) + { + verifier.addBrokenRule("Barcode expression is null", barcode); + } + + EvaluationTimeEnum evaluationTime = barcode.getEvaluationTimeValue(); + if (evaluationTime == EvaluationTimeEnum.AUTO) + { + verifier.addBrokenRule("Auto evaluation time is not supported for barcodes", barcode); + } + else if (evaluationTime == EvaluationTimeEnum.GROUP) + { + String evaluationGroup = barcode.getEvaluationGroup(); + if (evaluationGroup == null || evaluationGroup.length() == 0) + { + verifier.addBrokenRule("No evaluation group set for barcode", barcode); + } + else if (!verifier.getReportDesign().getGroupsMap().containsKey(evaluationGroup)) + { + verifier.addBrokenRule("Barcode evaluation group \"" + + evaluationGroup + " not found", barcode); + } + } + } + + protected void verifyChecksumMode(String checksumMode, BarcodeComponent barcode) + { + try + { + if (checksumMode != null) + { + ChecksumMode.byName(checksumMode); + } + } + catch (Exception e) + { + verifier.addBrokenRule(e, barcode); + } + } + + @Override + public void visitCodabar(CodabarComponent codabar) + { + verifyBarcode(codabar); + } + + @Override + public void visitCode128(Code128Component code128) + { + verifyBarcode(code128); + } + + @Override + public void visitEANCode128(EAN128Component ean128) + { + verifyBarcode(ean128); + verifyChecksumMode(ean128.getChecksumMode(), ean128); + } + + @Override + public void visitDataMatrix(DataMatrixComponent dataMatrix) + { + verifyBarcode(dataMatrix); + + try + { + String shape = dataMatrix.getShape(); + if (shape != null) + { + SymbolShapeHint.byName(shape); + } + } + catch (Exception e) + { + verifier.addBrokenRule(e, dataMatrix); + } + } + + @Override + public void visitCode39(Code39Component code39) + { + verifyBarcode(code39); + verifyChecksumMode(code39.getChecksumMode(), code39); + } + + @Override + public void visitUPCA(UPCAComponent upcA) + { + verifyBarcode(upcA); + verifyChecksumMode(upcA.getChecksumMode(), upcA); + } + + @Override + public void visitUPCE(UPCEComponent upcE) + { + verifyBarcode(upcE); + verifyChecksumMode(upcE.getChecksumMode(), upcE); + } + + @Override + public void visitEAN13(EAN13Component ean13) + { + verifyBarcode(ean13); + verifyChecksumMode(ean13.getChecksumMode(), ean13); + } + + @Override + public void visitEAN8(EAN8Component ean8) + { + verifyBarcode(ean8); + verifyChecksumMode(ean8.getChecksumMode(), ean8); + } + + @Override + public void visitInterleaved2Of5(Interleaved2Of5Component interleaved2Of5) + { + verifyBarcode(interleaved2Of5); + verifyChecksumMode(interleaved2Of5.getChecksumMode(), interleaved2Of5); + } + + @Override + public void visitRoyalMailCustomer( + RoyalMailCustomerComponent royalMailCustomer) + { + verifyBarcode(royalMailCustomer); + verifyChecksumMode(royalMailCustomer.getChecksumMode(), royalMailCustomer); + } + + @Override + public void visitUSPSIntelligentMail( + USPSIntelligentMailComponent intelligentMail) + { + verifyBarcode(intelligentMail); + verifyChecksumMode(intelligentMail.getChecksumMode(), intelligentMail); + } + + @Override + public void visitPostnet(POSTNETComponent postnet) + { + verifyBarcode(postnet); + verifyChecksumMode(postnet.getChecksumMode(), postnet); + + if (postnet.getBaselinePosition() != null) + { + try + { + BaselineAlignment.byName(postnet.getBaselinePosition()); + } + catch (Exception e) + { + verifier.addBrokenRule(e, postnet); + } + } + } + + @Override + public void visitPDF417(PDF417Component pdf417) + { + verifyBarcode(pdf417); + } + + @Override + public void visitQRCode(QRCodeComponent qrCode) + { + verifyBarcode(qrCode); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeVisitor.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeVisitor.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeVisitor.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeVisitor.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,64 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public interface BarcodeVisitor +{ + + void visitCodabar(CodabarComponent codabar); + + void visitCode128(Code128Component code128); + + void visitEANCode128(EAN128Component ean128); + + void visitDataMatrix(DataMatrixComponent dataMatrix); + + void visitRoyalMailCustomer(RoyalMailCustomerComponent royalMailCustomer); + + void visitUSPSIntelligentMail(USPSIntelligentMailComponent intelligentMail); + + void visitCode39(Code39Component code39); + + void visitUPCA(UPCAComponent upcA); + + void visitUPCE(UPCEComponent upcE); + + void visitEAN13(EAN13Component ean13); + + void visitEAN8(EAN8Component ean8); + + void visitInterleaved2Of5(Interleaved2Of5Component interleaved2Of5); + + void visitPostnet(POSTNETComponent postnet); + + void visitPDF417(PDF417Component pdf417); + + void visitQRCode(QRCodeComponent qrCode); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeXmlWriter.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeXmlWriter.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeXmlWriter.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/BarcodeXmlWriter.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,431 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import java.io.IOException; + +import net.sf.jasperreports.components.ComponentsExtensionsRegistryFactory; +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.component.ComponentKey; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; +import net.sf.jasperreports.engine.util.JRXmlWriteHelper; +import net.sf.jasperreports.engine.util.VersionComparator; +import net.sf.jasperreports.engine.util.XmlNamespace; +import net.sf.jasperreports.engine.xml.JRXmlConstants; +import net.sf.jasperreports.engine.xml.JRXmlWriter; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BarcodeXmlWriter implements BarcodeVisitor +{ + + private final JRXmlWriteHelper xmlWriteHelper; + private final BarcodeComponent barcodeComponent; + private final ComponentKey componentKey; + private final String version; + private final VersionComparator versionComparator; + + public BarcodeXmlWriter(JRXmlWriter reportWriter, JRComponentElement componentElement) + { + this(reportWriter, componentElement, null, new VersionComparator()); + } + + public BarcodeXmlWriter(JRXmlWriter reportWriter, JRComponentElement componentElement, String version, VersionComparator versionComparator) + { + this.xmlWriteHelper = reportWriter.getXmlWriteHelper(); + this.barcodeComponent = (BarcodeComponent) componentElement.getComponent(); + this.componentKey = componentElement.getComponentKey(); + this.version = version; + this.versionComparator = versionComparator; + } + + public void writeBarcode() + { + barcodeComponent.receive(this); + } + + protected void startBarcode(BarcodeComponent barcode) + { + XmlNamespace namespace = new XmlNamespace( + ComponentsExtensionsRegistryFactory.NAMESPACE, + componentKey.getNamespacePrefix(), + ComponentsExtensionsRegistryFactory.XSD_LOCATION); + xmlWriteHelper.startElement(componentKey.getName(), namespace); + } + + protected void endBarcode() throws IOException + { + xmlWriteHelper.closeElement(); + } + + protected void writeBaseAttributes(BarcodeComponent barcode) + { + xmlWriteHelper.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationTime, + barcode.getEvaluationTimeValue(), EvaluationTimeEnum.NOW); + xmlWriteHelper.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationGroup, + barcode.getEvaluationGroup()); + } + + protected void writeBaseAttributes(Barcode4jComponent barcode) + { + writeBaseAttributes((BarcodeComponent)barcode); + + xmlWriteHelper.addAttribute("moduleWidth", barcode.getModuleWidth()); + + if (isNewerVersionOrEqual(version, JRConstants.VERSION_6_0_2)) + { + xmlWriteHelper.addAttribute("orientation", barcode.getOrientationValue(), OrientationEnum.UP); + } + else + { + xmlWriteHelper.addAttribute("orientation", barcode.getOrientationValue().getValue(), (Integer)0); + } + + xmlWriteHelper.addAttribute("textPosition", barcode.getTextPositionValue()); + xmlWriteHelper.addAttribute("quietZone", barcode.getQuietZone()); + xmlWriteHelper.addAttribute("verticalQuietZone", barcode.getVerticalQuietZone()); + } + + protected void writeBaseContents(BarcodeComponent barcode) throws IOException + { + writeExpression("codeExpression", barcode.getCodeExpression(), false); + } + + protected void writeBaseContents(Barcode4jComponent barcode) throws IOException + { + writeBaseContents((BarcodeComponent)barcode); + + writeExpression("patternExpression", barcode.getPatternExpression(), false); + } + + @Override + public void visitCodabar(CodabarComponent codabar) + { + try + { + startBarcode(codabar); + writeBaseAttributes(codabar); + xmlWriteHelper.addAttribute("wideFactor", codabar.getWideFactor()); + writeBaseContents(codabar); + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public void visitCode128(Code128Component code128) + { + try + { + startBarcode(code128); + writeBaseAttributes(code128); + writeBaseContents(code128); + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public void visitDataMatrix(DataMatrixComponent dataMatrix) + { + try + { + startBarcode(dataMatrix); + writeBaseAttributes(dataMatrix); + xmlWriteHelper.addAttribute("shape", dataMatrix.getShape()); + writeBaseContents(dataMatrix); + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public void visitEANCode128(EAN128Component ean128) + { + try + { + startBarcode(ean128); + writeBaseAttributes(ean128); + xmlWriteHelper.addAttribute("checksumMode", ean128.getChecksumMode()); + writeBaseContents(ean128); + if(isNewerVersionOrEqual(version, JRConstants.VERSION_5_1_2)) + { + writeExpression("templateExpression", ean128.getTemplateExpression(), false); + } + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public void visitCode39(Code39Component code39) + { + try + { + startBarcode(code39); + writeBaseAttributes(code39); + xmlWriteHelper.addAttribute("checksumMode", code39.getChecksumMode()); + xmlWriteHelper.addAttribute("displayChecksum", code39.isDisplayChecksum()); + xmlWriteHelper.addAttribute("displayStartStop", code39.isDisplayStartStop()); + xmlWriteHelper.addAttribute("extendedCharSetEnabled", code39.isExtendedCharSetEnabled()); + xmlWriteHelper.addAttribute("intercharGapWidth", code39.getIntercharGapWidth()); + xmlWriteHelper.addAttribute("wideFactor", code39.getWideFactor()); + writeBaseContents(code39); + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public void visitUPCA(UPCAComponent upcA) + { + try + { + startBarcode(upcA); + writeBaseAttributes(upcA); + xmlWriteHelper.addAttribute("checksumMode", upcA.getChecksumMode()); + writeBaseContents(upcA); + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public void visitUPCE(UPCEComponent upcE) + { + try + { + startBarcode(upcE); + writeBaseAttributes(upcE); + xmlWriteHelper.addAttribute("checksumMode", upcE.getChecksumMode()); + writeBaseContents(upcE); + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public void visitEAN13(EAN13Component ean13) + { + try + { + startBarcode(ean13); + writeBaseAttributes(ean13); + xmlWriteHelper.addAttribute("checksumMode", ean13.getChecksumMode()); + writeBaseContents(ean13); + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public void visitEAN8(EAN8Component ean8) + { + try + { + startBarcode(ean8); + writeBaseAttributes(ean8); + xmlWriteHelper.addAttribute("checksumMode", ean8.getChecksumMode()); + writeBaseContents(ean8); + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public void visitInterleaved2Of5(Interleaved2Of5Component interleaved2Of5) + { + try + { + startBarcode(interleaved2Of5); + writeBaseAttributes(interleaved2Of5); + xmlWriteHelper.addAttribute("checksumMode", interleaved2Of5.getChecksumMode()); + xmlWriteHelper.addAttribute("displayChecksum", interleaved2Of5.isDisplayChecksum()); + xmlWriteHelper.addAttribute("wideFactor", interleaved2Of5.getWideFactor()); + writeBaseContents(interleaved2Of5); + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + protected void writeFourStateAttributes(FourStateBarcodeComponent barcode) + { + xmlWriteHelper.addAttribute("ascenderHeight", barcode.getAscenderHeight()); + xmlWriteHelper.addAttribute("checksumMode", barcode.getChecksumMode()); + xmlWriteHelper.addAttribute("intercharGapWidth", barcode.getIntercharGapWidth()); + xmlWriteHelper.addAttribute("trackHeight", barcode.getTrackHeight()); + } + + @Override + public void visitRoyalMailCustomer( + RoyalMailCustomerComponent royalMailCustomer) + { + try + { + startBarcode(royalMailCustomer); + writeBaseAttributes(royalMailCustomer); + writeFourStateAttributes(royalMailCustomer); + writeBaseContents(royalMailCustomer); + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public void visitUSPSIntelligentMail( + USPSIntelligentMailComponent intelligentMail) + { + try + { + startBarcode(intelligentMail); + writeBaseAttributes(intelligentMail); + writeFourStateAttributes(intelligentMail); + writeBaseContents(intelligentMail); + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public void visitPostnet(POSTNETComponent postnet) + { + try + { + startBarcode(postnet); + writeBaseAttributes(postnet); + xmlWriteHelper.addAttribute("shortBarHeight", postnet.getShortBarHeight()); + xmlWriteHelper.addAttribute("baselinePosition", postnet.getBaselinePosition()); + xmlWriteHelper.addAttribute("checksumMode", postnet.getChecksumMode()); + xmlWriteHelper.addAttribute("displayChecksum", postnet.getDisplayChecksum()); + xmlWriteHelper.addAttribute("intercharGapWidth", postnet.getIntercharGapWidth()); + writeBaseContents(postnet); + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public void visitPDF417(PDF417Component pdf417) + { + try + { + startBarcode(pdf417); + writeBaseAttributes(pdf417); + xmlWriteHelper.addAttribute("minColumns", pdf417.getMinColumns()); + xmlWriteHelper.addAttribute("maxColumns", pdf417.getMaxColumns()); + xmlWriteHelper.addAttribute("minRows", pdf417.getMinRows()); + xmlWriteHelper.addAttribute("maxRows", pdf417.getMaxRows()); + xmlWriteHelper.addAttribute("widthToHeightRatio", pdf417.getWidthToHeightRatio()); + xmlWriteHelper.addAttribute("errorCorrectionLevel", pdf417.getErrorCorrectionLevel()); + writeBaseContents(pdf417); + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public void visitQRCode(QRCodeComponent qrCode) + { + try + { + startBarcode(qrCode); + writeBaseAttributes(qrCode); + xmlWriteHelper.addAttribute("margin", qrCode.getMargin()); + xmlWriteHelper.addAttribute(QRCodeComponent.PROPERTY_ERROR_CORRECTION_LEVEL, + qrCode.getErrorCorrectionLevel(), + ErrorCorrectionLevelEnum.L); + writeBaseContents(qrCode); + endBarcode(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @SuppressWarnings("deprecation") + protected void writeExpression(String name, JRExpression expression, boolean writeClass) throws IOException + { + if(versionComparator.compare(version, JRConstants.VERSION_4_1_1) >= 0 ) + { + xmlWriteHelper.writeExpression(name, expression); + } + else + { + xmlWriteHelper.writeExpression(name, expression, writeClass); + } + } + + protected boolean isNewerVersionOrEqual(String currentVersion, String oldVersion) + { + return versionComparator.compare(currentVersion, oldVersion) >= 0; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/CodabarComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/CodabarComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/CodabarComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/CodabarComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class CodabarComponent extends Barcode4jComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_WIDE_FACTOR = "wideFactor"; + + private Double wideFactor; + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitCodabar(this); + } + + public Double getWideFactor() + { + return wideFactor; + } + + public void setWideFactor(Double wideFactor) + { + Object old = this.wideFactor; + this.wideFactor = wideFactor; + getEventSupport().firePropertyChange(PROPERTY_WIDE_FACTOR, + old, this.wideFactor); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/Code128Component.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/Code128Component.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/Code128Component.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/Code128Component.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class Code128Component extends Barcode4jComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitCode128(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/Code39Component.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/Code39Component.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/Code39Component.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/Code39Component.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,151 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +import org.krysalis.barcode4j.ChecksumMode; + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class Code39Component extends Barcode4jComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CHECKSUM_MODE = "checksumMode"; + public static final String PROPERTY_DISPLAY_CHECKSUM = "displayChecksum"; + public static final String PROPERTY_DISPLAY_START_STOP = "displayStartStop"; + public static final String PROPERTY_EXTENDED_CHARSET_ENABLED = "extendedCharSetEnabled"; + public static final String PROPERTY_INTERCHAR_GAP_WIDTH = "intercharGapWidth"; + public static final String PROPERTY_WIDE_FACTOR = "wideFactor"; + + private String checksumMode; + private Boolean displayChecksum; + private Boolean displayStartStop; + private Boolean extendedCharSetEnabled; + private Double intercharGapWidth; + private Double wideFactor; + + public String getChecksumMode() + { + return checksumMode; + } + + public void setChecksumMode(String checksumMode) + { + Object old = this.checksumMode; + this.checksumMode = checksumMode; + getEventSupport().firePropertyChange(PROPERTY_CHECKSUM_MODE, old, this.checksumMode); + } + + public void setChecksumMode(ChecksumMode checksumMode) + { + setChecksumMode(checksumMode == null ? null : checksumMode.getName()); + } + + public Boolean isDisplayChecksum() + { + return displayChecksum; + } + + /** + * Enables or disables the use of the checksum in the human-readable message. + */ + public void setDisplayChecksum(Boolean displayChecksum) + { + Boolean old = this.displayChecksum; + this.displayChecksum = displayChecksum; + getEventSupport().firePropertyChange(PROPERTY_DISPLAY_CHECKSUM, old, this.displayChecksum); + } + + public Boolean isDisplayStartStop() + { + return displayStartStop; + } + + /** + * Enables or disables the use of the start and stop characters in the human-readable message. + */ + public void setDisplayStartStop(Boolean displayStartStop) + { + Boolean old = this.displayStartStop; + this.displayStartStop = displayStartStop; + getEventSupport().firePropertyChange(PROPERTY_DISPLAY_START_STOP, old, this.displayStartStop); + } + + public Boolean isExtendedCharSetEnabled() + { + return extendedCharSetEnabled; + } + + /** + * Enables or disables the extended character set. + */ + public void setExtendedCharSetEnabled(Boolean extendedCharSetEnabled) + { + Boolean old = this.extendedCharSetEnabled; + this.extendedCharSetEnabled = extendedCharSetEnabled; + getEventSupport().firePropertyChange(PROPERTY_EXTENDED_CHARSET_ENABLED, old, this.extendedCharSetEnabled); + } + + public Double getIntercharGapWidth() + { + return intercharGapWidth; + } + + /** + * Sets the width between encoded characters. + */ + public void setIntercharGapWidth(Double intercharGapWidth) + { + Double old = this.intercharGapWidth; + this.intercharGapWidth = intercharGapWidth; + getEventSupport().firePropertyChange(PROPERTY_INTERCHAR_GAP_WIDTH, old, this.intercharGapWidth); + } + + public Double getWideFactor() + { + return wideFactor; + } + + /** + * Sets the factor by which wide bars are broader than narrow bars. + */ + public void setWideFactor(Double wideFactor) + { + Double old = this.wideFactor; + this.wideFactor = wideFactor; + getEventSupport().firePropertyChange(PROPERTY_WIDE_FACTOR, old, this.wideFactor); + } + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitCode39(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/CompiledBarcodeFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/CompiledBarcodeFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/CompiledBarcodeFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/CompiledBarcodeFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class CompiledBarcodeFactory extends UniformBarcodeVisitor +{ + + private final JRBaseObjectFactory baseFactory; + + private BarcodeComponent compiledComponent; + + public CompiledBarcodeFactory(JRBaseObjectFactory baseFactory) + { + this.baseFactory = baseFactory; + } + + public BarcodeComponent toCompiledComponent(BarcodeComponent barcode) + { + barcode.receive(this); + return compiledComponent; + } + + @Override + protected void visitBarcode(BarcodeComponent barcode) + { + compiledComponent = barcode.cloneObject(); + + JRExpression compiledCodeExpression = baseFactory.getExpression( + barcode.getCodeExpression()); + compiledComponent.setCodeExpression(compiledCodeExpression); + } + + @Override + protected void visitBarcode(Barcode4jComponent barcode) + { + visitBarcode((BarcodeComponent)barcode); + + JRExpression compiledPatternExpression = baseFactory.getExpression( + barcode.getPatternExpression()); + ((Barcode4jComponent)compiledComponent).setPatternExpression(compiledPatternExpression); + } + + + @Override + public void visitEANCode128(EAN128Component ean128) + { + super.visitEANCode128(ean128); + + JRExpression compiledTemplateExpression = baseFactory.getExpression( + ean128.getTemplateExpression()); + ((EAN128Component)compiledComponent).setTemplateExpression(compiledTemplateExpression); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/DataMatrixComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/DataMatrixComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/DataMatrixComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/DataMatrixComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,67 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +import org.krysalis.barcode4j.impl.datamatrix.SymbolShapeHint; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class DataMatrixComponent extends Barcode4jComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_SHAPE = "shape"; + + private String shape; + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitDataMatrix(this); + } + + public String getShape() + { + return shape; + } + + public void setShape(String shape) + { + Object old = this.shape; + this.shape = shape; + getEventSupport().firePropertyChange(PROPERTY_SHAPE, + old, this.shape); + } + + public void setShape(SymbolShapeHint shape) + { + setShape(shape == null ? null : shape.getName()); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/EAN128Component.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/EAN128Component.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/EAN128Component.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/EAN128Component.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,91 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +import org.krysalis.barcode4j.ChecksumMode; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class EAN128Component extends Code128Component +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CHECKSUM_MODE = "checksumMode"; + public static final String PROPERTY_TEMPLATE_EXPRESSION = "templateExpression"; + + private String checksumMode; + private JRExpression templateExpression; + + public String getChecksumMode() + { + return checksumMode; + } + + public void setChecksumMode(String checksumMode) + { + Object old = this.checksumMode; + this.checksumMode = checksumMode; + getEventSupport().firePropertyChange(PROPERTY_CHECKSUM_MODE, + old, this.checksumMode); + } + + public void setChecksumMode(ChecksumMode checksumMode) + { + setChecksumMode(checksumMode == null ? null : checksumMode.getName()); + } + + public JRExpression getTemplateExpression() + { + return templateExpression; + } + + public void setTemplateExpression(JRExpression templateExpression) + { + Object old = this.templateExpression; + this.templateExpression = templateExpression; + getEventSupport().firePropertyChange(PROPERTY_TEMPLATE_EXPRESSION, + old, this.templateExpression); + } + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitEANCode128(this); + } + + @Override + public Object clone() + { + EAN128Component clone = (EAN128Component) super.clone(); + clone.templateExpression = JRCloneUtils.nullSafeClone(templateExpression); + return clone; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/EAN13Component.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/EAN13Component.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/EAN13Component.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/EAN13Component.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +import org.krysalis.barcode4j.ChecksumMode; + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class EAN13Component extends Barcode4jComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CHECKSUM_MODE = "checksumMode"; + + private String checksumMode; + + public String getChecksumMode() + { + return checksumMode; + } + + public void setChecksumMode(String checksumMode) + { + Object old = this.checksumMode; + this.checksumMode = checksumMode; + getEventSupport().firePropertyChange(PROPERTY_CHECKSUM_MODE, old, this.checksumMode); + } + + public void setChecksumMode(ChecksumMode checksumMode) + { + setChecksumMode(checksumMode == null ? null : checksumMode.getName()); + } + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitEAN13(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/EAN8Component.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/EAN8Component.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/EAN8Component.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/EAN8Component.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +import org.krysalis.barcode4j.ChecksumMode; + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class EAN8Component extends Barcode4jComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CHECKSUM_MODE = "checksumMode"; + + private String checksumMode; + + public String getChecksumMode() + { + return checksumMode; + } + + public void setChecksumMode(String checksumMode) + { + Object old = this.checksumMode; + this.checksumMode = checksumMode; + getEventSupport().firePropertyChange(PROPERTY_CHECKSUM_MODE, old, this.checksumMode); + } + + public void setChecksumMode(ChecksumMode checksumMode) + { + setChecksumMode(checksumMode == null ? null : checksumMode.getName()); + } + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitEAN8(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/ErrorCorrectionLevelEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/ErrorCorrectionLevelEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/ErrorCorrectionLevelEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/ErrorCorrectionLevelEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,116 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public enum ErrorCorrectionLevelEnum implements NamedEnum +{ + /** + * + */ + L("L"), + + /** + * + */ + M("M"), + + /** + * + */ + Q("Q"), + + /** + * + */ + H("H"); + + /** + * + */ + private final transient String name; + public static final String EXCEPTION_MESSAGE_KEY_UNKNOWN_NAME = "components.barcode4j.error.correction.level.unknown.name"; + + private ErrorCorrectionLevelEnum(String name) + { + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public final ErrorCorrectionLevel getErrorCorrectionLevel() + { + // not storing this as instance field as we don't want to force an iText dependency + ErrorCorrectionLevel level; + if (name.equals("L")) + { + level = ErrorCorrectionLevel.L; + } + else if (name.equalsIgnoreCase("M")) + { + level = ErrorCorrectionLevel.M; + } + else if (name.equalsIgnoreCase("Q")) + { + level = ErrorCorrectionLevel.Q; + } + else if (name.equalsIgnoreCase("H")) + { + level = ErrorCorrectionLevel.H; + } + else + { + // should not happen + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_UNKNOWN_NAME, + new Object[]{name}); + } + return level; + } + + /** + * + */ + public static ErrorCorrectionLevelEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/FourStateBarcodeComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/FourStateBarcodeComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/FourStateBarcodeComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/FourStateBarcodeComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,106 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +import org.krysalis.barcode4j.ChecksumMode; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public abstract class FourStateBarcodeComponent extends Barcode4jComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_ASCENDER_HEIGHT = "ascenderHeight"; + public static final String PROPERTY_CHECKSUM_MODE = "checksumMode"; + public static final String PROPERTY_INTERCHAR_GAP_WIDTH = "intercharGapWidth"; + public static final String PROPERTY_TRACK_HEIGHT = "trackHeight"; + + private Double ascenderHeight; + private String checksumMode; + private Double intercharGapWidth; + private Double trackHeight; + + public Double getAscenderHeight() + { + return ascenderHeight; + } + + public void setAscenderHeight(Double ascenderHeight) + { + Object old = this.ascenderHeight; + this.ascenderHeight = ascenderHeight; + getEventSupport().firePropertyChange(PROPERTY_ASCENDER_HEIGHT, + old, this.ascenderHeight); + } + + public String getChecksumMode() + { + return checksumMode; + } + + public void setChecksumMode(String checksumMode) + { + Object old = this.checksumMode; + this.checksumMode = checksumMode; + getEventSupport().firePropertyChange(PROPERTY_CHECKSUM_MODE, + old, this.checksumMode); + } + + public void setChecksumMode(ChecksumMode checksumMode) + { + setChecksumMode(checksumMode == null ? null : checksumMode.getName()); + } + + public Double getIntercharGapWidth() + { + return intercharGapWidth; + } + + public void setIntercharGapWidth(Double intercharGapWidth) + { + Object old = this.intercharGapWidth; + this.intercharGapWidth = intercharGapWidth; + getEventSupport().firePropertyChange(PROPERTY_INTERCHAR_GAP_WIDTH, + old, this.intercharGapWidth); + } + + public Double getTrackHeight() + { + return trackHeight; + } + + public void setTrackHeight(Double trackHeight) + { + Object old = this.trackHeight; + this.trackHeight = trackHeight; + getEventSupport().firePropertyChange(PROPERTY_TRACK_HEIGHT, + old, this.trackHeight); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/Interleaved2Of5Component.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/Interleaved2Of5Component.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/Interleaved2Of5Component.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/Interleaved2Of5Component.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,100 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +import org.krysalis.barcode4j.ChecksumMode; + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class Interleaved2Of5Component extends Barcode4jComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CHECKSUM_MODE = "checksumMode"; + public static final String PROPERTY_DISPLAY_CHECKSUM = "displayChecksum"; + public static final String PROPERTY_WIDE_FACTOR = "wideFactor"; + + private String checksumMode; + private Boolean displayChecksum; + private Double wideFactor; + + public String getChecksumMode() + { + return checksumMode; + } + + public void setChecksumMode(String checksumMode) + { + Object old = this.checksumMode; + this.checksumMode = checksumMode; + getEventSupport().firePropertyChange(PROPERTY_CHECKSUM_MODE, old, this.checksumMode); + } + + public void setChecksumMode(ChecksumMode checksumMode) + { + setChecksumMode(checksumMode == null ? null : checksumMode.getName()); + } + + public Boolean isDisplayChecksum() + { + return displayChecksum; + } + + /** + * Enables or disables the use of the checksum in the human-readable message. + */ + public void setDisplayChecksum(Boolean displayChecksum) + { + Boolean old = this.displayChecksum; + this.displayChecksum = displayChecksum; + getEventSupport().firePropertyChange(PROPERTY_DISPLAY_CHECKSUM, old, this.displayChecksum); + } + + public Double getWideFactor() + { + return wideFactor; + } + + /** + * Sets the factor by which wide bars are broader than narrow bars. + */ + public void setWideFactor(Double wideFactor) + { + Double old = this.wideFactor; + this.wideFactor = wideFactor; + getEventSupport().firePropertyChange(PROPERTY_WIDE_FACTOR, old, this.wideFactor); + } + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitInterleaved2Of5(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/OrientationEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/OrientationEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/OrientationEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/OrientationEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,94 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedValueEnum; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public enum OrientationEnum implements NamedValueEnum +{ + /** + * + */ + UP(0, "up"), + + /** + * + */ + LEFT(90, "left"), + + /** + * + */ + DOWN(180, "down"), + + /** + * + */ + RIGHT(270, "right"); + + /** + * + */ + private final transient int value; + private final transient String name; + + private OrientationEnum(int value, String name) + { + this.value = value; + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + @Override + public Integer getValue() + { + return value; + } + + /** + * + */ + public static OrientationEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } + + /** + * + */ + public static OrientationEnum getByValue(Integer value) + { + return EnumUtil.getByValue(values(), value); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/OrientationRule.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/OrientationRule.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/OrientationRule.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/OrientationRule.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,71 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import net.sf.jasperreports.engine.xml.TransformedPropertyRule; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class OrientationRule extends TransformedPropertyRule +{ + + private static final Log log = LogFactory.getLog(OrientationRule.class); + + public OrientationRule(String attributeName, String propertyName) + { + super(attributeName, propertyName); + } + + @Override + protected Object toPropertyValue(String attributeValue) + { + OrientationEnum orientation = OrientationEnum.getByName(attributeValue); + if (orientation == null) + { + try + { + //parsing as integer value + int intValue = Integer.parseInt(attributeValue); + orientation = OrientationEnum.getByValue(intValue); + } + catch (NumberFormatException e) + { + //NOP + } + } + + if (log.isDebugEnabled()) + { + log.debug("Resolved orientation attribute " + attributeValue + " to " + orientation); + } + + return orientation; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,137 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** +* Contains classes for the built-in Barcode4J component. +*
    +*

    The Barcode4J Component

    +* This component relies on the Barcode4J library (http://barcode4j.sourceforge.net). +*
    +* Unlike the Barbecue barcode component, there is only one component per Barcode4J +* barcode type. All the barcode's components derive from a base type which defines its +* common attributes. +*

    +* All barcodes in this library include a code expression, which provides the textual data to +* be encoded in the barcode, and an optional expression that provides a pattern to be +* applied on the message displayed in the barcode. Delayed evaluation of the barcode can +* be configured using the two evaluation attributes and works in the same way as for +* Barbecue barcodes. +*

    +* Several optional barcode rendering attributes can be set: +*
      +*
    • orientation - specifies how the barcode and any accompanying text are to be +* oriented when rendered. There are 4 possible values: +*
        +*
      • 0 - indicates that the barcode is to be rendered in the default orientation +* (which for linear barcodes is with vertical bars arranged from left to right)
      • +*
      • 90 - indicates that the barcode is to be rotated anti-clockwise by 90 degrees
      • +*
      • 180 - indicates that the barcode is to be rotated anti-clockwise by 180 degrees
      • +*
      • 270 - indicates that the barcode is to be rotated anti-clockwise by 270 degrees
      • +*
    • +*
    • moduleWidth - specifies the width (in pixels) of the thinnest bar/module.
    • +*
    • textPosition - Sets the placement of the human-readable barcode message. It has +* three possible values: none - meaning no human-readable message, and +* bottom and top. +*
      +* Note that the message and barcode are oriented together as a unit, so if the orientation +* is set to 180 and the text position to top, the code appears reversed and the text +* appears upside down beneath the image.
    • +*
    • quietZone - Specifies the width of the quiet zone (in pixels).
    • +*
    • verticalQuietZone - Specifies the height of the vertical quiet zone (in pixels).
    • +*
    +* Concrete barcode types extend the base type by adding further attributes supported by the specific symboloy: +*
      +*
    • Codabar barcodes have a wideFactor attribute that specifies the factor between the +* width of wide bars and the width of narrow bars.
    • +*
    • Code128 barcodes do not have any specific attributes.
    • +*
    • EAN128, EAN13, EAN8, UPCA and UPCE barcodes have a checksumMode +* attribute which indicates how the check digit is to be handled. The attribute accepts +* four values: +*
        +*
      • add - adds the checksum to the data;
      • +*
      • check - indicates that the data should already contain a checksum;
      • +*
      • ignore - doesn't expect or add a checksum to the data;
      • +*
      • auto - attempts to detect whether a checksum is already present in the +* data or one should be added.
      • +*
    • +*
    • Data Matrix barcodes can be configured to render as a square or rectangle by the +* shape attribute.
    • +*
    • Code39 barcodes have a checksumMode attribute, a displayChecksum +* attribute that controls whether the human-readable message shows the checksum +* character, a displayStartStop attribute which decides whether start/stop +* characters are to be displayed in the human-readable message, +* extendedCharSetEnabled to indicate that the barcode can display characters +* from the entire 7-bit ASCII set, intercharGapWidth to control the width between +* the characters and a wideFactor attribute.
    • +*
    • Interleaved2Of5 barcodes can specify checksumMode, displayChecksum and +* wideFactor attributes with the same meanings as in Code39 barcodes.
    • +*
    • RoyalMailCustomer and USPSIntelligentMail barcodes have a checksumMode +* attribute, an intercharGapWidth attribute, an ascenderHeight attribute which +* sets the length of the bar ascender/descender, and a trackHeight attribute which +* provides the height of the barcode track.
    • +*
    • POSTNET barcodes can specify checksumMode, displayChecksum and +* intercharGapWidth attributes, plus shortBarHeight for setting the height of +* the short bar, and baselinePosition which can be top or bottom +* to indicate how bars should align.
    • +*
    • PDF417 barcode can control the number of columns and rows with the +* minColumns, maxColumns, minRows, maxRows and +* widthToHeightRatio attributes. The error correction level can be set using the +* errorCorrectionLevel attribute.
    • +*
    • QRCode barcode can control its error correction level using the errorCorrectionLevel attribute.
    • +*
    +* The object model for the barcode components uses +* {@link net.sf.jasperreports.components.barcode4j.BarcodeComponent BarcodeComponent} +* as base class and concrete classes for each barcode type. +*

    +* When a report that contains barcodes is filled, the data and attributes of the barcode are +* collected into an object and passed to an image producer whose responsibility is to create +* a renderer for the barcode. The image producer implements the +* {@link net.sf.jasperreports.components.barcode4j.BarcodeImageProducer BarcodeImageProducer} +* interface. As for Barbecue barcode elements, the resulting images have the size of the +* design barcode element and use RetainShape as scale type. +*

    +* Determining which image producer to use for a barcode component element relies on +* custom properties defined at the element, report and global levels. The +* {@link net.sf.jasperreports.components.barcode4j.BarcodeImageProducer#PROPERTY_IMAGE_PRODUCER net.sf.jasperreports.components.barcode4j.image.producer} property can +* have a value of the name of the class that implements the image producer interface or an +* alias that has been set for such a class, using a property of the form +* {@link net.sf.jasperreports.components.barcode4j.BarcodeImageProducer#PROPERTY_PREFIX_IMAGE_PRODUCER net.sf.jasperreports.components.barcode4j.image.producer.<alias>}. +* JasperReports has two barcode image producer implementations: one which renders the +* barcode in SVG format and one which renders the barcode as a rasterized image. The +* first implementation is registered under the svg alias and is used by default; +* the second one has image as alias and can be used by changing the +* {@link net.sf.jasperreports.components.barcode4j.BarcodeImageProducer#PROPERTY_PREFIX_IMAGE_PRODUCER net.sf.jasperreports.components.barcode4j.image.producer.<alias>} +* property at any level. +*

    +* The SVG barcode image producer uses the Barcode4J API to export the barcode to SVG, +* then it creates an SVG renderer based on the Batik SVG library. Hence, this option +* introduces a dependency on Batik for viewing or exporting a report that includes +* barcodes. +*

    +* The rasterized image producer draws the barcode on a PNG image which can be then +* displayed in the generated report. This producer uses further properties, set at the same +* levels as the image producer property, to allow the customization of the generated image. +*

    +*/ +package net.sf.jasperreports.components.barcode4j; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/PDF417Component.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/PDF417Component.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/PDF417Component.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/PDF417Component.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,135 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class PDF417Component extends Barcode4jComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_MIN_COLUMNS = "minColumns"; + public static final String PROPERTY_MAX_COLUMNS = "maxColumns"; + public static final String PROPERTY_MIN_ROWS = "minRows"; + public static final String PROPERTY_MAX_ROWS = "maxRows"; + public static final String PROPERTY_WIDTH_TO_HEIGHT_RATIO = "widthToHeightRatio"; + public static final String PROPERTY_ERROR_CORRECTION_LEVEL = "errorCorrectionLevel"; + + private Integer minColumns; + private Integer maxColumns; + private Integer minRows; + private Integer maxRows; + private Double widthToHeightRatio; + private Integer errorCorrectionLevel; + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitPDF417(this); + } + + public Integer getMinColumns() + { + return minColumns; + } + + public void setMinColumns(Integer minColumns) + { + Object old = this.minColumns; + this.minColumns = minColumns; + getEventSupport().firePropertyChange(PROPERTY_MIN_COLUMNS, + old, this.minColumns); + } + + public Integer getMaxColumns() + { + return maxColumns; + } + + public void setMaxColumns(Integer maxColumns) + { + Object old = this.maxColumns; + this.maxColumns = maxColumns; + getEventSupport().firePropertyChange(PROPERTY_MAX_COLUMNS, + old, this.maxColumns); + } + + public Integer getMinRows() + { + return minRows; + } + + public void setMinRows(Integer minRows) + { + Object old = this.minRows; + this.minRows = minRows; + getEventSupport().firePropertyChange(PROPERTY_MIN_ROWS, + old, this.minRows); + } + + public Integer getMaxRows() + { + return maxRows; + } + + public void setMaxRows(Integer maxRows) + { + Object old = this.maxRows; + this.maxRows = maxRows; + getEventSupport().firePropertyChange(PROPERTY_MAX_ROWS, + old, this.maxRows); + } + + public Double getWidthToHeightRatio() + { + return widthToHeightRatio; + } + + public void setWidthToHeightRatio(Double widthToHeightRatio) + { + Object old = this.widthToHeightRatio; + this.widthToHeightRatio = widthToHeightRatio; + getEventSupport().firePropertyChange(PROPERTY_WIDTH_TO_HEIGHT_RATIO, + old, this.widthToHeightRatio); + } + + public Integer getErrorCorrectionLevel() + { + return errorCorrectionLevel; + } + + public void setErrorCorrectionLevel(Integer errorCorrectionLevel) + { + Object old = this.errorCorrectionLevel; + this.errorCorrectionLevel = errorCorrectionLevel; + getEventSupport().firePropertyChange(PROPERTY_ERROR_CORRECTION_LEVEL, + old, this.errorCorrectionLevel); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/POSTNETComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/POSTNETComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/POSTNETComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/POSTNETComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,120 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class POSTNETComponent extends Barcode4jComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_SHORT_BAR_HEIGHT = "shortBarHeight"; + public static final String PROPERTY_BASELINE_POSITION = "baselinePosition"; + public static final String PROPERTY_CHECKSUM_MODE = "checksumMode"; + public static final String PROPERTY_DISPLAY_CHECKSUM = "displayChecksum"; + public static final String PROPERTY_INTERCHAR_GAP_WIDTH = "intercharGapWidth"; + + private Double shortBarHeight; + private String baselinePosition; + private String checksumMode; + private Boolean displayChecksum; + private Double intercharGapWidth; + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitPostnet(this); + } + + public String getBaselinePosition() + { + return baselinePosition; + } + + public void setBaselinePosition(String baselinePosition) + { + Object old = this.baselinePosition; + this.baselinePosition = baselinePosition; + getEventSupport().firePropertyChange(PROPERTY_BASELINE_POSITION, + old, this.baselinePosition); + } + + public String getChecksumMode() + { + return checksumMode; + } + + public void setChecksumMode(String checksumMode) + { + Object old = this.checksumMode; + this.checksumMode = checksumMode; + getEventSupport().firePropertyChange(PROPERTY_CHECKSUM_MODE, + old, this.checksumMode); + } + + public Boolean getDisplayChecksum() + { + return displayChecksum; + } + + public void setDisplayChecksum(Boolean displayChecksum) + { + Object old = this.displayChecksum; + this.displayChecksum = displayChecksum; + getEventSupport().firePropertyChange(PROPERTY_DISPLAY_CHECKSUM, + old, this.displayChecksum); + } + + public Double getIntercharGapWidth() + { + return intercharGapWidth; + } + + public void setIntercharGapWidth(Double intercharGapWidth) + { + Object old = this.intercharGapWidth; + this.intercharGapWidth = intercharGapWidth; + getEventSupport().firePropertyChange(PROPERTY_INTERCHAR_GAP_WIDTH, + old, this.intercharGapWidth); + } + + public Double getShortBarHeight() + { + return shortBarHeight; + } + + public void setShortBarHeight(Double shortBarHeight) + { + Object old = this.shortBarHeight; + this.shortBarHeight = shortBarHeight; + getEventSupport().firePropertyChange(PROPERTY_SHORT_BAR_HEIGHT, + old, this.shortBarHeight); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeBean.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeBean.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeBean.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeBean.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,56 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + + +/** + * This class is used to generate QRCode component barcode logic. + * + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class QRCodeBean +{ + private Integer margin; + private ErrorCorrectionLevelEnum errorCorrectionLevel; + + public QRCodeBean() { + } + + public Integer getMargin() { + return margin; + } + + public void setMargin(Integer margin) { + this.margin = margin; + } + + public ErrorCorrectionLevelEnum getErrorCorrectionLevel() { + return errorCorrectionLevel; + } + + public void setErrorCorrectionLevel(ErrorCorrectionLevelEnum errorCorrectionLevel) { + this.errorCorrectionLevel = errorCorrectionLevel; + } +} + diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,76 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +/** + * Contains the main settings for the QRCode component + * + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class QRCodeComponent extends BarcodeComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_MARGIN = "margin"; + public static final String PROPERTY_ERROR_CORRECTION_LEVEL = "errorCorrectionLevel"; + + public static final String PROPERTY_DEFAULT_ENCODING = "UTF-8"; + + private Integer margin; + private ErrorCorrectionLevelEnum errorCorrectionLevel; + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitQRCode(this); + } + + public Integer getMargin() + { + return margin; + } + + public void setMargin(Integer margin) + { + Object old = this.margin; + this.margin = margin; + getEventSupport().firePropertyChange(PROPERTY_MARGIN, old, this.margin); + } + + public ErrorCorrectionLevelEnum getErrorCorrectionLevel() + { + return errorCorrectionLevel == null ? ErrorCorrectionLevelEnum.L : errorCorrectionLevel; + } + + public void setErrorCorrectionLevel(ErrorCorrectionLevelEnum errorCorrectionLevel) + { + Object old = this.errorCorrectionLevel; + this.errorCorrectionLevel = errorCorrectionLevel; + getEventSupport().firePropertyChange(PROPERTY_ERROR_CORRECTION_LEVEL, + old, this.errorCorrectionLevel); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeImageProducer.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeImageProducer.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeImageProducer.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeImageProducer.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.renderers.Renderable; + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface QRCodeImageProducer +{ + + String PROPERTY_PREFIX_QRCODE_PRODUCER = + BarcodeComponent.PROPERTY_PREFIX + "qrcode.producer."; + + Renderable createImage( + JasperReportsContext jasperReportsContext, + JRComponentElement componentElement, + QRCodeBean qrCodeBean, + String message + ); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeRasterizedImageProducer.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeRasterizedImageProducer.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeRasterizedImageProducer.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeRasterizedImageProducer.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,118 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import java.awt.Color; +import java.awt.image.BufferedImage; +import java.util.HashMap; +import java.util.Map; + +import com.google.zxing.BarcodeFormat; +import com.google.zxing.EncodeHintType; +import com.google.zxing.WriterException; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.qrcode.QRCodeWriter; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.type.ImageTypeEnum; +import net.sf.jasperreports.engine.type.OnErrorTypeEnum; +import net.sf.jasperreports.engine.util.JRColorUtil; +import net.sf.jasperreports.renderers.Renderable; +import net.sf.jasperreports.renderers.util.RendererUtil; + + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class QRCodeRasterizedImageProducer implements QRCodeImageProducer +{ + + @Override + public Renderable createImage( + JasperReportsContext jasperReportsContext, + JRComponentElement componentElement, + QRCodeBean qrCodeBean, + String message + ) + { + QRCodeWriter writer = new QRCodeWriter(); + + Map hints = new HashMap(); + hints.put(EncodeHintType.CHARACTER_SET, QRCodeComponent.PROPERTY_DEFAULT_ENCODING); + hints.put(EncodeHintType.ERROR_CORRECTION, qrCodeBean.getErrorCorrectionLevel().getErrorCorrectionLevel()); + + int margin = qrCodeBean.getMargin() == null ? QRCodeSVGImageProducer.DEFAULT_MARGIN : qrCodeBean.getMargin(); + hints.put(EncodeHintType.MARGIN, margin); + + int resolution = JRPropertiesUtil.getInstance(jasperReportsContext).getIntegerProperty( + componentElement, BarcodeRasterizedImageProducer.PROPERTY_RESOLUTION, 300); + try + { + BitMatrix matrix = + writer.encode( + message, + BarcodeFormat.QR_CODE, +// (int)((72f / 2.54f) * componentElement.getWidth()), +// (int)((72f / 2.54f) * componentElement.getHeight()), + (int)((resolution / 72f) * componentElement.getWidth()), + (int)((resolution / 72f) * componentElement.getHeight()), + hints + ); + BufferedImage image = getImage(matrix, componentElement.getForecolor()); + return RendererUtil.getInstance(jasperReportsContext).getRenderable(image, ImageTypeEnum.PNG, OnErrorTypeEnum.ERROR); + } + catch (WriterException e) + { + throw new JRRuntimeException(e); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + public BufferedImage getImage(BitMatrix matrix, Color onColor) + { + int width = matrix.getWidth(); + int height = matrix.getHeight(); + BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); + int onArgb = JRColorUtil.getOpaqueArgb(onColor, Color.BLACK);//not actually opaque + for (int x = 0; x < width; x++) + { + for (int y = 0; y < height; y++) + { + if (matrix.get(x, y)) + { + image.setRGB(x, y, onArgb); + } + } + } + return image; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeSVGImageProducer.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeSVGImageProducer.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeSVGImageProducer.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/QRCodeSVGImageProducer.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,183 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import java.awt.Color; +import java.io.ByteArrayOutputStream; +import java.util.HashMap; +import java.util.Map; + +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.krysalis.barcode4j.output.BarcodeCanvasSetupException; +import org.krysalis.barcode4j.output.svg.SVGCanvasProvider; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import com.google.zxing.EncodeHintType; +import com.google.zxing.WriterException; +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; +import com.google.zxing.qrcode.encoder.ByteMatrix; +import com.google.zxing.qrcode.encoder.Encoder; +import com.google.zxing.qrcode.encoder.QRCode; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JRStyle; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.util.JRColorUtil; +import net.sf.jasperreports.renderers.Renderable; +import net.sf.jasperreports.renderers.SimpleRenderToImageAwareDataRenderer; + + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class QRCodeSVGImageProducer implements QRCodeImageProducer +{ + + public static final int DEFAULT_MARGIN = 4;//same as zxing's QRCodeWriter.QUIET_ZONE_SIZE + + @Override + public Renderable createImage( + JasperReportsContext jasperReportsContext, + JRComponentElement componentElement, + QRCodeBean qrCodeBean, + String message + ) + { + Map hints = new HashMap(); + hints.put(EncodeHintType.CHARACTER_SET, QRCodeComponent.PROPERTY_DEFAULT_ENCODING); + ErrorCorrectionLevel errorCorrectionLevel = qrCodeBean.getErrorCorrectionLevel().getErrorCorrectionLevel(); + hints.put(EncodeHintType.ERROR_CORRECTION, errorCorrectionLevel); + + ByteMatrix matrix = null; + SVGCanvasProvider provider = null; + try + { + QRCode qrCode = Encoder.encode(message, errorCorrectionLevel, hints); + matrix = qrCode.getMatrix(); + + provider = new SVGCanvasProvider(false, OrientationEnum.UP.getValue()); + } + catch (WriterException e) + { + throw new JRRuntimeException(e); + } + catch (BarcodeCanvasSetupException e) + { + throw new JRRuntimeException(e); + } + + Document svgDoc = provider.getDOM(); + Element svg = svgDoc.getDocumentElement(); + int codeWidth = matrix.getWidth(); + int codeHeight = matrix.getHeight(); + + JRStyle elementStyle = componentElement.getStyle(); + int elementWidth = componentElement.getWidth() - (elementStyle == null ? 0 + : (elementStyle.getLineBox().getLeftPadding() + elementStyle.getLineBox().getRightPadding())); + int elementHeight = componentElement.getHeight() - (elementStyle == null ? 0 + : (elementStyle.getLineBox().getTopPadding() + elementStyle.getLineBox().getBottomPadding())); + + int margin = qrCodeBean.getMargin() == null ? DEFAULT_MARGIN : qrCodeBean.getMargin(); + int matrixWidth = codeWidth + 2 * margin; + int matrixHeight = codeHeight + 2 * margin; + + // scaling to match the image size as closely as possible so that it looks good in html. + // the resolution is taken into account because the html exporter rasterizes to a png + // that has the same size as the svg. + int resolution = JRPropertiesUtil.getInstance(jasperReportsContext).getIntegerProperty( + componentElement, BarcodeRasterizedImageProducer.PROPERTY_RESOLUTION, 300); + int imageWidth = (int) Math.ceil(elementWidth * (resolution / 72d)); + int imageHeight = (int) Math.ceil(elementHeight * (resolution / 72d)); + + double horizontalScale = ((double) imageWidth) / matrixWidth; + double verticalScale = ((double) imageHeight) / matrixHeight; + + // we are scaling with integer units, not considering fractional coordinates for now + int scale = Math.max(1, (int) Math.min(Math.ceil(horizontalScale), Math.ceil(verticalScale))); + int qrWidth = scale * matrixWidth; + int qrHeight = scale * matrixHeight; + + // scaling again because of the integer units + double qrScale = Math.max(1d, Math.max(((double) qrWidth) / imageWidth, ((double) qrHeight) / imageHeight)); + int svgWidth = (int) Math.ceil(qrScale * imageWidth); + int svgHeight = (int) Math.ceil(qrScale * imageHeight); + svg.setAttribute("width", String.valueOf(svgWidth)); + svg.setAttribute("height",String.valueOf(svgHeight)); + svg.setAttribute("viewBox", "0 0 " + svgWidth + " " + svgHeight); + + int xOffset = Math.max(0, (svgWidth - qrWidth) / 2); + int yOffset = Math.max(0, (svgHeight - qrHeight) / 2); + + Color color = componentElement.getForecolor(); + String fill = "#" + JRColorUtil.getColorHexa(color); + String fillOpacity = color.getAlpha() < 255 ? Float.toString(((float) color.getAlpha()) / 255) : null; + String rectangleSize = Integer.toString(scale); + for (int x = 0; x < codeWidth; x++) { + for (int y = 0; y < codeHeight; y++) { + if (matrix.get(x,y) == 1) { + Element element = svgDoc.createElementNS(svg.getNamespaceURI(), "rect"); + element.setAttribute("x", String.valueOf(xOffset + scale * (x + margin))); + element.setAttribute("y", String.valueOf(yOffset + scale * (y + margin))); + element.setAttribute("width", rectangleSize); + element.setAttribute("height", rectangleSize); + element.setAttribute("fill", fill); + if (fillOpacity != null) { + element.setAttribute("fill-opacity", fillOpacity); + } + svgDoc.getFirstChild().appendChild(element); + } + } + } + + Source source = new DOMSource(svgDoc); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + Result output = new StreamResult(baos); + + try + { + Transformer transformer = TransformerFactory.newInstance() + .newTransformer(); + transformer.transform(source, output); + + } + catch (TransformerException e) + { + throw new JRRuntimeException(e); + } + + return SimpleRenderToImageAwareDataRenderer.getInstance(baos.toByteArray()); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/RoyalMailCustomerComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/RoyalMailCustomerComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/RoyalMailCustomerComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/RoyalMailCustomerComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class RoyalMailCustomerComponent extends FourStateBarcodeComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitRoyalMailCustomer(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/TextPositionEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/TextPositionEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/TextPositionEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/TextPositionEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public enum TextPositionEnum implements NamedEnum +{ + /** + * + */ + NONE("none"), + + /** + * + */ + BOTTOM("bottom"), + + /** + * + */ + TOP("top"); + + /** + * + */ + private final transient String name; + + private TextPositionEnum(String name) + { + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static TextPositionEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/UniformBarcodeVisitor.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/UniformBarcodeVisitor.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/UniformBarcodeVisitor.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/UniformBarcodeVisitor.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,128 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public abstract class UniformBarcodeVisitor implements BarcodeVisitor +{ + protected abstract void visitBarcode(BarcodeComponent barcode); + + protected abstract void visitBarcode(Barcode4jComponent barcode); + + @Override + public void visitCodabar(CodabarComponent codabar) + { + visitBarcode(codabar); + } + + @Override + public void visitCode128(Code128Component code128) + { + visitBarcode(code128); + } + + @Override + public void visitDataMatrix(DataMatrixComponent dataMatrix) + { + visitBarcode(dataMatrix); + } + + @Override + public void visitEANCode128(EAN128Component ean128) + { + visitBarcode(ean128); + } + + @Override + public void visitCode39(Code39Component code39) + { + visitBarcode(code39); + } + + @Override + public void visitUPCA(UPCAComponent upcA) + { + visitBarcode(upcA); + } + + @Override + public void visitUPCE(UPCEComponent upcE) + { + visitBarcode(upcE); + } + + @Override + public void visitEAN13(EAN13Component ean13) + { + visitBarcode(ean13); + } + + @Override + public void visitEAN8(EAN8Component ean8) + { + visitBarcode(ean8); + } + + @Override + public void visitInterleaved2Of5(Interleaved2Of5Component interleaved2Of5) + { + visitBarcode(interleaved2Of5); + } + + @Override + public void visitRoyalMailCustomer( + RoyalMailCustomerComponent royalMailCustomer) + { + visitBarcode(royalMailCustomer); + } + + @Override + public void visitUSPSIntelligentMail( + USPSIntelligentMailComponent intelligentMail) + { + visitBarcode(intelligentMail); + } + + @Override + public void visitPostnet(POSTNETComponent postnet) + { + visitBarcode(postnet); + } + + @Override + public void visitPDF417(PDF417Component pdf417) + { + visitBarcode(pdf417); + } + + @Override + public void visitQRCode(QRCodeComponent qrCode) + { + visitBarcode(qrCode); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/UPCAComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/UPCAComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/UPCAComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/UPCAComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +import org.krysalis.barcode4j.ChecksumMode; + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class UPCAComponent extends Barcode4jComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CHECKSUM_MODE = "checksumMode"; + + private String checksumMode; + + public String getChecksumMode() + { + return checksumMode; + } + + public void setChecksumMode(String checksumMode) + { + Object old = this.checksumMode; + this.checksumMode = checksumMode; + getEventSupport().firePropertyChange(PROPERTY_CHECKSUM_MODE, old, this.checksumMode); + } + + public void setChecksumMode(ChecksumMode checksumMode) + { + setChecksumMode(checksumMode == null ? null : checksumMode.getName()); + } + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitUPCA(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/UPCEComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/UPCEComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/UPCEComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/UPCEComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +import org.krysalis.barcode4j.ChecksumMode; + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class UPCEComponent extends Barcode4jComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_CHECKSUM_MODE = "checksumMode"; + + private String checksumMode; + + public String getChecksumMode() + { + return checksumMode; + } + + public void setChecksumMode(String checksumMode) + { + Object old = this.checksumMode; + this.checksumMode = checksumMode; + getEventSupport().firePropertyChange(PROPERTY_CHECKSUM_MODE, old, this.checksumMode); + } + + public void setChecksumMode(ChecksumMode checksumMode) + { + setChecksumMode(checksumMode == null ? null : checksumMode.getName()); + } + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitUPCE(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/USPSIntelligentMailComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/USPSIntelligentMailComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/barcode4j/USPSIntelligentMailComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/barcode4j/USPSIntelligentMailComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.barcode4j; + +import net.sf.jasperreports.engine.JRConstants; + +/** + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class USPSIntelligentMailComponent extends FourStateBarcodeComponent +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + @Override + public void receive(BarcodeVisitor visitor) + { + visitor.visitUSPSIntelligentMail(this); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/BaseElementHtmlHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/BaseElementHtmlHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/BaseElementHtmlHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/BaseElementHtmlHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components; + +import net.sf.jasperreports.engine.export.GenericElementHtmlHandler; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public abstract class BaseElementHtmlHandler implements GenericElementHtmlHandler { + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/AbstractChartCustomizer.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/AbstractChartCustomizer.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/AbstractChartCustomizer.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/AbstractChartCustomizer.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,191 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.charts; + +import net.sf.jasperreports.engine.fill.JRBaseFiller; +import net.sf.jasperreports.engine.fill.JRFillElementDataset; + +/** + * Abstract implementation of {@link net.sf.jasperreports.components.charts.ChartCustomizer ChartCustomizer} that provides + * access to parameter, variable and field values. + * + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public abstract class AbstractChartCustomizer implements ChartCustomizer +{ + private JRBaseFiller filler; + private JRFillElementDataset chartDataset; + + + /** + * Default constructor. + */ + protected AbstractChartCustomizer() + { + } + + + /** + * Initializes the chart customizer. + * + * @param chartFiller the filler instance + * @param dataset the fill dataset object + */ + public void init(JRBaseFiller chartFiller, JRFillElementDataset dataset) + { + this.filler = chartFiller; + this.chartDataset = dataset; + } + + + /** + * Returns the value of a report parameter. + * + * @param parameterName the parameter name + * @return the value of a report parameter + */ + protected final Object getParameterValue(String parameterName) + { + return getParameterValue(parameterName, false); + } + + + /** + * Returns the value of a report or input dataset parameter. + *

    + * The input dataset differs from the report dataset when the chart + * uses a sub dataset as input. + * + * @param parameterName the parameter name + * @param fromInputDataset whether the parameter belongs to the input dataset rather than the report. + *

    + * This is usefull only when the chart uses a sub dataset as input. + * + * @return the value of the parameter + */ + protected final Object getParameterValue(String parameterName, boolean fromInputDataset) + { + return (fromInputDataset ? chartDataset.getInputDataset() : filler.getMainDataset()).getParameterValue(parameterName); + } + + + /** + * Returns the value of a report variable. + * + * @param variableName the variable name + * @return the value of a report variable + */ + protected final Object getVariableValue(String variableName) + { + return getVariableValue(variableName, false); + } + + + /** + * Returns the value of a report or input dataset variable. + *

    + * The input dataset differs from the report dataset when the chart + * uses a sub dataset as input. + * + * @param variableName the variable name + * @param fromInputDataset whether the variable belongs to the input dataset rather than the report. + *

    + * This is usefull only when the chart uses a sub dataset as input. + * + * @return the value of the variable + */ + protected final Object getVariableValue(String variableName, boolean fromInputDataset) + { + return (fromInputDataset ? chartDataset.getInputDataset() : filler.getMainDataset()).getVariableValue(variableName); + } + + + /** + * Returns the value of a report field. + * + * @param fieldName the field name + * @return the value of a report field + */ + protected final Object getFieldValue(String fieldName) + { + return getFieldValue(fieldName, false); + } + + + /** + * Returns the value of a report or input dataset field. + *

    + * The input dataset differs from the report dataset when the chart + * uses a sub dataset as input. + * + * @param fieldName the field name + * @param fromInputDataset whether the field belongs to the input dataset rather than the report. + *

    + * This is usefull only when the chart uses a sub dataset as input. + * + * @return the value of the field + */ + protected final Object getFieldValue(String fieldName, boolean fromInputDataset) + { + return (fromInputDataset ? chartDataset.getInputDataset() : filler.getMainDataset()).getFieldValue(fieldName); + } + + + /** + * @return the filler + */ + public JRBaseFiller getFiller() + { + return this.filler; + } + + + /** + * @param filler the filler to set + */ + public void setFiller(JRBaseFiller filler) + { + this.filler = filler; + } + + + + /** + * @return the chartDataset + */ + public JRFillElementDataset getChartDataset() + { + return this.chartDataset; + } + + + /** + * @param chartDataset the chartDataset to set + */ + public void setChartDataset(JRFillElementDataset chartDataset) + { + this.chartDataset = chartDataset; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/ChartComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/ChartComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/ChartComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/ChartComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.charts; + +import java.io.Serializable; + +import net.sf.jasperreports.engine.component.ContextAwareComponent; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public interface ChartComponent extends ContextAwareComponent, Serializable +{ + public ChartSettings getChartSettings(); + + public ChartDataset getDataset(); + + public ChartPlot getPlot(); + + public EvaluationTimeEnum getEvaluationTime(); + + public String getEvaluationGroup(); +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/ChartCustomizer.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/ChartCustomizer.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/ChartCustomizer.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/ChartCustomizer.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,56 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/* + * Contributors: + * Michael McMahon - Michael.McMahon@activewire.net + */ + +package net.sf.jasperreports.components.charts; + +import org.jfree.chart.JFreeChart; + +/** + * This interface allows users to provide pluggable chart customizers. A class that implements this interface can + * be defined and its name must be specified in the report template. At fill time, the corresponding customize() + * method of this class will be called, if advanced chart customization is needed. + *

    + * If values of report parameters, variables or fields are needed in the customization, the customizer implementation + * should extend {@link net.sf.jasperreports.engine.JRAbstractChartCustomizer AbstractChartCustomizer} + * to gain access to such values. + * + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public interface ChartCustomizer { + + /** + * This method is called at fill time, before the chart is rendered. + * @param chart the JFreeChart object, which can be accessed and modified + * @param chartComponent the chart component, containing data that might be needed in + * customization + */ + public void customize(JFreeChart chart, ChartComponent chartComponent); + +} + diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/ChartDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/ChartDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/ChartDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/ChartDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,37 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.charts; + +import java.io.Serializable; + +import net.sf.jasperreports.engine.JRElementDataset; + +/** + * + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public interface ChartDataset extends JRElementDataset, Serializable +{ + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/ChartPlot.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/ChartPlot.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/ChartPlot.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/ChartPlot.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,86 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.charts; + +import java.awt.Color; +import java.io.Serializable; + +import net.sf.jasperreports.engine.JRCloneable; + +import org.jfree.chart.plot.PlotOrientation; + +/** + * + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public interface ChartPlot extends Serializable, JRCloneable +{ + /** + * Gets the chart background color. + */ + public Color getBackcolor(); + + /** + * Gets the plot orientation (horizontal or vertical). + */ + public PlotOrientation getOrientation(); + + /** + * Gets the transparency factor for this plot background. The range is from 0 to 1, where 0 means transparent and 1 + * opaque. The default is 1. + * @return a float value between 0 and 1. + */ + public Float getBackgroundAlpha(); + + /** + * Gets the transparency factor for this plot foreground. The range is from 0 to 1, where 0 means transparent and 1 + * opaque. The default is 1. + * @return a float value between 0 and 1. + */ + public Float getForegroundAlpha(); + +// /** +// * Returns a list of all the defined series colors. Every entry in the list is of type JRChartPlot.JRSeriesColor. +// * If there are no defined series colors this method will return an empty list, not null. +// */ +// public SortedSet getSeriesColors(); +// +// /** +// * Removes all defined series colors. +// */ +// public void clearSeriesColors(); +// +// /** +// * Adds the specified series color to the plot. +// */ +// public void addSeriesColor(JRChartPlot.JRSeriesColor seriesColor); +// +// /** +// * Set the list of series colors. +// * +// * @param colors the list of series colors ({@link JRSeriesColor} instances} +// */ +// public void setSeriesColors(Collection colors); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/ChartSettings.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/ChartSettings.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/ChartSettings.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/ChartSettings.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,126 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.charts; + +import java.awt.Color; +import java.io.Serializable; + +import net.sf.jasperreports.charts.type.EdgeEnum; +import net.sf.jasperreports.engine.JRAnchor; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.JRHyperlink; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public interface ChartSettings extends JRAnchor, JRHyperlink, Serializable +{ + + /** + * + */ + public Boolean getShowLegend(); + + /** + * + */ + public Color getBackcolor(); + + /** + * + */ + public JRFont getTitleFont(); + + /** + * + */ + public EdgeEnum getTitlePosition(); + + /** + * + */ + public Color getTitleColor(); + + /** + * + */ + public JRFont getSubtitleFont(); + + /** + * + */ + public Color getSubtitleColor(); + + /** + * + */ + public Color getLegendBackgroundColor(); + + /** + * + */ + public Color getLegendColor(); + + /** + * + */ + public JRFont getLegendFont(); + + /** + * + */ + public EdgeEnum getLegendPosition(); + + + /** + * + */ + public JRExpression getTitleExpression(); + + /** + * + */ + public JRExpression getSubtitleExpression(); + + /** + * + */ + public byte getChartType(); + + /** + * + */ + public String getRenderType(); + + /** + * Gets a user specified chart customizer class name. + * @see ChartCustomizer + */ + public String getCustomizerClass(); + + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/ChartSettingsXmlFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/ChartSettingsXmlFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/ChartSettingsXmlFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/ChartSettingsXmlFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,161 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.charts; + +import java.awt.Color; + +import net.sf.jasperreports.charts.type.EdgeEnum; +import net.sf.jasperreports.components.spiderchart.StandardChartSettings; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.util.JRColorUtil; +import net.sf.jasperreports.engine.xml.JRBaseFactory; +import net.sf.jasperreports.engine.xml.JRXmlConstants; + +import org.xml.sax.Attributes; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class ChartSettingsXmlFactory extends JRBaseFactory +{ + @Override + public Object createObject(Attributes atts) + { + StandardChartSettings chartSettings = new StandardChartSettings(); + + String isShowLegend = atts.getValue(JRXmlConstants.ATTRIBUTE_isShowLegend); + if (isShowLegend != null && isShowLegend.length() > 0) + { + chartSettings.setShowLegend(Boolean.valueOf(isShowLegend)); + } + + Color backcolor = JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_backcolor), null); + if (backcolor != null) + { + chartSettings.setBackcolor(backcolor); + } + + chartSettings.setLinkType(atts.getValue(JRXmlConstants.ATTRIBUTE_hyperlinkType)); + chartSettings.setLinkTarget(atts.getValue(JRXmlConstants.ATTRIBUTE_hyperlinkTarget)); + + String bookmarkLevelAttr = atts.getValue(JRXmlConstants.ATTRIBUTE_bookmarkLevel); + if (bookmarkLevelAttr != null) + { + chartSettings.setBookmarkLevel(Integer.parseInt(bookmarkLevelAttr)); + } + + chartSettings.setCustomizerClass(atts.getValue(JRXmlConstants.ATTRIBUTE_customizerClass)); + chartSettings.setRenderType(atts.getValue(JRXmlConstants.ATTRIBUTE_renderType)); + + return chartSettings; + } + + + /** + * + */ + public static class ChartTitleFactory extends JRBaseFactory + { + @Override + public Object createObject(Attributes atts) + { + StandardChartSettings chartSettings = (StandardChartSettings) digester.peek(); + + EdgeEnum position = EdgeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_position)); + if (position != null) + { + chartSettings.setTitlePosition(position); + } + + Color color = JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_color), Color.black); + if (color != null) + { + chartSettings.setTitleColor(color); + } + + return chartSettings; + } + } + + + /** + * + */ + public static class ChartSubtitleFactory extends JRBaseFactory + { + @Override + public Object createObject(Attributes atts) + { + StandardChartSettings chartSettings = (StandardChartSettings) digester.peek(); + + Color color = JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_color), Color.black); + if (color != null) + { + chartSettings.setSubtitleColor(color); + } + + return chartSettings; + } + } + + + /** + * + */ + public static class ChartLegendFactory extends JRBaseFactory + { + @Override + public Object createObject(Attributes atts) throws JRException + { + // Grab the chart from the object stack. + StandardChartSettings chartSettings = (StandardChartSettings)digester.peek(); + + // Set the text color + String attrValue = atts.getValue(JRXmlConstants.ATTRIBUTE_textColor); + if (attrValue != null && attrValue.length() > 0) + { + Color color = JRColorUtil.getColor(attrValue, null); + chartSettings.setLegendColor(color); + } + + // Set the background color + attrValue = atts.getValue(JRXmlConstants.ATTRIBUTE_backgroundColor); + if (attrValue != null && attrValue.length() > 0) + { + Color color = JRColorUtil.getColor(attrValue, null); + chartSettings.setLegendBackgroundColor(color); + } + + EdgeEnum position = EdgeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_position)); + if (position != null) + { + chartSettings.setLegendPosition(position); + } + + return chartSettings; + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/FillChartSettings.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/FillChartSettings.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/FillChartSettings.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/FillChartSettings.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,344 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.charts; + +import java.awt.Color; + +import net.sf.jasperreports.charts.type.EdgeEnum; +import net.sf.jasperreports.components.spiderchart.SpiderChartCompiler; +import net.sf.jasperreports.engine.JRChart; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRFont; +import net.sf.jasperreports.engine.JRHyperlinkParameter; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; +import net.sf.jasperreports.engine.type.HyperlinkTypeEnum; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class FillChartSettings implements ChartSettings +{ + + /** + * + */ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + /** + * + */ + protected ChartSettings parent; + + /** + * + */ + public FillChartSettings( + ChartSettings chartSettings, + JRFillObjectFactory factory + ) + { + factory.put(chartSettings, this); + parent = chartSettings; + } + + /** + * @see net.sf.jasperreports.engine.JRAnchor#getAnchorNameExpression() + */ + @Override + public JRExpression getAnchorNameExpression() { + return parent.getAnchorNameExpression(); + } + + /** + * @see net.sf.jasperreports.engine.JRAnchor#getBookmarkLevel() + */ + @Override + public int getBookmarkLevel() { + + return parent.getBookmarkLevel(); + } + + /** + * @see java.lang.Object#clone() + */ + @Override + public Object clone() { + + ChartSettings clone = null; + + try + { + clone = (ChartSettings)super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new JRRuntimeException(e); + } + return clone; + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getChartType() + */ + @Override + public byte getChartType() { + + return parent.getChartType(); + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getLegendBackgroundColor() + */ + @Override + public Color getLegendBackgroundColor() { + + return parent.getLegendBackgroundColor(); + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getLegendColor() + */ + @Override + public Color getLegendColor() { + + return parent.getLegendColor(); + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getLegendFont() + */ + @Override + public JRFont getLegendFont() { + + return parent.getLegendFont(); + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getLegendPosition() + */ + @Override + public EdgeEnum getLegendPosition() { + + return parent.getLegendPosition(); + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getRenderType() + */ + @Override + public String getRenderType() { + + return parent.getRenderType() == null ? JRChart.RENDER_TYPE_DRAW : parent.getRenderType(); + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getShowLegend() + */ + @Override + public Boolean getShowLegend() { + + return parent.getShowLegend(); + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getSubtitleColor() + */ + @Override + public Color getSubtitleColor() { + + return parent.getSubtitleColor(); + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getSubtitleExpression() + */ + @Override + public JRExpression getSubtitleExpression() { + + return parent.getSubtitleExpression(); + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getSubtitleFont() + */ + @Override + public JRFont getSubtitleFont() { + + return parent.getSubtitleFont(); + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getTitleColor() + */ + @Override + public Color getTitleColor() { + + return parent.getTitleColor(); + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getTitleExpression() + */ + @Override + public JRExpression getTitleExpression() { + + return parent.getTitleExpression(); + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getTitleFont() + */ + @Override + public JRFont getTitleFont() { + + return parent.getTitleFont(); + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getTitlePosition() + */ + @Override + public EdgeEnum getTitlePosition() { + + return parent.getTitlePosition(); + } + + /** + * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkAnchorExpression() + */ + @Override + public JRExpression getHyperlinkAnchorExpression() { + + return parent.getHyperlinkAnchorExpression(); + } + + /** + * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkPageExpression() + */ + @Override + public JRExpression getHyperlinkPageExpression() { + + return parent.getHyperlinkPageExpression(); + } + + /** + * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkParameters() + */ + @Override + public JRHyperlinkParameter[] getHyperlinkParameters() { + + return parent.getHyperlinkParameters(); + } + + /** + * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkReferenceExpression() + */ + @Override + public JRExpression getHyperlinkReferenceExpression() { + + return parent.getHyperlinkReferenceExpression(); + } + + /** + * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkWhenExpression() + */ + @Override + public JRExpression getHyperlinkWhenExpression() { + + return parent.getHyperlinkWhenExpression(); + } + + /** + * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkTarget() + */ + @Override + public byte getHyperlinkTarget() { + + return parent.getHyperlinkTarget(); + } + + /** + * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkTooltipExpression() + */ + @Override + public JRExpression getHyperlinkTooltipExpression() { + + return parent.getHyperlinkTooltipExpression(); + } + + /** + * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkTypeValue() + */ + @Override + public HyperlinkTypeEnum getHyperlinkTypeValue() { + + return parent.getHyperlinkTypeValue(); + } + + /** + * @see net.sf.jasperreports.engine.JRHyperlink#getLinkTarget() + */ + @Override + public String getLinkTarget() { + + return parent.getLinkTarget(); + } + + /** + * @see net.sf.jasperreports.engine.JRHyperlink#getLinkType() + */ + @Override + public String getLinkType() { + + return parent.getLinkType(); + } + + /** + * @see net.sf.jasperreports.components.charts.ChartSettings#getLegendColor() + */ + @Override + public Color getBackcolor() { + + return parent.getBackcolor(); + } + + @Override + public String getCustomizerClass() + { + return parent.getCustomizerClass(); + } + + /** + * + */ + public void collectExpressions(JRExpressionCollector collector) + { + SpiderChartCompiler.collectExpressions(this, collector); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/charts/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/charts/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,28 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** +* Contains interfaces and base classes for the built-in Spider Chart component. +*/ +package net.sf.jasperreports.components.charts; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/ComponentsExtensionsRegistryFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/ComponentsExtensionsRegistryFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/ComponentsExtensionsRegistryFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/ComponentsExtensionsRegistryFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,187 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; + +import net.sf.jasperreports.components.barbecue.BarbecueCompiler; +import net.sf.jasperreports.components.barbecue.BarbecueDesignConverter; +import net.sf.jasperreports.components.barbecue.BarbecueFillFactory; +import net.sf.jasperreports.components.barcode4j.BarcodeCompiler; +import net.sf.jasperreports.components.barcode4j.BarcodeDesignConverter; +import net.sf.jasperreports.components.barcode4j.BarcodeFillFactory; +import net.sf.jasperreports.components.iconlabel.IconLabelComponentCompiler; +import net.sf.jasperreports.components.iconlabel.IconLabelComponentDesignConverter; +import net.sf.jasperreports.components.iconlabel.IconLabelComponentFillFactory; +import net.sf.jasperreports.components.iconlabel.IconLabelComponentManager; +import net.sf.jasperreports.components.list.FillListFactory; +import net.sf.jasperreports.components.list.ListComponent; +import net.sf.jasperreports.components.list.ListComponentCompiler; +import net.sf.jasperreports.components.list.ListDesignConverter; +import net.sf.jasperreports.components.map.MapCompiler; +import net.sf.jasperreports.components.map.MapDesignConverter; +import net.sf.jasperreports.components.map.fill.MapFillFactory; +import net.sf.jasperreports.components.sort.SortComponentCompiler; +import net.sf.jasperreports.components.sort.SortComponentDesignConverter; +import net.sf.jasperreports.components.sort.SortComponentFillFactory; +import net.sf.jasperreports.components.spiderchart.SpiderChartCompiler; +import net.sf.jasperreports.components.spiderchart.SpiderChartDesignConverter; +import net.sf.jasperreports.components.spiderchart.SpiderChartFillFactory; +import net.sf.jasperreports.components.table.FillTableFactory; +import net.sf.jasperreports.components.table.TableCompiler; +import net.sf.jasperreports.components.table.TableDesignConverter; +import net.sf.jasperreports.engine.JRPropertiesMap; +import net.sf.jasperreports.engine.component.ComponentManager; +import net.sf.jasperreports.engine.component.ComponentsBundle; +import net.sf.jasperreports.engine.component.DefaultComponentXmlParser; +import net.sf.jasperreports.engine.component.DefaultComponentsBundle; +import net.sf.jasperreports.extensions.ExtensionsRegistry; +import net.sf.jasperreports.extensions.ExtensionsRegistryFactory; +import net.sf.jasperreports.extensions.ListExtensionsRegistry; + +/** + * Extension registry factory that includes built-in component element + * implementations. + * + *

    + * This registry factory is registered by default in JasperReports. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + * @see ListComponent + */ +public class ComponentsExtensionsRegistryFactory implements + ExtensionsRegistryFactory +{ + + public static final String NAMESPACE = + "http://jasperreports.sourceforge.net/jasperreports/components"; + public static final String XSD_LOCATION = + "http://jasperreports.sourceforge.net/xsd/components.xsd"; + public static final String XSD_RESOURCE = + "net/sf/jasperreports/components/components.xsd"; + + public static final String LIST_COMPONENT_NAME = "list"; + public static final String TABLE_COMPONENT_NAME = "table"; + public static final String BARBECUE_COMPONENT_NAME = "barbecue"; + public static final List BARCODE4J_COMPONENT_NAMES = Collections.unmodifiableList(Arrays.asList( + "Codabar", "Code128", "EAN128", "DataMatrix", "Code39", "Interleaved2Of5", + "UPCA", "UPCE", "EAN13", "EAN8", "USPSIntelligentMail", "RoyalMailCustomer", + "POSTNET", "PDF417", "QRCode")); + public static final String SPIDERCHART_COMPONENT_NAME = "spiderChart"; + public static final String MAP_COMPONENT_NAME = "map"; + public static final String SORT_COMPONENT_NAME = "sort"; + public static final String ICONLABEL_COMPONENT_NAME = "iconLabel"; + + private static final ExtensionsRegistry REGISTRY; + + static + { + final DefaultComponentsBundle bundle = new DefaultComponentsBundle(); + + DefaultComponentXmlParser parser = new DefaultComponentXmlParser(); + parser.setNamespace(NAMESPACE); + parser.setPublicSchemaLocation(XSD_LOCATION); + parser.setInternalSchemaResource(XSD_RESOURCE); + parser.setDigesterConfigurer(new ComponentsXmlDigesterConfigurer()); + bundle.setXmlParser(parser); + + HashMap componentManagers = new HashMap(); + + ComponentsManager listManager = new ComponentsManager(); + listManager.setDesignConverter(new ListDesignConverter()); + listManager.setComponentCompiler(new ListComponentCompiler()); + //listManager.setComponentXmlWriter(xmlHandler); + listManager.setComponentFillFactory(new FillListFactory()); + componentManagers.put(LIST_COMPONENT_NAME, listManager); + + ComponentsManager tableManager = new ComponentsManager(); + tableManager.setDesignConverter(new TableDesignConverter()); + tableManager.setComponentCompiler(new TableCompiler()); + //tableManager.setComponentXmlWriter(xmlHandler); + tableManager.setComponentFillFactory(new FillTableFactory()); + componentManagers.put(TABLE_COMPONENT_NAME, tableManager); + + ComponentsManager barbecueManager = new ComponentsManager(); + barbecueManager.setDesignConverter(new BarbecueDesignConverter()); + barbecueManager.setComponentCompiler(new BarbecueCompiler()); + //barbecueManager.setComponentXmlWriter(xmlHandler); + barbecueManager.setComponentFillFactory(new BarbecueFillFactory()); + componentManagers.put(BARBECUE_COMPONENT_NAME, barbecueManager); + + ComponentsManager barcode4jManager = new ComponentsManager(); + barcode4jManager.setDesignConverter(new BarcodeDesignConverter()); + barcode4jManager.setComponentCompiler(new BarcodeCompiler()); + //barcode4jManager.setComponentXmlWriter(xmlHandler); + barcode4jManager.setComponentFillFactory(new BarcodeFillFactory()); + for (String name : BARCODE4J_COMPONENT_NAMES) + { + componentManagers.put(name, barcode4jManager); + } + + ComponentsManager spiderChartManager = new ComponentsManager(); + spiderChartManager.setDesignConverter(new SpiderChartDesignConverter()); + spiderChartManager.setComponentCompiler(new SpiderChartCompiler()); + //spiderChartManager.setComponentXmlWriter(xmlHandler); + spiderChartManager.setComponentFillFactory(new SpiderChartFillFactory()); + componentManagers.put(SPIDERCHART_COMPONENT_NAME, spiderChartManager); + + ComponentsManager mapManager = new ComponentsManager(); + mapManager.setDesignConverter(MapDesignConverter.getInstance()); + mapManager.setComponentCompiler(new MapCompiler()); + //mapManager.setComponentXmlWriter(xmlHandler); + mapManager.setComponentFillFactory(new MapFillFactory()); + componentManagers.put(MAP_COMPONENT_NAME, mapManager); + + ComponentsManager sortManager = new ComponentsManager(); + sortManager.setDesignConverter(SortComponentDesignConverter.getInstance()); + sortManager.setComponentCompiler(new SortComponentCompiler()); + //sortManager.setComponentXmlWriter(xmlHandler); + sortManager.setComponentFillFactory(new SortComponentFillFactory()); + componentManagers.put(SORT_COMPONENT_NAME, sortManager); + + IconLabelComponentManager iconLabelManager = new IconLabelComponentManager(); + iconLabelManager.setDesignConverter(IconLabelComponentDesignConverter.getInstance()); + iconLabelManager.setComponentCompiler(new IconLabelComponentCompiler()); + iconLabelManager.setComponentFillFactory(new IconLabelComponentFillFactory()); + componentManagers.put(ICONLABEL_COMPONENT_NAME, iconLabelManager); + + bundle.setComponentManagers(componentManagers); + + ListExtensionsRegistry registry = new ListExtensionsRegistry(); + registry.add(ComponentsBundle.class, bundle); + + REGISTRY = registry; + } + + @Override + public ExtensionsRegistry createRegistry(String registryId, + JRPropertiesMap properties) + { + return REGISTRY; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/ComponentsManager.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/ComponentsManager.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/ComponentsManager.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/ComponentsManager.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components; + +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.component.ComponentXmlWriter; +import net.sf.jasperreports.engine.component.DefaultComponentManager; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class ComponentsManager extends DefaultComponentManager +{ + + @Override + public ComponentXmlWriter getComponentXmlWriter(JasperReportsContext jasperReportsContext) + { + return new ComponentsXmlWriter(jasperReportsContext); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/ComponentsXmlDigesterConfigurer.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/ComponentsXmlDigesterConfigurer.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/ComponentsXmlDigesterConfigurer.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/ComponentsXmlDigesterConfigurer.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,484 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components; + +import net.sf.jasperreports.components.barbecue.StandardBarbecueComponent; +import net.sf.jasperreports.components.barcode4j.CodabarComponent; +import net.sf.jasperreports.components.barcode4j.Code128Component; +import net.sf.jasperreports.components.barcode4j.Code39Component; +import net.sf.jasperreports.components.barcode4j.DataMatrixComponent; +import net.sf.jasperreports.components.barcode4j.EAN128Component; +import net.sf.jasperreports.components.barcode4j.EAN13Component; +import net.sf.jasperreports.components.barcode4j.EAN8Component; +import net.sf.jasperreports.components.barcode4j.ErrorCorrectionLevelEnum; +import net.sf.jasperreports.components.barcode4j.Interleaved2Of5Component; +import net.sf.jasperreports.components.barcode4j.OrientationEnum; +import net.sf.jasperreports.components.barcode4j.OrientationRule; +import net.sf.jasperreports.components.barcode4j.PDF417Component; +import net.sf.jasperreports.components.barcode4j.POSTNETComponent; +import net.sf.jasperreports.components.barcode4j.QRCodeComponent; +import net.sf.jasperreports.components.barcode4j.RoyalMailCustomerComponent; +import net.sf.jasperreports.components.barcode4j.TextPositionEnum; +import net.sf.jasperreports.components.barcode4j.UPCAComponent; +import net.sf.jasperreports.components.barcode4j.UPCEComponent; +import net.sf.jasperreports.components.barcode4j.USPSIntelligentMailComponent; +import net.sf.jasperreports.components.iconlabel.IconLabelComponentDigester; +import net.sf.jasperreports.components.items.Item; +import net.sf.jasperreports.components.items.ItemData; +import net.sf.jasperreports.components.items.ItemDataXmlFactory; +import net.sf.jasperreports.components.items.ItemDatasetFactory; +import net.sf.jasperreports.components.items.ItemProperty; +import net.sf.jasperreports.components.items.ItemPropertyXmlFactory; +import net.sf.jasperreports.components.items.ItemXmlFactory; +import net.sf.jasperreports.components.list.DesignListContents; +import net.sf.jasperreports.components.list.StandardListComponent; +import net.sf.jasperreports.components.map.MapXmlFactory; +import net.sf.jasperreports.components.sort.SortComponentDigester; +import net.sf.jasperreports.components.spiderchart.SpiderChartDigester; +import net.sf.jasperreports.components.table.DesignCell; +import net.sf.jasperreports.components.table.StandardColumn; +import net.sf.jasperreports.components.table.StandardColumnGroup; +import net.sf.jasperreports.components.table.StandardGroupCell; +import net.sf.jasperreports.components.table.StandardTableFactory; +import net.sf.jasperreports.components.table.TableReportContextXmlRule; +import net.sf.jasperreports.engine.JRElementDataset; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.component.XmlDigesterConfigurer; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; +import net.sf.jasperreports.engine.type.PrintOrderEnum; +import net.sf.jasperreports.engine.type.RotationEnum; +import net.sf.jasperreports.engine.xml.JRExpressionFactory; +import net.sf.jasperreports.engine.xml.JRXmlConstants; +import net.sf.jasperreports.engine.xml.JRXmlWriter; +import net.sf.jasperreports.engine.xml.StyleContainerRule; +import net.sf.jasperreports.engine.xml.UuidPropertyRule; +import net.sf.jasperreports.engine.xml.XmlConstantPropertyRule; + +import org.apache.commons.digester.Digester; + +/** + * XML digester for built-in component implementations. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + * @see ComponentsExtensionsRegistryFactory + */ +public class ComponentsXmlDigesterConfigurer implements XmlDigesterConfigurer +{ + + private static final String[] BARCODE4J_IGNORED_PROPERTIES = { + JRXmlConstants.ATTRIBUTE_evaluationTime, + "orientation", + "textPosition"}; + + private static final String[] QRCODE_IGNORED_PROPERTIES = { + JRXmlConstants.ATTRIBUTE_evaluationTime, + "errorCorrectionLevel"}; + + @Override + public void configureDigester(Digester digester) + { + addListRules(digester); + addBarbecueRules(digester); + addBarcode4jRules(digester); + addTableRules(digester); + SpiderChartDigester.addSpiderChartRules(digester); + addMapRules(digester); + SortComponentDigester.addSortComponentRules(digester); + IconLabelComponentDigester.addIconLabelComponentRules(digester); + } + + protected void addListRules(Digester digester) + { + String listPattern = "*/componentElement/list"; + digester.addObjectCreate(listPattern, StandardListComponent.class); + digester.addSetProperties(listPattern, + //properties to be ignored by this rule + new String[]{"printOrder"}, + new String[0]); + digester.addRule(listPattern, new XmlConstantPropertyRule( + "printOrder", "printOrderValue", PrintOrderEnum.values())); + + String listContentsPattern = listPattern + "/listContents"; + digester.addObjectCreate(listContentsPattern, DesignListContents.class); + digester.addSetProperties(listContentsPattern); + digester.addSetNext(listContentsPattern, "setContents"); + } + + @SuppressWarnings("deprecation") + protected void addBarbecueRules(Digester digester) + { + String barcodePattern = "*/componentElement/barbecue"; + digester.addObjectCreate(barcodePattern, StandardBarbecueComponent.class); + digester.addSetProperties(barcodePattern, + //properties to be ignored by this rule + new String[]{JRXmlConstants.ATTRIBUTE_evaluationTime, StandardBarbecueComponent.PROPERTY_ROTATION}, + new String[0]); + digester.addRule(barcodePattern, + new XmlConstantPropertyRule( + JRXmlConstants.ATTRIBUTE_evaluationTime, "evaluationTimeValue", + EvaluationTimeEnum.values())); + digester.addRule(barcodePattern, + new XmlConstantPropertyRule( + StandardBarbecueComponent.PROPERTY_ROTATION, + RotationEnum.values())); + + String barcodeExpressionPattern = barcodePattern + "/codeExpression"; + digester.addFactoryCreate(barcodeExpressionPattern, + JRExpressionFactory.StringExpressionFactory.class.getName()); + digester.addCallMethod(barcodeExpressionPattern, "setText", 0); + digester.addSetNext(barcodeExpressionPattern, "setCodeExpression", + JRExpression.class.getName()); + + String applicationIdentifierExpressionPattern = barcodePattern + + "/applicationIdentifierExpression"; + digester.addFactoryCreate(applicationIdentifierExpressionPattern, + JRExpressionFactory.StringExpressionFactory.class.getName()); + digester.addCallMethod(applicationIdentifierExpressionPattern, "setText", 0); + digester.addSetNext(applicationIdentifierExpressionPattern, + "setApplicationIdentifierExpression", + JRExpression.class.getName()); + } + + protected void addBarcode4jRules(Digester digester) + { + addBaseBarcode4jRules(digester, + "*/componentElement/Codabar", + CodabarComponent.class); + addBaseBarcode4jRules(digester, + "*/componentElement/Code128", + Code128Component.class); + addBaseBarcode4jRules(digester, + "*/componentElement/EAN128", + EAN128Component.class); + addTemplateRules(digester, + "*/componentElement/EAN128"); + addBaseBarcode4jRules(digester, + "*/componentElement/DataMatrix", + DataMatrixComponent.class); + addBaseBarcode4jRules(digester, + "*/componentElement/RoyalMailCustomer", + RoyalMailCustomerComponent.class); + addBaseBarcode4jRules(digester, + "*/componentElement/USPSIntelligentMail", + USPSIntelligentMailComponent.class); + addBaseBarcode4jRules(digester, + "*/componentElement/Code39", Code39Component.class); + addBaseBarcode4jRules(digester, + "*/componentElement/Interleaved2Of5", Interleaved2Of5Component.class); + addBaseBarcode4jRules(digester, + "*/componentElement/UPCA", UPCAComponent.class); + addBaseBarcode4jRules(digester, + "*/componentElement/UPCE", UPCEComponent.class); + addBaseBarcode4jRules(digester, + "*/componentElement/EAN13", EAN13Component.class); + addBaseBarcode4jRules(digester, + "*/componentElement/EAN8", EAN8Component.class); + addBaseBarcode4jRules(digester, + "*/componentElement/POSTNET", POSTNETComponent.class); + addBaseBarcode4jRules(digester, + "*/componentElement/PDF417", PDF417Component.class); + addQRCodeRules(digester, + "*/componentElement/QRCode", QRCodeComponent.class); + } + + protected void addBaseBarcode4jRules(Digester digester, + String barcodePattern, Class barcodeComponentClass) + { + addBarcodeRules(digester, barcodePattern, barcodeComponentClass, BARCODE4J_IGNORED_PROPERTIES); + addPatternExpressionRules(digester, barcodePattern); + + digester.addRule(barcodePattern, + new OrientationRule("orientation", "orientationValue")); + digester.addRule(barcodePattern, + new XmlConstantPropertyRule( + "textPosition", "textPositionValue", + TextPositionEnum.values())); + } + + @SuppressWarnings("deprecation") + protected void addPatternExpressionRules(Digester digester, String barcodePattern) + { + String patternExpressionPattern = barcodePattern + "/patternExpression"; + digester.addFactoryCreate(patternExpressionPattern, + JRExpressionFactory.StringExpressionFactory.class.getName()); + digester.addCallMethod(patternExpressionPattern, "setText", 0); + digester.addSetNext(patternExpressionPattern, "setPatternExpression", + JRExpression.class.getName()); + } + + @SuppressWarnings("deprecation") + protected void addBarcodeRules(Digester digester, + String barcodePattern, Class barcodeComponentClass, + String[] ignoredProperties) + { + digester.addObjectCreate(barcodePattern, barcodeComponentClass); + digester.addSetProperties(barcodePattern, + //properties to be ignored by this rule + ignoredProperties, + new String[0]); + //rule to set evaluation time + digester.addRule(barcodePattern, + new XmlConstantPropertyRule( + JRXmlConstants.ATTRIBUTE_evaluationTime, "evaluationTimeValue", + EvaluationTimeEnum.values())); + + String codeExpressionPattern = barcodePattern + "/codeExpression"; + digester.addFactoryCreate(codeExpressionPattern, + JRExpressionFactory.StringExpressionFactory.class.getName()); + digester.addCallMethod(codeExpressionPattern, "setText", 0); + digester.addSetNext(codeExpressionPattern, "setCodeExpression", + JRExpression.class.getName()); + } + + protected void addQRCodeRules(Digester digester, + String barcodePattern, Class barcodeComponentClass) + { + addBarcodeRules(digester, barcodePattern, barcodeComponentClass, QRCODE_IGNORED_PROPERTIES); + + digester.addRule(barcodePattern, + new XmlConstantPropertyRule( + "errorCorrectionLevel", "errorCorrectionLevel", + ErrorCorrectionLevelEnum.values())); + } + + @SuppressWarnings("deprecation") + protected void addTemplateRules(Digester digester, String barcodePattern) + { + String templateExpressionPattern = barcodePattern + "/templateExpression"; + digester.addFactoryCreate(templateExpressionPattern, + JRExpressionFactory.StringExpressionFactory.class.getName()); + digester.addCallMethod(templateExpressionPattern, "setText", 0); + digester.addSetNext(templateExpressionPattern, "setTemplateExpression", + JRExpression.class.getName()); + } + + @SuppressWarnings("deprecation") + protected void addMapRules(Digester digester) + { + String mapPattern = "*/componentElement/map"; + digester.addFactoryCreate(mapPattern, MapXmlFactory.class); + + String latitudeExpressionPattern = mapPattern + "/latitudeExpression"; + digester.addFactoryCreate(latitudeExpressionPattern, + JRExpressionFactory.class.getName()); + digester.addCallMethod(latitudeExpressionPattern, "setText", 0); + digester.addSetNext(latitudeExpressionPattern, "setLatitudeExpression", + JRExpression.class.getName()); + + String longitudeExpressionPattern = mapPattern + "/longitudeExpression"; + digester.addFactoryCreate(longitudeExpressionPattern, + JRExpressionFactory.class.getName()); + digester.addCallMethod(longitudeExpressionPattern, "setText", 0); + digester.addSetNext(longitudeExpressionPattern, "setLongitudeExpression", + JRExpression.class.getName()); + + String addressExpressionPattern = mapPattern + "/addressExpression"; + digester.addFactoryCreate(addressExpressionPattern, + JRExpressionFactory.class.getName()); + digester.addCallMethod(addressExpressionPattern, "setText", 0); + digester.addSetNext(addressExpressionPattern, "setAddressExpression", + JRExpression.class.getName()); + + String zoomExpressionPattern = mapPattern + "/zoomExpression"; + digester.addFactoryCreate(zoomExpressionPattern, + JRExpressionFactory.class.getName()); + digester.addCallMethod(zoomExpressionPattern, "setText", 0); + digester.addSetNext(zoomExpressionPattern, "setZoomExpression", + JRExpression.class.getName()); + + String languageExpressionPattern = mapPattern + "/languageExpression"; + digester.addFactoryCreate(languageExpressionPattern, + JRExpressionFactory.class.getName()); + digester.addCallMethod(languageExpressionPattern, "setText", 0); + digester.addSetNext(languageExpressionPattern, "setLanguageExpression", + JRExpression.class.getName()); + + String componentNamespace = digester.getRuleNamespaceURI(); + String jrNamespace = JRXmlConstants.JASPERREPORTS_NAMESPACE; + + String markerDatasetPattern = mapPattern + "/markerDataset"; + digester.addFactoryCreate(markerDatasetPattern, net.sf.jasperreports.components.map.MarkerDatasetXmlFactory.class.getName()); + digester.addSetNext(markerDatasetPattern, "setMarkerDataset", net.sf.jasperreports.components.map.MarkerDataset.class.getName()); + + String markerPattern = markerDatasetPattern + "/marker"; + digester.addFactoryCreate(markerPattern, net.sf.jasperreports.components.map.MarkerXmlFactory.class.getName()); + digester.addSetNext(markerPattern, "addMarker", net.sf.jasperreports.components.map.Marker.class.getName()); + + String markerPropertyPattern = markerPattern + "/markerProperty"; + digester.addFactoryCreate(markerPropertyPattern, net.sf.jasperreports.components.map.MarkerPropertyXmlFactory.class.getName()); + digester.addSetNext(markerPropertyPattern, "addMarkerProperty", net.sf.jasperreports.components.map.MarkerProperty.class.getName()); + + digester.setRuleNamespaceURI(jrNamespace); + + String markerPropertyValueExpressionPattern = markerPropertyPattern + "/" + JRXmlConstants.ELEMENT_valueExpression; + digester.addFactoryCreate(markerPropertyValueExpressionPattern, JRExpressionFactory.class.getName()); + digester.addCallMethod(markerPropertyValueExpressionPattern, "setText", 0); + digester.addSetNext(markerPropertyValueExpressionPattern, "setValueExpression", JRExpression.class.getName()); + + digester.setRuleNamespaceURI(componentNamespace); + + String markerDataPattern = mapPattern + "/markerData"; + digester.addFactoryCreate(markerDataPattern, ItemDataXmlFactory.class.getName()); + digester.addSetNext(markerDataPattern, "addMarkerData", ItemData.class.getName()); + + addItemRules(digester, markerDataPattern + "/item", jrNamespace); + + digester.setRuleNamespaceURI(jrNamespace); + digester.addFactoryCreate(markerDataPattern + "/dataset", ItemDatasetFactory.class.getName()); + digester.addSetNext(markerDataPattern + "/dataset", "setDataset", JRElementDataset.class.getName()); + + digester.setRuleNamespaceURI(componentNamespace); + + String pathStylePattern = mapPattern + "/pathStyle"; + digester.addFactoryCreate(pathStylePattern, ItemDataXmlFactory.class.getName()); + digester.addSetNext(pathStylePattern, "addPathStyle", ItemData.class.getName()); + + addItemRules(digester, pathStylePattern + "/item", jrNamespace); + + digester.setRuleNamespaceURI(jrNamespace); + digester.addFactoryCreate(pathStylePattern + "/dataset", ItemDatasetFactory.class.getName()); + digester.addSetNext(pathStylePattern + "/dataset", "setDataset", JRElementDataset.class.getName()); + + digester.setRuleNamespaceURI(componentNamespace); + + String pathDataPattern = mapPattern + "/pathData"; + digester.addFactoryCreate(pathDataPattern, ItemDataXmlFactory.class.getName()); + digester.addSetNext(pathDataPattern, "addPathData", ItemData.class.getName()); + + addItemRules(digester, pathDataPattern + "/item", jrNamespace); + + digester.setRuleNamespaceURI(jrNamespace); + digester.addFactoryCreate(pathDataPattern + "/dataset", ItemDatasetFactory.class.getName()); + digester.addSetNext(pathDataPattern + "/dataset", "setDataset", JRElementDataset.class.getName()); + + digester.setRuleNamespaceURI(componentNamespace); + + } + + protected void addItemRules(Digester digester, String itemPattern, String namespace) + { + digester.addFactoryCreate(itemPattern, ItemXmlFactory.class.getName()); + digester.addSetNext(itemPattern, "addItem", Item.class.getName()); + + String locationItemPropertyPattern = itemPattern + "/itemProperty"; + digester.addFactoryCreate(locationItemPropertyPattern, ItemPropertyXmlFactory.class.getName()); + digester.addSetNext(locationItemPropertyPattern, "addItemProperty", ItemProperty.class.getName()); + + digester.setRuleNamespaceURI(namespace); + + String locationItemPropertyValueExpressionPattern = locationItemPropertyPattern + "/" + JRXmlConstants.ELEMENT_valueExpression; + digester.addFactoryCreate(locationItemPropertyValueExpressionPattern, JRExpressionFactory.class.getName()); + digester.addCallMethod(locationItemPropertyValueExpressionPattern, "setText", 0); + digester.addSetNext(locationItemPropertyValueExpressionPattern, "setValueExpression", JRExpression.class.getName()); + } + + + @SuppressWarnings("deprecation") + protected void addTableRules(Digester digester) + { + String tablePattern = "*/componentElement/table"; + //digester.addObjectCreate(tablePattern, StandardTable.class); + digester.addFactoryCreate(tablePattern, StandardTableFactory.class.getName()); + + String columnPattern = "*/column"; + digester.addObjectCreate(columnPattern, StandardColumn.class); + digester.addSetNext(columnPattern, "addColumn"); + digester.addSetProperties(columnPattern, + //properties to be ignored by this rule + new String[]{"uuid"}, + new String[0]); + digester.addRule(columnPattern, new UuidPropertyRule("uuid", "UUID")); + addExpressionRules(digester, columnPattern + "/printWhenExpression", + JRExpressionFactory.BooleanExpressionFactory.class, "setPrintWhenExpression", + true); + addTableCellRules(digester, columnPattern + "/tableHeader", "setTableHeader"); + addTableCellRules(digester, columnPattern + "/tableFooter", "setTableFooter"); + addTableGroupCellRules(digester, columnPattern + "/groupHeader", "addGroupHeader"); + addTableGroupCellRules(digester, columnPattern + "/groupFooter", "addGroupFooter"); + addTableCellRules(digester, columnPattern + "/columnHeader", "setColumnHeader"); + addTableCellRules(digester, columnPattern + "/columnFooter", "setColumnFooter"); + addTableCellRules(digester, columnPattern + "/detailCell", "setDetailCell"); + + String columnGroupPattern = "*/columnGroup"; + digester.addObjectCreate(columnGroupPattern, StandardColumnGroup.class); + digester.addSetNext(columnGroupPattern, "addColumn"); + digester.addSetProperties(columnGroupPattern, + //properties to be ignored by this rule + new String[]{"uuid"}, + new String[0]); + digester.addRule(columnGroupPattern, new UuidPropertyRule("uuid", "UUID")); + addExpressionRules(digester, columnGroupPattern + "/printWhenExpression", + JRExpressionFactory.BooleanExpressionFactory.class, "setPrintWhenExpression", + true); + addTableCellRules(digester, columnGroupPattern + "/tableHeader", "setTableHeader"); + addTableCellRules(digester, columnGroupPattern + "/tableFooter", "setTableFooter"); + addTableGroupCellRules(digester, columnGroupPattern + "/groupHeader", "addGroupHeader"); + addTableGroupCellRules(digester, columnGroupPattern + "/groupFooter", "addGroupFooter"); + addTableCellRules(digester, columnGroupPattern + "/columnHeader", "setColumnHeader"); + addTableCellRules(digester, columnGroupPattern + "/columnFooter", "setColumnFooter"); + } + + protected void addTableCellRules(Digester digester, String pattern, + String setNextMethod) + { + digester.addObjectCreate(pattern, DesignCell.class); + digester.addSetNext(pattern, setNextMethod); + // rule to set the context dataset name + digester.addRule(pattern, new TableReportContextXmlRule()); + + digester.addSetProperties(pattern, + new String[]{JRXmlConstants.ATTRIBUTE_style}, + new String[0]); + digester.addRule(pattern, new StyleContainerRule()); + } + + protected void addTableGroupCellRules(Digester digester, String pattern, + String setNextMethod) + { + digester.addObjectCreate(pattern, StandardGroupCell.class); + digester.addSetProperties(pattern); + addTableCellRules(digester, pattern + "/cell", "setCell"); + digester.addSetNext(pattern, setNextMethod); + } + + protected void addExpressionRules(Digester digester, String expressionPattern, + Class factoryClass, String setterMethod, boolean jrNamespace) + { + String originalNamespace = digester.getRuleNamespaceURI(); + if (jrNamespace) + { + digester.setRuleNamespaceURI(JRXmlWriter.JASPERREPORTS_NAMESPACE.getNamespaceURI()); + } + + digester.addFactoryCreate(expressionPattern, factoryClass); + digester.addCallMethod(expressionPattern, "setText", 0); + digester.addSetNext(expressionPattern, setterMethod, + JRExpression.class.getName()); + + if (jrNamespace) + { + digester.setRuleNamespaceURI(originalNamespace); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/ComponentsXmlWriter.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/ComponentsXmlWriter.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/ComponentsXmlWriter.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/ComponentsXmlWriter.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,601 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components; + +import java.io.IOException; +import java.util.List; + +import net.sf.jasperreports.components.barbecue.BarbecueComponent; +import net.sf.jasperreports.components.barcode4j.BarcodeComponent; +import net.sf.jasperreports.components.barcode4j.BarcodeXmlWriter; +import net.sf.jasperreports.components.items.Item; +import net.sf.jasperreports.components.items.ItemData; +import net.sf.jasperreports.components.items.ItemProperty; +import net.sf.jasperreports.components.list.ListComponent; +import net.sf.jasperreports.components.list.ListContents; +import net.sf.jasperreports.components.map.MapComponent; +import net.sf.jasperreports.components.map.MapXmlFactory; +import net.sf.jasperreports.components.map.type.MapImageTypeEnum; +import net.sf.jasperreports.components.map.type.MapScaleEnum; +import net.sf.jasperreports.components.map.type.MapTypeEnum; +import net.sf.jasperreports.components.sort.SortComponent; +import net.sf.jasperreports.components.sort.SortComponentXmlWriter; +import net.sf.jasperreports.components.spiderchart.SpiderChartComponent; +import net.sf.jasperreports.components.spiderchart.SpiderChartXmlWriter; +import net.sf.jasperreports.components.table.BaseColumn; +import net.sf.jasperreports.components.table.Cell; +import net.sf.jasperreports.components.table.Column; +import net.sf.jasperreports.components.table.ColumnGroup; +import net.sf.jasperreports.components.table.ColumnVisitor; +import net.sf.jasperreports.components.table.GroupCell; +import net.sf.jasperreports.components.table.TableComponent; +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRDatasetRun; +import net.sf.jasperreports.engine.JRElementDataset; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.component.ComponentKey; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; +import net.sf.jasperreports.engine.type.OnErrorTypeEnum; +import net.sf.jasperreports.engine.util.JRXmlWriteHelper; +import net.sf.jasperreports.engine.util.XmlNamespace; +import net.sf.jasperreports.engine.xml.JRXmlConstants; +import net.sf.jasperreports.engine.xml.JRXmlWriter; + +/** + * XML writer for built-in component implementations. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + * @see ComponentsExtensionsRegistryFactory + */ +public class ComponentsXmlWriter extends AbstractComponentXmlWriter +{ + /** + * + */ + public ComponentsXmlWriter(JasperReportsContext jasperReportsContext) + { + super(jasperReportsContext); + } + + @Override + public void writeToXml(JRComponentElement componentElement, JRXmlWriter reportWriter) throws IOException + { + Component component = componentElement.getComponent(); + if (component instanceof ListComponent) + { + writeList(componentElement, reportWriter); + } + else if (component instanceof TableComponent) + { + writeTable(componentElement, reportWriter); + } + else if (component instanceof BarbecueComponent) + { + writeBarbecue(componentElement, reportWriter); + } + else if (component instanceof BarcodeComponent) + { + BarcodeXmlWriter barcodeWriter = new BarcodeXmlWriter( + reportWriter, + componentElement, + getVersion(jasperReportsContext, componentElement, reportWriter), + versionComparator); + barcodeWriter.writeBarcode(); + } + else if (component instanceof SpiderChartComponent) + { + SpiderChartXmlWriter spiderChartWriter = new SpiderChartXmlWriter( + jasperReportsContext, + getVersion(jasperReportsContext, componentElement, reportWriter), + versionComparator); + spiderChartWriter.writeToXml(componentElement, reportWriter); + } + else if (component instanceof SortComponent) + { + SortComponentXmlWriter sortWriter = new SortComponentXmlWriter(jasperReportsContext); + sortWriter.writeToXml(componentElement, reportWriter); + } + else if (component instanceof MapComponent) + { + writeMap(componentElement, reportWriter); + } + + } + + protected void writeList(JRComponentElement componentElement, JRXmlWriter reportWriter) throws IOException + { + ListComponent list = (ListComponent) componentElement.getComponent(); + ComponentKey componentKey = componentElement.getComponentKey(); + JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); + + XmlNamespace namespace = new XmlNamespace( + ComponentsExtensionsRegistryFactory.NAMESPACE, + componentKey.getNamespacePrefix(), + ComponentsExtensionsRegistryFactory.XSD_LOCATION); + + writer.startElement("list", namespace); + if(isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_3_6_1)) + { + writer.addAttribute("printOrder", list.getPrintOrderValue()); + } + writer.addAttribute("ignoreWidth", list.getIgnoreWidth()); + reportWriter.writeDatasetRun(list.getDatasetRun()); + + ListContents contents = list.getContents(); + writer.startElement("listContents"); + writer.addAttribute("height", contents.getHeight()); + writer.addAttribute("width", contents.getWidth()); + reportWriter.writeChildElements(contents); + writer.closeElement(); + + writer.closeElement(); + } + + protected void writeBarbecue(JRComponentElement componentElement, JRXmlWriter reportWriter) throws IOException + { + Component component = componentElement.getComponent(); + BarbecueComponent barcode = (BarbecueComponent) component; + JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); + ComponentKey componentKey = componentElement.getComponentKey(); + + XmlNamespace namespace = new XmlNamespace( + ComponentsExtensionsRegistryFactory.NAMESPACE, + componentKey.getNamespacePrefix(), + ComponentsExtensionsRegistryFactory.XSD_LOCATION); + + writer.startElement("barbecue", namespace); + + writer.addAttribute("type", barcode.getType()); + writer.addAttribute("drawText", barcode.isDrawText()); + writer.addAttribute("checksumRequired", barcode.isChecksumRequired()); + writer.addAttribute("barWidth", barcode.getBarWidth()); + writer.addAttribute("barHeight", barcode.getBarHeight()); + if (isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_4_0_0)) + { + writer.addAttribute("rotation", barcode.getOwnRotation()); + } + if (barcode.getEvaluationTimeValue() != EvaluationTimeEnum.NOW) + { + writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationTime, + barcode.getEvaluationTimeValue()); + } + writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationGroup, + barcode.getEvaluationGroup()); + + writeExpression("codeExpression", barcode.getCodeExpression(), false, componentElement, reportWriter); + writeExpression("applicationIdentifierExpression", barcode.getApplicationIdentifierExpression(), false, componentElement, reportWriter); + + writer.closeElement(); + } + + protected void writeMap(JRComponentElement componentElement, JRXmlWriter reportWriter) throws IOException + { + Component component = componentElement.getComponent(); + MapComponent map = (MapComponent) component; + JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); + ComponentKey componentKey = componentElement.getComponentKey(); + + XmlNamespace namespace = new XmlNamespace( + ComponentsExtensionsRegistryFactory.NAMESPACE, + componentKey.getNamespacePrefix(), + ComponentsExtensionsRegistryFactory.XSD_LOCATION); + + writer.startElement("map", namespace); + + if (map.getEvaluationTime() != EvaluationTimeEnum.NOW) + { + writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationTime, + map.getEvaluationTime()); + } + writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationGroup, + map.getEvaluationGroup()); + + if(isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_4_8_0)) + { + writer.addAttribute(MapXmlFactory.ATTRIBUTE_mapType, map.getMapType(), MapTypeEnum.ROADMAP); + writer.addAttribute(MapXmlFactory.ATTRIBUTE_mapScale, map.getMapScale(), MapScaleEnum.ONE); + writer.addAttribute(MapXmlFactory.ATTRIBUTE_imageType, map.getImageType(), MapImageTypeEnum.PNG); + if(isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_5_5_0)) + { + writer.addAttribute(MapXmlFactory.ATTRIBUTE_onErrorType, map.getOnErrorType(), OnErrorTypeEnum.ERROR); + } + } + + writer.writeExpression("latitudeExpression", + map.getLatitudeExpression()); + writer.writeExpression("longitudeExpression", + map.getLongitudeExpression()); + if(isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_5_5_2)) + { + writer.writeExpression("addressExpression", map.getAddressExpression()); + } + writer.writeExpression("zoomExpression", + map.getZoomExpression()); + if(isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_4_8_0)) + { + writer.writeExpression("languageExpression", + map.getLanguageExpression()); + } + if(isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_5_5_2)) { + List markerDataList = map.getMarkerDataList(); + if(markerDataList !=null && markerDataList.size() > 0) { + for(ItemData markerData : markerDataList) { + writeItemData(MapXmlFactory.ELEMENT_markerData, markerData, writer, reportWriter, namespace, componentElement); + } + } + } else if(isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_5_0_4)) { + @SuppressWarnings("deprecation") + ItemData itemData = map.getMarkerData(); + writeItemData(MapXmlFactory.ELEMENT_markerData, itemData, writer, reportWriter, namespace, componentElement); + } else if(isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_4_8_0)) { + + @SuppressWarnings("deprecation") + net.sf.jasperreports.components.map.MarkerDataset dataset = map.getMarkerDataset(); + writeMarkerDataset(dataset, writer, reportWriter, namespace, componentElement); + } + + if(isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_5_5_0)) + { + List pathStyleList = map.getPathStyleList(); + if(pathStyleList !=null && pathStyleList.size() > 0) { + for(ItemData pathStyle : pathStyleList) { + writeItemData(MapXmlFactory.ELEMENT_pathStyle, pathStyle, writer, reportWriter, namespace, componentElement); + } + } + + List pathDataList = map.getPathDataList(); + if(pathDataList !=null && pathDataList.size() > 0) { + for(ItemData pathData : pathDataList) { + writeItemData(MapXmlFactory.ELEMENT_pathData, pathData, writer, reportWriter, namespace, componentElement); + } + } + } + + writer.closeElement(); + } + + private void writeItemData(String name, ItemData itemData, JRXmlWriteHelper writer, JRXmlWriter reportWriter, XmlNamespace namespace, JRComponentElement componentElement) throws IOException + { + if (itemData != null) + { + writeItemDataContent(name, itemData, writer, reportWriter, namespace, componentElement); + writer.closeElement(); + } + } + + private void writeItemDataContent(String name, ItemData itemData, JRXmlWriteHelper writer, JRXmlWriter reportWriter, XmlNamespace namespace, JRComponentElement componentElement) throws IOException + { + writer.startElement(name, namespace); + + JRElementDataset dataset = itemData.getDataset(); + if (dataset != null) + { + reportWriter.writeElementDataset(dataset, false); + } + + /* */ + List itemList = itemData.getItems(); + if (itemList != null && !itemList.isEmpty()) + { + for(Item item : itemList) + { + if(item.getProperties() != null && !item.getProperties().isEmpty()) + { + writeItem(item, writer, reportWriter, namespace, componentElement); + } + } + } + } + + private void writeItem(Item item, JRXmlWriteHelper writer, JRXmlWriter reportWriter, XmlNamespace namespace, JRComponentElement componentElement) throws IOException + { + writer.startElement(MapXmlFactory.ELEMENT_item, namespace); + List itemProperties = item.getProperties(); + for(ItemProperty property : itemProperties) + { + writeItemProperty(property, writer, reportWriter, namespace, componentElement); + } + writer.closeElement(); + } + + private void writeItemProperty(ItemProperty itemProperty, JRXmlWriteHelper writer, JRXmlWriter reportWriter, XmlNamespace namespace, JRComponentElement componentElement) throws IOException + { + writer.startElement(MapXmlFactory.ELEMENT_itemProperty, namespace); + writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, itemProperty.getName()); + if(itemProperty.getValue() != null) + { + writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_value, itemProperty.getValue()); + } + writeExpression(JRXmlConstants.ELEMENT_valueExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, itemProperty.getValueExpression(), false, componentElement, reportWriter); + writer.closeElement(); + } + + /** + * @deprecated To be removed. + */ + private void writeMarkerDataset(net.sf.jasperreports.components.map.MarkerDataset dataset, JRXmlWriteHelper writer, JRXmlWriter reportWriter, XmlNamespace namespace, JRComponentElement componentElement) throws IOException + { + if (dataset != null) + { + writer.startElement(MapXmlFactory.ELEMENT_markerDataset, namespace); + + JRDatasetRun datasetRun = dataset.getDatasetRun(); + if (datasetRun != null) + { + reportWriter.writeDatasetRun(datasetRun); + } + + /* */ + List markerList = dataset.getMarkers(); + if (markerList != null && !markerList.isEmpty()) + { + for(net.sf.jasperreports.components.map.Marker marker : markerList) + { + if(marker.getProperties() != null && !marker.getProperties().isEmpty()) + { + writeMarker(marker, writer, reportWriter, namespace, componentElement); + } + } + } + + writer.closeElement(); + } + } + + /** + * @deprecated To be removed. + */ + private void writeMarker( + net.sf.jasperreports.components.map.Marker marker, + JRXmlWriteHelper writer, + JRXmlWriter reportWriter, + XmlNamespace namespace, + JRComponentElement componentElement + ) throws IOException + { + writer.startElement(MapXmlFactory.ELEMENT_marker, namespace); + List markerProperties = marker.getProperties(); + for(net.sf.jasperreports.components.map.MarkerProperty property : markerProperties) + { + writeMarkerProperty(property, writer, reportWriter, namespace, componentElement); + } + writer.closeElement(); + } + + /** + * @deprecated To be removed. + */ + private void writeMarkerProperty( + net.sf.jasperreports.components.map.MarkerProperty markerProperty, + JRXmlWriteHelper writer, + JRXmlWriter reportWriter, + XmlNamespace namespace, + JRComponentElement componentElement + ) throws IOException + { + writer.startElement(MapXmlFactory.ELEMENT_markerProperty, namespace); + writer.addAttribute(JRXmlConstants.ATTRIBUTE_name, markerProperty.getName()); + if(markerProperty.getValue() != null) + { + writer.addAttribute(JRXmlConstants.ATTRIBUTE_value, markerProperty.getValue()); + } + writeExpression(JRXmlConstants.ELEMENT_valueExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, markerProperty.getValueExpression(), false, componentElement, reportWriter); + writer.closeElement(); + } + + + protected void writeTable(final JRComponentElement componentElement, final JRXmlWriter reportWriter) throws IOException + { + Component component = componentElement.getComponent(); + TableComponent table = (TableComponent) component; + final JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); + ComponentKey componentKey = componentElement.getComponentKey(); + + XmlNamespace namespace = new XmlNamespace( + ComponentsExtensionsRegistryFactory.NAMESPACE, + componentKey.getNamespacePrefix(), + ComponentsExtensionsRegistryFactory.XSD_LOCATION); + + writer.startElement("table", namespace); + if (isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_4_1_1)) + { + writer.addAttribute(JRXmlConstants.ATTRIBUTE_whenNoDataType, table.getWhenNoDataType()); + } + reportWriter.writeDatasetRun(table.getDatasetRun()); + + ColumnVisitor columnWriter = new ColumnVisitor() + { + @Override + public Void visitColumn(Column column) + { + try + { + writer.startElement("column"); + writer.addAttribute("width", column.getWidth()); + if(isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_4_6_0)) + { + writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_uuid, column.getUUID().toString()); + reportWriter.writeProperties(column); + reportWriter.writePropertyExpressions(column.getPropertyExpressions()); + } + writeExpression(JRXmlConstants.ELEMENT_printWhenExpression, + JRXmlWriter.JASPERREPORTS_NAMESPACE, + column.getPrintWhenExpression(), + false, + componentElement, + reportWriter); + writeTableCell(componentElement, column.getTableHeader(), "tableHeader", reportWriter); + writeTableCell(componentElement, column.getTableFooter(), "tableFooter", reportWriter); + writeGroupCells(componentElement, column.getGroupHeaders(), "groupHeader", reportWriter); + writeGroupCells(componentElement, column.getGroupFooters(), "groupFooter", reportWriter); + writeTableCell(componentElement, column.getColumnHeader(), "columnHeader", reportWriter); + writeTableCell(componentElement, column.getColumnFooter(), "columnFooter", reportWriter); + writeTableCell(componentElement, column.getDetailCell(), "detailCell", reportWriter); + writer.closeElement(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + + return null; + } + + @Override + public Void visitColumnGroup(ColumnGroup columnGroup) + { + try + { + writer.startElement("columnGroup"); + writer.addAttribute("width", columnGroup.getWidth()); + if(isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_4_6_0)) + { + writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_uuid, columnGroup.getUUID().toString()); + reportWriter.writeProperties(columnGroup); + reportWriter.writePropertyExpressions(columnGroup.getPropertyExpressions()); + } + writeExpression(JRXmlConstants.ELEMENT_printWhenExpression, + JRXmlWriter.JASPERREPORTS_NAMESPACE, + columnGroup.getPrintWhenExpression(), + false, + componentElement, + reportWriter); + writeTableCell(componentElement, columnGroup.getTableHeader(), "tableHeader", reportWriter); + writeTableCell(componentElement, columnGroup.getTableFooter(), "tableFooter", reportWriter); + writeGroupCells(componentElement, columnGroup.getGroupHeaders(), "groupHeader", reportWriter); + writeGroupCells(componentElement, columnGroup.getGroupFooters(), "groupFooter", reportWriter); + writeTableCell(componentElement, columnGroup.getColumnHeader(), "columnHeader", reportWriter); + writeTableCell(componentElement, columnGroup.getColumnFooter(), "columnFooter", reportWriter); + + // deep + for (BaseColumn column : columnGroup.getColumns()) + { + column.visitColumn(this); + } + + writer.closeElement(); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + + return null; + } + }; + + for (BaseColumn column : table.getColumns()) + { + column.visitColumn(columnWriter); + } + + writer.closeElement(); + } + + protected void writeGroupCells(JRComponentElement componentElement, List cells, String name, + JRXmlWriter reportWriter) throws IOException + { + if (cells != null) + { + JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); + for (GroupCell groupCell : cells) + { + writer.startElement(name); + writer.addAttribute("groupName", groupCell.getGroupName()); + writeTableCell(componentElement, groupCell.getCell(), "cell", reportWriter); + writer.closeElement(); + } + } + } + + protected void writeTableCell(JRComponentElement componentElement, Cell cell, String name, + JRXmlWriter reportWriter) throws IOException + { + if (cell != null) + { + JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); + writer.startElement(name); + reportWriter.writeStyleReferenceAttr(cell); + writer.addAttribute("height", cell.getHeight()); + writer.addAttribute("rowSpan", cell.getRowSpan()); + + if (isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_4_8_0)) + { + reportWriter.writeProperties(cell); + } + reportWriter.writeBox(cell.getLineBox(), JRXmlWriter.JASPERREPORTS_NAMESPACE); + reportWriter.writeChildElements(cell); + + writer.closeElement();//cell + } + } + + @Override + public boolean isToWrite(JRComponentElement componentElement, JRXmlWriter reportWriter) + { + ComponentKey componentKey = componentElement.getComponentKey(); + if (ComponentsExtensionsRegistryFactory.NAMESPACE.equals(componentKey.getNamespace())) + { + if(ComponentsExtensionsRegistryFactory.SORT_COMPONENT_NAME.equals(componentKey.getName()) + || ComponentsExtensionsRegistryFactory.MAP_COMPONENT_NAME.equals(componentKey.getName())) + { + return isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_4_1_1); + } + else if(ComponentsExtensionsRegistryFactory.SPIDERCHART_COMPONENT_NAME.equals(componentKey.getName())) + { + return isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_3_7_4); + } + else if(ComponentsExtensionsRegistryFactory.TABLE_COMPONENT_NAME.equals(componentKey.getName())) + { + return isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_3_7_2); + } + else if(ComponentsExtensionsRegistryFactory.LIST_COMPONENT_NAME.equals(componentKey.getName())) + { + return isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_3_5_1); + } + else if(ComponentsExtensionsRegistryFactory.BARBECUE_COMPONENT_NAME.equals(componentKey.getName()) + || isBarcode4jName(componentKey.getName())) + { + return isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_3_5_2); + } + } + + return true; + } + + + protected boolean isBarcode4jName(String name) + { + for (String barcode4jName : ComponentsExtensionsRegistryFactory.BARCODE4J_COMPONENT_NAMES) + { + if(barcode4jName.equals(name)){ + return true; + } + } + return false; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/components.xsd jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/components.xsd --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/components.xsd 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/components.xsd 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,1097 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Type of orientation for the barcode object. + + + + + + None. + + + + + The barcode is rotated with 90 degrees anticlockwise. + + + + + The barcode is rotated with 90 degrees clockwise. + + + + + The barcode is rotated with 180 degrees. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Creates a dataset with one or more marker objects + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies style options for the sort symbol. + + + + + + + + + + Sort field type. + + + + + + + + + + + + + + + + + + + + Vertical handler alignment. + + + + + + + + + + + + + + + + + + + + + + + + + Horizontal handler alignment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Allows users to customize the behavior of the table when there are now rows in the data source. + + + + + + The table output will be blank. + + + + + All the table sections except the detail section will get printed. + + + + + + + + + + + + + + + + + + + + + + + + + This attribute is auto-generated and is used to uniquely identify elements across multiple report templates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background color of the chart + + + + + + + + + + + + + Plot options for a spiderChart. + + + + + + + + + + + Specifies the mode the radar axis are drawn (clockwise or anticlockwise). + + + + + + + + + + + Specifies whether the data series are stored in rows or in columns. + + + + + + + + + + + Specifies if the web polygons are filled or not + + + + + + + + + + + Specifies the starting angle for the spider chart axis. + + + + + Specifies the head radius percent. + + + + + Specifies the interior gap percent. + + + + + Specifies the color to use when drawing the line showing the axis. + + + + + Specifies the axis line width. + + + + + Specifies the axis label gap percent. + + + + + Specifies the label foreground color. + + + + + Background color of the chart + + + + + Alpha (transparency) parameter for the background. + + + + + Alpha (transparency) parameter for the foreground. + + + + + + + + Creates a dataset with one or more series and values associated with categories + + + + + + + + + + + + + + + + + + + + + Icon position. + + + + + + + + + + + + + + + + + + + Text fill policy. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Horizontal alignment. + + + + + + + + + + + + + + + + + + + + + + + + Vertical alignment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/AbstractVerifiableTableAction.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/AbstractVerifiableTableAction.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/AbstractVerifiableTableAction.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/AbstractVerifiableTableAction.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,104 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import java.util.UUID; + +import net.sf.jasperreports.components.table.StandardTable; +import net.sf.jasperreports.engine.JRIdentifiable; +import net.sf.jasperreports.engine.design.JRDesignComponentElement; +import net.sf.jasperreports.engine.util.DefaultFormatFactory; +import net.sf.jasperreports.engine.util.FormatFactory; +import net.sf.jasperreports.web.actions.AbstractAction; +import net.sf.jasperreports.web.actions.ActionException; +import net.sf.jasperreports.web.commands.CommandTarget; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public abstract class AbstractVerifiableTableAction extends AbstractAction +{ + protected BaseColumnData columnData; + + protected StandardTable table; + protected String targetUri; + + protected static FormatFactory formatFactory = new DefaultFormatFactory(); + + public AbstractVerifiableTableAction() + { + } + + @Override + public String getMessagesBundle() { + return "net.sf.jasperreports.components.headertoolbar.actions.messages"; + } + + public StandardTable getTable(String uuid) + { + CommandTarget target = getCommandTarget(UUID.fromString(uuid)); + if (target != null) + { + JRIdentifiable identifiable = target.getIdentifiable(); + JRDesignComponentElement componentElement = identifiable instanceof JRDesignComponentElement ? (JRDesignComponentElement)identifiable : null; + return componentElement == null ? null : (StandardTable)componentElement.getComponent(); + } + return null; + } + + public void prepare() throws ActionException + { + if (columnData == null) { + errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.validate.no.data"); + } + if(columnData.getTableUuid() == null || columnData.getTableUuid().trim().length() == 0) { + errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.validate.no.table"); + } + CommandTarget target = getCommandTarget(UUID.fromString(columnData.getTableUuid())); + if (target != null) + { + JRIdentifiable identifiable = target.getIdentifiable(); + JRDesignComponentElement componentElement = identifiable instanceof JRDesignComponentElement ? (JRDesignComponentElement)identifiable : null; + + if (componentElement == null) { + errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.validate.no.table.match", columnData.getTableUuid()); + } + + table = (StandardTable)componentElement.getComponent(); + targetUri = target.getUri(); + } + } + + @Override + public void run() throws ActionException + { + prepare(); + verify(); + errors.throwAll(); + performAction(); + } + + public abstract void verify() throws ActionException; + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/BaseColumnData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/BaseColumnData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/BaseColumnData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/BaseColumnData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class BaseColumnData { + + private String tableUuid; + + public BaseColumnData() { + } + + public BaseColumnData(String tableUuid) { + this.tableUuid = tableUuid; + } + + @JsonIgnore + public String getTableUuid() { + return tableUuid; + } + + @JsonProperty + public void setTableUuid(String tableUuid) { + this.tableUuid = tableUuid; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ConditionalFormattingAction.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ConditionalFormattingAction.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ConditionalFormattingAction.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ConditionalFormattingAction.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,202 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import java.text.DateFormat; +import java.text.NumberFormat; +import java.text.ParseException; +import java.util.List; +import java.util.Locale; + +import net.sf.jasperreports.components.headertoolbar.json.ColumnFormatting; +import net.sf.jasperreports.components.sort.FilterTypeDateOperatorsEnum; +import net.sf.jasperreports.components.sort.FilterTypesEnum; +import net.sf.jasperreports.components.table.BaseColumn; +import net.sf.jasperreports.components.table.StandardColumn; +import net.sf.jasperreports.components.table.util.TableUtil; +import net.sf.jasperreports.engine.JRParameter; +import net.sf.jasperreports.engine.JRTextField; +import net.sf.jasperreports.web.actions.ActionException; +import net.sf.jasperreports.web.commands.CommandException; +import net.sf.jasperreports.web.commands.ResetInCacheCommand; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class ConditionalFormattingAction extends AbstractVerifiableTableAction { + + public ConditionalFormattingAction() { + } + + public ConditionalFormattingData getConditionalFormattingData() { + return (ConditionalFormattingData) columnData; + } + + public void setConditionalFormattingData(ConditionalFormattingData conditionalFormattingData) { + columnData = conditionalFormattingData; + } + + @Override + public void performAction() throws ActionException { + // execute command + try { + fillColumnFormatting(); + + getCommandStack().execute( + new ResetInCacheCommand( + new ConditionalFormattingCommand(getJasperReportsContext(), getTargetTextField(), getConditionalFormattingData()), + getJasperReportsContext(), + getReportContext(), + targetUri + ) + ); + } catch (CommandException e) { + throw new ActionException(e); + } + } + + protected void fillColumnFormatting() + { + // the client does not send back the column locale and timezone, filling from the report context. + // is it ok to alter the columnData object? + ConditionalFormattingData conditionalFormattingData = (ConditionalFormattingData) columnData; + ColumnFormatting columnFormatting = ColumnFormatting.get(getReportContext(), + conditionalFormattingData.getTableUuid(), conditionalFormattingData.getColumnIndex()); + if (columnFormatting != null) + { + if (conditionalFormattingData.getLocaleCode() == null) + { + conditionalFormattingData.setLocaleCode(columnFormatting.getLocaleCode()); + } + if (conditionalFormattingData.getTimeZoneId() == null) + { + conditionalFormattingData.setTimeZoneId(columnFormatting.getTimeZoneId()); + } + } + } + + private JRTextField getTargetTextField() { + ConditionalFormattingData cfData = getConditionalFormattingData(); + List allCols = TableUtil.getAllColumns(table); + StandardColumn col = (StandardColumn)allCols.get(cfData.getColumnIndex()); + JRTextField result = null; + + if (EditTextElementData.APPLY_TO_DETAIL_ROWS.equals(cfData.getApplyTo())) { + result = TableUtil.getCellElement(JRTextField.class, col.getDetailCell(), true); + } else if (EditTextElementData.APPLY_TO_GROUP_SUBTOTAL.equals(cfData.getApplyTo())) { + result = TableUtil.getCellElement(JRTextField.class, col, TableUtil.COLUMN_GROUP_FOOTER, cfData.getGroupName(), table); + } else if (EditTextElementData.APPLY_TO_GROUPHEADING.equals(cfData.getApplyTo())) { + result = TableUtil.getCellElement(JRTextField.class, col, TableUtil.COLUMN_GROUP_HEADER, cfData.getGroupName(), table); + } else if (EditTextElementData.APPLY_TO_TABLE_TOTAL.equals(cfData.getApplyTo())) { + result = TableUtil.getCellElement(JRTextField.class, col, TableUtil.TABLE_FOOTER, null, table); + } + + return result; + } + + @Override + public void verify() throws ActionException { + ConditionalFormattingData cfd = getConditionalFormattingData(); + List conditions = cfd.getConditions(); + if (conditions.size() > 0) { + FilterTypesEnum conditionType = FilterTypesEnum.getByName(cfd.getConditionType()); + FormatCondition condition; + + Locale locale = (Locale)getReportContext().getParameterValue(JRParameter.REPORT_LOCALE); + if (locale == null) { + locale = Locale.getDefault(); + } + + for (int i = 0, ln = conditions.size(); i < ln; i ++) { + condition = conditions.get(i); + if (FilterTypesEnum.DATE.equals(conditionType) || FilterTypesEnum.TIME.equals(conditionType)) { + FilterTypeDateOperatorsEnum dateEnum = FilterTypeDateOperatorsEnum.getByEnumConstantName(condition.getConditionTypeOperator()); + boolean containsBetween = FilterTypeDateOperatorsEnum.IS_BETWEEN.equals(dateEnum) || FilterTypeDateOperatorsEnum.IS_NOT_BETWEEN.equals(dateEnum); + + try { + DateFormat df = formatFactory.createDateFormat(cfd.getConditionPattern(), locale, null); + df.setLenient(false); + + if (containsBetween) { + if (condition.getConditionStart() == null || condition.getConditionStart().length() == 0) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.empty.start.date", i+1); + } else { + try { + df.parse(condition.getConditionStart()); + } catch (ParseException e) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.invalid.start.date", i+1, condition.getConditionStart()); + } + } + + if (condition.getConditionEnd() != null && condition.getConditionEnd().length() > 0) { + try { + df.parse(condition.getConditionEnd()); + } catch (ParseException e) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.invalid.end.date", i+1, condition.getConditionEnd()); + } + } else { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.empty.end.date", i+1); + } + + } else { + if (condition.getConditionStart() == null || condition.getConditionStart().length() == 0) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.empty.date", i+1); + } else { + try { + df.parse(condition.getConditionStart()); + } catch (ParseException e) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.invalid.date", i+1, condition.getConditionStart()); + } + } + } + } catch (IllegalArgumentException e) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.invalid.pattern", i+1); + } + + } else if (conditionType == FilterTypesEnum.NUMERIC) { + if (condition.getConditionStart() == null || condition.getConditionStart().trim().length() == 0) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.empty.number", i+1); + continue; + } + try { + NumberFormat nf = formatFactory.createNumberFormat(cfd.getConditionPattern(), locale); + nf.parse(condition.getConditionStart()); + if (condition.getConditionEnd() != null && condition.getConditionEnd().length() > 0) { + try { + nf.parse(condition.getConditionEnd()); + } catch (ParseException e) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.invalid.number", i+1, condition.getConditionEnd()); + } + } + } catch (ParseException e) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.invalid.number", i+1, condition.getConditionStart()); + } catch (IllegalArgumentException e) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.invalid.pattern", i+1); + } + } + } + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ConditionalFormattingCommand.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ConditionalFormattingCommand.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ConditionalFormattingCommand.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ConditionalFormattingCommand.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,98 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import net.sf.jasperreports.engine.JRPropertiesMap; +import net.sf.jasperreports.engine.JRTextField; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.web.commands.Command; +import net.sf.jasperreports.web.util.JacksonUtil; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class ConditionalFormattingCommand implements Command +{ + + public static final String COLUMN_CONDITIONAL_FORMATTING_PROPERTY = "net.sf.jasperreports.components.headertoolbar.conditional.formatting"; + + private JasperReportsContext jasperReportsContext; + protected ConditionalFormattingData conditionalFormattingData; + private String oldSerializedConditionsData; + private String newSerializedConditionsData; + private JRTextField textElement; + + public ConditionalFormattingCommand(JasperReportsContext jasperReportsContext, JRTextField textElement, ConditionalFormattingData conditionalFormattingData) + { + this.jasperReportsContext = jasperReportsContext; + this.textElement = textElement; + this.conditionalFormattingData = conditionalFormattingData; + } + + @Override + public void execute() + { + if (textElement != null) + { + // get existing condition data as JSON string + String serializedConditionData = null; + JRPropertiesMap propertiesMap = textElement.getPropertiesMap(); + if (propertiesMap.containsProperty(COLUMN_CONDITIONAL_FORMATTING_PROPERTY)) { + serializedConditionData = propertiesMap.getProperty(COLUMN_CONDITIONAL_FORMATTING_PROPERTY); + } + + oldSerializedConditionsData = serializedConditionData; + + JacksonUtil jacksonUtil = JacksonUtil.getInstance(jasperReportsContext); +// ConditionalFormattingData existingConditionData = jacksonUtil.loadObject(serializedConditionData, ConditionalFormattingData.class); +// if (existingConditionData != null) { +// existingConditionData.setConditions(conditionalFormattingData.getConditions()); +// } else { +// existingConditionData = conditionalFormattingData; +// } +// +// newSerializedConditionsData = jacksonUtil.getJsonString(existingConditionData); + newSerializedConditionsData = jacksonUtil.getJsonString(conditionalFormattingData); + propertiesMap.setProperty(COLUMN_CONDITIONAL_FORMATTING_PROPERTY, newSerializedConditionsData); + } + } + + @Override + public void undo() + { + if (textElement != null) + { + textElement.getPropertiesMap().setProperty(COLUMN_CONDITIONAL_FORMATTING_PROPERTY, oldSerializedConditionsData); + } + } + + @Override + public void redo() + { + if (textElement != null) + { + textElement.getPropertiesMap().setProperty(COLUMN_CONDITIONAL_FORMATTING_PROPERTY, newSerializedConditionsData); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ConditionalFormattingData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ConditionalFormattingData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ConditionalFormattingData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ConditionalFormattingData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,161 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +@JsonIgnoreProperties(ignoreUnknown=true) +public class ConditionalFormattingData extends BaseColumnData { + + private int columnIndex; + private String conditionType; + private String conditionPattern; + private String localeCode; + private String timeZoneId; + private String columnType; + private String fieldOrVariableName; + private List conditions; + + private String applyTo; + private String groupName; + + public ConditionalFormattingData() { + this.conditions = new ArrayList(); + } + + @JsonIgnore + public int getColumnIndex() { + return columnIndex; + } + + @JsonProperty + public void setColumnIndex(int columnIndex) { + this.columnIndex = columnIndex; + } + + public String getConditionType() { + return conditionType; + } + + public void setConditionType(String filterType) { + this.conditionType = filterType; + } + + public String getConditionPattern() { + return conditionPattern; + } + + public void setConditionPattern(String filterPattern) { + this.conditionPattern = filterPattern; + } + + @JsonIgnore + public String getLocaleCode() { + return localeCode; + } + + @JsonIgnore + public void setLocaleCode(String localeCode) { + this.localeCode = localeCode; + } + + @JsonIgnore + public String getTimeZoneId() { + return timeZoneId; + } + + @JsonIgnore + public void setTimeZoneId(String timeZoneId) { + this.timeZoneId = timeZoneId; + } + + /** + * @deprecated To be removed. + */ + @JsonIgnore + public String getColumnType() { + return columnType; + } + + /** + * @deprecated To be removed. + */ + @JsonIgnore + public void setColumnType(String columnType) { + this.columnType = columnType; + } + + /** + * @deprecated To be removed. + */ + @JsonIgnore + public String getFieldOrVariableName() { + return fieldOrVariableName; + } + + /** + * @deprecated To be removed. + */ + @JsonIgnore + public void setFieldOrVariableName(String fieldOrVariableName) { + this.fieldOrVariableName = fieldOrVariableName; + } + + public List getConditions() { + return conditions; + } + + public void setConditions(List conditions) { + this.conditions = conditions; + } + + @JsonIgnore + public String getApplyTo() { + return applyTo; + } + + @JsonProperty + public void setApplyTo(String applyTo) { + this.applyTo = applyTo; + } + + @JsonIgnore + public String getGroupName() { + return groupName; + } + + @JsonProperty + public void setGroupName(String groupName) { + this.groupName = groupName; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/EditTextElementAction.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/EditTextElementAction.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/EditTextElementAction.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/EditTextElementAction.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,165 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import java.text.NumberFormat; +import java.text.ParsePosition; +import java.util.List; +import java.util.Locale; + +import net.sf.jasperreports.components.headertoolbar.HeaderToolbarElementUtils; +import net.sf.jasperreports.components.sort.FilterTypesEnum; +import net.sf.jasperreports.components.table.BaseColumn; +import net.sf.jasperreports.components.table.StandardColumn; +import net.sf.jasperreports.components.table.util.TableUtil; +import net.sf.jasperreports.engine.JRField; +import net.sf.jasperreports.engine.JRParameter; +import net.sf.jasperreports.engine.design.JRDesignDataset; +import net.sf.jasperreports.engine.design.JRDesignDatasetRun; +import net.sf.jasperreports.engine.design.JRDesignTextElement; +import net.sf.jasperreports.engine.design.JRDesignTextField; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.repo.JasperDesignCache; +import net.sf.jasperreports.web.actions.ActionException; +import net.sf.jasperreports.web.commands.CommandException; +import net.sf.jasperreports.web.commands.ResetInCacheCommand; + + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class EditTextElementAction extends AbstractVerifiableTableAction { + + public EditTextElementAction() { + } + + public void setEditTextElementData(EditTextElementData editTextElementData) { + columnData = editTextElementData; + } + + public EditTextElementData getEditTextElementData() { + return (EditTextElementData)columnData; + } + + @Override + public void performAction() throws ActionException { + // execute command + try { + getCommandStack().execute( + new ResetInCacheCommand( + new EditTextElementCommand(getTargetTextElement(), getEditTextElementData(), getReportContext()), + getJasperReportsContext(), + getReportContext(), + targetUri + ) + ); + } catch (CommandException e) { + throw new ActionException(e); + } + } + + private JRDesignTextElement getTargetTextElement() { + EditTextElementData textElementData = getEditTextElementData(); + List allCols = TableUtil.getAllColumns(table); + StandardColumn col = (StandardColumn)allCols.get(textElementData.getColumnIndex()); + JRDesignTextElement result = null; + + if (EditTextElementData.APPLY_TO_DETAIL_ROWS.equals(textElementData.getApplyTo())) { + result = TableUtil.getCellElement(JRDesignTextElement.class, col.getDetailCell(), true); + } else if (EditTextElementData.APPLY_TO_GROUP_SUBTOTAL.equals(textElementData.getApplyTo())) { + result = TableUtil.getCellElement(JRDesignTextElement.class, col, TableUtil.COLUMN_GROUP_FOOTER, textElementData.getGroupName(), table); + } else if (EditTextElementData.APPLY_TO_HEADING.equals(textElementData.getApplyTo())) { + result = TableUtil.getCellElement(JRDesignTextElement.class, col.getColumnHeader(), true); + } else if (EditTextElementData.APPLY_TO_GROUPHEADING.equals(textElementData.getApplyTo())) { + result = TableUtil.getCellElement(JRDesignTextElement.class, col, TableUtil.COLUMN_GROUP_HEADER, textElementData.getGroupName(), table); + } else if (EditTextElementData.APPLY_TO_TABLE_TOTAL.equals(textElementData.getApplyTo())) { + result = TableUtil.getCellElement(JRDesignTextElement.class, col, TableUtil.TABLE_FOOTER, null, table); + } + + return result; + } + + @Override + public void verify() throws ActionException { + EditTextElementData colValData = getEditTextElementData(); + + Locale locale = (Locale)getReportContext().getParameterValue(JRParameter.REPORT_LOCALE); + if (locale == null) { + locale = Locale.getDefault(); + } + + if (colValData.getFontSize() != null) { + try { + NumberFormat numberFormat = NumberFormat.getNumberInstance(locale); + ParsePosition pp = new ParsePosition(0); + Number formattedNumber = numberFormat.parse(colValData.getFontSize(), pp); + + if (formattedNumber != null && pp.getIndex() == colValData.getFontSize().length()) { + colValData.setFloatFontSize(formattedNumber.floatValue()); + } else { + errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.edit.values.invalid.font.size", colValData.getFontSize()); + } + + } catch (NumberFormatException e) { + errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.edit.values.invalid.font.size", colValData.getFontSize()); + } + } + JRDesignTextElement textField = getTargetTextElement(); + + if (textField instanceof JRDesignTextField && TableUtil.hasSingleChunkExpression((JRDesignTextField) textField)) { + JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)table.getDatasetRun(); + String datasetName = datasetRun.getDatasetName(); + JasperDesignCache cache = JasperDesignCache.getInstance(getJasperReportsContext(), getReportContext()); + JasperDesign jasperDesign = cache.getJasperDesign(targetUri); + JRDesignDataset dataset = (JRDesignDataset)jasperDesign.getDatasetMap().get(datasetName); + + String textFieldName = ((JRDesignTextField) textField).getExpression().getChunks()[0].getText(); + FilterTypesEnum filterType = null; + + for (JRField field: dataset.getFields()) { + if (textFieldName.equals(field.getName())) { + filterType = HeaderToolbarElementUtils.getFilterType(field.getValueClass()); + break; + } + } + + if (filterType != null) { + if (filterType.equals(FilterTypesEnum.DATE)) { + try { + formatFactory.createDateFormat(colValData.getFormatPattern(), locale, null); + } catch (IllegalArgumentException e){ + errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.edit.column.values.invalid.date.pattern", new Object[] {colValData.getFormatPattern()}); + } + } else if (filterType.equals(FilterTypesEnum.NUMERIC)) { + try { + formatFactory.createNumberFormat(colValData.getFormatPattern(), locale); + } catch (IllegalArgumentException e){ + errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.edit.column.values.invalid.number.pattern", new Object[] {colValData.getFormatPattern()}); + } + } + } + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/EditTextElementCommand.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/EditTextElementCommand.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/EditTextElementCommand.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/EditTextElementCommand.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,132 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import java.awt.Color; +import java.util.Locale; + +import net.sf.jasperreports.components.headertoolbar.HeaderToolbarElementUtils; +import net.sf.jasperreports.components.table.util.TableUtil; +import net.sf.jasperreports.engine.JRParameter; +import net.sf.jasperreports.engine.ReportContext; +import net.sf.jasperreports.engine.design.JRDesignExpression; +import net.sf.jasperreports.engine.design.JRDesignStaticText; +import net.sf.jasperreports.engine.design.JRDesignTextElement; +import net.sf.jasperreports.engine.design.JRDesignTextField; +import net.sf.jasperreports.engine.type.HorizontalTextAlignEnum; +import net.sf.jasperreports.engine.type.ModeEnum; +import net.sf.jasperreports.engine.util.JRColorUtil; +import net.sf.jasperreports.engine.util.JRStringUtil; +import net.sf.jasperreports.web.commands.Command; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class EditTextElementCommand implements Command +{ + + private EditTextElementData editTextElementData; + private EditTextElementData oldEditTextElementData; + private JRDesignTextElement textElement; + private String oldText; + private ReportContext reportContext; + + public EditTextElementCommand(JRDesignTextElement textElement, EditTextElementData editTextElementData, ReportContext reportContext) + { + this.textElement = textElement; + this.editTextElementData = editTextElementData; + this.reportContext = reportContext; + } + + + @Override + public void execute() { + if (textElement != null) { + Locale locale = (Locale)reportContext.getParameterValue(JRParameter.REPORT_LOCALE); + if (locale == null) { + locale = Locale.getDefault(); + } + oldEditTextElementData = new EditTextElementData(); + oldEditTextElementData.setApplyTo(editTextElementData.getApplyTo()); + HeaderToolbarElementUtils.copyOwnTextElementStyle(oldEditTextElementData, textElement, locale); + applyColumnHeaderData(editTextElementData, textElement, true); + } + } + + private void applyColumnHeaderData(EditTextElementData textElementData, JRDesignTextElement textElement, boolean execute) { + if (EditTextElementData.APPLY_TO_HEADING.equals(textElementData.getApplyTo())) { + if (textElement instanceof JRDesignTextField) { + JRDesignTextField designTextField = (JRDesignTextField)textElement; + if (execute) { + if (oldText == null) { + oldText = (designTextField.getExpression()).getText(); + } + ((JRDesignExpression)designTextField.getExpression()).setText("\"" + JRStringUtil.escapeJavaStringLiteral(textElementData.getHeadingName()) + "\""); + } else { + ((JRDesignExpression)designTextField.getExpression()).setText(oldText); + } + + } else if (textElement instanceof JRDesignStaticText){ + JRDesignStaticText staticText = (JRDesignStaticText)textElement; + if (execute) { + if (oldText == null) { + oldText = staticText.getText(); + } + staticText.setText(textElementData.getHeadingName()); + } else { + staticText.setText(oldText); + } + } + } + + textElement.setFontName(textElementData.getFontName()); + textElement.setFontSize(textElementData.getFloatFontSize()); + textElement.setBold(textElementData.getFontBold()); + textElement.setItalic(textElementData.getFontItalic()); + textElement.setUnderline(textElementData.getFontUnderline()); + textElement.setForecolor(textElementData.getFontColor() != null ? JRColorUtil.getColor("#" + textElementData.getFontColor(), textElement.getForecolor()) : null); + textElement.setHorizontalTextAlign(HorizontalTextAlignEnum.getByName(textElementData.getFontHAlign())); + textElement.setBackcolor(textElementData.getFontBackColor() != null ? JRColorUtil.getColor("#" + textElementData.getFontBackColor(), Color.white) : null); + textElement.setMode(ModeEnum.getByName(textElementData.getMode())); + + if (textElement instanceof JRDesignTextField && TableUtil.hasSingleChunkExpression((JRDesignTextField) textElement)) { + ((JRDesignTextField) textElement).setPattern(textElementData.getFormatPattern()); + } + } + + + @Override + public void undo() { + if (oldEditTextElementData != null) { + applyColumnHeaderData(oldEditTextElementData, textElement, false); + } + } + + + @Override + public void redo() { + applyColumnHeaderData(editTextElementData, textElement, true); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/EditTextElementData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/EditTextElementData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/EditTextElementData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/EditTextElementData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,207 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class EditTextElementData extends BaseColumnData { + + public static final String APPLY_TO_HEADING = "heading"; + public static final String APPLY_TO_DETAIL_ROWS = "detailrows"; + public static final String APPLY_TO_GROUPHEADING = "groupheading"; + public static final String APPLY_TO_GROUP_SUBTOTAL = "groupsubtotal"; + public static final String APPLY_TO_TABLE_TOTAL = "tabletotal"; + + private int columnIndex; + private String headingName; + private String fontName; + private String fontSize; + private Boolean fontBold; + private Boolean fontItalic; + private Boolean fontUnderline; + private String fontColor; + private String fontBackColor; + private String fontHAlign; + private String formatPattern; + private String mode; + + private String dataType; + private String applyTo; + private String groupName; + + private Float floatFontSize; + + public EditTextElementData() { + } + + @JsonIgnore + public int getColumnIndex() { + return columnIndex; + } + + @JsonProperty + public void setColumnIndex(int columnIndex) { + this.columnIndex = columnIndex; + } + + public String getHeadingName() { + return headingName; + } + + public void setHeadingName(String headingName) { + this.headingName = headingName; + } + + public String getFontName() { + return fontName; + } + + public void setFontName(String fontName) { + this.fontName = fontName; + } + + public String getFontSize() { + return fontSize; + } + + public void setFontSize(String fontSize) { + this.fontSize = fontSize; + } + + public Boolean getFontBold() { + return fontBold; + } + + public void setFontBold(Boolean fontBold) { + this.fontBold = fontBold; + } + + public Boolean getFontItalic() { + return fontItalic; + } + + public void setFontItalic(Boolean fontItalic) { + this.fontItalic = fontItalic; + } + + public Boolean getFontUnderline() { + return fontUnderline; + } + + public void setFontUnderline(Boolean fontUnderline) { + this.fontUnderline = fontUnderline; + } + + public String getFontColor() { + return fontColor; + } + + public void setFontColor(String fontColor) { + this.fontColor = fontColor; + } + + public String getFontBackColor() { + return fontBackColor; + } + + public void setFontBackColor(String fontBackColor) { + this.fontBackColor = fontBackColor; + } + + public String getFontHAlign() { + return fontHAlign; + } + + public void setFontHAlign(String fontHAlign) { + this.fontHAlign = fontHAlign; + } + + public String getFormatPattern() { + return formatPattern; + } + + public void setFormatPattern(String formatPattern) { + this.formatPattern = formatPattern; + } + + public String getMode() { + return mode; + } + + public void setMode(String mode) { + this.mode = mode; + } + + /** + * @deprecated To be removed. + */ + @JsonIgnore + public String getDataType() { + return dataType; + } + + /** + * @deprecated To be removed. + */ + @JsonIgnore + public void setDataType(String dataType) { + this.dataType = dataType; + } + + @JsonIgnore + public String getApplyTo() { + return applyTo; + } + + @JsonProperty + public void setApplyTo(String applyTo) { + this.applyTo = applyTo; + } + + @JsonIgnore + public String getGroupName() { + return groupName; + } + + @JsonProperty + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + @JsonIgnore + public Float getFloatFontSize() { + return floatFontSize; + } + + @JsonIgnore + public void setFloatFontSize(Float floatFontSize) { + this.floatFontSize = floatFontSize; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/FilterAction.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/FilterAction.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/FilterAction.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/FilterAction.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,169 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import java.text.DateFormat; +import java.text.NumberFormat; +import java.text.ParseException; +import java.util.Locale; + +import net.sf.jasperreports.components.sort.FilterTypeDateOperatorsEnum; +import net.sf.jasperreports.components.sort.FilterTypesEnum; +import net.sf.jasperreports.components.sort.actions.FilterCommand; +import net.sf.jasperreports.components.sort.actions.FilterData; +import net.sf.jasperreports.engine.JRParameter; +import net.sf.jasperreports.engine.design.JRDesignDataset; +import net.sf.jasperreports.engine.design.JRDesignDatasetRun; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.repo.JasperDesignCache; +import net.sf.jasperreports.web.actions.ActionException; +import net.sf.jasperreports.web.commands.CommandException; +import net.sf.jasperreports.web.commands.ResetInCacheCommand; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class FilterAction extends AbstractVerifiableTableAction { + + public FilterAction() { + } + + public FilterData getFilterData() { + return (FilterData) columnData; + } + + public void setFilterData(FilterData filterData) { + columnData = filterData; + } + + @Override + public void performAction() throws ActionException { + JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)table.getDatasetRun(); + + String datasetName = datasetRun.getDatasetName(); + + JasperDesignCache cache = JasperDesignCache.getInstance(getJasperReportsContext(), getReportContext()); + + JasperDesign jasperDesign = cache.getJasperDesign(targetUri); + JRDesignDataset dataset = (JRDesignDataset)jasperDesign.getDatasetMap().get(datasetName); + + // execute command + try { + getCommandStack().execute( + new ResetInCacheCommand( + new FilterCommand(getJasperReportsContext(), dataset, getFilterData()), + getJasperReportsContext(), + getReportContext(), + targetUri + ) + ); + } catch (CommandException e) { + throw new ActionException(e); + } + } + + @Override + public void verify() throws ActionException { + FilterData fd = getFilterData(); + if (fd.isClearFilter()) { + return; + } + + if (fd.getFilterType() == null || fd.getFilterType().length() == 0) { + errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.filter.invalid.type"); + } + + FilterTypesEnum filterType = FilterTypesEnum.getByName(fd.getFilterType()); + + Locale locale = (Locale)getReportContext().getParameterValue(JRParameter.REPORT_LOCALE); + if (locale == null) { + locale = Locale.getDefault(); + } + + if (FilterTypesEnum.DATE.equals(filterType) || FilterTypesEnum.TIME.equals(filterType)) { + FilterTypeDateOperatorsEnum dateEnum = FilterTypeDateOperatorsEnum.getByEnumConstantName(fd.getFilterTypeOperator()); + boolean containsBetween = FilterTypeDateOperatorsEnum.IS_BETWEEN.equals(dateEnum) || FilterTypeDateOperatorsEnum.IS_NOT_BETWEEN.equals(dateEnum); + + try { + DateFormat df = formatFactory.createDateFormat(fd.getFilterPattern(), locale, null); + df.setLenient(false); + + if (containsBetween) { + if (fd.getFieldValueStart() == null || fd.getFieldValueStart().length() == 0) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.filter.empty.start.date"); + } else { + try { + df.parse(fd.getFieldValueStart()); + } catch (ParseException e) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.filter.invalid.start.date", fd.getFieldValueStart()); + } + } + + if (fd.getFieldValueEnd() != null && fd.getFieldValueEnd().length() > 0) { + try { + df.parse(fd.getFieldValueEnd()); + } catch (ParseException e) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.filter.invalid.end.date", fd.getFieldValueEnd()); + } + } else { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.filter.empty.end.date"); + } + + } else { + if (fd.getFieldValueStart() == null || fd.getFieldValueStart().length() == 0) { + errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.filter.empty.date"); + } + try { + df.parse(fd.getFieldValueStart()); + } catch (ParseException e) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.filter.invalid.date", fd.getFieldValueStart()); + } + } + } catch (IllegalArgumentException e) { + errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.filter.invalid.pattern"); + } + + } else if (filterType == FilterTypesEnum.NUMERIC) { + if (fd.getFieldValueStart() == null || fd.getFieldValueStart().trim().length() == 0) { + errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.filter.empty.number"); + } + try { + NumberFormat nf = formatFactory.createNumberFormat(fd.getFilterPattern(), locale); + nf.parse(fd.getFieldValueStart()); + if (fd.getFieldValueEnd() != null && fd.getFieldValueEnd().length() > 0) { + try { + nf.parse(fd.getFieldValueEnd()); + } catch (ParseException e) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.filter.invalid.number", new Object[]{fd.getFieldValueEnd()}); + } + } + } catch (ParseException e) { + errors.add("net.sf.jasperreports.components.headertoolbar.actions.filter.invalid.number", new Object[]{fd.getFieldValueStart()}); + } catch (IllegalArgumentException e) { + errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.filter.invalid.pattern"); + } + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/FormatCondition.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/FormatCondition.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/FormatCondition.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/FormatCondition.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,150 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import java.util.Locale; +import java.util.TimeZone; + +import net.sf.jasperreports.components.sort.AbstractFieldComparator; +import net.sf.jasperreports.components.sort.FieldComparatorFactory; +import net.sf.jasperreports.components.sort.FilterTypesEnum; + + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class FormatCondition { + + private String conditionStart; + private String conditionEnd; + private String conditionTypeOperator; + private Boolean conditionFontBold; + private Boolean conditionFontItalic; + private Boolean conditionFontUnderline; + private String conditionFontColor; + private String conditionFontBackColor; + private String conditionMode; + + public FormatCondition() { + } + + public String getConditionStart() { + return conditionStart; + } + + public void setConditionStart(String conditionStart) { + this.conditionStart = conditionStart; + } + + public String getConditionEnd() { + return conditionEnd; + } + + public void setConditionEnd(String conditionEnd) { + this.conditionEnd = conditionEnd; + } + + public String getConditionTypeOperator() { + return conditionTypeOperator; + } + + public void setConditionTypeOperator(String conditionTypeOperator) { + this.conditionTypeOperator = conditionTypeOperator; + } + + public Boolean isConditionFontBold() { + return conditionFontBold; + } + + public void setConditionFontBold(Boolean conditionFontBold) { + this.conditionFontBold = conditionFontBold; + } + + public Boolean isConditionFontItalic() { + return conditionFontItalic; + } + + public void setConditionFontItalic(Boolean conditionFontItalic) { + this.conditionFontItalic = conditionFontItalic; + } + + public Boolean isConditionFontUnderline() { + return conditionFontUnderline; + } + + public void setConditionFontUnderline(Boolean conditionFontUnderline) { + this.conditionFontUnderline = conditionFontUnderline; + } + + public String getConditionFontColor() { + return conditionFontColor; + } + + public void setConditionFontColor(String conditionFontColor) { + this.conditionFontColor = conditionFontColor; + } + + public String getConditionFontBackColor() { + return conditionFontBackColor; + } + + public void setConditionFontBackColor(String conditionFontBackColor) { + this.conditionFontBackColor = conditionFontBackColor; + } + + public String getConditionMode() { + return conditionMode; + } + + public void setConditionMode(String conditionMode) { + this.conditionMode = conditionMode; + } + + public boolean matches( + Object compareTo, + String conditionType, + String conditionPattern, + String conditionTypeOperator, + Locale locale, + TimeZone timeZone + ) + { + AbstractFieldComparator fieldComparator = + FieldComparatorFactory + .createFieldComparator( + FilterTypesEnum.getByName(conditionType), + conditionPattern, + locale, + timeZone + ); + + fieldComparator.setValueStart(conditionStart); + fieldComparator.setValueEnd(conditionEnd); + fieldComparator.setCompareTo(compareTo); + fieldComparator.setCompareToClass(compareTo != null ? compareTo.getClass() : Object.class); + + return fieldComparator.compare(conditionTypeOperator); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnCommand.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnCommand.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnCommand.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnCommand.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import net.sf.jasperreports.components.table.StandardColumn; +import net.sf.jasperreports.engine.design.JRDesignExpression; +import net.sf.jasperreports.web.commands.Command; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class HideUnhideColumnCommand implements Command { + + private String expressionText; + + private String oldPrintWhenExpressionText; + private StandardColumn column; + private JRDesignExpression newPrintWhenExpression; + + private static final String BOOLEAN_FALSE = "Boolean.FALSE"; + private static final String BOOLEAN_TRUE = "Boolean.TRUE"; + + + public HideUnhideColumnCommand(StandardColumn column, boolean hide) { + this.column = column; + if (hide) { + this.expressionText = BOOLEAN_FALSE; + } else { + this.expressionText = BOOLEAN_TRUE; + } + } + + + @Override + public void execute() { + if (column.getPrintWhenExpression() != null) { + oldPrintWhenExpressionText = column.getPrintWhenExpression().getText(); + ((JRDesignExpression)column.getPrintWhenExpression()).setText(expressionText); + } else { + newPrintWhenExpression = new JRDesignExpression(); + newPrintWhenExpression.setText(expressionText); + column.setPrintWhenExpression(newPrintWhenExpression); + } + } + + + @Override + public void undo() { + if (oldPrintWhenExpressionText != null) { + ((JRDesignExpression)column.getPrintWhenExpression()).setText(oldPrintWhenExpressionText); + } else { + column.setPrintWhenExpression(null); + } + } + + + @Override + public void redo() { + if (newPrintWhenExpression != null) { + column.setPrintWhenExpression(newPrintWhenExpression); + } else { + ((JRDesignExpression)column.getPrintWhenExpression()).setText(expressionText); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class HideUnhideColumnData extends BaseColumnData { + + private int[] columnIndexes; + private boolean hide; + + public HideUnhideColumnData() { + } + + public int[] getColumnIndexes() { + return columnIndexes; + } + + public void setColumnIndexes(int[] columnIndexes) { + this.columnIndexes = columnIndexes; + } + + public boolean getHide() { + return hide; + } + + public void setHide(boolean hide) { + this.hide = hide; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnsAction.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnsAction.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnsAction.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnsAction.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import net.sf.jasperreports.web.actions.ActionException; +import net.sf.jasperreports.web.commands.CommandException; +import net.sf.jasperreports.web.commands.ResetInCacheCommand; + + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class HideUnhideColumnsAction extends AbstractVerifiableTableAction { + + public HideUnhideColumnsAction(){ + } + + public void setColumnData(HideUnhideColumnData columnData) { + this.columnData = columnData; + } + + public HideUnhideColumnData getColumnData() { + return (HideUnhideColumnData)columnData; + } + + public String getName() { + return "hide_unhide_column_action"; + } + + @Override + public void performAction() throws ActionException + { + // execute command + try { + getCommandStack().execute( + new ResetInCacheCommand( + new HideUnhideColumnsCommand(table, getColumnData()), + getJasperReportsContext(), + getReportContext(), + targetUri + ) + ); + } catch (CommandException e) { + throw new ActionException(e); + } + } + + @Override + public void verify() throws ActionException { + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnsCommand.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnsCommand.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnsCommand.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/HideUnhideColumnsCommand.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,76 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import java.util.List; + +import net.sf.jasperreports.components.table.BaseColumn; +import net.sf.jasperreports.components.table.StandardColumn; +import net.sf.jasperreports.components.table.StandardTable; +import net.sf.jasperreports.components.table.util.TableUtil; +import net.sf.jasperreports.web.commands.Command; +import net.sf.jasperreports.web.commands.CommandException; +import net.sf.jasperreports.web.commands.CommandStack; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class HideUnhideColumnsCommand implements Command { + + private StandardTable table; + private HideUnhideColumnData columnData; + private CommandStack individualResizeCommandStack; + + public HideUnhideColumnsCommand(StandardTable table, HideUnhideColumnData columnData) { + this.table = table; + this.columnData = columnData; + individualResizeCommandStack = new CommandStack(); + } + + + @Override + public void execute() throws CommandException { + List tableColumns = TableUtil.getAllColumns(table); + int[] columnIndexes = columnData.getColumnIndexes(); + + if (columnIndexes != null) { + for(int colIndex: columnIndexes){ + individualResizeCommandStack.execute(new HideUnhideColumnCommand((StandardColumn)tableColumns.get(colIndex), columnData.getHide())); + } + } + } + + + @Override + public void undo() { + individualResizeCommandStack.undoAll(); + } + + + @Override + public void redo() { + individualResizeCommandStack.redoAll(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/messages.properties jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/messages.properties --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/messages.properties 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/messages.properties 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,34 @@ +net.sf.jasperreports.components.headertoolbar.actions.validate.no.data=No data! +net.sf.jasperreports.components.headertoolbar.actions.validate.no.table=No table! +net.sf.jasperreports.components.headertoolbar.actions.validate.no.table.match=No matching table for uuid: {0}! + +net.sf.jasperreports.components.headertoolbar.actions.move.column.invalid.position=Invalid position: {0}! + +net.sf.jasperreports.components.headertoolbar.actions.filter.invalid.type=Invalid filter type! +net.sf.jasperreports.components.headertoolbar.actions.filter.invalid.pattern=Invalid filter pattern! +net.sf.jasperreports.components.headertoolbar.actions.filter.invalid.date=Invalid date: {0}! +net.sf.jasperreports.components.headertoolbar.actions.filter.invalid.start.date=Invalid start date: {0}! +net.sf.jasperreports.components.headertoolbar.actions.filter.invalid.end.date=Invalid end date: {0}! +net.sf.jasperreports.components.headertoolbar.actions.filter.invalid.number=Invalid number: {0}! +net.sf.jasperreports.components.headertoolbar.actions.filter.empty.date=No date supplied! +net.sf.jasperreports.components.headertoolbar.actions.filter.empty.start.date=No start date supplied! +net.sf.jasperreports.components.headertoolbar.actions.filter.empty.end.date=No end date supplied! +net.sf.jasperreports.components.headertoolbar.actions.filter.empty.number=No number supplied! + +net.sf.jasperreports.components.headertoolbar.actions.edit.column.values.invalid.date.pattern=Invalid date pattern: {0}! +net.sf.jasperreports.components.headertoolbar.actions.edit.column.values.invalid.number.pattern=Invalid number pattern: {0}! + +net.sf.jasperreports.components.headertoolbar.actions.resize.column.negative.width=New width cannot be negative! + +net.sf.jasperreports.components.headertoolbar.actions.edit.column.header.invalid.font.size=Invalid headings font size: {0}! +net.sf.jasperreports.components.headertoolbar.actions.edit.values.invalid.font.size=Invalid values font size: {0}! + +net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.empty.date = Condition {0}: no date supplied! +net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.empty.start.date = Condition {0}: no start date supplied! +net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.empty.end.date = Condition {0}: no end date supplied! +net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.invalid.date = Condition {0}: invalid date "{1}"! +net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.invalid.start.date = Condition {0}: invalid start date "{1}"! +net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.invalid.end.date = Condition {0}: invalid end date "{1}"! +net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.invalid.pattern = Condition {0}: invalid condition pattern! +net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.empty.number = Condition {0}: no number supplied! +net.sf.jasperreports.components.headertoolbar.actions.conditionalformatting.invalid.number = Condition {0}: invalid number "{1}"! diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveColumnAction.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveColumnAction.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveColumnAction.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveColumnAction.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import net.sf.jasperreports.components.table.util.TableUtil; +import net.sf.jasperreports.web.actions.ActionException; +import net.sf.jasperreports.web.commands.CommandException; +import net.sf.jasperreports.web.commands.ResetInCacheCommand; + + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class MoveColumnAction extends AbstractVerifiableTableAction { + + public MoveColumnAction() { + } + + public void setMoveColumnData(MoveColumnData moveColumnData) { + columnData = moveColumnData; + } + + public MoveColumnData getMoveColumnData() { + return (MoveColumnData)columnData; + } + + public String getName() { + return "move_column_action"; + } + + @Override + public void performAction() throws ActionException { + // execute command + try { + getCommandStack().execute( + new ResetInCacheCommand( + new MoveColumnCommand(table, getMoveColumnData()), + getJasperReportsContext(), + getReportContext(), + targetUri + ) + ); + } catch (CommandException e) { + throw new ActionException(e); + } + } + + @Override + public void verify() throws ActionException { + MoveColumnData colData = getMoveColumnData(); + if (colData.getColumnToMoveNewIndex() > TableUtil.getAllColumns(table).size() - 1) { + errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.move.column.invalid.position", colData.getColumnToMoveNewIndex()); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveColumnCommand.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveColumnCommand.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveColumnCommand.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveColumnCommand.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,118 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import java.util.Iterator; +import java.util.List; + +import net.sf.jasperreports.components.headertoolbar.actions.ResizeColumnCommand.ColumnGroupInfo; +import net.sf.jasperreports.components.headertoolbar.actions.ResizeColumnCommand.ColumnUtil; +import net.sf.jasperreports.components.table.BaseColumn; +import net.sf.jasperreports.components.table.StandardTable; +import net.sf.jasperreports.components.table.util.TableUtil; +import net.sf.jasperreports.web.commands.Command; +import net.sf.jasperreports.web.commands.CommandException; +import net.sf.jasperreports.web.commands.CommandStack; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class MoveColumnCommand implements Command +{ + + private StandardTable table; + private MoveColumnData moveColumnData; + private CommandStack individualResizeCommandStack; + + + public MoveColumnCommand(StandardTable table, MoveColumnData moveColumnData) + { + this.table = table; + this.moveColumnData = moveColumnData; + this.individualResizeCommandStack = new CommandStack(); + } + + + @Override + public void execute() throws CommandException + { + moveColumns(moveColumnData); + } + + private void moveColumns(MoveColumnData moveColumnData) throws CommandException + { + int srcColIndex = moveColumnData.getColumnToMoveIndex(); + int destColIndex = moveColumnData.getColumnToMoveNewIndex(); + + List allColumns = TableUtil.getAllColumns(table); + + BaseColumn srcColumn = allColumns.get(srcColIndex); + BaseColumn destColumn = allColumns.get(destColIndex); + + List srcColParentColumnGroups = new ColumnUtil(srcColIndex).getParentColumnGroups(table.getColumns()); + List destColParentColumnGroups = new ColumnUtil(destColIndex).getParentColumnGroups(table.getColumns()); + + List srcSiblingColumns = + (srcColParentColumnGroups == null || srcColParentColumnGroups.isEmpty()) + ? table.getColumns() + : srcColParentColumnGroups.get(srcColParentColumnGroups.size() - 1).columnGroup.getColumns(); + + int srcSiblingColIndex = srcSiblingColumns.indexOf(srcColumn); + int destSiblingColIndex = srcSiblingColumns.indexOf(destColumn); + if ( + destSiblingColIndex < 0 + && (destColParentColumnGroups != null && !destColParentColumnGroups.isEmpty()) + ) + { + Iterator it = destColParentColumnGroups.iterator(); + while (destSiblingColIndex < 0 && it.hasNext()) + { + ColumnGroupInfo columnGroupInfo = it.next(); + destSiblingColIndex = srcSiblingColumns.indexOf(columnGroupInfo.columnGroup); + } + } + + if (destSiblingColIndex < 0) + { + //the dest column is not a sibling of the src column nor a descendant of a sibling; move is not possible + } + else if (srcSiblingColIndex != destSiblingColIndex) + { + individualResizeCommandStack.execute(new SimpleMoveColumnCommand(srcSiblingColumns, srcColumn, srcSiblingColIndex, destSiblingColIndex)); + } + } + + @Override + public void undo() + { + individualResizeCommandStack.undoAll(); + } + + @Override + public void redo() + { + individualResizeCommandStack.redoAll(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveColumnData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveColumnData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveColumnData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveColumnData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class MoveColumnData extends BaseColumnData { + + private int columnToMoveIndex; + private int columnToMoveNewIndex; + + public MoveColumnData() { + } + + public int getColumnToMoveIndex() { + return columnToMoveIndex; + } + + public void setColumnToMoveIndex(int columnToMoveIndex) { + this.columnToMoveIndex = columnToMoveIndex; + } + + public int getColumnToMoveNewIndex() { + return columnToMoveNewIndex; + } + + public void setColumnToMoveNewIndex(int columnToMoveNewIndex) { + this.columnToMoveNewIndex = columnToMoveNewIndex; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveElementCommand.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveElementCommand.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveElementCommand.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/MoveElementCommand.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import net.sf.jasperreports.engine.base.JRBaseElement; +import net.sf.jasperreports.web.commands.Command; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class MoveElementCommand implements Command +{ + + private int x; + private int oldX; + private JRBaseElement receiver; + + public MoveElementCommand(JRBaseElement receiver, int x) { + this.receiver = receiver; + this.x = x; + this.oldX = receiver.getX(); + } + + @Override + public void execute() { + receiver.setX(x); + } + + @Override + public void undo() { + receiver.setX(oldX); + } + + @Override + public void redo() { + execute(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,28 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** +* Contains Action classes for the built-in Header Toolbar component. +*/ +package net.sf.jasperreports.components.headertoolbar.actions; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeColumnAction.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeColumnAction.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeColumnAction.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeColumnAction.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import net.sf.jasperreports.web.actions.ActionException; +import net.sf.jasperreports.web.commands.CommandException; +import net.sf.jasperreports.web.commands.ResetInCacheCommand; + + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class ResizeColumnAction extends AbstractVerifiableTableAction { + + public ResizeColumnAction() { + } + + public void setResizeColumnData(ResizeColumnData resizeColumnData) { + columnData = resizeColumnData; + } + + public ResizeColumnData getResizeColumnData() { + return (ResizeColumnData)columnData; + } + + public String getName() { + return "resize_column_action"; + } + + @Override + public void performAction() throws ActionException + { + // execute command + try { + getCommandStack().execute( + new ResetInCacheCommand( + new ResizeColumnCommand(table, getResizeColumnData()), + getJasperReportsContext(), + getReportContext(), + targetUri + ) + ); + } catch (CommandException e) { + throw new ActionException(e); + } + } + + @Override + public void verify() throws ActionException { + ResizeColumnData resizeColData = getResizeColumnData(); + if (resizeColData.getWidth() < 0) { + errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.resize.column.negative.width"); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeColumnCommand.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeColumnCommand.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeColumnCommand.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeColumnCommand.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,285 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.sf.jasperreports.components.table.BaseColumn; +import net.sf.jasperreports.components.table.ColumnGroup; +import net.sf.jasperreports.components.table.GroupCell; +import net.sf.jasperreports.components.table.StandardBaseColumn; +import net.sf.jasperreports.components.table.StandardColumn; +import net.sf.jasperreports.components.table.StandardTable; +import net.sf.jasperreports.components.table.util.TableUtil; +import net.sf.jasperreports.engine.JRChild; +import net.sf.jasperreports.engine.JRElementGroup; +import net.sf.jasperreports.engine.JRFrame; +import net.sf.jasperreports.engine.base.JRBaseElement; +import net.sf.jasperreports.web.commands.Command; +import net.sf.jasperreports.web.commands.CommandException; +import net.sf.jasperreports.web.commands.CommandStack; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class ResizeColumnCommand implements Command +{ + + private StandardTable table; + private ResizeColumnData resizeColumnData; + private CommandStack individualResizeCommandStack; + + + public ResizeColumnCommand(StandardTable table, ResizeColumnData resizeColumnData) + { + this.table = table; + this.resizeColumnData = resizeColumnData; + this.individualResizeCommandStack = new CommandStack(); + } + + @Override + public void execute() throws CommandException + { + List tableColumns = TableUtil.getAllColumns(table); + + int modIndex = resizeColumnData.getColumnIndex(); + + StandardColumn modColumn = (StandardColumn) tableColumns.get(modIndex); + + int deltaWidth = resizeColumnData.getWidth() - modColumn.getWidth(); + int startX = 0; + List allColumns = TableUtil.getAllColumns(table); + if (allColumns != null) + { + for (int i = 0; i <= modIndex; i++) + { + startX += allColumns.get(i).getWidth(); + } + } + + List parentColumnGroups = new ColumnUtil(resizeColumnData.getColumnIndex()).getParentColumnGroups(table.getColumns()); + + for(ColumnGroupInfo colGroupInfo : parentColumnGroups) + { + if ( + colGroupInfo.x <= startX + && startX <= colGroupInfo.x + colGroupInfo.columnGroup.getWidth() + ) + { + resizeColumn(colGroupInfo.columnGroup, startX - colGroupInfo.x, deltaWidth); + } + } + + resizeColumn(modColumn, modColumn.getWidth(), deltaWidth); + } + + private void resizeColumn(BaseColumn column, int startX, int amount) throws CommandException + { + if (amount < -startX) + { + amount = -startX; + } + + StandardBaseColumn standardBaseColumn = column instanceof StandardBaseColumn ? (StandardBaseColumn)column : null; + if (standardBaseColumn != null) + { + individualResizeCommandStack.execute(new SimpleResizeColumnCommand(standardBaseColumn, standardBaseColumn.getWidth() + amount)); + //standardBaseColumn.setWidth(standardBaseColumn.getWidth() + amount); + } + + StandardColumn standardColumn = column instanceof StandardColumn ? (StandardColumn)column : null; + if (standardColumn != null) + { + resizeChildren(standardColumn.getDetailCell(), startX, amount); + } + + resizeChildren(column.getTableHeader(), startX, amount); + resizeChildren(column.getColumnHeader(), startX, amount); + resizeChildren(column.getColumnFooter(), startX, amount); + resizeChildren(column.getTableFooter(), startX, amount); + + for (GroupCell header: column.getGroupHeaders()) { + resizeChildren(header.getCell(), startX, amount); + } + + for (GroupCell footer: column.getGroupFooters()) { + resizeChildren(footer.getCell(), startX, amount); + } + } + + private void resizeChildren(JRElementGroup elementGroup, int startX, int amount) throws CommandException + { + if (elementGroup != null && startX >= 0) + { + for (JRChild child: elementGroup.getChildren()) + { + int childStartX = startX; + int childAmount = amount; + if (child instanceof JRFrame) + { + childStartX = startX - ((JRFrame)child).getX(); + } + + if (child instanceof JRBaseElement) + { + JRBaseElement be = (JRBaseElement) child; + + int resizeAmount = 0; + int moveAmount = 0; + + if (startX <= be.getX()) + { + resizeAmount = 0; + moveAmount = amount; + } + else if (startX <= be.getX() + be.getWidth()) + { + if (amount < be.getX() - startX) + { + resizeAmount = be.getX() - startX; + moveAmount = amount - resizeAmount; + } + else + { + resizeAmount = amount; + moveAmount = amount - resizeAmount;//0 + } + } + else + { + if (startX + amount < be.getX() + be.getWidth()) + { + if (startX + amount > be.getX()) + { + resizeAmount = amount + (startX - (be.getX() + be.getWidth())); + moveAmount = 0; + } + else + { + resizeAmount = - be.getWidth(); + moveAmount = startX + amount - be.getX(); + } + } + else + { + resizeAmount = 0; + moveAmount = 0; + } + } + + if (resizeAmount != 0) + { + individualResizeCommandStack.execute(new ResizeElementCommand(be, be.getWidth() + resizeAmount)); + } + + if (moveAmount != 0) + { + moveAmount = be.getX() + moveAmount < 0 ? -be.getX() : moveAmount; + individualResizeCommandStack.execute(new MoveElementCommand(be, be.getX() + moveAmount)); + } + + childAmount = resizeAmount; + } + + if (child instanceof JRElementGroup) + { + JRElementGroup eg = (JRElementGroup) child; + resizeChildren(eg, childStartX, childAmount); + } + } + } + } + + @Override + public void undo() + { + individualResizeCommandStack.undoAll(); + } + + @Override + public void redo() + { + individualResizeCommandStack.redoAll(); + } + + static public class ColumnUtil + { + private boolean found = false; + private int colIndex; + private int crtColIndex; + private int crtColX; + private List parentColumnGroups = new ArrayList(); + + ColumnUtil(int colIndex) + { + this.colIndex = colIndex; + } + + public List getParentColumnGroups(List columns) + { + Iterator it = columns.iterator(); + while(!found && it.hasNext()) + { + BaseColumn column = it.next(); + if (column instanceof ColumnGroup) + { + ColumnGroupInfo colGroupInfo = new ColumnGroupInfo(); + colGroupInfo.x = crtColX; + colGroupInfo.colIndex = crtColIndex; + colGroupInfo.columnGroup = (ColumnGroup)column; + parentColumnGroups.add(colGroupInfo); + + getParentColumnGroups(((ColumnGroup)column).getColumns()); + + if (!found) + { + parentColumnGroups.remove(parentColumnGroups.size() - 1); + } + } + else + { + if (colIndex == crtColIndex) + { + found = true; + return parentColumnGroups; + } + + crtColIndex++; + crtColX += column.getWidth(); + } + } + + return parentColumnGroups; + } + } + + static public class ColumnGroupInfo + { + public int x; + public int colIndex; + public ColumnGroup columnGroup; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeColumnData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeColumnData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeColumnData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeColumnData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,70 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class ResizeColumnData extends BaseColumnData { + + private int columnIndex; + private int width; + private String direction; + + public ResizeColumnData() { + } + + public ResizeColumnData(String tableUuid, int columnIndex, int width, String direction) { + super(tableUuid); + this.columnIndex = columnIndex; + this.width = width; + this.direction = direction; + } + + public int getColumnIndex() { + return columnIndex; + } + + public void setColumnIndex(int columnIndex) { + this.columnIndex = columnIndex; + } + + public int getWidth() { + return width; + } + + public void setWidth(int width) { + this.width = width; + } + + public String getDirection() { + return direction; + } + + public void setDirection(String direction) { + this.direction = direction; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeElementCommand.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeElementCommand.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeElementCommand.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/ResizeElementCommand.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import net.sf.jasperreports.engine.base.JRBaseElement; +import net.sf.jasperreports.web.commands.Command; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class ResizeElementCommand implements Command +{ + + private int width; + private int oldWidth; + private JRBaseElement receiver; + + public ResizeElementCommand(JRBaseElement receiver, int width) { + this.receiver = receiver; + this.width = width; + this.oldWidth = receiver.getWidth(); + } + + @Override + public void execute() { + receiver.setWidth(width); + } + + @Override + public void undo() { + receiver.setWidth(oldWidth); + } + + @Override + public void redo() { + execute(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/SimpleMoveColumnCommand.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/SimpleMoveColumnCommand.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/SimpleMoveColumnCommand.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/SimpleMoveColumnCommand.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,83 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import java.util.List; + +import net.sf.jasperreports.components.table.BaseColumn; +import net.sf.jasperreports.web.commands.Command; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class SimpleMoveColumnCommand implements Command +{ + + private List columns; + private BaseColumn column; + private int srcColIndex; + private int destColIndex; + + + public SimpleMoveColumnCommand(List columns, BaseColumn column, int srcColIndex, int destColIndex) + { + this.columns = columns; + this.column = column; + this.srcColIndex = srcColIndex; + this.destColIndex = destColIndex; + } + + + @Override + public void execute() + { + moveColumns(srcColIndex, destColIndex); + } + + private void moveColumns(int srcSiblingColIndex, int destSiblingColIndex) + { + columns.remove(srcSiblingColIndex); + if (destSiblingColIndex == columns.size()) + { + columns.add(column); + } + else + { + columns.add(destSiblingColIndex, column); + } + } + + @Override + public void undo() + { + moveColumns(destColIndex, srcColIndex); + } + + @Override + public void redo() + { + execute(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/SimpleResizeColumnCommand.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/SimpleResizeColumnCommand.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/SimpleResizeColumnCommand.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/SimpleResizeColumnCommand.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import net.sf.jasperreports.components.table.StandardBaseColumn; +import net.sf.jasperreports.web.commands.Command; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class SimpleResizeColumnCommand implements Command +{ + private StandardBaseColumn column; + private int oldWidth; + private int width; + + + public SimpleResizeColumnCommand(StandardBaseColumn column, int width) + { + this.column = column; + this.width = width; + this.oldWidth = column.getWidth(); + } + + @Override + public void execute() + { + column.setWidth(width); + } + + @Override + public void undo() + { + column.setWidth(oldWidth); + } + + @Override + public void redo() + { + execute(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/SortAction.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/SortAction.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/SortAction.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/actions/SortAction.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.actions; + +import net.sf.jasperreports.components.sort.actions.SortCommand; +import net.sf.jasperreports.components.sort.actions.SortData; +import net.sf.jasperreports.engine.design.JRDesignDataset; +import net.sf.jasperreports.engine.design.JRDesignDatasetRun; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.repo.JasperDesignCache; +import net.sf.jasperreports.web.actions.ActionException; +import net.sf.jasperreports.web.commands.CommandException; +import net.sf.jasperreports.web.commands.ResetInCacheCommand; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class SortAction extends AbstractVerifiableTableAction { + + public SortAction() { + } + + public SortData getSortData() { + return (SortData)columnData; + } + + public void setSortData(SortData sortData) { + columnData = sortData; + } + + @Override + public void performAction() throws ActionException { + JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)table.getDatasetRun(); + + String datasetName = datasetRun.getDatasetName(); + + JasperDesignCache cache = JasperDesignCache.getInstance(getJasperReportsContext(), getReportContext()); + + JasperDesign jasperDesign = cache.getJasperDesign(targetUri); + JRDesignDataset dataset = (JRDesignDataset)jasperDesign.getDatasetMap().get(datasetName); + + // execute command + try { + getCommandStack().execute( + new ResetInCacheCommand( + new SortCommand(getJasperReportsContext(), dataset, getSortData()), + getJasperReportsContext(), + getReportContext(), + targetUri + ) + ); + } catch (CommandException e) { + throw new ActionException(e); + } + } + + @Override + public void verify() throws ActionException { + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderLabelUtil.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderLabelUtil.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderLabelUtil.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderLabelUtil.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,197 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.util.Map; + +import net.sf.jasperreports.components.table.fill.BuiltinExpressionEvaluator; +import net.sf.jasperreports.engine.JRElement; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRStaticText; +import net.sf.jasperreports.engine.JRTextField; +import net.sf.jasperreports.engine.JRVisitor; +import net.sf.jasperreports.engine.design.JRDesignFrame; +import net.sf.jasperreports.engine.fill.DatasetExpressionEvaluator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillField; +import net.sf.jasperreports.engine.fill.JRFillParameter; +import net.sf.jasperreports.engine.fill.JRFillVariable; +import net.sf.jasperreports.engine.type.WhenResourceMissingTypeEnum; + +/** + * + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class HeaderLabelUtil +{ + /** + * + */ + public static HeaderLabelBuiltinExpression alterHeaderLabel(JRDesignFrame frame, String suffix) + { + HeaderLabelBuiltinExpression evaluator = null; + + JRElement[] elements = frame.getElements(); + JRElement element = (elements == null || elements.length == 0) ? null : elements[0]; + + if (element instanceof JRStaticText) + { + JRElement elementProxy = getProxy((JRStaticText)element, suffix); + frame.getChildren().set(0, elementProxy); + } + else if (element instanceof JRTextField) + { + evaluator = new HeaderLabelBuiltinExpression(((JRTextField)element).getExpression(), suffix); + } + + + return evaluator; + } + + + /** + * + */ + private static JRStaticText getProxy(final JRStaticText staticText, final String suffix) + { + return + (JRStaticText)Proxy.newProxyInstance( + HeaderLabelUtil.class.getClassLoader(), + new Class[]{JRStaticText.class}, + new InvocationHandler() + { + @Override + public Object invoke( + Object proxy, + Method method, + Object[] args + ) throws Throwable + { + if ("getText".equals(method.getName())) + { + return + staticText.getText() + + suffix; + } + if ("visit".equals(method.getName())) + { + ((JRVisitor)args[0]).visitStaticText((JRStaticText)proxy); + return null; + } + return method.invoke(staticText, args); + } + } + ); + } + + + /** + * + * + private static JRTextField getProxy(final JRTextField textField, final SortOrderEnum sortOrder) + { + return + (JRTextField)Proxy.newProxyInstance( + HeaderLabelUtil.class.getClassLoader(), + new Class[]{JRTextField.class}, + new InvocationHandler() + { + public Object invoke( + Object proxy, + Method method, + Object[] args + ) throws Throwable + { + if ("getExpression".equals(method.getName())) + { + JRDesignExpression expression = new JRDesignExpression(); + return + Color.blue; + } + if ("visit".equals(method.getName())) + { + ((JRVisitor)args[0]).visitTextField((JRTextField)proxy); + return null; + } + return method.invoke(textField, args); + } + } + ); + } + + + /** + * + */ + public static class HeaderLabelBuiltinExpression implements BuiltinExpressionEvaluator + { + private final JRExpression expression; + private String suffix; + + public HeaderLabelBuiltinExpression(JRExpression expression, String suffix) + { + this.expression = expression; + this.suffix = suffix; + } + + @Override + public void init(Map parametersMap, + Map fieldsMap, + Map variablesMap, + WhenResourceMissingTypeEnum resourceMissingType) throws JRException + { + // NOP + } + + @Override + public Object evaluate(DatasetExpressionEvaluator evaluator) throws JRExpressionEvalException + { + return evaluator.evaluate(expression) + suffix; + } + + @Override + public Object evaluateOld(DatasetExpressionEvaluator evaluator) throws JRExpressionEvalException + { + return evaluator.evaluateOld(expression) + suffix; + } + + @Override + public Object evaluateEstimated(DatasetExpressionEvaluator evaluator) throws JRExpressionEvalException + { + return evaluator.evaluateEstimated(expression) + suffix; + } + + public JRExpression getExpression() + { + return expression; + } + + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarConditionalStyleProviderExtensionFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarConditionalStyleProviderExtensionFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarConditionalStyleProviderExtensionFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarConditionalStyleProviderExtensionFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar; + +import net.sf.jasperreports.engine.JRPropertiesMap; +import net.sf.jasperreports.engine.style.StyleProviderFactory; +import net.sf.jasperreports.extensions.ExtensionsRegistry; +import net.sf.jasperreports.extensions.ExtensionsRegistryFactory; +import net.sf.jasperreports.extensions.SingletonExtensionRegistry; + +/** + * Extension factory for {@link HeaderToolbarConditionalStyleProviderFactory}. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class HeaderToolbarConditionalStyleProviderExtensionFactory implements ExtensionsRegistryFactory +{ + + private static final ExtensionsRegistry REGISTRY = + new SingletonExtensionRegistry(StyleProviderFactory.class, + HeaderToolbarConditionalStyleProviderFactory.getInstance()); + + @Override + public ExtensionsRegistry createRegistry(String registryId, JRPropertiesMap properties) + { + return REGISTRY; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarConditionalStyleProviderFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarConditionalStyleProviderFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarConditionalStyleProviderFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarConditionalStyleProviderFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar; + +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.style.StyleProvider; +import net.sf.jasperreports.engine.style.StyleProviderContext; +import net.sf.jasperreports.engine.style.StyleProviderFactory; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public final class HeaderToolbarConditionalStyleProviderFactory implements StyleProviderFactory +{ + + private static final HeaderToolbarConditionalStyleProviderFactory INSTANCE = new HeaderToolbarConditionalStyleProviderFactory(); + + private HeaderToolbarConditionalStyleProviderFactory() + { + } + + /** + * + */ + public static HeaderToolbarConditionalStyleProviderFactory getInstance() + { + return INSTANCE; + } + + @Override + public StyleProvider getStyleProvider(StyleProviderContext context, JasperReportsContext jasperreportsContext) + { + return new HeaderToolbarConditionalStyleProvider(context, jasperreportsContext); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarConditionalStyleProvider.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarConditionalStyleProvider.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarConditionalStyleProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarConditionalStyleProvider.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,161 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar; + +import java.awt.Color; + +import net.sf.jasperreports.components.headertoolbar.actions.ConditionalFormattingCommand; +import net.sf.jasperreports.components.headertoolbar.actions.ConditionalFormattingData; +import net.sf.jasperreports.components.headertoolbar.actions.FormatCondition; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRStyle; +import net.sf.jasperreports.engine.JRTextField; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.base.JRBaseStyle; +import net.sf.jasperreports.engine.style.StyleProvider; +import net.sf.jasperreports.engine.style.StyleProviderContext; +import net.sf.jasperreports.engine.type.ModeEnum; +import net.sf.jasperreports.engine.util.JRColorUtil; +import net.sf.jasperreports.engine.util.JRDataUtils; +import net.sf.jasperreports.web.util.JacksonUtil; + +/** + * + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class HeaderToolbarConditionalStyleProvider implements StyleProvider +{ + private final StyleProviderContext context; + private JasperReportsContext jasperreportsContext; + + public HeaderToolbarConditionalStyleProvider(StyleProviderContext context, JasperReportsContext jasperreportsContext) + { + this.context = context; + this.jasperreportsContext = jasperreportsContext; + } + + @Override + public JRStyle getStyle(byte evaluation) + { + if (context.getElement().getPropertiesMap() != null) + { + String srlzdConditionalFormattingData = context.getElement().getPropertiesMap().getProperty(ConditionalFormattingCommand.COLUMN_CONDITIONAL_FORMATTING_PROPERTY); + if (srlzdConditionalFormattingData != null) + { + JRStyle style = null; + + ConditionalFormattingData cfd = JacksonUtil.getInstance(jasperreportsContext).loadObject(srlzdConditionalFormattingData, ConditionalFormattingData.class); + if (cfd.getConditions().size() > 0) + { + Object compareTo; + + if (context.getElement().getPropertiesMap().containsProperty(HeaderToolbarElement.PROPERTY_COLUMN_FIELD)) { + String fieldName = context.getElement().getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_COLUMN_FIELD); + compareTo = context.getFieldValue(fieldName, evaluation); + } else if (context.getElement().getPropertiesMap().containsProperty(HeaderToolbarElement.PROPERTY_COLUMN_VARIABLE)) { + String variableName = context.getElement().getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_COLUMN_VARIABLE); + compareTo = context.getVariableValue(variableName, evaluation); + } else { + JRExpression expression = context.getElement() instanceof JRTextField ? ((JRTextField)context.getElement()).getExpression() : null; + compareTo = context.evaluateExpression(expression, evaluation); + } + + boolean bgColorSet = false; + boolean fontBoldSet = false; + boolean fontItalicSet = false; + boolean fontUnderlineSet = false; + boolean foreColorSet = false; + boolean modeSet = false; + for (FormatCondition condition: cfd.getConditions()) + { + if( + condition.matches( + compareTo, + cfd.getConditionType(), + cfd.getConditionPattern(), + condition.getConditionTypeOperator(), + cfd.getLocaleCode() == null ? context.getLocale() : JRDataUtils.getLocale(cfd.getLocaleCode()), + cfd.getTimeZoneId() == null ? context.getTimeZone() : JRDataUtils.getTimeZone(cfd.getTimeZoneId()) + ) + ) + { + if (style == null) + { + style = new JRBaseStyle(); + } + + if (condition.isConditionFontBold() != null && !fontBoldSet) + { + style.setBold(condition.isConditionFontBold()); + fontBoldSet = true; + } + if (condition.isConditionFontItalic() != null && !fontItalicSet) + { + style.setItalic(condition.isConditionFontItalic()); + fontItalicSet = true; + } + if (condition.isConditionFontUnderline() != null && !fontUnderlineSet) + { + style.setUnderline(condition.isConditionFontUnderline()); + fontUnderlineSet = true; + } + if (condition.getConditionFontColor() != null && !foreColorSet) + { + style.setForecolor(JRColorUtil.getColor("#" + condition.getConditionFontColor(), Color.black)); + foreColorSet = true; + } + if (condition.getConditionMode() != null && !modeSet) + { + style.setMode(ModeEnum.getByName(condition.getConditionMode())); + modeSet = true; + } + if (condition.getConditionFontBackColor() != null && !bgColorSet) + { + style.setBackcolor(JRColorUtil.getColor("#" + condition.getConditionFontBackColor(), Color.white)); + bgColorSet = true; + } + } + } + } + + return style; + } + } + return null; + } + + @Override + public String[] getFields() + { + return null; + } + + @Override + public String[] getVariables() + { + return null; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarElement.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarElement.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarElement.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarElement.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar; + +import net.sf.jasperreports.engine.JRGenericElementType; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.xml.JRXmlConstants; + + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public interface HeaderToolbarElement { + + public static final String ELEMENT_NAME = "headertoolbar"; + public static final JRGenericElementType ELEMENT_TYPE = new JRGenericElementType(JRXmlConstants.JASPERREPORTS_NAMESPACE, ELEMENT_NAME); + + public static final String PARAM_COLUMN_LABEL_PREFIX = "column."; + + public static final String SORT_ORDER_ASC = "Asc"; + public static final String SORT_ORDER_DESC = "Dsc"; + public static final String SORT_ORDER_NONE = "None"; + public static final String SORT_COLUMN_TOKEN_SEPARATOR = ":"; + + public static final String PROPERTY_TABLE_UUID = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.tableUUID"; + public static final String PROPERTY_TABLE_NAME = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.table.name"; + public static final String PROPERTY_COLUMN_UUID = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.columnUUID"; + public static final String PROPERTY_CELL_ID = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.cellID"; + + public static final String PROPERTY_FLOATING_HEADER = JRPropertiesUtil.PROPERTY_PREFIX + "export.table.floating.header"; + /** + * @deprecated To be removed. + */ + public static final String PROPERTY_COLUMN_FIELD_OR_VARIABLE_NAME = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.field.or.variable"; + public static final String PROPERTY_COLUMN_NAME = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.sortColumnName"; + public static final String PROPERTY_COLUMN_COMPONENT_NAME = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.column.name"; + public static final String PARAMETER_COLUMN_LABEL = "sortColumnLabel"; + public static final String PROPERTY_COLUMN_TYPE = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.sortColumnType"; + public static final String PROPERTY_COLUMN_INDEX = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.columnIndex"; + public static final String PROPERTY_COLUMN_FIELD = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.column.field"; + public static final String PROPERTY_COLUMN_VARIABLE = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.column.variable"; + + public static final String PROPERTY_FILTER_TYPE = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.filter.type"; + public static final String PROPERTY_FILTER_PATTERN = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.filter.pattern"; + + public static final String PROPERTY_CAN_SORT = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.can.sort"; + public static final String PROPERTY_CAN_FILTER = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.can.filter"; + public static final String PROPERTY_CAN_MOVE = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.can.move"; + public static final String PROPERTY_CAN_RESIZE = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.can.resize"; + /** + * @deprecated To be removed. + */ + public static final String PROPERTY_CAN_FORMAT_CONDITIONALLY = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.can.format.conditionally"; + public static final String PROPERTY_CONDTION_TYPE = JRPropertiesUtil.PROPERTY_PREFIX + "components.condition.type"; + + public static final String PROPERTY_FORMAT_TIME_ZONE = JRPropertiesUtil.PROPERTY_PREFIX + "export.headertoolbar.format.time.zone"; +} \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarElementUtils.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarElementUtils.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarElementUtils.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarElementUtils.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,578 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar; + +import java.sql.Time; +import java.text.DateFormat; +import java.text.NumberFormat; +import java.text.ParseException; +import java.util.Date; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.TimeZone; + +import net.sf.jasperreports.components.headertoolbar.actions.ConditionalFormattingCommand; +import net.sf.jasperreports.components.headertoolbar.actions.ConditionalFormattingData; +import net.sf.jasperreports.components.headertoolbar.actions.EditTextElementData; +import net.sf.jasperreports.components.headertoolbar.actions.FormatCondition; +import net.sf.jasperreports.components.sort.FilterTypesEnum; +import net.sf.jasperreports.components.sort.actions.FilterData; +import net.sf.jasperreports.components.table.util.TableUtil; +import net.sf.jasperreports.engine.JRField; +import net.sf.jasperreports.engine.JRPropertiesMap; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JRVariable; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.design.JRDesignDataset; +import net.sf.jasperreports.engine.design.JRDesignTextElement; +import net.sf.jasperreports.engine.design.JRDesignTextField; +import net.sf.jasperreports.engine.type.SortOrderEnum; +import net.sf.jasperreports.engine.util.DefaultFormatFactory; +import net.sf.jasperreports.engine.util.FormatFactory; +import net.sf.jasperreports.engine.util.JRColorUtil; +import net.sf.jasperreports.engine.util.JRDataUtils; +import net.sf.jasperreports.engine.util.JRStringUtil; +import net.sf.jasperreports.engine.util.MessageProvider; +import net.sf.jasperreports.engine.util.MessageUtil; +import net.sf.jasperreports.web.util.JacksonUtil; + + + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class HeaderToolbarElementUtils +{ + private static final String DEFAULT_PATTERNS_BUNDLE = "net.sf.jasperreports.components.messages"; + private static final String DEFAULT_DATE_PATTERN_KEY = "net.sf.jasperreports.components.date.pattern"; + private static final String DEFAULT_TIME_PATTERN_KEY = "net.sf.jasperreports.components.time.pattern"; + private static final String DEFAULT_NUMBER_PATTERN_KEY = "net.sf.jasperreports.components.number.pattern"; + private static final String DATE_PATTERN_BUNDLE = DEFAULT_DATE_PATTERN_KEY + ".bundle"; + private static final String DATE_PATTERN_KEY = DEFAULT_DATE_PATTERN_KEY + ".key"; + private static final String TIME_PATTERN_BUNDLE = DEFAULT_TIME_PATTERN_KEY + ".bundle"; + private static final String TIME_PATTERN_KEY = DEFAULT_TIME_PATTERN_KEY + ".key"; + private static final String NUMBER_PATTERN_BUNDLE = DEFAULT_NUMBER_PATTERN_KEY + ".bundle"; + private static final String NUMBER_PATTERN_KEY = DEFAULT_NUMBER_PATTERN_KEY + ".key"; + private static final String DEFAULT_CALENDAR_DATE_PATTERN_KEY = "net.sf.jasperreports.components.calendar.date.pattern"; + private static final String DEFAULT_CALENDAR_DATE_TIME_PATTERN_KEY = "net.sf.jasperreports.components.calendar.date.time.pattern"; + private static final String CALENDAR_DATE_PATTERN_BUNDLE = DEFAULT_CALENDAR_DATE_PATTERN_KEY + ".bundle"; + private static final String CALENDAR_DATE_PATTERN_KEY = DEFAULT_CALENDAR_DATE_PATTERN_KEY + ".key"; + private static final String CALENDAR_DATE_TIME_PATTERN_KEY = DEFAULT_CALENDAR_DATE_TIME_PATTERN_KEY + ".key"; + + private static Map sortOrderMapping = new HashMap(); + + static { + sortOrderMapping.put(HeaderToolbarElement.SORT_ORDER_ASC, SortOrderEnum.ASCENDING); + sortOrderMapping.put(HeaderToolbarElement.SORT_ORDER_DESC, SortOrderEnum.DESCENDING); + } + + public static String[] extractColumnInfo(String sortColumn) { + return sortColumn.split(HeaderToolbarElement.SORT_COLUMN_TOKEN_SEPARATOR); + } + + public static String packSortColumnInfo(String columnName, String columnType, String sortOrder) { + StringBuilder sb = new StringBuilder(); + sb.append(columnName) + .append(HeaderToolbarElement.SORT_COLUMN_TOKEN_SEPARATOR) + .append(columnType) + .append(HeaderToolbarElement.SORT_COLUMN_TOKEN_SEPARATOR) + .append(sortOrder); + return sb.toString(); + } + + public static boolean isValidSortData(String sortData) { + return sortData != null + && sortData.indexOf(HeaderToolbarElement.SORT_COLUMN_TOKEN_SEPARATOR) >= 0 + && sortData.split(HeaderToolbarElement.SORT_COLUMN_TOKEN_SEPARATOR).length > 1; + } + + public static SortOrderEnum getSortOrder(String sortOrder) { + return sortOrderMapping.get(sortOrder); + } + + public static FilterTypesEnum getFilterType(Class clazz) { + FilterTypesEnum result = null; + if (Number.class.isAssignableFrom(clazz)) + { + result = FilterTypesEnum.NUMERIC; + } + else if (String.class.isAssignableFrom(clazz)) + { + result = FilterTypesEnum.TEXT; + } + else if (Time.class.isAssignableFrom(clazz)) + { + result = FilterTypesEnum.TIME; + } + else if (Date.class.isAssignableFrom(clazz)) + { + result = FilterTypesEnum.DATE; + } + else if (Boolean.class.isAssignableFrom(clazz)) + { + result = FilterTypesEnum.BOOLEAN; + } + return result; + } + + public static void copyOwnTextElementStyle(EditTextElementData textElementData, JRDesignTextElement textElement, Locale locale) { + textElementData.setFontName(textElement.getOwnFontName()); + textElementData.setFontSize(textElement.getOwnFontsize() != null ? NumberFormat.getNumberInstance(locale).format(textElement.getOwnFontsize()) : null); + textElementData.setFloatFontSize(textElement.getOwnFontsize() != null ? textElement.getOwnFontsize() : null); + textElementData.setFontBold(textElement.isOwnBold()); + textElementData.setFontItalic(textElement.isOwnItalic()); + textElementData.setFontUnderline(textElement.isOwnUnderline()); + textElementData.setFontColor(textElement.getOwnForecolor() != null ? JRColorUtil.getColorHexa(textElement.getOwnForecolor()) : null); + textElementData.setFontBackColor(textElement.getOwnBackcolor() != null ? JRColorUtil.getColorHexa(textElement.getOwnBackcolor()) : null); + textElementData.setFontHAlign(textElement.getOwnHorizontalTextAlign() != null ? textElement.getOwnHorizontalTextAlign().getName() : null); + textElementData.setMode(textElement.getOwnModeValue() != null ? textElement.getOwnModeValue().getName() : null); + + if (textElement instanceof JRDesignTextField && TableUtil.hasSingleChunkExpression((JRDesignTextField) textElement)) { + textElementData.setFormatPattern(((JRDesignTextField) textElement).getOwnPattern()); + } + } + + public static void copyTextElementStyle(EditTextElementData textElementData, JRDesignTextElement textElement, Locale locale) { + textElementData.setFontName(JRStringUtil.htmlEncode(textElement.getFontName())); + textElementData.setFontSize(NumberFormat.getNumberInstance(locale).format(textElement.getFontsize())); + textElementData.setFloatFontSize(textElement.getFontsize()); + textElementData.setFontBold(textElement.isBold()); + textElementData.setFontItalic(textElement.isItalic()); + textElementData.setFontUnderline(textElement.isUnderline()); + textElementData.setFontColor(JRColorUtil.getColorHexa(textElement.getForecolor())); + textElementData.setFontBackColor(JRColorUtil.getColorHexa(textElement.getBackcolor())); + textElementData.setFontHAlign(textElement.getHorizontalTextAlign().getName()); + textElementData.setMode(textElement.getModeValue().getName()); + + if (textElement instanceof JRDesignTextField && TableUtil.hasSingleChunkExpression((JRDesignTextField) textElement)) { + textElementData.setFormatPattern(JRStringUtil.htmlEncode(((JRDesignTextField) textElement).getPattern())); + } + } + + + /** + * + */ + public static void updateFilterData( + FilterData filterData, + String filterPattern, + Locale locale, + TimeZone timeZone + ) + { + switch (FilterTypesEnum.getByName(filterData.getFilterType())) + { + case TEXT : + { + // html encode the conditions for text based columns + filterData.setFieldValueStart(JRStringUtil.htmlEncode(filterData.getFieldValueStart())); + break; + } + case DATE : + case TIME : + { + FormatFactory formatFactory = new DefaultFormatFactory(); + DateFormat newDf = + formatFactory.createDateFormat( + filterPattern, + locale, + timeZone + ); + newDf.setLenient(false); + DateFormat oldDf = + formatFactory.createDateFormat( + filterData.getFilterPattern(), + filterData.getLocaleCode() == null ? locale : JRDataUtils.getLocale(filterData.getLocaleCode()), + filterData.getTimeZoneId() == null ? timeZone : JRDataUtils.getTimeZone(filterData.getTimeZoneId()) + ); + oldDf.setLenient(false); + + try + { + if (filterData.getFieldValueStart() != null && !filterData.getFieldValueStart().trim().isEmpty()) + { + filterData.setFieldValueStart( + newDf.format(oldDf.parse(filterData.getFieldValueStart())) + ); + } + if (filterData.getFieldValueEnd() != null && !filterData.getFieldValueEnd().trim().isEmpty()) + { + filterData.setFieldValueEnd( + newDf.format(oldDf.parse(filterData.getFieldValueEnd())) + ); + } + } + catch (ParseException e) + { + throw new JRRuntimeException(e); + } + break; + } + case NUMERIC : + { + FormatFactory formatFactory = new DefaultFormatFactory(); + NumberFormat newNf = + formatFactory.createNumberFormat( + filterPattern, + locale + ); + NumberFormat oldNf = + formatFactory.createNumberFormat( + filterData.getFilterPattern(), + filterData.getLocaleCode() == null ? locale : JRDataUtils.getLocale(filterData.getLocaleCode()) + ); + + try + { + if (filterData.getFieldValueStart() != null && !filterData.getFieldValueStart().trim().isEmpty()) + { + filterData.setFieldValueStart( + newNf.format(oldNf.parse(filterData.getFieldValueStart())) + ); + } + if (filterData.getFieldValueEnd() != null && !filterData.getFieldValueEnd().trim().isEmpty()) + { + filterData.setFieldValueEnd( + newNf.format(oldNf.parse(filterData.getFieldValueEnd())) + ); + } + } + catch (ParseException e) + { + throw new JRRuntimeException(e); + } + break; + } + } + + filterData.setFilterPattern(filterPattern); + filterData.setLocaleCode(JRDataUtils.getLocaleCode(locale)); + filterData.setTimeZoneId(JRDataUtils.getTimeZoneId(timeZone));//FIXME only set this for date/time? + } + + /** + * + */ + public static ConditionalFormattingData getConditionalFormattingData( + JRDesignTextElement textElement, + JasperReportsContext jasperReportsContext + ) + { + ConditionalFormattingData cfd = null; + if (textElement != null) + { + JRPropertiesMap propertiesMap = textElement.getPropertiesMap(); + if ( + propertiesMap.containsProperty(ConditionalFormattingCommand.COLUMN_CONDITIONAL_FORMATTING_PROPERTY) + && propertiesMap.getProperty(ConditionalFormattingCommand.COLUMN_CONDITIONAL_FORMATTING_PROPERTY) != null + ) + { + cfd = + JacksonUtil.getInstance(jasperReportsContext).loadObject( + propertiesMap.getProperty(ConditionalFormattingCommand.COLUMN_CONDITIONAL_FORMATTING_PROPERTY), + ConditionalFormattingData.class + ); + } + } + return cfd; + } + + /** + * + */ + public static void updateConditionalFormattingData( + ConditionalFormattingData cfd, + String conditionPattern, + Locale locale, + TimeZone timeZone + ) + { + switch (FilterTypesEnum.getByName(cfd.getConditionType())) + { + case TEXT : + { + // html encode the conditions for text based columns + for (FormatCondition fc: cfd.getConditions()) + { + fc.setConditionStart(JRStringUtil.htmlEncode(fc.getConditionStart())); + } + break; + } + case DATE : + case TIME : + { + FormatFactory formatFactory = new DefaultFormatFactory(); + DateFormat newDf = + formatFactory.createDateFormat( + conditionPattern, + locale, + timeZone + ); + newDf.setLenient(false); + DateFormat oldDf = + formatFactory.createDateFormat( + cfd.getConditionPattern(), + cfd.getLocaleCode() == null ? locale : JRDataUtils.getLocale(cfd.getLocaleCode()), + cfd.getTimeZoneId() == null ? timeZone : JRDataUtils.getTimeZone(cfd.getTimeZoneId()) + ); + oldDf.setLenient(false); + + try + { + for (FormatCondition fc: cfd.getConditions()) + { + if (fc.getConditionStart() != null && !fc.getConditionStart().trim().isEmpty()) + { + fc.setConditionStart( + newDf.format(oldDf.parse(fc.getConditionStart())) + ); + } + if (fc.getConditionEnd() != null && !fc.getConditionEnd().trim().isEmpty()) + { + fc.setConditionEnd( + newDf.format(oldDf.parse(fc.getConditionEnd())) + ); + } + } + } + catch (ParseException e) + { + throw new JRRuntimeException(e); + } + break; + } + case NUMERIC : + { + FormatFactory formatFactory = new DefaultFormatFactory(); + NumberFormat newNf = + formatFactory.createNumberFormat( + conditionPattern, + locale + ); + NumberFormat oldNf = + formatFactory.createNumberFormat( + cfd.getConditionPattern(), + cfd.getLocaleCode() == null ? locale : JRDataUtils.getLocale(cfd.getLocaleCode()) + ); + + try + { + for (FormatCondition fc: cfd.getConditions()) + { + if (fc.getConditionStart() != null && !fc.getConditionStart().trim().isEmpty()) + { + fc.setConditionStart( + newNf.format(oldNf.parse(fc.getConditionStart())) + ); + } + if (fc.getConditionEnd() != null && !fc.getConditionEnd().trim().isEmpty()) + { + fc.setConditionEnd( + newNf.format(oldNf.parse(fc.getConditionEnd())) + ); + } + } + } + catch (ParseException e) + { + throw new JRRuntimeException(e); + } + break; + } + } + + cfd.setConditionPattern(conditionPattern); + cfd.setLocaleCode(JRDataUtils.getLocaleCode(locale)); + cfd.setTimeZoneId(JRDataUtils.getTimeZoneId(timeZone)); + } + + /** + * + */ + public static JRField getField(String name, JRDesignDataset dataSet) + { + JRField found = null; + for (JRField field : dataSet.getFields()) + { + if (name.equals(field.getName())) + { + found = field; + break; + } + } + return found; + } + + /** + * + */ + public static JRVariable getVariable(String name, JRDesignDataset dataSet) + { + JRVariable found = null; + for (JRVariable var : dataSet.getVariables()) + { + if (name.equals(var.getName())) + { + found = var; + break; + } + } + return found; + } + + + public static String getFilterPattern( + JasperReportsContext jasperReportsContext, + Locale locale, + FilterTypesEnum filterType + ) + { + String pattern = null; + switch (filterType) + { + case DATE : + { + pattern = HeaderToolbarElementUtils.getDatePattern(jasperReportsContext, locale); + break; + } + case TIME : + { + pattern = HeaderToolbarElementUtils.getTimePattern(jasperReportsContext, locale); + break; + } + case NUMERIC : + { + pattern = HeaderToolbarElementUtils.getNumberPattern(jasperReportsContext, locale); + break; + } + case TEXT : + default : + { + } + } + return pattern; + } + + /** + * + */ + public static String getNumberPattern(JasperReportsContext jrContext, Locale locale) + { + String numberPatternBundleName = JRPropertiesUtil.getInstance(jrContext).getProperty(NUMBER_PATTERN_BUNDLE); + if (numberPatternBundleName == null) + { + numberPatternBundleName = DEFAULT_PATTERNS_BUNDLE; + } + String numberPatternKey = JRPropertiesUtil.getInstance(jrContext).getProperty(NUMBER_PATTERN_KEY); + if (numberPatternKey == null) + { + numberPatternKey = DEFAULT_NUMBER_PATTERN_KEY; + } + return getBundleMessage(numberPatternKey, jrContext, numberPatternBundleName, locale); + } + + /** + * + */ + public static String getDatePattern(JasperReportsContext jrContext, Locale locale) + { + String datePatternBundleName = JRPropertiesUtil.getInstance(jrContext).getProperty(DATE_PATTERN_BUNDLE); + if (datePatternBundleName == null) + { + datePatternBundleName = DEFAULT_PATTERNS_BUNDLE; + } + String datePatternKey = JRPropertiesUtil.getInstance(jrContext).getProperty(DATE_PATTERN_KEY); + if (datePatternKey == null) + { + datePatternKey = DEFAULT_DATE_PATTERN_KEY; + } + return getBundleMessage(datePatternKey, jrContext, datePatternBundleName, locale); + } + + /** + * + */ + public static String getTimePattern(JasperReportsContext jrContext, Locale locale) + { + String timePatternBundleName = JRPropertiesUtil.getInstance(jrContext).getProperty(TIME_PATTERN_BUNDLE); + if (timePatternBundleName == null) + { + timePatternBundleName = DEFAULT_PATTERNS_BUNDLE; + } + + String timePatternKey = JRPropertiesUtil.getInstance(jrContext).getProperty(TIME_PATTERN_KEY); + if (timePatternKey == null) + { + timePatternKey = DEFAULT_TIME_PATTERN_KEY; + } + return getBundleMessage(timePatternKey, jrContext, timePatternBundleName, locale); + } + + /** + * + */ + public static String getCalendarDatePattern(JasperReportsContext jrContext, Locale locale) + { + String calendarDatePatternBundleName = JRPropertiesUtil.getInstance(jrContext).getProperty(CALENDAR_DATE_PATTERN_BUNDLE); + if (calendarDatePatternBundleName == null) + { + calendarDatePatternBundleName = DEFAULT_PATTERNS_BUNDLE; + } + String calendarDatePatternKey = JRPropertiesUtil.getInstance(jrContext).getProperty(CALENDAR_DATE_PATTERN_KEY); + if (calendarDatePatternKey == null) + { + calendarDatePatternKey = DEFAULT_CALENDAR_DATE_PATTERN_KEY; + } + return getBundleMessage(calendarDatePatternKey, jrContext, calendarDatePatternBundleName, locale); + } + + /** + * + */ + public static String getCalendarTimePattern(JasperReportsContext jrContext, Locale locale) + { + String timePatternBundleName = JRPropertiesUtil.getInstance(jrContext).getProperty(TIME_PATTERN_BUNDLE); + if (timePatternBundleName == null) + { + timePatternBundleName = DEFAULT_PATTERNS_BUNDLE; + } + String calendarTimePatternKey = JRPropertiesUtil.getInstance(jrContext).getProperty(CALENDAR_DATE_TIME_PATTERN_KEY); + if (calendarTimePatternKey == null) + { + calendarTimePatternKey = DEFAULT_CALENDAR_DATE_TIME_PATTERN_KEY; + } + return getBundleMessage(calendarTimePatternKey, jrContext, timePatternBundleName, locale); + } + + /** + * + */ + public static String getBundleMessage(String key, JasperReportsContext jasperReportsContext, String bundleName, Locale locale) + { + MessageProvider messageProvider = MessageUtil.getInstance(jasperReportsContext).getMessageProvider(bundleName); + return messageProvider.getMessage(key, null, locale); + } +} \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarParameterContributorExtensionFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarParameterContributorExtensionFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarParameterContributorExtensionFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarParameterContributorExtensionFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar; + +import net.sf.jasperreports.engine.JRPropertiesMap; +import net.sf.jasperreports.engine.ParameterContributorFactory; +import net.sf.jasperreports.extensions.ExtensionsRegistry; +import net.sf.jasperreports.extensions.ExtensionsRegistryFactory; +import net.sf.jasperreports.extensions.SingletonExtensionRegistry; + +/** + * Extension factory for {@link HeaderToolbarParameterContributorFactory}. + * + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class HeaderToolbarParameterContributorExtensionFactory implements ExtensionsRegistryFactory +{ + + private static final ExtensionsRegistry REGISTRY = + new SingletonExtensionRegistry(ParameterContributorFactory.class, + HeaderToolbarParameterContributorFactory.getInstance()); + + @Override + public ExtensionsRegistry createRegistry(String registryId, JRPropertiesMap properties) + { + return REGISTRY; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarParameterContributorFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarParameterContributorFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarParameterContributorFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarParameterContributorFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar; + +import java.util.Collections; +import java.util.List; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.ParameterContributor; +import net.sf.jasperreports.engine.ParameterContributorContext; +import net.sf.jasperreports.engine.ParameterContributorFactory; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public final class HeaderToolbarParameterContributorFactory implements ParameterContributorFactory +{ + + private static final HeaderToolbarParameterContributorFactory INSTANCE = new HeaderToolbarParameterContributorFactory(); + + private HeaderToolbarParameterContributorFactory() + { + } + + /** + * + */ + public static HeaderToolbarParameterContributorFactory getInstance() + { + return INSTANCE; + } + + @Override + public List getContributors(ParameterContributorContext context) throws JRException + { + return Collections.singletonList(new HeaderToolbarParameterContributor(context)); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarParameterContributor.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarParameterContributor.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarParameterContributor.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/HeaderToolbarParameterContributor.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,84 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar; + +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.components.sort.FieldFilter; +import net.sf.jasperreports.components.sort.actions.FilterCommand; +import net.sf.jasperreports.engine.CompositeDatasetFilter; +import net.sf.jasperreports.engine.DatasetFilter; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRParameter; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.ParameterContributor; +import net.sf.jasperreports.engine.ParameterContributorContext; +import net.sf.jasperreports.engine.ReportContext; +import net.sf.jasperreports.web.util.JacksonUtil; + +/** + * + * + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class HeaderToolbarParameterContributor implements ParameterContributor +{ + private final ParameterContributorContext context; + + public HeaderToolbarParameterContributor (ParameterContributorContext context) + { + this.context = context; + } + + @Override + public void contributeParameters(Map parameterValues) throws JRException + { + ReportContext reportContext = (ReportContext) parameterValues.get(JRParameter.REPORT_CONTEXT); + if (reportContext != null) + { + String serializedFilters = JRPropertiesUtil.getOwnProperty(context.getDataset(), FilterCommand.DATASET_FILTER_PROPERTY); + + if (serializedFilters != null) + { + List existingFilters = getFilters(serializedFilters); + parameterValues.put(JRParameter.FILTER, new CompositeDatasetFilter(existingFilters)); + } + } + } + + protected List getFilters(String serializedFilters) + { + if (serializedFilters != null) + { + return JacksonUtil.getInstance(context.getJasperReportsContext()).loadList(serializedFilters, FieldFilter.class); + } + return null; + } + + @Override + public void dispose() { + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/ColumnFormatting.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/ColumnFormatting.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/ColumnFormatting.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/ColumnFormatting.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,94 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.json; + +import java.io.Serializable; +import java.util.Locale; +import java.util.Map; +import java.util.TimeZone; +import java.util.concurrent.ConcurrentHashMap; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.ReportContext; +import net.sf.jasperreports.engine.util.JRDataUtils; +import net.sf.jasperreports.engine.util.Pair; + +/** + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class ColumnFormatting implements Serializable +{ + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String CONTEXT_PARAMETER_COLUMN_FORMATTING = "net.sf.jasperreports.headertoolbar.column.formatting"; + + public static void store(ReportContext reportContext, String tableUUID, int columnIndex, + Locale locale, TimeZone timeZone) + { + // storing locale and timezone per column to be used in ConditionalFormattingAction. + // we need to do that because, unlike for filters, conditional formatting action json does not contain the locale and timezone. + //FIXME for now this is never cleared, we need to find a place do do that. + Map, ColumnFormatting> columnFormattingMap = (Map, ColumnFormatting>) + reportContext.getParameterValue(CONTEXT_PARAMETER_COLUMN_FORMATTING); + if (columnFormattingMap == null) + { + //FIXME concurrency? + columnFormattingMap = new ConcurrentHashMap, ColumnFormatting>(); + reportContext.setParameterValue(CONTEXT_PARAMETER_COLUMN_FORMATTING, columnFormattingMap); + } + + ColumnFormatting columnFormatting = new ColumnFormatting( + JRDataUtils.getLocaleCode(locale), JRDataUtils.getTimeZoneId(timeZone)); + columnFormattingMap.put(new Pair(tableUUID, columnIndex), columnFormatting); + } + + public static ColumnFormatting get(ReportContext reportContext, String tableUUID, int columnIndex) + { + Map, ColumnFormatting> columnFormattingMap = (Map, ColumnFormatting>) + reportContext.getParameterValue(CONTEXT_PARAMETER_COLUMN_FORMATTING); + ColumnFormatting columnFormatting = columnFormattingMap == null ? null + : columnFormattingMap.get(new Pair(tableUUID, columnIndex)); + return columnFormatting; + } + + private final String localeCode; + private final String timeZoneId; + + public ColumnFormatting(String localeCode, String timeZoneId) + { + this.localeCode = localeCode; + this.timeZoneId = timeZoneId; + } + + public String getLocaleCode() + { + return localeCode; + } + + public String getTimeZoneId() + { + return timeZoneId; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/HeaderToolbarElementJsonHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/HeaderToolbarElementJsonHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/HeaderToolbarElementJsonHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/HeaderToolbarElementJsonHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,1092 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.headertoolbar.json; + +import java.awt.GraphicsEnvironment; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.TimeZone; +import java.util.TreeSet; +import java.util.UUID; + +import net.sf.jasperreports.components.headertoolbar.HeaderToolbarElement; +import net.sf.jasperreports.components.headertoolbar.HeaderToolbarElementUtils; +import net.sf.jasperreports.components.headertoolbar.actions.ConditionalFormattingData; +import net.sf.jasperreports.components.headertoolbar.actions.EditTextElementData; +import net.sf.jasperreports.components.headertoolbar.actions.FilterAction; +import net.sf.jasperreports.components.headertoolbar.actions.SortAction; +import net.sf.jasperreports.components.sort.FieldFilter; +import net.sf.jasperreports.components.sort.FilterTypeBooleanOperatorsEnum; +import net.sf.jasperreports.components.sort.FilterTypeDateOperatorsEnum; +import net.sf.jasperreports.components.sort.FilterTypeNumericOperatorsEnum; +import net.sf.jasperreports.components.sort.FilterTypeTextOperatorsEnum; +import net.sf.jasperreports.components.sort.FilterTypesEnum; +import net.sf.jasperreports.components.sort.actions.FilterCommand; +import net.sf.jasperreports.components.sort.actions.FilterData; +import net.sf.jasperreports.components.sort.actions.SortData; +import net.sf.jasperreports.components.table.BaseColumn; +import net.sf.jasperreports.components.table.Column; +import net.sf.jasperreports.components.table.ColumnGroup; +import net.sf.jasperreports.components.table.GroupCell; +import net.sf.jasperreports.components.table.StandardColumn; +import net.sf.jasperreports.components.table.StandardTable; +import net.sf.jasperreports.components.table.util.TableUtil; +import net.sf.jasperreports.engine.DatasetFilter; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionChunk; +import net.sf.jasperreports.engine.JRField; +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRIdentifiable; +import net.sf.jasperreports.engine.JRPropertiesMap; +import net.sf.jasperreports.engine.JRSortField; +import net.sf.jasperreports.engine.JRStyle; +import net.sf.jasperreports.engine.JRStyleContainer; +import net.sf.jasperreports.engine.JRVariable; +import net.sf.jasperreports.engine.JasperPrint; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.ReportContext; +import net.sf.jasperreports.engine.base.JRBasePrintHyperlink; +import net.sf.jasperreports.engine.design.JRDesignComponentElement; +import net.sf.jasperreports.engine.design.JRDesignDataset; +import net.sf.jasperreports.engine.design.JRDesignDatasetRun; +import net.sf.jasperreports.engine.design.JRDesignTextElement; +import net.sf.jasperreports.engine.design.JRDesignTextField; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.export.GenericElementJsonHandler; +import net.sf.jasperreports.engine.export.JsonExporterContext; +import net.sf.jasperreports.engine.fonts.FontUtil; +import net.sf.jasperreports.engine.type.ModeEnum; +import net.sf.jasperreports.engine.type.NamedEnum; +import net.sf.jasperreports.engine.type.SortFieldTypeEnum; +import net.sf.jasperreports.engine.util.JRColorUtil; +import net.sf.jasperreports.engine.util.JRDataUtils; +import net.sf.jasperreports.engine.util.JRStringUtil; +import net.sf.jasperreports.engine.util.MessageProvider; +import net.sf.jasperreports.engine.util.MessageUtil; +import net.sf.jasperreports.repo.JasperDesignCache; +import net.sf.jasperreports.web.commands.CommandTarget; +import net.sf.jasperreports.web.util.JacksonUtil; +import net.sf.jasperreports.web.util.ReportInteractionHyperlinkProducer; +import net.sf.jasperreports.web.util.VelocityUtil; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class HeaderToolbarElementJsonHandler implements GenericElementJsonHandler +{ + private static final Log log = LogFactory.getLog(HeaderToolbarElementJsonHandler.class); + + private static final String HEADER_TOOLBAR_ELEMENT_JSON_TEMPLATE = "net/sf/jasperreports/components/headertoolbar/json/resources/HeaderToolbarElementJsonTemplate.vm"; + private static final String PARAM_GENERATED_TEMPLATE_PREFIX = "net.sf.jasperreports.headertoolbar."; + + private static final List datePatterns = new ArrayList(); + private static final List timePatterns = new ArrayList(); + private static final Map numberPatternsMap = new LinkedHashMap(); + + private static final String DURATION_PATTERN = "[h]:mm:ss"; + + static { + // date patterns + datePatterns.add("dd/MM/yyyy"); + datePatterns.add("MM/dd/yyyy"); + datePatterns.add("yyyy/MM/dd"); + datePatterns.add("EEEEE dd MMMMM yyyy"); + datePatterns.add("MMMMM dd. yyyy"); + datePatterns.add("dd/MM"); + datePatterns.add("dd/MM/yy"); + datePatterns.add("dd-MMM"); + datePatterns.add("dd-MMM-yy"); + datePatterns.add("MMM-yy"); + datePatterns.add("MMMMM-yy"); + datePatterns.add("dd/MM/yyyy h.mm a"); + datePatterns.add("dd/MM/yyyy HH.mm.ss"); + datePatterns.add("MMM"); + datePatterns.add("d/M/yyyy"); + datePatterns.add("dd-MMM-yyyy"); + datePatterns.add("yyyy.MM.dd G 'at' HH:mm:ss z"); + datePatterns.add("EEE. MMM d. ''yy"); + datePatterns.add("yyyy.MMMMM.dd GGG hh:mm aaa"); + datePatterns.add("EEE. d MMM yyyy HH:mm:ss Z"); + datePatterns.add("yyMMddHHmmssZ"); + + timePatterns.add("hh:mm aaa"); + timePatterns.add("hh:mm:ss aaa"); + timePatterns.add("HH:mm"); + timePatterns.add("HH:mm:ss"); + + numberPatternsMap.put("###0;-###0", "-1234"); + numberPatternsMap.put("###0;###0-", "1234-"); + numberPatternsMap.put("###0;(###0)", "(1234)"); + numberPatternsMap.put("###0;(-###0)", "(-1234)"); + numberPatternsMap.put("###0;(###0-)", "(1234-)"); + numberPatternsMap.put(DURATION_PATTERN, "[h]:mm:ss"); + } + + private static final String TABLE_UUID = "exporter_first_attempt"; + + @Override + public String getJsonFragment(JsonExporterContext context, JRGenericPrintElement element) + { + boolean templateAlreadyLoaded = false; + + String htmlFragment = null; + String tableUUID = element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_TABLE_UUID); + ReportContext reportContext = context.getExporterRef().getReportContext(); + if (reportContext != null && tableUUID != null)//FIXMEJIVE + { + String columnUuid = element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_COLUMN_UUID); + String columnLabel = (String)element.getParameterValue(HeaderToolbarElement.PARAMETER_COLUMN_LABEL); + if (columnLabel == null) { + columnLabel = ""; + } + int columnIndex = Integer.parseInt(element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_COLUMN_INDEX)); + + Map contextMap = new HashMap(); + contextMap.put("JRStringUtil", JRStringUtil.class); + contextMap.put("tableUUID", tableUUID); + + JasperReportsContext jrContext = context.getJasperReportsContext(); + + JasperPrint jasperPrint = context.getExportedReport(); + Locale locale = jasperPrint.getLocaleCode() == null ? Locale.getDefault() : JRDataUtils.getLocale(jasperPrint.getLocaleCode()); + TimeZone timeZone = getFilterTimeZone(jasperPrint, element); + + if (log.isDebugEnabled()) + { + log.debug("column " + columnUuid + " has locale " + locale + ", timezone " + timeZone); + } + + Boolean isClearCache = (Boolean)reportContext.getParameterValue(PARAMETER_CLEAR_CONTEXT_CACHE); + + if (reportContext.getParameterValue(PARAM_GENERATED_TEMPLATE_PREFIX) != null && !(isClearCache != null && isClearCache)) { + templateAlreadyLoaded = true; + } else { + reportContext.setParameterValue(PARAM_GENERATED_TEMPLATE_PREFIX, true); + } + + ColumnFormatting.store(reportContext, tableUUID, columnIndex, locale, timeZone); + + /*** begin: FILTER PATTERNS ***/ + // numeric filter pattern + String numericFilterPattern = HeaderToolbarElementUtils.getNumberPattern(jrContext, locale); + + // date filter pattern + String dateFilterPattern = HeaderToolbarElementUtils.getDatePattern(jrContext, locale); + + // time filter pattern + String timeFilterPattern = HeaderToolbarElementUtils.getTimePattern(jrContext, locale); + /*** end: FILTER PATTERNS ***/ + + FilterAction action = new FilterAction(); + action.init(jrContext, reportContext); + CommandTarget target = action.getCommandTarget(UUID.fromString(tableUUID)); + + JasperDesign jasperDesign = null; + JRDesignDataset dataset = null; + StandardTable table = null; + + if (target != null) + { + JRIdentifiable identifiable = target.getIdentifiable(); + JRDesignComponentElement componentElement = identifiable instanceof JRDesignComponentElement ? (JRDesignComponentElement)identifiable : null; + table = componentElement == null ? null : (StandardTable)componentElement.getComponent(); + JasperDesignCache cache = JasperDesignCache.getInstance(jrContext, reportContext); + jasperDesign = cache.getJasperDesign(target.getUri()); + JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)table.getDatasetRun(); + String datasetName = datasetRun.getDatasetName(); + dataset = (JRDesignDataset)jasperDesign.getDatasetMap().get(datasetName); + } + + if (!tableUUID.equals(context.getValue(TABLE_UUID))) + { + Map columnNames = getAllColumnNames(element, jrContext, contextMap); + List> columnGroupsData = getColumnGroupsData(jrContext, reportContext, target, jasperDesign, dataset, table, tableUUID, locale, timeZone); + // column names are normally set on the first column, but check if we got them + if (!columnNames.isEmpty()) { + context.setValue(TABLE_UUID, tableUUID); + + // column info + contextMap.put("allColumnNames", JacksonUtil.getInstance(jrContext).getJsonString(columnNames)); + contextMap.put("allColumnGroupsData", JacksonUtil.getInstance(jrContext).getJsonString(columnGroupsData)); + contextMap.put("tableName", element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_TABLE_NAME)); + + // floating header + contextMap.put("hasFloatingHeader", Boolean.parseBoolean(element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_FLOATING_HEADER))); + + // patterns + contextMap.put("numericPatterns", JacksonUtil.getInstance(jrContext).getJsonString(getNumberPatterns(numberPatternsMap))); + contextMap.put("datePatterns", JacksonUtil.getInstance(jrContext).getJsonString(getDatePatterns(datePatterns, locale))); + contextMap.put("timePatterns", JacksonUtil.getInstance(jrContext).getJsonString(getDatePatterns(timePatterns, locale))); + + // operators + contextMap.put("numericOperators", JacksonUtil.getInstance(jrContext).getJsonString(getTranslatedOperators(jrContext, FilterTypeNumericOperatorsEnum.class.getName(), FilterTypeNumericOperatorsEnum.values(), locale))); + contextMap.put("dateOperators", JacksonUtil.getInstance(jrContext).getJsonString(getTranslatedOperators(jrContext, FilterTypeDateOperatorsEnum.class.getName(), FilterTypeDateOperatorsEnum.values(), locale))); + contextMap.put("timeOperators", JacksonUtil.getInstance(jrContext).getJsonString(getTranslatedOperators(jrContext, FilterTypeDateOperatorsEnum.class.getName(), FilterTypeDateOperatorsEnum.values(), locale))); + contextMap.put("textOperators", JacksonUtil.getInstance(jrContext).getJsonString(getTranslatedOperators(jrContext, FilterTypeTextOperatorsEnum.class.getName(), FilterTypeTextOperatorsEnum.values(), locale))); + contextMap.put("booleanOperators", JacksonUtil.getInstance(jrContext).getJsonString(getTranslatedOperators(jrContext, FilterTypeBooleanOperatorsEnum.class.getName(), FilterTypeBooleanOperatorsEnum.values(), locale))); + + /*** begin: FILTER PATTERNS ***/ + // numeric filter pattern + contextMap.put("numericFilterPattern", numericFilterPattern); + + // date filter pattern + contextMap.put("dateFilterPattern", dateFilterPattern); + + // time filter pattern + contextMap.put("timeFilterPattern", timeFilterPattern); + /*** end: FILTER PATTERNS ***/ + + /*** begin: CALENDAR PATTERNS ***/ + // date pattern + contextMap.put("calendarDatePattern", HeaderToolbarElementUtils.getCalendarDatePattern(jrContext, locale)); + + // time pattern + contextMap.put("calendarTimePattern", HeaderToolbarElementUtils.getCalendarTimePattern(jrContext, locale)); + /*** end: CALENDAR PATTERNS ***/ + + contextMap.put("exporterFirstAttempt", true); + } + } + + contextMap.put("templateAlreadyLoaded", templateAlreadyLoaded); + + Boolean canSort = Boolean.parseBoolean(element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_CAN_SORT)); + Boolean canFilter = Boolean.parseBoolean(element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_CAN_FILTER)); + + if (element.getModeValue() == ModeEnum.OPAQUE) + { + contextMap.put("backgroundColor", JRColorUtil.getColorHexa(element.getBackcolor())); + } + + contextMap.put("columnUuid", columnUuid); + //FIXME conceptually it would be better not to encode for html here + //but produce a pure json and encode for html on the client where necessary + contextMap.put("columnLabel", JRStringUtil.htmlEncode(columnLabel)); + contextMap.put("columnIndex", columnIndex); + contextMap.put("dataType", FilterTypesEnum.TEXT.getName()); // use Text as default + contextMap.put("canSort", canSort); + contextMap.put("canFilter", canFilter); + + contextMap.put("fontExtensionsFontNames", getFontExtensionsFontNames(jrContext)); + contextMap.put("systemFontNames", getSystemFontNames(jrContext)); + + setColumnHeaderData(columnLabel, columnIndex, target, contextMap, jrContext, reportContext, locale); + EditTextElementData columnValueData = setColumnValueData(columnIndex, target, contextMap, jrContext, reportContext, locale); + + String columnName = element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_COLUMN_NAME); + String columnComponentName = element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_COLUMN_COMPONENT_NAME); + String columnType = element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_COLUMN_TYPE); + FilterTypesEnum filterType = FilterTypesEnum.getByName(element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_FILTER_TYPE)); + + if (columnComponentName == null) { + columnComponentName = columnName; + } + contextMap.put("columnName", columnComponentName); + + if (canFilter) + { + FilterData filterData = getFilterData(jrContext, dataset, columnName, columnType, filterType, columnValueData.getFormatPattern(), + locale, timeZone); + + contextMap.put("dataType", filterType.getName()); + contextMap.put("filterData", JacksonUtil.getInstance(jrContext).getJsonString(filterData)); + contextMap.put("filterTableUuid", filterData.getTableUuid()); + } + + if (canSort) { + SortData sortAscData = new SortData(tableUUID, columnName, columnType, HeaderToolbarElement.SORT_ORDER_ASC); + SortData sortDescData = new SortData(tableUUID, columnName, columnType, HeaderToolbarElement.SORT_ORDER_DESC); + String sortField = getCurrentSortField(jrContext, reportContext, tableUUID, columnName, columnType); + if (sortField != null) + { + String[] sortActionData = HeaderToolbarElementUtils.extractColumnInfo(sortField); + + boolean isAscending = HeaderToolbarElement.SORT_ORDER_ASC.equals(sortActionData[2]); + if (isAscending) { + sortAscData.setSortOrder(HeaderToolbarElement.SORT_ORDER_NONE); + } else { + sortDescData.setSortOrder(HeaderToolbarElement.SORT_ORDER_NONE); + } + } + contextMap.put("sortAscData", JacksonUtil.getInstance(jrContext).getJsonString(sortAscData)); + contextMap.put("sortDescData", JacksonUtil.getInstance(jrContext).getJsonString(sortDescData)); + } + + List tableColumns = TableUtil.getAllColumns(table); + Column column = (Column)tableColumns.get(columnIndex); + + JRDesignTextField detailTextField = TableUtil.getCellElement(JRDesignTextField.class, column.getDetailCell(), true); + if (detailTextField != null) + { + ConditionalFormattingData detailCfd = getConditionalFormattingData(element, jrContext, dataset, detailTextField, null, + locale, timeZone); + if (detailCfd != null) + { + contextMap.put("conditionalFormattingData", JacksonUtil.getInstance(jrContext).getJsonString(detailCfd)); + } + } + + htmlFragment = VelocityUtil.processTemplate(HeaderToolbarElementJsonHandler.HEADER_TOOLBAR_ELEMENT_JSON_TEMPLATE, contextMap); + } + + return htmlFragment; + } + + protected TimeZone getFilterTimeZone(JasperPrint jasperPrint, JRGenericPrintElement element) + { + String formatTimeZone = element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_FORMAT_TIME_ZONE); + TimeZone timeZone; + if (formatTimeZone != null) + { + timeZone = JRDataUtils.getTimeZone(formatTimeZone); + } + else if (jasperPrint.getTimeZoneId() != null) + { + timeZone = JRDataUtils.getTimeZone(jasperPrint.getTimeZoneId()); + } + else + { + timeZone = TimeZone.getDefault(); + } + return timeZone; + } + + private List> getDatePatterns(List datePatterns, Locale locale) { + List> formatPatterns = new ArrayList>(); + + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy", locale); + Date today = new Date(); + HashMap keys; + + for(String datePattern: datePatterns) { + keys = new HashMap(); + sdf.applyPattern(datePattern); + keys.put("key", datePattern); + keys.put("val", sdf.format(today)); + formatPatterns.add(keys); + } + + return formatPatterns; + } + private List> getNumberPatterns(Map numberPatternsMap) { + List> formatPatterns = new ArrayList>(); + HashMap keys; + + for(Map.Entry entry: numberPatternsMap.entrySet()) { + keys = new HashMap(); + keys.put("key", entry.getKey()); + keys.put("val", entry.getValue()); + formatPatterns.add(keys); + } + + return formatPatterns; + } + + private String getActionBaseUrl(JsonExporterContext context) { + JRBasePrintHyperlink hyperlink = new JRBasePrintHyperlink(); + hyperlink.setLinkType(ReportInteractionHyperlinkProducer.HYPERLINK_TYPE_REPORT_INTERACTION); +// return context.getHyperlinkURL(hyperlink); + return "FIXME HeaderToolbarElementJsonHandler.getActionBaseUrl"; + } + + private String getCurrentSortField( + JasperReportsContext jasperReportsContext, + ReportContext reportContext, + String uuid, + String sortColumnName, + String sortColumnType + ) + { + JasperDesignCache cache = JasperDesignCache.getInstance(jasperReportsContext, reportContext); + SortAction action = new SortAction(); + action.init(jasperReportsContext, reportContext); + CommandTarget target = action.getCommandTarget(UUID.fromString(uuid)); + if (target != null) + { + JRIdentifiable identifiable = target.getIdentifiable(); + JRDesignComponentElement componentElement = identifiable instanceof JRDesignComponentElement ? (JRDesignComponentElement)identifiable : null; + StandardTable table = componentElement == null ? null : (StandardTable)componentElement.getComponent(); + + JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)table.getDatasetRun(); + + String datasetName = datasetRun.getDatasetName(); + + JasperDesign jasperDesign = cache.getJasperDesign(target.getUri());//FIXMEJIVE getJasperReport not design + JRDesignDataset dataset = (JRDesignDataset)jasperDesign.getDatasetMap().get(datasetName); + + List existingFields = dataset.getSortFieldsList(); + String sortField = null; + + if (existingFields != null && existingFields.size() > 0) { + for (JRSortField field: existingFields) { + if (field.getName().equals(sortColumnName) && field.getType().getName().equals(sortColumnType)) { + sortField = sortColumnName + HeaderToolbarElement.SORT_COLUMN_TOKEN_SEPARATOR + sortColumnType + HeaderToolbarElement.SORT_COLUMN_TOKEN_SEPARATOR; + switch (field.getOrderValue()) { + case ASCENDING: + sortField += HeaderToolbarElement.SORT_ORDER_ASC; + break; + case DESCENDING: + sortField += HeaderToolbarElement.SORT_ORDER_DESC; + break; + } + break; + } + } + } + + return sortField; + } + + return null; + } + + @Override + public boolean toExport(JRGenericPrintElement element) { + return true; + } + + private List> getTranslatedOperators( + JasperReportsContext jasperReportsContext, + String bundleName, + NamedEnum[] operators, + Locale locale + ) //FIXMEJIVE make utility method for translating enums + { + List> result = new ArrayList>(); + MessageProvider messageProvider = MessageUtil.getInstance(jasperReportsContext).getMessageProvider(bundleName); + LinkedHashMap keys; + + for (NamedEnum operator: operators) + { + keys = new LinkedHashMap(); + String key = bundleName + "." + ((Enum)operator).name(); + keys.put("key", ((Enum)operator).name()); + keys.put("val", messageProvider.getMessage(key, null, locale)); + result.add(keys); + } + + return result; + } + + private static FilterData getFilterData( + JasperReportsContext jasperReportsContext, + JRDesignDataset dataset, + String columnName, + String columnType, + FilterTypesEnum filterType, + String columnValuePattern, + Locale locale, + TimeZone timeZone + ) + { + // get existing filter as JSON string + String serializedFilters = "[]"; + JRPropertiesMap propertiesMap = dataset.getPropertiesMap(); + if (propertiesMap.getProperty(FilterCommand.DATASET_FILTER_PROPERTY) != null) { + serializedFilters = propertiesMap.getProperty(FilterCommand.DATASET_FILTER_PROPERTY); + } + + List filters = new ArrayList(); + + List existingFilters = JacksonUtil.getInstance(jasperReportsContext).loadList(serializedFilters, FieldFilter.class); + if (existingFilters.size() > 0) { + for (DatasetFilter filter: existingFilters) { + if (((FieldFilter)filter).getField().equals(columnName)) { + filters.add(filter); + break; + } + } + } + + FilterData filterData = new FilterData(); + filterData.setFieldName(columnName); + filterData.setFilterType(filterType.getName()); + filterData.setIsField(SortFieldTypeEnum.FIELD.equals(SortFieldTypeEnum.getByName(columnType))); + + if (filters.size() > 0) + { + FieldFilter ff = (FieldFilter)filters.get(0); + filterData.setFieldValueStart(ff.getFilterValueStart()); + filterData.setFieldValueEnd(ff.getFilterValueEnd()); + filterData.setFilterTypeOperator(ff.getFilterTypeOperator()); + filterData.setFilterType(ff.getFilterType()); + filterData.setFilterPattern(ff.getFilterPattern()); + filterData.setLocaleCode(ff.getLocaleCode()); + filterData.setTimeZoneId(ff.getTimeZoneId()); + } + + if (filterType.getName().equals(filterData.getFilterType())) + { + String filterPattern = HeaderToolbarElementUtils.getFilterPattern(jasperReportsContext, locale, filterType); + + if (FilterTypesEnum.NUMERIC.equals(filterType) && DURATION_PATTERN.equals(columnValuePattern)) { + filterPattern = DURATION_PATTERN; + } + + HeaderToolbarElementUtils.updateFilterData( + filterData, + filterPattern, + locale, + timeZone + ); + } + else + { + //FIXMEJIVE should we raise error? + } + + return filterData; + } + + private void setColumnHeaderData(String sortColumnLabel, Integer columnIndex, CommandTarget target, Map contextMap, + JasperReportsContext jasperReportsContext, ReportContext reportContext, Locale locale) { + if (target != null){ + JRIdentifiable identifiable = target.getIdentifiable(); + JRDesignComponentElement componentElement = identifiable instanceof JRDesignComponentElement ? (JRDesignComponentElement)identifiable : null; + StandardTable table = componentElement == null ? null : (StandardTable)componentElement.getComponent(); + + List tableColumns = TableUtil.getAllColumns(table); + + if (columnIndex != null) { + StandardColumn column = (StandardColumn) tableColumns.get(columnIndex); + + JRDesignTextElement textElement = TableUtil.getCellElement(JRDesignTextElement.class, column.getColumnHeader(), true); + + if (textElement != null) { + EditTextElementData textElementData = new EditTextElementData(); + + textElementData.setHeadingName(JRStringUtil.htmlEncode(sortColumnLabel)); + textElementData.setColumnIndex(columnIndex); + JRDesignTextElement styledElement = resolveElementStyle(textElement, reportContext, target); + HeaderToolbarElementUtils.copyTextElementStyle(textElementData, styledElement, locale); + + contextMap.put("colHeaderData", JacksonUtil.getInstance(jasperReportsContext).getJsonString(textElementData)); + } + } + } + } + + private JRDesignTextElement resolveElementStyle(JRDesignTextElement element, ReportContext context, + CommandTarget target) + { + JRStyle defaultStyle = element.getDefaultStyleProvider() == null ? null + : element.getDefaultStyleProvider().getDefaultStyle(); + boolean hasExternalStyle = hasExternalStyle(element) + || (defaultStyle != null && hasExternalStyle(defaultStyle)); + if (!hasExternalStyle && defaultStyle != null) + { + //we have everything + return element; + } + + JasperDesignCache designCache = JasperDesignCache.getExistingInstance(context); + List reportStyles = designCache == null ? null : designCache.getStyles( + target.getUri(), target.getIdentifiable() == null ? null : target.getIdentifiable().getUUID()); + if (reportStyles == null || reportStyles.isEmpty()) + { + return element; + } + + JRStyle externalDefault = null; + if (defaultStyle == null) + { + for (JRStyle style : reportStyles) + { + if (style.isDefault()) + { + externalDefault = style; + } + } + + if (!hasExternalStyle && externalDefault == null) + { + //nothing to change + return element; + } + } + + JRStyle elementStyle; + if (element.getStyle() == null && element.getStyleNameReference() == null) + { + elementStyle = externalDefault; + } + else + { + String elementStyleName = element.getStyleNameReference() == null + ? element.getStyle().getName() : element.getStyleNameReference(); + + elementStyle = null; + for (JRStyle style : reportStyles) + { + if (style.getName().equals(elementStyleName)) + { + elementStyle = style; + } + } + } + + if (elementStyle == null) + { + //didn't find a style for the element + return element; + } + + JRDesignTextElement elementClone = (JRDesignTextElement) element.clone(); + elementClone.setStyle(elementStyle); + return elementClone; + } + + private boolean hasExternalStyle(JRStyleContainer styleContainer) + { + if (styleContainer.getStyle() == null && styleContainer.getStyleNameReference() != null) + { + return true; + } + + JRStyle style = styleContainer.getStyle(); + while (style != null) + { + if (style.getStyle() == null && style.getStyleNameReference() != null) + { + return true; + } + + style = style.getStyle(); + } + return false; + } + + private EditTextElementData setColumnValueData(Integer columnIndex, CommandTarget target, Map contextMap, + JasperReportsContext jasperReportsContext, ReportContext reportContext, Locale locale) { + EditTextElementData textElementData = new EditTextElementData(); + + if (target != null){ + JRIdentifiable identifiable = target.getIdentifiable(); + JRDesignComponentElement componentElement = identifiable instanceof JRDesignComponentElement ? (JRDesignComponentElement)identifiable : null; + StandardTable table = componentElement == null ? null : (StandardTable)componentElement.getComponent(); + + List tableColumns = TableUtil.getAllColumns(table); + + if (columnIndex != null) { + StandardColumn column = (StandardColumn) tableColumns.get(columnIndex); + + JRDesignTextField textElement = TableUtil.getCellElement(JRDesignTextField.class, column.getDetailCell(), true); + + if (textElement != null) { + textElementData.setColumnIndex(columnIndex); + JRDesignTextElement styledElement = resolveElementStyle(textElement, reportContext, target); + HeaderToolbarElementUtils.copyTextElementStyle(textElementData, styledElement, locale); + } + } + } + contextMap.put("colValueData", JacksonUtil.getInstance(jasperReportsContext).getJsonString(textElementData)); + + return textElementData; + } + + public static class ColumnInfo { + private String index; + private String label; + private String uuid; + private boolean visible; + private boolean interactive; + + private ColumnInfo(String index, String label, String uuid, boolean visible, boolean interactive) { + this.index = index; + this.label = label; + this.uuid = uuid; + this.visible = visible; + this.interactive = interactive; + } + + public String getIndex() { + return index; + } + + public String getLabel() { + return label; + } + + public String getUuid() { + return uuid; + } + + public boolean getVisible() { + return visible; + } + + public boolean getInteractive() { + return interactive; + } + } + + private Map getAllColumnNames(JRGenericPrintElement element, + JasperReportsContext jasperReportsContext, Map contextMap) { + int prefixLength = HeaderToolbarElement.PARAM_COLUMN_LABEL_PREFIX.length(); + Map columnNames = new HashMap(); + for (String paramName : element.getParameterNames()) { + if (paramName.startsWith(HeaderToolbarElement.PARAM_COLUMN_LABEL_PREFIX)) { + String columnName = (String) element.getParameterValue(paramName); + String[] tokens = paramName.substring(prefixLength).split("\\|"); + if (columnName == null || columnName.trim().length() == 0) { + columnName = "Column_" + tokens[0]; + } + columnNames.put(tokens[0], new ColumnInfo(tokens[0], JRStringUtil.htmlEncode(columnName), tokens[1], false, Boolean.valueOf(tokens[2]))); + } + } + return columnNames; + } + + public static class GroupInfo { + public static final String TYPE_GROUP_HEADING = "groupheading"; + public static final String TYPE_GROUP_SUBTOTAL = "groupsubtotal"; + public static final String TYPE_TABLE_TOTAL = "tabletotal"; + + private String name; + private String type; + private List forColumns; + + public GroupInfo(String name, String type) { + this.name = name; + this.type = type; + this.forColumns = new ArrayList(); + } + + public String getName() { + return name; + } + + public String getType() { + return type; + } + + public void addForColumn(Integer index) { + forColumns.add(index); + } + + public List getForColumns() { + return this.forColumns; + } + } + + private boolean setTextElements(List groupCells, Map groups, String groupType, Integer columnIndex) { + boolean result = false; + if (groupCells != null) { + for (GroupCell gc: groupCells) { + JRDesignTextElement textElement = TableUtil.getCellElement(JRDesignTextElement.class, gc.getCell(), false); + + if (textElement != null) { + result = true; + if (groups.containsKey(textElement)) { + groups.get(textElement).addForColumn(columnIndex); + } + else { + GroupInfo gi = new GroupInfo(gc.getGroupName() != null ? gc.getGroupName() : groupType + "_" + columnIndex, groupType); + gi.addForColumn(columnIndex); + groups.put(textElement, gi); + } + } + } + } + return result; + } + + private List> getColumnGroupsData(JasperReportsContext jasperReportsContext, + ReportContext reportContext, CommandTarget target, JasperDesign jasperDesign, + JRDesignDataset dataset, StandardTable table, String tableUuid, Locale locale, TimeZone timeZone) + { + List allColumns = TableUtil.getAllColumns(table); + + int i = 0; + Map groups = new HashMap(); + boolean found; + + // build the groups map + for (BaseColumn bc: allColumns) { + List colGroups = TableUtil.getHierarchicalColumnGroupsForColumn(bc, table.getColumns(), table); + + // group headers + found = setTextElements(bc.getGroupHeaders(), groups, GroupInfo.TYPE_GROUP_HEADING, i); + if (!found) { + for (ColumnGroup cg: colGroups) { + if (cg.getGroupHeaders() == null) { + continue; + } + found = setTextElements(cg.getGroupHeaders(), groups, GroupInfo.TYPE_GROUP_HEADING, i); + if (found) break; + } + } + + // group footers + found = setTextElements(bc.getGroupFooters(), groups, GroupInfo.TYPE_GROUP_SUBTOTAL, i); + if (!found) { + for (ColumnGroup cg: colGroups) { + if (cg.getGroupFooters() == null) { + continue; + } + found = setTextElements(cg.getGroupFooters(), groups, GroupInfo.TYPE_GROUP_SUBTOTAL, i); + if (found) break; + } + } + + // table footers + found = false; + if (bc.getTableFooter() != null) { + JRDesignTextElement textElement = TableUtil.getCellElement(JRDesignTextElement.class, bc.getTableFooter(), false); + + if (textElement != null) { + found = true; + if (groups.containsKey(textElement)) { + groups.get(textElement).addForColumn(i); + } + else { + GroupInfo gi = new GroupInfo("Tabletotal" + "_" + i, GroupInfo.TYPE_TABLE_TOTAL); + gi.addForColumn(i); + groups.put(textElement, gi); + } + } + } + if (!found) { + for (ColumnGroup cg: colGroups) { + if (cg.getTableFooter() == null) { + continue; + } + JRDesignTextElement textElement = TableUtil.getCellElement(JRDesignTextElement.class, cg.getTableFooter(), false); + + if (textElement != null) { + found = true; + if (groups.containsKey(textElement)) { + groups.get(textElement).addForColumn(i); + } + else { + GroupInfo gi = new GroupInfo("Tabletotal" + "_" + i, GroupInfo.TYPE_TABLE_TOTAL); + gi.addForColumn(i); + groups.put(textElement, gi); + } + } + + if (found) break; + } + } + i++; + } + + List> groupsData = new ArrayList>(); + + // populate groupsData + i = 0; + for (Map.Entry entry: groups.entrySet()) + { + JRDesignTextElement textElement = entry.getKey(); + GroupInfo groupInfo = entry.getValue(); + + EditTextElementData textElementData; + textElementData = new EditTextElementData(); + textElementData.setGroupName(groupInfo.getName()); + JRDesignTextElement styledElement = resolveElementStyle(textElement, reportContext, target); + HeaderToolbarElementUtils.copyTextElementStyle(textElementData, styledElement, locale); + + Map groupData = new HashMap(); + groupData.put("groupType", groupInfo.getType()); + groupData.put("id", groupInfo.getType() + "_" + i); + groupData.put("groupData", textElementData); + groupData.put("groupName", groupInfo.getName()); + groupData.put("forColumns", groupInfo.getForColumns()); + + JRDesignTextField textField = textElement instanceof JRDesignTextField ? (JRDesignTextField)textElement : null; + ConditionalFormattingData cfData = + textField == null + ? null + : getConditionalFormattingData( + null, + jasperReportsContext, + dataset, + textField, + groupInfo.getName(), + locale, + timeZone + ); + + if (cfData != null) + { + groupData.put("dataType", cfData.getConditionType()); + groupData.put("conditionalFormattingData", cfData); + } + else + { + groupData.put("dataType", FilterTypesEnum.TEXT.getName()); + } + + groupsData.add(groupData); + + i++; + } + + return groupsData; + } + + private static ConditionalFormattingData getConditionalFormattingData( + JRGenericPrintElement element, + JasperReportsContext jasperReportsContext, + JRDesignDataset dataset, + JRDesignTextField textField, + String groupName, + Locale locale, + TimeZone timeZone + ) + { + FilterTypesEnum conditionType = null; + String conditionTypeProp; + + // only for the detail values the element will not be null + if (element != null) { + conditionTypeProp = element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_FILTER_TYPE); + + if (element.getPropertiesMap().containsProperty(HeaderToolbarElement.PROPERTY_COLUMN_FIELD)) { + textField.getPropertiesMap().setProperty(HeaderToolbarElement.PROPERTY_COLUMN_FIELD, element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_COLUMN_FIELD)); + } else if (element.getPropertiesMap().containsProperty(HeaderToolbarElement.PROPERTY_COLUMN_VARIABLE)) { + textField.getPropertiesMap().setProperty(HeaderToolbarElement.PROPERTY_COLUMN_VARIABLE, element.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_COLUMN_VARIABLE)); + } + + } else { + conditionTypeProp = textField.getPropertiesMap().getProperty(HeaderToolbarElement.PROPERTY_CONDTION_TYPE); + } + + + if (conditionTypeProp == null) + { + JRExpression expression = textField.getExpression(); + if (expression != null) + { + JRExpressionChunk[] chunks = expression.getChunks(); + if (chunks != null && chunks.length == 1) + { + JRExpressionChunk expressionChunk = expression.getChunks()[0]; + String fieldOrVariableName = expressionChunk.getText(); + + switch (expressionChunk.getType()) { + case JRExpressionChunk.TYPE_FIELD: + JRField field = HeaderToolbarElementUtils.getField(fieldOrVariableName, dataset); + conditionType = HeaderToolbarElementUtils.getFilterType(field.getValueClass()); + break; + + case JRExpressionChunk.TYPE_VARIABLE: + JRVariable variable = HeaderToolbarElementUtils.getVariable(fieldOrVariableName, dataset); + conditionType = HeaderToolbarElementUtils.getFilterType(variable.getValueClass()); + break; + + case JRExpressionChunk.TYPE_TEXT: + default: + } + } + } + } + else + { + conditionType = FilterTypesEnum.getByName(conditionTypeProp); + } + + ConditionalFormattingData cfd = null; + if (conditionType != null) + { + cfd = + HeaderToolbarElementUtils.getConditionalFormattingData( + textField, + jasperReportsContext + ); + if (cfd == null) + { + cfd = new ConditionalFormattingData(); + if (groupName != null) + { + cfd.setGroupName(groupName); + } + cfd.setConditionType(conditionType.getName()); + } + + if (conditionType.getName().equals(cfd.getConditionType())) + { + String conditionPattern = HeaderToolbarElementUtils.getFilterPattern(jasperReportsContext, locale, conditionType); + + if (FilterTypesEnum.NUMERIC.equals(conditionType) && DURATION_PATTERN.equals(textField.getPattern())) { + conditionPattern = DURATION_PATTERN; + } + + HeaderToolbarElementUtils.updateConditionalFormattingData( + cfd, + conditionPattern, + locale, + timeZone + ); + } + else + { + //FIXMEJIVE should we raise error? + } + } + + return cfd; + } + + private Set getFontExtensionsFontNames(JasperReportsContext jasperReportsContext) { + Set classes = new TreeSet(); + + Collection extensionFonts = FontUtil.getInstance(jasperReportsContext).getFontNames(); + for (Iterator it = extensionFonts.iterator(); it.hasNext();) { + String fname = it.next(); + classes.add(fname); + } + + return classes; + } + + private Set getSystemFontNames(JasperReportsContext jasperReportsContext) { + Set fontExtensionsFontNames = getFontExtensionsFontNames(jasperReportsContext); + Set classes = new TreeSet(); + + String[] names = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); + for (int i = 0; i < names.length; i++) { + String name = names[i]; + if (fontExtensionsFontNames.add(name)) { + classes.add(name); + } + } + + return classes; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,28 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** +* Contains utility classes for the built-in Header Toolbar component. +*/ +package net.sf.jasperreports.components.headertoolbar.json; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/resources/HeaderToolbarElementJsonTemplate.vm jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/resources/HeaderToolbarElementJsonTemplate.vm --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/resources/HeaderToolbarElementJsonTemplate.vm 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/json/resources/HeaderToolbarElementJsonTemplate.vm 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,82 @@ +#if (${exporterFirstAttempt}) +"${tableUUID}": { + "id": "${tableUUID}", + #if (${tableName})"name": "${tableName}",#end + "type": "table", + "module": "jive.table", + "uimodule": "jive.interactive.column", + "allColumnsData": ${allColumnNames}, + "allColumnGroupsData": ${allColumnGroupsData}, + "hasFloatingHeader": ${hasFloatingHeader} + #if (!${templateAlreadyLoaded}) + , "genericProperties": { + "fontSizes": [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], + "fonts": { + "extension": [#set ($extFontSize=$fontExtensionsFontNames.size()) + #foreach ($fontName in ${fontExtensionsFontNames}) "$JRStringUtil.escapeString4JavaScript($fontName)" #if($velocityCount<$extFontSize),#end#end + ], + "system": [#set ($sysFontSize=$systemFontNames.size()) + #foreach ($fontName in ${systemFontNames}) "$JRStringUtil.escapeString4JavaScript($fontName)" #if($velocityCount<$sysFontSize),#end#end + ] + }, + "patterns": { + "numeric": ${numericPatterns}, + "date": ${datePatterns}, + "time": ${timePatterns} + }, + "operators": { + "numeric" :${numericOperators}, + "date" :${dateOperators}, + "time" :${timeOperators}, + "text" :${textOperators}, + "boolean" :${booleanOperators} + }, + "filterPatterns": { + "numeric": "${numericFilterPattern}", + "date": "${dateFilterPattern}", + "time": "${timeFilterPattern}" + }, + "calendarPatterns": { + "date": "${calendarDatePattern}", + "time": "${calendarTimePattern}" + } + } + #end +}, +#end +"${columnUuid}": { + "id": "${columnUuid}", + "name": "${columnName}", + "type": "column", + "parentId": "${tableUUID}", + "selector": ".jrcolHeader", + "proxySelector": ".jrcel", + "columnIndex": ${columnIndex}, + "columnLabel": "$JRStringUtil.escapeJSONString(${columnLabel})", + "dataType": "${dataType}", + "filterData": {"actionName": "filter"}, + "clearData": {"actionName": "filter", "filterData": {"clearFilter": true}}, + "canSort": ${canSort}, + #if (${canSort}) + "headerToolbar": { + "sortAscBtn": {"sortData": {"actionName":"sort","sortData":${sortAscData}}}, + "sortDescBtn": {"sortData": {"actionName":"sort","sortData":${sortDescData}}} + }, + #end + "canFilter": ${canFilter}, + #if (${canFilter}) + "filtering": { + "filterData": ${filterData} + }, + #end + #if ($conditionalFormattingData) + "conditionalFormattingData": ${conditionalFormattingData}, + "canFormatConditionally": true, + #else + "canFormatConditionally": false, + #end + #if ($colHeaderData) + "headingsTabContent": ${colHeaderData}, + #end + "valuesTabContent": ${colValueData} +} \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/messages.properties jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/messages.properties --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/messages.properties 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/messages.properties 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,60 @@ +net.sf.jasperreports.components.headertoolbar.title.formatcolumn=Format column +net.sf.jasperreports.components.headertoolbar.title.format=Column options +net.sf.jasperreports.components.headertoolbar.label.formatting=Formatting... +net.sf.jasperreports.components.headertoolbar.label.showcolumns=Show columns \u25BA +net.sf.jasperreports.components.headertoolbar.label.showcolumns.all= +net.sf.jasperreports.components.headertoolbar.label.hidecolumn=Hide column + +net.sf.jasperreports.components.headertoolbar.title.filtercolumn=Filter column +net.sf.jasperreports.components.headertoolbar.label.columnfilters=Column filters +net.sf.jasperreports.components.headertoolbar.label.sortasc=Sort ascending +net.sf.jasperreports.components.headertoolbar.label.sortdesc=Sort descending + +net.sf.jasperreports.components.headertoolbar.label.extfonts=Extension fonts +net.sf.jasperreports.components.headertoolbar.label.sysfonts=System fonts + +net.sf.jasperreports.components.headertoolbar.label.clearfilter.true=Show all rows +net.sf.jasperreports.components.headertoolbar.label.clearfilter.false=Show only rows where + +net.sf.jasperreports.components.headertoolbar.title.basicformat=Basic Formatting +net.sf.jasperreports.components.headertoolbar.label.applyto=Apply to +net.sf.jasperreports.components.headertoolbar.label.headingtext=Heading text +net.sf.jasperreports.components.headertoolbar.label.fontname=Font +net.sf.jasperreports.components.headertoolbar.label.fontsize=Size +net.sf.jasperreports.components.headertoolbar.title.fontcolor=Pick a font color +net.sf.jasperreports.components.headertoolbar.title.fontbackcolor=Pick a background color +net.sf.jasperreports.components.headertoolbar.label.style=Style +net.sf.jasperreports.components.headertoolbar.label.color=Color +net.sf.jasperreports.components.headertoolbar.label.alignment=Alignment +net.sf.jasperreports.components.headertoolbar.label.numberformat=Number format +net.sf.jasperreports.components.headertoolbar.label.currency=Currency +net.sf.jasperreports.components.headertoolbar.label.currency.none= + +net.sf.jasperreports.components.headertoolbar.label.formatpattern=Format pattern +net.sf.jasperreports.components.headertoolbar.label.localespecific=\u00A4 - Locale specific + +net.sf.jasperreports.components.headertoolbar.label.draghelper=Drag to new column position +net.sf.jasperreports.components.headertoolbar.dialog.ok=OK +net.sf.jasperreports.components.headertoolbar.dialog.cancel=Cancel + +net.sf.jasperreports.components.headertoolbar.colorpicker.transparent=No fill +net.sf.jasperreports.components.headertoolbar.colorpicker.none=Reset + +net.sf.jasperreports.components.headertoolbar.title.conditions=Conditional Formatting +net.sf.jasperreports.components.headertoolbar.conditions.list=Conditions List +net.sf.jasperreports.components.headertoolbar.condition.operator=Operator +net.sf.jasperreports.components.headertoolbar.condition.condition=Condition +net.sf.jasperreports.components.headertoolbar.condition.format=Format +net.sf.jasperreports.components.headertoolbar.condition.add=Add + +net.sf.jasperreports.components.headertoolbar.dialog.previous.column=< Previous Column +net.sf.jasperreports.components.headertoolbar.dialog.next.column=Next Column > + +net.sf.jasperreports.components.headertoolbar.groupheading.prefix=Group +net.sf.jasperreports.components.headertoolbar.groupsubtotal.prefix=Sub-total + +net.sf.jasperreports.components.headertoolbar.applyto.option.headings=Headings +net.sf.jasperreports.components.headertoolbar.applyto.option.detailrows=Detail Rows +net.sf.jasperreports.components.headertoolbar.applyto.option.tabletotal=Totals + +net.sf.jasperreports.components.headertoolbar.bookmarks.dialog.title=Bookmarks \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,28 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** +* Contains classes for the built-in Header Toolbar component. +*/ +package net.sf.jasperreports.components.headertoolbar; \ No newline at end of file Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/delete_edit.gif and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/delete_edit.gif differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/filter_over.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/filter_over.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/filter.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/filter.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/filter_wrong.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/filter_wrong.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/format/add_dec.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/format/add_dec.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/format/currency.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/format/currency.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/format/percentage.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/format/percentage.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/format/remove_dec.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/format/remove_dec.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/format/thousands_sep.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/format/thousands_sep.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/format.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/format.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.over.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.over.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.pressed.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.pressed.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.primary.over.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.primary.over.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.primary.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.primary.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.primary.pressed.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.primary.pressed.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/button_column_formatting_sprite.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/button_column_formatting_sprite.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/button_formatting_sprite.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/button_formatting_sprite.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/column.header.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/column.header.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/column_toolbar_buttons_sprite.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/column_toolbar_buttons_sprite.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/dialog_button_capsule_sprite.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/dialog_button_capsule_sprite.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/dragMarker.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/dragMarker.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/fontColor.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/fontColor.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/foobar.bg.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/foobar.bg.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/iv_format_button_sprite.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/jive/iv_format_button_sprite.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/sort_asc_over.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/sort_asc_over.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/sort_asc.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/sort_asc.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/sort_desc_over.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/sort_desc_over.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/sort_desc.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/sort_desc.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/style/align_center.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/style/align_center.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/style/align_left.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/style/align_left.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/style/align_right.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/style/align_right.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/style/bold.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/style/bold.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/style/italic.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/style/italic.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/style/underline.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/images/style/underline.png differ diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/jive.vm.css jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/jive.vm.css --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/jive.vm.css 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/jive.vm.css 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,672 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +table.jrPage span.jr_search_result.highlight span { + background-color: yellow; +} + +#jive_foobar button::-moz-focus-inner, #jive_dialog button::-moz-focus-inner { + padding: 0 !important; + border: 0 none !important; +} + +#jive_overlay { + position:absolute; + z-index:9; + border-top:solid 1px #AEB2B7; + border-left:solid 1px #AEB2B7; + border-bottom:solid 1px #AEB2B7; +} +#jive_overlay > div { + position:absolute; + left:0; + top:0; + right:0; + bottom:0; + background:#c0c0c0; + opacity:0.3; + filter: alpha(opacity=30); +} +#jive_marker{ + position:absolute; + width:10px; + cursor: e-resize; + border-left:dotted 1px #555; + z-index:10; +} +#jive_marker_icon{ + background:url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/dragMarker.png); + width:18px; + height:16px; + position:relative; + top:-16px; + left:-10px; +} +#jive_foobar { + position:absolute; + border:solid 1px #ccc; + border-bottom:none; + padding:0; + height:20px; + background:url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/foobar.bg.png) repeat-x #fff; + background-position:0 1px; + width: 100px; + z-index:11; +} + +.jive_foobar_button { + margin:0; + height:20px; + padding:0; + border:none; + overflow:visible; + background:transparent; +} + +.jive_foobar_button.over { + background: url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/button_column_formatting_sprite.png); +} +.jive_foobar_button.pressed { + background: url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/button_column_formatting_sprite.png); + background-position:0 -51px; +} + +.jive_foobar_button .wrap {} + +.jive_foobar_button .icon { + display:inline-block; + width:24px; + height:16px; + .display:inline; + zoom:1; + cursor:pointer; +} + +.jive_dialog { + background: none repeat scroll 0 0 #FFFFFF; + border: 1px solid #CCCCCC; + box-shadow: 0 0 4px 4px rgba(51, 51, 51, 0.5); + font-family: Verdana; + font-size: 11px; + position: absolute; + z-index: 2; +} +.jive_dialog > div.msshadow { + position:absolute; + top:-10px; + left:-10px; + right:10px; + bottom:10px; + background:#fff; +} + +.jive_dialog .dialogHeader { + position:relative; + color: #0872A4; + background:url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/column.header.png) repeat-x #e8e8e8; + .border-top:solid 1px #e8e8e8; +} + +.jive_dialog h2 { + text-align: left; + margin:0 0 0 10px; + padding:0 4px; + font-size:11px; + line-height:28px; +} + +.jive_dialog div.dialogBody { + max-height: 480px; + *max-height:460px; /* IE7 */ + overflow-y: auto; + overflow-x:hidden; + padding: 3px; + position: relative; + margin: 0 10px; +} + +.jive_dialog div.dialogFooter { + position:relative; + padding:8px; + height:auto; + text-align: left; + border-top:solid 1px #d3d5d6; + overflow:hidden; + } + +.jive_dialog button#dialogOk, .jive_dialog button#dialogCancel { + float: right; +} + +.jive_dialog button { + display:block; + float:left; + margin-top:0 !important; + margin-right: 5px; + margin-bottom:0 !important; + cursor: pointer; + border: 0; + padding:0 15px 0 0; + min-height: 28px; + text-align: center; +} + +.jive_dialog button > .wrap { + line-height: 20px; + margin-top: 5px; + margin-bottom: 5px; + font-weight: bold; + padding-left: 15px; + font-size: 11px; +} + +#jive_dropdown { + position:absolute; + z-index:3; +} + +#jive_dropdown .pmenu, #jive_menus .pmenu { + position:absolute; + background:#fff; + z-index:10000; + border:solid 1px #ccc; + text-align:left; + list-style-type:none; + min-width:130px; + display:none; + padding:0; + margin:0; + font-family: arial; +} + +#jive_dropdown .pmenuitem, #jive_menus .pmenuitem { + color: #666666; + cursor: pointer; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + height: 24px; + line-height: 2em; + padding: 0 12px; +} + +#jive_dropdown .pmenuitem.hover, #jive_menus .pmenuitem.hover {background:#fc870e; color:#fff;} + +#jive_dialog button.action { + /* from(e7e7e7), to(c1c1c1) */ + background: url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.png) repeat-x; + color: #666; +} + +#jive_dialog button.action.over { + /* from(e4e0e0), to(5a5a5b) */ + background: url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.over.png) repeat-x; +} + +#jive_dialog button.action.pressed { + /* from(e4e0e0), to(5a5a5b) */ + background: url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.pressed.png) repeat-x; +} + +#jive_dialog button.action.primary { + /* from(3fb8fa), to(2881bb) */ + background:url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.primary.png) repeat-x !important; + color: #fff; +} + +#jive_dialog button.action.primary.over { + /* from(#faac1f), to(#f9771d) */ + background:url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.primary.over.png) repeat-x !important; +} + +#jive_dialog button.action.primary.pressed { + background:url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/action.primary.pressed.png) repeat-x !important; +} + +#jive_dialog div.dialogFooter button.disabled { + background: #e7e7e7 !important; + color:#aaa !important; +} + +#jive_dialog .tabContainer { + position:absolute; + right:22px; + top:3px; + z-index:2; + width:auto; +} + +#jive_dialog .tab { + display:inline-block; + *display:inline; + zoom:1; + position:relative; + height:19px; + border-style: solid; + border-width:1px; +} + +/* multisheet tabs */ +#jive_dialog .tab.multisheet, +#jive_dialog .tab.dialog { + min-width:100px; + cursor:pointer; + white-space:nowrap; + top:1px; + border-color:#c5c5c5; + border-bottom:transparent; + background-color: #efefef; + *margin-right:4px; + *top:3px; + margin: 0 2px; +} + +#jive_dialog .tab.multisheet span, +#jive_dialog .tab.dialog span { + display: block; + height: 100%; + line-height: 19px; + min-width: 100px; + padding: 0 8px; + text-align: center; + width: auto; +} + +#jive_dialog .tab.multisheet.active, +#jive_dialog .tab.dialog.active { + height:22px; + top:1px; + border:1px solid #c5c5c5; + border-top:1px solid #c5c5c5; + border-bottom:transparent; +} + +#jive_dialog .tab.multisheet.active span, +#jive_dialog .tab.dialog.active span { + line-height:23px; + font-weight:bold; + border:1px solid #f8f8f8; + border-right:1px solid #ededed; + border-bottom:1px solid #ededed; + background: #ededed; /*fallback for non-CSS3 browsers*/ +} + +#jive_dialog .tab.dialog.active span { + background:#fff; + border-bottom:1px solid #ffffff; +} + +.jive_form table { + margin-bottom:2px; +} + +.jive_form td { + background:#fff; + padding:0; + margin:0; + vertical-align: top; +} + +.jive_form td.jive_textLabel { + text-align: center; + vertical-align: middle; +} + +#jive_dialog div.thick.wrapper {position:relative;padding:10px 10px;z-index:1;overflow:hidden;} +#jive_dialog div.wrapper { + overflow: hidden; + padding: 4px 10px 6px 10px; + position: relative; + z-index: 1; +} +#jive_dialog div.wrapper.label { + padding:8px 10px 0px 10px; + margin-bottom:0px; +} +#jive_dialog div.t_wrap {padding-right: 4px;} +.jive_form input, +.jive_form select { + font-size: 11px; + position:relative; + width:100%; + margin:0; + padding:0; + border-style: solid; + border-width: 1px; + border-top-color: #848484; + border-right-color: #c1c1c1; + border-bottom-color: #e1e1e1; + border-left-color: #c1c1c1; +} + +.jive_form input{height:21px;line-height:21px;} +.jive_form select{/*height:24px;line-height:24px;*/margin:4px 0;} + +.jive_form input[type="radio"]{width:auto;height:auto;float:left;position:relative;display:block;border:none;} + +.jive_form select.showList {height:auto; !important; display: inherit;} +.jive_form select.wFreeText {margin-top:8px; !important} + +.jive_form .colorbar {height:24px;border:solid 1px #ccc;} + +.jive_inputLabel {float:left;position:relative;margin-left:8px;} + +.jive_inputbutton { + -moz-user-select: none; + background: url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/dialog_button_capsule_sprite.png) repeat scroll 0 0 transparent; + cursor: pointer; + float: left; + height: 26px; + margin-left: 0px; + margin-right: 4px; + position: relative; + width: 26px; +} + +.jive_inputbutton.plain { + background:none; +} + +.jive_inputbutton.over {background-position:-50px -45px;} +.jive_inputbutton.pressed {background-position:-50px -103px;} +.jive_inputbutton.selected {background-position: 0 -50px;} +.jive_inputbutton.unchanged {background-position: -124px 0px;} +.jive_inputbutton.drop {background-position: -58px 0; width: 34px;} +.jive_inputbutton.drop.unchanged {background-position: -182px 0;} +#jive_form_basicFormat .jive_inputbutton.drop > .jive_bIcon { + margin-left: 0; + height: 30px; + margin-top: 1px; + width: 28px; +} +.jive_inputbutton.disabled { + color: #aaa; + cursor: default; +} + +#jive_dialog .selected .boldIcon { + background-position: -30px -3px; +} + +#jive_dialog .selected .italicIcon { + background-position: -30px -49px; +} + +#jive_dialog .selected .underlineIcon { + background-position: -30px -94px; +} + +#jive_dialog .unchanged .boldIcon { + background-position: -60px -3px; +} + +#jive_dialog .unchanged .italicIcon { + background-position: -60px -49px; +} + +#jive_dialog .unchanged .underlineIcon { + background-position: -60px -94px; +} + +.jive_inputbutton > div.colorpick { + cursor: pointer; + position: absolute; + top: 18px; + height:4px; +} +#jive_dialog div.colorpick.normal { + width:16px; + margin-left:6px; +} +#jive_dialog div.colorpick.wide { + width: 18px; + margin-left:5px; +} + +.jive_listTextInputTouch {display:block;} + +.jive_freeTextButton { + float:right; + position:relative; + background:transparent; + z-index:2; + cursor:pointer; +} + +.jive_bIcon { + background: url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/button_formatting_sprite.png); + display: inline-block; + height: 22px; + margin: 3px; + width: 20px; +} + +.jive_freeTextButton .jive_bIcon { + width:16px; + height:16px; + margin:6px; +} + +#jive_foobar .sortDescIcon { + background: url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/iv_format_button_sprite.png); + background-position:3px -94px; + top:2px; + left:3px; +} +#jive_foobar .sortAscIcon { + background: url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/iv_format_button_sprite.png); + background-position:3px -63px; +} +#jive_foobar .filterIcon { + background: url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/iv_format_button_sprite.png); + background-position:4px -31px; +} +#jive_foobar .formatIcon { + background: url(${path}net/sf/jasperreports/components/headertoolbar/resources/images/jive/iv_format_button_sprite.png); + background-position:2px 2px; +} +.jive_foobar_button.over .sortDescIcon{ + background-position:-73px -94px; +} +.jive_foobar_button.over .sortAscIcon{ + background-position:-73px -63px; +} +.jive_foobar_button.over .filterIcon{ + background-position:-72px -31px; +} +.jive_foobar_button.over .formatIcon{ + background-position:-74px 2px; +} +#jive_foobar .jive_foobar_button.disabled .sortDescIcon{ + background-position:-35px -94px; +} +#jive_foobar .jive_foobar_button.disabled .sortAscIcon{ + background-position:-35px -63px; +} +#jive_foobar .jive_foobar_button.disabled .filterIcon{ + background-position:-34px -31px; +} +#jive_dialog .boldIcon { + background-position:0 -3px; +} +#jive_dialog .italicIcon { + background-position:0 -49px; +} +#jive_dialog .underlineIcon { + background-position:0 -94px; +} +#jive_dialog .backgroundColorIcon { + background-position: 2px -551px; +} +#jive_dialog .unchanged .backgroundColorIcon { + background-position: -60px -551px; +} +#jive_form_columnConditionalFormatting .moveUpIcon { + background-position: 0 -598px; +} + +#jive_form_columnConditionalFormatting .moveDownIcon { + background-position: 0 -640px; +} + +#jive_form_columnConditionalFormatting .deleteIcon { + background-position: 0 -680px; +} +#jive_form_basicFormat .leftIcon { + background-position:-2px -142px; +} +#jive_form_basicFormat .selected .leftIcon { + background-position: -32px -142px; +} +#jive_form_basicFormat .centerIcon { + background-position: -1px -188px; +} +#jive_form_basicFormat .selected .centerIcon { + background-position: -31px -188px; +} +#jive_form_basicFormat .rightIcon { + background-position: 0 -234px; +} +#jive_form_basicFormat .selected .rightIcon { + background-position: -30px -234px; +} +#jive_form_basicFormat .currencyIcon { + background-position:-1px -277px; + width: 23px; +} +#jive_form_basicFormat .percentageIcon { + background-position:-1px -326px; +} +#jive_form_basicFormat .commaIcon { + background-position:-1px -371px; +} +#jive_form_basicFormat .increaseDecimalsIcon { + background-position:-2px -417px; +} +#jive_form_basicFormat .decreaseDecimalsIcon { + background-position:-1px -463px; +} +#jive_dialog .fontColorIcon { + background-position:2px -508px; +} +#jive_dialog .unchanged .fontColorIcon { + background-position: -60px -508px; +} + +#jive_colorpicker {z-index:10000;} +#jive_colorpicker td {background:#fff;border:solid 1px #fff;padding:0;} +#jive_colorpicker td.selected {background:#eee;border:solid 1px #eee;} +#jive_colorpicker .pick {width:16px;height:16px;margin:4px;cursor:pointer;} +#jive_colorpicker table {border-collapse: collapse;} +#jive_colorpicker tr.transparent_pick div.pick{border: 1px solid black; width: 240px;} +#jive_colorpicker tr.reset_pick div.pick{border: 1px solid black; width: 240px;} +table.jrPage .interactiveElement{cursor:pointer;} + +/* CONDITION LIST */ +#jive_form_columnConditionalFormatting .conditionList { + border-collapse: separate; + border:1px solid #c0c0c0; + border-spacing: 0; + color:#666666; +} + +#jive_form_columnConditionalFormatting .conditionList tr { + height:26px; +} + +#jive_form_columnConditionalFormatting .conditionList th { + background-color: #D4DEE9; /* fallback/image non-cover color */ + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#E1E9F3), to(#D4DEE9)); /* Safari 4+, Chrome 1-9 */ + background-image: -webkit-linear-gradient(top, #E1E9F3, #D4DEE9); /* Safari 5.1+, Mobile Safari, Chrome 10+ */ + background-image: -moz-linear-gradient(top, #E1E9F3, #D4DEE9); /* Firefox 3.6+ */ + background-image: -ms-linear-gradient(top, #E1E9F3, #D4DEE9); /* IE 10+ */ + background-image: -o-linear-gradient(top, #E1E9F3, #D4DEE9); /* Opera 11.10+ */ + vertical-align:middle; + padding:0 6px; + font-weight:normal; + border-top:none; + border-right:1px solid #c0c0c0; + border-bottom:1px solid #c0c0c0; + *border-bottom:2px solid #c0c0c0; + border-left:1px solid #ffffff; +} + +#jive_form_columnConditionalFormatting .conditionList td { + position:relative; + vertical-align:middle; + padding:4px 2px; + *padding:2px; + border-top:1px solid #ffffff; + border-right:1px solid #e3e9ef; + border-bottom:1px solid #ececec; + border-left:1px solid #ffffff; + *border-right:1px solid #ffffff; + *border-left:1px solid #e3e9ef; +} + +#jive_form_columnConditionalFormatting .conditionList tr.add td{ + background-color:#f6f6f6; +} + +#jive_form_columnConditionalFormatting .conditionList tr.add td .jive_inputbutton { + height: auto; +} + +#jive_form_columnConditionalFormatting .conditionList .last { + border-right:none; +} + +#jive_form_columnConditionalFormatting .conditionList td.condition_between_start { + border-right: none; +} + +#jive_form_columnConditionalFormatting .conditionList td.condition_between_end { + border-left: none; +} + +@media screen and (-webkit-min-device-pixel-ratio:0) { + #jive_dialog div.wrapper.label { /* CHROME/SAFARI STYLES */ + margin-top:2px; + margin-bottom:0px; + } +} + +#jive_form_columnConditionalFormatting { + width:700px; + display: block; + margin: 0 10px 20px 10px; +} + +#jive_form_columnConditionalFormatting .jive_textLabel>div.wrapper.label { + padding:8px 10px 2px 0; +} + +/* ApplyTo Selector */ +#jive_dialog .applytoWrapper { + padding: 4px; + margin: 0 20px; + position: relative; +} +#jive_dialog .applytoTitle, #jive_dialog .applytoSelector { + display: inline; +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.column.js jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.column.js --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.column.js 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.column.js 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,204 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +define(["jquery"], function($){ + var api = { + sort: {}, + move: {}, + format: {}, + filter: {}, + hide: {}, + unhide: {}, + resize: {} + }; + + var Column = function(config) { + this.config = config; + this.parent = null; + this.loader = null; + + this.events = { + ACTION_PERFORMED: "action", + BEFORE_ACTION_PERFORMED: "beforeAction" + }; + + this.api = api; + }; + + Column.prototype = { + sort: function(parms) { + var it = this, + payload = { + action: this.config.headerToolbar['sort' + parms.order + 'Btn'].sortData + }; + payload.action.sortData.tableUuid = it.config.parentId; + it._notify({name: it.events.BEFORE_ACTION_PERFORMED}); + return this.loader.runAction(payload).then(function(jsonData) { + it._notify({ + name: it.events.ACTION_PERFORMED, + type: "sort", + data: jsonData + }); + return it; + }); + }, + move: function(parms) { + var it = this, + payload = { + action: { + actionName: 'move', + moveColumnData: { + tableUuid: it.config.parentId, + columnToMoveIndex: it.config.columnIndex, + columnToMoveNewIndex: parms.index + } + } + }; + it._notify({name: it.events.BEFORE_ACTION_PERFORMED}); + return this.loader.runAction(payload).then(function(jsonData) { + it._notify({ + name: it.events.ACTION_PERFORMED, + type: "move", + data: jsonData + }); + + return it; + }); + }, + format: function(parms) { + var it = this, + payload = { + action: parms + }; + it._notify({name: it.events.BEFORE_ACTION_PERFORMED}); + return this.loader.runAction(payload).then(function(jsonData) { + it._notify({ + name: it.events.ACTION_PERFORMED, + type: "format", + data: jsonData + }); + + return it; + }); + }, + filter: function(parms) { + var it = this, + filterParms = $.extend({}, it.config.filtering.filterData, parms), + payload = { + action: { + actionName: 'filter', + filterData: filterParms + } + }; + it._notify({name: it.events.BEFORE_ACTION_PERFORMED}); + return this.loader.runAction(payload).then(function(jsonData) { + it._notify({ + name: it.events.ACTION_PERFORMED, + type: "filter", + data: jsonData + }); + + return it; + }); + }, + hide: function() { + var it = this, + payload = { + action: { + actionName: 'hideUnhideColumns', + columnData: { + tableUuid: it.config.parentId, + hide: true, + columnIndexes: [this.config.columnIndex] + } + } + }; + it._notify({name: it.events.BEFORE_ACTION_PERFORMED}); + return this.loader.runAction(payload).then(function(jsonData) { + it._notify({ + name: it.events.ACTION_PERFORMED, + type: "hide", + data: jsonData + }); + + return it; + }); + }, + unhide: function(columnIds) { + var it = this, + payload = { + action: { + actionName: 'hideUnhideColumns', + columnData: { + tableUuid: it.config.parentId, + hide: false, + columnIndexes: columnIds ? columnIds : [this.config.columnIndex] + } + } + }; + it._notify({name: it.events.BEFORE_ACTION_PERFORMED}); + return this.loader.runAction(payload).then(function(jsonData) { + it._notify({ + name: it.events.ACTION_PERFORMED, + type: "unhide", + data: jsonData + }); + + return it; + }); + }, + resize: function(parms) { + var it = this, + payload = { + action: { + actionName: 'resize', + resizeColumnData: { + tableUuid: it.config.parentId, + columnIndex: this.config.columnIndex, + direction: "right", + width: parms.width + } + } + }; + it._notify({name: it.events.BEFORE_ACTION_PERFORMED}); + return this.loader.runAction(payload).then(function(jsonData) { + it._notify({ + name: it.events.ACTION_PERFORMED, + type: "resize", + data: jsonData + }); + + return it; + }); + }, + + // internal functions + _notify: function(evt) { + // bubble the event + this.parent._notify(evt); + } + } + + return Column; +}); diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.i18n.tmpl jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.i18n.tmpl --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.i18n.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.i18n.tmpl 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,56 @@ +{ + "column.format.dialog.title": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.title.formatcolumn')", + "column.format.title": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.title.format')", + "column.format.formatmenu.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.formatting')", + "column.format.hidecolumn.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.hidecolumn')", + "column.format.showcolumns.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.showcolumns')", + "column.format.showcolumns.all.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.showcolumns.all')", + + "column.filter.dialog.title": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.title.filtercolumn')", + "column.filter.title": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.columnfilters')", + "column.sortasc.title": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.sortasc')", + "column.sortdesc.title": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.sortdesc')", + + "column.dialog.extfonts": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.extfonts')", + "column.dialog.sysfonts": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.sysfonts')", + + "column.filterform.clearfilter.true.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.clearfilter.true')", + "column.filterform.clearfilter.false.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.clearfilter.false')", + + "column.formatHeaderForm.headingName.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.headingtext')", + + "column.formatforms.fontName.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.fontname')", + "column.formatforms.fontSize.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.fontsize')", + "column.formatforms.fontColor.title": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.title.fontcolor')", + "column.formatforms.fontBackColor.title": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.title.fontbackcolor')", + "column.formatforms.styleButtons.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.style')", + "column.formatforms.color.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.color')", + "column.formatforms.alignment.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.alignment')", + "column.formatforms.numberformat.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.numberformat')", + "column.formatforms.currency.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.currency')", + "column.formatforms.currency.none.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.currency.none')", + + "column.basicFormatForm.title": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.title.basicformat')", + "column.formatCellsForm.formatPattern.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.formatpattern')", + "column.formatCellsForm.numberFormatButtons.localespecific.label": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.localespecific')", + + "column.move.helper": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.label.draghelper')", + + "column.conditionalFormatting.title": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.title.conditions')", + "column.conditionalFormatting.conditions.list.title": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.conditions.list')", + "column.conditionalFormatting.condition.operator": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.condition.operator')", + "column.conditionalFormatting.condition.condition": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.condition.condition')", + "column.conditionalFormatting.condition.format": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.condition.format')", + "column.conditionalFormatting.condition.add": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.condition.add')", + + "column.basicFormatForm.groupheading.prefix": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.groupheading.prefix')", + "column.basicFormatForm.groupsubtotal.prefix": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.groupsubtotal.prefix')", + "column.basicFormatForm.applyto.option.headings": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.applyto.option.headings')", + "column.basicFormatForm.applyto.option.detailrows": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.applyto.option.detailrows')", + "column.basicFormatForm.applyto.option.tabletotal": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.applyto.option.tabletotal')", + + "format.dialog.column.previous": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.dialog.previous.column')", + "format.dialog.column.next": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.dialog.next.column')", + + "bookmarks.dialog.title": "$msgProvider.getMessage('net.sf.jasperreports.components.headertoolbar.bookmarks.dialog.title')" +} \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.interactive.column.js jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.interactive.column.js --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.interactive.column.js 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.interactive.column.js 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,1817 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +define(["jquery.ui", "jive"], function($, jive) { + var EventManager = null; + + var DURATION_PATTERN = "[h]:mm:ss"; + + jive.interactive.column = { + genericPropertiesInitialized: false, + uuid: null, + allColumns: {}, + allColumnGroups: {}, + allColumnsMap: {}, + columnsData: {}, + count: 0, + ids: {}, + fontSizes:null, + fonts: { + extension: null, + system: null + }, + patterns: null, + operators: null, + filterPatterns: null, + calendarPatterns: null, + actions: { + format: {icon: 'formatIcon', title: jive.i18n.get('column.format.title'), actions:{ + formatHeaderAndValues: {label: jive.i18n.get('column.format.formatmenu.label'), fn:'formatHeader'}, + hideColumn: {label: jive.i18n.get('column.format.hidecolumn.label'), fn:'hide', arg:'{"hide":true}'}, + showColumns: {label: jive.i18n.get('column.format.showcolumns.label'), actions:{ + showAll: {label: jive.i18n.get('column.format.showcolumns.all.label'), fn: 'hide', arg:'{"hide":false,"column":"all"}'} + }} + }}, + filter: {icon: 'filterIcon', title: jive.i18n.get('column.filter.title'), fn: 'filter'}, + sortAscending: {icon: 'sortAscIcon', title: jive.i18n.get('column.sortasc.title'), fn:'sort', arg:['Asc']}, + sortDescnding: {icon: 'sortDescIcon', title: jive.i18n.get('column.sortdesc.title'), fn: 'sort', arg:['Desc']} + }, + dropColumns: {}, + dropPoints: {}, + visibleColumnsMoveData: {}, + ldi: null, + rdi: null, + delta: null, + reportInstance: null, + + init: function(report) { + var it = this; + + it.reportInstance = report; + EventManager = report.eventManager; + + jive.init(report); + + $.each(report.components.table, function() { + // dynamic properties (fonts, fontsizes) come only for the first table + if (!it.genericPropertiesInitialized && this.config.genericProperties) { + it.setGenericProperties(this.config.genericProperties); + it.genericPropertiesInitialized = true; + } + if(!it.genericPropertiesInitialized) { + alert('Error: generic properties not set for interactive column.'); + } else { + it.initColumns(this, report.config.container); + } + }); + }, + + initColumns: function(Table, jqReportContainer){ + var c,i,it = this, lt, tableCols = [], colData, prop; + var tableUuid = Table.config.id; + var allColumns = Table.config.allColumnsData; + + it.allColumns[tableUuid] = allColumns; + it.allColumnGroups[tableUuid] = Table.config.allColumnGroupsData; + it.allColumnsMap[tableUuid] = {}; + + /* + * Load dynamic form data + */ + it.basicFormatForm.elements[1][0][0].groups = [{name: jive.i18n.get('column.dialog.extfonts'),values:[]}]; + $.each(it.fonts.extension,function(i,v) { + it.basicFormatForm.elements[1][0][0].groups[0].values.push([v,v]); + }); + it.basicFormatForm.elements[1][0][0].groups.push({name: jive.i18n.get('column.dialog.sysfonts'),values:[]}); + $.each(it.fonts.system,function(i,v) { + it.basicFormatForm.elements[1][0][0].groups[1].values.push([v,v]); + }); + + it.basicFormatForm.elements[1][0][1].values = []; + $.each(it.fontSizes,function(i,v) { + it.basicFormatForm.elements[1][0][1].values.push([v,v]); + }); + + /* + * Compute drop boundaries (x-axis only) for DnD visual feedback. + */ + it.dropPoints[tableUuid] = []; + it.visibleColumnsMoveData[tableUuid] = []; + it.dropColumns[tableUuid] = []; + + var firstColumnHeader = jqReportContainer.find("table.jrPage").find('td.jrcolHeader[data-tableuuid=' + tableUuid + ']:first'); + var parentContainer; + firstColumnHeader.parents('table').each(function(i, v) { + parentContainer = $(v); + tableCols = parentContainer.find('td.jrcolHeader[data-tableuuid=' + tableUuid + ']'); + if (tableCols.length > 0) { + return false; //break each + } + }); + + var colsData = it.columnsData[tableUuid] = {}; + + for (i = 0; i < tableCols.length; i++) { + var colUuid = $(tableCols.get(i)).data('coluuid'), + cols, firstCol, lastCol, realWidth, firstLeft; + if (colsData[colUuid]) continue; + + cols = parentContainer.find('td.jrcolHeader[data-coluuid=' + colUuid + ']'); + firstCol = cols.eq(0); + if (cols.size() > 0) { + lastCol = cols.eq(cols.size()-1); + } else { + lastCol = firstCol; + } + + realWidth = firstCol.outerWidth(); + firstLeft = firstCol.position().left; + + cols.each(function(i, v) { + var it = $(v); + if (it.position().left < firstLeft) {//should not happen but let's be safe + realWidth += firstLeft - it.position().left; + firstLeft = it.position().left; + } + if (it.position().left + it.outerWidth() > firstLeft + realWidth) { + realWidth = it.position().left + it.outerWidth() - firstLeft; + } + }); + + colsData[colUuid] = { + jo: $(firstCol), + width: realWidth, + height: lastCol.position().top - firstCol.position().top + lastCol.height(), + colidx: lastCol.data('colidx') + }; + } + + tableCols = []; + for (prop in colsData) { // convert object to array + if (colsData.hasOwnProperty(prop)) { + tableCols.push(colsData[prop]); + } + } + tableCols.sort(function(col1,col2) { + return col1.jo.data('colidx')-col2.jo.data('colidx'); + }); + + for (i = 0; i < tableCols.length; i++) { + c = tableCols[i]; + lt = c.jo.offset().left; + colData = it.getColumnByUuid(c.jo.data('coluuid'), tableUuid); + if (colData != null) { + colData.visible = true; // enable column + } + it.dropColumns[tableUuid].push('cel_'+c.jo.data('cellid')); + it.dropPoints[tableUuid].push(lt); + it.visibleColumnsMoveData[tableUuid].push({ + left: lt, + right: lt + c.width, + width: c.width, + index: colData != null ? colData.index : null, + uuid: c.jo.data('coluuid') + }); + + if (i == tableCols.length - 1) { + it.dropPoints[tableUuid].push(lt + c.width); + } + } + + var markers = []; + for(i=0;i 0) { + return false; //break each + } + }); + return result; + }, + getColumnByUuid: function(columnUuid, tableUuid) { + var tableColumns = this.allColumns[tableUuid], + colIdx; + + for (colIdx in tableColumns) { + if (tableColumns[colIdx].uuid === columnUuid) { + return tableColumns[colIdx]; + } + } + return null; + }, + getInteractiveElementFromProxy: function(cellJo){ + var classes = cellJo.attr('class').split(' '), + headerSel = 'td[data-cellid="' + classes[1].substring(4) + '"]:first', + headerJo = null, + cellJoOffsetTop = cellJo.offset().top; + + cellJo.parents().each(function(i, v) { + headerJo = $(headerSel, v); + if (headerJo && headerJo.length > 0 + && headerJo.offset().top < cellJoOffsetTop) { // the header must be above the cell + return false; // break each + } + headerJo = null; + }); + + return headerJo; + }, + zoom: function(o) { + jive.zoom(o); + }, + getElementSize: function(){ + var it = this, + jo = jive.selected.jo, + cid = jo.data('cellid'), + h = null; + + cid = ('' + cid).replace(/\./g,'\\.'); + + jo.parents().each(function(i, v) { + var lastCell = $('td.cel_' + cid + ':last', v); + if(lastCell && lastCell.length > 0) { + var lastElemTop = lastCell.offset().top; + var lastElemHeight = lastCell.outerHeight() * (it.reportInstance.zoom && it.reportInstance.zoom.level ? it.reportInstance.zoom.level : 1); + h = lastElemTop + lastElemHeight - jo.offset().top; + return false; // break each + } + }); + + if (h === null) { + h = jive.selected.realHeight; + } + + return {w:jive.selected.realWidth, h:h}; + }, + onSelect: function(){ + var it = this, + allOption = [], + pmenu = jive.ui.foobar.menus.column.showColumns.jo, + tableUuid = jive.selected.jo.data('tableuuid'), + allColumns = it.allColumns[tableUuid]; + + if(it.count == 1) { + jive.ui.foobar.menus.column.format.jo.find('li').eq(1).hide(); + jive.ui.overlay.jo.draggable('option','disabled',true); + }else { + jive.ui.foobar.menus.column.format.jo.find('li').eq(1).show(); + jive.ui.overlay.jo.draggable('option','disabled',false); + } + + pmenu.children().each(function(i,el){ + if (i > 0) { + var menuItmArgs = $(el).data('args'); + var col = it.getColumnByUuid(menuItmArgs.columnUuid, tableUuid); + if (col != null) { + menuItmArgs.column = [col.index]; + $(el).data('args', menuItmArgs); + } + if (col && col.visible === true) { + el.style.display = 'none'; + } else if (col){ + allOption.push(col.index); + el.style.display = 'block'; + } else { + el.style.display = 'none'; + } + } + }); + + if(allOption.length > 0){ + jive.ui.foobar.menus.column.format.jo.find('li').eq(2).show(); + pmenu.children().eq(0).data('args',{hide:false,column:allOption}); + } else { + jive.ui.foobar.menus.column.format.jo.find('li').eq(2).hide(); + } + + // disable sort/filter if not sortable/filterable + var sortButtons = $('button:eq(2), button:eq(3)', jive.ui.foobar.jo), + filterButton = $('button:eq(1)', jive.ui.foobar.jo); + !jive.selected.ie.config.canSort ? sortButtons.addClass('disabled') : sortButtons.removeClass('disabled'); + !jive.selected.ie.config.canFilter ? filterButton.addClass('disabled') : filterButton.removeClass('disabled'); + }, + onDragStart: function(){ + var prop, i; + this.uuid = jive.selected.jo.data('tableuuid'); + this.currentColumnsMoveData = this.visibleColumnsMoveData[this.uuid]; + this.currentColMoveData = null; + + for (i = 0; i < this.currentColumnsMoveData.length; i++) { + if (this.currentColumnsMoveData[i].uuid === jive.selected.jo.data('coluuid')) { + this.currentColMoveData = this.currentColumnsMoveData[i]; + break; + } + } + + var c = 'cel_'+ jive.selected.jo.data('cellid'); + var ci = $.inArray(c,this.dropColumns[this.uuid]) * 2; + this.ldi = ci == 0 ? 0 : ci - 1; + this.rdi = ci + 3 == this.dropPoints[this.uuid].length ? ci + 2 : ci + 3; + + this.delta = jive.ui.marker.position.left - this.dropPoints[this.uuid][ci+2]; + this.dropColumnIndex = ci; + + this.colToMoveToIndex = this.currentColMoveData.index; + }, + onDrag: function(evt,ui){ + var ev = evt.originalEvent.originalEvent || evt; + var markers = this.dropPoints[this.uuid]; + var i = 0, ln = this.currentColumnsMoveData.length, colMoveData, refColIndex, refColMiddle, isLeftToRight; + + if(evt.pageX < markers[this.ldi]) { + if(this.ldi > 0){ + this.dropColumnIndex = this.ldi % 2 == 1 ? this.ldi - 1 : this.ldi; + jive.ui.marker.jo.css('left', markers[this.dropColumnIndex] + this.delta +'px').show(); + this.rdi = this.ldi; + this.ldi--; + } + } + if(evt.pageX > markers[this.rdi]) { + if(this.rdi < (markers.length-1)) { + this.dropColumnIndex = this.rdi % 2 == 1 ? this.rdi + 1 : this.rdi; + jive.ui.marker.jo.css('left', markers[this.dropColumnIndex] + this.delta + 'px').show(); + this.ldi = this.rdi; + this.rdi++; + } + } + + // determine move direction + if (evt.pageX > this.currentColMoveData.right) { + isLeftToRight = true; + } else if (evt.pageX < this.currentColMoveData.left){ + isLeftToRight = false; + } + + // find column based on event.pageX + for (; i < ln; i++) { + colMoveData = this.currentColumnsMoveData[i]; + if (evt.pageX <= colMoveData.right) { + refColIndex = parseInt(colMoveData.index); + refColMiddle = colMoveData.left + colMoveData.width / 2; + + if (evt.pageX <= refColMiddle) { // move left, relative to column middle + if (refColIndex > 0) { + if (isLeftToRight === true) { + this.colToMoveToIndex = refColIndex - 1; + } else if (isLeftToRight === false) { + this.colToMoveToIndex = refColIndex; + } + } else { + this.colToMoveToIndex = 0; + } + } else { // move right, relative to column middle + if (isLeftToRight === true) { + this.colToMoveToIndex = refColIndex; + } else if (isLeftToRight === false) { + this.colToMoveToIndex = refColIndex + 1; + } + } + break; + } + } + + if (isLeftToRight && this.colToMoveToIndex == null) { // for maximum drag to right, move to index of last visible column + this.colToMoveToIndex = parseInt(this.currentColumnsMoveData[ln-1].index); + } + }, + onDragStop: function(ev,ui){ + if(this.colToMoveToIndex != null && this.colToMoveToIndex != jive.selected.ie.config.columnIndex) { + jive.selected.ie.move({index: this.colToMoveToIndex}); + } + }, + resize: function(width){ + var w = width < 8 ? 8 : Math.floor(width); + jive.hide(); + jive.selected.ie.resize({width: w}); + }, + sort: function(argv){ + jive.hide(); + jive.selected.ie.sort({order: argv[0]}); + }, + filter: function(){ + var label = jive.selected.ie.config.columnLabel; + !label.length && (label = "#" + (jive.selected.ie.config.columnIndex + 1)); + + jive.ui.dialog.show(jive.i18n.get('column.filter.dialog.title') + ': ' + label, ['columnfilter']); + }, + formatHeader: function(){ + var label = jive.selected.ie.config.columnLabel; + !label.length && (label = "#" + (jive.selected.ie.config.columnIndex + 1)); + + jive.ui.dialog.show(jive.i18n.get('column.format.dialog.title') + ': ' + label, ['basicFormat', 'columnConditionalFormatting']); + }, + hide: function(args){ + jive.hide(); + if(args.hide) { + jive.selected.ie.hide(); + } else { + var columnIndices, allColumnsMap; + if(args.columnUuid) { + if (!jive.elements[args.columnUuid]) { + allColumnsMap = this.allColumnsMap[jive.selected.ie.config.parentId]; + } else { + allColumnsMap = this.allColumnsMap[jive.elements[args.columnUuid].config.parentId]; + } + columnIndices = [allColumnsMap[args.columnUuid].index]; + } else { + columnIndices = args.column; + } + jive.selected.ie.unhide(columnIndices); + } + }, + setGenericProperties: function (obj) { + jive.interactive.column.fontSizes = obj.fontSizes; + jive.interactive.column.fonts = obj.fonts; + jive.interactive.column.patterns = obj.patterns; + jive.interactive.column.operators = obj.operators; + jive.interactive.column.filterPatterns = obj.filterPatterns; + jive.interactive.column.calendarPatterns = obj.calendarPatterns; + }, + showCurrencyDropDown: function(){ + jive.selected.form.inputs['currencyBtn1'].showOptions(); + }, + applyCurrencyFormat: function(args) { + var it = this, + input = jive.selected.form.inputs['currencyBtn1'], + cSymbol = $('#formatPattern').data('cSymbol'); + + $('#formatPattern').children().each(function (i, optElem) { + var opt = $(optElem); + + if (DURATION_PATTERN !== opt.val()) { + + // attempt to remove current symbol, if present + if (cSymbol && cSymbol.length > 0) { + opt.text(it.numberFormat.addRemoveCurrencySymbol(opt.text(), false, cSymbol)); + opt.val(it.numberFormat.addRemoveCurrencySymbol(opt.val(), false, cSymbol)); + } + + // apply new symbol + if (args.val && args.val.length > 0) { + opt.text(it.numberFormat.addRemoveCurrencySymbol(opt.text(), true, args.val)); + opt.val(it.numberFormat.addRemoveCurrencySymbol(opt.val(), true, args.val)); + $('#formatPattern').data('cSymbol', args.val); + } + } + }); + + input.hideOptions(); + }, + togglePercentageFormat: function(){ + var it = this; + $('#formatPattern').children().each(function (i, optElem) { + var opt = $(optElem); + + if (DURATION_PATTERN !== opt.val()) { + opt.text(it.numberFormat.addRemovePercentageForNumber(opt.text(), jive.selected.form.inputs['percentageBtn'].value)); + opt.val(it.numberFormat.addRemovePercentage(opt.val(), jive.selected.form.inputs['percentageBtn'].value)); + } + }); + }, + toggleCommaFormat: function(){ + var it = this; + $('#formatPattern').children().each(function (i, optElem) { + var opt = $(optElem); + + if (DURATION_PATTERN !== opt.val()) { + opt.text(it.numberFormat.addRemoveThousandsSeparator(opt.text(), jive.selected.form.inputs['commaBtn'].value)); + opt.val(it.numberFormat.addRemoveThousandsSeparator(opt.val(), jive.selected.form.inputs['commaBtn'].value)); + } + }); + }, + addDecimal: function(){ + var it = this; + $('#formatPattern').children().each(function (i, optElem) { + var opt = $(optElem); + if (DURATION_PATTERN !== opt.val()) { + opt.text(it.numberFormat.addRemoveDecimalPlace(opt.text(), true)); + opt.val(it.numberFormat.addRemoveDecimalPlace(opt.val(), true)); + } + }); + }, + remDecimal: function(){ + var it = this; + $('#formatPattern').children().each(function (i, optElem) { + var opt = $(optElem); + + if (DURATION_PATTERN !== opt.val()) { + opt.text(it.numberFormat.addRemoveDecimalPlace(opt.text(), false)); + opt.val(it.numberFormat.addRemoveDecimalPlace(opt.val(), false)); + } + }); + }, + numberFormat: { + symbols: { + currency: '\u00A4' + }, + regex: { + numberPart: /([\d|#]+(?!,))/, + decimalPart: /(\.[\d|#]+)/, + numericChar: /[\d|#]/ + }, + addRemoveDecimalPlace: (function () { + return function (exp, booleanAdd) { + var pozToken = exp.split(';')[0], + negToken = exp.split(';')[1]; + + if (booleanAdd) { + exp = addDecimalPlaceToToken(pozToken); + if (negToken) { + exp = exp + ";" + addDecimalPlaceToToken(negToken); + } + return exp; + } else { + exp = removeDecimalPlaceFromToken(pozToken); + if (negToken) { + exp = exp + ";" + removeDecimalPlaceFromToken(negToken); + } + return exp; + } + }; + + function addDecimalPlaceToToken (token) { + var dotIndex = token.indexOf('.'); + + if (dotIndex != -1) { // already have decimals + var decimalPart = jive.interactive.column.numberFormat.regex.decimalPart.exec(token)[1]; + + return token.replace(decimalPart, decimalPart + '0'); + + } else { // no decimals + var numberPart = jive.interactive.column.numberFormat.regex.numberPart.exec(token)[1]; + + return token.replace(numberPart, numberPart + '.0'); + } + } + + function removeDecimalPlaceFromToken (token) { + var result = token, + dotIndex = result.indexOf('.'); + + if (dotIndex != -1) { + var decimalPart = jive.interactive.column.numberFormat.regex.decimalPart.exec(result)[1]; + + if (decimalPart.length > 2) { // remove last decimal place + result = result.replace(decimalPart, decimalPart.substring(0, decimalPart.length - 1)); + } else { // remove all (dot and decimal place) + result = result.replace(decimalPart, ''); + } + } + + return result; + } + }()), + + addRemoveThousandsSeparator: (function () { + return function (exp, booleanAdd) { + var indexOfComma = exp.indexOf(','), + pozToken = exp.split(';')[0], + negToken = exp.split(';')[1]; + + if (booleanAdd) { + if (indexOfComma == -1) { // add + exp = addThousandsSeparatorToToken(pozToken); + if (negToken) { + exp = exp + ';' + addThousandsSeparatorToToken(negToken); + } + } + } else { + if (indexOfComma != -1) { // remove + exp = removeThousandsSeparatorFromToken(pozToken); + if (negToken) { + exp = exp + ';' + removeThousandsSeparatorFromToken(negToken); + } + } + } + return exp; + }; + + function addThousandsSeparatorToToken (token) { + var indexOfNumericChar = token.indexOf(jive.interactive.column.numberFormat.regex.numericChar.exec(token)), + firstPart = token.substring(0, indexOfNumericChar + 1); + + return firstPart + ',' + token.substring(firstPart.length);; + } + + function removeThousandsSeparatorFromToken (token) { + return token.replace(',',''); + } + }()), + + addRemovePercentage: (function () { + return function (exp, booleanAdd) { + var indexOfPercent = exp.indexOf('%'), + pozToken = exp.split(';')[0], + negToken = exp.split(';')[1]; + + if (booleanAdd) { // add + if (indexOfPercent == -1) { + exp = addPercentageToToken(pozToken); + if (negToken) { + exp = exp + ";" + addPercentageToToken(negToken); + } + } + } else { // remove + if (indexOfPercent != -1) { + exp = removePercentageFromToken(pozToken); + if (negToken) { + exp = exp + ";" + removePercentageFromToken(negToken); + } + } + } + return exp; + }; + + function addPercentageToToken (token) { + return token + ' %'; + }; + + function removePercentageFromToken (token) { + return token.substring(0, token.length - 2); + }; + }()), + + /** + * @param negPattern must be in form of: pozSubPattern;negSubPattern + */ + applyNegativeNumberPattern: function (negPattern) { + var pozPatternRegex = new RegExp(negPattern.split(';')[0], 'g'), + exp = jive.interactive.column.numberFormatExpression || '###0', + pozToken = exp.split(';')[0]; + + exp = negPattern.replace(pozPatternRegex, pozToken); + return exp; + }, + + addRemovePercentageForNumber: function (numberExp, booleanAdd) { + var numberPart = jive.interactive.column.numberFormat.regex.numberPart.exec(numberExp)[1]; + + if (booleanAdd) { + if (numberExp.indexOf('%') == -1 && numberPart.indexOf('00') == -1) { + numberExp = numberExp.replace(numberPart, numberPart + "00"); + numberExp = numberExp + ' %'; + } + } else { + if (numberExp.indexOf('%') != -1 && numberPart.indexOf('00') != -1) { + numberExp = numberExp.replace(numberPart, numberPart.substring(0, numberPart.length - 2)); + numberExp = numberExp.substring(0, numberExp.length - 2); + } + } + + return numberExp; + }, + + addRemoveCurrencySymbol: function(exp, booleanAdd, currencySymbol) { + var cs = currencySymbol || jive.interactive.column.numberFormat.symbols.currency, + indexOfCS = exp.indexOf(cs), + pozToken = exp.split(';')[0], + negToken = exp.split(';')[1]; + + if (booleanAdd) { + if (indexOfCS == -1) { + exp = cs + " " + pozToken; + if (negToken) { + exp = exp + ";" + cs + " " + negToken; + } + } + } else { + if (indexOfCS != -1) { + exp = pozToken.substring(2); + if (negToken) { + exp = exp + ";" + negToken.substring(2); + } + } + } + + return exp; + } + } + } + + jive.interactive.column.columnFilterForm = { + name: 'columnfilter', + method: 'get', + jc: {}, + elements: [ + [[{type:'radio',id:'clearFilter',label: jive.i18n.get('column.filterform.clearfilter.true.label'), value:'true'}]], + [ + [{type:'radio',id:'clearFilter',label: jive.i18n.get('column.filterform.clearfilter.false.label'), value:'false',colspan:4}], + [ + {type:'list', id:'filterTypeOperator', values:[]}, + {type:'text', id:"fieldValueStart", value:''}, + {type:'label', value:'and'}, + {type:'text', id:"fieldValueEnd", value:''} + ] + ] + ], + onCreate:function(jo){ + /* + * This method is called when form is created. Can be used to initiate behavior and cache form elements. + */ + var it = this; + it.jc.filterStart = $('#fieldValueStart'); + it.jc.filterEnd = $('#fieldValueEnd').prop('disabled',true); + it.jc.filterType = $('#filterTypeOperator').change(function(){ + if($(this).val().indexOf('BETWEEN') >= 0){ + it.jc.filterEnd.parent().parent().prev().show(); + it.jc.filterEnd.parent().parent().show(); + it.jc.filterEnd.prop('disabled',false); + } else { + it.jc.filterEnd.parent().parent().prev().hide(); + it.jc.filterEnd.parent().parent().hide(); + it.jc.filterEnd.prop('disabled',true); + } + }); + $('input[name="clearFilter"]').change(function(){ + var filtertype = jive.selected.ie.config.filtering.filterData.filterType.toLowerCase(); + + for(p in it.jc) (it.jc.hasOwnProperty(p) && $(this).val() == 'true') ? it.jc[p].prop('disabled',true) : it.jc[p].prop('disabled',false); + it.jc.filterEnd.prop('disabled', (it.jc.filterType.val().indexOf('BETWEEN') >= 0 && $(this).val() == 'false') ? false : true); + + if (filtertype == 'boolean' && $(this).val() == 'false') { + it.jc.filterStart.prop('disabled', true); + it.jc.filterStart.closest('td').hide(); + } + }); + }, + onShow:function(){ + // hide applyTo and prev/next col + var dialog = jive.ui.dialog.jo; + dialog.find('.applytoWrapper').hide(); + dialog.find('#colprev').hide(); + dialog.find('#colnext').hide(); + + var it = this, + metadata = jive.selected.ie.config.filtering.filterData, + filtertype = metadata.filterType.toLowerCase(), + options = jive.interactive.column.operators[filtertype], + calendarPattern = jive.interactive.column.calendarPatterns["date"], + calendarTimePattern = jive.interactive.column.calendarPatterns["time"], + p; + + it.jc.filterType.empty(); + + $.each(options, function(i, option) { + it.jc.filterType.append($("'); + }); + $('#formatPattern').html(htm.join('')); + + if (!isFromCache) { + formatPattern = jive.decodeHTML(metadata.formatPattern); + } else { + formatPattern = metadata.formatPattern; + } + + inputs['formatPattern'].set(formatPattern); + + jo.find('tr').show(); + if (dataType == 'numeric') { + if (DURATION_PATTERN === formatPattern) { + jo.find('tr:eq(0)').children('td:last').css('visibility','hidden'); + jo.find('tr:eq(1)').children('td:last').css('visibility','hidden'); + } else { + jo.find('tr:eq(0)').children('td:last').css('visibility','visible'); + jo.find('tr:eq(1)').children('td:last').css('visibility','visible'); + inputs['percentageBtn'].set(false); + inputs['commaBtn'].set(false); + } + } else { + jo.find('tr:eq(0)').children('td:last').css('visibility','hidden'); + jo.find('tr:eq(1)').children('td:last').css('visibility','hidden'); + } + } else { + jo.find('tr').hide(); + } + } + }, + getGroupMetadata: function(groupId) { + var groupData = {}; + $.each(jive.interactive.column.allColumnGroups[jive.selected.ie.config.parentId], function(i, group) { + if (group.id === groupId) { + $.extend(groupData, group.groupData); + group.groupName && (groupData.groupName = group.groupName); + group.dataType && (groupData.dataType = group.dataType); + return false; // break each + } + }); + + return groupData; + }, + submit:function(){ + var actions = [], + prop; + this.actionDataCache[this.getCacheKey()] = this.getActionData(); + + for (prop in this.actionDataCache) { + if (this.actionDataCache.hasOwnProperty(prop)) { + actions.push(this.actionDataCache[prop]); + } + } + jive.hide(); + jive.selected.ie.format(actions); + }, + onBlur: function(prevApplyTo) { + this.actionDataCache[this.getCacheKey(prevApplyTo)] = this.getActionData(prevApplyTo); + }, + onHide: function() { + this.actionDataCache = {}; + }, + getActionData: function(prevApplyTo) { + var inputs = jive.selected.form.inputs, + currentApplyTo = prevApplyTo || $('#applyTo').val(), + val = currentApplyTo.substring(0, currentApplyTo.indexOf('_') != -1 ? currentApplyTo.indexOf("_"): currentApplyTo.length), + result, + metadata = this.getGroupMetadata(currentApplyTo); + + result = { + actionName: 'editTextElement', + editTextElementData:{ + applyTo: val, + tableUuid: jive.selected.ie.config.parentId, + columnIndex: jive.selected.ie.config.columnIndex, + fontName: jive.escapeFontName(inputs['fontName'].get()), + fontSize: inputs['fontSize'].get(), + fontBold: inputs['fontBold'].get(), + fontItalic: inputs['fontItalic'].get(), + fontUnderline: inputs['fontUnderline'].get(), + fontHAlign: inputs['fontAlign'].get(), + fontColor: inputs['fontColor'].get(), + fontBackColor: inputs['fontBackColor'].getBackColor(), + mode: inputs['fontBackColor'].getModeValue(), + dataType: metadata && metadata.dataType + } + }; + + switch(val) { + case 'heading': + result.editTextElementData.headingName = inputs['headingName'].get(); + break; + case 'tabletotal': + case 'detailrows': + result.editTextElementData.formatPattern = inputs['formatPattern'].get(); + break; + case 'groupheading': + result.editTextElementData.groupName = metadata.groupName || null; + break; + case 'groupsubtotal': + result.editTextElementData.formatPattern = inputs['formatPattern'].get(); + result.editTextElementData.groupName = metadata.groupName || null; + break; + } + + return result; + } + }; + + jive.interactive.column.columnConditionalFormattingForm = { + actionDataCache: {}, + name: 'columnConditionalFormatting', + title: jive.i18n.get('column.conditionalFormatting.title'), + method: 'get', + options: null, + conditionType: null, + prevApplyTo: null, + templateElements: [ + {type:'label', value:''}, + {type:'list', id:'conditionTypeOperator', values:[]}, + {type:'text', id:'conditionStart', value:'', wrapClass: 't_wrap'}, + {type:'label', value:'and', wrapClass: 't_wrap', tdClass: 'condition_between_start'}, + {type:'text', id:'conditionEnd', value:'', wrapClass: 't_wrap'}, + { + type: 'buttons', + items: [ + {type:'checkbox',id:'conditionFontBold',value:'bold',bIcon:'boldIcon', isTripleState: true}, + {type:'checkbox',id:'conditionFontItalic',value:'italic',bIcon:'italicIcon', isTripleState: true}, + {type:'checkbox',id:'conditionFontUnderline',value:'underline',bIcon:'underlineIcon', isTripleState: true}, + {type:'backcolor',id:'conditionFontBackColor',bIcon:'backgroundColorIcon',title:jive.i18n.get('column.formatforms.fontBackColor.title'), drop: true, showTransparent: true, showReset: true, styleClass: 'wide'}, + {type:'color',id:'conditionFontColor',bIcon:'fontColorIcon',title:jive.i18n.get('column.formatforms.fontColor.title'), drop: true, showReset: true} + ] + }, + { + type: 'buttons', + items: [ + {type:'action', id:'conditionMoveUp', fn: 'conditionMoveUp', bIcon: 'moveUpIcon', btnClass: 'plain'}, + {type:'action', id:'conditionMoveDown', fn: 'conditionMoveDown', bIcon: 'moveDownIcon', btnClass: 'plain'} + ] + }, + {type:'button', id:'conditionRemove', bIcon:'deleteIcon', fn: 'removeFormatCondition', btnClass: 'plain', tdClass: 'last'} + ], + elements: [ + [ + [ + {type:'label', value: jive.i18n.get('column.conditionalFormatting.conditions.list.title'), align: 'left', wrapClass: 'wrapper label'} + ] + ], + [ + [ + {type:'label', value:'#', isHeader: true, tdWidth: '3%', align: 'center'}, + {type:'label', value: jive.i18n.get('column.conditionalFormatting.condition.operator'), isHeader: true, tdWidth: '26%', align: 'center'}, + {type:'label', value: jive.i18n.get('column.conditionalFormatting.condition.condition'), colspan: 3, isHeader: true, tdWidth: '30%', align: 'center'}, + {type:'label', value: jive.i18n.get('column.conditionalFormatting.condition.format'), isHeader: true, tdWidth: '26%', align: 'center'}, + {type:'label', isHeader: true, tdWidth: '10%', align: 'center'}, + {type:'label', isHeader: true, tdClass: 'last', tdWidth: '5%', align: 'center'} + ], + [ + {type:'label'}, + {type:'button', id:'conditionAdd', bLabel: jive.i18n.get('column.conditionalFormatting.condition.add'), fn: 'addFormatCondition', btnClass: 'plain', nowrap: true}, + {type:'label', nowrap: true, colspan: 3}, + {type:'label', nowrap: true}, + {type:'label', nowrap: true}, + {type:'label', nowrap: true, tdClass: 'last'} + ] + ] + ], + onCreate: function(jo){ + var it = this, + form = jo; + + form.on('change', 'select[name=conditionTypeOperator]', function(evt) { + var self = $(this), + row = self.closest('tr'), + conditionEnd = row.find('input[name^=conditionEnd]'), + conditionStart = row.find('input[name^=conditionStart]'); + + if (self.val().indexOf('BETWEEN') >= 0) { + conditionEnd.closest('td').addClass('condition_between_end').show().prev().show(); + conditionEnd.prop('disabled', false); + conditionStart.closest('td').attr('colspan', 1).addClass('condition_between_start'); + } else { + conditionEnd.closest('td').removeClass('condition_between_end').hide().prev().hide(); + conditionEnd.prop('disabled', true); + conditionStart.closest('td').attr('colspan', 3).removeClass('condition_between_start'); + } + }); + + form.on('rowchange', 'table', function(evt) { + $(this).find('tr.jive_condition').each(function(i, v) { + $(this).find('.jive_textLabel:first div:first').text(i+1); + }); + }); + + form.find('table:eq(1)').addClass('conditionList').find('tr:last').addClass('add'); + }, + columnChanged: function() { + var existingApplyToText = $('#applyTo :selected').text(), + newOption, + availableApplyToOptions, + hasDetailRowsOption, + altOption, + label = jive.selected.ie.config.columnLabel; + + !label.length && (label = "#" + (jive.selected.ie.config.columnIndex + 1)); + + // update dialog column name + jive.ui.dialog.title.html(jive.i18n.get('column.format.dialog.title') + ': ' + label); + jive.interactive.column.basicFormatForm.updateColNavButtons(); + jive.interactive.column.basicFormatForm.updateApplyToSelector(true, true); + + newOption = $('#applyTo').find('option:contains(' + existingApplyToText + ')'); + if (newOption.length > 0) { + newOption.attr('selected', true); + this.applyToChanged(newOption.val()); + } else { + availableApplyToOptions = $.map($("#applyTo option") ,function(option) { + return option.value; + }); + + hasDetailRowsOption = $.grep(availableApplyToOptions, function(optionValue) { + return optionValue === "detailrows"; + }).length > 0; + + altOption = hasDetailRowsOption ? "detailrows" : availableApplyToOptions[0]; + + $("#applyTo").val(altOption || ""); + this.applyToChanged(altOption || ""); + } + }, + applyToChanged: function(val) { + this.onGenericShow(val); + }, + onShow: function() { + jive.selected.form.jo.parent().css({'overflow-y': 'hidden'}); + + jive.interactive.column.basicFormatForm.updateColNavButtons(); + jive.interactive.column.basicFormatForm.updateApplyToSelector(true, true); + this.prevApplyTo = 'detailrows'; + $('#applyTo').val('detailrows'); + this.onGenericShow('detailrows'); + }, + getGroupMetadata: function(groupId) { + var groupData = {}; + $.each(jive.interactive.column.allColumnGroups[jive.selected.ie.config.parentId], function(i, group) { + if (group.id === groupId) { + $.extend(groupData, group.conditionalFormattingData); + group.groupName && (groupData.groupName = group.groupName); + return false; // break each + } + }); + + return groupData; + }, + onGenericShow:function(applyToVal){ + var it = this, + table = jive.selected.form.jo.find('table:eq(1)'), + isFromCache = false, + addButton = jive.selected.form.jo.find('div.jive_inputbutton[bname=conditionAdd]'), + metadata; + + jive.selected.form.jo.parent().css({'overflow-y': 'auto'}); + + if (this.actionDataCache[this.getCacheKey()]) { + metadata = this.actionDataCache[this.getCacheKey()].conditionalFormattingData; + isFromCache = true; + } else { + if (applyToVal.indexOf('group') != -1 || applyToVal.indexOf('tabletotal') != -1) { + metadata = this.getGroupMetadata(applyToVal); + } else if (applyToVal == 'detailrows') { + metadata = jive.selected.ie.config.conditionalFormattingData; + } + } + + if (metadata) { + it.conditionType = metadata.conditionType.toLowerCase(); + it.options = jive.interactive.column.operators[it.conditionType]; + + // enable Add button + addButton.removeClass('disabled'); + /** + * for boolean fields, hide the condition column + */ + if (it.conditionType === 'boolean') { + table.find('th:eq(2), tr.add td:eq(2)').hide(); + } else { + table.find('th:eq(2), tr.add td:eq(2)').show(); + } + + $.each(metadata.conditions, function(i,v) { + it.addFormatCondition(jive.selected.form.jo, v, isFromCache); + }); + + } else { + // clear conditions table, disable Add button + jive.selected.form.jo.find('table:eq(1) tr.jive_condition').each(function() {it.removeRow($(this));}); + addButton.addClass('disabled'); + + } + }, + onBlur: function(prevApplyTo) { + var it = this, + currentApplyTo = prevApplyTo || $('#applyTo').val(), + cacheKey; + // do not cache actionData for headings + if (currentApplyTo !== 'heading') { + cacheKey = this.getCacheKey(currentApplyTo); + if (cacheKey) { + this.actionDataCache[cacheKey] = this.getActionData(currentApplyTo); + } + } + jive.selected.form.jo.find('table:eq(1) tr.jive_condition').each(function() {it.removeRow($(this));}); + }, + onHide: function() { + var it = this; + this.actionDataCache = {}; + jive.selected.form.jo.find('table:eq(1) tr.jive_condition').each(function() {it.removeRow($(this));}); + }, + submit:function(){ + var actions = [], + prop; + this.actionDataCache[this.name] = this.getActionData(); + + for (prop in this.actionDataCache) { + if (this.actionDataCache.hasOwnProperty(prop)) { + actions.push(this.actionDataCache[prop]); + } + } + + jive.hide(); + + jive.selected.ie.format(actions); + }, + addFormatCondition: function(jo, conditionData, isFromCache) { + if (!jo.is('.disabled')) { + var it = this, + conditionType = it.conditionType, + calendarPattern = jive.interactive.column.calendarPatterns["date"], + calendarTimePattern = jive.interactive.column.calendarPatterns["time"], + form = jo.closest('form'), + table = form.find('table:eq(1)'), + tr = [], + row, + inputs = jive.selected.form.inputs, + htm = []; + + tr.push(''); + $.each(this.templateElements, function(i,e) { + jive.ui.forms.createTemplateElement(e, it, form, tr); + }); + tr.push(''); + row = $(tr.join('')); + row.insertBefore(table.find('tr:last')); + + $.each(it.options, function(k,v) { + v && htm.push(''); + }); + + row.find('select[name=conditionTypeOperator]').append(htm.join('')).trigger('change'); + + if(conditionType === 'date') { + var pickerOptions = { + changeMonth: true, + changeYear: true, + dateFormat: calendarPattern, + timeFormat: calendarTimePattern, + showSecond: true + } + row.find('input[name=conditionStart]').datetimepicker(pickerOptions); + row.find('input[name=conditionEnd]').datetimepicker(pickerOptions); + } else if (conditionType === 'time') { + var timePickerOptions = { + timeFormat: calendarTimePattern, + showSecond:true, + constrainInput:false + } + row.find('input[name=conditionStart]').timepicker(timePickerOptions); + row.find('input[name=conditionEnd]').timepicker(timePickerOptions); + } else if (conditionType === 'boolean') { + row.find('input[name=conditionStart]').prop('disabled', true); + row.find('input[name=conditionStart]').closest('td').hide(); + } + + if (conditionData) { + row.find('select[name=conditionTypeOperator]').val(conditionData.conditionTypeOperator).trigger('change'); + inputs[row.find('input[name=conditionEnd]').attr('id')].set(conditionData.conditionEnd); + + if (conditionType === 'text' && isFromCache) { + inputs[row.find('input[name=conditionStart]').attr('id')].set(conditionData.conditionStart); + } else { + inputs[row.find('input[name=conditionStart]').attr('id')].set(jive.decodeHTML(conditionData.conditionStart)); + } + + inputs[row.find('.jive_inputbutton[bname^=conditionFontBold]').attr('bname')].set(conditionData.conditionFontBold); + inputs[row.find('.jive_inputbutton[bname^=conditionFontItalic]').attr('bname')].set(conditionData.conditionFontItalic); + inputs[row.find('.jive_inputbutton[bname^=conditionFontUnderline]').attr('bname')].set(conditionData.conditionFontUnderline); + inputs[row.find('.jive_inputbutton[bname^=conditionFontColor]').attr('bname')].set(conditionData.conditionFontColor); + inputs[row.find('.jive_inputbutton[bname^=conditionFontBackColor]').attr('bname')].set(conditionData.conditionFontBackColor, conditionData.conditionMode); + } else { + inputs[row.find('.jive_inputbutton[bname^=conditionFontBold]').attr('bname')].set(null); + inputs[row.find('.jive_inputbutton[bname^=conditionFontItalic]').attr('bname')].set(null); + inputs[row.find('.jive_inputbutton[bname^=conditionFontUnderline]').attr('bname')].set(null); + inputs[row.find('.jive_inputbutton[bname^=conditionFontColor]').attr('bname')].set(null); + inputs[row.find('.jive_inputbutton[bname^=conditionFontBackColor]').attr('bname')].set(null, null); + } + + table.trigger('rowchange'); + } + }, + removeFormatCondition: function(jo) { + var row = jo.closest('tr'), + table = row.closest('table'); + + this.removeRow(row); + + table.trigger('rowchange'); + }, + removeRow: function(row) { + var inputs = jive.selected.form.inputs; + row.find('[name^=condition]').each(function() {delete inputs[$(this).attr('id')];}); + row.find('.jive_inputbutton[bname^=conditionFont]').each(function() {delete inputs[$(this).attr('bname')];}); + row.remove(); + }, + conditionMoveUp: function(jo) { + var row = jo.closest('tr'), + prev = row.prev(), + table = row.closest('table'); + + if (table.find('tr').index(row) > 1) { + row.insertBefore(prev); + table.trigger('rowchange'); + } + }, + conditionMoveDown: function(jo) { + var row = jo.closest('tr'), + next = row.next(), + table = row.closest('table'), + rows = table.find('tr'); + + if (next.size() > 0 && rows.index(row) < (rows.size() - 2)) { + row.insertAfter(next); + table.trigger('rowchange'); + } + + }, + getCacheKey: function(prevApplyTo) { + var applyTo = prevApplyTo || $('#applyTo').val(); + + if (applyTo === 'heading') { + return null; + } + + if (applyTo === 'detailrows' && jive.selected.ie.config.conditionalFormattingData) { + return this.name + "_" + jive.selected.ie.config.columnIndex + "_" + applyTo; + } else if (this.getGroupMetadata(applyTo) && this.getGroupMetadata(applyTo).conditionalFormattingData) { + return this.name + "_" + applyTo; + } + + return null; + }, + getActionData: function(prevApplyTo) { + var currentApplyTo = prevApplyTo || $('#applyTo').val(), + val = currentApplyTo.substring(0, currentApplyTo.indexOf('_') != -1 ? currentApplyTo.indexOf("_"): currentApplyTo.length), + inputs = jive.selected.form.inputs, + metadata, actionData; + + if (currentApplyTo.indexOf('group') != -1) { + metadata = this.getGroupMetadata(currentApplyTo); + actionData = { + actionName: 'conditionalFormatting', + conditionalFormattingData: { + applyTo: val, + tableUuid: jive.selected.ie.config.parentId, + columnIndex: jive.selected.ie.config.columnIndex, + conditionPattern: metadata.conditionPattern, + conditionType: metadata.conditionType, + conditions: [], + groupName: metadata.groupName + } + }; + } else if (currentApplyTo == 'detailrows' || val === 'tabletotal') { + if (val === 'tabletotal') { + metadata = this.getGroupMetadata(currentApplyTo); + } else { + metadata = jive.selected.ie.config.conditionalFormattingData; + } + actionData = { + actionName: 'conditionalFormatting', + conditionalFormattingData: { + applyTo: val, + tableUuid: jive.selected.ie.config.parentId, + columnIndex: jive.selected.ie.config.columnIndex, + conditionPattern: metadata.conditionPattern, + conditionType: metadata.conditionType, + conditions: [] + } + }; + } + + jive.selected.form.jo.find('table:eq(1) tr.jive_condition').each(function(i, v) { + var row = $(this); + actionData.conditionalFormattingData.conditions.push({ + conditionStart: inputs[row.find('input[name=conditionStart]').attr('id')].get(), + conditionEnd: inputs[row.find('input[name=conditionEnd]').attr('id')].get(), + conditionTypeOperator: inputs[row.find('select[name=conditionTypeOperator]').attr('id')].get(), + conditionFontBold: inputs[row.find('.jive_inputbutton[bname^=conditionFontBold]').attr('bname')].get(), + conditionFontItalic: inputs[row.find('.jive_inputbutton[bname^=conditionFontItalic]').attr('bname')].get(), + conditionFontUnderline: inputs[row.find('.jive_inputbutton[bname^=conditionFontUnderline]').attr('bname')].get(), + conditionFontColor: inputs[row.find('.jive_inputbutton[bname^=conditionFontColor]').attr('bname')].get(), + conditionFontBackColor: inputs[row.find('.jive_inputbutton[bname^=conditionFontBackColor]').attr('bname')].getBackColor(), + conditionMode: inputs[row.find('.jive_inputbutton[bname^=conditionFontBackColor]').attr('bname')].getModeValue() + }); + }); + + return actionData; + } + }; + + return jive.interactive.column; +}); diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.js jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.js --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.js 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.js 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,1543 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +define(['jquery.timepicker', 'text!jive.templates.tmpl', 'csslink!jive.vm.css', 'text!jive.i18n.tmpl'], function($, templates, css, jivei18nText) { + var clickEventName = 'click'; + + if(/Android|iPhone|iPad/i.test(navigator.userAgent) ) { + clickEventName = 'touchend'; + } + + var jive = { + name: 'jive', + reportInstance: null, + active: false, + started: false, + selectors: {}, + elements: {}, + interactive:{}, + clickEventName: clickEventName, + isIE: /msie/i.test(navigator.userAgent), + isIPad: /ipad/i.test(navigator.userAgent), + isFloatingHeader: false, + isDashboard: false, + activeContainer: null, + getReportContainer: function() { + return this.activeContainer; + }, + jivei18n: JSON.parse(jivei18nText), + i18n: { + get: function (key) { + if (jive.jivei18n.hasOwnProperty(key)) { + return jive.jivei18n[key]; + } else { + return key; + } + } + }, + ui: { + scaleFactor: 1, + marker: { + jo: null, + position: null, + setElement: function(selector){ + this.jo = $(selector); + this.jo.draggable({ + axis: "x", + start: function(ev,ui) { + jive.ui.overlay.left = jive.ui.overlay.jo.position().left; + jive.resizingColumn = true; + }, + drag: function(ev,ui){ + jive.ui.overlay.jo.width(ui.position.left - jive.ui.overlay.left); + }, + stop:function(ev,ui) { + //jive.interactive[jive.selected.ie.config.type].resize((ui.position.left - jive.ui.overlay.left) / jive.ui.scaleFactor); + jive.interactive[jive.selected.ie.config.type].resize((ui.position.left - jive.ui.overlay.left) / (jive.reportInstance.zoom ? jive.reportInstance.zoom.level : 1)); + jive.resizingColumn = false; + } + }); + //this.jo.appendTo('table.jrPage'); + }, + show: function(dim){ + var isFirstTimeSelection = false; + if (!this.jo) { + this.setElement('#jive_marker'); + isFirstTimeSelection = true; + } + this.jo.css({ + height: dim.h + }); + this.jo.appendTo(jive.getReportContainer()).show(); + this.jo.position({of:jive.ui.overlay.jo, my: 'left top', at:'right top', collision:'none'}); + + // on first time selection the markers needs to be repositioned to be correctly aligned + isFirstTimeSelection && this.jo.position({of:jive.ui.overlay.jo, my: 'left top', at:'right top', collision:'none'}); + + var de = this.jo.get(0); + var left = this.jo.get(0).style.left; + var top = this.jo.get(0).style.top; + var i = left.indexOf('px'); + if(i > 0) left = left.substring(0,i); + i = top.indexOf('px'); + if(i > 0) top = top.substring(0,i); + this.position = { + left: left, + top: top + } + } + }, + overlay: { + jo: null, + left: null, + setElement: function(selector){ + this.jo = $(selector); + this.jo.draggable(); + this.jo.draggable({ + cursorAt: { top: 40, left: -30 }, + start: function(ev,ui) { + jive.hide(['foobar','marker']); + jive.interactive[jive.selected.ie.config.type].onDragStart(ev,ui); + }, + drag: function(ev,ui){ + jive.interactive[jive.selected.ie.config.type].onDrag(ev,ui); + }, + stop:function(ev,ui) { + jive.interactive[jive.selected.ie.config.type].onDragStop(ev,ui); + jive.hide(); + } + }); + }, + show: function(dim){ + var isFirstTimeSelection = false; + if (!this.jo) { + this.setElement('#jive_overlay'); + isFirstTimeSelection = true; + } + this.jo.draggable(); + this.jo.css({ + width: dim.w * (jive.reportInstance.zoom ? jive.reportInstance.zoom.level : 1), + height: dim.h + }).draggable('option','helper', function(event) { + return $('div.jive_drag_label').clone().appendTo('#jive_components').html(jive.i18n.get('column.move.helper')).show(); + }); + this.jo.appendTo(jive.getReportContainer()).show(); + this.jo.position({of:jive.selected.jo, my: 'left top', at:'left top',collision:'none'}); + + // on first time selection the overlay needs to be repositioned to be correctly aligned + isFirstTimeSelection && this.jo.position({of:jive.selected.jo, my: 'left top', at:'left top',collision:'none'}); + } + }, + foobar: { + jo: null, + current: null, + dropMenu: null, + cache: {}, + menus: {}, + setElement: function(selector){ + this.jo = $(selector); + this.jo.on('mousedown touchstart','button',function(evt){ + var jo = $(this); + !jo.hasClass('disabled') && jo.addClass('pressed'); + return false; + }); + this.jo.on('mouseup touchend','button',function(evt){ + var jo = $(this); + jo.removeClass('pressed'); + var type = jive.selected.ie.config.type; + var fn = jo.attr('fn'); + + if(!jive.resizingColumn) { + if(fn && !jo.hasClass('disabled')){ + jive.interactive[type][fn](jive.interactive[type].actions[jo.attr('actionkey')].arg); + } else { + if(jo.attr('menu')){ + var menu = jive.ui.foobar.menus[type][jo.attr('menu')]; + menu.jo.show().position({ + of: $(this), + my: 'left top+2', + at: 'left bottom', + collision: 'none' + }); + jive.ui.foobar.dropMenu = menu; + } + } + } + + return false; + }); + this.jo.on('mouseover','button',function(){ + jive.ui.foobar.dropMenu && jive.ui.foobar.dropMenu.jo.hide(); + var jo = $(this); + !jo.hasClass('disabled') && jo.addClass('over'); + if(jo.attr('menu')){ + var menu = jive.ui.foobar.menus[jive.selected.ie.config.type][jo.attr('menu')]; + menu.jo.show().position({ + of: $(this), + my: 'left top+2', + at: 'left bottom', + collision: 'none' + }); + jive.ui.foobar.dropMenu = menu; + } + }); + this.jo.on('mouseout','button',function(){ + $(this).removeClass('over pressed'); + }); + this.cache = {}; + this.menus = {}; + this.current = null; + }, + show:function(dim){ + !this.jo && this.setElement('#jive_foobar'); + this.render(jive.interactive[jive.selected.ie.config.type].actions); + this.jo.find('button').removeClass('over pressed'); + this.jo.appendTo(jive.getReportContainer()).show(); + this.setToolbarPosition(); + this.setToolbarPosition(); // twice + }, + setToolbarPosition: function() { + var top = jive.selected.jo.offset().top - this.jo.outerHeight(), + containerTop; + + if (jive.isDashboard) { + containerTop = $(window).scrollTop(); + } else if ($('div#reportViewFrame .body').length > 0) { + containerTop = $('div#reportViewFrame .body').offset().top; + } else { + containerTop = 0; + } + + this.jo.css({position: 'absolute'}); + this.jo.offset({top: top, left: jive.selected.jo.offset().left}); + this.topCalculated = false; + if (jive.isFloatingHeader) { + jive.setToolbarPositionWhenFloating(true, jive.isDashboard); + } else if (containerTop >= top) { + this.jo.offset({top: jive.selected.jo.offset().top}); + } + }, + render: function(actionMap){ + var it = this; + var tmpl = [ + '']; + + if(!it.cache[jive.selected.ie.config.type]){ + it.cache[jive.selected.ie.config.type] = ''; + var htm; + $.each(actionMap,function(k,v){ + if(v.actions) { + it.menus[jive.selected.ie.config.type] = it.menus[jive.selected.ie.config.type] || {}; + it.createMenu(k, v.label, v.actions); + } + tmpl[1] = v.title; + tmpl[3] = k; + tmpl[5] = v.fn ? 'fn="'+v.fn+'"' : v.actions ? 'menu="'+k+'"' : ''; + tmpl[7] = v.icon; + it.cache[jive.selected.ie.config.type] += tmpl.join(''); + }); + } + + if(it.current != jive.selected.ie.config.type){ + it.jo.empty(); + it.jo.html(it.cache[jive.selected.ie.config.type]); + it.current = jive.selected.ie.config.type; + } + }, + createMenu: function(key, label, items){ + var it = this, + htm = '

      '; + $.each(items,function(k,v){ + if(!v.disabled) { + var attr = v.fn ? 'fn="'+v.fn+'"' : '', + label = v.label || k; + attr += v.arg ? " data-args='"+v.arg+"'" : ""; + htm += '
    • '+ jive.encodeHTML(label) +'
    • '; + v.actions && it.createMenu(k, v.label, v.actions); + } + }); + htm += '
    '; + it.menus[jive.selected.ie.config.type][key] ={jo:$(htm).appendTo('#jive_menus')}; + }, + reset: function() { + this.cache = {}; + this.menus = {}; + } + }, + dialog: { + jo: null, + body: null, + isVisible: false, + setElement: function(selector){ + var it = this; + var jo, input; + + it.jo = $(selector); + it.jo.draggable({handle: 'div.dialogHeader'}); + /* + * Cache jquery objects + */ + it.body = $('#jive_dialog div.dialogBody'); + it.title = $('#jive_dialog span.dialogTitle'); + it.tabs = $('#jive_dialog div.tabContainer'); + + if(typeof isIE === 'function') { + isIE() && (navigator.appVersion.indexOf('MSIE 10.0;') < 0) && it.jo.prepend('
    '); + } + /* + * Set behaviors for form elements + */ + it.tabs.on(clickEventName, '.tab',function(e){ + var jo = $(this), + activeTabActionCache; + + if (!jo.hasClass('disabled')) { + it.tabs.find('.tab').removeClass('active'); + jo.addClass('active'); + jive.selected.form.onBlur(); + jive.selected.form.jo.hide(); + activeTabActionCache = jive.selected.form.actionDataCache; + + jive.selected.form = jive.ui.forms[jo.data('form')]; + $.extend(jive.selected.form.actionDataCache, activeTabActionCache); + + jive.selected.form.onShow(); + jive.selected.form.jo.show(); + /* + Force refresh for IE 10 box shadow bug. + http://connect.microsoft.com/IE/feedback/details/763388/repaint-problem-with-dynamically-resizing-box-shadow# + */ + $('body')[0].style.zoom = ($('body')[0].style.zoom == 0) ? 1 : 0; + } + }); + it.body.on(clickEventName,'input, select',function(e){ + var jo = $(this); + jo.focus(); + if(jo.attr('type') == 'radio') jo.trigger('change').prop('checked',true); + }); + it.body.on('change', '.jive_listTextInput, .jive_listTextInputTouch', function (e) { + var jo = $(this); + jive.selected.form.inputs[jo.next('select').attr('name')].value = jo.val() !== "" ? jo.val() : null; + }); + it.body.on('change','select.wFreeText',function(e){ + var jo = $(this); + jo.prev().val(jo.val()); + jive.selected.form.inputs[jo.attr('name')].set(jo.val()); + }); + it.body.on('keypress', '.jive_restrictedInput', function(e) { + if ($(this).data('restriction') === "numeric" && isNaN(String.fromCharCode(e.which))) { + return false; + } + return true; + }); + it.body.on(clickEventName,'.jive_inputbutton',function(){ + jo = $(this); + input = jive.selected.form.inputs[jo.attr('bname')]; + switch(jo.attr('type')) { + case "radio": + input.set(jo.attr('value'), jo); + break; + case "checkbox": + input.toggle(); + } + input.onClick && input.onClick(jo); + }); + it.body.on(clickEventName,'.jive_freeTextButton',function(){ + jo = $(this); + jo.parent().next().find('input, select').toggle(); + }); + $('#dialogOk, #dialogCancel').bind(clickEventName,function(e){ + if(this.className.indexOf('disabled') < 0){ + if(this.id == 'dialogCancel'){ + jive.active = false; + $('body').trigger('jive.inactive'); + } else { + jive.selected.form.submit(); + } + jive.ui.dialog.hide(); + jive.ui.dialog.isVisible = false; + } + }); + }, + show: function(title, forms, formIndex){ + !this.jo && this.setElement('#jive_dialog'); + + if(forms.length > 1) { + var htm = ''; + var form; + var fi = formIndex || 0; + var active; + + $.each(forms,function(i,v){ + form = jive.ui.forms[v]; + active = i == fi ? 'active' : ''; + htm += '
    '+form.title+'
    '; + !form.jo && jive.ui.forms.render(form); + jive.ui.dialog.body.append(form.jo); + }); + this.tabs.html(htm).show(); + + jive.selected.form = jive.ui.forms[forms[fi]]; + } else { + this.tabs.hide(); + jive.selected.form = jive.ui.forms[forms[0]]; + !jive.selected.form.jo && jive.ui.forms.render(jive.selected.form); + this.body.append(jive.selected.form.jo); + } + jive.selected.form.onShow(); + this.title.html(title); + jive.selected.form.jo.show(); + this.jo.show().position({of:$(window), at:'center center', my:'center center', collision: 'none fit'}); + this.isVisible = true; + jive.hide(null, true); + }, + hide:function(){ + var it = this; + var ids = []; + jive.ui.dialog.jo.hide(); + it.body.children().each(function(){ + ids.push(this.id.substring(10)); + $(this).appendTo('#jive_forms').hide(); + }); + + $('#jive_dropdown .pmenu').hide(); + + $.each(ids,function(i,v){ + jive.ui.forms[v].onHide && jive.ui.forms[v].onHide(); + }); + }, + toggleButtons: function() { + $('#dialogOk, #dialogCancel').toggleClass('disabled'); + } + }, + forms: { + add:function(parms){ + jive.ui.forms[parms.name] = parms; + }, + render:function(parms){ + var it = jive.ui.forms; + var style = 'display:none;width:700px;'; + var form = $('
    ').appendTo('#jive_forms'); + + var tb = []; + var label,colspan,rowspan; + parms.inputs = {}; + + $.each(parms.elements,function(i,table){ + tb.push(''); + $.each(table,function(i,row){ + tb.push(''); + $.each(row,function(i,e){ + jive.ui.forms.createElement(e, parms, form, tb); + }); + tb.push(''); + }); + tb.push('
    '); + }); + form.append(tb.join('')); + it[parms.name].jo = form; + it[parms.name].onCreate(form); + }, + createElement: function(e, parms, form, tb) { + var label = e.label || '', + colspan = e.colspan ? ' colspan="'+e.colspan+'"' : '', + rowspan = e.rowspan ? ' rowspan="'+e.rowspan+'"' : '', + tdClass = e.tdClass ? ' ' + e.tdClass : '', + tdWidth = e.tdWidth ? 'width: ' + e.tdWidth + ';' : '', + cellElem = e.isHeader ? 'th' : 'td', + textAlign = e.align ? 'text-align: ' + e.align + ';' : '', + textWidth = e.width ? ' width: ' + e.width + 'px;' : '', + wrapClass = e.wrapClass || '', + val; + + tb.push('<' + cellElem + ' '); + + if(e.type == 'label') { + val = e.value || ''; + tb.push('class="jive_textLabel' + tdClass + '" style="' + tdWidth + '"' + colspan + '>'); + e.nowrap ? tb.push(val) : tb.push('
    ' + val + '
    '); + } + if(e.type == 'text') { + tb.push('class="' + tdClass + '" style="' + tdWidth + '"' + colspan + rowspan+'>'); + e.label && tb.push('
    '+e.label+':
    '); + tb.push('
    '); + parms.inputs[e.id] = { + set:function(val) { + $('#'+e.id).val(val); + }, + get:function(){ + return $('#'+e.id).val(); + } + } + } + if(e.type == 'radio') { + tb.push('class="' + tdClass + '" style="' + tdWidth + '"' + colspan + rowspan+'>
    '); + parms.inputs[e.id] = { + set:function(val) { + $('input[name="'+e.id+'"]').val(val); + }, + get:function(){ + return $('input[name="'+e.id+'"]').val(); + } + } + } + if(e.type == 'list') { + var size = e.size ? e.size : 1; + var isTouch = 'ontouchstart' in document.documentElement ? 'Touch' : ''; + var showList = ('ontouchstart' in document.documentElement || size == 1) ? '' : 'showList'; + var wFreeText = e.freeText ? 'wFreeText' : ''; + var isRestricted = e.restriction != null; + + var select = [''); + tb.push('class="' + tdClass + '" style="' + tdWidth + '"' + colspan + rowspan+'>'); + e.label && tb.push('
    ' + e.label + ':
    '); + tb.push('
    '); + e.freeText && tb.push(''); + tb.push(select.join('')); + tb.push('
    '); + + parms.inputs[e.id] = { + value: null, + set:function(val) { + this.value = val; + $('#'+e.id).val(val); + e.freeText && $('#'+e.id+'Text').val(val) && $("#" + e.id + "Text").trigger("change"); + }, + get:function(){ + // return e.freeText ? $('#'+e.id+'Text').val() : $('#'+e.id).val(); + return this.value; + } + } + } + if(e.type == 'button') { + tb.push('class="' + tdClass + '" style="' + tdWidth + '">'); + tb.push('
    '); + e.bIcon && tb.push(''); + if (e.bLabel) { + e.nowrap ? tb.push(e.bLabel) : tb.push(''+e.bLabel+''); + } + tb.push('
    '); + parms.inputs[e.id] = { + onClick: function(jo){ + jive.ui.forms[parms.name][e.fn](jo); + } + } + } + if(e.type == 'buttons') { + tb.push('class="' + tdClass + '" style="' + tdWidth + '"' + colspan + rowspan+'>'); + label.length>0 && tb.push('
    '+label+':
    '); + tb.push('
    '); + $.each(e.items,function(i,v){ + !parms.inputs[v.id] && form.append(''); + tb.push('
    '); + if (v.type === 'color' || v.type === 'backcolor') { + tb.push('
    '); + } + v.bIcon && tb.push(''); + v.bLabel && tb.push(''+v.bLabel+''); + tb.push('
    '); + + if(v.type === 'dropdown') { + parms.inputs[v.id] = { + _idd: v.id, + _options: v.options, + onClick: function() { + jive.interactive[jive.selected.ie.config.type][v.fn](); + }, + showOptions: function() { + var dd = $('#jive_dropdown'); + dd.empty(); + + var htm = '
      ', + args; + $.each(this._options, function(k, option) { + htm += "
    • " + jive.encodeHTML(option.label) + "
    • "; + }); + htm += '
    '; + + dd.append(htm); + dd.find('.pmenu').show(); + dd.css({width: '150px', height: '100px'}); + //dd.position({my: 'left top', at: 'left bottom', of: $('div.jive_inputbutton[bname="'+this._idd+'"]'), collision: 'none', offset: '0 -10px'}); + dd.position({my: 'left top-10', at: 'left bottom', of: $('div.jive_inputbutton[bname="'+this._idd+'"]'), collision: 'none'}); + }, + hideOptions: function () { + $('#jive_dropdown .pmenu').hide(); + } + } + } + if(v.type == 'checkbox') { + parms.inputs[v.id] = { + value: null, + set: function(val) { + var btn = $('div.jive_inputbutton[bname="'+v.id+'"]'); + this.value = val; + if (val === true) { + btn.removeClass('unchanged').addClass('selected'); + } else if (val === false) { + btn.removeClass('unchanged').removeClass('selected'); + } else if (val === null) { + if (v.isTripleState) btn.removeClass('selected').addClass('unchanged'); + else this.set(false); + } + }, + toggle: function() { + if (this.value === true) { + this.set(false); + } else if (this.value === false) { + if (v.isTripleState) this.set(null); + else this.set(true); + } else if (v.isTripleState && this.value === null) this.set(true); + }, + get:function(){ + return this.value; + }, + onClick: function(){ + v.fn && jive.interactive[jive.selected.ie.config.type][v.fn](); + } + } + } + if(v.type == 'radio' && !parms.inputs[v.id]) { + parms.inputs[v.id] = { + value: null, + set:function(val, jo) { + if (jo && jo.is('.selected') && v.isTripleState) { + this.set(null); + return; + } + this.value = val; + $('div.jive_inputbutton[bname="'+v.id+'"]').removeClass('selected'); + $('div.jive_inputbutton[bname="'+v.id+'"][value="'+val+'"]').addClass('selected'); + + }, + get:function(){ + return this.value; + }, + onClick: function(jo){ + v.fn && jive.interactive[jive.selected.ie.config.type][v.fn](); + } + } + } + if(v.type == 'action'){ + parms.inputs[v.id] = { + onClick: function(){ + jive.interactive[jive.selected.ie.config.type][v.fn](); + } + } + } + if(v.type == 'color') { + parms.inputs[v.id] = { + value: null, + set:function(val) { + var btn = $('div.jive_inputbutton[bname="'+v.id+'"]'); + this.value = val; + if (val === null) { + btn.addClass('unchanged').find('div.colorpick').css('background-color', 'transparent'); + } else if (val === 'null') { + this.set(null); + } else { + btn.removeClass('unchanged').find('div.colorpick').css('background-color', val === 'transparent' ? val : ('#' + val)); + } + }, + get:function(){ + return this.value; + }, + onClick:function(jo){ + jive.ui.colorpicker.show({ + title: v.title, + inputId: v.id, + anchor: jo, + currentColor: $('input[name="'+v.id+'"]').val(), + showTransparent: v.showTransparent, + showReset: v.showReset + }); + } + } + } + if(v.type == 'backcolor') { + parms.inputs[v.id] = { + backColor: null, + modeValue: null, + set: function(backColor, modeValue, isFromPicker) { + var btn = $('div.jive_inputbutton[bname="'+v.id+'"]'); + if (isFromPicker) { + if (backColor !== 'keep_existing') { + this.backColor = backColor === 'null' ? null : backColor; + } + } else { + this.backColor = backColor; + } + this.modeValue = modeValue === 'null' ? null : modeValue; + + if (!this.backColor && !this.modeValue) { + btn.addClass('unchanged').find('div.colorpick').css('background-color', 'transparent'); + } else if (this.modeValue === 'Transparent' || !this.backColor) { + btn.removeClass('unchanged').find('div.colorpick').css('background-color', 'transparent'); + } else if (this.backColor) { + btn.removeClass('unchanged').find('div.colorpick').css('background-color', '#' + this.backColor); + } + }, + getBackColor:function(){ + return this.backColor; + }, + getModeValue:function(){ + return this.modeValue; + }, + onClick:function(jo){ + jive.ui.colorpicker.show({ + title: v.title, + inputId: v.id, + anchor: jo, + currentColor: $('input[name="'+v.id+'"]').val(), + showTransparent: v.showTransparent, + showReset: v.showReset + }); + } + } + } + }); + tb.push('
    '); + } + + tb.push(''); + }, + createTemplateElement: function(e, parms, form, tb) { + var label = e.label || '', + colspan = e.colspan ? 'colspan="'+e.colspan+'"' : '', + rowspan = e.rowspan ? 'rowspan="'+e.rowspan+'"' : '', + elemCount = form.find('*[id^=' + e.id + ']').size(), + elemUid = e.id + (elemCount > 0 ? '_' + $.now() : ''), + tdClass = e.tdClass ? ' ' + e.tdClass : '', + textAlign = e.align ? 'text-align: ' + e.align + ';' : '', + textWidth = e.width ? ' width: ' + e.width + 'px;' : '', + wrapClass = e.wrapClass || ''; + + if(e.type == 'label') { + tb.push(''); + e.nowrap ? tb.push(e.value) : tb.push('
    '+e.value+'
    '); + tb.push(''); + } + if(e.type == 'text') { + tb.push(''); + e.label && tb.push('
    '+e.label+':
    '); + tb.push('
    '); + parms.inputs[elemUid] = { + set:function(val) { + $('#'+elemUid).val(val); + }, + get:function(){ + return $('#'+elemUid).val(); + } + } + } + if(e.type == 'list') { + var size = e.size ? e.size : 1; + var isTouch = 'ontouchstart' in document.documentElement ? 'Touch' : ''; + var showList = ('ontouchstart' in document.documentElement || size == 1) ? '' : 'showList'; + var wFreeText = e.freeText ? 'wFreeText' : ''; + var isRestricted = e.restriction != null; + + var select = [''); + tb.push(''); + e.label && tb.push('
    ' + e.label + ':
    '); + tb.push('
    '); + e.freeText && tb.push(''); + tb.push(select.join('')); + tb.push('
    '); + + parms.inputs[elemUid] = { + set:function(val) { + $('#'+elemUid).val(val); + e.freeText && $('#'+elemUid+'Text').val(val); + }, + get:function(){ + return e.freeText ? $('#'+elemUid+'Text').val() : $('#'+elemUid).val(); + } + } + } + if(e.type == 'button') { + tb.push(''); + tb.push('
    '); + e.bIcon && tb.push(''); + if (e.bLabel) { + e.nowrap ? tb.push(e.bLabel) : tb.push(''+e.bLabel+''); + } + tb.push('
    '); + tb.push(''); + parms.inputs[e.id] = { + onClick: function(jo){ + jive.ui.forms[parms.name][e.fn](jo); + } + } + } + if(e.type == 'buttons') { + tb.push('') + label.length>0 && tb.push('
    '+label+':
    '); + tb.push('
    '); + $.each(e.items,function(i,v){ + var vidCount = form.find('*[bname^=' + v.id + ']').size(), + vid = v.id + (vidCount > 0 ? '_' + $.now() : ''); + tb.push('
    '); + if (v.type === 'color' || v.type === 'backcolor') { + tb.push('
    '); + } + v.bIcon && tb.push(''); + v.bLabel && tb.push(''+v.bLabel+''); + tb.push('
    '); + + if(v.type == 'checkbox') { + parms.inputs[vid] = { + value: null, + set: function(val) { + var btn = $('div.jive_inputbutton[bname="'+vid+'"]'); + this.value = val; + if (val === true) { + btn.removeClass('unchanged').addClass('selected'); + } else if (val === false) { + btn.removeClass('unchanged').removeClass('selected'); + } else if (val === null) { + if (v.isTripleState) btn.removeClass('selected').addClass('unchanged'); + else this.set(false); + } + }, + toggle: function() { + if (this.value === true) { + this.set(false); + } else if (this.value === false) { + if (v.isTripleState) this.set(null); + else this.set(true); + } else if (v.isTripleState && this.value === null) this.set(true); + }, + get:function(){ + return this.value; + }, + onClick: function(){ + v.fn && jive.interactive[jive.selected.ie.config.type][v.fn](); + } + } + } + + if(v.type == 'action'){ + parms.inputs[vid] = { + onClick: function(jo){ + // jive.interactive[jive.selected.ie.config.type][v.fn](); + jive.ui.forms[parms.name][v.fn](jo); + } + } + } + if(v.type == 'color') { + parms.inputs[vid] = { + value: null, + set:function(val) { + var btn = $('div.jive_inputbutton[bname="'+vid+'"]'); + this.value = val; + if (val === null) { + btn.addClass('unchanged').find('div.colorpick').css('background-color', 'transparent'); + } else if (val === 'null') { + this.set(null); + } else { + btn.removeClass('unchanged').find('div.colorpick').css('background-color', val === 'transparent' ? val : ('#' + val)); + } + }, + get:function(){ + return this.value; + }, + onClick:function(jo){ + jive.ui.colorpicker.show({ + title: v.title, + inputId: vid, + anchor: jo, + currentColor: $('input[name="'+vid+'"]').val(), + showTransparent: v.showTransparent, + showReset: v.showReset + }); + } + } + } + if(v.type == 'backcolor') { + parms.inputs[vid] = { + backColor: null, + modeValue: null, + set: function(backColor, modeValue, isFromPicker) { + var btn = $('div.jive_inputbutton[bname="'+vid+'"]'); + if (isFromPicker) { + if (backColor !== 'keep_existing') { + this.backColor = backColor === 'null' ? null : backColor; + } + } else { + this.backColor = backColor; + } + this.modeValue = modeValue === 'null' ? null : modeValue; + + if (!this.backColor && !this.modeValue) { + btn.addClass('unchanged').find('div.colorpick').css('background-color', 'transparent'); + } else if (this.modeValue === 'Transparent' || !this.backColor) { + btn.removeClass('unchanged').find('div.colorpick').css('background-color', 'transparent'); + } else if (this.backColor) { + btn.removeClass('unchanged').find('div.colorpick').css('background-color', '#' + this.backColor); + } + }, + getBackColor:function(){ + return this.backColor; + }, + getModeValue:function(){ + return this.modeValue; + }, + onClick:function(jo){ + jive.ui.colorpicker.show({ + title: v.title, + inputId: vid, + anchor: jo, + currentColor: $('input[name="'+vid+'"]').val(), + showTransparent: v.showTransparent, + showReset: v.showReset + }); + } + } + } + }); + tb.push('
    '); + } + } + }, + colorpicker: { + jo: null, + selected: null, + title: '', + inputId: null, + setElement: function(){ + var it = this; + var jo; + it.jo = $('#jive_colorpicker'); + it.jo.draggable({handle: 'div.dialogHeader'}); + it.jo.on(clickEventName,'div.pick',function(evt){ + it.selected = $(this).parent().addClass('selected'); + jive.selected.form.inputs[it.inputId].set(it.extractHexColor(it.selected.children().eq(0).attr('hexcolor')), it.selected.closest('tr').data('mode'), true); + jive.ui.colorpicker.jo.hide(); + jive.ui.modal.hide(); + evt.preventDefault(); + }); + }, + show: function(options) { + this.title = options.title || 'Pick a color'; + this.inputId = options.inputId; + !this.jo && this.setElement(); + this.jo.find('td.selected').removeClass('selected'); + if (options.currentColor) { + this.jo.find('div.pick[hexcolor=' + options.currentColor + ']').parent().addClass('selected'); // FIXMEJIVE not working anymore + } + if (options.showTransparent) { + this.jo.find('tr.transparent_pick').show(); + } else { + this.jo.find('tr.transparent_pick').hide(); + } + if (options.showReset) { + this.jo.find('tr.reset_pick').show(); + } else { + this.jo.find('tr.reset_pick').hide(); + } + jive.ui.modal.show(this.jo); + this.jo.find('h2').html(this.title); + this.jo.show().position({of:options.anchor, at:'left bottom', my:'left top', offset: '0 0', collision:'none'}); + }, + extractHexColor: function(rgbString) { + if (rgbString && rgbString.toLowerCase().indexOf('rgb') !== -1) { + var out = "", + tokens = rgbString.split(','), + i, + number, + conv; + + for (i = 0; i < tokens.length; i++) { + number = parseInt(/\d+/.exec(tokens[i])[0], 10); + conv = number.toString(16); + out += (conv.length === 1) ? ('0' + conv) : conv; + } + return out; + } + return rgbString; + } + }, + modal: { + whf: null, + visible: false, + show: function(whoHasFocus) { + this.whf = whoHasFocus; + if($('#jive_modal').length == 0) { + $('table.jrPage').parent().append(''); + $('#jive_modal').on(clickEventName,function(evt){ + jive.ui.modal.hide(); + evt.preventDefault(); + }) + } + if(!this.visible) { + jive.ui.dialog.toggleButtons(); + $('#jive_modal').show(); + this.visible = true; + } + }, + hide: function() { + jive.ui.modal.whf.hide(); + jive.ui.dialog.toggleButtons(); + $('#jive_modal').hide(); + this.visible = false; + } + } + }, + selected: { + ie: null, // selected interactive element + jo: null, // selected jquery object tied to interactive element + form: null // selected form defined by interactive element + }, + viewerReady: false, + encodeHTML: function(decodedHTML) { + return $("
    ").text(decodedHTML).html(); + }, + decodeHTML: function(encodedHTML) { + return $("
    ").html(encodedHTML).text(); + }, + escapeFontName: function(fontName) { + if (fontName) { + return fontName.replace(/"/g, ""); + } + return null; + }, + hide: function(items, keepDialogOpen) { + var it = this; + if(!items){ + if (keepDialogOpen) { + it.active = it.ui.dialog.isVisible; + } else { + it.active = false; + it.ui.dialog.isVisible && it.ui.dialog.hide(); + } + it.ui.marker.jo && it.ui.marker.jo.appendTo('#jive_components').hide(); + it.ui.overlay.jo && it.ui.overlay.jo.appendTo('#jive_components').hide(); + it.ui.foobar.jo && it.ui.foobar.jo.appendTo('#jive_components').hide(); + $('.pmenu').hide(); + it.ui.colorpicker.jo && it.ui.colorpicker.jo.hide(); + } else { + $.each(items, function(i,v){ + it.ui[v].jo && it.ui[v].jo.hide(); + }); + } + }, + getHeaderTable: function() { + var tbl = $('table.floatableHeader'); + if (tbl.length == 0) { + tbl = $("").appendTo('div#reportContainer'); + + tbl.on(clickEventName, '.jrcolHeader', function(evt){ + // keep html links functional + if(!$(evt.target).parent().is('a')) { + var jo = $(this); + var coluuid = jo.data('coluuid'); + var reportTableCell = tbl.parent().find('table.jrPage td.jrcolHeader[data-coluuid=' + coluuid + ']:first'); + reportTableCell.length && jive.selectInteractiveElement(reportTableCell); + return false; + } + }); + + var firstColHeader = $('td.jrcolHeader:first'), + parentTable = firstColHeader.closest('table'), + lastColHeader = $('td.jrcolHeader:last', parentTable), + rows = [], clone, cloneWidth = [], row, lastRow, cloneTD, rowTD, rowTDs, i, j, k, ln, tblJrPage, parentTableRows; + if (firstColHeader.length > 0) { + firstColHeader.addClass('first_jrcolHeader'); + row = firstColHeader.closest('tr'); + lastRow = lastColHeader.closest('tr'); + tblJrPage = firstColHeader.closest('table'); + + if (row === lastRow) { + rows.push(row); + } else { + parentTableRows = parentTable.find('tr'); + i = parentTableRows.index(row); + j = parentTableRows.index(lastRow); + + for (k = i; k <= j; k++) { + rows.push(parentTableRows.get(k)); + } + } + + $.each(rows, function(idx, row) { + rowTDs = $(row).find('td'); + clone = $(""); + cloneWidth[idx] = 0; + + // set width and height for each cloned TD + for (i = 0, ln = rowTDs.length; i < ln; i++) { + rowTD = $(rowTDs.get(i)); + cloneTD = rowTD.clone(); + cloneWidth[idx] = cloneWidth[idx] + rowTD.outerWidth(); + cloneTD.css("width", rowTD.css("width")); + cloneTD.css("height", rowTD.css("height")); + clone.append(cloneTD); + } + tbl.append(clone); + }); + tbl.css({ + position: 'fixed', + width: Math.max.apply(Math, cloneWidth), + 'empty-cells': tblJrPage.css('empty-cells'), + 'border-collapse': tblJrPage.css('border-collapse'), + 'background-color': tblJrPage.css('background-color') + }); + tbl.attr('cellpadding', tblJrPage.attr('cellpadding')); + tbl.attr('cellspacing', tblJrPage.attr('cellspacing')); + tbl.attr('border', tblJrPage.attr('border')); + } + } + + return tbl; + }, + setToolbarPositionWhenFloating: function(isJiveActive, isDashboard) { + var it = this, top, firstHeader, toolbarTop, firstHeaderTop; + + if (isJiveActive) { // handle the toolbar position + firstHeader = $('td.first_jrcolHeader'); + top = isDashboard ? 0 : $('div#reportViewFrame .body').offset().top, + toolbarTop = it.ui.foobar.jo.offset().top, + firstHeaderTop = firstHeader.offset().top; + + if (!it.ui.foobar.topCalculated) { + if (toolbarTop < 0) { + if (firstHeaderTop < 0 && toolbarTop > firstHeaderTop) { + top += Math.abs(toolbarTop - firstHeaderTop); + } + } else if (firstHeaderTop < 0) { + top += Math.abs(firstHeaderTop) + toolbarTop; + } else if (toolbarTop > firstHeaderTop) { + top += toolbarTop - firstHeaderTop; + } + + it.ui.foobar.jo.css({ + position: 'fixed', + top: top, + left: it.selected.jo.offset().left - $(window).scrollLeft() + }); + + it.ui.foobar.topCalculated = true; + } else { + it.ui.foobar.jo.css({ + left: it.selected.jo.offset().left - $(window).scrollLeft() + }); + } + } + }, + applyScaleTransform: function($container, zoom, origin) { + var scale = 'scale(' + zoom + ")", + origin = origin || '50% 0', + transform = { + '-webkit-transform': scale, + '-webkit-transform-origin': origin, + '-moz-transform': scale, + '-moz-transform-origin': origin, + '-ms-transform': scale, + '-ms-transform-origin': origin, + '-o-transform': scale, + '-o-transform-origin': origin, + 'transform': scale, + 'transform-origin': origin + }; + + $container.css(transform); + }, + zoom: function(o) { + var it = this; + it.isFloatingHeader && it.scrollHeader(it.isDashboard, true); + it.active && it.hide(); // hide jive stuff when zooming to avoid repositioning of its elements + }, + scrollHeader: function(isDashboard, forceScroll) { + var it = this, + $win = $(window), +// scrollContainer = it.isIPad ? $win : $('div#reportViewFrame .body'), + scrollContainer = $('div#reportViewFrame .body'), + scrolledTop = false, + scrolledLeft = false; + + // Determine scroll direction and value + if (it.scrollData.scrollTop != null) { // check previous scrollTop + if (scrollContainer.scrollTop() != it.scrollData.scrollTop) { + it.scrollData.scrollTop = scrollContainer.scrollTop(); + scrolledTop = true; + } + } else if (scrollContainer.scrollTop() != 0) { + it.scrollData.scrollTop = scrollContainer.scrollTop(); + scrolledTop = true; + } + + if (it.scrollData.scrollLeft != null) { // check previous scrollLeft + if (scrollContainer.scrollLeft() != it.scrollData.scrollLeft) { + it.scrollData.scrollLeft = scrollContainer.scrollLeft(); + scrolledLeft = true; + } + } else if (scrollContainer.scrollLeft() != 0) { + it.scrollData.scrollLeft = scrollContainer.scrollLeft(); + scrolledLeft = true; + } + + if (!scrolledLeft && !scrolledTop && !forceScroll) { + return; + } + + var firstHeader = $('td.jrcolHeader:first'); + if (!firstHeader.length > 0) { + return; + } + + var floatableTbl = it.getHeaderTable(), + tbl = firstHeader.closest('table'), + containerTop = isDashboard ? $win.scrollTop() : $('div#reportViewFrame .body').offset().top, + headerTop = firstHeader.closest('tr').offset().top, + reportContainerTop = $('#reportContainer').offset().top, + lastTableCel = $('td.first_jrcolHeader:first').closest('table').find('td.jrcel:last'), + diff = lastTableCel.length ? lastTableCel.offset().top - floatableTbl.outerHeight() - containerTop: -1, // if last cell is not visible, hide the floating header + scrollTop = it.cachedScroll || 0, + zoom = jive.reportInstance.zoom; + + it.isIPad && !it.cachedHeaderTop && (it.cachedHeaderTop = headerTop); + if (!isDashboard && it.isIPad) { + scrollTop += it.cachedHeaderTop - headerTop; + } + + if (!it.scrollData.bMoved && headerTop-containerTop < 0 && diff > 0) { + floatableTbl.show(); + + if (zoom) { + it.applyScaleTransform(floatableTbl, zoom.level, zoom.overflow ? '0 0' : '50% 0'); + floatableTbl.offset({ + top: isDashboard ? (it.isIPad ? scrollTop : 0) : (it.isIPad ? scrollTop : containerTop), + left: tbl.offset().left + }); + // do this twice for proper positioning + floatableTbl.offset({ + top: isDashboard ? (it.isIPad ? scrollTop : 0) : (it.isIPad ? scrollTop : containerTop), + left: tbl.offset().left + }); + } else { + floatableTbl.offset({ + top: isDashboard ? (it.isIPad ? scrollTop : 0) : (it.isIPad ? scrollTop : containerTop), + left: tbl.offset().left + }); + } + + it.setToolbarPositionWhenFloating(it.active, isDashboard); + + it.scrollData.bMoved = it.isFloatingHeader = true; + if (!isDashboard) { + if (!it.scrollData.reportContainerPositionAtMove) { + it.scrollData.reportContainerPositionAtMove = reportContainerTop; + } + } + } else if (it.scrollData.bMoved && headerTop-containerTop < 0 && diff > 0) { + floatableTbl.show(); + if (zoom) { + it.applyScaleTransform(floatableTbl, zoom.level, zoom.overflow ? '0 0' : '50% 0'); + floatableTbl.offset({ + top: isDashboard ? (it.isIPad ? scrollTop : 0) : (it.isIPad ? scrollTop : containerTop), + left: tbl.offset().left + }); + } else if (scrolledLeft) { + floatableTbl.offset({ + top: isDashboard ? (it.isIPad ? scrollTop : 0) : (it.isIPad ? scrollTop : containerTop), + left: tbl.offset().left + }); + } + + it.setToolbarPositionWhenFloating(it.active, isDashboard); + } else if (it.scrollData.bMoved) { + floatableTbl.hide(); + it.scrollData.bMoved = it.isFloatingHeader = false; + it.cachedScroll = 0; + it.active && it.ui.foobar.setToolbarPosition(); + } + + it.isIPad && (it.cachedHeaderTop = headerTop); + it.isIPad && (it.cachedScroll = scrollTop); + }, + setScrollableHeader: function(isDashboard){ + var it = this; + + it.scrollData = { + bMoved: false, + reportContainerPositionAtMove: null + }; + + if (!isDashboard) { + $('div#reportViewFrame .body').on('scroll', function() { + it.scrollHeader(isDashboard); + }); + } + + if (it.isIE) { // attach scroll to body for dashboards in IE + $('body').on('scroll', function() { + it.scrollHeader(isDashboard); + + // reposition jive visual elements + it.active && !it.ui.dialog.isVisible && it.showVisualElements(jive.selected.dim); + }); + } + $(window).on('resize scroll', function() { + it.scrollHeader(isDashboard); + + // reposition jive visual elements + it.active && !it.ui.dialog.isVisible && it.showVisualElements(jive.selected.dim); + }); + }, + init: function(report) { + var it = this; + + jive.reportInstance = report; + + if(!it.initialized) { + it.isDashboard = $('body').is('.dashboardViewFrame'); + /* + Scrolable table headers + + If there is a table that does not have floating header then floating headers for all tables + should be disabled + */ + var hasFloatingHeader = true; + $.each(report.components.table, function(index, table) { + if (!table.config.hasFloatingHeader) { + hasFloatingHeader = false; + return false; // break each + } + }); + + if(hasFloatingHeader && (it.isDashboard || $('div#reportViewFrame').length > 0)) { + it.setScrollableHeader(it.isDashboard); + } + + /* + Setup HTML + */ + $('#jive_components').length == 0 && $('body').append('
    '); + $('#jive_components').empty(); + $('#jive_components').append(templates); + + /* + Event Handling + */ + report.config.container.on(clickEventName, function(){ + if(!it.ui.dialog.isVisible) { + it.hide(); + $('body').trigger('jive.inactive'); + } + }); + + var jmenuitem; + $('div#jive_menus, div#jive_dropdown').on({ + 'mouseup touchend': function(evt){ + jmenuitem = $(this); + var args = jmenuitem.data('args'); + + jmenuitem.attr('fn') && jive.interactive[jive.selected.ie.config.type][jmenuitem.attr('fn')](args); + + if(evt.type == 'touchend') { + var key = jmenuitem.attr('key'); + if(jive.ui.foobar.menus[jive.selected.ie.config.type][key]){ + jive.ui.foobar.menus[jive.selected.ie.config.type][key].jo.show().position({ + of: jmenuitem, + my: 'left top', + at: 'right top' + }); + } else { + !jive.ui.dialog.isVisible && jive.hide(); + } + } + evt.preventDefault(); + }, + 'mouseover': function(evt){ + jmenuitem = $(this); + jmenuitem.addClass('hover'); + if(jmenuitem.width() < (jmenuitem.parent().width() - 24)) { + jmenuitem.width(jmenuitem.parent().width()-24); // IE7 fix + } + jmenuitem.parent().prevAll().hide(); + var key = jmenuitem.attr('key'); + if(jive.ui.foobar.menus[jive.selected.ie.config.type][key]){ + jive.ui.foobar.menus[jive.selected.ie.config.type][key].jo.show().position({ + of: jmenuitem, + my: 'left top', + at: 'right top' + }); + } + }, + 'mouseout': function(evt){ + jmenuitem = $(this); + jmenuitem.removeClass('hover'); + } + }, '.pmenuitem'); + + $('div#jive_dropdown').on({ + 'mouseup touchend': function(evt){ + var args = $(this).data('args'); + $(this).attr('fn') && jive.interactive[jive.selected.ie.config.type][$(this).attr('fn')](args); + evt.preventDefault(); + } + }, '.pmenuitem'); + + $('div#jive_dropdown').on('mouseleave', '.pmenu', function(evt) { + $(this).hide(); + }); + + it.initialized = true; + + $('body').trigger('jive.initialized', [it]); + } + }, + initInteractiveElement: function(o, jqReportContainer){ + if(jive.elements[o.config.id]) { + /* + * Check if report has been reloaded, if so we need to setup event + * listeners. + */ + if(!$.hasData(jqReportContainer.find('table.jrPage')[0])) { + jive.selectors = {}; + } + } + + jive.elements[o.config.id] = o; + /* + * Check if event listener has for selector already set. + */ + if(!jive.selectors[o.config.parentId + "-" + o.config.selector]){ + + jive.selectors[o.config.parentId + "-" + o.config.selector] = o.config.type; + + jqReportContainer.find('table.jrPage').on(clickEventName, o.config.selector, function(evt){ + // keep html links functional + if(!$(evt.target).parent().is('a')) { + var jo = $(this); + jive.selectInteractiveElement(jo); + return false; + } + }) + } + + if(o.config.proxySelector && !jive.selectors[o.config.parentId + "-" + o.config.proxySelector]) { + jive.selectors[o.config.parentId + "-" + o.config.proxySelector] = o.config.type; + jqReportContainer.find('table.jrPage').on(clickEventName, o.config.proxySelector, function(evt){ + // keep html links functional + if(!$(evt.target).parent().is('a')) { + var jo = jive.interactive[o.config.type].getInteractiveElementFromProxy($(this)); + jive.selectInteractiveElement(jo); + return false; + } + }) + } + }, + selectInteractiveElement: function(jo){ + if (jo && jo.is('.interactiveElement')) { + jive.ui.dialog.isVisible && jive.ui.dialog.hide(); + + jive.activeContainer = jo.closest('._jr_report_container_'); + + var colData = jive.interactive.column.columnsData[jo.data('tableuuid')][jo.data('coluuid')]; + + jive.selected = { + ie: jive.elements[jo.data('coluuid')], + jo: jive.interactive.column.getJoForCurrentSelection(jo), + realWidth: colData.width, + realHeight: colData.height + }; + + /*******************/ + /* + Fix for bug #36767 - overlay is not shown correctly for table columns after sorting; + When zooming, it is necessary to recalculate the overlay width + */ + var headerCols = $('table.jrPage .jrcolHeader[data-coluuid=' + jo.data('coluuid') + ']'), + firstCol = headerCols.eq(0), + widthSoFar, + realWidth, + firstLeft = firstCol.offset().left; + + widthSoFar = realWidth = firstCol.outerWidth(); + headerCols.each(function(i, v) { + var it = $(v); + if (it.offset().left < firstLeft) { //should not happen but let's be safe + realWidth += firstLeft - it.offset().left; + firstLeft = it.offset().left; + } + if (it.offset().left + it.outerWidth() > firstLeft + realWidth) { + realWidth = it.offset().left + it.outerWidth() - firstLeft; + widthSoFar += it.outerWidth() + } + }); + + jive.selected.realWidth = widthSoFar; + /*******************/ + + jive.selected.dim = jive.interactive[jive.selected.ie.config.type].getElementSize(); + + this.showVisualElements(jive.selected.dim); + + jive.active = true; + jive.started = true; + jive.interactive[jive.selected.ie.config.type].onSelect(); + } + }, + showVisualElements: function(dim) { + // hide already visible menus, if any + jive.ui.foobar.dropMenu && jive.ui.foobar.dropMenu.jo.hide(); + jive.ui.foobar.menus.column && jive.ui.foobar.menus.column.showColumns && jive.ui.foobar.menus.column.showColumns.jo.hide(); + + jive.ui.overlay.show(dim); + jive.ui.marker.show(dim); + jive.ui.foobar.show(dim); + } + } + + return jive; +}); diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.table.js jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.table.js --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.table.js 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.table.js 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,76 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +define(["jive.column", "jquery"], function(Column, $) { + var genericProperties = null; + + var Table = function(o) { + + this.config = { + id: null, + + /** + * {"1":{"index":"1","label":"Name","uuid":"ace5fd47-03c8-4d26-b2c0-354ca60560e0","visible":false,"interactive":true},..} + */ + allColumnsData: null + }; + $.extend(this.config, o); + + if(o.genericProperties) { + genericProperties = o.genericProperties; + } else { + this.config.genericProperties = genericProperties; + } + + this.parent = null; + this.columns = []; + this.columnMap = {} + this.loader = null; + }; + + Table.prototype = { + registerPart: function(partConfig) { + var column = new Column(partConfig); + column.parent = this; + column.loader = this.loader; + this.columns[partConfig.columnIndex] = column; + this.columnMap[partConfig.id] = column; + }, + getId: function() { + return this.config.id; + }, + + // internal functions + /** + * + * @param evt {object} The event object: {type, name, data} + */ + _notify: function(evt) { + // bubble the event + this.parent._notify(evt); + } + }; + + return Table; +}); \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.templates.tmpl jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.templates.tmpl --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.templates.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/headertoolbar/resources/require/jive.templates.tmpl 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,162 @@ + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Transparent
    None
    +
    +
    +
    +
    +
    diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/ContainerFillEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/ContainerFillEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/ContainerFillEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/ContainerFillEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public enum ContainerFillEnum implements NamedEnum +{ + /** + * + */ + NONE("None"), + + /** + * + */ + HORIZONTAL("Horizontal"), + + /** + * + */ + VERTICAL("Vertical"), + + /** + * + */ + BOTH("Both"); + + /** + * + */ + private final transient String name; + + private ContainerFillEnum(String name) + { + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static ContainerFillEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentCompiler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentCompiler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentCompiler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentCompiler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,59 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.component.ComponentCompiler; +import net.sf.jasperreports.engine.design.JRVerifier; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelComponentCompiler implements ComponentCompiler +{ + + @Override + public void collectExpressions(Component component, JRExpressionCollector collector) + { + IconLabelComponent iconLabelComponent = (IconLabelComponent) component; + collector.collect(iconLabelComponent.getLabelTextField()); + collector.collect(iconLabelComponent.getIconTextField()); + } + + @Override + public Component toCompiledComponent(Component component, JRBaseObjectFactory baseFactory) + { + IconLabelComponent iconLabelComponent = (IconLabelComponent) component; + return new IconLabelComponent(iconLabelComponent, baseFactory); + } + + @Override + public void verify(Component component, JRVerifier verifier) + { + // TODO + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentDesignConverter.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentDesignConverter.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentDesignConverter.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentDesignConverter.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRElement; +import net.sf.jasperreports.engine.JRPrintElement; +import net.sf.jasperreports.engine.component.ComponentDesignConverter; +import net.sf.jasperreports.engine.convert.ElementIconConverter; +import net.sf.jasperreports.engine.convert.ReportConverter; +import net.sf.jasperreports.engine.util.JRImageLoader; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelComponentDesignConverter extends ElementIconConverter implements ComponentDesignConverter +{ + + /** + * + */ + private final static IconLabelComponentDesignConverter INSTANCE = new IconLabelComponentDesignConverter(); + + /** + * + */ + private IconLabelComponentDesignConverter() + { + super(JRImageLoader.SUBREPORT_IMAGE_RESOURCE);//FIXMEINPUT + } + + /** + * + */ + public static IconLabelComponentDesignConverter getInstance() + { + return INSTANCE; + } + + @Override + public JRPrintElement convert(ReportConverter reportConverter, JRComponentElement element) + { + return convert(reportConverter, (JRElement)element); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentDigester.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentDigester.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentDigester.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentDigester.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,86 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.component.XmlDigesterConfigurer; +import net.sf.jasperreports.engine.type.HorizontalImageAlignEnum; +import net.sf.jasperreports.engine.type.VerticalImageAlignEnum; +import net.sf.jasperreports.engine.xml.JRXmlConstants; +import net.sf.jasperreports.engine.xml.XmlConstantPropertyRule; + +import org.apache.commons.digester.Digester; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelComponentDigester implements XmlDigesterConfigurer +{ + @Override + public void configureDigester(Digester digester) + { + addIconLabelComponentRules(digester); + } + + public static void addIconLabelComponentRules(Digester digester) + { + String componentNamespace = digester.getRuleNamespaceURI(); + + String iconLabelComponentPattern = "*/componentElement/iconLabel"; + digester.addFactoryCreate(iconLabelComponentPattern, IconLabelComponentFactory.class.getName()); + + digester.addSetProperties(iconLabelComponentPattern, new String[] { + IconLabelComponent.PROPERTY_ICON_POSITION, + IconLabelComponent.PROPERTY_LABEL_FILL, + IconLabelComponent.PROPERTY_HORIZONTAL_ALIGNMENT, + IconLabelComponent.PROPERTY_VERTICAL_ALIGNMENT }, + new String[0]); + + digester.addRule(iconLabelComponentPattern, + new XmlConstantPropertyRule( + IconLabelComponent.PROPERTY_ICON_POSITION, + IconPositionEnum.values())); + digester.addRule(iconLabelComponentPattern, + new XmlConstantPropertyRule( + IconLabelComponent.PROPERTY_LABEL_FILL, + ContainerFillEnum.values())); + digester.addRule(iconLabelComponentPattern, + new XmlConstantPropertyRule( + IconLabelComponent.PROPERTY_HORIZONTAL_ALIGNMENT, + "horizontalImageAlign", + HorizontalImageAlignEnum.values())); + digester.addRule(iconLabelComponentPattern, + new XmlConstantPropertyRule( + IconLabelComponent.PROPERTY_VERTICAL_ALIGNMENT, + "verticalImageAlign", + VerticalImageAlignEnum.values())); + + digester.setRuleNamespaceURI(JRXmlConstants.JASPERREPORTS_NAMESPACE); + + digester.addFactoryCreate(iconLabelComponentPattern + "/label/textField", LabelTextFieldFactory.class.getName()); + digester.addFactoryCreate(iconLabelComponentPattern + "/icon/textField", IconTextFieldFactory.class.getName()); + + digester.setRuleNamespaceURI(componentNamespace); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelComponentFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) + { + JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); + + IconLabelComponent iconLabelComponent = new IconLabelComponent(jasperDesign); + +// String isMultiLine = atts.getValue(JRXmlConstants.ATTRIBUTE_multiLine); +// if (isMultiLine != null && isMultiLine.length() > 0) +// { +// iconLabelComponent.setMultiLine(Boolean.valueOf(isMultiLine).booleanValue()); +// } + + return iconLabelComponent; + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentFillFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentFillFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentFillFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentFillFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.component.ComponentFillFactory; +import net.sf.jasperreports.engine.component.FillComponent; +import net.sf.jasperreports.engine.fill.JRFillCloneFactory; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelComponentFillFactory implements ComponentFillFactory +{ + + @Override + public FillComponent toFillComponent(Component component, + JRFillObjectFactory factory) + { + IconLabelComponent iconLabelComponent = (IconLabelComponent) component; + return new IconLabelComponentFill(iconLabelComponent, factory); + } + + @Override + public FillComponent cloneFillComponent(FillComponent component, + JRFillCloneFactory factory) + { + IconLabelComponentFill iconLabelComponentFill = (IconLabelComponentFill) component; + return new IconLabelComponentFill(iconLabelComponentFill.getIconLabelComponent(), factory); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentFill.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentFill.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentFill.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentFill.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,846 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import java.awt.Color; + +import net.sf.jasperreports.engine.JRAlignment; +import net.sf.jasperreports.engine.JRBoxContainer; +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRDefaultStyleProvider; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRImageAlignment; +import net.sf.jasperreports.engine.JRLineBox; +import net.sf.jasperreports.engine.JRPrintElement; +import net.sf.jasperreports.engine.JRPrintFrame; +import net.sf.jasperreports.engine.JRPrintText; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JRStyle; +import net.sf.jasperreports.engine.JasperPrint; +import net.sf.jasperreports.engine.component.BaseFillComponent; +import net.sf.jasperreports.engine.component.ConditionalStyleAwareFillComponent; +import net.sf.jasperreports.engine.component.FillPrepareResult; +import net.sf.jasperreports.engine.component.StretchableFillComponent; +import net.sf.jasperreports.engine.fill.JRFillCloneFactory; +import net.sf.jasperreports.engine.fill.JRFillCloneable; +import net.sf.jasperreports.engine.fill.JRFillElementContainer; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; +import net.sf.jasperreports.engine.fill.JRFillTextField; +import net.sf.jasperreports.engine.fill.JRTemplateFrame; +import net.sf.jasperreports.engine.fill.JRTemplatePrintFrame; +import net.sf.jasperreports.engine.type.HorizontalImageAlignEnum; +import net.sf.jasperreports.engine.type.VerticalImageAlignEnum; +import net.sf.jasperreports.engine.util.JRBoxUtil; +import net.sf.jasperreports.engine.util.StyleResolver; + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelComponentFill extends BaseFillComponent implements StretchableFillComponent, ConditionalStyleAwareFillComponent, JRBoxContainer, JRAlignment, JRImageAlignment +{ + private final IconLabelComponent iconLabelComponent; + + private final JRLineBox lineBox; + private final JRFillTextField labelTextField; + private final JRFillTextField iconTextField; + + //private JRTemplateGenericElement template; + private JRTemplateFrame template; + //private JRTemplateGenericPrintElement printElement; + private JRTemplatePrintFrame printElement; + private JRPrintText labelPrintText; + private JRPrintText iconPrintText; +// private boolean contentVisible; + private boolean iconsVisible = true; + private IconLabelDirectionEnum direction = IconLabelDirectionEnum.HORIZONTAL; + private int middlePadding; + + private int stretchHeight; + + public IconLabelComponentFill(IconLabelComponent iconLabelComponent, JRFillObjectFactory factory) + { + this.iconLabelComponent = iconLabelComponent; + this.lineBox = iconLabelComponent.getLineBox().clone(this); + this.labelTextField = (JRFillTextField)factory.getVisitResult(iconLabelComponent.getLabelTextField()); + this.iconTextField = (JRFillTextField)factory.getVisitResult(iconLabelComponent.getIconTextField()); + } + + public IconLabelComponentFill(IconLabelComponent iconLabelComponent, JRFillCloneFactory factory) + { + this.iconLabelComponent = iconLabelComponent; + this.lineBox = iconLabelComponent.getLineBox().clone(this); + this.labelTextField = null;//FIXMEINPUT (JRFillTextField)factory.getVisitResult(iconLabelComponent.getTextField()); + this.iconTextField = null;//FIXMEINPUT (JRFillTextField)factory.getVisitResult(iconLabelComponent.getTextField()); + } + + protected IconLabelComponent getIconLabelComponent() + { + return iconLabelComponent; + } + + @Override + public void evaluate(byte evaluation) throws JRException + { + labelTextField.evaluate(evaluation); + iconTextField.evaluate(evaluation); + } + + @Override + public JRPrintElement fill() + { + JRComponentElement element = fillContext.getComponentElement(); + if (template == null) + { + template = + new JRTemplateFrame( + fillContext.getElementOrigin(), + fillContext.getDefaultStyleProvider() + ); +// template = +// new JRTemplateGenericElement( +// fillContext.getElementOrigin(), +// fillContext.getDefaultStyleProvider(), +// IconLabelElement.ICONLABEL_ELEMENT_TYPE +// ); + + template.setStyle(fillContext.getComponentElement().getStyle()); + template.setMode(fillContext.getComponentElement().getOwnModeValue()); + template.setBackcolor(fillContext.getComponentElement().getOwnBackcolor()); + template.setForecolor(fillContext.getComponentElement().getOwnForecolor()); + JRBoxUtil.copy(getLineBox(), template.getLineBox()); + + template = deduplicate(template); + } + + printElement = new JRTemplatePrintFrame(template, printElementOriginator); +// printElement = new JRTemplateGenericPrintElement(template, elementId); + printElement.setUUID(element.getUUID()); + printElement.setX(element.getX()); + printElement.setY(fillContext.getElementPrintY()); + + printElement.setWidth(element.getWidth()); + //printElement.setHeight(element.getHeight()); + printElement.setHeight(stretchHeight); + + fillContext.getFiller().getPropertiesUtil().transferProperties( + iconLabelComponent.getContext().getComponentElement(),//FIXMEICONLABEL copy from fill element? + printElement, JasperPrint.PROPERTIES_PRINT_TRANSFER_PREFIX + ); + +// if (contentVisible) +// { + if (direction == IconLabelDirectionEnum.HORIZONTAL) + { + fillHorizontal(); + } + else + { + fillVertical(); + } +// } + + copy(printElement); + + return printElement; + } + + public void fillHorizontal() + { + try + { + labelPrintText = (JRPrintText)labelTextField.fill(); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + + if ( + iconLabelComponent.getLabelFill() != ContainerFillEnum.HORIZONTAL + && iconLabelComponent.getLabelFill() != ContainerFillEnum.BOTH + ) + { + int calculatedLabelWidth = + (int)labelTextField.getTextWidth() + + labelTextField.getLineBox().getLeftPadding() + + labelTextField.getLineBox().getRightPadding() + + 3;//we do +3 to avoid text wrap in html (+1 was enough for pdf) + labelPrintText.setWidth(Math.min(labelTextField.getWidth(), calculatedLabelWidth));//for some reason, calculated text width seems to be larger then available text width + } + + if ( + iconLabelComponent.getLabelFill() == ContainerFillEnum.VERTICAL + || iconLabelComponent.getLabelFill() == ContainerFillEnum.BOTH + ) + { + labelPrintText.setHeight( + Math.max( + labelTextField.getStretchHeight(), + stretchHeight + - getLineBox().getTopPadding() + - getLineBox().getBottomPadding() + ) + ); + } + + try + { + iconPrintText = (JRPrintText)iconTextField.fill(); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + + iconPrintText.setWidth( + (int)iconTextField.getTextWidth() + + iconTextField.getLineBox().getLeftPadding() + + iconTextField.getLineBox().getRightPadding() + ); + + int commonHeight = Math.max(labelPrintText.getHeight(), iconPrintText.getHeight()); + labelPrintText.setHeight(commonHeight); + iconPrintText.setHeight(commonHeight); + + switch (getHorizontalImageAlign()) + { + case LEFT : + { + if (iconLabelComponent.getIconPosition() == IconPositionEnum.START) + { + labelPrintText.setX(iconPrintText.getWidth() + middlePadding); + iconPrintText.setX(0); + } + else + { + labelPrintText.setX(0); + iconPrintText.setX(labelPrintText.getWidth() + middlePadding); + } + break; + } + case CENTER : + { + if (iconLabelComponent.getIconPosition() == IconPositionEnum.START) + { + iconPrintText.setX( + ( + iconLabelComponent.getContext().getComponentElement().getWidth() + - getLineBox().getLeftPadding() + - getLineBox().getRightPadding() + - middlePadding + - labelPrintText.getWidth() + - iconPrintText.getWidth() + ) / 2 + ); + labelPrintText.setX(iconPrintText.getX() + iconPrintText.getWidth() + middlePadding); + } + else + { + labelPrintText.setX( + ( + iconLabelComponent.getContext().getComponentElement().getWidth() + - getLineBox().getLeftPadding() + - getLineBox().getRightPadding() + - middlePadding + - labelPrintText.getWidth() + - iconPrintText.getWidth() + ) / 2 + ); + iconPrintText.setX(labelPrintText.getX() + labelPrintText.getWidth() + middlePadding); + } + break; + } + case RIGHT : + { + if (iconLabelComponent.getIconPosition() == IconPositionEnum.START) + { + labelPrintText.setX( + iconLabelComponent.getContext().getComponentElement().getWidth() + - getLineBox().getLeftPadding() + - getLineBox().getRightPadding() + - labelPrintText.getWidth() + ); + iconPrintText.setX(labelPrintText.getX() - iconPrintText.getWidth() - middlePadding); + } + else + { + iconPrintText.setX( + iconLabelComponent.getContext().getComponentElement().getWidth() + - getLineBox().getLeftPadding() + - getLineBox().getRightPadding() + - iconPrintText.getWidth() + ); + labelPrintText.setX(iconPrintText.getX() - labelPrintText.getWidth() - middlePadding); + } + break; + } + } + + switch (getVerticalImageAlign()) + { + case TOP : + { + labelPrintText.setY(0); + iconPrintText.setY(0); + break; + } + case MIDDLE : + { + labelPrintText.setY( + ( + stretchHeight + - getLineBox().getTopPadding() + - getLineBox().getBottomPadding() + - labelPrintText.getHeight() + ) / 2 + ); + iconPrintText.setY( + ( + stretchHeight + - getLineBox().getTopPadding() + - getLineBox().getBottomPadding() + - iconPrintText.getHeight() + ) / 2 + ); + break; + } + case BOTTOM : + { + labelPrintText.setY( + stretchHeight + - getLineBox().getTopPadding() + - getLineBox().getBottomPadding() + - labelPrintText.getHeight() + ); + iconPrintText.setY( + stretchHeight + - getLineBox().getTopPadding() + - getLineBox().getBottomPadding() + - iconPrintText.getHeight() + ); + break; + } + } + } + + + public void fillVertical() + { + try + { + labelPrintText = (JRPrintText)labelTextField.fill(); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + +// if ( +// iconLabelComponent.getLabelFill() != ContainerFillEnum.HORIZONTAL +// && iconLabelComponent.getLabelFill() != ContainerFillEnum.BOTH +// ) +// { +// int calculatedLabelWidth = +// (int)labelTextField.getTextWidth() +// + labelTextField.getLineBox().getLeftPadding() +// + labelTextField.getLineBox().getRightPadding() +// + 3;//we do +3 to avoid text wrap in html (+1 was enough for pdf) +// labelPrintText.setWidth(Math.min(labelTextField.getWidth(), calculatedLabelWidth));//for some reason, calculated text width seems to be larger then available text width +// } + + if ( + iconLabelComponent.getLabelFill() == ContainerFillEnum.VERTICAL + || iconLabelComponent.getLabelFill() == ContainerFillEnum.BOTH + ) + { + labelPrintText.setHeight( + Math.max( + labelTextField.getStretchHeight(), + stretchHeight - (direction == IconLabelDirectionEnum.HORIZONTAL ? 0 : (iconTextField.getStretchHeight() + middlePadding)) + - getLineBox().getTopPadding() + - getLineBox().getBottomPadding() + ) + ); + } + + try + { + iconPrintText = (JRPrintText)iconTextField.fill(); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + +// iconPrintText.setWidth( +// (int)iconTextField.getTextWidth() +// + iconTextField.getLineBox().getLeftPadding() +// + iconTextField.getLineBox().getRightPadding() +// ); + +// int commonHeight = Math.max(labelPrintText.getHeight(), iconPrintText.getHeight()); +// labelPrintText.setHeight(commonHeight); +// iconPrintText.setHeight(commonHeight); + + switch (getHorizontalImageAlign()) + { + case LEFT : + { + labelPrintText.setX(0); + iconPrintText.setX(0); + break; + } + case CENTER : + { + labelPrintText.setX( + ( + iconLabelComponent.getContext().getComponentElement().getWidth() + - getLineBox().getLeftPadding() + - getLineBox().getRightPadding() + - labelPrintText.getWidth() + ) / 2 + ); + iconPrintText.setX( + ( + iconLabelComponent.getContext().getComponentElement().getWidth() + - getLineBox().getLeftPadding() + - getLineBox().getRightPadding() + - iconPrintText.getWidth() + ) / 2 + ); + break; + } + case RIGHT : + { + labelPrintText.setX( + iconLabelComponent.getContext().getComponentElement().getWidth() + - getLineBox().getLeftPadding() + - getLineBox().getRightPadding() + - labelPrintText.getWidth() + ); + iconPrintText.setX( + iconLabelComponent.getContext().getComponentElement().getWidth() + - getLineBox().getLeftPadding() + - getLineBox().getRightPadding() + - iconPrintText.getWidth() + ); + break; + } + } + + switch (getVerticalImageAlign()) + { + case TOP : + { + if (iconLabelComponent.getIconPosition() == IconPositionEnum.START) + { + labelPrintText.setY(iconPrintText.getHeight() + middlePadding); + iconPrintText.setY(0); + } + else + { + labelPrintText.setY(0); + iconPrintText.setY(labelPrintText.getHeight() + middlePadding); + } + break; + } + case MIDDLE : + { + if (iconLabelComponent.getIconPosition() == IconPositionEnum.START) + { + iconPrintText.setY( + ( + stretchHeight + - getLineBox().getTopPadding() + - getLineBox().getBottomPadding() + - middlePadding + - labelPrintText.getHeight() + - iconPrintText.getHeight() + ) / 2 + ); + labelPrintText.setY(iconPrintText.getY() + iconPrintText.getHeight() + middlePadding); + } + else + { + labelPrintText.setY( + ( + stretchHeight + - getLineBox().getTopPadding() + - getLineBox().getBottomPadding() + - middlePadding + - labelPrintText.getHeight() + - iconPrintText.getHeight() + ) / 2 + ); + iconPrintText.setY(labelPrintText.getY() + labelPrintText.getHeight() + middlePadding); + } + break; + } + case BOTTOM : + { + if (iconLabelComponent.getIconPosition() == IconPositionEnum.START) + { + labelPrintText.setY( + stretchHeight + - getLineBox().getTopPadding() + - getLineBox().getBottomPadding() + - labelPrintText.getHeight() + ); + iconPrintText.setY(labelPrintText.getY() - iconPrintText.getHeight() - middlePadding); + } + else + { + iconPrintText.setY( + stretchHeight + - getLineBox().getTopPadding() + - getLineBox().getBottomPadding() + - iconPrintText.getHeight() + ); + labelPrintText.setY(iconPrintText.getY() - labelPrintText.getHeight() - middlePadding); + } + break; + } + } + } + + @Override + public void setStretchHeight(int stretchHeight) + { + this.stretchHeight = stretchHeight; + } + + @Override + public void setConditionalStylesContainer(JRFillElementContainer conditionalStylesContainer) + { + labelTextField.setConditionalStylesContainer(conditionalStylesContainer); + iconTextField.setConditionalStylesContainer(conditionalStylesContainer); + } + + @Override + public FillPrepareResult prepare(int availableHeight) + { + float paddingDiff = + iconLabelComponent.getContext().getComponentElement().getWidth() + - getLineBox().getLeftPadding() + - getLineBox().getRightPadding() + - 1; + + if (paddingDiff < 0) + { + paddingDiff = paddingDiff / 2; + + int leftPadding = getLineBox().getLeftPadding() + (int)Math.floor(paddingDiff); + leftPadding = leftPadding < 0 ? 0 : leftPadding; + getLineBox().setLeftPadding(leftPadding); + + int rightPadding = getLineBox().getRightPadding() + (int)Math.ceil(paddingDiff); + rightPadding = rightPadding < 0 ? 0 : rightPadding; + getLineBox().setRightPadding(rightPadding); + } + + int availableWidth = + iconLabelComponent.getContext().getComponentElement().getWidth() + - getLineBox().getLeftPadding() + - getLineBox().getRightPadding(); + + middlePadding = (int)(iconTextField.getFontsize() / 2); + + if (availableWidth <= middlePadding) + { + middlePadding = 0; + } + else + { + middlePadding = Math.min(availableWidth - middlePadding, middlePadding); + } + + availableWidth = + iconLabelComponent.getContext().getComponentElement().getWidth() + - getLineBox().getLeftPadding() + - getLineBox().getRightPadding() + - middlePadding; + +// if (availableWidth <= 0) +// { +// return FillPrepareResult.printStretch(iconLabelComponent.getContext().getComponentElement().getHeight(), false); +// } +// +// contentVisible = true; + + int textAvailableHeight = + availableHeight + - getLineBox().getTopPadding() + - getLineBox().getBottomPadding(); + + iconTextField.setWidth(availableWidth); + + try + { + iconTextField.prepare(textAvailableHeight, fillContext.getFillContainerContext().isCurrentOverflow()); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + + boolean changeDirection = false; + int labelAvailableWidth; + + int iconsUsedWidth = 0; + + if (iconTextField.getTextWidth() > iconTextField.getWidth() - iconTextField.getLineBox().getLeftPadding() - iconTextField.getLineBox().getRightPadding()) + { + changeDirection = true; + } + else + { + iconsUsedWidth = + (int)iconTextField.getTextWidth() + + iconTextField.getLineBox().getLeftPadding() + + iconTextField.getLineBox().getRightPadding(); + changeDirection = availableWidth <= iconsUsedWidth; + labelAvailableWidth = changeDirection ? availableWidth : (availableWidth - iconsUsedWidth); + } + + if (changeDirection) + { + labelAvailableWidth = availableWidth + middlePadding; + } + else + { + labelAvailableWidth = availableWidth - iconsUsedWidth; + } + + labelTextField.setWidth(labelAvailableWidth); + + try + { + labelTextField.prepare(textAvailableHeight, fillContext.getFillContainerContext().isCurrentOverflow()); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + + if ( + changeDirection +// && labelTextField.getTextWidth() > labelTextField.getWidth() - labelTextField.getLineBox().getLeftPadding() - labelTextField.getLineBox().getRightPadding() + )//FIXMEICONLABEL here we might get to hide icons simply because label is blank + { + direction = IconLabelDirectionEnum.VERTICAL; + middlePadding = (int)(iconTextField.getFontsize() / 2); +// labelTextField.setWidth(availableWidth); + int iconAvailableHeight = + (labelTextField.isStretchWithOverflow() + ? textAvailableHeight - labelTextField.getStretchHeight() + : iconLabelComponent.getContext().getComponentElement().getHeight() - labelTextField.getStretchHeight()) + - middlePadding; + iconsVisible = iconAvailableHeight > 0; + if (iconsVisible) + { + try + { +// labelTextField.rewind(); +// labelTextField.prepare(textAvailableHeight - iconTextField.getStretchHeight(), fillContext.getFillContainerContext().isCurrentOverflow()); + iconTextField.rewind(); + iconTextField.reset(); + iconTextField.setWidth(labelAvailableWidth); + iconTextField.prepare( + iconAvailableHeight, + fillContext.getFillContainerContext().isCurrentOverflow() + ); + iconsVisible = iconTextField.getStretchHeight() <= iconAvailableHeight; + //iconsVisible = iconTextField.getPrintElementHeight() <= iconAvailableHeight; + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + } + + stretchHeight = + (direction == IconLabelDirectionEnum.HORIZONTAL + ? Math.max(labelTextField.getStretchHeight(), (iconsVisible ? iconTextField.getStretchHeight() : 0)) + : (labelTextField.getStretchHeight() + (iconsVisible ? iconTextField.getStretchHeight() + middlePadding : 0))) + + getLineBox().getTopPadding() + + getLineBox().getBottomPadding(); + + return FillPrepareResult.printStretch(stretchHeight, false); + } + + public JRFillCloneable createClone(JRFillCloneFactory factory) + { + throw new UnsupportedOperationException(); + } + + @Override + public void evaluateDelayedElement(JRPrintElement element, byte evaluation) throws JRException + { + evaluate(evaluation); + copy((JRGenericPrintElement) element); + } + + protected void copy(JRGenericPrintElement printElement) + { + printElement.setParameterValue(IconLabelElement.PARAMETER_LINE_BOX, iconLabelComponent.getLineBox().clone(null)); + printElement.setParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT, labelPrintText); + printElement.setParameterValue(IconLabelElement.PARAMETER_ICON_TEXT_ELEMENT, iconPrintText); + } + + protected void copy(JRPrintFrame printFrame) + { + //printElement.iconLabelComponent.getLineBox().clone(printElement); +// if (contentVisible) +// { + printElement.addElement(labelPrintText); + if (iconsVisible) + { + printElement.addElement(iconPrintText); + } +// } + } + + @Override + public Color getDefaultLineColor() + { + return Color.black; + } + + @Override + public JRDefaultStyleProvider getDefaultStyleProvider() { + return fillContext.getComponentElement().getDefaultStyleProvider(); + } + + protected StyleResolver getStyleResolver() { + return getDefaultStyleProvider().getStyleResolver(); + } + + @Override + public JRStyle getStyle() { + return fillContext.getComponentElement().getStyle(); + } + + @Override + public String getStyleNameReference() { + return fillContext.getComponentElement().getStyleNameReference(); + } + + @Override + public JRLineBox getLineBox() { + return lineBox; + } + + /** + * @deprecated Replaced by {@link #getHorizontalImageAlign()}. + */ + @Override + public net.sf.jasperreports.engine.type.HorizontalAlignEnum getHorizontalAlignmentValue() + { + return net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalAlignEnum(getHorizontalImageAlign()); + } + + /** + * @deprecated Replaced by {@link #getOwnHorizontalImageAlign()}. + */ + @Override + public net.sf.jasperreports.engine.type.HorizontalAlignEnum getOwnHorizontalAlignmentValue() + { + return net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalAlignEnum(getOwnHorizontalImageAlign()); + } + + /** + * @deprecated Replaced by {@link #setHorizontalImageAlign(HorizontalImageAlignEnum)}. + */ + @Override + public void setHorizontalAlignment(net.sf.jasperreports.engine.type.HorizontalAlignEnum horizontalAlignmentValue) + { + setHorizontalImageAlign(net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalImageAlignEnum(horizontalAlignmentValue)); + } + + /** + * @deprecated Replaced by {@link #getVerticalImageAlign()}. + */ + @Override + public net.sf.jasperreports.engine.type.VerticalAlignEnum getVerticalAlignmentValue() + { + return net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalAlignEnum(getVerticalImageAlign()); + } + + /** + * @deprecated Replaced by {@link #getOwnVerticalImageAlign()}. + */ + @Override + public net.sf.jasperreports.engine.type.VerticalAlignEnum getOwnVerticalAlignmentValue() + { + return net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalAlignEnum(getOwnVerticalImageAlign()); + } + + /** + * @deprecated Replaced by {@link #setVerticalImageAlign(VerticalImageAlignEnum)}. + */ + @Override + public void setVerticalAlignment(net.sf.jasperreports.engine.type.VerticalAlignEnum verticalAlignmentValue) + { + setVerticalImageAlign(net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalImageAlignEnum(verticalAlignmentValue)); + } + + @Override + public HorizontalImageAlignEnum getHorizontalImageAlign() + { + return getStyleResolver().getHorizontalImageAlign(this); + } + + @Override + public HorizontalImageAlignEnum getOwnHorizontalImageAlign() + { + return iconLabelComponent.getOwnHorizontalImageAlign(); + } + + @Override + public void setHorizontalImageAlign(HorizontalImageAlignEnum horizontalAlignment) + { + throw new UnsupportedOperationException(); + } + + @Override + public VerticalImageAlignEnum getVerticalImageAlign() + { + return getStyleResolver().getVerticalImageAlign(this); + } + + @Override + public VerticalImageAlignEnum getOwnVerticalImageAlign() + { + return iconLabelComponent.getOwnVerticalImageAlign(); + } + + @Override + public void setVerticalImageAlign(VerticalImageAlignEnum verticalAlignment) + { + throw new UnsupportedOperationException(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,362 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import java.awt.Color; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.Serializable; + +import net.sf.jasperreports.engine.JRAlignment; +import net.sf.jasperreports.engine.JRBoxContainer; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRDefaultStyleProvider; +import net.sf.jasperreports.engine.JRImageAlignment; +import net.sf.jasperreports.engine.JRLineBox; +import net.sf.jasperreports.engine.JRStyle; +import net.sf.jasperreports.engine.JRTextField; +import net.sf.jasperreports.engine.base.JRBaseLineBox; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.component.BaseComponentContext; +import net.sf.jasperreports.engine.component.ComponentContext; +import net.sf.jasperreports.engine.component.ContextAwareComponent; +import net.sf.jasperreports.engine.design.JRDesignTextField; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.type.HorizontalImageAlignEnum; +import net.sf.jasperreports.engine.type.VerticalImageAlignEnum; +import net.sf.jasperreports.engine.util.StyleResolver; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelComponent implements ContextAwareComponent, JRBoxContainer, JRAlignment, JRImageAlignment, Serializable, JRChangeEventsSupport +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public static final String PROPERTY_ICON_POSITION = "iconPosition"; + public static final String PROPERTY_LABEL_FILL = "labelFill"; + public static final String PROPERTY_HORIZONTAL_ALIGNMENT = "horizontalAlignment"; + public static final String PROPERTY_VERTICAL_ALIGNMENT = "verticalAlignment"; + + private JRLineBox lineBox; + private JRTextField labelTextField; + private JRTextField iconTextField; + private IconPositionEnum iconPosition; + private ContainerFillEnum labelFill; + private HorizontalImageAlignEnum horizontalImageAlign; + private VerticalImageAlignEnum verticalImageAlign; + + private ComponentContext context; + + private transient JRPropertyChangeSupport eventSupport; + + public IconLabelComponent(JRDefaultStyleProvider defaultStyleProvider) + { + lineBox = new JRBaseLineBox(this); + labelTextField = new JRDesignTextField(defaultStyleProvider); + iconTextField = new JRDesignTextField(defaultStyleProvider); + } + + public IconLabelComponent(IconLabelComponent component, JRBaseObjectFactory objectFactory) + { + this.lineBox = component.getLineBox().clone(this); + this.labelTextField = (JRTextField)objectFactory.getVisitResult(component.getLabelTextField()); + this.iconTextField = (JRTextField)objectFactory.getVisitResult(component.getIconTextField()); + + this.iconPosition = component.getIconPosition(); + this.labelFill = component.getLabelFill(); + this.horizontalImageAlign = component.getOwnHorizontalImageAlign(); + this.verticalImageAlign = component.getOwnVerticalImageAlign(); + + this.context = new BaseComponentContext(component.getContext(), objectFactory); + } + + @Override + public void setContext(ComponentContext context) + { + this.context = context; + } + + @Override + public ComponentContext getContext() + { + return context; + } + + @Override + public JRLineBox getLineBox() + { + return lineBox; + } + + /** + * + */ + public void setLineBox(JRLineBox lineBox) + { + this.lineBox = lineBox; + } + + @Override + public JRDefaultStyleProvider getDefaultStyleProvider() + { + return context == null ? labelTextField.getDefaultStyleProvider() : context.getComponentElement().getDefaultStyleProvider(); + } + + /** + * + */ + protected StyleResolver getStyleResolver() + { + return getDefaultStyleProvider().getStyleResolver(); + } + + @Override + public JRStyle getStyle() + { + return context == null ? null : context.getComponentElement().getStyle(); + } + + @Override + public String getStyleNameReference() + { + return context == null ? null : context.getComponentElement().getStyleNameReference(); + } + + @Override + public Color getDefaultLineColor() + { + return Color.black; + } + + /** + * + */ + public JRTextField getLabelTextField() + { + return labelTextField; + } + + /** + * + */ + public void setLabelTextField(JRTextField labelTextField) + { + this.labelTextField = labelTextField; + } + + /** + * + */ + public JRTextField getIconTextField() + { + return iconTextField; + } + + /** + * + */ + public void setIconTextField(JRTextField iconTextField) + { + this.iconTextField = iconTextField; + } + + /** + * + */ + public IconPositionEnum getIconPosition() + { + return iconPosition; + } + + /** + * + */ + public void setIconPosition(IconPositionEnum iconPosition) + { + IconPositionEnum old = this.iconPosition; + this.iconPosition = iconPosition; + getEventSupport().firePropertyChange(PROPERTY_ICON_POSITION, old, this.iconPosition); + } + + /** + * @deprecated Replaced by {@link #getHorizontalImageAlign()}. + */ + @Override + public net.sf.jasperreports.engine.type.HorizontalAlignEnum getHorizontalAlignmentValue() + { + return net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalAlignEnum(getHorizontalImageAlign()); + } + + /** + * @deprecated Replaced by {@link #getOwnHorizontalImageAlign()}. + */ + @Override + public net.sf.jasperreports.engine.type.HorizontalAlignEnum getOwnHorizontalAlignmentValue() + { + return net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalAlignEnum(getOwnHorizontalImageAlign()); + } + + /** + * @deprecated Replaced by {@link #setHorizontalImageAlign(HorizontalImageAlignEnum)}. + */ + @Override + public void setHorizontalAlignment(net.sf.jasperreports.engine.type.HorizontalAlignEnum horizontalAlignmentValue) + { + setHorizontalImageAlign(net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalImageAlignEnum(horizontalAlignmentValue)); + } + + /** + * @deprecated Replaced by {@link #getVerticalImageAlign()}. + */ + @Override + public net.sf.jasperreports.engine.type.VerticalAlignEnum getVerticalAlignmentValue() + { + return net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalAlignEnum(getVerticalImageAlign()); + } + + /** + * @deprecated Replaced by {@link #getOwnVerticalImageAlign()}. + */ + @Override + public net.sf.jasperreports.engine.type.VerticalAlignEnum getOwnVerticalAlignmentValue() + { + return net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalAlignEnum(getOwnVerticalImageAlign()); + } + + /** + * @deprecated Replaced by {@link #setVerticalImageAlign(VerticalImageAlignEnum)}. + */ + @Override + public void setVerticalAlignment(net.sf.jasperreports.engine.type.VerticalAlignEnum verticalAlignmentValue) + { + setVerticalImageAlign(net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalImageAlignEnum(verticalAlignmentValue)); + } + + @Override + public HorizontalImageAlignEnum getHorizontalImageAlign() + { + return getStyleResolver().getHorizontalImageAlign(this); + } + + @Override + public HorizontalImageAlignEnum getOwnHorizontalImageAlign() + { + return horizontalImageAlign; + } + + @Override + public void setHorizontalImageAlign(HorizontalImageAlignEnum horizontalImageAlign) + { + Object old = this.horizontalImageAlign; + this.horizontalImageAlign = horizontalImageAlign; + getEventSupport().firePropertyChange(PROPERTY_HORIZONTAL_ALIGNMENT, old, this.horizontalImageAlign); + } + + @Override + public VerticalImageAlignEnum getVerticalImageAlign() + { + return getStyleResolver().getVerticalImageAlign(this); + } + + @Override + public VerticalImageAlignEnum getOwnVerticalImageAlign() + { + return verticalImageAlign; + } + + @Override + public void setVerticalImageAlign(VerticalImageAlignEnum verticalImageAlign) + { + Object old = this.verticalImageAlign; + this.verticalImageAlign = verticalImageAlign; + getEventSupport().firePropertyChange(PROPERTY_VERTICAL_ALIGNMENT, old, this.verticalImageAlign); + } + + /** + * + */ + public ContainerFillEnum getLabelFill() + { + return labelFill; + } + + /** + * + */ + public void setLabelFill(ContainerFillEnum labelFill) + { + ContainerFillEnum old = this.labelFill; + this.labelFill = labelFill; + getEventSupport().firePropertyChange(PROPERTY_LABEL_FILL, old, this.labelFill); + } + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private net.sf.jasperreports.engine.type.HorizontalAlignEnum horizontalAlign; + /** + * @deprecated + */ + private net.sf.jasperreports.engine.type.VerticalAlignEnum verticalAlign; + + @SuppressWarnings("deprecation") + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_6_0_2) + { + horizontalImageAlign = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalImageAlignEnum(horizontalAlign); + verticalImageAlign = net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalImageAlignEnum(verticalAlign); + + horizontalAlign = null; + verticalAlign = null; + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentManager.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentManager.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentManager.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentManager.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.component.ComponentXmlWriter; +import net.sf.jasperreports.engine.component.DefaultComponentManager; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelComponentManager extends DefaultComponentManager +{ + + @Override + public ComponentXmlWriter getComponentXmlWriter(JasperReportsContext jasperReportsContext) + { + return new IconLabelComponentXmlWriter(jasperReportsContext); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentUtil.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentUtil.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentUtil.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentUtil.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,278 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.components.ComponentsExtensionsRegistryFactory; +import net.sf.jasperreports.components.table.fill.TableReport; +import net.sf.jasperreports.engine.JRHyperlink; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRPropertyExpression; +import net.sf.jasperreports.engine.JRTextElement; +import net.sf.jasperreports.engine.JRTextField; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.component.ComponentKey; +import net.sf.jasperreports.engine.design.JRDesignComponentElement; +import net.sf.jasperreports.engine.design.JRDesignTextField; +import net.sf.jasperreports.engine.type.HorizontalImageAlignEnum; +import net.sf.jasperreports.engine.type.HorizontalTextAlignEnum; +import net.sf.jasperreports.engine.type.VerticalImageAlignEnum; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelComponentUtil +{ + private JasperReportsContext jasperReportsContext; + + /** + * + */ + public static IconLabelComponentUtil getInstance(JasperReportsContext jasperReportsContext) + { + return new IconLabelComponentUtil(jasperReportsContext); + } + + /** + * + */ + private IconLabelComponentUtil(JasperReportsContext jasperReportsContext) + { + this.jasperReportsContext = jasperReportsContext; + } + + /** + * + */ + public JRDesignComponentElement createIconLabelComponentElement(JRTextElement textElement) + { + return createIconLabelComponentElement(textElement, textElement); + } + + /** + * + */ + public JRDesignComponentElement createIconLabelComponentElement(JRTextElement parentElement, JRTextElement textElement) + { + JRDesignComponentElement componentElement = new JRDesignComponentElement(textElement.getDefaultStyleProvider()); + componentElement.setComponentKey(new ComponentKey( + ComponentsExtensionsRegistryFactory.NAMESPACE, null, ComponentsExtensionsRegistryFactory.ICONLABEL_COMPONENT_NAME)); + componentElement.setX(textElement.getX()); + componentElement.setY(textElement.getY()); + componentElement.setHeight(textElement.getHeight()); + componentElement.setWidth(textElement.getWidth()); + componentElement.setStyle(textElement.getStyle()); + componentElement.setStyleNameReference(textElement.getStyleNameReference()); + componentElement.setMode(parentElement.getOwnModeValue()); + componentElement.setForecolor(parentElement.getOwnForecolor()); + componentElement.setBackcolor(parentElement.getOwnBackcolor()); + componentElement.setStretchType(parentElement.getStretchTypeValue()); + componentElement.setPositionType(parentElement.getPositionTypeValue()); + componentElement.setKey(parentElement.getKey()); + componentElement.setPrintWhenExpression(parentElement.getPrintWhenExpression());//FIXMEICONLABEL make this and the ones below work + componentElement.setPrintInFirstWholeBand(parentElement.isPrintInFirstWholeBand()); + componentElement.setPrintRepeatedValues(parentElement.isPrintRepeatedValues()); + componentElement.setPrintWhenDetailOverflows(parentElement.isPrintWhenDetailOverflows()); + componentElement.setPrintWhenGroupChanges(parentElement.getPrintWhenGroupChanges()); + componentElement.setRemoveLineWhenBlank(parentElement.isRemoveLineWhenBlank()); + + IconLabelComponent iconLabelComponent = new IconLabelComponent(textElement.getDefaultStyleProvider()); + iconLabelComponent.setIconPosition(IconPositionEnum.END); + + if (parentElement.getOwnVerticalTextAlign() != null) + { + switch (parentElement.getOwnVerticalTextAlign()) + { + case BOTTOM : + { + iconLabelComponent.setVerticalImageAlign(VerticalImageAlignEnum.BOTTOM); + break; + } + case MIDDLE : + { + iconLabelComponent.setVerticalImageAlign(VerticalImageAlignEnum.MIDDLE); + break; + } + case TOP : + case JUSTIFIED : + default : + { + iconLabelComponent.setVerticalImageAlign(VerticalImageAlignEnum.TOP); + break; + } + } + } + + if (parentElement.getOwnHorizontalTextAlign() != null) + { + switch (parentElement.getOwnHorizontalTextAlign()) + { + case RIGHT : + { + iconLabelComponent.setHorizontalImageAlign(HorizontalImageAlignEnum.RIGHT); + break; + } + case CENTER : + { + iconLabelComponent.setHorizontalImageAlign(HorizontalImageAlignEnum.CENTER); + break; + } + case LEFT : + case JUSTIFIED : + default : + { + iconLabelComponent.setHorizontalImageAlign(HorizontalImageAlignEnum.LEFT); + break; + } + } + } + + iconLabelComponent.setLabelFill(ContainerFillEnum.NONE); + iconLabelComponent.setLineBox(parentElement.getLineBox().clone(iconLabelComponent)); +// iconLabelComponent.getLineBox().setPadding(0); +// iconLabelComponent.getLineBox().setLeftPadding(0); +// iconLabelComponent.getLineBox().setRightPadding(0); +// iconLabelComponent.getLineBox().setTopPadding(0); +// iconLabelComponent.getLineBox().setBottomPadding(0); + + JRDesignTextField labelTextField = new JRDesignTextField(textElement.getDefaultStyleProvider()); + labelTextField.setStretchWithOverflow(true); + labelTextField.setX(0); + labelTextField.setY(0); + labelTextField.setWidth(1); + labelTextField.setHeight(textElement.getHeight()); +// labelTextField.setHeight(Math.max(1, headerTextElement.getHeight() +// - headerTextElement.getLineBox().getTopPadding() - headerTextElement.getLineBox().getBottomPadding())); + labelTextField.setStyle(textElement.getStyle()); + labelTextField.setStyleNameReference(textElement.getStyleNameReference()); + labelTextField.setMode(parentElement.getOwnModeValue()); + labelTextField.setFontSize(parentElement.getOwnFontsize()); + labelTextField.setFontName(parentElement.getOwnFontName()); + labelTextField.setForecolor(parentElement.getOwnForecolor()); + labelTextField.setBackcolor(parentElement.getOwnBackcolor()); + labelTextField.setBold(parentElement.isOwnBold()); + labelTextField.setItalic(parentElement.isOwnItalic()); + labelTextField.setUnderline(parentElement.isOwnUnderline()); + labelTextField.setStrikeThrough(parentElement.isOwnStrikeThrough()); + labelTextField.setHorizontalTextAlign(parentElement.getOwnHorizontalTextAlign()); + labelTextField.setVerticalTextAlign(parentElement.getOwnVerticalTextAlign()); + labelTextField.setRotation(parentElement.getOwnRotationValue());//FIXMEICONLABEL how does it work? +// JRBoxUtil.copy(parentElement.getLineBox(), labelTextField.getLineBox()); + labelTextField.getLineBox().setRightPadding(0); + labelTextField.getLineBox().getPen().setLineWidth(0); + labelTextField.getLineBox().getLeftPen().setLineWidth(0); + labelTextField.getLineBox().getRightPen().setLineWidth(0); + labelTextField.getLineBox().getTopPen().setLineWidth(0); + labelTextField.getLineBox().getBottomPen().setLineWidth(0); + labelTextField.getLineBox().setLeftPadding(0); + labelTextField.getLineBox().getPen().setLineWidth(0); + labelTextField.getLineBox().getLeftPen().setLineWidth(0); + labelTextField.getLineBox().getRightPen().setLineWidth(0); + labelTextField.getLineBox().getTopPen().setLineWidth(0); + labelTextField.getLineBox().getBottomPen().setLineWidth(0); + + for(String propName : parentElement.getPropertiesMap().getPropertyNames()) + { + labelTextField.getPropertiesMap().setProperty( + propName, + parentElement.getPropertiesMap().getProperty(propName) + ); + } + + if (parentElement.getPropertyExpressions() != null) + { + for(JRPropertyExpression propExpr : parentElement.getPropertyExpressions()) + { + labelTextField.addPropertyExpression(propExpr); + } + } + + JRTextField textField = parentElement instanceof JRTextField ? (JRTextField)parentElement : null; + if (textField != null) + { + labelTextField.setStretchWithOverflow(textField.isStretchWithOverflow()); + labelTextField.setBlankWhenNull(textField.isBlankWhenNull()); + labelTextField.setMarkup(textField.getMarkup()); + labelTextField.setPattern(textField.getPattern()); + labelTextField.setPatternExpression(textField.getPatternExpression()); + labelTextField.setBookmarkLevel(textField.getBookmarkLevel()); + labelTextField.setAnchorNameExpression(textField.getAnchorNameExpression()); + labelTextField.setEvaluationTime(textField.getEvaluationTimeValue()); + labelTextField.setEvaluationGroup(textField.getEvaluationGroup()); + labelTextField.setEvaluationGroup(textField.getEvaluationGroup()); + } + + JRHyperlink hyperlink = parentElement instanceof JRHyperlink ? (JRHyperlink)parentElement : null; + if (hyperlink != null) + { + labelTextField.setHyperlinkWhenExpression(hyperlink.getHyperlinkWhenExpression()); + labelTextField.setLinkType(hyperlink.getLinkType()); + labelTextField.setHyperlinkAnchorExpression(hyperlink.getHyperlinkAnchorExpression()); + labelTextField.setHyperlinkPageExpression(hyperlink.getHyperlinkPageExpression()); + labelTextField.setHyperlinkReferenceExpression(hyperlink.getHyperlinkReferenceExpression()); + labelTextField.setLinkTarget(hyperlink.getLinkTarget()); + labelTextField.setHyperlinkTooltipExpression(hyperlink.getHyperlinkTooltipExpression()); + } + + iconLabelComponent.setLabelTextField(labelTextField); + + JRDesignTextField iconTextField = new JRDesignTextField(textElement.getDefaultStyleProvider()); + iconTextField.setStretchWithOverflow(true); + iconTextField.setX(0); + iconTextField.setY(0); + iconTextField.setWidth(1); + iconTextField.setHeight(1); + iconTextField.setStyle(textElement.getStyle()); + iconTextField.setStyleNameReference(textElement.getStyleNameReference()); + iconTextField.setMode(parentElement.getOwnModeValue()); + iconTextField.setFontName(JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(TableReport.PROPERTY_ICON_FONT)); + iconTextField.setFontSize(parentElement.getOwnFontsize()); + iconTextField.setForecolor(parentElement.getOwnForecolor()); + iconTextField.setBackcolor(parentElement.getOwnBackcolor()); + iconTextField.setBold(false);//parentElement.isOwnBold()); + iconTextField.setItalic(false);//parentElement.isOwnItalic()); + iconTextField.setUnderline(false);//parentElement.isOwnUnderline()); + iconTextField.setStrikeThrough(false);//parentElement.isOwnStrikeThrough()); + iconTextField.setHorizontalTextAlign(HorizontalTextAlignEnum.CENTER); + iconTextField.setVerticalTextAlign(parentElement.getOwnVerticalTextAlign()); +// JRBoxUtil.copy(parentElement.getLineBox(), iconTextField.getLineBox()); + iconTextField.getLineBox().setLeftPadding(0); + iconTextField.getLineBox().getPen().setLineWidth(0); + iconTextField.getLineBox().getLeftPen().setLineWidth(0); + iconTextField.getLineBox().getRightPen().setLineWidth(0); + iconTextField.getLineBox().getTopPen().setLineWidth(0); + iconTextField.getLineBox().getBottomPen().setLineWidth(0); + iconTextField.getLineBox().setRightPadding(0); + iconTextField.getLineBox().getPen().setLineWidth(0); + iconTextField.getLineBox().getLeftPen().setLineWidth(0); + iconTextField.getLineBox().getRightPen().setLineWidth(0); + iconTextField.getLineBox().getTopPen().setLineWidth(0); + iconTextField.getLineBox().getBottomPen().setLineWidth(0); + + iconLabelComponent.setIconTextField(iconTextField); + + componentElement.setComponent(iconLabelComponent); + + return componentElement; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentXmlWriter.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentXmlWriter.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentXmlWriter.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelComponentXmlWriter.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,112 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import java.io.IOException; + +import net.sf.jasperreports.components.ComponentsXmlWriter; +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.component.ComponentKey; +import net.sf.jasperreports.engine.component.ComponentXmlWriter; +import net.sf.jasperreports.engine.component.ComponentsEnvironment; +import net.sf.jasperreports.engine.util.JRXmlWriteHelper; +import net.sf.jasperreports.engine.util.VersionComparator; +import net.sf.jasperreports.engine.util.XmlNamespace; +import net.sf.jasperreports.engine.xml.JRXmlWriter; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelComponentXmlWriter implements ComponentXmlWriter +{ + private final JasperReportsContext jasperReportsContext; + private final VersionComparator versionComparator; + + /** + * + */ + public IconLabelComponentXmlWriter(JasperReportsContext jasperReportsContext) + { + this.jasperReportsContext = jasperReportsContext; + this.versionComparator = new VersionComparator(); + } + + + @Override + public boolean isToWrite(JRComponentElement componentElement, JRXmlWriter reportWriter) + { + String version = ComponentsXmlWriter.getVersion(jasperReportsContext, componentElement, reportWriter); + return isNewerVersionOrEqual(version, JRConstants.VERSION_4_1_1); + } + + + @Override + public void writeToXml(JRComponentElement componentElement, JRXmlWriter reportWriter) throws IOException + { + Component component = componentElement.getComponent(); + if (component instanceof IconLabelComponent) { + IconLabelComponent iconLabelComponent = (IconLabelComponent) component; + ComponentKey componentKey = componentElement.getComponentKey(); + writeIconLabelComponent(iconLabelComponent, componentKey, reportWriter); + } + } + + protected void writeIconLabelComponent(IconLabelComponent iconLabelComponent, ComponentKey componentKey, + JRXmlWriter reportWriter) throws IOException { + JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); + + String namespaceURI = componentKey.getNamespace(); + String schemaLocation = + ComponentsEnvironment.getInstance(jasperReportsContext) + .getBundle(namespaceURI).getXmlParser().getPublicSchemaLocation(); + XmlNamespace componentNamespace = new XmlNamespace(namespaceURI, componentKey.getNamespacePrefix(), + schemaLocation); + + writer.startElement("iconLabel", componentNamespace); + + writer.addAttribute(IconLabelComponent.PROPERTY_ICON_POSITION, iconLabelComponent.getIconPosition()); + writer.addAttribute(IconLabelComponent.PROPERTY_LABEL_FILL, iconLabelComponent.getLabelFill()); + writer.addAttribute(IconLabelComponent.PROPERTY_HORIZONTAL_ALIGNMENT, iconLabelComponent.getOwnHorizontalImageAlign()); + writer.addAttribute(IconLabelComponent.PROPERTY_VERTICAL_ALIGNMENT, iconLabelComponent.getOwnVerticalImageAlign()); + + reportWriter.writeBox(iconLabelComponent.getLineBox(), JRXmlWriter.JASPERREPORTS_NAMESPACE); + writer.startElement("label", componentNamespace); + reportWriter.writeTextField(iconLabelComponent.getLabelTextField()); + writer.closeElement(); + writer.startElement("icon", componentNamespace); + reportWriter.writeTextField(iconLabelComponent.getIconTextField()); + writer.closeElement(); + + writer.closeElement(); + } + + protected boolean isNewerVersionOrEqual(String currentVersion, String oldVersion) + { + return versionComparator.compare(currentVersion, oldVersion) >= 0; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelDirectionEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelDirectionEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelDirectionEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelDirectionEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,68 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public enum IconLabelDirectionEnum implements NamedEnum +{ + /** + * + */ + HORIZONTAL("Horizontal"), + + /** + * + */ + VERTICAL("Vertical"); + + /** + * + */ + private final transient String name; + + private IconLabelDirectionEnum(String name) + { + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static IconLabelDirectionEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementCsvHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementCsvHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementCsvHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementCsvHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRPrintText; +import net.sf.jasperreports.engine.export.GenericElementCsvHandler; +import net.sf.jasperreports.engine.export.JRCsvExporter; +import net.sf.jasperreports.engine.export.JRCsvExporterContext; +import net.sf.jasperreports.engine.util.JRStyledText; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelElementCsvHandler implements GenericElementCsvHandler +{ + private static final IconLabelElementCsvHandler INSTANCE = new IconLabelElementCsvHandler(); + + public static IconLabelElementCsvHandler getInstance() + { + return INSTANCE; + } + + @Override + public String getTextValue(JRCsvExporterContext exporterContext, JRGenericPrintElement element) + { + JRPrintText labelPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT); + if (labelPrintText == null) + { + return null; + } + + String text = null; + + JRStyledText styledText = ((JRCsvExporter)exporterContext.getExporterRef()).getStyledText(labelPrintText); + if (styledText == null) + { + text = ""; + } + else + { + text = styledText.getText(); + } + + return text; + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementDocxHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementDocxHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementDocxHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementDocxHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,74 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRPrintText; +import net.sf.jasperreports.engine.export.JRExporterGridCell; +import net.sf.jasperreports.engine.export.ooxml.GenericElementDocxHandler; +import net.sf.jasperreports.engine.export.ooxml.JRDocxExporter; +import net.sf.jasperreports.engine.export.ooxml.JRDocxExporterContext; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelElementDocxHandler implements GenericElementDocxHandler +{ + private static final IconLabelElementDocxHandler INSTANCE = new IconLabelElementDocxHandler(); + + public static IconLabelElementDocxHandler getInstance() + { + return INSTANCE; + } + + + @Override + public void exportElement( + JRDocxExporterContext exporterContext, + JRGenericPrintElement element, + JRExporterGridCell gridCell + ) + { + JRPrintText labelPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT); + if (labelPrintText != null) + { + try + { + JRDocxExporter exporter = (JRDocxExporter)exporterContext.getExporterRef(); + exporter.exportText(exporterContext.getTableHelper(), labelPrintText, gridCell); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementGraphics2DHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementGraphics2DHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementGraphics2DHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementGraphics2DHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,111 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import java.awt.Graphics2D; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRLineBox; +import net.sf.jasperreports.engine.JRPrintText; +import net.sf.jasperreports.engine.base.JRBasePrintFrame; +import net.sf.jasperreports.engine.export.GenericElementGraphics2DHandler; +import net.sf.jasperreports.engine.export.JRGraphics2DExporter; +import net.sf.jasperreports.engine.export.JRGraphics2DExporterContext; +import net.sf.jasperreports.engine.export.draw.FrameDrawer; +import net.sf.jasperreports.engine.export.draw.Offset; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class IconLabelElementGraphics2DHandler implements GenericElementGraphics2DHandler +{ + private static final IconLabelElementGraphics2DHandler INSTANCE = new IconLabelElementGraphics2DHandler(); + + public static IconLabelElementGraphics2DHandler getInstance() + { + return INSTANCE; + } + + + @Override + public void exportElement( + JRGraphics2DExporterContext exporterContext, + JRGenericPrintElement element, + Graphics2D grx, + Offset offset) + { + try + { + JRPrintText labelPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT); + if (labelPrintText == null) //FIXMEINPUT deal with xml serialization + { + return; + } + + JRBasePrintFrame frame = new JRBasePrintFrame(element.getDefaultStyleProvider()); + frame.setX(element.getX()); + frame.setY(element.getY()); + frame.setWidth(element.getWidth()); + frame.setHeight(element.getHeight()); + frame.setStyle(element.getStyle()); + frame.setBackcolor(element.getBackcolor()); + frame.setForecolor(element.getForecolor()); + frame.setMode(element.getModeValue()); + JRLineBox lineBox = (JRLineBox)element.getParameterValue(IconLabelElement.PARAMETER_LINE_BOX); + if (lineBox != null) + { + frame.copyBox(lineBox); + } + + frame.addElement(labelPrintText); + + JRPrintText iconPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_ICON_TEXT_ELEMENT); + if (iconPrintText != null) //FIXMEINPUT deal with xml serialization + { + frame.addElement(iconPrintText); + } + + JRGraphics2DExporter exporter = (JRGraphics2DExporter)exporterContext.getExporterRef(); + + FrameDrawer frameDrawer = exporter.getDrawVisitor().getFrameDrawer(); + frameDrawer.draw( + grx, + frame, + offset.getX(), + offset.getY() + ); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementHtmlHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementHtmlHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementHtmlHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementHtmlHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,146 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRLineBox; +import net.sf.jasperreports.engine.JRPrintElement; +import net.sf.jasperreports.engine.JRPrintText; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBasePrintFrame; +import net.sf.jasperreports.engine.export.GenericElementHtmlHandler; +import net.sf.jasperreports.engine.export.HtmlExporter; +import net.sf.jasperreports.engine.export.JRHtmlExporterContext; +import net.sf.jasperreports.export.Exporter; +import net.sf.jasperreports.export.ExporterInput; +import net.sf.jasperreports.export.HtmlExporterConfiguration; +import net.sf.jasperreports.export.HtmlReportConfiguration; +import net.sf.jasperreports.export.HtmlExporterOutput; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelElementHtmlHandler implements GenericElementHtmlHandler +{ + private static final IconLabelElementHtmlHandler INSTANCE = new IconLabelElementHtmlHandler(); + + public static IconLabelElementHtmlHandler getInstance() + { + return INSTANCE; + } + + @Override + public String getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element) + { + JRPrintText labelPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT); + if (labelPrintText == null) + { + return null; + } + + JRBasePrintFrame frame = new JRBasePrintFrame(element.getDefaultStyleProvider()); + frame.setX(element.getX()); + frame.setY(element.getY()); + frame.setWidth(element.getWidth()); + frame.setHeight(element.getHeight()); + frame.setStyle(element.getStyle()); + frame.setBackcolor(element.getBackcolor()); + frame.setForecolor(element.getForecolor()); + frame.setMode(element.getModeValue()); + JRLineBox lineBox = (JRLineBox)element.getParameterValue(IconLabelElement.PARAMETER_LINE_BOX); + if (lineBox != null) + { + frame.copyBox(lineBox); + } + + frame.addElement(labelPrintText); + + JRPrintText iconPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_ICON_TEXT_ELEMENT); + if (iconPrintText != null) + { + frame.addElement(iconPrintText); + } + + Exporter exporter = context.getExporterRef(); + HtmlExporter htmlExporter = exporter instanceof HtmlExporter ? (HtmlExporter)exporter : null; + if (htmlExporter == null) + { + xhtmlExport(exporter, frame); + } + else + { + List elements = new ArrayList(); + elements.add(frame); + + try + { + htmlExporter.exportElements(elements); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + return ""; + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } + + @SuppressWarnings("deprecation") + private void xhtmlExport( + Exporter exporter, + JRBasePrintFrame frame + ) + { + net.sf.jasperreports.engine.export.JRXhtmlExporter xhtmlExporter = + exporter instanceof net.sf.jasperreports.engine.export.JRXhtmlExporter + ? (net.sf.jasperreports.engine.export.JRXhtmlExporter)exporter + : null; + if (xhtmlExporter != null) + { + try + { + xhtmlExporter.exportFrame(frame); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElement.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElement.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElement.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElement.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.JRGenericElementType; +import net.sf.jasperreports.engine.xml.JRXmlConstants; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface IconLabelElement +{ + public static final String ELEMENT_NAME = "iconLabel"; + public static final JRGenericElementType ICONLABEL_ELEMENT_TYPE = new JRGenericElementType(JRXmlConstants.JASPERREPORTS_NAMESPACE, ELEMENT_NAME); + + public static final String PARAMETER_LINE_BOX = "lineBox"; + public static final String PARAMETER_LABEL_TEXT_ELEMENT = "labelTextElement"; + public static final String PARAMETER_ICON_TEXT_ELEMENT = "iconTextElement"; +} \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementJExcelApiHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementJExcelApiHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementJExcelApiHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementJExcelApiHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,76 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRPrintText; +import net.sf.jasperreports.engine.export.JRExporterGridCell; +import net.sf.jasperreports.engine.export.JRGridLayout; + + +/** + * @deprecated To be removed. + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelElementJExcelApiHandler implements net.sf.jasperreports.engine.export.GenericElementJExcelApiHandler +{ + private static final IconLabelElementJExcelApiHandler INSTANCE = new IconLabelElementJExcelApiHandler(); + + public static IconLabelElementJExcelApiHandler getInstance() + { + return INSTANCE; + } + + + @Override + public void exportElement( + net.sf.jasperreports.engine.export.JExcelApiExporterContext exporterContext, + JRGenericPrintElement element, JRExporterGridCell gridCell, + int colIndex, int rowIndex, int emptyCols, int yCutsRow, + JRGridLayout layout + ) + { + JRPrintText labelPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT); + if (labelPrintText != null) + { + try + { + net.sf.jasperreports.engine.export.JExcelApiExporter exporter = + (net.sf.jasperreports.engine.export.JExcelApiExporter)exporterContext.getExporter(); + exporter.exportText(labelPrintText, gridCell, colIndex, rowIndex); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementOdsHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementOdsHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementOdsHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementOdsHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,76 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRPrintText; +import net.sf.jasperreports.engine.export.JRExporterGridCell; +import net.sf.jasperreports.engine.export.JRGridLayout; +import net.sf.jasperreports.engine.export.oasis.GenericElementOdsHandler; +import net.sf.jasperreports.engine.export.oasis.JROdsExporter; +import net.sf.jasperreports.engine.export.oasis.JROdsExporterContext; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelElementOdsHandler implements GenericElementOdsHandler +{ + private static final IconLabelElementOdsHandler INSTANCE = new IconLabelElementOdsHandler(); + + public static IconLabelElementOdsHandler getInstance() + { + return INSTANCE; + } + + + @Override + public void exportElement( + JROdsExporterContext exporterContext, + JRGenericPrintElement element, JRExporterGridCell gridCell, + int colIndex, int rowIndex, int emptyCols, int yCutsRow, + JRGridLayout layout + ) + { + JRPrintText labelPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT); + if (labelPrintText != null) + { + try + { + JROdsExporter exporter = (JROdsExporter)exporterContext.getExporterRef(); + exporter.exportText(labelPrintText, gridCell, colIndex, rowIndex); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementOdtHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementOdtHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementOdtHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementOdtHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRPrintText; +import net.sf.jasperreports.engine.export.JRExporterGridCell; +import net.sf.jasperreports.engine.export.oasis.GenericElementOdtHandler; +import net.sf.jasperreports.engine.export.oasis.JROdtExporter; +import net.sf.jasperreports.engine.export.oasis.JROdtExporterContext; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelElementOdtHandler implements GenericElementOdtHandler +{ + private static final IconLabelElementOdtHandler INSTANCE = new IconLabelElementOdtHandler(); + + public static IconLabelElementOdtHandler getInstance() + { + return INSTANCE; + } + + @Override + public void exportElement( + JROdtExporterContext exporterContext, + JRGenericPrintElement element, + JRExporterGridCell gridCell + ) + { + JRPrintText labelPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT); + if (labelPrintText != null) + { + try + { + JROdtExporter exporter = (JROdtExporter)exporterContext.getExporterRef(); + exporter.exportText(exporterContext.getTableBuilder(), labelPrintText, gridCell); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementPdfHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementPdfHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementPdfHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementPdfHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,88 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRLineBox; +import net.sf.jasperreports.engine.JRPrintText; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBasePrintFrame; +import net.sf.jasperreports.engine.export.GenericElementPdfHandler; +import net.sf.jasperreports.engine.export.JRPdfExporter; +import net.sf.jasperreports.engine.export.JRPdfExporterContext; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelElementPdfHandler implements GenericElementPdfHandler +{ + @Override + public void exportElement(JRPdfExporterContext exporterContext, JRGenericPrintElement element) + { + JRPrintText labelPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT); + if (labelPrintText == null) //FIXMEINPUT deal with xml serialization + { + return; + } + + JRBasePrintFrame frame = new JRBasePrintFrame(element.getDefaultStyleProvider()); + frame.setX(element.getX()); + frame.setY(element.getY()); + frame.setWidth(element.getWidth()); + frame.setHeight(element.getHeight()); + frame.setStyle(element.getStyle()); + frame.setBackcolor(element.getBackcolor()); + frame.setForecolor(element.getForecolor()); + frame.setMode(element.getModeValue()); + JRLineBox lineBox = (JRLineBox)element.getParameterValue(IconLabelElement.PARAMETER_LINE_BOX); + if (lineBox != null) + { + frame.copyBox(lineBox); + } + + frame.addElement(labelPrintText); + + JRPrintText iconPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_ICON_TEXT_ELEMENT); + if (iconPrintText != null) //FIXMEINPUT deal with xml serialization + { + frame.addElement(iconPrintText); + } + + JRPdfExporter exporter = (JRPdfExporter)exporterContext.getExporterRef(); + try + { + exporter.exportFrame(frame); + } + catch(Exception e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementPptxHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementPptxHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementPptxHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementPptxHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,98 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRLineBox; +import net.sf.jasperreports.engine.JRPrintText; +import net.sf.jasperreports.engine.base.JRBasePrintFrame; +import net.sf.jasperreports.engine.export.ooxml.GenericElementPptxHandler; +import net.sf.jasperreports.engine.export.ooxml.JRPptxExporter; +import net.sf.jasperreports.engine.export.ooxml.JRPptxExporterContext; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelElementPptxHandler implements GenericElementPptxHandler +{ + private static final IconLabelElementPptxHandler INSTANCE = new IconLabelElementPptxHandler(); + + public static IconLabelElementPptxHandler getInstance() + { + return INSTANCE; + } + + @Override + public void exportElement( + JRPptxExporterContext exporterContext, + JRGenericPrintElement element + ) + { + JRPrintText labelPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT); + if (labelPrintText == null) //FIXMEINPUT deal with xml serialization + { + return; + } + + JRBasePrintFrame frame = new JRBasePrintFrame(element.getDefaultStyleProvider()); + frame.setX(element.getX()); + frame.setY(element.getY()); + frame.setWidth(element.getWidth()); + frame.setHeight(element.getHeight()); + frame.setStyle(element.getStyle()); + frame.setBackcolor(element.getBackcolor()); + frame.setForecolor(element.getForecolor()); + frame.setMode(element.getModeValue()); + JRLineBox lineBox = (JRLineBox)element.getParameterValue(IconLabelElement.PARAMETER_LINE_BOX); + if (lineBox != null) + { + frame.copyBox(lineBox); + } + + frame.addElement(labelPrintText); + + JRPrintText iconPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_ICON_TEXT_ELEMENT); + if (iconPrintText != null) //FIXMEINPUT deal with xml serialization + { + frame.addElement(iconPrintText); + } + + try + { + JRPptxExporter exporter = (JRPptxExporter)exporterContext.getExporterRef(); + exporter.exportFrame(frame); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementRtfHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementRtfHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementRtfHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementRtfHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,100 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRLineBox; +import net.sf.jasperreports.engine.JRPrintText; +import net.sf.jasperreports.engine.base.JRBasePrintFrame; +import net.sf.jasperreports.engine.export.GenericElementRtfHandler; +import net.sf.jasperreports.engine.export.JRRtfExporter; +import net.sf.jasperreports.engine.export.JRRtfExporterContext; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelElementRtfHandler implements GenericElementRtfHandler +{ + private static final IconLabelElementRtfHandler INSTANCE = new IconLabelElementRtfHandler(); + + public static IconLabelElementRtfHandler getInstance() + { + return INSTANCE; + } + + + @Override + public void exportElement( + JRRtfExporterContext exporterContext, + JRGenericPrintElement element + ) + { + JRPrintText labelPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT); + if (labelPrintText == null) //FIXMEINPUT deal with xml serialization + { + return; + } + + JRBasePrintFrame frame = new JRBasePrintFrame(element.getDefaultStyleProvider()); + frame.setX(element.getX()); + frame.setY(element.getY()); + frame.setWidth(element.getWidth()); + frame.setHeight(element.getHeight()); + frame.setStyle(element.getStyle()); + frame.setBackcolor(element.getBackcolor()); + frame.setForecolor(element.getForecolor()); + frame.setMode(element.getModeValue()); + JRLineBox lineBox = (JRLineBox)element.getParameterValue(IconLabelElement.PARAMETER_LINE_BOX); + if (lineBox != null) + { + frame.copyBox(lineBox); + } + + frame.addElement(labelPrintText); + +// JRPrintText iconPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_ICON_TEXT_ELEMENT); +// if (iconPrintText != null) //FIXMEINPUT deal with xml serialization +// { +// frame.addElement(iconPrintText); +// } + + try + { + JRRtfExporter exporter = (JRRtfExporter)exporterContext.getExporterRef(); + exporter.exportFrame(frame); +// exporter.exportText(labelPrintText); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementXlsHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementXlsHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementXlsHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementXlsHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRPrintText; +import net.sf.jasperreports.engine.export.GenericElementXlsHandler; +import net.sf.jasperreports.engine.export.JRExporterGridCell; +import net.sf.jasperreports.engine.export.JRGridLayout; +import net.sf.jasperreports.engine.export.JRXlsExporter; +import net.sf.jasperreports.engine.export.JRXlsExporterContext; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelElementXlsHandler implements GenericElementXlsHandler +{ + private static final IconLabelElementXlsHandler INSTANCE = new IconLabelElementXlsHandler(); + + public static IconLabelElementXlsHandler getInstance() + { + return INSTANCE; + } + + @Override + public void exportElement( + JRXlsExporterContext exporterContext, + JRGenericPrintElement element, JRExporterGridCell gridCell, + int colIndex, int rowIndex, int emptyCols, int yCutsRow, + JRGridLayout layout + ) + { + JRPrintText labelPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT); + if (labelPrintText != null) + { + try + { + JRXlsExporter exporter = (JRXlsExporter)exporterContext.getExporterRef(); + exporter.exportText(labelPrintText, gridCell, colIndex, rowIndex); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementXlsxHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementXlsxHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementXlsxHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementXlsxHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,83 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRPrintImage; +import net.sf.jasperreports.engine.JRPrintText; +import net.sf.jasperreports.engine.export.JRExporterGridCell; +import net.sf.jasperreports.engine.export.ooxml.GenericElementXlsxHandler; +import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter; +import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporterContext; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelElementXlsxHandler implements GenericElementXlsxHandler +{ + private static final IconLabelElementXlsxHandler INSTANCE = new IconLabelElementXlsxHandler(); + + public static IconLabelElementXlsxHandler getInstance() + { + return INSTANCE; + } + + + @Override + public void exportElement( + JRXlsxExporterContext exporterContext, + JRGenericPrintElement element, JRExporterGridCell gridCell, + int colIndex, int rowIndex + ) throws JRException + { + JRPrintText labelPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT); + if (labelPrintText != null) + { + try + { + JRXlsxExporter exporter = (JRXlsxExporter)exporterContext.getExporterRef(); + exporter.exportText(labelPrintText, gridCell, colIndex, rowIndex); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } + + @Override + public JRPrintImage getImage(JRXlsxExporterContext exporterContext, + JRGenericPrintElement element) throws JRException { + // TODO Auto-generated method stub + return null; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementXmlHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementXmlHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementXmlHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconLabelElementXmlHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,105 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import java.io.IOException; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRLineBox; +import net.sf.jasperreports.engine.JRPrintText; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBasePrintFrame; +import net.sf.jasperreports.engine.export.GenericElementXmlHandler; +import net.sf.jasperreports.engine.export.JRXmlExporter; +import net.sf.jasperreports.engine.export.JRXmlExporterContext; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconLabelElementXmlHandler implements GenericElementXmlHandler +{ + private static final IconLabelElementXmlHandler INSTANCE = new IconLabelElementXmlHandler(); + + public static IconLabelElementXmlHandler getInstance() + { + return INSTANCE; + } + + + @Override + public void exportElement(JRXmlExporterContext exporterContext, JRGenericPrintElement element) + { + JRPrintText labelPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT); + if (labelPrintText == null) + { + return; + } + + JRBasePrintFrame frame = new JRBasePrintFrame(element.getDefaultStyleProvider()); + frame.setX(element.getX()); + frame.setY(element.getY()); + frame.setWidth(element.getWidth()); + frame.setHeight(element.getHeight()); + frame.setStyle(element.getStyle()); + frame.setBackcolor(element.getBackcolor()); + frame.setForecolor(element.getForecolor()); + frame.setMode(element.getModeValue()); + JRLineBox lineBox = (JRLineBox)element.getParameterValue(IconLabelElement.PARAMETER_LINE_BOX); + if (lineBox != null) + { + frame.copyBox(lineBox); + } + + frame.addElement(labelPrintText); + + JRPrintText iconPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_ICON_TEXT_ELEMENT); + if (iconPrintText != null) + { + frame.addElement(iconPrintText); + } + + JRXmlExporter exporter = (JRXmlExporter)exporterContext.getExporterRef(); + + try + { + exporter.exportElement(frame); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + catch (IOException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconPositionEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconPositionEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconPositionEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconPositionEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,68 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public enum IconPositionEnum implements NamedEnum +{ + /** + * + */ + START("Start"), + + /** + * + */ + END("End"); + + /** + * + */ + private final transient String name; + + private IconPositionEnum(String name) + { + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static IconPositionEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconTextFieldFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconTextFieldFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconTextFieldFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/IconTextFieldFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.design.JRDesignTextField; +import net.sf.jasperreports.engine.xml.JRTextFieldFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class IconTextFieldFactory extends JRTextFieldFactory +{ + + @Override + public JRDesignTextField getTextField() + { + IconLabelComponent iconLabelComponent = (IconLabelComponent)digester.peek(); + JRDesignTextField labelTextField = (JRDesignTextField)iconLabelComponent.getIconTextField(); + return labelTextField; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/LabelTextFieldFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/LabelTextFieldFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/LabelTextFieldFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/LabelTextFieldFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.iconlabel; + +import net.sf.jasperreports.engine.design.JRDesignTextField; +import net.sf.jasperreports.engine.xml.JRTextFieldFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class LabelTextFieldFactory extends JRTextFieldFactory +{ + + @Override + public JRDesignTextField getTextField() + { + IconLabelComponent iconLabelComponent = (IconLabelComponent)digester.peek(); + JRDesignTextField labelTextField = (JRDesignTextField)iconLabelComponent.getLabelTextField(); + return labelTextField; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/iconlabel/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/iconlabel/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,28 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** +* Contains classes for the built-in Icon Label component. +*/ +package net.sf.jasperreports.components.iconlabel; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/fill/FillItemData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/fill/FillItemData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/fill/FillItemData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/fill/FillItemData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,152 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.items.fill; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.components.items.Item; +import net.sf.jasperreports.components.items.ItemData; +import net.sf.jasperreports.engine.JRElementDataset; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.component.FillContextProvider; +import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public abstract class FillItemData +{ + + /** + * + */ + protected ItemData itemData; + protected List itemsList; + protected FillItemDataset fillItemDataset; + protected FillContextProvider fillContextProvider; + private List> evaluatedItems = null; + + /** + * + */ + public FillItemData( + FillContextProvider fillContextProvider, + ItemData itemData, + JRFillObjectFactory factory + )// throws JRException + { + factory.put(itemData, this); + + this.itemData = itemData; + this.fillContextProvider = fillContextProvider; + + if (itemData.getDataset() != null) + { + fillItemDataset = new FillItemDataset(this, factory); + } + + /* */ + List srcItemList = itemData.getItems(); + if (srcItemList != null && !srcItemList.isEmpty()) + { + itemsList = new ArrayList(); + for(Item item : srcItemList) + { + if(item != null) + { + itemsList.add(getFillItem(item, factory)); + } + } + } + } + + /** + * + */ + public JRElementDataset getDataset() + { + return itemData.getDataset(); + } + + /** + * + */ + public void evaluateItems(JRFillExpressionEvaluator evaluator, byte evaluation) throws JRException + { + if (itemsList != null) + { + for(FillItem item : itemsList) + { + item.evaluateProperties(evaluator, evaluation); + } + } + } + + /** + * + */ + public List> getEvaluateItems(byte evaluation) throws JRException + { + if (fillItemDataset != null) + { + fillItemDataset.setEvaluation(evaluation); + fillItemDataset.evaluateDatasetRun(evaluation); + } + else if (itemsList != null) + { + if (getDataset() == null) + { + evaluateItems(fillContextProvider.getFillContext(), evaluation); + } + + addEvaluateItems(); + } + + return evaluatedItems; + } + + /** + * + */ + public void addEvaluateItems() + { + if (itemsList != null) + { + if (evaluatedItems == null || getDataset() == null) + { + evaluatedItems = new ArrayList>(); + } + + for(FillItem item : itemsList) + { + evaluatedItems.add(item.getEvaluatedProperties()); + } + } + } + + public abstract FillItem getFillItem(Item item, JRFillObjectFactory factory); +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/fill/FillItemDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/fill/FillItemDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/fill/FillItemDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/fill/FillItemDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,139 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.items.fill; + +import net.sf.jasperreports.components.items.fill.FillItemData; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.fill.JRCalculator; +import net.sf.jasperreports.engine.fill.JRExpressionEvalException; +import net.sf.jasperreports.engine.fill.JRFillElementDataset; +import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class FillItemDataset extends JRFillElementDataset +{ + + protected final FillItemData itemData; +// protected List markerList; + //protected List> evaluatedMarkers; + protected JRFillExpressionEvaluator evaluator; + protected byte evaluation = JRExpression.EVALUATION_DEFAULT; + + public FillItemDataset(FillItemData itemData, JRFillObjectFactory factory) + { + super(itemData.getDataset(), factory); + + this.itemData = itemData; + + factory.registerElementDataset(this); + } + + @Override + protected void customEvaluate(JRCalculator calculator) + throws JRExpressionEvalException + { + try + { + itemData.evaluateItems(calculator, evaluation); +// if(markerList != null && ! markerList.isEmpty()) +// { +// for (FillMarker marker : markerList) +// { +// marker.evaluateProperties(calculator, evaluation); +// } +// } + } + catch (JRExpressionEvalException e) + { + throw e; + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + protected void customIncrement() + { +// if(markerList != null && ! markerList.isEmpty()) { +// for (FillMarker marker : markerList) +// { +// Map evaluatedProperties = marker.getEvaluatedProperties(); +// if (evaluatedProperties != null) +// { +// if(evaluatedMarkers == null) { +// evaluatedMarkers = new ArrayList>(); +// } +// evaluatedMarkers.add(evaluatedProperties); +// } +// } +// } + itemData.addEvaluateItems(); + } + + @Override + protected void customInitialize() + { + //evaluatedMarkers = null; + } + + @Override + public void collectExpressions(JRExpressionCollector collector) + { + //MapCompiler.collectExpressions(markerDataset, collector); + } + + @Override + public void increment() + { + super.increment(); + } + +// public List> getEvaluatedMarkers() +// { +// return evaluatedMarkers; +// } + + /** + * @return the evaluation + */ + public byte getEvaluation() { + return evaluation; + } + + /** + * @param evaluation the evaluation to set + */ + public void setEvaluation(byte evaluation) { + this.evaluation = evaluation; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/fill/FillItem.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/fill/FillItem.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/fill/FillItem.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/fill/FillItem.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,126 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.items.fill; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.components.items.Item; +import net.sf.jasperreports.components.items.ItemProperty; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public abstract class FillItem implements Item +{ + + /** + * + */ + protected Item item; + protected Map evaluatedProperties; + + /** + * + */ + public FillItem( + Item item, + JRFillObjectFactory factory + ) + { + factory.put(item, this); + + this.item = item; + } + + + /** + * + */ + public void evaluateProperties(JRFillExpressionEvaluator evaluator, byte evaluation) throws JRException + { + List itemProperties = getProperties(); + Map result = null; + if(itemProperties != null && !itemProperties.isEmpty()) + { + result = new HashMap(); + for(ItemProperty property : itemProperties) + { + result.put(property.getName(), getEvaluatedValue(property, evaluator, evaluation)); + } + } + + //if some of the item properties are conditioning each other + verifyValues(result); + evaluatedProperties = result; + } + + + @Override + public Object clone() + { + throw new UnsupportedOperationException(); + } + + @Override + public List getProperties() + { + return item.getProperties(); + } + + public Map getEvaluatedProperties() + { + return evaluatedProperties; + } + + public Object getEvaluatedValue(ItemProperty property, JRFillExpressionEvaluator evaluator, byte evaluation) throws JRException + { + Object result = null; + if( + property.getValueExpression() == null + || property.getValueExpression().getText() == null + || property.getValueExpression().getText().trim().length() == 0 + ) + { + result = property.getValue(); + } + else + { + result = evaluator.evaluate(property.getValueExpression(), evaluation); + } + + verifyValue(property, result); + + return result; + } + + public abstract void verifyValue(ItemProperty property, Object value) throws JRException; + + public abstract void verifyValues(Map result) throws JRException; +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/fill/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/fill/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/fill/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/fill/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,28 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** + * Contains classes and interfaces for filling the item based components. + */ +package net.sf.jasperreports.components.items.fill; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/ItemCompiler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/ItemCompiler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/ItemCompiler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/ItemCompiler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,129 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.items; + +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.engine.JRDatasetRun; +import net.sf.jasperreports.engine.JRElementDataset; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.design.JRVerifier; + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class ItemCompiler +{ + + public static void collectExpressions(ItemData data, JRExpressionCollector collector) + { + if (data != null) + { + JRExpressionCollector datasetCollector = collector; + + JRElementDataset dataset = data.getDataset(); + JRDatasetRun datasetRun = dataset == null ? null : dataset.getDatasetRun(); + if (datasetRun != null) + { + collector.collect(datasetRun); + datasetCollector = collector.getDatasetCollector(datasetRun.getDatasetName()); + } + + List items = data.getItems(); + if (items != null && !items.isEmpty()) + { + for(Item item : items) + { + List itemProperties = item.getProperties(); + if(itemProperties != null) + { + for(ItemProperty property : itemProperties) + { + datasetCollector.addExpression(property.getValueExpression()); + } + } + } + } + } + } + + public static void verifyItemData(JRVerifier verifier, ItemData itemData, String itemName, String[] requiredNames, Map alternativeNamesMap) + { + if (itemData.getDataset() != null) + { + verifier.verifyElementDataset(itemData.getDataset()); + } + + List items = itemData.getItems(); + if (items != null) + { + for (Item item : items) + { + verifyItem(verifier, item, itemName, requiredNames, alternativeNamesMap); + } + } + } + + /** + * Verifies if required properties or their alternatives are present in the item properties list. Alternative + * property names are read from the alternativeNamesMap parameter. + *
    + * For instance, a required latitude property can be provided either directly, using the latitude item + * property, or by processing the alternative address property. If at least one of the latitude + * or address properties are present in the item properties list, the latitude requirement is fulfilled. + * + * @param verifier + * @param item + * @param itemName + * @param requiredNames + * @param alternativeNamesMap + */ + public static void verifyItem(JRVerifier verifier, Item item, String itemName, String[] requiredNames, Map alternativeNamesMap) + { + if(requiredNames != null && requiredNames.length > 0){ + List itemProperties = item.getProperties(); + if (itemProperties != null && !itemProperties.isEmpty()) + { + for (String reqName :requiredNames) + { + boolean hasProperty = false; + for(ItemProperty itemProperty : itemProperties) { + if (itemProperty.getName().equals(reqName) + || (alternativeNamesMap != null && itemProperty.getName().equals(alternativeNamesMap.get(reqName)))) { + hasProperty = true; + break; + } + } + if(!hasProperty) + { + verifier.addBrokenRule("No '" + reqName + "' property set for the " + itemName + " item.", itemProperties); + } + } + } + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/ItemData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/ItemData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/ItemData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/ItemData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.items; + +import java.util.List; + +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRElementDataset; + +/** + * The ItemData interface + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface ItemData extends JRCloneable +{ + + /** + * Returns a list of {@link Item Item} + * objects. Each item in the list provides a collection of item properties. + * + * @return a list of items + * + * @see Item + * @see ItemProperty + */ + public List getItems(); + + /** + * Returns the dataset information that will be used by the {@link ItemData ItemData} object. + *

    + * This information is required either to use the main dataset or to instantiate a + * subdataset from the report. The data produced by the subdataset is fed to the items list. + * + * @return the dataset + * @see net.sf.jasperreports.engine.JRElementDataset + */ + public JRElementDataset getDataset(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/ItemDatasetFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/ItemDatasetFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/ItemDatasetFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/ItemDatasetFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.items; + +import net.sf.jasperreports.engine.design.JRDesignElementDataset; +import net.sf.jasperreports.engine.xml.JRElementDatasetFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class ItemDatasetFactory extends JRElementDatasetFactory +{ + + @Override + public JRDesignElementDataset getDataset() + { + return new JRDesignElementDataset(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/ItemDataXmlFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/ItemDataXmlFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/ItemDataXmlFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/ItemDataXmlFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.items; + +import net.sf.jasperreports.components.items.StandardItemData; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class ItemDataXmlFactory extends JRBaseFactory +{ + @Override + public Object createObject(Attributes attrs) throws Exception + { + return new StandardItemData(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/Item.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/Item.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/Item.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/Item.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.items; + +import java.util.List; + +import net.sf.jasperreports.engine.JRCloneable; + +/** + * The Item interface. Provides a collection of item properties. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface Item extends JRCloneable +{ + + /** + * Returns a list of {@link ItemProperty ItemProperty} objects. + * Each item property provides a name-value pair. + * + * @return a list of item properties + * @see ItemProperty + */ + public List getProperties(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/ItemProperty.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/ItemProperty.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/ItemProperty.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/ItemProperty.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.items; + +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRExpression; + +/** + * The ItemProperty interface. An item property has a name (required) and a + * value provided either in a static way, using the value attribute, + * or dynamically, using a value expression. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface ItemProperty extends JRCloneable +{ + + /** + * Returns the name of the item property (required). + * @return the property name + */ + String getName(); + + /** + * Returns the value attribute of the item property. Only + * java.lang.String values are allowed for this attribute. + * @return the value attribute + */ + String getValue(); + + /** + * Returns a {@link net.sf.jasperreports.engine.JRExpression JRExpression} representing + * the value object for the item property. If present, it overrides the value given by + * the value attribute. + * + * @return the value expression + */ + JRExpression getValueExpression(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/ItemPropertyXmlFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/ItemPropertyXmlFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/ItemPropertyXmlFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/ItemPropertyXmlFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.items; + +import net.sf.jasperreports.engine.xml.JRBaseFactory; +import net.sf.jasperreports.engine.xml.JRXmlConstants; + +import org.xml.sax.Attributes; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class ItemPropertyXmlFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) + { + StandardItemProperty itemProperty = new StandardItemProperty(); + + String name = atts.getValue(JRXmlConstants.ATTRIBUTE_name); + if(name != null) + { + itemProperty.setName(name); + } + String value = atts.getValue(JRXmlConstants.ATTRIBUTE_value); + if(value != null) + { + itemProperty.setValue(value); + } + return itemProperty; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/ItemXmlFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/ItemXmlFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/ItemXmlFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/ItemXmlFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.items; + +import net.sf.jasperreports.components.items.StandardItem; +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class ItemXmlFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) + { + return new StandardItem(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,28 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** + * Contains classes and interfaces for the item based components. + */ +package net.sf.jasperreports.components.items; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/StandardItemData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/StandardItemData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/StandardItemData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/StandardItemData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,200 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.items; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRElementDataset; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class StandardItemData implements Serializable, ItemData, JRChangeEventsSupport +{//FIXMEMAP implement clone? + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + public static final String PROPERTY_ITEMS = "items"; + public static final String PROPERTY_DATASET = "dataset"; + + private List itemsList = new ArrayList(); + private JRElementDataset dataset; + + private transient JRPropertyChangeSupport eventSupport; + + public StandardItemData() + { + } + + public StandardItemData(ItemData data, JRBaseObjectFactory factory) + { + itemsList = getCompiledItems(data.getItems(), factory); + dataset = factory.getElementDataset(data.getDataset()); + } + + private static List getCompiledItems(List items, JRBaseObjectFactory factory) + { + if (items == null) + { + return null; + } + + List compiledItems = new ArrayList(items.size()); + for (Iterator it = items.iterator(); it.hasNext();) + { + Item item = it.next(); + Item compiledItem = new StandardItem(getCompiledProperties(item.getProperties(), factory)); + compiledItems.add(compiledItem); + } + return compiledItems; + } + + private static List getCompiledProperties(List properties, JRBaseObjectFactory factory) + { + if (properties == null) + { + return null; + } + + List compiledProperties = new ArrayList(properties.size()); + for (Iterator it = properties.iterator(); it.hasNext();) + { + ItemProperty property = it.next(); + ItemProperty compiledProperty = new StandardItemProperty(property.getName(), property.getValue(), factory.getExpression(property.getValueExpression())); + compiledProperties.add(compiledProperty); + } + return compiledProperties; + } + + public void collectExpressions(JRExpressionCollector collector) { + ItemCompiler.collectExpressions(this, collector); + } + + @Override + public List getItems() { + return itemsList; + } + + /** + * + */ + public void addItem(Item item) + { + itemsList.add(item); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_ITEMS, item, itemsList.size() - 1); + } + + /** + * + */ + public void addItem(int index, Item item) + { + if(index >=0 && index < itemsList.size()) + itemsList.add(index, item); + else{ + itemsList.add(item); + index = itemsList.size() - 1; + } + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_ITEMS, itemsList, index); + } + + /** + * + */ + public Item removeItem(Item item) + { + if (item != null) + { + int idx = itemsList.indexOf(item); + if (idx >= 0) + { + itemsList.remove(idx); + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_ITEMS, item, idx); + } + } + return item; + } + + @Override + public JRElementDataset getDataset() + { + return dataset; + } + + /** + * Sets the dataset information that will be used to create the item list. + * + * @param dataset the dataset information + * @see #getDataset() + */ + public void setDataset(JRElementDataset dataset) + { + Object old = this.dataset; + this.dataset = dataset; + getEventSupport().firePropertyChange(PROPERTY_DATASET, old, this.dataset); + } + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + @Override + public Object clone() + { + StandardItemData clone = null; + try + { + clone = (StandardItemData) super.clone(); + } + catch (CloneNotSupportedException e) + { + // never + throw new JRRuntimeException(e); + } + clone.dataset = JRCloneUtils.nullSafeClone(dataset); + clone.itemsList = JRCloneUtils.cloneList(itemsList); + clone.eventSupport = null; + return clone; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/StandardItem.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/StandardItem.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/StandardItem.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/StandardItem.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,111 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.items; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class StandardItem implements Item, JRChangeEventsSupport, Serializable +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + public static final String PROPERTY_ITEM_PROPERTIES = "itemProperties"; + + private transient JRPropertyChangeSupport eventSupport; + + private List properties = new ArrayList(); + + public StandardItem() + { + } + + public StandardItem(List properties) + { + this.properties = properties; + } + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + @Override + public Object clone() + { + StandardItem clone = null; + try + { + clone = (StandardItem) super.clone(); + } + catch (CloneNotSupportedException e) + { + // never + throw new RuntimeException(e); + } + clone.properties = JRCloneUtils.cloneList(properties); + return clone; + } + + @Override + public List getProperties() + { + return properties; + } + + public void addItemProperty(ItemProperty property) + { + properties.add(property); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_ITEM_PROPERTIES, property, properties.size() - 1); + } + + public void removeItemProperty(ItemProperty property) + { + int idx = properties.indexOf(property); + if (idx >= 0) + { + properties.remove(idx); + + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_ITEM_PROPERTIES, + property, idx); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/StandardItemProperty.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/StandardItemProperty.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/items/StandardItemProperty.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/items/StandardItemProperty.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,131 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.items; + +import java.io.Serializable; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class StandardItemProperty implements ItemProperty, JRChangeEventsSupport, Serializable +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_NAME = "name"; + public static final String PROPERTY_VALUE = "value"; + public static final String PROPERTY_VALUE_EXPRESSION = "valueExpression"; + + private transient JRPropertyChangeSupport eventSupport; + + private String name; + private String value; + private JRExpression valueExpression; + + public StandardItemProperty() + { + } + + public StandardItemProperty(String name, String value, JRExpression valueExpression) + { + this.name = name; + this.valueExpression = valueExpression; + this.value = value; + } + + @Override + public String getName() + { + return name; + } + + public void setName(String name) + { + Object old = this.name; + this.name = name; + getEventSupport().firePropertyChange(PROPERTY_NAME, old, this.name); + } + + @Override + public String getValue() + { + return value; + } + + public void setValue(String value) + { + Object old = this.value; + this.value = value; + getEventSupport().firePropertyChange(PROPERTY_VALUE, old, this.value); + } + + @Override + public JRExpression getValueExpression() + { + return valueExpression; + } + + public void setValueExpression(JRExpression valueExpression) + { + Object old = this.valueExpression; + this.valueExpression = valueExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_EXPRESSION, old, this.valueExpression); + } + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + @Override + public Object clone() + { + try + { + StandardItemProperty clone = (StandardItemProperty) super.clone(); + clone.valueExpression = JRCloneUtils.nullSafeClone(valueExpression); + return clone; + } + catch (CloneNotSupportedException e) + { + // never + throw new RuntimeException(e); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/BaseFillList.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/BaseFillList.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/BaseFillList.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/BaseFillList.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,233 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.list; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRPrintElement; +import net.sf.jasperreports.engine.JRPrintElementContainer; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JRStyle; +import net.sf.jasperreports.engine.component.BaseFillComponent; +import net.sf.jasperreports.engine.fill.JRFillCloneFactory; +import net.sf.jasperreports.engine.fill.JRFillCloneable; +import net.sf.jasperreports.engine.fill.JRFillDataset; +import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; +import net.sf.jasperreports.engine.fill.JRTemplateFrame; +import net.sf.jasperreports.engine.fill.JRTemplatePrintFrame; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Base fill list component implementation. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public abstract class BaseFillList extends BaseFillComponent implements JRFillCloneable +{ + + private static final Log log = LogFactory.getLog(BaseFillList.class); + + protected final int contentsHeight; + protected final FillDatasetRun datasetRun; + + protected Map printFrameTemplates = new HashMap(); + protected JRTemplatePrintFrame printFrame; + protected boolean filling; + protected boolean fillStarted; + + public BaseFillList(ListComponent component, JRFillObjectFactory factory) throws JRException + { + ListContents listContents = component.getContents(); + this.contentsHeight = listContents.getHeight(); + + this.datasetRun = new FillDatasetRun(component.getDatasetRun(), factory); + } + + protected BaseFillList(BaseFillList list, JRFillCloneFactory factory) + { + super(list, factory); + + this.contentsHeight = list.contentsHeight; + this.datasetRun = new FillDatasetRun(list.datasetRun, factory); + this.printFrameTemplates = list.printFrameTemplates;//share the templates among clones + } + + protected JRFillExpressionEvaluator createDatasetExpressionEvaluator() + { + return new JRFillExpressionEvaluator() + { + @Override + public Object evaluate(JRExpression expression, + byte evaluationType) throws JRException + { + return datasetRun.evaluateDatasetExpression( + expression, evaluationType); + } + + @Override + public JRFillDataset getFillDataset() + { + return datasetRun.getDataset(); + } + }; + } + + @Override + public void evaluate(byte evaluation) throws JRException + { + if (filling) + { + log.warn("List fill did not complete, closing previous dataset run"); + datasetRun.end(); + } + + filling = false; + fillStarted = false; + + datasetRun.evaluate(evaluation); + } + + protected void createPrintFrame() + { + printFrame = new JRTemplatePrintFrame(getFrameTemplate(), printElementOriginator); + printFrame.setUUID(fillContext.getComponentElement().getUUID()); + printFrame.setX(fillContext.getComponentElement().getX()); + printFrame.setWidth(fillContext.getComponentElement().getWidth()); + } + + protected JRTemplateFrame getFrameTemplate() + { + JRStyle style = fillContext.getElementStyle(); + JRTemplateFrame frameTemplate = printFrameTemplates.get(style); + if (frameTemplate == null) + { + frameTemplate = new JRTemplateFrame( + fillContext.getElementOrigin(), + fillContext.getDefaultStyleProvider()); + frameTemplate.setElement(fillContext.getComponentElement()); + frameTemplate = deduplicate(frameTemplate); + + printFrameTemplates.put(style, frameTemplate); + } + + return frameTemplate; + } + + @Override + public JRPrintElement fill() + { + printFrame.setY(fillContext.getElementPrintY()); + return printFrame; + } + + @Override + public void rewind() + { + try + { + if (filling) + { + // if currently running, close the query + datasetRun.end(); + } + + if (fillStarted) + { + if (log.isDebugEnabled()) + { + log.debug("Rewinding started list"); + } + + // rewind the data source + datasetRun.rewind(); + } + + filling = false; + fillStarted = false; + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + protected static class AppendingPrintElementContainer implements JRPrintElementContainer + { + private final JRPrintElementContainer container; + private final int initialContainerHeight; + private int xOffset; + + public AppendingPrintElementContainer(JRPrintElementContainer container) + { + this.container = container; + this.initialContainerHeight = container.getHeight(); + } + + @Override + public void addElement(JRPrintElement element) + { + if (xOffset > 0) + { + element.setX(element.getX() + xOffset); + } + + element.setY(initialContainerHeight + element.getY()); + container.addElement(element); + } + + @Override + public List getElements() + { + return container.getElements(); + } + + @Override + public int getHeight() + { + throw new UnsupportedOperationException(); + } + + @Override + public void setHeight(int height) + { + int newHeight = initialContainerHeight + height; + if (newHeight > container.getHeight()) + { + container.setHeight(newHeight); + } + } + + public void setXOffset(int xOffset) + { + this.xOffset = xOffset; + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/BaseListContents.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/BaseListContents.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/BaseListContents.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/BaseListContents.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,62 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.list; + +import net.sf.jasperreports.engine.base.JRBaseElementGroup; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; + +/** + * {@link ListContents} implementation used in compiled reports. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class BaseListContents extends JRBaseElementGroup implements ListContents +{ + + private static final long serialVersionUID = 1L; + + private final int height; + private final Integer width; + + protected BaseListContents(ListContents listContents, JRBaseObjectFactory factory) + { + super(listContents, factory); + + this.height = listContents.getHeight(); + this.width = listContents.getWidth(); + } + + @Override + public int getHeight() + { + return height; + } + + @Override + public Integer getWidth() + { + return width; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/DesignListContents.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/DesignListContents.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/DesignListContents.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/DesignListContents.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,94 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.list; + +import net.sf.jasperreports.engine.design.JRDesignElementGroup; + +/** + * {@link ListContents} implementation used at report design time. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class DesignListContents extends JRDesignElementGroup implements + ListContents +{ + + private static final long serialVersionUID = 1L; + + public static final String PROPERTY_HEIGHT = "height"; + public static final String PROPERTY_WIDTH = "width"; + + private int height; + private Integer width; + + @Override + public int getHeight() + { + return height; + } + + /** + * Sets the list contents height. + * + * @param height the list contents height + * @see #getHeight() + */ + public void setHeight(int height) + { + int old = this.height; + this.height = height; + getEventSupport().firePropertyChange(PROPERTY_HEIGHT, old, this.height); + } + + @Override + public Integer getWidth() + { + return width; + } + + /** + * Sets the width of the list contents. + * + * @param width the list contents width + * @see #getWidth() + */ + public void setWidth(Integer width) + { + Object old = this.width; + this.width = width; + getEventSupport().firePropertyChange(PROPERTY_WIDTH, old, this.width); + } + + /** + * Sets the width of the list contents. + * + * @param width the list contents width + * @see #getWidth() + */ + public void setWidth(int width) + { + setWidth(Integer.valueOf(width)); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/FillDatasetRun.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/FillDatasetRun.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/FillDatasetRun.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/FillDatasetRun.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,239 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.list; + +import java.sql.Connection; +import java.util.Map; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import net.sf.jasperreports.data.cache.DataCacheHandler; +import net.sf.jasperreports.engine.JRDataSource; +import net.sf.jasperreports.engine.JRDataset; +import net.sf.jasperreports.engine.JRDatasetRun; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRRewindableDataSource; +import net.sf.jasperreports.engine.JasperReport; +import net.sf.jasperreports.engine.fill.FillDatasetPosition; +import net.sf.jasperreports.engine.fill.JRFillCloneFactory; +import net.sf.jasperreports.engine.fill.JRFillDataset; +import net.sf.jasperreports.engine.fill.JRFillDatasetRun; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; +import net.sf.jasperreports.engine.fill.JRFillSubreport; +import net.sf.jasperreports.engine.util.JRReportUtils; + +/** + * Used to iterate on the list subdataset at fill time. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class FillDatasetRun extends JRFillDatasetRun +{ + + private static final Log log = LogFactory.getLog(FillDatasetRun.class); + + private Map parameterValues; + private FillDatasetPosition datasetPosition; + private boolean cacheIncluded; + private JRDataSource dataSource; + private Connection connection; + private boolean first; + + public FillDatasetRun(JRDatasetRun datasetRun, + JRFillObjectFactory factory) throws JRException + { + super(factory.getReportFiller(), factory.getExpressionEvaluator(), + datasetRun, + createFillDataset(datasetRun, factory)); + + initReturnValues(factory); + factory.registerDatasetRun(this); + } + + public FillDatasetRun(FillDatasetRun datasetRun, JRFillCloneFactory factory) + { + super(datasetRun, factory); + } + + private static JRFillDataset createFillDataset(JRDatasetRun datasetRun, + JRFillObjectFactory factory) throws JRException + { + JasperReport jasperReport = factory.getReportFiller().getJasperReport(); + JRDataset reportDataset = JRReportUtils.findSubdataset(datasetRun, jasperReport); + JRFillDataset fillDataset = new JRFillDataset(factory.getReportFiller(), reportDataset, factory); + fillDataset.createCalculator(jasperReport); + fillDataset.inheritFromMain(); + return fillDataset; + } + + public void evaluate(byte evaluation) throws JRException + { + if (log.isDebugEnabled()) + { + log.debug("Evaluating list dataset run parameters"); + } + + saveReturnVariables(); + + parameterValues = JRFillSubreport.getParameterValues( + filler, + expressionEvaluator, + parametersMapExpression, + parameters, + evaluation, + false, + dataset.getResourceBundle() != null,//hasResourceBundle + false//hasFormatFactory + ); + + JRFillDataset parentDataset = expressionEvaluator.getFillDataset(); + datasetPosition = new FillDatasetPosition(parentDataset.getDatasetPosition()); + datasetPosition.addAttribute("datasetRunUUID", getUUID()); + parentDataset.setCacheRecordIndex(datasetPosition, evaluation); + + String cacheIncludedProp = JRPropertiesUtil.getOwnProperty(this, DataCacheHandler.PROPERTY_INCLUDED); + cacheIncluded = JRPropertiesUtil.asBoolean(cacheIncludedProp, true);// default to true + + if (dataSourceExpression != null) + { + if (filler.getFillContext().hasDataSnapshot() && cacheIncluded) + { + dataSource = null; + } + else + { + dataSource = (JRDataSource) expressionEvaluator.evaluate( + dataSourceExpression, evaluation); + } + } + else if (connectionExpression != null) + { + connection = (Connection) expressionEvaluator.evaluate( + connectionExpression, evaluation); + } + } + + public void start() throws JRException + { + if (log.isDebugEnabled()) + { + log.debug("Starting list dataset iteration"); + } + + if (dataSourceExpression != null) + { + dataset.setDatasourceParameterValue(parameterValues, dataSource); + } + else if (connectionExpression != null) + { + dataset.setConnectionParameterValue(parameterValues, connection); + } + + // set fill position for caching + dataset.setFillPosition(datasetPosition); + dataset.setCacheSkipped(!cacheIncluded); + + copyConnectionParameter(parameterValues); + dataset.initCalculator(); + dataset.setParameterValues(parameterValues); + dataset.evaluateFieldProperties(); + dataset.initDatasource(); + + dataset.start(); + init(); + first = true; + } + + public boolean next() throws JRException + { + checkInterrupted(); + + if (dataset.next()) + { + if (first) + { + first = false; + } + else + { + group(); + } + + detail(); + + return true; + } + + return false; + } + + public void end() + { + if (log.isDebugEnabled()) + { + log.debug("Closing the data source"); + } + + dataset.closeDatasource(); + dataset.disposeParameterContributors(); + } + + public void rewind() throws JRException + { + if (dataSource != null) + { + if (dataSource instanceof JRRewindableDataSource) + { + if (log.isDebugEnabled()) + { + log.debug("Rewinding the list data source"); + } + + ((JRRewindableDataSource) dataSource).moveFirst(); + } + else + { + log.warn("Cannot rewind list data source as it is not a JRRewindableDataSource"); + } + } + } + + public Object evaluateDatasetExpression(JRExpression expression, byte evaluationType) + throws JRException + { + return dataset.evaluateExpression(expression, evaluationType); + } + + @Override + protected JRFillDataset getDataset() + { + // only added here for visibility + return super.getDataset(); + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/FillListContents.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/FillListContents.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/FillListContents.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/FillListContents.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,143 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.list; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.fill.JRFillCloneFactory; +import net.sf.jasperreports.engine.fill.JRFillCloneable; +import net.sf.jasperreports.engine.fill.JRFillElementContainer; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * List contents fill element container. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class FillListContents extends JRFillElementContainer +{ + + private final int contentsHeight; + + protected FillListContents(ListContents listContents, + JRFillObjectFactory factory) + { + super(factory.getFiller(), listContents, factory); + + this.contentsHeight = listContents.getHeight(); + + initElements(); + initConditionalStyles(); + } + + public FillListContents(FillListContents fillListContents, + JRFillCloneFactory factory) + { + super(fillListContents, factory); + + this.contentsHeight = fillListContents.contentsHeight; + + initElements(); + initConditionalStyles(); + } + + public int getHeight() + { + return contentsHeight; + } + + @Override + protected int getContainerHeight() + { + return contentsHeight; + } + + @Override + protected int getActualContainerHeight() + { + return getContainerHeight(); + } + + protected void evaluateContents() throws JRException + { + evaluateConditionalStyles(JRExpression.EVALUATION_DEFAULT); + evaluate(JRExpression.EVALUATION_DEFAULT); + } + + protected void prepare(int availableHeight) throws JRException + { + initFill(); + resetElements(); + prepareElements(availableHeight, true); + } + + @Override + public JRFillCloneable createClone(JRFillCloneFactory factory) + { + return new FillListContents(this, factory); + } + + public FillListContents createClone() + { + JRFillCloneFactory factory = new JRFillCloneFactory(); + return new FillListContents(this, factory); + } + + // overridden for access + @Override + protected int getStretchHeight() + { + return super.getStretchHeight(); + } + + // overridden for access + @Override + protected void rewind() throws JRException + { + super.rewind(); + } + + protected void stretchTo(int height) + { + setStretchHeight(height); + } + + // double check the usefulness of this whole method when removing legacy stretch; + // it looks like it will be needed only on HorizontalFillList, in which case its content could be copied only there + // and this method could be removed + protected void finalizeElementPositions() + { + if (isLegacyElementStretchEnabled()) + { + stretchElements(); + moveBandBottomElements(); + removeBlankElements(); + } + else + { + stretchElementsToContainer(); + moveBandBottomElements(); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/FillListFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/FillListFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/FillListFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/FillListFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,76 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.list; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.component.ComponentFillFactory; +import net.sf.jasperreports.engine.component.FillComponent; +import net.sf.jasperreports.engine.fill.JRFillCloneFactory; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; +import net.sf.jasperreports.engine.type.PrintOrderEnum; + +/** + * Factory of {@link BaseFillList list fill component} instances. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class FillListFactory implements ComponentFillFactory +{ + + @Override + public FillComponent cloneFillComponent(FillComponent component, + JRFillCloneFactory factory) + { + return (FillComponent) ((BaseFillList) component).createClone(factory); + } + + @Override + public FillComponent toFillComponent(Component component, + JRFillObjectFactory factory) + { + try + { + ListComponent list = (ListComponent) component; + FillComponent fillList; + PrintOrderEnum printOrder = list.getPrintOrderValue(); + if (printOrder == null + || printOrder == PrintOrderEnum.VERTICAL) + { + fillList = new VerticalFillList(list, factory); + } + else + { + fillList = new HorizontalFillList(list, factory); + } + return fillList; + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/HorizontalFillList.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/HorizontalFillList.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/HorizontalFillList.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/HorizontalFillList.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,364 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.list; + +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JRStyle; +import net.sf.jasperreports.engine.component.FillPrepareResult; +import net.sf.jasperreports.engine.fill.JRFillCloneFactory; +import net.sf.jasperreports.engine.fill.JRFillCloneable; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Horizontal fill list component implementation. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class HorizontalFillList extends BaseFillList +{ + + private static final Log log = LogFactory.getLog(HorizontalFillList.class); + public static final String EXCEPTION_MESSAGE_KEY_ROW_OVERFLOW = "fill.horizontal.list.row.overflow"; + + private final int contentsWidth; + private final boolean ignoreWidth; + private final List contentsList; + + private int overflowStartPage; + private int overflowColumnIndex; + + public HorizontalFillList(ListComponent component, JRFillObjectFactory factory) throws JRException + { + super(component, factory); + + ListContents listContents = component.getContents(); + this.contentsWidth = listContents.getWidth().intValue(); + + Boolean listIgnoreWidth = component.getIgnoreWidth(); + this.ignoreWidth = listIgnoreWidth != null && listIgnoreWidth.booleanValue(); + + JRFillObjectFactory datasetFactory = new JRFillObjectFactory(factory, + createDatasetExpressionEvaluator()); + FillListContents fillContents = new FillListContents( + listContents, datasetFactory); + this.contentsList = new ArrayList(); + this.contentsList.add(fillContents); + } + + protected HorizontalFillList(HorizontalFillList list, JRFillCloneFactory factory) + { + super(list, factory); + + this.contentsWidth = list.contentsWidth; + this.ignoreWidth = list.ignoreWidth; + + FillListContents listContents = list.contentsList.get(0); + FillListContents contentsClone = new FillListContents(listContents, factory); + + this.contentsList = new ArrayList(); + this.contentsList.add(contentsClone); + } + + @Override + public FillPrepareResult prepare(int availableHeight) + { + createPrintFrame(); + try + { + boolean hadData = false; + + if (filling) + { + // refill row after an overflow + if (log.isDebugEnabled()) + { + log.debug("Refilling list row after overflow"); + } + + hadData = true; + } + else + { + if (log.isDebugEnabled()) + { + log.debug("Starting list rendering"); + } + + if (fillStarted) + { + // if already started and finished, rewind the data source + if (log.isDebugEnabled()) + { + log.debug("List reprinted, rewinding data source"); + } + + datasetRun.rewind(); + } + + datasetRun.start(); + fillStarted = true; + + // reset the overflow page + overflowStartPage = 0; + } + + boolean overflow = false; + int columnIndex = 0; + + // also breaks when there are no more records, see below + while(!overflow) + { + int contentsAvailableHeight = availableHeight + - printFrame.getHeight(); + if (contentsAvailableHeight < contentsHeight) + { + // no space left to start a new row + if (log.isDebugEnabled()) + { + log.debug("Not enough space left for a list row, overflowing"); + } + + overflow = true; + } + else + { + boolean refillOverflowed = columnIndex < overflowColumnIndex; + if (!refillOverflowed && !datasetRun.next()) + { + // no more records + break; + } + + FillListContents listContents = getContents(columnIndex); + // we still have overflowed cells to refill + if (refillOverflowed) + { + // refilling an overflowed cell + if (log.isDebugEnabled()) + { + log.debug("Refilling overflowed cell at column " + + columnIndex); + } + + listContents.rewind(); + } + else + { + hadData = true; + + // reset the overflow counter as we render a new cell + overflowStartPage = 0; + + // a new cell, evaluate + if (log.isDebugEnabled()) + { + log.debug("Filling new cell at column " + + columnIndex); + } + + listContents.evaluateContents(); + } + + listContents.prepare(contentsAvailableHeight); + overflow = listContents.willOverflow(); + + ++columnIndex; + + if (!overflow + // reached the right element limit + && !ignoreWidth + && contentsWidth * (columnIndex + 1) + > fillContext.getComponentElement().getWidth()) + { + fillRow(columnIndex); + + // reset column index + columnIndex = 0; + + // also reset overflow column index + overflowColumnIndex = 0; + } + } + } + + if (overflow) + { + if (log.isDebugEnabled()) + { + log.debug("List has overflowed at column " + (columnIndex - 1)); + } + + int pageCount = fillContext.getFiller().getCurrentPageCount(); + if (overflowStartPage == 0) + { + // first overflow + overflowStartPage = pageCount; + } + else if (pageCount >= overflowStartPage + 2) + { + throw + new JRRuntimeException( + EXCEPTION_MESSAGE_KEY_ROW_OVERFLOW, + (Object[])null + ); + } + + // set the filling flag so that we know that we are continuing + filling = true; + + // set the index of the column that overflowed + // this is actually the index + 1 + overflowColumnIndex = columnIndex; + + return FillPrepareResult.printStretch(availableHeight, overflow); + } + else + { + // list has completed; + + // fill last row, if not filled + if (columnIndex > 0) + { + fillRow(columnIndex); + + // reset overflow column index + overflowColumnIndex = 0; + } + + if (log.isDebugEnabled()) + { + log.debug("List has completed rendering"); + } + + filling = false; + datasetRun.end(); + + datasetRun.copyReturnValues(); + + if (!hadData) + { + //if no data, set as no print + return FillPrepareResult.NO_PRINT_NO_OVERFLOW; + } + + return FillPrepareResult.printStretch(printFrame.getHeight(), false); + } + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + protected void fillRow(int columnCount) throws JRException + { + // completed a row + // fill all cells from the row + + if (log.isDebugEnabled()) + { + log.debug("Completed a row with " + columnCount + " columns"); + } + + AppendingPrintElementContainer printContainer = + new AppendingPrintElementContainer(printFrame); + + // compute the row height + int rowHeight = 0; + for (int idx = 0; idx < columnCount; ++idx) + { + FillListContents contents = contentsList.get(idx); + int cellHeight = contents.getStretchHeight(); + if (cellHeight > rowHeight) + { + rowHeight = cellHeight; + } + } + + for (int idx = 0; idx < columnCount; ++idx) + { + FillListContents contents = contentsList.get(idx); + // stretch all cells to row height + contents.stretchTo(rowHeight); + contents.finalizeElementPositions(); + + // fill elements + printContainer.setXOffset(idx * contentsWidth); + contents.fillElements(printContainer); + } + + if (ignoreWidth) + { + JRStyle style = printFrame.getStyle(); + int leftPadding = style == null ? 0 : style.getLineBox().getLeftPadding(); + int rightPadding = style == null ? 0 : style.getLineBox().getRightPadding(); + int requiredWidth = columnCount * contentsWidth + leftPadding + rightPadding; + if (requiredWidth > printFrame.getWidth()) + { + printFrame.setWidth(requiredWidth); + } + } + } + + protected FillListContents getContents(int columnIndex) + { + if (columnIndex > 0 && columnIndex >= contentsList.size()) + { + FillListContents template = contentsList.get(0); + for (int idx = contentsList.size(); idx <= columnIndex; idx++) + { + if (log.isDebugEnabled()) + { + log.debug("Cloning list fill contents for column " + idx); + } + + FillListContents clone = template.createClone(); + contentsList.add(clone); + } + } + return contentsList.get(columnIndex); + } + + @Override + public void rewind() + { + super.rewind(); + + overflowStartPage = 0; + overflowColumnIndex = 0; + } + + @Override + public JRFillCloneable createClone(JRFillCloneFactory factory) + { + return new HorizontalFillList(this, factory); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/ListComponentCompiler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/ListComponentCompiler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/ListComponentCompiler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/ListComponentCompiler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,171 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.list; + +import net.sf.jasperreports.engine.JRDatasetRun; +import net.sf.jasperreports.engine.JRElement; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.component.ComponentCompiler; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.type.PrintOrderEnum; + +/** + * Compile-time handler of {@link ListComponent list component} instances. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class ListComponentCompiler implements ComponentCompiler +{ + + @Override + public void collectExpressions(Component component, + JRExpressionCollector collector) + { + ListComponent listComponent = (ListComponent) component; + JRDatasetRun datasetRun = listComponent.getDatasetRun(); + collector.collect(datasetRun); + + JRExpressionCollector datasetCollector = collector.getDatasetCollector( + datasetRun.getDatasetName()); + JRElement[] elements = listComponent.getContents().getElements(); + if (elements != null) + { + for (int i = 0; i < elements.length; i++) + { + elements[i].collectExpressions(datasetCollector); + } + } + } + + @Override + public Component toCompiledComponent(Component component, + JRBaseObjectFactory baseFactory) + { + ListComponent listComponent = (ListComponent) component; + StandardListComponent compiledComponent = new StandardListComponent( + listComponent, baseFactory); + return compiledComponent; + } + + @Override + public void verify(Component component, JRVerifier verifier) + { + ListComponent listComponent = (ListComponent) component; + + JRDatasetRun datasetRun = listComponent.getDatasetRun(); + if (datasetRun == null) + { + verifier.addBrokenRule("No list subdataset run set", listComponent); + } + else + { + verifier.verifyDatasetRun(datasetRun); + } + + ListContents listContents = listComponent.getContents(); + + if (listContents == null) + { + verifier.addBrokenRule("No list contents set", listComponent); + } + else + { + PrintOrderEnum listPrintOrder = listComponent.getPrintOrderValue() == null ? PrintOrderEnum.VERTICAL : listComponent.getPrintOrderValue(); + + Boolean listIgnoreWidth = listComponent.getIgnoreWidth(); + boolean ignoreWidth = listIgnoreWidth != null + && listIgnoreWidth.booleanValue(); + + if (listContents.getHeight() < 0) + { + verifier.addBrokenRule("List contents height must be positive.", listContents); + } + + int elementWidth = verifier.getCurrentComponentElement().getWidth(); + Integer width = listContents.getWidth(); + int contentsWidth; + if (width == null) + { + contentsWidth = elementWidth; + + if (listPrintOrder == PrintOrderEnum.HORIZONTAL) + { + verifier.addBrokenRule("List contents width must be set for horizontal lists", + listContents); + } + } + else + { + contentsWidth = width.intValue(); + + if (width.intValue() <= 0) + { + verifier.addBrokenRule("List contents width must be positive.", listContents); + } + + if (!ignoreWidth && listPrintOrder == PrintOrderEnum.HORIZONTAL + && width.intValue() > elementWidth) + { + verifier.addBrokenRule( + "List contents width is larger than the list element width", + listComponent); + } + } + + JRElement[] elements = listContents.getElements(); + if (elements != null) + { + for (int i = 0; i < elements.length; i++) + { + JRElement element = elements[i]; + + verifier.verifyElement(element); + + if (element.getX() < 0 || element.getY() < 0) + { + verifier.addBrokenRule("Element must be placed at positive coordinates.", + element); + } + + if (element.getY() + element.getHeight() > listContents.getHeight()) + { + verifier.addBrokenRule("Element reaches outside list contents height: y = " + + element.getY() + ", height = " + element.getHeight() + + ", list contents height = " + listContents.getHeight() + ".", element); + } + + if (element.getX() + element.getWidth() > contentsWidth) + { + verifier.addBrokenRule("Element reaches outside list contents width: x = " + + element.getX() + ", width = " + element.getWidth() + + ", list contents width = " + contentsWidth + ".", element); + } + } + } + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/ListComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/ListComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/ListComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/ListComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,103 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.list; + +import net.sf.jasperreports.crosstabs.JRCrosstab; +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRDatasetRun; +import net.sf.jasperreports.engine.JRVisitable; +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.type.PrintOrderEnum; + +/** + * List component interface. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public interface ListComponent extends Component, JRCloneable, JRVisitable +{ + + /** + * Returns the subdataset run information that will be used by this list. + * + *

    + * This information is required to instantiate a subdataset from the report. + * The data produced by the subdataset is fed to the list item contents. + * + * @return the subdataset run information + */ + JRDatasetRun getDatasetRun(); + + /** + * Returns the list item contents. + * + *

    + * Each record produced by the list subdataset is used to fill the list + * item contents and the result is included in the generated report. + * + * @return the list item contents + */ + ListContents getContents(); + + /** + * Returns the print order of the list cells. + * + *

    + * The list cells can be either printed vertically one beneath another + * (on a single column), or horizontally on rows of 2 or more columns. + *

    + * + *

    + * The default print order (used when no explicit order has been set) + * is vertical. + *

    + * + * @return the list print order if set, one of + *
      + *
    • {@link PrintOrderEnum#VERTICAL}
    • + *
    • {@link PrintOrderEnum#HORIZONTAL}
    • + *
    + * @see ListContents#getWidth() + */ + public PrintOrderEnum getPrintOrderValue(); + + /** + * Returns the flag that determines whether the element width is to be ignored + * when filling this list. + * + *

    + * This flag only applies to horizontally filled reports. If the flag is set, + * the list will be filled on a single row. + *

    + * + *

    + * By default, the flag is not set. + *

    + * + * @see #getPrintOrderValue() + * @see JRCrosstab#setIgnoreWidth(Boolean) + */ + public Boolean getIgnoreWidth(); + +} \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/ListContents.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/ListContents.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/ListContents.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/ListContents.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.list; + +import net.sf.jasperreports.engine.JRElementGroup; + +/** + * Container of report elements that are to be printed for each record in the + * list subdataset. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + * @see ListComponent#getContents() + */ +public interface ListContents extends JRElementGroup +{ + + /** + * Returns the height of the list contents. + * + *

    + * This value is used as a minimum list item height: if the space left on + * the page is smaller than the height, then an overflow is triggered and + * the list item is printed on a new page/column. + * + * @return the height of the list contents + */ + int getHeight(); + + /** + * Returns the width of the list contents. + * + *

    + * When the list is filled horizontally, several list cells will be placed + * on the same row one next to another within the width of the list element + * (unless the list element width is ignored). + * The width of the list contents will determine how many cells can be + * placed on a row. + *

    + * + * @return the width of the list contents + * @see ListComponent#getPrintOrderValue() + * @see ListComponent#getIgnoreWidth() + */ + Integer getWidth(); +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/ListDesignConverter.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/ListDesignConverter.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/ListDesignConverter.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/ListDesignConverter.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,119 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.list; + +import java.util.Iterator; +import java.util.List; + +import net.sf.jasperreports.engine.JRChild; +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRPrintElement; +import net.sf.jasperreports.engine.base.JRBasePrintFrame; +import net.sf.jasperreports.engine.component.ComponentDesignConverter; +import net.sf.jasperreports.engine.convert.ConvertVisitor; +import net.sf.jasperreports.engine.convert.ReportConverter; +import net.sf.jasperreports.engine.type.ModeEnum; + +/** + * List preview converter. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class ListDesignConverter implements ComponentDesignConverter +{ + + @Override + public JRPrintElement convert(ReportConverter reportConverter, + JRComponentElement element) + { + ListComponent list = (ListComponent) element.getComponent(); + if (list == null || list.getContents() == null) + { + return null; + } + + JRBasePrintFrame frame = new JRBasePrintFrame( + reportConverter.getDefaultStyleProvider()); + reportConverter.copyBaseAttributes(element, frame); + + ListContents contents = list.getContents(); + if (contents.getHeight() > 0) + { + JRBasePrintFrame contentsFrame = new JRBasePrintFrame( + reportConverter.getDefaultStyleProvider()); + contentsFrame.setUUID(element.getUUID()); + contentsFrame.setX(0); + contentsFrame.setY(0); + contentsFrame.setWidth(element.getWidth()); + contentsFrame.setHeight(contents.getHeight()); + contentsFrame.setMode(ModeEnum.TRANSPARENT); + + List children = contents.getChildren(); + if (children != null) + { + ConvertVisitor contentsVisitor = new ConvertVisitor(reportConverter, + contentsFrame); + for (Iterator it = children.iterator(); it + .hasNext();) + { + JRChild child = it.next(); + child.visit(contentsVisitor); + } + } + + frame.addElement(contentsFrame); + + /* + Integer width = contents.getWidth(); + int contentsWidth = width == null ? element.getWidth() + : width.intValue(); + + if (contents.getHeight() < element.getHeight() + || contentsWidth < element.getWidth()) + { + // add a grey rectangle to highlight the contents height + JRBasePrintImage image = new JRBasePrintImage( + reportConverter.getDefaultStyleProvider()); + image.setX(0); + image.setWidth(element.getWidth()); + image.setY(0); + image.setHeight(element.getHeight()); + image.setMode(ModeEnum.TRANSPARENT); + + // clip out the list contents area + Area clip = new Area(new Rectangle( + 0, 0, element.getWidth(), element.getHeight())); + clip.subtract(new Area(new Rectangle( + 0, 0, contentsWidth, contents.getHeight()))); + + image.setRenderer(new UnusedSpaceImageRenderer(clip)); + frame.addElement(image); + } + */ + } + + return frame; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,64 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** +* Contains classes for the built-in List component. +*

    +* A list component is a report element that iterates on a set of records and renders a cell for +* each record. +*

    +* The data for a list is obtained via a subdataset defined in the report. The list component +* includes a <datasetRun> JRXML element (equivalent to a +* {@link net.sf.jasperreports.engine.JRDatasetRun JRDatasetRun} at the API level), which contains +* information required to instantiate a report subdataset. A data source object can be sent +* to the subdataset, or, when the subdataset embeds a query, connection parameters and +* query parameters can be provided. The subdataset is instantiated when the list +* component is evaluated and it iterates through the records it produces. +*

    +* The list cell consists of a report element which will be rendered for each record in the +* dataset. This element can be a frame which nests several elements. The list cell is +* evaluated in the context of the subdataset, therefore expressions used by the elements can +* only refer to parameters, fields and variables which are defined in the subdataset. Also, +* delayed evaluation times will not work for elements in the list cells because the elements +* are not evaluated in the context of the main report dataset. +*
    +* The cell width is the same as the defined width of the component element; the height is +* given by an attribute of the list. The contents of the cell must fit within the width and +* height of the cell. +*

    +* When iterating on the dataset records, the list component renders cells vertically in a +* single column if printOrder is Vertical, or it renders cells side by side, in a single +* row, if the printOrder attribute is set to Horizontal. For horizontally filled lists, the +* row breaking behavior is controlled by the ignoreWidth attribute, which either forces a +* row break when list width limit is reached, or lets the cells stretch beyond the list +* declared width limit. The list cell height is used as the column's minimum height. If the +* space remaining at the bottom of the page is less than the cell height, a column/page +* overflow is triggered and the list continues rendering on a new column/page. +*
    +* The height of the list component element itself can be greater than the list cell height. +* The list element height is used as minimum height of the entire list, that is, the list will +* not start rendering unless the space remaining on the page is at least the height of the +* element. +*/ +package net.sf.jasperreports.components.list; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/StandardListComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/StandardListComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/StandardListComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/StandardListComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,224 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.list; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.Serializable; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRDatasetRun; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JRVisitor; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.type.PrintOrderEnum; +import net.sf.jasperreports.engine.util.ElementsVisitorUtils; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * Standard {@link ListComponent} implementation. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class StandardListComponent implements Serializable, ListComponent, JRChangeEventsSupport +{ + + private static final long serialVersionUID = 1L; + + public static final String PROPERTY_PRINT_ORDER = "printOrder"; + public static final String PROPERTY_IGNORE_WIDTH = "ignoreWidth"; + public static final String PROPERTY_DATASET_RUN = "datasetRun"; + + private JRDatasetRun datasetRun; + private ListContents contents; + private PrintOrderEnum printOrderValue; + private Boolean ignoreWidth; + + public StandardListComponent() + { + } + + public StandardListComponent(ListComponent list, JRBaseObjectFactory baseFactory) + { + this.datasetRun = baseFactory.getDatasetRun(list.getDatasetRun()); + this.contents = new BaseListContents(list.getContents(), baseFactory); + this.printOrderValue = list.getPrintOrderValue(); + this.ignoreWidth = list.getIgnoreWidth(); + } + + @Override + public JRDatasetRun getDatasetRun() + { + return datasetRun; + } + + /** + * Sets the subdataset run information that will be used by this list. + * + * @param datasetRun the subdataset run information + * @see #getDatasetRun() + */ + public void setDatasetRun(JRDatasetRun datasetRun) + { + Object old = this.datasetRun; + this.datasetRun = datasetRun; + getEventSupport().firePropertyChange(PROPERTY_DATASET_RUN, old, this.datasetRun); + } + + @Override + public ListContents getContents() + { + return contents; + } + + /** + * Sets the list item contents. + * + * @param contents the list item contents + * @see #getContents() + */ + public void setContents(ListContents contents) + { + this.contents = contents; + } + + @Override + public Object clone() + { + StandardListComponent clone = null; + try + { + clone = (StandardListComponent) super.clone(); + } + catch (CloneNotSupportedException e) + { + // never + throw new JRRuntimeException(e); + } + clone.datasetRun = JRCloneUtils.nullSafeClone(datasetRun); + clone.contents = JRCloneUtils.nullSafeClone(contents); + clone.eventSupport = null; + return clone; + } + + @Override + public PrintOrderEnum getPrintOrderValue() + { + return printOrderValue; + } + + /** + * Sets the list cell print order. + * + * @param printOrderValue the cell print oder, null or one of + *

      + *
    • {@link PrintOrderEnum#VERTICAL}
    • + *
    • {@link PrintOrderEnum#HORIZONTAL}
    • + *
    + * @see #getPrintOrderValue() + */ + public void setPrintOrderValue(PrintOrderEnum printOrderValue) + { + Object old = this.printOrderValue; + this.printOrderValue = printOrderValue; + getEventSupport().firePropertyChange(PROPERTY_PRINT_ORDER, old, this.printOrderValue); + } + + private transient JRPropertyChangeSupport eventSupport; + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + @Override + public Boolean getIgnoreWidth() + { + return ignoreWidth; + } + + /** + * Sets the list ignore width flag. + * + * @param ignoreWidth the ignore width flag + */ + public void setIgnoreWidth(Boolean ignoreWidth) + { + Object old = this.ignoreWidth; + this.ignoreWidth = ignoreWidth; + getEventSupport().firePropertyChange(PROPERTY_IGNORE_WIDTH, + old, this.ignoreWidth); + } + + /** + * Sets the list ignore width flag. + * + * @param ignoreWidth the ignore width flag + */ + public void setIgnoreWidth(boolean ignoreWidth) + { + setIgnoreWidth(Boolean.valueOf(ignoreWidth)); + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private Byte printOrder; + + @SuppressWarnings("deprecation") + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2) + { + printOrderValue = PrintOrderEnum.getByValue(printOrder); + } + } + + @Override + public void visit(JRVisitor visitor) + { + if (ElementsVisitorUtils.visitDeepElements(visitor) && contents != null) + { + ElementsVisitorUtils.visitElements(visitor, contents.getChildren()); + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/UnusedSpaceImageRenderer.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/UnusedSpaceImageRenderer.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/UnusedSpaceImageRenderer.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/UnusedSpaceImageRenderer.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,105 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.list; + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.Shape; +import java.awt.geom.Rectangle2D; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.renderers.AbstractRenderer; +import net.sf.jasperreports.renderers.Graphics2DRenderable; + +/** + * Am image renderer used to mark the unused vertical space in a list + * component preview. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class UnusedSpaceImageRenderer extends AbstractRenderer implements Graphics2DRenderable +{ + private static final long serialVersionUID = 1L; + + // transparent light grey + private static final Color FILL = new Color(224, 224, 224, 128); + + public static final UnusedSpaceImageRenderer INSTANCE = new UnusedSpaceImageRenderer(); + + private final Shape clip; + private final int lineGap = 15; + private final int lineWidth = 10; + + public UnusedSpaceImageRenderer() + { + this(null); + } + + public UnusedSpaceImageRenderer(Shape clip) + { + this.clip = clip; + } + + @Override + public void render( + JasperReportsContext jasperReportsContext, + Graphics2D grx, + Rectangle2D rectangle + ) throws JRException + { + Graphics2D graphics = (Graphics2D) grx.create(); + try + { + graphics.translate(rectangle.getX(), rectangle.getY()); + graphics.setColor(FILL); + + if (clip != null) + { + graphics.clip(clip); + } + + int width = (int) rectangle.getWidth(); + int limit = width + (int) rectangle.getHeight(); + int increment = lineGap + lineWidth; + int reverseOffset = (width - 4 * lineWidth / 3) % increment; + for (int x = 0; x <= limit; x += increment) + { + graphics.fillPolygon( + new int[]{x, x + lineWidth, 0, 0}, + new int[]{0, 0, x + lineWidth, x}, + 4); + + graphics.fillPolygon( + new int[]{width - x - reverseOffset, width - x - lineWidth - reverseOffset, width, width}, + new int[]{0, 0, x + lineWidth, x}, + 4); + } + } + finally + { + graphics.dispose(); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/VerticalFillList.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/VerticalFillList.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/list/VerticalFillList.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/list/VerticalFillList.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,179 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.list; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.component.FillPrepareResult; +import net.sf.jasperreports.engine.fill.JRFillCloneFactory; +import net.sf.jasperreports.engine.fill.JRFillCloneable; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Vertical fill list component implementation. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class VerticalFillList extends BaseFillList +{ + + private static final Log log = LogFactory.getLog(VerticalFillList.class); + + private final FillListContents listContents; + + public VerticalFillList(ListComponent component, JRFillObjectFactory factory) throws JRException + { + super(component, factory); + + JRFillObjectFactory datasetFactory = new JRFillObjectFactory(factory, + createDatasetExpressionEvaluator()); + this.listContents = new FillListContents(component.getContents(), datasetFactory); + } + + protected VerticalFillList(VerticalFillList list, JRFillCloneFactory factory) + { + super(list, factory); + + this.listContents = new FillListContents(list.listContents, factory); + } + + @Override + public FillPrepareResult prepare(int availableHeight) + { + createPrintFrame(); + try + { + boolean hadData = false; + boolean overflow = false; + + if (filling) + { + // continuing after an overflow + if (log.isDebugEnabled()) + { + log.debug("Continuing list after overflow"); + } + + hadData = true; + overflow = fillContents(availableHeight); + } + else + { + if (log.isDebugEnabled()) + { + log.debug("Starting list rendering"); + } + + if (fillStarted) + { + // if already started and finished, rewind the data source + if (log.isDebugEnabled()) + { + log.debug("List reprinted, rewinding data source"); + } + + datasetRun.rewind(); + } + + datasetRun.start(); + fillStarted = true; + } + + while(!overflow && datasetRun.next()) + { + hadData = true; + + listContents.evaluateContents(); + overflow = fillContents(availableHeight); + } + + if (overflow) + { + if (log.isDebugEnabled()) + { + log.debug("List has overflowed"); + } + + // set the filling flag so that we know that we are continuing + filling = true; + return FillPrepareResult.printStretch(availableHeight, overflow); + } + else + { + // list has completed; + + if (log.isDebugEnabled()) + { + log.debug("List has completed rendering"); + } + + filling = false; + datasetRun.end(); + + datasetRun.copyReturnValues(); + + if (!hadData) + { + //if no data, set as no print + return FillPrepareResult.NO_PRINT_NO_OVERFLOW; + } + + return FillPrepareResult.printStretch(printFrame.getHeight(), false); + } + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + protected boolean fillContents(int availableHeight) throws JRException + { + boolean overflow; + int contentsAvailableHeight = availableHeight - printFrame.getHeight(); + if (contentsAvailableHeight < listContents.getHeight()) + { + overflow = true; + } + else + { + listContents.prepare(contentsAvailableHeight); + listContents.finalizeElementPositions(); + listContents.fillElements( + new AppendingPrintElementContainer(printFrame)); + + overflow = listContents.willOverflow(); + } + return overflow; + } + + @Override + public JRFillCloneable createClone(JRFillCloneFactory factory) + { + return new VerticalFillList(this, factory); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillContextProvider.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillContextProvider.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillContextProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillContextProvider.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.fill; + + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated Replaced by {@link net.sf.jasperreports.engine.component.FillContextProvider}. + */ +public interface FillContextProvider extends net.sf.jasperreports.engine.component.FillContextProvider +{ +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillItemData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillItemData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillItemData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillItemData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.fill; + +import net.sf.jasperreports.components.items.ItemData; +import net.sf.jasperreports.engine.component.FillContextProvider; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public abstract class FillItemData extends net.sf.jasperreports.components.items.fill.FillItemData +{ + /** + * + */ + public FillItemData( + FillContextProvider fillContextProvider, + ItemData itemData, + JRFillObjectFactory factory + )// throws JRException + { + super(fillContextProvider, itemData, factory); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillItemDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillItemDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillItemDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillItemDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.fill; + +import net.sf.jasperreports.components.items.fill.FillItemData; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated Replaced by {@link net.sf.jasperreports.components.items.fill.FillItemDataset}. + */ +public class FillItemDataset extends net.sf.jasperreports.components.items.fill.FillItemDataset +{ + public FillItemDataset(FillItemData itemData, JRFillObjectFactory factory) + { + super(itemData, factory); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillItem.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillItem.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillItem.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillItem.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,46 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.fill; + +import net.sf.jasperreports.components.items.Item; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated Replaced by {@link net.sf.jasperreports.components.items.fill.FillItem}. + */ +public abstract class FillItem extends net.sf.jasperreports.components.items.fill.FillItem +{ + /** + * + */ + public FillItem( + Item item, + JRFillObjectFactory factory + ) + { + super(item, factory); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillMarker.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillMarker.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillMarker.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillMarker.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,143 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.fill; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * @deprecated Replaced by {@link FillItem}. + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class FillMarker implements net.sf.jasperreports.components.map.Marker +{ + public static final String EXCEPTION_MESSAGE_KEY_INVALID_VALUE_LOCATION = "charts.thermometer.plot.invalid.value.location"; + + /** + * + */ + protected net.sf.jasperreports.components.map.Marker parent; + + /** + * + */ + public FillMarker( + net.sf.jasperreports.components.map.Marker marker, + JRFillObjectFactory factory + ) + { + factory.put(marker, this); + + parent = marker; + } + + + /** + * + */ + public Map evaluateProperties(JRFillExpressionEvaluator evaluator, byte evaluation) throws JRException + { + List markerProperties = getProperties(); + Map result = null; + if(markerProperties != null && !markerProperties.isEmpty()) + { + result = new HashMap(); + for(net.sf.jasperreports.components.map.MarkerProperty property : markerProperties) + { + result.put(property.getName(), getEvaluatedValue(property, evaluator, evaluation)); + } + } + return result; + } + + + @Override + public Object clone() + { + throw new UnsupportedOperationException(); + } + + @Override + public List getProperties() + { + return parent.getProperties(); + } + + public Object getEvaluatedValue( + net.sf.jasperreports.components.map.MarkerProperty property, + JRFillExpressionEvaluator evaluator, + byte evaluation + ) throws JRException + { + Object result = null; + if ( + property.getValueExpression() == null + || property.getValueExpression().getText() == null + || property.getValueExpression().getText().trim().length() == 0 + ) + { + if( + net.sf.jasperreports.components.map.Marker.PROPERTY_latitude.equals(property.getName()) + || net.sf.jasperreports.components.map.Marker.PROPERTY_longitude.equals(property.getName()) + ) + { + if(property.getValue() == null || property.getValue().length() == 0) + { + throw + new JRException( + MapFillComponent.EXCEPTION_MESSAGE_KEY_NULL_OR_EMPTY_VALUE_NOT_ALLOWED, + new Object[]{property.getName()}); + } + } + result = property.getValue(); + } + else + { + result = evaluator.evaluate(property.getValueExpression(), evaluation); + if ( + net.sf.jasperreports.components.map.Marker.PROPERTY_latitude.equals(property.getName()) + || net.sf.jasperreports.components.map.Marker.PROPERTY_longitude.equals(property.getName()) + ) + { + if( + result == null + || String.valueOf(result).trim().length() == 0 + ) + { + throw + new JRException( + MapFillComponent.EXCEPTION_MESSAGE_KEY_NULL_OR_EMPTY_VALUE_NOT_ALLOWED, + new Object[]{property.getName()}); + } + } + } + return result; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillPlaceItemData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillPlaceItemData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillPlaceItemData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillPlaceItemData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,53 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.fill; + +import net.sf.jasperreports.components.items.Item; +import net.sf.jasperreports.components.items.ItemData; +import net.sf.jasperreports.components.items.fill.FillItem; +import net.sf.jasperreports.engine.component.FillContextProvider; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class FillPlaceItemData extends FillItemData +{ + /** + * + */ + public FillPlaceItemData( + FillContextProvider fillContextProvider, + ItemData itemData, + JRFillObjectFactory factory + )// throws JRException + { + super(fillContextProvider, itemData, factory); + } + + @Override + public FillItem getFillItem(Item item, JRFillObjectFactory factory){ + return new FillPlaceItem(item, factory); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillPlaceItem.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillPlaceItem.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillPlaceItem.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillPlaceItem.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,192 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.fill; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLEncoder; +import java.util.Map; + +import javax.xml.parsers.DocumentBuilderFactory; + +import net.sf.jasperreports.components.items.Item; +import net.sf.jasperreports.components.items.ItemProperty; +import net.sf.jasperreports.components.items.fill.FillItem; +import net.sf.jasperreports.components.map.MapComponent; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; +import net.sf.jasperreports.engine.type.ColorEnum; +import net.sf.jasperreports.engine.util.JRColorUtil; + +import org.jaxen.dom.DOMXPath; +import org.w3c.dom.Document; +import org.w3c.dom.Node; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class FillPlaceItem extends FillItem +{ + public static final String PROPERTY_COLOR = "color"; + public static final String EXCEPTION_MESSAGE_KEY_MISSING_COORDINATES = "components.map.missing.coordinates"; + + /** + * + */ + public FillPlaceItem( + Item item, + JRFillObjectFactory factory + ) + { + super(item, factory); + } + + @Override + public Object getEvaluatedValue(ItemProperty property, JRFillExpressionEvaluator evaluator, byte evaluation) throws JRException + { + Object result = super.getEvaluatedValue(property, evaluator, evaluation); + return MapComponent.ITEM_PROPERTY_address.equals(property.getName()) + ? getCoords((String)result) + : (PROPERTY_COLOR.equals(property.getName()) + ? JRColorUtil.getColorHexa(JRColorUtil.getColor((String)result, ColorEnum.RED.getColor())) + : result); + } + + @Override + public void verifyValue(ItemProperty property, Object value) throws JRException { + } + + @Override + public void verifyValues(Map result) throws JRException { + if(result != null) { + Object latitude = result.get(MapComponent.ITEM_PROPERTY_latitude); + Object longitude = result.get(MapComponent.ITEM_PROPERTY_longitude); + Object address = result.get(MapComponent.ITEM_PROPERTY_address); + + Float fLatitude = null; + if (latitude instanceof Number) + { + fLatitude = ((Number)latitude).floatValue(); + } + else + { + String strLatitude = latitude == null ? null : String.valueOf(latitude); + fLatitude = strLatitude == null || strLatitude.trim().length() == 0 ? null : Float.parseFloat(strLatitude); + } + + Float fLongitude = null; + if (longitude instanceof Number) + { + fLongitude = ((Number)longitude).floatValue(); + } + else + { + String strLongitude = longitude == null ? null : String.valueOf(longitude); + fLongitude = strLongitude == null || strLongitude.trim().length() == 0 ? null : Float.parseFloat(strLongitude); + } + + if (fLatitude != null && fLongitude != null) + { + result.remove(MapComponent.ITEM_PROPERTY_address); + result.put(MapComponent.ITEM_PROPERTY_latitude, fLatitude); + result.put(MapComponent.ITEM_PROPERTY_longitude, fLongitude); + } + else if (address != null) + { + Float[] coords = (Float[])address; + if(coords[0] != null && coords[1] != null){ + result.put(MapComponent.ITEM_PROPERTY_latitude, coords[0]); + result.put(MapComponent.ITEM_PROPERTY_longitude, coords[1]); + result.remove(MapComponent.ITEM_PROPERTY_address); + } else { + throw + new JRException( + MapFillComponent.EXCEPTION_MESSAGE_KEY_INVALID_ADDRESS_COORDINATES, + new Object[]{coords[0], coords[1]} + ); + } + } + else + { + throw + new JRException( + EXCEPTION_MESSAGE_KEY_MISSING_COORDINATES, + new Object[]{fLatitude == null ? MapComponent.ITEM_PROPERTY_latitude : MapComponent.ITEM_PROPERTY_longitude} + ); + } + } + } + + private Float[] getCoords(String address) throws JRException { + Float[] coords = null; + if(address != null) { + try { + String url = MapFillComponent.PLACE_URL_PREFIX + URLEncoder.encode(address, MapFillComponent.DEFAULT_ENCODING) + MapFillComponent.PLACE_URL_SUFFIX; + byte[] response = read(url); + Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(response)); + Node statusNode = (Node) new DOMXPath(MapFillComponent.STATUS_NODE).selectSingleNode(document); + String status = statusNode.getTextContent(); + if(MapFillComponent.STATUS_OK.equals(status)) { + coords = new Float[2]; + Node latNode = (Node) new DOMXPath(MapFillComponent.LATITUDE_NODE).selectSingleNode(document); + coords[0] = Float.valueOf(latNode.getTextContent()); + Node lngNode = (Node) new DOMXPath(MapFillComponent.LONGITUDE_NODE).selectSingleNode(document); + coords[1] = Float.valueOf(lngNode.getTextContent()); + } else { + throw + new JRException( + MapFillComponent.EXCEPTION_MESSAGE_KEY_ADDRESS_REQUEST_FAILED, + new Object[]{status} + ); + } + } catch (Exception e) { + throw new JRException(e); + } + } + return coords; + } + + private byte[] read(String url) throws IOException { + InputStream stream = null; + try { + URL u = new URL(url); + stream = u.openStream(); + ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); + byte[] buf = new byte[4096]; + int read; + while ((read = stream.read(buf)) > 0) { + byteOut.write(buf, 0, read); + } + return byteOut.toByteArray(); + } finally { + if(stream != null) { + stream.close(); + } + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillStyleItemData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillStyleItemData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillStyleItemData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillStyleItemData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,53 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.fill; + +import net.sf.jasperreports.components.items.Item; +import net.sf.jasperreports.components.items.ItemData; +import net.sf.jasperreports.components.items.fill.FillItem; +import net.sf.jasperreports.engine.component.FillContextProvider; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class FillStyleItemData extends FillItemData +{ + /** + * + */ + public FillStyleItemData( + FillContextProvider fillContextProvider, + ItemData itemData, + JRFillObjectFactory factory + ) + { + super(fillContextProvider, itemData, factory); + } + + @Override + public FillItem getFillItem(Item item, JRFillObjectFactory factory){ + return new FillStyleItem(item, factory); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillStyleItem.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillStyleItem.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/FillStyleItem.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/FillStyleItem.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.fill; + +import java.util.Map; + +import net.sf.jasperreports.components.items.Item; +import net.sf.jasperreports.components.items.ItemProperty; +import net.sf.jasperreports.components.items.fill.FillItem; +import net.sf.jasperreports.components.map.MapComponent; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; +import net.sf.jasperreports.engine.type.ColorEnum; +import net.sf.jasperreports.engine.util.JRColorUtil; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class FillStyleItem extends FillItem +{ + public static final String PROPERTY_NAME = "name"; + public static final String PROPERTY_COLOR = "color"; + + /** + * + */ + public FillStyleItem( + Item item, + JRFillObjectFactory factory + ) + { + super(item, factory); + } + + @Override + public Object getEvaluatedValue(ItemProperty property, JRFillExpressionEvaluator evaluator, byte evaluation) throws JRException + { + Object result = super.getEvaluatedValue(property, evaluator, evaluation); + return PROPERTY_COLOR.equals(property.getName()) + ? JRColorUtil.getColorHexa(JRColorUtil.getColor((String)result, ColorEnum.RED.getColor())) + : result; + } + + + @Override + public void verifyValue(ItemProperty property, Object value) throws JRException { + if(PROPERTY_NAME.equals(property.getName()) && (value == null || (value instanceof String && ((String)value).length() == 0))){ + throw + new JRException( + MapFillComponent.EXCEPTION_MESSAGE_KEY_NULL_OR_EMPTY_VALUE_NOT_ALLOWED, + new Object[]{property.getName()} + ); + } + } + + @Override + public void verifyValues(Map result) throws JRException { + if(result != null) { + //these are not intended for the style property + result.remove(MapComponent.ITEM_PROPERTY_latitude); + result.remove(MapComponent.ITEM_PROPERTY_longitude); + result.remove(MapComponent.ITEM_PROPERTY_address); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/MapFillComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/MapFillComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/MapFillComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/MapFillComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,477 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.fill; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import javax.xml.parsers.DocumentBuilderFactory; + +import net.sf.jasperreports.components.items.ItemData; +import net.sf.jasperreports.components.map.MapComponent; +import net.sf.jasperreports.components.map.type.MapImageTypeEnum; +import net.sf.jasperreports.components.map.type.MapScaleEnum; +import net.sf.jasperreports.components.map.type.MapTypeEnum; +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRPrintElement; +import net.sf.jasperreports.engine.JRPropertiesHolder; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.component.BaseFillComponent; +import net.sf.jasperreports.engine.component.FillContext; +import net.sf.jasperreports.engine.component.FillContextProvider; +import net.sf.jasperreports.engine.component.FillPrepareResult; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; +import net.sf.jasperreports.engine.fill.JRTemplateGenericElement; +import net.sf.jasperreports.engine.fill.JRTemplateGenericPrintElement; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; +import net.sf.jasperreports.engine.type.OnErrorTypeEnum; + +import org.jaxen.dom.DOMXPath; +import org.w3c.dom.Document; +import org.w3c.dom.Node; + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class MapFillComponent extends BaseFillComponent implements FillContextProvider +{ + public static final String PLACE_URL_PREFIX = "https://maps.googleapis.com/maps/api/geocode/xml?address="; + public static final String PLACE_URL_SUFFIX = "&sensor=false&output=xml&oe=utf8"; + public static final String DEFAULT_ENCODING = "UTF-8"; + public static final String STATUS_NODE = "/GeocodeResponse/status"; + public static final String LATITUDE_NODE = "/GeocodeResponse/result/geometry/location/lat"; + public static final String LONGITUDE_NODE = "/GeocodeResponse/result/geometry/location/lng"; + public static final String STATUS_OK = "OK"; + + public static final String EXCEPTION_MESSAGE_KEY_NULL_OR_EMPTY_VALUE_NOT_ALLOWED = "components.map.null.or.empty.value.not.allowed"; + public static final String EXCEPTION_MESSAGE_KEY_NULL_OR_EMPTY_VALUES_NOT_ALLOWED = "components.map.null.or.empty.values.not.allowed"; + public static final String EXCEPTION_MESSAGE_KEY_INVALID_ADDRESS_COORDINATES = "components.map.invalid.address.coordinates"; + public static final String EXCEPTION_MESSAGE_KEY_ADDRESS_REQUEST_FAILED = "components.map.address.request.failed"; + + private final MapComponent mapComponent; + + private Float latitude; + private Float longitude; + private String center; + private Integer zoom; + private String language; + private MapTypeEnum mapType; + private MapScaleEnum mapScale; + private MapImageTypeEnum imageType; + private OnErrorTypeEnum onErrorType; + private String clientId; + private String signature; + private String key; + private String version; + + private List markerDataList; + private List pathStyleList; + private List pathDataList; + private List> markers; + private Map> styles; + private List> paths; + + JRFillObjectFactory factory; + + public MapFillComponent(MapComponent map) + { + this.mapComponent = map; + } + + public MapFillComponent(MapComponent map, JRFillObjectFactory factory) + { + this.mapComponent = map; + this.factory = factory; + + if(mapComponent.getMarkerDataList() != null){ + markerDataList = new ArrayList(); + for(ItemData markerData : mapComponent.getMarkerDataList()) { + markerDataList.add(new FillPlaceItemData(this, markerData, factory)); + } + } + if(mapComponent.getPathStyleList() != null){ + pathStyleList = new ArrayList(); + for(ItemData pathStyle : mapComponent.getPathStyleList()) { + pathStyleList.add(new FillStyleItemData(this, pathStyle, factory)); + } + } + if(mapComponent.getPathDataList() != null){ + pathDataList = new ArrayList(); + for(ItemData pathData : mapComponent.getPathDataList()) { + pathDataList.add(new FillPlaceItemData(this, pathData, factory)); + } + } + } + + protected MapComponent getMap() + { + return mapComponent; + } + + @Override + public FillContext getFillContext() + { + return fillContext; + } + + @Override + public void evaluate(byte evaluation) throws JRException + { + if (isEvaluateNow()) + { + evaluateMap(evaluation); + } + } + + protected void evaluateMap(byte evaluation) throws JRException + { + JRPropertiesHolder propertiesHolder = fillContext.getComponentElement().getParentProperties(); + JRPropertiesUtil util = JRPropertiesUtil.getInstance(fillContext.getFiller().getJasperReportsContext()); + clientId = util.getProperty(propertiesHolder, MapComponent.PROPERTY_CLIENT_ID); + signature = util.getProperty(propertiesHolder, MapComponent.PROPERTY_SIGNATURE); + key = util.getProperty(propertiesHolder, MapComponent.PROPERTY_KEY); + version = util.getProperty(propertiesHolder, MapComponent.PROPERTY_VERSION); + + Number lat = (Number)fillContext.evaluate(mapComponent.getLatitudeExpression(), evaluation); + latitude = lat == null ? null : lat.floatValue(); + + Number lg = (Number)fillContext.evaluate(mapComponent.getLongitudeExpression(), evaluation); + longitude = lg == null ? null : lg.floatValue(); + + if(latitude == null || longitude == null) { + center = (String)fillContext.evaluate(mapComponent.getAddressExpression(), evaluation); + Float[] coords = getCoords(center); + if(coords != null && coords[0] != null && coords[1] != null){ + latitude = coords[0]; + longitude = coords[1]; + } else { + throw + new JRException( + EXCEPTION_MESSAGE_KEY_INVALID_ADDRESS_COORDINATES, + new Object[]{MapComponent.ITEM_PROPERTY_latitude, MapComponent.ITEM_PROPERTY_longitude} + ); + } + } + zoom = (Integer)fillContext.evaluate(mapComponent.getZoomExpression(), evaluation); + zoom = zoom == null ? MapComponent.DEFAULT_ZOOM : zoom; + if(mapComponent.getLanguageExpression() != null) + { + language = (String)fillContext.evaluate(mapComponent.getLanguageExpression(), evaluation); + } + else + { + Locale locale = fillContext.getReportLocale(); + if(locale != null) + { + language = locale.getLanguage(); + } + } + mapType = mapComponent.getMapType() == null? MapTypeEnum.ROADMAP : mapComponent.getMapType(); + mapScale = mapComponent.getMapScale(); + imageType = mapComponent.getImageType(); + + if(markerDataList != null) { + markers = new ArrayList>(); + + for(FillItemData markerData : markerDataList) { + List> currentItemList = markerData.getEvaluateItems(evaluation); + if(currentItemList != null && !currentItemList.isEmpty()){ + for(Map currentItem : currentItemList){ + if(currentItem != null){ + markers.add(currentItem); + } + } + } + } + } + + if(pathDataList != null) { + addPathStyles(evaluation); + paths = new ArrayList>(); + Map> pathIds = new HashMap>(); + + for(FillItemData pathData : pathDataList) { + List> currentItemList = pathData.getEvaluateItems(evaluation); + if(currentItemList != null && !currentItemList.isEmpty()){ + for(Map currentItem : currentItemList){ + if(currentItem != null){ + String pathName = currentItem.get(MapComponent.ITEM_PROPERTY_name) != null ? (String)currentItem.get(MapComponent.ITEM_PROPERTY_name) : MapComponent.DEFAULT_PATH_NAME; + Map pathMap = null; + if(pathIds.containsKey(pathName)){ + pathMap = pathIds.get(pathName); + } else { + pathMap = new HashMap(); + pathMap.put(MapComponent.PARAMETER_PATH_LOCATIONS, new ArrayList>()); + pathIds.put(pathName, pathMap); + paths.add(pathMap); + } + setStyle((String)currentItem.get(MapComponent.ITEM_PROPERTY_style), pathMap); + boolean coordSet = false; + for(String key : currentItem.keySet()){ + if(!(MapComponent.ITEM_PROPERTY_name.equals(key) || MapComponent.ITEM_PROPERTY_style.equals(key))){ + if(MapComponent.ITEM_PROPERTY_latitude.equals(key) || MapComponent.ITEM_PROPERTY_longitude.equals(key)){ + if(!coordSet){ + if(currentItem.get(MapComponent.ITEM_PROPERTY_latitude) == null || currentItem.get(MapComponent.ITEM_PROPERTY_longitude) == null){ + throw new JRException( + EXCEPTION_MESSAGE_KEY_NULL_OR_EMPTY_VALUES_NOT_ALLOWED, + new Object[]{MapComponent.ITEM_PROPERTY_latitude, MapComponent.ITEM_PROPERTY_longitude} + ); + } + Map location = new HashMap(); + location.put(MapComponent.ITEM_PROPERTY_latitude, currentItem.get(MapComponent.ITEM_PROPERTY_latitude)); + location.put(MapComponent.ITEM_PROPERTY_longitude, currentItem.get(MapComponent.ITEM_PROPERTY_longitude)); + ((List>)pathMap.get(MapComponent.PARAMETER_PATH_LOCATIONS)).add(location); + coordSet = true; + } + } else { + pathMap.put(key, currentItem.get(key)); + } + } + } + } + } + } + } + } + onErrorType = mapComponent.getOnErrorType(); + } + + protected void addPathStyles(byte evaluation) throws JRException{ + styles = new HashMap>(); + if (pathStyleList != null) + { + for(FillItemData styleData : pathStyleList){ + List> currentStyleList = styleData.getEvaluateItems(evaluation); + if(currentStyleList != null && !currentStyleList.isEmpty()){ + for(Map currentStyle : currentStyleList){ + String styleName = (String)currentStyle.get(MapComponent.ITEM_PROPERTY_name); + if(styleName == null){ + throw + new JRException( + EXCEPTION_MESSAGE_KEY_NULL_OR_EMPTY_VALUE_NOT_ALLOWED, + new Object[]{MapComponent.ITEM_PROPERTY_name} + ); + } + Map styleMap = null; + if(styles.containsKey(styleName)){ + styleMap = styles.get(styleName); + } else { + styleMap = new HashMap(); + styles.put(styleName, styleMap); + } + setStyle(currentStyle, styleMap); + } + } + } + } + } + + protected void setStyle(String styleName, Map styleMap){ + if(styleName != null){ + Map parentStyleMap = styles.get(styleName); + if(parentStyleMap != null && ! parentStyleMap.isEmpty()){ + String parentStyleName = (String)parentStyleMap.get(MapComponent.ITEM_PROPERTY_style); + if(parentStyleName != null){ + setStyle(parentStyleName, styleMap); + } + setStyle(parentStyleMap, styleMap); + } + } + } + + protected void setStyle(Map parentStyleMap, Map styleMap){ + if(parentStyleMap != null){ + for(String styleProperty : parentStyleMap.keySet()) { + if(!(MapComponent.ITEM_PROPERTY_name.equals(styleProperty) + || MapComponent.ITEM_PROPERTY_latitude.equals(styleProperty) + || MapComponent.ITEM_PROPERTY_longitude.equals(styleProperty)) + && parentStyleMap.get(styleProperty) != null && parentStyleMap.get(styleProperty).toString().length() > 0){ + styleMap.put(styleProperty, parentStyleMap.get(styleProperty)); + } + } + } + } + + protected boolean isEvaluateNow() + { + return mapComponent.getEvaluationTime() == EvaluationTimeEnum.NOW; + } + + @Override + public FillPrepareResult prepare(int availableHeight) + { + return FillPrepareResult.PRINT_NO_STRETCH; +// return isEvaluateNow() && (latitude == null || longitude == null) +// ? FillPrepareResult.NO_PRINT_NO_OVERFLOW +// : FillPrepareResult.PRINT_NO_STRETCH; + } + + @Override + public JRPrintElement fill() + { + JRComponentElement element = fillContext.getComponentElement(); + JRTemplateGenericElement template = new JRTemplateGenericElement( + fillContext.getElementOrigin(), + fillContext.getDefaultStyleProvider(), + MapComponent.MAP_ELEMENT_TYPE); + template = deduplicate(template); + JRTemplateGenericPrintElement printElement = new JRTemplateGenericPrintElement(template, printElementOriginator); + printElement.setUUID(element.getUUID()); + printElement.setX(element.getX()); + printElement.setY(fillContext.getElementPrintY()); + printElement.setWidth(element.getWidth()); + printElement.setHeight(element.getHeight()); + + if (isEvaluateNow()) + { + copy(printElement); + } + else + { + fillContext.registerDelayedEvaluation(printElement, + mapComponent.getEvaluationTime(), mapComponent.getEvaluationGroup()); + } + + return printElement; + } + + @Override + public void evaluateDelayedElement(JRPrintElement element, byte evaluation) + throws JRException + { + evaluateMap(evaluation); + copy((JRGenericPrintElement) element); + } + + protected void copy(JRGenericPrintElement printElement) + { + printElement.setParameterValue(MapComponent.ITEM_PROPERTY_latitude, latitude); + printElement.setParameterValue(MapComponent.ITEM_PROPERTY_longitude, longitude); + printElement.setParameterValue(MapComponent.PARAMETER_ZOOM, zoom); + String reqParams = ""; + if(language != null) + { + reqParams += "&language=" + language; + } + if(clientId != null) { + reqParams += "&client=" + clientId; + if(signature != null) { + reqParams += "&signature=" + signature; + } + } else if(key != null) { + reqParams += "&key=" + key; + } + if(version != null) { + reqParams += "&v=" + version; + } + if(reqParams.length() > 0) { + printElement.setParameterValue(MapComponent.PARAMETER_REQ_PARAMS, reqParams); + } + if(mapType != null) + { + printElement.setParameterValue(MapComponent.ATTRIBUTE_MAP_TYPE, mapType.getName()); + } + if(mapScale != null) + { + printElement.setParameterValue(MapComponent.ATTRIBUTE_MAP_SCALE, mapScale.getName()); + } + if(imageType != null) + { + printElement.setParameterValue(MapComponent.ATTRIBUTE_IMAGE_TYPE, imageType.getName()); + } + if(onErrorType != null) + { + printElement.setParameterValue(MapComponent.PARAMETER_ON_ERROR_TYPE, onErrorType.getName()); + } + if(markers != null && !markers.isEmpty()) + { + printElement.setParameterValue(MapComponent.PARAMETER_MARKERS, markers); + } + if(paths != null && !paths.isEmpty()) + { + printElement.setParameterValue(MapComponent.PARAMETER_PATHS, paths); + } + } + + private Float[] getCoords(String address) throws JRException { + Float[] coords = null; + if(address != null) { + try { + String url = PLACE_URL_PREFIX + URLEncoder.encode(address, DEFAULT_ENCODING) + PLACE_URL_SUFFIX; + byte[] response = read(url); + Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(response)); + Node statusNode = (Node) new DOMXPath(STATUS_NODE).selectSingleNode(document); + String status = statusNode.getTextContent(); + if(STATUS_OK.equals(status)) { + coords = new Float[2]; + Node latNode = (Node) new DOMXPath(LATITUDE_NODE).selectSingleNode(document); + coords[0] = Float.valueOf(latNode.getTextContent()); + Node lngNode = (Node) new DOMXPath(LONGITUDE_NODE).selectSingleNode(document); + coords[1] = Float.valueOf(lngNode.getTextContent()); + } else { + throw + new JRException( + EXCEPTION_MESSAGE_KEY_ADDRESS_REQUEST_FAILED, + new Object[]{status} + ); + } + } catch (Exception e) { + throw new JRException(e); + } + } + return coords; + } + + private byte[] read(String url) throws IOException { + InputStream stream = null; + try { + URL u = new URL(url); + stream = u.openStream(); + ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); + byte[] buf = new byte[4096]; + int read; + while ((read = stream.read(buf)) > 0) { + byteOut.write(buf, 0, read); + } + return byteOut.toByteArray(); + } finally { + if(stream != null) { + stream.close(); + } + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/MapFillFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/MapFillFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/MapFillFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/MapFillFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,56 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.fill; + +import net.sf.jasperreports.components.map.MapComponent; +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.component.ComponentFillFactory; +import net.sf.jasperreports.engine.component.FillComponent; +import net.sf.jasperreports.engine.fill.JRFillCloneFactory; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class MapFillFactory implements ComponentFillFactory +{ + + @Override + public FillComponent toFillComponent(Component component, + JRFillObjectFactory factory) + { + MapComponent map = (MapComponent) component; + return new MapFillComponent(map, factory); + } + + @Override + public FillComponent cloneFillComponent(FillComponent component, + JRFillCloneFactory factory) + { + MapFillComponent fillMap = (MapFillComponent) component; + return new MapFillComponent(fillMap.getMap()); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/MarkerFillDatasetRun.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/MarkerFillDatasetRun.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/MarkerFillDatasetRun.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/MarkerFillDatasetRun.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,59 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.fill; + +import net.sf.jasperreports.components.list.FillDatasetRun; +import net.sf.jasperreports.engine.JRDatasetRun; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.fill.JRFillDataset; +import net.sf.jasperreports.engine.fill.JRFillObjectFactory; + + +/** + * Used to iterate on a subdataset and create a sorted data source. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class MarkerFillDatasetRun extends FillDatasetRun +{ + +// private JRSortField[] allSortFields; +// private SortInfo sortInfo; +// private int recordIndex; +// private List records; + + + public MarkerFillDatasetRun(JRDatasetRun datasetRun, JRFillObjectFactory factory) throws JRException + { + super(datasetRun, factory); + } + + + @Override + protected JRFillDataset getDataset() + { + // only added here for visibility + return super.getDataset(); + } +} \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/fill/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/fill/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +/** + * Contains fill time implementations for Google Map component related interfaces. + */ +package net.sf.jasperreports.components.map.fill; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/ItemData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/ItemData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/ItemData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/ItemData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.util.List; + +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRElementDataset; + +/** + * The ItemData interface + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated Replaced by {@link net.sf.jasperreports.components.items.ItemData}. + */ +public interface ItemData extends JRCloneable +{ + + /** + * Returns a list of {@link net.sf.jasperreports.components.map.Item Item} + * objects. Each item in the list provides a collection of item properties. + * + * @return a list of items + * + * @see net.sf.jasperreports.components.map.Item + * @see net.sf.jasperreports.components.map.ItemProperty + */ + public List getItems(); + + /** + * Returns the dataset information that will be used by the {@link net.sf.jasperreports.components.map.ItemData ItemData} object. + *

    + * This information is required either to use the main dataset or to instantiate a + * subdataset from the report. The data produced by the subdataset is fed to the items list. + * + * @return the dataset + * @see net.sf.jasperreports.engine.JRElementDataset + */ + public JRElementDataset getDataset(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/ItemDatasetFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/ItemDatasetFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/ItemDatasetFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/ItemDatasetFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated Replaced by {@link net.sf.jasperreports.components.items.ItemDatasetFactory}. + */ +public class ItemDatasetFactory extends net.sf.jasperreports.components.items.ItemDatasetFactory +{ +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/ItemDataXmlFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/ItemDataXmlFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/ItemDataXmlFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/ItemDataXmlFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated Replaced by {@link net.sf.jasperreports.components.items.ItemDataXmlFactory}. + */ +public class ItemDataXmlFactory extends net.sf.jasperreports.components.items.ItemDataXmlFactory +{ +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/Item.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/Item.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/Item.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/Item.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.util.List; + +import net.sf.jasperreports.engine.JRCloneable; + +/** + * The Item interface. Provides a collection of item properties. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated Replaced by {@link net.sf.jasperreports.components.items.Item}. + */ +public interface Item extends JRCloneable +{ + + /** + * Returns a list of {@link net.sf.jasperreports.components.map.ItemProperty ItemProperty} objects. + * Each item property provides a name-value pair. + * + * @return a list of item properties + * @see net.sf.jasperreports.components.map.ItemProperty + */ + public List getProperties(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/ItemProperty.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/ItemProperty.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/ItemProperty.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/ItemProperty.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,62 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRExpression; + +/** + * The ItemProperty interface. An item property has a name (required) and a + * value provided either in a static way, using the value attribute, + * or dynamically, using a value expression. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated Replaced by {@link net.sf.jasperreports.components.items.ItemProperty}. + */ +public interface ItemProperty extends JRCloneable +{ + + /** + * Returns the name of the item property (required). + * @return the property name + */ + String getName(); + + /** + * Returns the value attribute of the item property. Only + * java.lang.String values are allowed for this attribute. + * @return the value attribute + */ + String getValue(); + + /** + * Returns a {@link net.sf.jasperreports.engine.JRExpression JRExpression} representing + * the value object for the item property. If present, it overrides the value given by + * the value attribute. + * + * @return the value expression + */ + JRExpression getValueExpression(); + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/ItemPropertyXmlFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/ItemPropertyXmlFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/ItemPropertyXmlFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/ItemPropertyXmlFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated Replaced by {@link net.sf.jasperreports.components.items.ItemPropertyXmlFactory}. + */ +public class ItemPropertyXmlFactory extends net.sf.jasperreports.components.items.ItemPropertyXmlFactory +{ +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/ItemXmlFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/ItemXmlFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/ItemXmlFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/ItemXmlFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated Replaced by {@link net.sf.jasperreports.components.items.ItemXmlFactory}. + */ +public class ItemXmlFactory extends net.sf.jasperreports.components.items.ItemXmlFactory +{ +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapCompiler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapCompiler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapCompiler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapCompiler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,187 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.components.items.ItemCompiler; +import net.sf.jasperreports.components.items.ItemData; +import net.sf.jasperreports.engine.JRDatasetRun; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.component.ComponentCompiler; +import net.sf.jasperreports.engine.design.JRVerifier; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class MapCompiler implements ComponentCompiler +{ + + private final static Map addressMap = new HashMap(); + static { + addressMap.put(MapComponent.ITEM_PROPERTY_latitude, MapComponent.ITEM_PROPERTY_address); + addressMap.put(MapComponent.ITEM_PROPERTY_longitude, MapComponent.ITEM_PROPERTY_address); + } + + @Override + public void collectExpressions(Component component, JRExpressionCollector collector) + { + MapComponent map = (MapComponent) component; + collector.addExpression(map.getLatitudeExpression()); + collector.addExpression(map.getLongitudeExpression()); + collector.addExpression(map.getAddressExpression()); + collector.addExpression(map.getZoomExpression()); + collector.addExpression(map.getLanguageExpression()); + + List markerDataList = map.getMarkerDataList(); + if(markerDataList != null && markerDataList.size() > 0) { + for(ItemData markerData : markerDataList){ + ItemCompiler.collectExpressions(markerData, collector); + } + } + List pathStyleList = map.getPathStyleList(); + if(pathStyleList != null && pathStyleList.size() > 0) { + for(ItemData pathStyle : pathStyleList){ + ItemCompiler.collectExpressions(pathStyle, collector); + } + } + List pathDataList = map.getPathDataList(); + if(pathDataList != null && pathDataList.size() > 0) { + for(ItemData pathData : pathDataList){ + ItemCompiler.collectExpressions(pathData, collector); + } + } + } + + /** + * @deprecated Replaced by {@link ItemCompiler#collectExpressions(ItemData, JRExpressionCollector)}. + */ + public static void collectExpressions(ItemData data, JRExpressionCollector collector) + { + ItemCompiler.collectExpressions(data, collector); + } + + /** + * @deprecated Replaced by {@link ItemCompiler#collectExpressions(ItemData, JRExpressionCollector)}. + */ + public static void collectExpressions(MarkerDataset dataset, JRExpressionCollector collector) + { + if(dataset != null) + { + JRExpressionCollector datasetCollector = collector; + + JRDatasetRun datasetRun = dataset.getDatasetRun(); + if (datasetRun != null) + { + collector.collect(datasetRun); + datasetCollector = collector.getDatasetCollector(datasetRun.getDatasetName()); + } + + List markers = dataset.getMarkers(); + if (markers != null && !markers.isEmpty()) + { + for(Marker marker : markers) + { + List markerProperties = marker.getProperties(); + if(markerProperties != null) + { + for(MarkerProperty property : markerProperties) + { + datasetCollector.addExpression(property.getValueExpression()); + } + } + } + } + } + } + + @Override + public Component toCompiledComponent(Component component, + JRBaseObjectFactory baseFactory) + { + MapComponent map = (MapComponent) component; + return new StandardMapComponent(map, baseFactory); + } + + @Override + public void verify(Component component, JRVerifier verifier) + { + MapComponent map = (MapComponent) component; + + EvaluationTimeEnum evaluationTime = map.getEvaluationTime(); + if (evaluationTime == EvaluationTimeEnum.AUTO) + { + verifier.addBrokenRule("Auto evaluation time is not supported for maps", map); + } + else if (evaluationTime == EvaluationTimeEnum.GROUP) + { + String evaluationGroup = map.getEvaluationGroup(); + if (evaluationGroup == null || evaluationGroup.length() == 0) + { + verifier.addBrokenRule("No evaluation group set for map", map); + } + else if (!verifier.getReportDesign().getGroupsMap().containsKey(evaluationGroup)) + { + verifier.addBrokenRule("Map evaluation group \"" + + evaluationGroup + " not found", map); + } + } + + if((map.getLatitudeExpression() == null || map.getLongitudeExpression() == null) && map.getAddressExpression() == null){ + verifier.addBrokenRule("Missing the latitude and/or the longitude expression for the map center. Try to configure them properly, or configure the equivalent addressExpression for this map.", map); + } + + String[] reqNames = new String[]{MapComponent.ITEM_PROPERTY_latitude, MapComponent.ITEM_PROPERTY_longitude}; + List markerDataList = map.getMarkerDataList(); + if (markerDataList != null && markerDataList.size() > 0) + { + for(ItemData markerData : markerDataList){ + ItemCompiler.verifyItemData(verifier, markerData, MapComponent.ELEMENT_MARKER_DATA, reqNames, addressMap); + } + } + + List pathStyleList = map.getPathStyleList(); + if (pathStyleList != null && pathStyleList.size() > 0) + { + for(ItemData pathStyle : pathStyleList){ + ItemCompiler.verifyItemData(verifier, pathStyle, MapComponent.ELEMENT_PATH_STYLE, new String[]{MapComponent.ITEM_PROPERTY_name}, null); + } + } + + List pathDataList = map.getPathDataList(); + if (pathDataList != null && pathDataList.size() > 0) + { + for(ItemData pathData : pathDataList){ + ItemCompiler.verifyItemData(verifier, pathData, MapComponent.ELEMENT_PATH_DATA, reqNames, addressMap); + } + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,701 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.util.List; + +import net.sf.jasperreports.components.items.ItemData; +import net.sf.jasperreports.components.map.type.MapImageTypeEnum; +import net.sf.jasperreports.components.map.type.MapScaleEnum; +import net.sf.jasperreports.components.map.type.MapTypeEnum; +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRGenericElementType; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.component.Component; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; +import net.sf.jasperreports.engine.type.OnErrorTypeEnum; +import net.sf.jasperreports.engine.xml.JRXmlConstants; + +/** + * The Map component interface. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public interface MapComponent extends Component, JRCloneable +{ + // properties at report element level: + + public static final String PROPERTY_PREFIX = JRPropertiesUtil.PROPERTY_PREFIX + "components.map."; + public static final String PROPERTY_KEY = PROPERTY_PREFIX + "key"; + public static final String PROPERTY_CLIENT_ID = PROPERTY_PREFIX + "client.id"; + public static final String PROPERTY_SIGNATURE = PROPERTY_PREFIX + "signature"; + public static final String PROPERTY_VERSION = PROPERTY_PREFIX + "version"; + + // map attributes: + + /** + * The attribute that provides the map type. Possible values are: + *

      + *
    • roadmap (default)
    • + *
    • satellite
    • + *
    • terrain
    • + *
    • hybrid
    • + *
    + */ + public static final String ATTRIBUTE_MAP_TYPE = "mapType"; + + /** + * Applies to static maps only. This attribute specifies the behavior of the engine when the + * image is not available. Possible values are: + *
      + *
    • Error (default)
    • + *
    • Blank
    • + *
    • Icon
    • + *
    + */ + public static final String ATTRIBUTE_ON_ERROR_TYPE = "onErrorType"; + + /** + * Numeric (positive integer) attribute that provides the scale value used to return higher-resolution map images + * when working with high resolution screens available on mobile devices. Possible values are: + *
      + *
    • 1 (default)
    • + *
    • 2
    • + *
    • 4 (for Business customers only)
    • + *
    + */ + public static final String ATTRIBUTE_MAP_SCALE = "mapScale"; + + /** + * This attribute represents the image format of the map. Possible values are: + *
      + *
    • png (default)
    • + *
    • png8
    • + *
    • png32
    • + *
    • gif
    • + *
    • jpg
    • + *
    • jpg-baseline
    • + *
    + */ + public static final String ATTRIBUTE_IMAGE_TYPE = "imageType"; + + // common item properties: + + /** + * Numeric floating-point value representing the latitude of the place on the map; + * required if no equivalent {@link #ITEM_PROPERTY_address} is set. + *

    + * Applies to items in markerData and pathData. + */ + public static final String ITEM_PROPERTY_latitude = "latitude"; + + /** + * Numeric floating-point value representing the longitude of the place on the map; + * required if no equivalent {@link #ITEM_PROPERTY_address} is set. + *

    + * Applies to items in markerData and pathData. + */ + public static final String ITEM_PROPERTY_longitude = "longitude"; + + /** + * Specifies the address of a given point on the map. + *

    + * The address-based geo-location is considered only if no {@link #ITEM_PROPERTY_latitude} + * and {@link #ITEM_PROPERTY_longitude} properties are set. + *

    + * Applies to items in markerData and pathData. + */ + public static final String ITEM_PROPERTY_address = "address"; + + /** + * String value representing the name, as unique identifier. + *

    + * Applies to items in pathData and pathStyle. It is required for items in pathStyle + * and optional for items in pathData. Default name for items in pathData is {@link #DEFAULT_PATH_NAME}. + */ + public static final String ITEM_PROPERTY_name = "name"; + + /** + * String value representing the name of a path style (in pathData) or the name of the + * parent style (in pathStyle); optional. + *

    + * Applies to items in pathData and pathStyle. + *

    + * If not provided, the path will be generated using Google default style settings for paths. + */ + public static final String ITEM_PROPERTY_style = "style"; + + /** + * boolean value that specifies if this item (marker or path) is clickable; optional. Default value is true. + *

    + * Applies to items in markerData and pathStyle. + */ + public static final String ITEM_PROPERTY_clickable = "clickable"; + + /** + * boolean value that specifies if this item (marker or path) is draggable; optional. Default value is false. + *

    + * Applies to items in markerData and pathStyle. + */ + public static final String ITEM_PROPERTY_draggable = "draggable"; + + /** + * boolean value that specifies if this item (marker or path) is visible on the map; optional. Default value is true. + *

    + * Applies to items in markerData and pathStyle. + */ + public static final String ITEM_PROPERTY_visible = "visible"; + + /** + * Integer value representing the z index of this item (marker or path); optional. + *

    + * Applies to items in markerData and pathStyle. + */ + public static final String ITEM_PROPERTY_MARKER_zIndex = "zIndex"; + + // item properties for markerData: + + /** + * String value representing the tooltip for the marker icon; optional. + */ + public static final String ITEM_PROPERTY_MARKER_title = "title"; + + /** + * String value representing a link to a page or document that will be open when the marker is clicked on; optional. + * @see #ITEM_PROPERTY_MARKER_INFOWINDOW_content + */ + public static final String ITEM_PROPERTY_MARKER_url = "url"; + + /** + * String value representing the hyperlink target for the marker; optional. + *

    + * Allowed values are: + *

      + *
    • _blank (default)
    • + *
    • _parent
    • + *
    • _self
    • + *
    • _top
    • + *
    • a valid window/frame name
    • + *
    + */ + public static final String ITEM_PROPERTY_MARKER_target = "target"; + + /** + * Optional String value representing the color for the default pin icons. This property is taken + * into account when {@link #ITEM_PROPERTY_MARKER_ICON_url} property is not set. Its value may represent: + *

    + *

      + *
    • one of the predefined color names in the following list (see also ColorEnum): + *
        + *
      • black
      • + *
      • blue
      • + *
      • cyan
      • + *
      • darkGray
      • + *
      • gray
      • + *
      • green
      • + *
      • lightGray
      • + *
      • magenta
      • + *
      • orange
      • + *
      • pink
      • + *
      • red(default)
      • + *
      • yellow
      • + *
      • white
      • + *
      + *
    • + *
    • a valid color hex code (prefixed by #). For instance: #0000FF.
    • + *
    • the color RGB value.
    • + *
    + */ + public static final String ITEM_PROPERTY_MARKER_color = "color"; + + /** + * String value representing the label for the default pin icons; optional. This property is taken into account + * when {@link #ITEM_PROPERTY_MARKER_ICON_url} property is not set. + */ + public static final String ITEM_PROPERTY_MARKER_label = "label"; + + /** + * String value representing the cursor value; optional. + */ + public static final String ITEM_PROPERTY_MARKER_cursor = "cursor"; + + /** + * Predefined String value representing the default marker icon size; optional. + *

    + * This property is considered for static maps only. Allowed values are: + *

      + *
    • mid
    • + *
    • tiny
    • + *
    • small
    • + *
    + */ + public static final String ITEM_PROPERTY_MARKER_size = "size"; + + /** + * boolean value that specifies if the marker icon is flat; optional. + */ + public static final String ITEM_PROPERTY_MARKER_flat = "flat"; + + /** + * boolean value that specifies if the marker icon is optimized; optional. + */ + public static final String ITEM_PROPERTY_MARKER_optimized = "optimized"; + + /** + * boolean value to be applied for the raiseOnDrag property; optional. + */ + public static final String ITEM_PROPERTY_MARKER_raiseOnDrag = "raiseOnDrag"; + + // marker icon properties + + /** + * String value representing the URL where the marker icon is loaded from; optional. + *

    + * This property is overriden by the {@link #ITEM_PROPERTY_MARKER_ICON_url} property value. + */ + public static final String ITEM_PROPERTY_MARKER_icon = "icon"; + + /** + * String value representing the URL where the marker icon is loaded from; optional. + *

    + * When is set, it overrides the value of {@link #ITEM_PROPERTY_MARKER_icon} property. + *

    + * If not set, a default google pin icon will be loaded. + */ + public static final String ITEM_PROPERTY_MARKER_ICON_url = "icon.url"; + + /** + * Integer value representing the icon width, in pixels. To be considered, + * {@link #ITEM_PROPERTY_MARKER_ICON_height} must be also set. + *

    + * This property is optional. + */ + public static final String ITEM_PROPERTY_MARKER_ICON_width = "icon.width"; + + /** + * Integer value representing the icon height, in pixels. To be considered, + * {@link #ITEM_PROPERTY_MARKER_ICON_width} must be also set. + *

    + * This property is optional. + */ + public static final String ITEM_PROPERTY_MARKER_ICON_height = "icon.height"; + + /** + * Integer value representing the horizontal position of the marker icon within a sprite, + * if any, in pixels. Default value is 0. + *

    + * This property is optional. + */ + public static final String ITEM_PROPERTY_MARKER_ICON_ORIGIN_x = "icon.origin.x"; + + /** + * Integer value representing the vertical position of the marker icon within a sprite, if any, + * in pixels. Default value is 0. + *

    + * This property is optional. + */ + public static final String ITEM_PROPERTY_MARKER_ICON_ORIGIN_y = "icon.origin.y"; + + /** + * Integer value representing the horizontal position to anchor the marker icon with respect to the + * location of the marker on the map. Default value is 0. + *

    + * This property is optional. + */ + public static final String ITEM_PROPERTY_MARKER_ICON_ANCHOR_x = "icon.anchor.x"; + + /** + * Integer value representing the vertical position to anchor the marker icon with respect to the + * location of the marker on the map. Default value is 0. + *

    + * This property is optional. + */ + public static final String ITEM_PROPERTY_MARKER_ICON_ANCHOR_y = "icon.anchor.y"; + + // marker shadow properties + + /** + * String value representing the URL where the custom marker shadow icon is loaded from; optional. + *

    + * This property is overriden by {@link #ITEM_PROPERTY_MARKER_SHADOW_url}. + */ + public static final String ITEM_PROPERTY_MARKER_shadow = "shadow"; + + /** + * String value representing the URL where the custom marker shadow icon is loaded from; optional. + *

    + * When is set, it overrides the value of the {@link #ITEM_PROPERTY_MARKER_shadow} property. + */ + public static final String ITEM_PROPERTY_MARKER_SHADOW_url = "shadow.url"; + + /** + * Integer value representing the shadow icon width, in pixels. To be considered, + * {@link #ITEM_PROPERTY_MARKER_SHADOW_height} must be also set. + *

    + * This property is optional. + */ + public static final String ITEM_PROPERTY_MARKER_SHADOW_width = "shadow.width"; + + /** + * Integer value representing the shadow icon height, in pixels. To be considered, + * {@link #ITEM_PROPERTY_MARKER_SHADOW_width} must be also set. + *

    + * This property is optional. + */ + public static final String ITEM_PROPERTY_MARKER_SHADOW_height = "shadow.height"; + + /** + * Integer value representing the horizontal position of the shadow icon within a sprite, + * if any, in pixels. Default value is 0. + *

    + * This property is optional. + */ + public static final String ITEM_PROPERTY_MARKER_SHADOW_ORIGIN_x = "shadow.origin.x"; + + /** + * Integer value representing the vertical position of the shadow icon within a sprite, if any, + * in pixels. Default value is 0. + *

    + * This property is optional. + */ + public static final String ITEM_PROPERTY_MARKER_SHADOW_ORIGIN_y = "shadow.origin.y"; + + /** + * Integer value representing the horizontal position to anchor the shadow icon with respect to the + * location of the marker on the map. Default value is 0. + *

    + * This property is optional. + */ + public static final String ITEM_PROPERTY_MARKER_SHADOW_ANCHOR_x = "shadow.anchor.x"; + + /** + * Integer value representing the vertical position to anchor the shadow icon with respect to the + * location of the marker on the map. Default value is 0. + *

    + * This property is optional. + */ + public static final String ITEM_PROPERTY_MARKER_SHADOW_ANCHOR_y = "shadow.anchor.y"; + + // marker infowindow properties + + /** + * String value representing the content to be displayed in an info window; optional. Empty contents are not processed. + * When a marker icon is clicked on the map, additional information can be displayed either in a separate + * window/frame or in an info window floating above the map. + *

    + * If both {@link #ITEM_PROPERTY_MARKER_url} and info window settings are present in a marker definition, the info window takes precedence + * over the marker URL. Clicking on the marker icon will open the info window. + * @see #ITEM_PROPERTY_MARKER_url + */ + public static final String ITEM_PROPERTY_MARKER_INFOWINDOW_content = "infowindow.content"; + + /** + * Optional integer value representing the offset (in pixels) from the tip of the info window to the location + * on which the info window is anchored. Default value is 0. + */ + public static final String ITEM_PROPERTY_MARKER_INFOWINDOW_pixelOffset = "infowindow.pixelOffset"; + + /** + * Optional integer value representing the maximum width in pixels of the info window. + */ + public static final String ITEM_PROPERTY_MARKER_INFOWINDOW_maxWidth = "infowindow.maxWidth"; + + /** + * Optional floating-point value representing the latitude used to determine the info window position on the map. + * Neglected for info windows attached to markers. + */ + public static final String ITEM_PROPERTY_MARKER_INFOWINDOW_latitude = "infowindow.latitude"; + + /** + * Optional floating-point value representing the longitude used to determine the info window position on the map. + * Neglected for info windows attached to markers. + */ + public static final String ITEM_PROPERTY_MARKER_INFOWINDOW_longitude = "infowindow.longitude"; + + // item properties for pathData: + // see the common item properties that can be applied for items in pathData. + + // item properties for pathStyle: + + /** + * Flag that specifies whether the path is a polygon; optional. + *

    + * Default value: false. + */ + public static final String ITEM_PROPERTY_STYLE_isPolygon = "isPolygon"; + + /** + * Numeric integer value representing the stroke weight; optional. + */ + public static final String ITEM_PROPERTY_STYLE_strokeWeight = "strokeWeight"; + + /** + * The color of the stroke; optional. Can be represented as #-prefixed HTML color code or as predefined HTML color name + */ + public static final String ITEM_PROPERTY_STYLE_strokeColor = "strokeColor"; + + /** + * Numeric floating-point value in [0..1] representing the opacity of the path stroke; optional. + */ + public static final String ITEM_PROPERTY_STYLE_strokeOpacity = "strokeOpacity"; + + /** + * String value representing the color of the fill; optional. + *

    + * Can be represented as #-prefixed HTML color code or as predefined HTML color name + */ + public static final String ITEM_PROPERTY_STYLE_fillColor = "fillColor"; + + /** + * Numeric floating-point value in [0..1] representing the opacity of the path fill; optional. + */ + public static final String ITEM_PROPERTY_STYLE_fillOpacity = "fillOpacity"; + + /** + * Flag that specifies if the path is editable; optional. + */ + public static final String ITEM_PROPERTY_STYLE_editable = "editable"; + + /** + * Flag that specifies if the path is geodesic; optional. + */ + public static final String ITEM_PROPERTY_STYLE_geodesic = "geodesic"; + + // map elements + + public static final String ELEMENT_MARKER_DATA = "markerData"; + public static final String ELEMENT_PATH_STYLE = "pathStyle"; + public static final String ELEMENT_PATH_DATA = "pathData"; + + // generic element parameters: + + /** + * The name of map generic elements. + */ + public static final String MAP_ELEMENT_NAME = "map"; + + /** + * The qualified type of Flash generic elements. + */ + public static final JRGenericElementType MAP_ELEMENT_TYPE = + new JRGenericElementType(JRXmlConstants.JASPERREPORTS_NAMESPACE, MAP_ELEMENT_NAME); + + /** + * The name of the parameter that provides the onErrorType attribute. + */ + public static final String PARAMETER_ON_ERROR_TYPE = "onErrorType"; + + /** + * The name of the parameter that provides the list of marker objects for the map. + */ + public static final String PARAMETER_MARKERS = "markers"; + + /** + * The name of the parameter that provides the map language. + */ + public static final String PARAMETER_LANGUAGE = "language"; + + /** + * The name of the parameter that provides the zoom factor. + */ + public static final String PARAMETER_ZOOM = "zoom"; + + /** + * The cached image renderer. + */ + public static final String PARAMETER_CACHE_RENDERER = "cacheRenderer"; + + /** + * The name of the parameter that provides the Google API map request parameters. + */ + public static final String PARAMETER_REQ_PARAMS = "reqParams"; + + /** + * The name of the flag parameter that specifies paths on the map + */ + public static final String PARAMETER_PATHS = "paths"; + + /** + * The name of the parameter that provides the path locations. + */ + public static final String PARAMETER_PATH_LOCATIONS = "locations"; + + // map defaults: + + public static final Float DEFAULT_LATITUDE = 0f; + public static final Float DEFAULT_LONGITUDE = 0f; + public static final Integer DEFAULT_ZOOM = 0; + public static final MapTypeEnum DEFAULT_MAP_TYPE = MapTypeEnum.ROADMAP; + public static final OnErrorTypeEnum DEFAULT_ON_ERROR_TYPE = OnErrorTypeEnum.ERROR; + public static final String DEFAULT_PATH_NAME = "DEFAULT_PATH_NAME"; + + + + /** + * Returns a {@link net.sf.jasperreports.engine.JRExpression JRExpression} + * representing the latitude coordinate of the map center + * + * @return the latitude expression + */ + JRExpression getLatitudeExpression(); + + /** + * Returns a {@link net.sf.jasperreports.engine.JRExpression JRExpression} + * representing the longitude coordinate of the map center + * + * @return the longitude expression + */ + JRExpression getLongitudeExpression(); + + /** + * Returns a {@link net.sf.jasperreports.engine.JRExpression JRExpression} + * representing the address of the map center. If no latitude or longitude + * coordinates are provided, the address expression will be used to calculate + * these coordinates + * + * @return the address expression + */ + JRExpression getAddressExpression(); + + /** + * Returns a numeric expression + * representing the zoom factor of the map. + * + * @return the zoom expression + */ + JRExpression getZoomExpression(); + + /** + * Returns a {@link net.sf.jasperreports.engine.JRExpression JRExpression} + * representing the language for the labels on the map. + * + * @return the language expression + */ + JRExpression getLanguageExpression(); + + /** + * Returns the evaluation time of the map component element + * + * @return the evaluation time + */ + EvaluationTimeEnum getEvaluationTime(); + + /** + * Returns the evaluation group name for the map component element + * + * @return the evaluation group + */ + String getEvaluationGroup(); + + /** + * Returns the type of the Google map. Possible values are: + *

      + *
    • {@link net.sf.jasperreports.components.map.type.MapTypeEnum#ROADMAP ROADMAP} (default value)
    • + *
    • {@link net.sf.jasperreports.components.map.type.MapTypeEnum#SATELLITE SATELLITE}
    • + *
    • {@link net.sf.jasperreports.components.map.type.MapTypeEnum#TERRAIN TERRAIN}
    • + *
    • {@link net.sf.jasperreports.components.map.type.MapTypeEnum#HYBRID HYBRID}
    • + *
    + * @return the type of the Google map + * @see net.sf.jasperreports.components.map.type.MapTypeEnum + */ + MapTypeEnum getMapType(); + + /** + * Returns the scale factor of the Google map used to return higher-resolution map images when + * working with high resolution screens available on mobile devices. Possible values are: + *
      + *
    • 1 (default value)
    • + *
    • 2
    • + *
    • 4 (for Business customers only)
    • + *
    + * @return the scale factor + */ + MapScaleEnum getMapScale(); + + /** + * Returns the image format of the map. Possible values are: + *
      + *
    • {@link net.sf.jasperreports.components.map.type.MapImageTypeEnum#PNG PNG} (default value)
    • + *
    • {@link net.sf.jasperreports.components.map.type.MapImageTypeEnum#PNG_8 PNG_8}
    • + *
    • {@link net.sf.jasperreports.components.map.type.MapImageTypeEnum#PNG_32 PNG_32}
    • + *
    • {@link net.sf.jasperreports.components.map.type.MapImageTypeEnum#GIF GIF}
    • + *
    • {@link net.sf.jasperreports.components.map.type.MapImageTypeEnum#JPG JPG}
    • + *
    • {@link net.sf.jasperreports.components.map.type.MapImageTypeEnum#JPG_BASELINE JPG_BASELINE}
    • + *
    + * @return the image format of the map + * @see net.sf.jasperreports.components.map.type.MapImageTypeEnum + */ + MapImageTypeEnum getImageType(); + + /** + * Returns an attribute that customizes the way the engine handles a missing map image + * during report generation. Possible values are: + *
      + *
    • {@link net.sf.jasperreports.engine.type.OnErrorTypeEnum#ERROR ERROR} (default value)
    • + *
    • {@link net.sf.jasperreports.engine.type.OnErrorTypeEnum#BLANK BLANK}
    • + *
    • {@link net.sf.jasperreports.engine.type.OnErrorTypeEnum#ICON ICON}
    • + *
    + * @return the onErrorType attribute + * @see net.sf.jasperreports.engine.type.OnErrorTypeEnum + */ + OnErrorTypeEnum getOnErrorType(); + + /** + * Returns a list of {@link ItemData ItemData} objects + * representing collections of markers on the map + * + * @return a list of marker data + * @see ItemData + */ + List getMarkerDataList(); + + /** + * Returns a list of {@link ItemData ItemData} objects + * representing collections of path styles for the map + * + * @return a list of path styles + * @see ItemData + */ + List getPathStyleList(); + + /** + * Returns a list of {@link ItemData ItemData} objects + * representing collections of paths on the map + * + * @return a list of path data + * @see ItemData + */ + List getPathDataList(); + + /** + * @deprecated Replaced by {@link #getMarkerDataList()}. + */ + ItemData getMarkerData(); + + /** + * @deprecated Replaced by {@link #getMarkerDataList()}. + */ + MarkerDataset getMarkerDataset(); +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapDesignConverter.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapDesignConverter.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapDesignConverter.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapDesignConverter.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,67 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.JRComponentElement; +import net.sf.jasperreports.engine.JRElement; +import net.sf.jasperreports.engine.JRPrintElement; +import net.sf.jasperreports.engine.component.ComponentDesignConverter; +import net.sf.jasperreports.engine.convert.ElementIconConverter; +import net.sf.jasperreports.engine.convert.ReportConverter; +import net.sf.jasperreports.engine.util.JRImageLoader; + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class MapDesignConverter extends ElementIconConverter implements ComponentDesignConverter +{ + + /** + * + */ + private final static MapDesignConverter INSTANCE = new MapDesignConverter(); + + /** + * + */ + private MapDesignConverter() + { + super(JRImageLoader.SUBREPORT_IMAGE_RESOURCE); + } + + /** + * + */ + public static MapDesignConverter getInstance() + { + return INSTANCE; + } + + @Override + public JRPrintElement convert(ReportConverter reportConverter, JRComponentElement element) + { + return convert(reportConverter, (JRElement)element); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementDocxHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementDocxHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementDocxHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementDocxHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,71 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.export.JRExporterGridCell; +import net.sf.jasperreports.engine.export.ooxml.GenericElementDocxHandler; +import net.sf.jasperreports.engine.export.ooxml.JRDocxExporter; +import net.sf.jasperreports.engine.export.ooxml.JRDocxExporterContext; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MapElementDocxHandler implements GenericElementDocxHandler +{ + private static final MapElementDocxHandler INSTANCE = new MapElementDocxHandler(); + + public static MapElementDocxHandler getInstance() + { + return INSTANCE; + } + + @Override + public void exportElement( + JRDocxExporterContext exporterContext, + JRGenericPrintElement element, + JRExporterGridCell gridCell + ) + { + try + { + JRDocxExporter exporter = (JRDocxExporter)exporterContext.getExporterRef(); + exporter.exportImage( + exporterContext.getTableHelper(), + MapElementImageProvider.getImage(exporterContext.getJasperReportsContext(), element), + gridCell + ); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementGraphics2DHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementGraphics2DHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementGraphics2DHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementGraphics2DHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.awt.Graphics2D; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.export.GenericElementGraphics2DHandler; +import net.sf.jasperreports.engine.export.JRGraphics2DExporter; +import net.sf.jasperreports.engine.export.JRGraphics2DExporterContext; +import net.sf.jasperreports.engine.export.draw.ImageDrawer; +import net.sf.jasperreports.engine.export.draw.Offset; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MapElementGraphics2DHandler implements GenericElementGraphics2DHandler +{ + private static final MapElementGraphics2DHandler INSTANCE = new MapElementGraphics2DHandler(); + + public static MapElementGraphics2DHandler getInstance() + { + return INSTANCE; + } + + + @Override + public void exportElement( + JRGraphics2DExporterContext exporterContext, + JRGenericPrintElement element, + Graphics2D grx, + Offset offset) + { + try + { + JRGraphics2DExporter exporter = (JRGraphics2DExporter)exporterContext.getExporterRef(); + ImageDrawer imageDrawer = exporter.getDrawVisitor().getImageDrawer(); + + imageDrawer.draw( + grx, + MapElementImageProvider.getImage(exporterContext.getJasperReportsContext(), element), + offset.getX(), + offset.getY() + ); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementHtmlHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementHtmlHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementHtmlHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementHtmlHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,169 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.ReportContext; +import net.sf.jasperreports.engine.export.GenericElementHtmlHandler; +import net.sf.jasperreports.engine.export.HtmlExporter; +import net.sf.jasperreports.engine.export.JRHtmlExporterContext; +import net.sf.jasperreports.engine.type.ModeEnum; +import net.sf.jasperreports.engine.util.JRColorUtil; +import net.sf.jasperreports.export.Exporter; +import net.sf.jasperreports.export.ExporterInput; +import net.sf.jasperreports.export.HtmlExporterConfiguration; +import net.sf.jasperreports.export.HtmlExporterOutput; +import net.sf.jasperreports.export.HtmlReportConfiguration; +import net.sf.jasperreports.web.util.JacksonUtil; +import net.sf.jasperreports.web.util.VelocityUtil; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class MapElementHtmlHandler implements GenericElementHtmlHandler +{ + private static final MapElementHtmlHandler INSTANCE = new MapElementHtmlHandler(); + + private static final String MAP_ELEMENT_HTML_TEMPLATE = "net/sf/jasperreports/components/map/resources/templates/MapElementHtmlTemplate.vm"; + + private static final String FIRST_ATTEMPT_PARAM = "exporter_first_attempt"; + + public static MapElementHtmlHandler getInstance() + { + return INSTANCE; + } + + @Override + public String getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element) + { + ReportContext reportContext = context.getExporterRef().getReportContext(); + Map contextMap = new HashMap(); + + contextMap.put("mapCanvasId", "map_canvas_" + element.hashCode()); + + Exporter exporter = context.getExporterRef(); + HtmlExporter htmlExporter2 = exporter instanceof HtmlExporter ? (HtmlExporter)exporter : null; + if (htmlExporter2 == null) + { + xhtmlExport(exporter, contextMap, element); + } + else + { + contextMap.put("elementX", htmlExporter2.toSizeUnit((float)element.getX())); + contextMap.put("elementY", htmlExporter2.toSizeUnit((float)element.getY())); + } + + contextMap.put("elementWidth", element.getWidth()); + contextMap.put("elementHeight", element.getHeight()); + + if (element.getModeValue() == ModeEnum.OPAQUE) + { + contextMap.put("backgroundColor", JRColorUtil.getColorHexa(element.getBackcolor())); + } + + contextMap.put("gotReportContext", reportContext != null); + + if (reportContext == null) + { + Float latitude = (Float)element.getParameterValue(MapComponent.ITEM_PROPERTY_latitude); + latitude = latitude == null ? MapComponent.DEFAULT_LATITUDE : latitude; + + Float longitude = (Float)element.getParameterValue(MapComponent.ITEM_PROPERTY_longitude); + longitude = longitude == null ? MapComponent.DEFAULT_LONGITUDE : longitude; + + Integer zoom = (Integer)element.getParameterValue(MapComponent.PARAMETER_ZOOM); + zoom = zoom == null ? MapComponent.DEFAULT_ZOOM : zoom; + + String mapType = (String)element.getParameterValue(MapComponent.ATTRIBUTE_MAP_TYPE); + mapType = (mapType == null ? MapComponent.DEFAULT_MAP_TYPE.getName() : mapType).toUpperCase(); + + contextMap.put("latitude", latitude); + contextMap.put("longitude", longitude); + contextMap.put("zoom", zoom); + contextMap.put("mapType", mapType); + + List> markerList = (List>)element.getParameterValue(MapComponent.PARAMETER_MARKERS); + String markers = markerList == null || markerList.isEmpty() ? "[]" : JacksonUtil.getInstance(context.getJasperReportsContext()).getJsonString(markerList); + contextMap.put("markerList", markers); + + List> pathList = (List>)element.getParameterValue(MapComponent.PARAMETER_PATHS); + String paths = pathList == null || pathList.isEmpty() ? "[]" : JacksonUtil.getInstance(context.getJasperReportsContext()).getJsonString(pathList); + contextMap.put("pathsList", paths); + + String reqParams = (String)element.getParameterValue(MapComponent.PARAMETER_REQ_PARAMS); + if(reqParams != null) + { + contextMap.put(MapComponent.PARAMETER_REQ_PARAMS, reqParams); + } + + if (context.getValue(FIRST_ATTEMPT_PARAM) == null) + { + context.setValue(FIRST_ATTEMPT_PARAM, true); + + //FIXME: support for parametrized http://maps.google.com/maps/api/js script (see MapElementHtmlTemplate.vm) + contextMap.put("exporterFirstAttempt", true); + } + } + + return VelocityUtil.processTemplate(MAP_ELEMENT_HTML_TEMPLATE, contextMap); + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } + + @SuppressWarnings("deprecation") + private void xhtmlExport( + Exporter exporter, + Map contextMap, + JRGenericPrintElement element + ) + { + net.sf.jasperreports.engine.export.JRXhtmlExporter xhtmlExporter = + exporter instanceof net.sf.jasperreports.engine.export.JRXhtmlExporter + ? (net.sf.jasperreports.engine.export.JRXhtmlExporter)exporter + : null; + if (xhtmlExporter == null) + { + net.sf.jasperreports.engine.export.JRHtmlExporter htmlExporter = + exporter instanceof net.sf.jasperreports.engine.export.JRHtmlExporter + ? (net.sf.jasperreports.engine.export.JRHtmlExporter)exporter + : null; + contextMap.put("elementX", htmlExporter.toSizeUnit(element.getX())); + contextMap.put("elementY", htmlExporter.toSizeUnit(element.getY())); + } + else + { + contextMap.put("xhtml", "xhtml"); + contextMap.put("elementX", xhtmlExporter.toSizeUnit(element.getX())); + contextMap.put("elementY", xhtmlExporter.toSizeUnit(element.getY())); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementImageProvider.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementImageProvider.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementImageProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementImageProvider.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,213 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.awt.Color; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRPrintImage; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.base.JRBasePrintImage; +import net.sf.jasperreports.engine.type.HorizontalImageAlignEnum; +import net.sf.jasperreports.engine.type.OnErrorTypeEnum; +import net.sf.jasperreports.engine.type.ScaleImageEnum; +import net.sf.jasperreports.engine.type.VerticalImageAlignEnum; +import net.sf.jasperreports.engine.util.JRColorUtil; +import net.sf.jasperreports.renderers.Renderable; +import net.sf.jasperreports.renderers.util.RendererUtil; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MapElementImageProvider +{ + /** + * The character count limit for a static map URL request + */ + public static Integer MAX_URL_LENGTH = 2048; + + public static JRPrintImage getImage(JasperReportsContext jasperReportsContext, JRGenericPrintElement element) throws JRException + { + + Float latitude = (Float)element.getParameterValue(MapComponent.ITEM_PROPERTY_latitude); + latitude = latitude == null ? MapComponent.DEFAULT_LATITUDE : latitude; + + Float longitude = (Float)element.getParameterValue(MapComponent.ITEM_PROPERTY_longitude); + longitude = longitude == null ? MapComponent.DEFAULT_LONGITUDE : longitude; + + Integer zoom = (Integer)element.getParameterValue(MapComponent.PARAMETER_ZOOM); + zoom = zoom == null ? MapComponent.DEFAULT_ZOOM : zoom; + + String mapType = (String)element.getParameterValue(MapComponent.ATTRIBUTE_MAP_TYPE); + String mapScale = (String)element.getParameterValue(MapComponent.ATTRIBUTE_MAP_SCALE); + String mapFormat = (String)element.getParameterValue(MapComponent.ATTRIBUTE_IMAGE_TYPE); + String reqParams = (String)element.getParameterValue(MapComponent.PARAMETER_REQ_PARAMS); + String markers =""; + + List> markerList = (List>)element.getParameterValue(MapComponent.PARAMETER_MARKERS); + if(markerList != null && !markerList.isEmpty()) + { + String currentMarkers = ""; + for(Map map : markerList) + { + if(map != null && !map.isEmpty()) + { + currentMarkers = "&markers="; + String size = (String)map.get(MapComponent.ITEM_PROPERTY_MARKER_size); + currentMarkers += size != null && size.length() > 0 ? "size:" + size + "%7C" : ""; + String color = (String)map.get(MapComponent.ITEM_PROPERTY_MARKER_color); + currentMarkers += color != null && color.length() > 0 ? "color:0x" + color + "%7C" : ""; + String label = (String)map.get(MapComponent.ITEM_PROPERTY_MARKER_label); + currentMarkers += label != null && label.length() > 0 ? "label:" + Character.toUpperCase(label.charAt(0)) + "%7C" : ""; + String icon = map.get(MapComponent.ITEM_PROPERTY_MARKER_ICON_url) != null + ? (String)map.get(MapComponent.ITEM_PROPERTY_MARKER_ICON_url) + : (String)map.get(MapComponent.ITEM_PROPERTY_MARKER_icon); + if(icon != null && icon.length() > 0) + { + currentMarkers +="icon:" + icon + "%7C"; + } + currentMarkers +=map.get(MapComponent.ITEM_PROPERTY_latitude); + currentMarkers +=","; + currentMarkers +=map.get(MapComponent.ITEM_PROPERTY_longitude); + markers += currentMarkers; + } + } + } + + List> pathList = (List>)element.getParameterValue(MapComponent.PARAMETER_PATHS); + String currentPaths = ""; + if(pathList != null && !pathList.isEmpty()) + { + for(Map pathMap : pathList) + { + if(pathMap != null && !pathMap.isEmpty()) + { + currentPaths += "&path="; + String color = (String)pathMap.get(MapComponent.ITEM_PROPERTY_STYLE_strokeColor); + if(color != null && color.length() > 0){ + //adding opacity to color + color = JRColorUtil.getColorHexa(JRColorUtil.getColor(color, Color.BLACK)); + color += pathMap.get(MapComponent.ITEM_PROPERTY_STYLE_strokeOpacity) == null || pathMap.get(MapComponent.ITEM_PROPERTY_STYLE_strokeOpacity).toString().length() == 0 + ? "ff" + : Integer.toHexString((int) (255 * Double.valueOf(pathMap.get(MapComponent.ITEM_PROPERTY_STYLE_strokeOpacity).toString()))); + } + currentPaths += color != null && color.length() > 0 ? "color:0x" + color.toLowerCase() + "%7C" : ""; + Boolean isPolygon = pathMap.get(MapComponent.ITEM_PROPERTY_STYLE_isPolygon) == null ? false : Boolean.valueOf(pathMap.get(MapComponent.ITEM_PROPERTY_STYLE_isPolygon).toString()); + if(isPolygon){ + String fillColor = (String)pathMap.get(MapComponent.ITEM_PROPERTY_STYLE_fillColor); + if(fillColor != null && fillColor.length() > 0){ + //adding opacity to fill color + fillColor = JRColorUtil.getColorHexa(JRColorUtil.getColor(fillColor, Color.WHITE)); + fillColor += pathMap.get(MapComponent.ITEM_PROPERTY_STYLE_fillOpacity) == null || pathMap.get(MapComponent.ITEM_PROPERTY_STYLE_fillOpacity).toString().length() == 0 + ? "00" + : Integer.toHexString((int) (256 * Double.valueOf(pathMap.get(MapComponent.ITEM_PROPERTY_STYLE_fillOpacity).toString()))); + } + currentPaths += fillColor != null && fillColor.length() > 0 ? "fillcolor:0x" + fillColor.toLowerCase() + "%7C" : ""; + } + String weight = pathMap.get(MapComponent.ITEM_PROPERTY_STYLE_strokeWeight) == null ? null : pathMap.get(MapComponent.ITEM_PROPERTY_STYLE_strokeWeight).toString(); + currentPaths += weight != null && weight.length() > 0 ? "weight:" + Integer.valueOf(weight) + "%7C" : ""; + List> locations = (List>)pathMap.get(MapComponent.PARAMETER_PATH_LOCATIONS); + Map location = null; + if(locations != null && !locations.isEmpty()) { + for(int i = 0; i < locations.size(); i++) { + location = locations.get(i); + currentPaths += location.get(MapComponent.ITEM_PROPERTY_latitude); + currentPaths += ","; + currentPaths += location.get(MapComponent.ITEM_PROPERTY_longitude); + currentPaths += i < locations.size() - 1 ? "%7C":""; + } + if(isPolygon){ + currentPaths += "%7C"; + currentPaths += locations.get(0).get(MapComponent.ITEM_PROPERTY_latitude); + currentPaths += ","; + currentPaths += locations.get(0).get(MapComponent.ITEM_PROPERTY_longitude); + } + } + } + } + } + + String imageLocation = + "http://maps.google.com/maps/api/staticmap?center=" + + latitude + + "," + + longitude + + "&size=" + + element.getWidth() + + "x" + + element.getHeight() + + "&zoom=" + + zoom + + (mapType == null ? "" : "&maptype=" + mapType) + + (mapFormat == null ? "" : "&format=" + mapFormat) + + (mapScale == null ? "" : "&scale=" + mapScale); + String params = "&sensor=false" + (reqParams == null ? "" : reqParams); + + //a static map url is limited to 2048 characters + imageLocation += imageLocation.length() + markers.length() + currentPaths.length() + params.length() < MAX_URL_LENGTH + ? markers + currentPaths + params + : imageLocation.length() + markers.length() + params.length() < MAX_URL_LENGTH ? markers + params : params; + JRBasePrintImage printImage = new JRBasePrintImage(element.getDefaultStyleProvider()); + + printImage.setUUID(element.getUUID()); + printImage.setX(element.getX()); + printImage.setY(element.getY()); + printImage.setWidth(element.getWidth()); + printImage.setHeight(element.getHeight()); + printImage.setStyle(element.getStyle()); + printImage.setMode(element.getModeValue()); + printImage.setBackcolor(element.getBackcolor()); + printImage.setForecolor(element.getForecolor()); + + //FIXMEMAP there are no scale image and alignment attributes defined for the map element + printImage.setScaleImage(ScaleImageEnum.RETAIN_SHAPE); + printImage.setHorizontalImageAlign(HorizontalImageAlignEnum.LEFT); + printImage.setVerticalImageAlign(VerticalImageAlignEnum.TOP); + + OnErrorTypeEnum onErrorType = + element.getParameterValue(MapComponent.PARAMETER_ON_ERROR_TYPE) == null + ? MapComponent.DEFAULT_ON_ERROR_TYPE + : OnErrorTypeEnum.getByName((String)element.getParameterValue(MapComponent.PARAMETER_ON_ERROR_TYPE)); + printImage.setOnErrorType(onErrorType); + + Renderable cacheRenderer = (Renderable)element.getParameterValue(MapComponent.PARAMETER_CACHE_RENDERER); + + if (cacheRenderer == null) + { + cacheRenderer = RendererUtil.getInstance(jasperReportsContext).getNonLazyRenderable(imageLocation, onErrorType); + if (cacheRenderer != null) + { + element.setParameterValue(MapComponent.PARAMETER_CACHE_RENDERER, cacheRenderer); + } + } + + printImage.setRenderer(cacheRenderer); + + return printImage; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementJExcelApiHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementJExcelApiHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementJExcelApiHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementJExcelApiHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.export.JRExporterGridCell; +import net.sf.jasperreports.engine.export.JRGridLayout; + + +/** + * @deprecated To be removed. + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MapElementJExcelApiHandler implements net.sf.jasperreports.engine.export.GenericElementJExcelApiHandler +{ + private static final MapElementJExcelApiHandler INSTANCE = new MapElementJExcelApiHandler(); + + public static MapElementJExcelApiHandler getInstance() + { + return INSTANCE; + } + + @Override + public void exportElement( + net.sf.jasperreports.engine.export.JExcelApiExporterContext exporterContext, + JRGenericPrintElement element, + JRExporterGridCell gridCell, + int colIndex, + int rowIndex, + int emptyCols, + int yCutsRow, + JRGridLayout layout + ) + { + try + { + net.sf.jasperreports.engine.export.JExcelApiExporter exporter = + (net.sf.jasperreports.engine.export.JExcelApiExporter)exporterContext.getExporter(); + exporter.exportImage(MapElementImageProvider.getImage(exporterContext.getJasperReportsContext(), element), gridCell, colIndex, rowIndex, emptyCols, yCutsRow, layout); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementJsonHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementJsonHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementJsonHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementJsonHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,96 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.export.GenericElementJsonHandler; +import net.sf.jasperreports.engine.export.JsonExporterContext; +import net.sf.jasperreports.web.util.JacksonUtil; +import net.sf.jasperreports.web.util.VelocityUtil; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class MapElementJsonHandler implements GenericElementJsonHandler +{ + private static final MapElementJsonHandler INSTANCE = new MapElementJsonHandler(); + + private static final String MAP_ELEMENT_JSON_TEMPLATE = "net/sf/jasperreports/components/map/resources/templates/MapElementJsonTemplate.vm"; + + public static MapElementJsonHandler getInstance() + { + return INSTANCE; + } + + @Override + public String getJsonFragment(JsonExporterContext context, JRGenericPrintElement element) + { + Map contextMap = new HashMap(); + contextMap.put("mapCanvasId", "map_canvas_" + element.hashCode()); + + Float latitude = (Float)element.getParameterValue(MapComponent.ITEM_PROPERTY_latitude); + latitude = latitude == null ? MapComponent.DEFAULT_LATITUDE : latitude; + + Float longitude = (Float)element.getParameterValue(MapComponent.ITEM_PROPERTY_longitude); + longitude = longitude == null ? MapComponent.DEFAULT_LONGITUDE : longitude; + + Integer zoom = (Integer)element.getParameterValue(MapComponent.PARAMETER_ZOOM); + zoom = zoom == null ? MapComponent.DEFAULT_ZOOM : zoom; + + String mapType = (String)element.getParameterValue(MapComponent.ATTRIBUTE_MAP_TYPE); + mapType = (mapType == null ? MapComponent.DEFAULT_MAP_TYPE.getName() : mapType).toUpperCase(); + + contextMap.put("latitude", latitude); + contextMap.put("longitude", longitude); + contextMap.put("zoom", zoom); + contextMap.put("mapType", mapType); + + List> markerList = (List>)element.getParameterValue(MapComponent.PARAMETER_MARKERS); + String markers = markerList == null || markerList.isEmpty() ? "[]" : JacksonUtil.getInstance(context.getJasperReportsContext()).getJsonString(markerList); + contextMap.put("markerList", markers); + + List> pathList = (List>)element.getParameterValue(MapComponent.PARAMETER_PATHS); + String paths = pathList == null || pathList.isEmpty() ? "[]" : JacksonUtil.getInstance(context.getJasperReportsContext()).getJsonString(pathList); + contextMap.put("pathsList", paths); + + String reqParams = (String)element.getParameterValue(MapComponent.PARAMETER_REQ_PARAMS); + if(reqParams != null) + { + contextMap.put(MapComponent.PARAMETER_REQ_PARAMS, reqParams); + } + + return VelocityUtil.processTemplate(MAP_ELEMENT_JSON_TEMPLATE, contextMap); + } + + @Override + public boolean toExport(JRGenericPrintElement element) + { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementOdsHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementOdsHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementOdsHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementOdsHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.export.JRExporterGridCell; +import net.sf.jasperreports.engine.export.JRGridLayout; +import net.sf.jasperreports.engine.export.oasis.GenericElementOdsHandler; +import net.sf.jasperreports.engine.export.oasis.JROdsExporter; +import net.sf.jasperreports.engine.export.oasis.JROdsExporterContext; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MapElementOdsHandler implements GenericElementOdsHandler +{ + private static final MapElementOdsHandler INSTANCE = new MapElementOdsHandler(); + + public static MapElementOdsHandler getInstance() + { + return INSTANCE; + } + + @Override + public void exportElement( + JROdsExporterContext exporterContext, + JRGenericPrintElement element, + JRExporterGridCell gridCell, + int colIndex, + int rowIndex, + int emptyCols, + int yCutsRow, + JRGridLayout layout + ) + { + try + { + JROdsExporter exporter = (JROdsExporter)exporterContext.getExporterRef(); + exporter.exportImage( + MapElementImageProvider.getImage(exporterContext.getJasperReportsContext(), element), + gridCell, + colIndex, + rowIndex, + 0, + 0, + null + ); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementOdtHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementOdtHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementOdtHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementOdtHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,71 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.export.JRExporterGridCell; +import net.sf.jasperreports.engine.export.oasis.GenericElementOdtHandler; +import net.sf.jasperreports.engine.export.oasis.JROdtExporter; +import net.sf.jasperreports.engine.export.oasis.JROdtExporterContext; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MapElementOdtHandler implements GenericElementOdtHandler +{ + private static final MapElementOdtHandler INSTANCE = new MapElementOdtHandler(); + + public static MapElementOdtHandler getInstance() + { + return INSTANCE; + } + + @Override + public void exportElement( + JROdtExporterContext exporterContext, + JRGenericPrintElement element, + JRExporterGridCell gridCell + ) + { + try + { + JROdtExporter exporter = (JROdtExporter)exporterContext.getExporterRef(); + exporter.exportImage( + exporterContext.getTableBuilder(), + MapElementImageProvider.getImage(exporterContext.getJasperReportsContext(), element), + gridCell + ); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementPdfHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementPdfHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementPdfHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementPdfHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,65 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.export.GenericElementPdfHandler; +import net.sf.jasperreports.engine.export.JRPdfExporter; +import net.sf.jasperreports.engine.export.JRPdfExporterContext; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MapElementPdfHandler implements GenericElementPdfHandler +{ + private static final MapElementPdfHandler INSTANCE = new MapElementPdfHandler(); + + public static MapElementPdfHandler getInstance() + { + return INSTANCE; + } + + @Override + public void exportElement( + JRPdfExporterContext exporterContext, + JRGenericPrintElement element + ) + { + try + { + JRPdfExporter exporter = (JRPdfExporter)exporterContext.getExporterRef(); + exporter.exportImage(MapElementImageProvider.getImage(exporterContext.getJasperReportsContext(), element)); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementPptxHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementPptxHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementPptxHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementPptxHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,64 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.export.ooxml.GenericElementPptxHandler; +import net.sf.jasperreports.engine.export.ooxml.JRPptxExporter; +import net.sf.jasperreports.engine.export.ooxml.JRPptxExporterContext; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MapElementPptxHandler implements GenericElementPptxHandler +{ + private static final MapElementPptxHandler INSTANCE = new MapElementPptxHandler(); + + public static MapElementPptxHandler getInstance() + { + return INSTANCE; + } + + @Override + public void exportElement( + JRPptxExporterContext exporterContext, + JRGenericPrintElement element + ) + { + try + { + JRPptxExporter exporter = (JRPptxExporter)exporterContext.getExporterRef(); + exporter.exportImage(MapElementImageProvider.getImage(exporterContext.getJasperReportsContext(), element)); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) { + return true; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementRtfHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementRtfHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementRtfHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementRtfHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,65 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.export.GenericElementRtfHandler; +import net.sf.jasperreports.engine.export.JRRtfExporter; +import net.sf.jasperreports.engine.export.JRRtfExporterContext; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MapElementRtfHandler implements GenericElementRtfHandler +{ + private static final MapElementRtfHandler INSTANCE = new MapElementRtfHandler(); + + public static MapElementRtfHandler getInstance() + { + return INSTANCE; + } + + @Override + public void exportElement( + JRRtfExporterContext exporterContext, + JRGenericPrintElement element + ) + { + try + { + JRRtfExporter exporter = (JRRtfExporter)exporterContext.getExporterRef(); + exporter.exportImage(MapElementImageProvider.getImage(exporterContext.getJasperReportsContext(), element)); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementXlsHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementXlsHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementXlsHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementXlsHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.export.GenericElementXlsHandler; +import net.sf.jasperreports.engine.export.JRExporterGridCell; +import net.sf.jasperreports.engine.export.JRGridLayout; +import net.sf.jasperreports.engine.export.JRXlsExporter; +import net.sf.jasperreports.engine.export.JRXlsExporterContext; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MapElementXlsHandler implements GenericElementXlsHandler +{ + private static final MapElementXlsHandler INSTANCE = new MapElementXlsHandler(); + + public static MapElementXlsHandler getInstance() + { + return INSTANCE; + } + + @Override + public void exportElement( + JRXlsExporterContext exporterContext, + JRGenericPrintElement element, + JRExporterGridCell gridCell, + int colIndex, + int rowIndex, + int emptyCols, + int yCutsRow, + JRGridLayout layout + ) + { + try + { + JRXlsExporter exporter = (JRXlsExporter)exporterContext.getExporterRef(); + exporter.exportImage(MapElementImageProvider.getImage(exporterContext.getJasperReportsContext(), element), gridCell, colIndex, rowIndex, emptyCols, yCutsRow, layout); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementXlsxHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementXlsxHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementXlsxHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementXlsxHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.JRPrintImage; +import net.sf.jasperreports.engine.export.JRExporterGridCell; +import net.sf.jasperreports.engine.export.ooxml.GenericElementXlsxHandler; +import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter; +import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporterContext; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MapElementXlsxHandler implements GenericElementXlsxHandler +{ + private static final MapElementXlsxHandler INSTANCE = new MapElementXlsxHandler(); + + public static MapElementXlsxHandler getInstance() + { + return INSTANCE; + } + + @Override + public void exportElement( + JRXlsxExporterContext exporterContext, + JRGenericPrintElement element, + JRExporterGridCell gridCell, + int colIndex, + int rowIndex + ) + { + try + { + JRXlsxExporter exporter = (JRXlsxExporter)exporterContext.getExporterRef(); + exporter.exportImage(getImage(exporterContext, element), gridCell, colIndex, rowIndex, 0, 0, null); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) { + return true; + } + + @Override + public JRPrintImage getImage(JRXlsxExporterContext exporterContext, JRGenericPrintElement element) throws JRException + { + return MapElementImageProvider.getImage(exporterContext.getJasperReportsContext(), element); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementXmlHandler.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementXmlHandler.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapElementXmlHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapElementXmlHandler.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,64 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.JRGenericPrintElement; +import net.sf.jasperreports.engine.export.GenericElementXmlHandler; +import net.sf.jasperreports.engine.export.JRXmlExporter; +import net.sf.jasperreports.engine.export.JRXmlExporterContext; + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MapElementXmlHandler implements GenericElementXmlHandler +{ + private static final MapElementXmlHandler INSTANCE = new MapElementXmlHandler(); + + public static MapElementXmlHandler getInstance() + { + return INSTANCE; + } + @Override + public void exportElement( + JRXmlExporterContext exporterContext, + JRGenericPrintElement element + ) + { + try + { + JRXmlExporter exporter = (JRXmlExporter)exporterContext.getExporterRef(); + exporter.exportImage(MapElementImageProvider.getImage(exporterContext.getJasperReportsContext(), element)); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + + @Override + public boolean toExport(JRGenericPrintElement element) { + return true; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapPrintElement.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapPrintElement.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapPrintElement.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapPrintElement.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,84 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +/** + * Utility class that creates generic print elements of map type. + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public final class MapPrintElement +{ +// /** +// * Creates a map element by copying all base element attributes +// * from a template instance. +// * +// * @param template the element from which to copy base attributes +// * @param latitude the latitude for the map +// * @param longitude the longitude for the map +// * @param elementParameters additional parameters to be set on the Flash element. +// * Hyperlink objects need to be set as element parameters. +// * @return a map element +// */ +// public static JRGenericPrintElement makeMapElement(JRPrintElement template, +// Float latitude, Float longitude, Integer zoom, Map elementParameters) +// { +// // TODO use JRTemplateGenericElement +// JRBaseGenericPrintElement mapEl = new JRBaseGenericPrintElement( +// template.getDefaultStyleProvider()); +// // copy all attribute from the template element +// mapEl.setX(template.getX()); +// mapEl.setY(template.getY()); +// mapEl.setWidth(template.getWidth()); +// mapEl.setHeight(template.getHeight()); +// mapEl.setStyle(template.getStyle()); +// mapEl.setMode(template.getOwnModeValue()); +// mapEl.setBackcolor(template.getOwnBackcolor()); +// mapEl.setForecolor(template.getOwnForecolor()); +// mapEl.setOrigin(template.getOrigin()); +// mapEl.setKey(template.getKey()); +// +// mapEl.setGenericType(MAP_ELEMENT_TYPE); +// mapEl.setParameterValue(PARAMETER_LATITUDE, latitude); +// mapEl.setParameterValue(PARAMETER_LONGITUDE, longitude); +// mapEl.setParameterValue(PARAMETER_ZOOM, zoom); +// +// if (elementParameters != null && !elementParameters.isEmpty()) +// { +// for (Iterator> it = elementParameters.entrySet().iterator(); it.hasNext();) +// { +// Map.Entry entry = it.next(); +// String name = entry.getKey(); +// Object value = entry.getValue(); +// mapEl.setParameterValue(name, value); +// } +// } +// +// return mapEl; +// } + + private MapPrintElement() + { + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapXmlFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapXmlFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MapXmlFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MapXmlFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,107 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.components.map.type.MapImageTypeEnum; +import net.sf.jasperreports.components.map.type.MapScaleEnum; +import net.sf.jasperreports.components.map.type.MapTypeEnum; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; +import net.sf.jasperreports.engine.type.OnErrorTypeEnum; +import net.sf.jasperreports.engine.xml.JRBaseFactory; +import net.sf.jasperreports.engine.xml.JRXmlConstants; + +import org.xml.sax.Attributes; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MapXmlFactory extends JRBaseFactory +{ + /** + * + */ + public static final String ATTRIBUTE_mapType = "mapType"; + public static final String ATTRIBUTE_mapScale = "mapScale"; + public static final String ATTRIBUTE_imageType = "imageType"; + public static final String ATTRIBUTE_onErrorType = "onErrorType"; + public static final String ELEMENT_item = "item"; + public static final String ELEMENT_markerData = "markerData"; + public static final String ELEMENT_itemProperty = "itemProperty"; + public static final String ELEMENT_pathStyle = "pathStyle"; + public static final String ELEMENT_pathData = "pathData"; + /** + * @deprecated Replaced by {@link #ELEMENT_item}. + */ + public static final String ELEMENT_marker = "marker"; + /** + * @deprecated Replaced by {@link #ELEMENT_markerData}. + */ + public static final String ELEMENT_markerDataset = "markerDataset"; + /** + * @deprecated Replaced by {@link #ELEMENT_itemProperty}. + */ + public static final String ELEMENT_markerProperty = "markerProperty"; + + @Override + public Object createObject(Attributes atts) + { + StandardMapComponent map = new StandardMapComponent(); + + EvaluationTimeEnum evaluationTime = EvaluationTimeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_evaluationTime)); + if (evaluationTime != null) + { + map.setEvaluationTime(evaluationTime); + } + + if (map.getEvaluationTime() == EvaluationTimeEnum.GROUP) + { + String groupName = atts.getValue(JRXmlConstants.ATTRIBUTE_evaluationGroup); + map.setEvaluationGroup(groupName); + } + + MapTypeEnum mapType = MapTypeEnum.getByName(atts.getValue(ATTRIBUTE_mapType)); + if(mapType != null) + { + map.setMapType(mapType); + } + MapScaleEnum mapScale = MapScaleEnum.getByName(atts.getValue(ATTRIBUTE_mapScale)); + if(mapScale != null) + { + map.setMapScale(mapScale); + } + MapImageTypeEnum imageType = MapImageTypeEnum.getByName(atts.getValue(ATTRIBUTE_imageType)); + if(imageType != null) + { + map.setImageType(imageType); + } + OnErrorTypeEnum onErrorType = OnErrorTypeEnum.getByName(atts.getValue(ATTRIBUTE_onErrorType)); + if(onErrorType != null) + { + map.setOnErrorType(onErrorType); + } + + return map; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MarkerDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MarkerDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MarkerDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MarkerDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.util.List; + +import net.sf.jasperreports.engine.JRCloneable; +import net.sf.jasperreports.engine.JRDatasetRun; + +/** + * @deprecated Replaced by {@link ItemData}. + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public interface MarkerDataset extends JRCloneable{ + + public List getMarkers(); + + public JRDatasetRun getDatasetRun(); +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MarkerDatasetXmlFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MarkerDatasetXmlFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MarkerDatasetXmlFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MarkerDatasetXmlFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + +/** + * @deprecated Replaced by {@link ItemDataXmlFactory}. + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MarkerDatasetXmlFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes attrs) throws Exception + { + StandardMarkerDataset dataset = new StandardMarkerDataset(); + return dataset; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/Marker.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/Marker.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/Marker.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/Marker.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.util.List; + +import net.sf.jasperreports.engine.JRCloneable; + +/** + * @deprecated Replaced by {@link Item}. + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public interface Marker extends JRCloneable { + /** + * @deprecated Replaced by {@link MapComponent#ITEM_PROPERTY_latitude}. + */ + public static final String PROPERTY_latitude = MapComponent.ITEM_PROPERTY_latitude; + /** + * @deprecated Replaced by {@link MapComponent#ITEM_PROPERTY_longitude}. + */ + public static final String PROPERTY_longitude = MapComponent.ITEM_PROPERTY_longitude; + /** + * @deprecated Replaced by {@link MapComponent#ITEM_PROPERTY_MARKER_title}. + */ + public static final String PROPERTY_title = MapComponent.ITEM_PROPERTY_MARKER_title; + + public List getProperties(); +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MarkerProperty.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MarkerProperty.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MarkerProperty.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MarkerProperty.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + + +/** + * @deprecated Replaced by {@link ItemProperty}. + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public interface MarkerProperty extends ItemProperty +{ +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MarkerPropertyXmlFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MarkerPropertyXmlFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MarkerPropertyXmlFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MarkerPropertyXmlFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,56 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.xml.JRBaseFactory; +import net.sf.jasperreports.engine.xml.JRXmlConstants; + +import org.xml.sax.Attributes; + + +/** + * @deprecated Replaced by {@link ItemPropertyXmlFactory}. + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MarkerPropertyXmlFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) + { + StandardMarkerProperty markerProperty = new StandardMarkerProperty(); + + String name = atts.getValue(JRXmlConstants.ATTRIBUTE_name); + if(name != null) + { + markerProperty.setName(name); + } + String value = atts.getValue(JRXmlConstants.ATTRIBUTE_value); + if(value != null) + { + markerProperty.setValue(value); + } + return markerProperty; + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MarkerXmlFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MarkerXmlFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/MarkerXmlFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/MarkerXmlFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import net.sf.jasperreports.engine.xml.JRBaseFactory; + +import org.xml.sax.Attributes; + + +/** + * @deprecated Replaced by {@link ItemXmlFactory}. + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class MarkerXmlFactory extends JRBaseFactory +{ + + @Override + public Object createObject(Attributes atts) + { + return new StandardMarker(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,28 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** +* Contains classes for the built-in Google Map component. +*/ +package net.sf.jasperreports.components.map; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/resources/require/jasperreports-map.js jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/resources/require/jasperreports-map.js --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/resources/require/jasperreports-map.js 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/resources/require/jasperreports-map.js 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,159 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +define(function(require){ + var Map = function(config) { + this.config = config; + this.parent = null; + this.loader = null; + + this.infowindow = {}; + + this._init(); + }; + + Map.prototype = { + // public API + + // internal API + _init: function() { + var it = this, + instData = it.config.instanceData, + reqParams = instData.requestParams || ""; + + // try to load the Gogle Maps API once, otherwise conflicts will happen + if (typeof google === 'undefined' || (typeof google !== 'undefined' && typeof google.maps === 'undefined')) { + require(["async!http://maps.google.com/maps/api/js?sensor=false" + reqParams + "!callback"], function() { + it._showMap(it.config.id, instData.latitude, instData.longitude, instData.zoom, instData.mapType, instData.markerList, instData.pathsList); + }); + } else { + it._showMap(it.config.id, instData.latitude, instData.longitude, instData.zoom, instData.mapType, instData.markerList, instData.pathsList); + } + + }, + _configureImage: function (pk, pp, po) { + var width, height, originX, originY, anchorX, anchorY; + + width = pp[pk + '.width'] ? parseInt(pp[pk + '.width']) : null; + height = pp[pk + '.height'] ? parseInt(pp[pk + '.height']) : null; + + originX = pp[pk + '.origin.x'] ? parseInt(pp[pk + '.origin.x']) : 0; + originY = pp[pk + '.origin.y'] ? parseInt(pp[pk + '.origin.y']) : 0; + + anchorX = pp[pk + '.anchor.x'] ? parseInt(pp[pk + '.anchor.x']) : 0; + anchorY = pp[pk + '.anchor.y'] ? parseInt(pp[pk + '.anchor.y']) : 0; + + po[pk] = { + url: pp[pk + '.url'], + size: width && height ? new google.maps.Size(width, height) : null, + origin: new google.maps.Point(originX,originY), + anchor: new google.maps.Point(anchorX,anchorY) + }; + }, + _createInfo: function (pp) { + if(pp['infowindow.content'] && pp['infowindow.content'].length > 0) { + var gg= google.maps, + po = { + content: pp['infowindow.content'] + }; + if (pp['infowindow.pixelOffset']) po['pixelOffset'] = pp['infowindow.pixelOffset']; + if (pp['infowindow.latitude'] && pp['infowindow.longitude']) po['position'] = new gg.LatLng(pp['infowindow.latitude'], pp['infowindow.longitude']); + if (pp['infowindow.maxWidth']) po['maxWidth'] = pp['infowindow.maxWidth']; + return new gg.InfoWindow(po); + } + return null; + }, + _showMap: function(canvasId, latitude, longitude, zoom, mapType, markers, p) { + var it = this, + gg = google.maps, + myOptions = { + zoom: zoom, + center: new gg.LatLng(latitude, longitude), + mapTypeId: gg.MapTypeId[mapType], + autocloseinfo: true + }, + map = new gg.Map(document.getElementById(canvasId), myOptions); + if(markers){ + var j; + for (var i = 0; i < markers.length; i++) { + var markerProps = markers[i]; + var markerLatLng = new gg.LatLng(markerProps['latitude'], markerProps['longitude']); + var markerOptions = { + position: markerLatLng, + map: map + }; + if(markerProps['icon.url'] && markerProps['icon.url'].length > 0) it._configureImage('icon', markerProps, markerOptions); + else if (markerProps['icon'] && markerProps['icon'].length > 0) markerOptions['icon'] = markerProps['icon']; + else if (markerProps['color'] && markerProps['color'].length > 0) markerOptions['icon'] = 'http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=' + ((markerProps['label'] && markerProps['label'].length > 0) ? markerProps['label'] : '%E2%80%A2')+ '%7C' + markerProps['color']; + else if(markerProps['label'] && markerProps['label'].length > 0) markerOptions['icon'] = 'http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=' + markerProps['label'] + '%7CFE7569'; + if(markerProps['shadow.url'] && markerProps['shadow.url'].length > 0) it._configureImage('shadow', markerProps, markerOptions); + else if(markerProps['shadow'] && markerProps['shadow'].length > 0) markerOptions['shadow'] = markerProps['shadow']; + for (j in markerProps) { + if (j.indexOf(".") < 0 && markerProps.hasOwnProperty(j) && !markerOptions.hasOwnProperty(j)) markerOptions[j] = markerProps[j]; + } + var marker = new google.maps.Marker(markerOptions); + marker['info'] = it._createInfo(markerProps); + gg.event.addListener(marker, 'click', function() { + if(map.autocloseinfo && it.infowindow && it.infowindow.close) it.infowindow.close(); + if(this['info']) { + it.infowindow = this['info']; + this['info'].open(map, this); + } else if (this['url'] && this['url'].length > 0) window.open(this['url'], this['target']); + }); + } + } + if(p) { + for(var k=0; k +
    + + +#if (!${gotReportContext}) + #if (${exporterFirstAttempt}) + #if(${reqParams}) + + #else + + #end + + #end + +#end \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/resources/templates/MapElementJsonTemplate.vm jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/resources/templates/MapElementJsonTemplate.vm --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/resources/templates/MapElementJsonTemplate.vm 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/resources/templates/MapElementJsonTemplate.vm 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,14 @@ +"${mapCanvasId}": { + "id": "${mapCanvasId}", + "type": "googlemap", + "module": "jasperreports-map", + "instanceData" : { + "requestParams": "${reqParams}", + "latitude": ${latitude}, + "longitude": ${longitude}, + "zoom": ${zoom}, + "mapType": "${mapType}", + "markerList": ${markerList}, + "pathsList": ${pathsList} + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/StandardItemData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/StandardItemData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/StandardItemData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/StandardItemData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,205 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.sf.jasperreports.components.items.Item; +import net.sf.jasperreports.components.items.ItemData; +import net.sf.jasperreports.components.items.ItemProperty; +import net.sf.jasperreports.components.items.StandardItemProperty; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRElementDataset; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated Replaced by {@link net.sf.jasperreports.components.items.StandardItemData}. + */ +public class StandardItemData implements Serializable, ItemData, JRChangeEventsSupport +{//FIXMEMAP implement clone? + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + public static final String PROPERTY_ITEMS = "items"; + public static final String PROPERTY_DATASET = "dataset"; + + private List itemsList = new ArrayList(); + private JRElementDataset dataset; + + private transient JRPropertyChangeSupport eventSupport; + + public StandardItemData() + { + } + + public StandardItemData(ItemData data, JRBaseObjectFactory factory) + { + itemsList = getCompiledItems(data.getItems(), factory); + dataset = factory.getElementDataset(data.getDataset()); + } + + private static List getCompiledItems(List items, JRBaseObjectFactory factory) + { + if (items == null) + { + return null; + } + + List compiledItems = new ArrayList(items.size()); + for (Iterator it = items.iterator(); it.hasNext();) + { + Item item = it.next(); + Item compiledItem = new StandardItem(getCompiledProperties(item.getProperties(), factory)); + compiledItems.add(compiledItem); + } + return compiledItems; + } + + private static List getCompiledProperties(List properties, JRBaseObjectFactory factory) + { + if (properties == null) + { + return null; + } + + List compiledProperties = new ArrayList(properties.size()); + for (Iterator it = properties.iterator(); it.hasNext();) + { + ItemProperty property = it.next(); + ItemProperty compiledProperty = new StandardItemProperty(property.getName(), property.getValue(), factory.getExpression(property.getValueExpression())); + compiledProperties.add(compiledProperty); + } + return compiledProperties; + } + + public void collectExpressions(JRExpressionCollector collector) { + MapCompiler.collectExpressions(this, collector); + } + + @Override + public List getItems() { + return itemsList; + } + + /** + * + */ + public void addItem(Item item) + { + itemsList.add(item); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_ITEMS, item, itemsList.size() - 1); + } + + /** + * + */ + public void addItem(int index, Item item) + { + if(index >=0 && index < itemsList.size()) + itemsList.add(index, item); + else{ + itemsList.add(item); + index = itemsList.size() - 1; + } + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_ITEMS, itemsList, index); + } + + /** + * + */ + public Item removeItem(Item item) + { + if (item != null) + { + int idx = itemsList.indexOf(item); + if (idx >= 0) + { + itemsList.remove(idx); + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_ITEMS, item, idx); + } + } + return item; + } + + @Override + public JRElementDataset getDataset() + { + return dataset; + } + + /** + * Sets the dataset information that will be used to create the item list. + * + * @param dataset the dataset information + * @see #getDataset() + */ + public void setDataset(JRElementDataset dataset) + { + Object old = this.dataset; + this.dataset = dataset; + getEventSupport().firePropertyChange(PROPERTY_DATASET, old, this.dataset); + } + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + @Override + public Object clone() + { + StandardItemData clone = null; + try + { + clone = (StandardItemData) super.clone(); + } + catch (CloneNotSupportedException e) + { + // never + throw new JRRuntimeException(e); + } + clone.dataset = JRCloneUtils.nullSafeClone(dataset); + clone.itemsList = JRCloneUtils.cloneList(itemsList); + clone.eventSupport = null; + return clone; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/StandardItem.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/StandardItem.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/StandardItem.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/StandardItem.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,114 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.components.items.Item; +import net.sf.jasperreports.components.items.ItemProperty; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated Replaced by {@link net.sf.jasperreports.components.items.StandardItem}. + */ +public class StandardItem implements Item, JRChangeEventsSupport, Serializable +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + public static final String PROPERTY_ITEM_PROPERTIES = "itemProperties"; + + private transient JRPropertyChangeSupport eventSupport; + + private List properties = new ArrayList(); + + public StandardItem() + { + } + + public StandardItem(List properties) + { + this.properties = properties; + } + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + @Override + public Object clone() + { + StandardItem clone = null; + try + { + clone = (StandardItem) super.clone(); + } + catch (CloneNotSupportedException e) + { + // never + throw new RuntimeException(e); + } + clone.properties = JRCloneUtils.cloneList(properties); + return clone; + } + + @Override + public List getProperties() + { + return properties; + } + + public void addItemProperty(ItemProperty property) + { + properties.add(property); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_ITEM_PROPERTIES, property, properties.size() - 1); + } + + public void removeItemProperty(ItemProperty property) + { + int idx = properties.indexOf(property); + if (idx >= 0) + { + properties.remove(idx); + + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_ITEM_PROPERTIES, + property, idx); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/StandardItemProperty.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/StandardItemProperty.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/StandardItemProperty.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/StandardItemProperty.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,133 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.io.Serializable; + +import net.sf.jasperreports.components.items.ItemProperty; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + * @deprecated Replaced by {@link net.sf.jasperreports.components.items.StandardItemProperty}. + */ +public class StandardItemProperty implements ItemProperty, JRChangeEventsSupport, Serializable +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_NAME = "name"; + public static final String PROPERTY_VALUE = "value"; + public static final String PROPERTY_VALUE_EXPRESSION = "valueExpression"; + + private transient JRPropertyChangeSupport eventSupport; + + private String name; + private String value; + private JRExpression valueExpression; + + public StandardItemProperty() + { + } + + public StandardItemProperty(String name, String value, JRExpression valueExpression) + { + this.name = name; + this.valueExpression = valueExpression; + this.value = value; + } + + @Override + public String getName() + { + return name; + } + + public void setName(String name) + { + Object old = this.name; + this.name = name; + getEventSupport().firePropertyChange(PROPERTY_NAME, old, this.name); + } + + @Override + public String getValue() + { + return value; + } + + public void setValue(String value) + { + Object old = this.value; + this.value = value; + getEventSupport().firePropertyChange(PROPERTY_VALUE, old, this.value); + } + + @Override + public JRExpression getValueExpression() + { + return valueExpression; + } + + public void setValueExpression(JRExpression valueExpression) + { + Object old = this.valueExpression; + this.valueExpression = valueExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_EXPRESSION, old, this.valueExpression); + } + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + @Override + public Object clone() + { + try + { + StandardItemProperty clone = (StandardItemProperty) super.clone(); + clone.valueExpression = JRCloneUtils.nullSafeClone(valueExpression); + return clone; + } + catch (CloneNotSupportedException e) + { + // never + throw new RuntimeException(e); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/StandardMapComponent.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/StandardMapComponent.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/StandardMapComponent.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/StandardMapComponent.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,524 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.components.items.ItemData; +import net.sf.jasperreports.components.items.StandardItemData; +import net.sf.jasperreports.components.map.type.MapImageTypeEnum; +import net.sf.jasperreports.components.map.type.MapScaleEnum; +import net.sf.jasperreports.components.map.type.MapTypeEnum; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.type.EvaluationTimeEnum; +import net.sf.jasperreports.engine.type.OnErrorTypeEnum; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class StandardMapComponent implements MapComponent, Serializable, JRChangeEventsSupport +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_LATITUDE_EXPRESSION = "latitudeExpression"; + public static final String PROPERTY_LONGITUDE_EXPRESSION = "longitudeExpression"; + public static final String PROPERTY_ADDRESS_EXPRESSION = "addressExpression"; + public static final String PROPERTY_ZOOM_EXPRESSION = "zoomExpression"; + public static final String PROPERTY_LANGUAGE_EXPRESSION = "languageExpression"; + public static final String PROPERTY_EVALUATION_TIME = "evaluationTime"; + public static final String PROPERTY_EVALUATION_GROUP = "evaluationGroup"; + public static final String PROPERTY_MAP_TYPE = "mapType"; + public static final String PROPERTY_MAP_SCALE = "mapScale"; + public static final String PROPERTY_IMAGE_TYPE = "imageType"; + public static final String PROPERTY_ON_ERROR_TYPE = "onErrorType"; + public static final String PROPERTY_MARKER_DATA_LIST = "markerDataList"; + public static final String PROPERTY_PATH_STYLE_LIST = "pathStyleList"; + public static final String PROPERTY_PATH_DATA_LIST = "pathDataList"; + + /** + * @deprecated Replaced by {@link #PROPERTY_MARKER_DATA}. + */ + public static final String PROPERTY_MARKER_DATASET = "markerDataset"; + + /** + * @deprecated Replaced by {@link #PROPERTY_MARKER_DATA_LIST}. + */ + public static final String PROPERTY_MARKER_DATA = "markerData"; + + private JRExpression latitudeExpression; + private JRExpression longitudeExpression; + private JRExpression addressExpression; + private JRExpression zoomExpression; + private JRExpression languageExpression; + private EvaluationTimeEnum evaluationTime = EvaluationTimeEnum.NOW; + private String evaluationGroup; + private MapTypeEnum mapType; + private MapScaleEnum mapScale; + private MapImageTypeEnum imageType; + + private OnErrorTypeEnum onErrorType; + private List markerDataList = new ArrayList(); + private List pathStyleList = new ArrayList(); + private List pathDataList = new ArrayList(); + + private transient JRPropertyChangeSupport eventSupport; + + public StandardMapComponent() + { + } + + public StandardMapComponent(MapComponent map, JRBaseObjectFactory objectFactory) + { + this.latitudeExpression = objectFactory.getExpression(map.getLatitudeExpression()); + this.longitudeExpression = objectFactory.getExpression(map.getLongitudeExpression()); + this.addressExpression = objectFactory.getExpression(map.getAddressExpression()); + this.zoomExpression = objectFactory.getExpression(map.getZoomExpression()); + this.languageExpression = objectFactory.getExpression(map.getLanguageExpression()); + this.evaluationTime = map.getEvaluationTime(); + this.evaluationGroup = map.getEvaluationGroup(); + this.mapType = map.getMapType(); + this.mapScale = map.getMapScale(); + this.imageType = map.getImageType(); + List markerList = map.getMarkerDataList(); + if(markerList != null && markerList.size() > 0) + { + this.markerDataList = new ArrayList(); + for(ItemData markerData : markerList){ + this.markerDataList.add(new StandardItemData(markerData, objectFactory)); + } + } + this.onErrorType = map.getOnErrorType(); + List styleList = map.getPathStyleList(); + if(styleList != null && styleList.size() > 0) + { + this.pathStyleList = new ArrayList(); + for(ItemData pathStyle : styleList){ + pathStyleList.add(new StandardItemData(pathStyle, objectFactory)); + } + } + List pathList = map.getPathDataList(); + if(pathList != null && pathList.size() > 0) + { + this.pathDataList = new ArrayList(); + for(ItemData pathData : pathList){ + pathDataList.add(new StandardItemData(pathData, objectFactory)); + } + } + } + + @Override + public JRExpression getLatitudeExpression() + { + return latitudeExpression; + } + + public void setLatitudeExpression(JRExpression latitudeExpression) + { + Object old = this.latitudeExpression; + this.latitudeExpression = latitudeExpression; + getEventSupport().firePropertyChange(PROPERTY_LATITUDE_EXPRESSION, old, this.latitudeExpression); + } + + @Override + public JRExpression getLongitudeExpression() + { + return longitudeExpression; + } + + public void setLongitudeExpression(JRExpression longitudeExpression) + { + Object old = this.longitudeExpression; + this.longitudeExpression = longitudeExpression; + getEventSupport().firePropertyChange(PROPERTY_LONGITUDE_EXPRESSION, old, this.longitudeExpression); + } + + @Override + public JRExpression getAddressExpression() + { + return addressExpression; + } + + public void setAddressExpression(JRExpression addressExpression) + { + Object old = this.addressExpression; + this.addressExpression = addressExpression; + getEventSupport().firePropertyChange(PROPERTY_ADDRESS_EXPRESSION, old, this.addressExpression); + } + + @Override + public JRExpression getZoomExpression() + { + return zoomExpression; + } + + public void setZoomExpression(JRExpression zoomExpression) + { + Object old = this.zoomExpression; + this.zoomExpression = zoomExpression; + getEventSupport().firePropertyChange(PROPERTY_ZOOM_EXPRESSION, old, this.zoomExpression); + } + + @Override + public JRExpression getLanguageExpression() + { + return languageExpression; + } + + public void setLanguageExpression(JRExpression languageExpression) + { + Object old = this.languageExpression; + this.languageExpression = languageExpression; + getEventSupport().firePropertyChange(PROPERTY_LANGUAGE_EXPRESSION, old, this.languageExpression); + } + + @Override + public EvaluationTimeEnum getEvaluationTime() + { + return evaluationTime; + } + + public void setEvaluationTime(EvaluationTimeEnum evaluationTimeValue) + { + Object old = this.evaluationTime; + this.evaluationTime = evaluationTimeValue; + getEventSupport().firePropertyChange(PROPERTY_EVALUATION_TIME, old, this.evaluationTime); + } + + @Override + public String getEvaluationGroup() + { + return evaluationGroup; + } + + public void setEvaluationGroup(String evaluationGroup) + { + Object old = this.evaluationGroup; + this.evaluationGroup = evaluationGroup; + getEventSupport().firePropertyChange(PROPERTY_EVALUATION_GROUP, + old, this.evaluationGroup); + } + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + @Override + public Object clone() + { + StandardMapComponent clone = null; + try + { + clone = (StandardMapComponent) super.clone(); + } + catch (CloneNotSupportedException e) + { + // never + throw new JRRuntimeException(e); + } + clone.latitudeExpression = JRCloneUtils.nullSafeClone(latitudeExpression); + clone.longitudeExpression = JRCloneUtils.nullSafeClone(longitudeExpression); + clone.addressExpression = JRCloneUtils.nullSafeClone(addressExpression); + clone.zoomExpression = JRCloneUtils.nullSafeClone(zoomExpression); + clone.languageExpression = JRCloneUtils.nullSafeClone(languageExpression); + clone.markerDataList = JRCloneUtils.cloneList(markerDataList); + clone.pathStyleList = JRCloneUtils.cloneList(pathStyleList); + clone.pathDataList = JRCloneUtils.cloneList(pathDataList); + clone.eventSupport = null; + return clone; + } + + @Override + public MapTypeEnum getMapType() { + return mapType; + } + + public void setMapType(MapTypeEnum mapType) { + Object old = this.mapType; + this.mapType = mapType; + getEventSupport().firePropertyChange(PROPERTY_MAP_TYPE, old, this.mapType); + } + + @Override + public MapScaleEnum getMapScale() { + return mapScale; + } + + public void setMapScale(MapScaleEnum mapScale) { + Object old = this.mapScale; + this.mapScale = mapScale; + getEventSupport().firePropertyChange(PROPERTY_MAP_SCALE, old, this.mapScale); + } + + @Override + public MapImageTypeEnum getImageType() { + return imageType; + } + + public void setImageType(MapImageTypeEnum imageType) { + Object old = this.imageType; + this.imageType = imageType; + getEventSupport().firePropertyChange(PROPERTY_IMAGE_TYPE, old, this.imageType); + } + + /** + * @deprecated Replaced by {@link #getMarkerDataList()}. + */ + @Override + public ItemData getMarkerData() { + return !markerDataList.isEmpty() ? markerDataList.get(0) : null; + } + + /** + * @deprecated Replaced by {@link #addMarkerData(ItemData)}. + */ + public void setMarkerData(ItemData markerData) { + addMarkerData(markerData); + } + + + @Override + public OnErrorTypeEnum getOnErrorType() { + return onErrorType; + } + + public void setOnErrorType(OnErrorTypeEnum onErrorType) { + Object old = this.onErrorType; + this.onErrorType = onErrorType; + getEventSupport().firePropertyChange(PROPERTY_ON_ERROR_TYPE, old, this.onErrorType); + } + + + /** + * @deprecated Replaced by {@link #getMarkerData()}. + */ + @Override + public MarkerDataset getMarkerDataset() { + return markerDataset; //FIXMEMAP make dummy marker dataset + } + + /** + * @deprecated Replaced by {@link #setMarkerData(ItemData)}. + */ + public void setMarkerDataset(MarkerDataset markerDataset) { + setMarkerData(StandardMarkerDataset.getItemData(markerDataset)); + } + + /* + * These fields are only for serialization backward compatibility. + */ + private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD + /** + * @deprecated + */ + private MarkerDataset markerDataset; + /** + * @deprecated Replaced by {@link #markerDataList}. + */ + private ItemData markerData; + + @SuppressWarnings("deprecation") + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_5_5_2) + { + if (markerDataset != null) + { + if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_0){ + markerData = StandardMarkerDataset.getItemData(markerDataset); + } else { + this.markerDataList = new ArrayList(); + this.markerDataList.add(StandardMarkerDataset.getItemData(markerDataset)); + } + } + markerDataset = null; + + if (markerData != null) + { + this.markerDataList = new ArrayList(); + this.markerDataList.add(markerData); + } + markerData = null; + } + } + + @Override + public List getPathStyleList() { + return this.pathStyleList; + } + + /** + * + */ + public void addPathStyle(ItemData pathStyle) + { + pathStyleList.add(pathStyle); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_PATH_STYLE_LIST, pathStyle, pathStyleList.size() - 1); + } + + /** + * + */ + public void addPathStyle(int index, ItemData pathStyle) + { + if(index >=0 && index < pathStyleList.size()) + pathStyleList.add(index, pathStyle); + else{ + pathStyleList.add(pathStyle); + index = pathStyleList.size() - 1; + } + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_PATH_STYLE_LIST, pathStyleList, index); + } + + /** + * + */ + public ItemData removePathStyle(ItemData pathStyle) + { + if (pathStyle != null) + { + int idx = pathStyleList.indexOf(pathStyle); + if (idx >= 0) + { + pathStyleList.remove(idx); + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_PATH_STYLE_LIST, pathStyle, idx); + } + } + return pathStyle; + } + + @Override + public List getMarkerDataList() { + return this.markerDataList; + } + + /** + * + */ + public void addMarkerData(ItemData markerData) + { + markerDataList.add(markerData); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_MARKER_DATA_LIST, markerData, markerDataList.size() - 1); + } + + /** + * + */ + public void addMarkerData(int index, ItemData markerData) + { + if(index >=0 && index < markerDataList.size()) + markerDataList.add(index, markerData); + else{ + markerDataList.add(markerData); + index = markerDataList.size() - 1; + } + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_MARKER_DATA_LIST, markerDataList, index); + } + + /** + * + */ + public ItemData removeMarkerData(ItemData markerData) + { + if (markerData != null) + { + int idx = markerDataList.indexOf(markerData); + if (idx >= 0) + { + markerDataList.remove(idx); + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_MARKER_DATA_LIST, markerData, idx); + } + } + return markerData; + } + + @Override + public List getPathDataList() { + return this.pathDataList; + } + + /** + * + */ + public void addPathData(ItemData pathData) + { + pathDataList.add(pathData); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_PATH_DATA_LIST, pathData, pathDataList.size() - 1); + } + + /** + * + */ + public void addPathData(int index, ItemData pathData) + { + if(index >=0 && index < pathDataList.size()) + pathDataList.add(index, pathData); + else{ + pathDataList.add(pathData); + index = pathDataList.size() - 1; + } + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_PATH_DATA_LIST, pathDataList, index); + } + + /** + * + */ + public ItemData removePathData(ItemData pathData) + { + if (pathData != null) + { + int idx = pathDataList.indexOf(pathData); + if (idx >= 0) + { + pathDataList.remove(idx); + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_PATH_DATA_LIST, pathData, idx); + } + } + return pathData; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/StandardMarkerDataset.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/StandardMarkerDataset.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/StandardMarkerDataset.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/StandardMarkerDataset.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,238 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.sf.jasperreports.components.items.ItemData; +import net.sf.jasperreports.components.items.StandardItemData; +import net.sf.jasperreports.components.items.StandardItemProperty; +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRDatasetRun; +import net.sf.jasperreports.engine.JRExpressionCollector; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.base.JRBaseObjectFactory; +import net.sf.jasperreports.engine.design.JRDesignElementDataset; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @deprecated Replaced by {@link StandardItemData}. + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class StandardMarkerDataset implements Serializable, MarkerDataset, JRChangeEventsSupport +{//FIXMEMAP implement clone? + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + public static final String PROPERTY_MARKER = "marker"; + public static final String PROPERTY_DATASET_RUN = "datasetRun"; + + private List markerList = new ArrayList(); + private JRDatasetRun datasetRun; + + private transient JRPropertyChangeSupport eventSupport; + + public StandardMarkerDataset() + { + } + + public StandardMarkerDataset(MarkerDataset dataset, JRBaseObjectFactory factory) + { + markerList = getCompiledMarkers(dataset.getMarkers(), factory); + datasetRun = factory.getDatasetRun(dataset.getDatasetRun()); + } + + private static List getCompiledMarkers(List markers, JRBaseObjectFactory factory) + { + if (markers == null) + { + return null; + } + + List compiledMarkers = new ArrayList(markers.size()); + for (Iterator it = markers.iterator(); it.hasNext();) + { + Marker marker = it.next(); + Marker compiledMarker = new StandardMarker(getCompiledProperties(marker.getProperties(), factory)); + compiledMarkers.add(compiledMarker); + } + return compiledMarkers; + } + + private static List getCompiledProperties(List properties, JRBaseObjectFactory factory) + { + if (properties == null) + { + return null; + } + + List compiledProperties = new ArrayList(properties.size()); + for (Iterator it = properties.iterator(); it.hasNext();) + { + MarkerProperty property = it.next(); + MarkerProperty compiledProperty = new StandardMarkerProperty(property.getName(), property.getValue(), factory.getExpression(property.getValueExpression())); + compiledProperties.add(compiledProperty); + } + return compiledProperties; + } + + public void collectExpressions(JRExpressionCollector collector) { + MapCompiler.collectExpressions(this, collector); + } + + @Override + public List getMarkers() { + return markerList; + } + + /** + * + */ + public void addMarker(Marker marker) + { + markerList.add(marker); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_MARKER, marker, markerList.size() - 1); + } + + /** + * + */ + public void addMarker(int index, Marker marker) + { + if(index >=0 && index < markerList.size()) + markerList.add(index, marker); + else{ + markerList.add(marker); + index = markerList.size() - 1; + } + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_MARKER, markerList, index); + } + + /** + * + */ + public Marker removeMarker(Marker marker) + { + if (marker != null) + { + int idx = markerList.indexOf(marker); + if (idx >= 0) + { + markerList.remove(idx); + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_MARKER, marker, idx); + } + } + return marker; + } + + @Override + public JRDatasetRun getDatasetRun() + { + return datasetRun; + } + + /** + * Sets the subdataset run information that will be used to create the marker list. + * + * @param datasetRun the subdataset run information + * @see #getDatasetRun() + */ + public void setDatasetRun(JRDatasetRun datasetRun) + { + Object old = this.datasetRun; + this.datasetRun = datasetRun; + getEventSupport().firePropertyChange(PROPERTY_DATASET_RUN, old, this.datasetRun); + } + + /** + * + */ + public static ItemData getItemData(MarkerDataset markerDataset) + { + if (markerDataset != null) + { + StandardItemData itemData = new StandardItemData(); + for (Marker marker : markerDataset.getMarkers()) + { + StandardItem item = new StandardItem(); + for (MarkerProperty markerProperty : marker.getProperties()) + { + StandardItemProperty itemProperty = new StandardItemProperty(); + itemProperty.setName(markerProperty.getName()); + itemProperty.setValue(markerProperty.getValue()); + itemProperty.setValueExpression(markerProperty.getValueExpression()); + item.addItemProperty(itemProperty); + } + itemData.addItem(item); + } + + if (markerDataset.getDatasetRun() != null) + { + JRDesignElementDataset dataset = new JRDesignElementDataset(); + dataset.setDatasetRun(markerDataset.getDatasetRun()); + itemData.setDataset(dataset); + } + return itemData; + } + return null; + } + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + @Override + public Object clone() + { + StandardMarkerDataset clone = null; + try + { + clone = (StandardMarkerDataset) super.clone(); + } + catch (CloneNotSupportedException e) + { + // never + throw new JRRuntimeException(e); + } + clone.datasetRun = JRCloneUtils.nullSafeClone(datasetRun); + clone.markerList = JRCloneUtils.cloneList(markerList); + clone.eventSupport = null; + return clone; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/StandardMarker.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/StandardMarker.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/StandardMarker.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/StandardMarker.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,111 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @deprecated Replaced by {@link StandardItem}. + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class StandardMarker implements Marker, JRChangeEventsSupport, Serializable +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + public static final String PROPERTY_MARKER_PROPERTIES = "markerProperties"; + + private transient JRPropertyChangeSupport eventSupport; + + private List properties = new ArrayList(); + + public StandardMarker() + { + } + + public StandardMarker(List properties) + { + this.properties = properties; + } + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + @Override + public Object clone() + { + try + { + StandardMarker clone = (StandardMarker) super.clone(); + clone.properties = JRCloneUtils.cloneList(properties); + return clone; + } + catch (CloneNotSupportedException e) + { + // never + throw new RuntimeException(e); + } + } + + @Override + public List getProperties() + { + return properties; + } + + public void addMarkerProperty(MarkerProperty property) + { + properties.add(property); + getEventSupport().fireCollectionElementAddedEvent(PROPERTY_MARKER_PROPERTIES, property, properties.size() - 1); + } + + public void removeMarkerProperty(MarkerProperty property) + { + int idx = properties.indexOf(property); + if (idx >= 0) + { + properties.remove(idx); + + getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_MARKER_PROPERTIES, + property, idx); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/StandardMarkerProperty.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/StandardMarkerProperty.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/StandardMarkerProperty.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/StandardMarkerProperty.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,132 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map; + +import java.io.Serializable; + +import net.sf.jasperreports.engine.JRConstants; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; +import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; +import net.sf.jasperreports.engine.util.JRCloneUtils; + +/** + * @deprecated Replaced by {@link StandardItemProperty}. + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public class StandardMarkerProperty implements MarkerProperty, JRChangeEventsSupport, Serializable +{ + + private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; + + public static final String PROPERTY_NAME = "name"; + public static final String PROPERTY_VALUE = "value"; + public static final String PROPERTY_VALUE_EXPRESSION = "valueExpression"; + + private transient JRPropertyChangeSupport eventSupport; + + private String name; + private String value; + private JRExpression valueExpression; + + public StandardMarkerProperty() + { + } + + public StandardMarkerProperty(String name, String value, JRExpression valueExpression) + { + this.name = name; + this.valueExpression = valueExpression; + this.value = value; + } + + @Override + public String getName() + { + return name; + } + + public void setName(String name) + { + Object old = this.name; + this.name = name; + getEventSupport().firePropertyChange(PROPERTY_NAME, old, this.name); + } + + @Override + public String getValue() + { + return value; + } + + public void setValue(String value) + { + Object old = this.value; + this.value = value; + getEventSupport().firePropertyChange(PROPERTY_VALUE, old, this.value); + } + + @Override + public JRExpression getValueExpression() + { + return valueExpression; + } + + public void setValueExpression(JRExpression valueExpression) + { + Object old = this.valueExpression; + this.valueExpression = valueExpression; + getEventSupport().firePropertyChange(PROPERTY_VALUE_EXPRESSION, old, this.valueExpression); + } + + @Override + public JRPropertyChangeSupport getEventSupport() + { + synchronized (this) + { + if (eventSupport == null) + { + eventSupport = new JRPropertyChangeSupport(this); + } + } + + return eventSupport; + } + + @Override + public Object clone() + { + try + { + StandardMarkerProperty clone = (StandardMarkerProperty) super.clone(); + clone.valueExpression = JRCloneUtils.nullSafeClone(valueExpression); + return clone; + } + catch (CloneNotSupportedException e) + { + // never + throw new RuntimeException(e); + } + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/type/MapImageTypeEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/type/MapImageTypeEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/type/MapImageTypeEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/type/MapImageTypeEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,88 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.type; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public enum MapImageTypeEnum implements NamedEnum +{ + /** + * The 8-bit PNG format (the same as PNG_8) + */ + PNG("png"), + + /** + * The 8-bit PNG format + */ + PNG_8("png8"), + + /** + * The 32-bit PNG format + */ + PNG_32("png32"), + + /** + * The GIF format + */ + GIF("gif"), + + /** + * The JPEG compression format + */ + JPG("jpg"), + + /** + * The non-progressive JPEG compression format + */ + JPG_BASELINE("jpg-baseline"); + + /** + * + */ + private final transient String name; + + private MapImageTypeEnum(String name) + { + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static MapImageTypeEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/type/MapScaleEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/type/MapScaleEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/type/MapScaleEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/type/MapScaleEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.type; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public enum MapScaleEnum implements NamedEnum +{ + /** + * + */ + ONE("1"), + + /** + * + */ + TWO("2"), + + /** + * + */ + FOUR("4"); + + /** + * + */ + private final transient String name; + + private MapScaleEnum(String name) + { + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static MapScaleEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/type/MapTypeEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/type/MapTypeEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/type/MapTypeEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/type/MapTypeEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.map.type; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + + +/** + * @author sanda zaharia (shertage@users.sourceforge.net) + */ +public enum MapTypeEnum implements NamedEnum +{ + /** + * The roadmap type + */ + ROADMAP("roadmap"), + + /** + * The satellite map type + */ + SATELLITE("satellite"), + + /** + * The terrain map type + */ + TERRAIN("terrain"), + + /** + * The hybrid type + */ + HYBRID("hybrid"); + + /** + * + */ + private final transient String name; + + private MapTypeEnum(String name) + { + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static MapTypeEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/type/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/type/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/map/type/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/map/type/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +/** + * Contains enum types used by the built-in Google Map component. + */ +package net.sf.jasperreports.components.map.type; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/messages.properties jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/messages.properties --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/messages.properties 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/messages.properties 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,5 @@ +net.sf.jasperreports.components.date.pattern=yyyy-MM-dd HH:mm:ss +net.sf.jasperreports.components.time.pattern=HH:mm:ss +net.sf.jasperreports.components.number.pattern=###,###.### +net.sf.jasperreports.components.calendar.date.pattern=yy-mm-dd +net.sf.jasperreports.components.calendar.date.time.pattern=HH:mm:ss \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,175 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** + * Contains classes for built-in components. + *

    + * In addition to the standard report elements, such as text fields, images, charts, subreports + * and crosstabs JasperReports has an + * increasing number of core components that can be used to add content to generated + * reports. Some of them are used for greatly simplifying the creation of complex layouts, + * others are used to embed highly specialized visualization packages, such as barcodes and + * other types of graphics, or to generate report interactivity, like the Header Toolbar component. + *

    + * The purpose of this feature is to allow users to extend the functionality of the + * JasperReports engine by plugging-in custom-made visual components that would take + * data as input and produce content that is embedded into the resulting documents. Custom + * made components can be anything from simple barcodes to tables, and professional + * charting packages. + *

    + * The custom component support is relying on two other major features of the + * JasperReports library: extension support and generic elements and you need to be familiar with + * them before delving into custom components. + *

    + * A custom component is a custom report element that has a defined structure and + * produces some output in generated reports, just like usual report elements do. + * Just like a normal chart element in a report template will produce an image element in + * the generated document, or just like a crosstab element present in the report template will + * produce a series of frames and text fields that makes up a tabular structure in the + * generated documents, generic custom components declared in a report template could + * generate any combination of simple elements and generic elements as the output of their + * built-in calculation and layout logic. + *

    + * Custom components are supposed to come in bundles. A component bundle is a package + * comprising of one or several components that share the same XML namespace and + * schema. For example, a chart component bundle can contain multiple chart components, + * one for each type of chart (pie chart component, bar chart component and so on). + *

    Custom Components Use Cases Examples

    + * In the following use case example, we consider a JasperReports user that wants to replace the + * JFreeChart library (bundled with JasperReports by default for the built-in charting + * support) with some other charting package. + *

    + * Following are the few steps required to achieve it: + *

      + *
    • A new component bundle is developed. The bundle can contain several + * components, that is, one per chart type.
    • + *
    • An XML schema for the chart components is designed.
    • + *
    • The schema uses a namespace reserved for the chart component implementation.
    • + *
    • A Java object model is designed for the chart components.
    • + *
    • Chart components can (optionally) use report subdatasets to produce data.
    • + *
    • The component implementation produces + * {@link net.sf.jasperreports.engine.JRPrintImage} instances when the report is + * filled. The images can use a custom image renderer + * ({@link net.sf.jasperreports.engine.Renderable}) implementation.
    • + *
    • The developed component code is bundled into a JAR and placed on the application's classpath.
    • + *
    • Report designers can now embed custom charts into JRXMLs.
    • + *
    + *

    Custom Component Implementation Overview

    + * A typical implementation of a custom component would involve the following: + *
      + *
    • A jasperreports_extension.properties resource which registers an + * extension factory that reads a Spring beans file. + *
      + * The Spring beans file that includes one or more beans of type + * {@link net.sf.jasperreports.engine.component.ComponentsBundle}. Most of the + * time the default implementation + * {@link net.sf.jasperreports.engine.component.DefaultComponentsBundle} is used.
    • + *
    • A component bundle includes: + *
        + *
      • A XML parser object which implements + * {@link net.sf.jasperreports.engine.component.ComponentsXmlParser}. The + * default + * {@link net.sf.jasperreports.engine.component.DefaultComponentXmlParser} + * implementation can be used in most cases. An XML parser provides: + *
          + *
        • A namespace to be used for the component bundle.
        • + *
        • An XML schema to validate component XML fragments. The XML schema is + * given as both a public location where it can be accessed, and as an internal + * resource which will be used when parsing reports.
        • + *
        • A {@link net.sf.jasperreports.engine.component.XmlDigesterConfigurer} + * implementation which registers XML digester rules that are used to transform + * at JRXML parse time component XML fragments into Java objects. In many + * cases, new digester rule classes need to be written.
        • + *
        + *
      • + *
      • One or more component managers, + * {@link net.sf.jasperreports.engine.component.ComponentManager} + * implementations, usually instances of + * {@link net.sf.jasperreports.engine.component.DefaultComponentManager}. A + * component manager is an entry point through which the handlers for a single + * component type can be accessed. It contains: + *
          + *
        • A component compiler + * ({@link net.sf.jasperreports.engine.component.ComponentCompiler} + * implementation) that handles a component instance during report compile. It + * contains methods to collect report expressions from a component instance, to + * validate such a component and to create a component object that is included in + * the compiled report.
        • + *
        • A component XML writer + * ({@link net.sf.jasperreports.engine.component.ComponentXmlWriter} + * implementation) which is responsible for producing a XML representation of + * component instances.
        • + *
        • A factory of component fill instances, + * {@link net.sf.jasperreports.engine.component.ComponentFillFactory} + * implementation.
        • + *
        • Such a factory would produce custom + * {@link net.sf.jasperreports.engine.component.FillComponent} instances. A + * fill component object is responsible for managing a component at fill time. A + * typical implementation would evaluate a set of expressions and use the results + * to create a print element to be included in the generated report.
        • + *
        + *
      • + *
      + *
    • + *
    • If the component needs to generate an output elements that do not fall into the types + * built into JasperReports (such as texts/images), the component can produce generic + * print elements. + *
      + * To handle such generic elements at export time, custom generic element handler + * implementations need to be written
    • + *
    • If the component implementation generates charts, or, more generically, if it needs + * to collect data from several records in the report dataset or from subdatasets, the + * component object model will contain classes derived from abstract JasperReports + * element dataset classes. These classes offer the infrastructure required to collect + * data from report datasets. + *
      + * More specifically, the following classes would be extended by the component + * implementation: + *
        + *
      • {@link net.sf.jasperreports.engine.design.JRDesignElementDataset}, for + * the report design/JRXML parsing stage.
      • + *
      • {@link net.sf.jasperreports.engine.base.JRBaseElementDataset}, to be + * included in compiled reports.
      • + *
      • {@link net.sf.jasperreports.engine.fill.JRFillElementDataset}, to be + * used at fill time.
      • + *
      + *
    • + *
    + *

    + * When implementing custom components, the most helpful information can be found in + * the form of JasperReports API Javadoc and samples. The following samples found in the + * /demo/samples folder of the JasperReports project distribution package show custom + * components: + *

      + *
    • Barbecue: A sample that illustrates the use of the Barbecue component + * built into JasperReports.
    • + *
    • Barcode4j: A sample that displays barcodes using the Barcode4j component + * built into JasperReports.
    • + *
    • jchartscomponent: A chart component implementation that outputs axis charts + * generated by the jCharts library (http://jcharts.sf.net).
    • + *
    • openflashchart: A chart component that outputs Open Flash Charts in HTML + * reports (http://teethgrinder.co.uk/open-flash-chart-2).
    • + *
    + */ +package net.sf.jasperreports.components; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/AbstractFieldComparator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/AbstractFieldComparator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/AbstractFieldComparator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/AbstractFieldComparator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,88 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort; + +import java.text.Format; + +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.util.DefaultFormatFactory; +import net.sf.jasperreports.engine.util.FormatFactory; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public abstract class AbstractFieldComparator { + + protected String valueStart; + protected String valueEnd; + + protected T compareStart; + protected T compareEnd; + protected T compareTo; + protected Class compareToClass; + + protected Format formatter; + + private static FormatFactory formatFactory; + + static { + formatFactory = new DefaultFormatFactory(); + } + + @SuppressWarnings("unchecked") + public void setCompareTo(Object compareTo) { + this.compareTo = (T) compareTo; + } + + public void setValueStart(String valueStart) { + this.valueStart = valueStart; + } + + public void setValueEnd(String valueEnd) { + this.valueEnd = valueEnd; + } + + public void setCompareToClass(Class compareToClass) { + this.compareToClass = compareToClass; + } + + public abstract boolean compare(String filterTypeOperator); + + public abstract void initValues() throws Exception; + + protected FormatFactory getFormatFactory() { + return formatFactory; + } + + public boolean isValid() { + try { + initValues(); + } catch (Exception e) { + throw new JRRuntimeException(e); + } + return true; + } + + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/AddSortFieldCommand.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/AddSortFieldCommand.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/AddSortFieldCommand.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/AddSortFieldCommand.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort.actions; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.design.JRDesignDataset; +import net.sf.jasperreports.engine.design.JRDesignSortField; +import net.sf.jasperreports.web.commands.Command; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class AddSortFieldCommand implements Command +{ + + private JRDesignDataset dataset; + private JRDesignSortField sortField; + + /** + * + */ + public AddSortFieldCommand(JRDesignDataset dataset, JRDesignSortField sortField) + { + this.dataset = dataset; + this.sortField = sortField; + } + + @Override + public void execute() + { + try + { + dataset.addSortField(sortField); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + + @Override + public void undo() + { + dataset.removeSortField(sortField); + } + + @Override + public void redo() + { + execute(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/FilterAction.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/FilterAction.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/FilterAction.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/FilterAction.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,91 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort.actions; + +import java.util.UUID; + +import net.sf.jasperreports.engine.design.JRDesignDataset; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.engine.util.DefaultFormatFactory; +import net.sf.jasperreports.engine.util.FormatFactory; +import net.sf.jasperreports.repo.JasperDesignCache; +import net.sf.jasperreports.web.actions.AbstractAction; +import net.sf.jasperreports.web.actions.ActionException; +import net.sf.jasperreports.web.commands.CommandException; +import net.sf.jasperreports.web.commands.CommandStack; +import net.sf.jasperreports.web.commands.CommandTarget; +import net.sf.jasperreports.web.commands.ResetInCacheCommand; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class FilterAction extends AbstractAction { + + private FilterData filterData; + protected static FormatFactory formatFactory = new DefaultFormatFactory(); + + public FilterAction() { + } + + public FilterData getFilterData() { + return filterData; + } + + public void setFilterData(FilterData filterData) { + this.filterData = filterData; + } + + @Override + public void performAction() throws ActionException { + + if (filterData != null) { + CommandTarget target = getCommandTarget(UUID.fromString(filterData.getTableUuid())); + if (target != null) + { + JasperDesignCache cache = JasperDesignCache.getInstance(getJasperReportsContext(), getReportContext()); + + JasperDesign jasperDesign = cache.getJasperDesign(target.getUri()); + JRDesignDataset dataset = (JRDesignDataset)jasperDesign.getMainDataset(); + + // obtain command stack + CommandStack commandStack = getCommandStack(); + + // execute command + try { + commandStack.execute( + new ResetInCacheCommand( + new FilterCommand(getJasperReportsContext(), dataset, getFilterData()), + getJasperReportsContext(), + getReportContext(), + target.getUri() + ) + ); + } catch (CommandException e) { + throw new ActionException(e); + } + } + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/FilterCommand.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/FilterCommand.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/FilterCommand.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/FilterCommand.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,146 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort.actions; + +import java.util.List; + +import net.sf.jasperreports.components.sort.FieldFilter; +import net.sf.jasperreports.engine.DatasetFilter; +import net.sf.jasperreports.engine.JRPropertiesMap; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.design.JRDesignDataset; +import net.sf.jasperreports.web.commands.Command; +import net.sf.jasperreports.web.util.JacksonUtil; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class FilterCommand implements Command +{ + + public static final String DATASET_FILTER_PROPERTY = "net.sf.jasperreports.filters"; + + private JasperReportsContext jasperReportsContext; + protected JRDesignDataset dataset; + protected FilterData filterData; + private String oldSerializedFilters; + private String newSerializedFilters; + + public FilterCommand(JasperReportsContext jasperReportsContext, JRDesignDataset dataset, FilterData filterData) + { + this.jasperReportsContext = jasperReportsContext; + this.dataset = dataset; + this.filterData = filterData; + } + + @Override + public void execute() + { + // get existing filter as JSON string + String serializedFilters = "[]"; + JRPropertiesMap propertiesMap = dataset.getPropertiesMap(); + if (propertiesMap.getProperty(DATASET_FILTER_PROPERTY) != null) { + serializedFilters = propertiesMap.getProperty(DATASET_FILTER_PROPERTY); + } + + oldSerializedFilters = serializedFilters; + + JacksonUtil jacksonUtil = JacksonUtil.getInstance(jasperReportsContext); + List existingFilters = jacksonUtil.loadList(serializedFilters, FieldFilter.class); + + if (!filterData.isClearFilter()) { // add filter + boolean addNewFilter = false; + + if (existingFilters.size() == 0) { + addNewFilter = true; + } else { + // lookup new filter + FieldFilter filterForCurrentField = null; + + for (DatasetFilter ff: existingFilters){ + if (((FieldFilter)ff).getField().equals(filterData.getFieldName())) { + filterForCurrentField = (FieldFilter)ff; + break; + } + } + + // update filterForCurrentField + if (filterForCurrentField != null) { + filterForCurrentField.setFilterTypeOperator(filterData.getFilterTypeOperator()); + filterForCurrentField.setFilterValueEnd(filterData.getFieldValueEnd()); + filterForCurrentField.setFilterValueStart(filterData.getFieldValueStart()); + filterForCurrentField.setFilterPattern(filterData.getFilterPattern()); + filterForCurrentField.setLocaleCode(filterData.getLocaleCode()); + filterForCurrentField.setTimeZoneId(filterData.getTimeZoneId()); + filterForCurrentField.setIsValid(null); + filterForCurrentField.setIsField(filterData.getIsField()); + } else { + addNewFilter = true; + } + } + + if (addNewFilter) { + FieldFilter newFilterField = new FieldFilter( + filterData.getFieldName(), filterData.getFieldValueStart(), + filterData.getFieldValueEnd(), filterData.getFilterType(), + filterData.getFilterTypeOperator()); + + newFilterField.setFilterPattern(filterData.getFilterPattern()); + newFilterField.setLocaleCode(filterData.getLocaleCode()); + newFilterField.setTimeZoneId(filterData.getTimeZoneId()); + newFilterField.setIsField(filterData.getIsField()); + existingFilters.add(newFilterField); + } + + } else { // remove filter + FieldFilter filterToRemove = null; + + for (DatasetFilter df: existingFilters){ + if (((FieldFilter)df).getField().equals(filterData.getFieldName())) { + filterToRemove = (FieldFilter)df; + break; + } + } + + if (filterToRemove != null) { + existingFilters.remove(filterToRemove); + } + } + + newSerializedFilters = jacksonUtil.getJsonString(existingFilters); + propertiesMap.setProperty(DATASET_FILTER_PROPERTY, newSerializedFilters); + } + + @Override + public void undo() + { + dataset.getPropertiesMap().setProperty(DATASET_FILTER_PROPERTY, oldSerializedFilters); + } + + @Override + public void redo() + { + dataset.getPropertiesMap().setProperty(DATASET_FILTER_PROPERTY, newSerializedFilters); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/FilterData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/FilterData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/FilterData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/FilterData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,127 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort.actions; + +import net.sf.jasperreports.components.headertoolbar.actions.BaseColumnData; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class FilterData extends BaseColumnData { + + private String fieldName; + private String fieldValueStart; + private String fieldValueEnd; + private String filterType; + private String filterTypeOperator; + private String filterPattern; + private String localeCode; + private String timeZoneId; + private boolean isField; + private boolean clearFilter; + + public FilterData() { + } + + public String getFieldName() { + return fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public String getFieldValueStart() { + return fieldValueStart; + } + + public void setFieldValueStart(String fieldValueStart) { + this.fieldValueStart = fieldValueStart; + } + + public String getFieldValueEnd() { + return fieldValueEnd; + } + + public void setFieldValueEnd(String fieldValueEnd) { + this.fieldValueEnd = fieldValueEnd; + } + + public String getFilterType() { + return filterType; + } + + public void setFilterType(String filterType) { + this.filterType = filterType; + } + + public String getFilterTypeOperator() { + return filterTypeOperator; + } + + public void setFilterTypeOperator(String filterTypeOperator) { + this.filterTypeOperator = filterTypeOperator; + } + + public String getFilterPattern() { + return filterPattern; + } + + public void setFilterPattern(String filterPattern) { + this.filterPattern = filterPattern; + } + + public String getLocaleCode() { + return localeCode; + } + + public void setLocaleCode(String localeCode) { + this.localeCode = localeCode; + } + + public String getTimeZoneId() { + return timeZoneId; + } + + public void setTimeZoneId(String timeZoneId) { + this.timeZoneId = timeZoneId; + } + + public boolean isClearFilter() { + return clearFilter; + } + + public void setClearFilter(boolean clearFilter) { + this.clearFilter = clearFilter; + } + + public boolean getIsField() { + return isField; + } + + public void setIsField(boolean isField) { + this.isField = isField; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,28 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** +* Contains Action classes for the built-in Sort component. +*/ +package net.sf.jasperreports.components.sort.actions; \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/RemoveSortFieldCommand.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/RemoveSortFieldCommand.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/RemoveSortFieldCommand.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/RemoveSortFieldCommand.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,83 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort.actions; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.JRSortField; +import net.sf.jasperreports.engine.design.JRDesignDataset; +import net.sf.jasperreports.web.commands.Command; + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public class RemoveSortFieldCommand implements Command +{ + + private JRDesignDataset dataset; + private JRSortField sortField; + private int removeIndex; + + /** + * + */ + public RemoveSortFieldCommand(JRDesignDataset dataset, JRSortField sortField) + { + this.dataset = dataset; + this.sortField = sortField; + } + + @Override + public void execute() + { + removeIndex = dataset.getSortFieldsList().indexOf(sortField); + if (removeIndex >= 0) + { + dataset.removeSortField(sortField); + } + } + + @Override + public void undo() + { + if (removeIndex >= 0) + { + try + { + dataset.addSortField(removeIndex, sortField); + } + catch (JRException e) + { + throw new JRRuntimeException(e); + } + } + } + + @Override + public void redo() + { + execute(); + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/SortAction.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/SortAction.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/SortAction.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/SortAction.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,90 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort.actions; + +import java.util.UUID; + +import net.sf.jasperreports.engine.design.JRDesignDataset; +import net.sf.jasperreports.engine.design.JasperDesign; +import net.sf.jasperreports.repo.JasperDesignCache; +import net.sf.jasperreports.web.actions.AbstractAction; +import net.sf.jasperreports.web.actions.ActionException; +import net.sf.jasperreports.web.commands.CommandException; +import net.sf.jasperreports.web.commands.CommandStack; +import net.sf.jasperreports.web.commands.CommandTarget; +import net.sf.jasperreports.web.commands.ResetInCacheCommand; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class SortAction extends AbstractAction +{ + + private SortData sortData; + + public SortAction() { + } + + public SortData getSortData() { + return sortData; + } + + public void setSortData(SortData sortData) { + this.sortData = sortData; + } + + @Override + public void performAction() throws ActionException + { + if (sortData != null) + { + CommandTarget target = getCommandTarget(UUID.fromString(sortData.getTableUuid())); + if (target != null) + { + JasperDesignCache cache = JasperDesignCache.getInstance(getJasperReportsContext(), getReportContext()); + + JasperDesign jasperDesign = cache.getJasperDesign(target.getUri()); + JRDesignDataset dataset = (JRDesignDataset)jasperDesign.getMainDataset(); + + // obtain command stack + CommandStack commandStack = getCommandStack(); + + // execute command + try { + commandStack.execute( + new ResetInCacheCommand( + new SortCommand(getJasperReportsContext(), dataset, sortData), + getJasperReportsContext(), + getReportContext(), + target.getUri() + ) + ); + } catch (CommandException e) { + throw new ActionException(e); + } + } + } + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/SortCommand.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/SortCommand.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/SortCommand.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/SortCommand.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,156 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort.actions; + +import java.util.List; + +import net.sf.jasperreports.components.headertoolbar.HeaderToolbarElementUtils; +import net.sf.jasperreports.engine.JRExpression; +import net.sf.jasperreports.engine.JRExpressionChunk; +import net.sf.jasperreports.engine.JRGroup; +import net.sf.jasperreports.engine.JRPropertiesUtil; +import net.sf.jasperreports.engine.JRSortField; +import net.sf.jasperreports.engine.JasperReportsContext; +import net.sf.jasperreports.engine.design.JRDesignDataset; +import net.sf.jasperreports.engine.design.JRDesignSortField; +import net.sf.jasperreports.engine.type.SortFieldTypeEnum; +import net.sf.jasperreports.engine.type.SortOrderEnum; +import net.sf.jasperreports.web.commands.Command; +import net.sf.jasperreports.web.commands.CommandException; +import net.sf.jasperreports.web.commands.CommandStack; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class SortCommand implements Command +{ + /** + * Property that specifies whether additional sort fields should be created automatically to preserve the integrity of dataset groups, + * when interactive sorting is performed. The groups need to have simple expressions using single field or single variable reference, for + * this feature to work properly. + */ + public static final String PROPERTY_CREATE_SORT_FIELDS_FOR_GROUPS = JRPropertiesUtil.PROPERTY_PREFIX + "create.sort.fields.for.groups"; + +// private ReportContext reportContext; + private JasperReportsContext jasperReportsContext; + protected JRDesignDataset dataset; + protected SortData sortData; +// protected JasperDesignCache cache; + private CommandStack individualCommandStack; + + public SortCommand(JasperReportsContext jasperReportsContext, JRDesignDataset dataset, SortData sortData) + //public AbstractSortCommand(ReportContext reportContext, SortData sortData) + { +// this.reportContext = reportContext; + this.jasperReportsContext = jasperReportsContext; + this.dataset = dataset; + this.sortData = sortData; +// this.cache = JasperDesignCache.getInstance(reportContext); + this.individualCommandStack = new CommandStack(); + } + + @Override + public void execute() throws CommandException + { + SortOrderEnum sortOrder = HeaderToolbarElementUtils.getSortOrder(sortData.getSortOrder());//FIXMEJIVE use labels in JR enum, even if they are longer + + JRDesignSortField newSortField = + new JRDesignSortField( + sortData.getSortColumnName(), + SortFieldTypeEnum.getByName(sortData.getSortColumnType()), + sortOrder + ); + + JRSortField oldSortField = null; + List sortFields = dataset.getSortFieldsList(); + if ( + JRPropertiesUtil.getInstance(jasperReportsContext).getBooleanProperty(dataset, PROPERTY_CREATE_SORT_FIELDS_FOR_GROUPS, false) + && (sortFields == null || sortFields.isEmpty()) + ) + { + List groups = dataset.getGroupsList(); + for (JRGroup group : groups) + { + JRExpression expression = group.getExpression(); + if (expression != null) + { + JRExpressionChunk[] chunks = expression.getChunks(); + if (chunks != null && chunks.length == 1) + { + JRExpressionChunk chunk = chunks[0]; + if ( + chunk.getType() == JRExpressionChunk.TYPE_FIELD + || chunk.getType() == JRExpressionChunk.TYPE_VARIABLE + ) + { + JRDesignSortField groupSortField = + new JRDesignSortField( + chunk.getText(), + chunk.getType() == JRExpressionChunk.TYPE_FIELD + ? SortFieldTypeEnum.FIELD + : SortFieldTypeEnum.VARIABLE, + SortOrderEnum.ASCENDING + ); + individualCommandStack.execute(new AddSortFieldCommand(dataset, groupSortField)); + } + } + } + } + } + + for (JRSortField crtSortField : sortFields) + { + if ( + newSortField.getName().equals(crtSortField.getName()) + && newSortField.getType() == crtSortField.getType() + ) + { + oldSortField = crtSortField; + break; + } + } + + if (oldSortField != null) + { + individualCommandStack.execute(new RemoveSortFieldCommand(dataset, oldSortField)); + } + + if (sortOrder != null) + { + individualCommandStack.execute(new AddSortFieldCommand(dataset, newSortField)); + } + } + + @Override + public void undo() + { + individualCommandStack.undoAll(); + } + + @Override + public void redo() + { + individualCommandStack.redoAll(); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/SortData.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/SortData.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/actions/SortData.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/actions/SortData.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort.actions; + +import net.sf.jasperreports.components.headertoolbar.actions.BaseColumnData; + + + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class SortData extends BaseColumnData { + + private String sortColumnName; + private String sortColumnType; + private String sortOrder; + + public SortData() { + } + + public SortData(String tableUuid, String sortColumnName, String sortColumnType, String sortOrder) { + super(tableUuid); + this.sortColumnName = sortColumnName; + this.sortColumnType = sortColumnType; + this.sortOrder = sortOrder; + } + + public String getSortColumnName() { + return sortColumnName; + } + + public void setSortColumnName(String sortColumnName) { + this.sortColumnName = sortColumnName; + } + + public String getSortColumnType() { + return sortColumnType; + } + + public void setSortColumnType(String sortColumnType) { + this.sortColumnType = sortColumnType; + } + + public String getSortOrder() { + return sortOrder; + } + + public void setSortOrder(String sortOrder) { + this.sortOrder = sortOrder; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FieldBooleanComparator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FieldBooleanComparator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FieldBooleanComparator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FieldBooleanComparator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,62 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort; + + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class FieldBooleanComparator extends AbstractFieldComparator { + + public FieldBooleanComparator() { + } + + @Override + public void initValues() throws Exception { + } + + @Override + public boolean compare(String filterTypeOperator) { + boolean result = true; + FilterTypeBooleanOperatorsEnum booleanEnum = FilterTypeBooleanOperatorsEnum.getByEnumConstantName(filterTypeOperator); + + switch (booleanEnum) { + case IS_TRUE: + result = Boolean.TRUE.equals(compareTo); + break; + case IS_NOT_TRUE: + result = !Boolean.TRUE.equals(compareTo); + break; + case IS_FALSE: + result = Boolean.FALSE.equals(compareTo); + break; + case IS_NOT_FALSE: + result = !Boolean.FALSE.equals(compareTo); + break; + } + + return result; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FieldComparatorFactory.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FieldComparatorFactory.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FieldComparatorFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FieldComparatorFactory.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort; + +import java.util.Locale; +import java.util.TimeZone; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class FieldComparatorFactory { + private FieldComparatorFactory() { + } + + public static AbstractFieldComparator createFieldComparator(FilterTypesEnum filterTypeEnum, String filterPattern, Locale locale, TimeZone timeZone){ + switch (filterTypeEnum) { + case TIME: + case DATE: + return new FieldDateComparator(filterPattern, locale, timeZone); + case NUMERIC: + return new FieldNumberComparator(filterPattern, locale); + case TEXT: + return new FieldTextComparator(locale); + case BOOLEAN: + return new FieldBooleanComparator(); + default: + return null; + } + } +} \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FieldDateComparator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FieldDateComparator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FieldDateComparator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FieldDateComparator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,115 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort; + +import java.text.DateFormat; +import java.text.ParseException; +import java.util.Date; +import java.util.Locale; +import java.util.TimeZone; + +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.util.FormatUtils; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class FieldDateComparator extends AbstractFieldComparator { + + public FieldDateComparator(String filterPattern, Locale locale, TimeZone timeZone) { + formatter = getFormatFactory().createDateFormat(filterPattern, locale, timeZone); + } + + @Override + public void initValues() throws Exception { + if (valueStart != null && valueStart.length() > 0) { + compareStart = FormatUtils.getFormattedDate((DateFormat)formatter, valueStart, compareToClass); + } + if (valueEnd != null && valueEnd.length() > 0) { + compareEnd = FormatUtils.getFormattedDate((DateFormat)formatter, valueEnd, compareToClass); + } + } + + @Override + public boolean compare(String filterTypeOperator) { + boolean defaultResult = true, + result = defaultResult, + resultPart1 = true, + resultPart2 = true; + + try { + initValues(); + } catch (Exception e) { + throw new JRRuntimeException(e); + } + + boolean validComparison = compareStart != null && compareTo != null; + boolean validComparison2 = compareEnd != null && compareTo != null; + + Date formattedCompareTo = compareTo; + + if (compareTo != null) { + try { + formattedCompareTo = FormatUtils.getFormattedDate((DateFormat)formatter, ((DateFormat)formatter).format(compareTo), compareToClass); + } catch (ParseException e) { + throw new JRRuntimeException(e); + } + } + + FilterTypeDateOperatorsEnum dateEnum = FilterTypeDateOperatorsEnum.getByEnumConstantName(filterTypeOperator); + switch (dateEnum) { + case EQUALS: + result = validComparison ? formattedCompareTo.compareTo(compareStart) == 0 : false; + break; + case IS_AFTER: + result = validComparison ? formattedCompareTo.compareTo(compareStart) > 0 : false; + break; + case IS_BEFORE: + result = validComparison ? formattedCompareTo.compareTo(compareStart) < 0 : false; + break; + case IS_BETWEEN: + resultPart1 = validComparison ? formattedCompareTo.compareTo(compareStart) >= 0 : false; + resultPart2 = validComparison2 ? formattedCompareTo.compareTo(compareEnd) <= 0 : false; + result = resultPart1 && resultPart2; + break; + case IS_NOT_BETWEEN: + resultPart1 = validComparison ? formattedCompareTo.compareTo(compareStart) >= 0 : false; + resultPart2 = validComparison2 ? formattedCompareTo.compareTo(compareEnd) <= 0 : false; + result = !(resultPart1 && resultPart2); + break; + case IS_NOT_EQUAL_TO: + result = validComparison ? formattedCompareTo.compareTo(compareStart) != 0 : defaultResult; + break; + case IS_ON_OR_AFTER: + result = validComparison ? formattedCompareTo.compareTo(compareStart) >= 0 : false; + break; + case IS_ON_OR_BEFORE: + result = validComparison ? formattedCompareTo.compareTo(compareStart) <= 0 : false; + break; + } + + return result; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FieldFilter.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FieldFilter.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FieldFilter.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FieldFilter.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,230 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort; + +import java.util.Locale; +import java.util.TimeZone; + +import net.sf.jasperreports.engine.DatasetFilter; +import net.sf.jasperreports.engine.EvaluationType; +import net.sf.jasperreports.engine.JRParameter; +import net.sf.jasperreports.engine.fill.DatasetFillContext; +import net.sf.jasperreports.engine.fill.JRFillDataset; +import net.sf.jasperreports.engine.util.JRDataUtils; + +/** + * A dataset filter that matches String values based on substrings. + * + * @author Lucian Chirita (lucianc@users.sourceforge.net) + */ +public class FieldFilter implements DatasetFilter { + + private String field; + + private String filterValueStart; + private String filterValueEnd; + + private String filterType; + private String filterTypeOperator; + private String filterPattern; + private String localeCode; + private String timeZoneId; + + private DatasetFillContext context; + + private Boolean isValid; + private Boolean isField; + + private FilterTypesEnum filterTypeEnum; + + private AbstractFieldComparator fieldComparator; + + public FieldFilter() { + } + + /** + * Creates a field filter. + * + * + */ + public FieldFilter(String field, String filterValueStart, + String filterValueEnd, String filterType, String filterTypeOperator) { + this.field = field; + this.filterValueStart = filterValueStart; + this.filterValueEnd = filterValueEnd; + this.filterType = filterType; + this.filterTypeOperator = filterTypeOperator; + } + + @Override + public void init(DatasetFillContext context) { + this.context = context; + this.filterTypeEnum = FilterTypesEnum.getByName(filterType); + if (fieldComparator == null) { + Locale locale = getFilterLocale(); + TimeZone timeZone = getFilterTimeZone(); + + fieldComparator = FieldComparatorFactory + .createFieldComparator( + filterTypeEnum, + filterPattern, + locale, + timeZone); + } + } + + protected Locale getFilterLocale() + { + Locale locale; + if (localeCode != null) + { + locale = JRDataUtils.getLocale(localeCode); + } + else if (context.getLocale() != null) + { + locale = context.getLocale(); + } + else + { + locale = Locale.getDefault(); + } + return locale; + } + + protected TimeZone getFilterTimeZone() + { + TimeZone timeZone; + if (timeZoneId != null) + { + timeZone = JRDataUtils.getTimeZone(timeZoneId); + } + else + { + timeZone = (TimeZone) context.getParameterValue(JRParameter.REPORT_TIME_ZONE); + } + return timeZone; + } + + @Override + public boolean matches(EvaluationType evaluation) { + Object value; + if (isField == null || Boolean.TRUE.equals(isField)) { + value = context.getFieldValue(field, evaluation); + fieldComparator.setCompareToClass(((JRFillDataset)context).getFillField(field).getValueClass()); + } else { + value = context.getVariableValue(field, evaluation); + fieldComparator.setCompareToClass(((JRFillDataset)context).getFillVariable(field).getValueClass()); + } + + fieldComparator.setValueStart(filterValueStart); + fieldComparator.setValueEnd(filterValueEnd); + fieldComparator.setCompareTo(value); + + + if (isValid == null) { + isValid = fieldComparator.isValid(); + } + if (!isValid) { + return true; + } + return fieldComparator.compare(filterTypeOperator); + } + + public String getField() { + return this.field; + } + + public String getFilterValueStart() { + return filterValueStart; + } + + public void setFilterValueStart(String filterValueStart) { + this.filterValueStart = filterValueStart; + } + + public String getFilterValueEnd() { + return filterValueEnd; + } + + public void setFilterValueEnd(String filterValueEnd) { + this.filterValueEnd = filterValueEnd; + } + + public String getFilterType() { + return filterType; + } + + public String getFilterTypeOperator() { + return filterTypeOperator; + } + + public void setFilterTypeOperator(String filterTypeOperator) { + this.filterTypeOperator = filterTypeOperator; + } + + public FilterTypesEnum getFilterTypeEnum() { + return filterTypeEnum; + } + + public Boolean getIsValid() { + return isValid; + } + + public void setIsValid(Boolean isValid) { + this.isValid = isValid; + } + + public Boolean getIsField() { + return isField; + } + + public void setIsField(Boolean isField) { + this.isField = isField; + } + + public String getFilterPattern() { + return filterPattern; + } + + public void setFilterPattern(String filterPattern) { + this.filterPattern = filterPattern; + } + + public String getLocaleCode() { + return localeCode; + } + + public void setLocaleCode(String localeCode) { + this.localeCode = localeCode; + } + + public String getTimeZoneId() { + return timeZoneId; + } + + public void setTimeZoneId(String timeZoneId) { + this.timeZoneId = timeZoneId; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FieldNumberComparator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FieldNumberComparator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FieldNumberComparator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FieldNumberComparator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,118 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort; + +import java.math.BigDecimal; +import java.text.NumberFormat; +import java.text.ParseException; +import java.util.Locale; + +import net.sf.jasperreports.engine.JRRuntimeException; +import net.sf.jasperreports.engine.util.FormatUtils; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class FieldNumberComparator extends AbstractFieldComparator { + + + public FieldNumberComparator(String filterPattern, Locale locale) { + formatter = getFormatFactory().createNumberFormat(filterPattern, locale); + } + + @Override + public void initValues() throws Exception { + if (valueStart != null && valueStart.length() > 0) { + compareStart = FormatUtils.getFormattedNumber((NumberFormat)formatter, valueStart, compareToClass); + } + if (valueEnd != null && valueEnd.length() > 0) { + compareEnd = FormatUtils.getFormattedNumber((NumberFormat)formatter, valueEnd, compareToClass); + } + } + + @Override + public boolean compare(String filterTypeOperator) { + boolean defaultResult = true, + result = defaultResult, + resultPart1 = true, + resultPart2 = true; + + try { + initValues(); + } catch (Exception e) { + throw new JRRuntimeException(e); + } + + Number formattedCompareTo = compareTo; + if (compareTo != null) { + try { + formattedCompareTo = FormatUtils.getFormattedNumber((NumberFormat)formatter, formatter.format(compareTo), compareToClass); + } catch (ParseException e) { + throw new JRRuntimeException(e); + } + } + + FilterTypeNumericOperatorsEnum numericEnum = FilterTypeNumericOperatorsEnum.getByEnumConstantName(filterTypeOperator); + BigDecimal dbA = formattedCompareTo != null ? new BigDecimal(formattedCompareTo.toString()) : null; + BigDecimal dbStart = compareStart != null ? new BigDecimal(compareStart.toString()) : null; + BigDecimal dbEnd = compareEnd != null ? new BigDecimal(compareEnd.toString()) : null; + + boolean validComparison = dbStart != null && dbA != null; + boolean validComparison2 = dbEnd != null && dbA != null; + + switch (numericEnum) { + case DOES_NOT_EQUAL: + result = validComparison ? dbA.compareTo(dbStart) != 0 : defaultResult; + break; + case EQUALS: + result = validComparison ? dbA.compareTo(dbStart) == 0 : false; + break; + case GREATER_THAN: + result = validComparison ? dbA.compareTo(dbStart) > 0 : false; + break; + case GREATER_THAN_EQUAL_TO: + result = validComparison ? dbA.compareTo(dbStart) >= 0 : false; + break; + case IS_BETWEEN: + resultPart1 = validComparison ? dbA.compareTo(dbStart) >= 0 : false; + resultPart2 = validComparison2 ? dbA.compareTo(dbEnd) <= 0 : false; + result = resultPart1 && resultPart2; + break; + case IS_NOT_BETWEEN: + resultPart1 = validComparison ? dbA.compareTo(dbStart) >= 0 : false; + resultPart2 = validComparison2 ? dbA.compareTo(dbEnd) <= 0 : false; + result = !(resultPart1 && resultPart2); + break; + case LESS_THAN: + result = validComparison ? dbA.compareTo(dbStart) < 0 : false; + break; + case LESS_THAN_EQUAL_TO: + result = validComparison ? dbA.compareTo(dbStart) <= 0 : false; + break; + } + + return result; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FieldTextComparator.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FieldTextComparator.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FieldTextComparator.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FieldTextComparator.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,95 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort; + +import java.util.Locale; + +import net.sf.jasperreports.engine.JRRuntimeException; + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public class FieldTextComparator extends AbstractFieldComparator { + + private Locale locale; + + public FieldTextComparator(Locale locale) { + this.locale = locale; + } + + @Override + public void initValues() { + compareStart = valueStart; + } + + @Override + public boolean compare (String filterTypeOperator) { + boolean defaultResult = true, + result = defaultResult; + + try { + initValues(); + } catch (Exception e) { + throw new JRRuntimeException(e); + } + + FilterTypeTextOperatorsEnum textEnum = FilterTypeTextOperatorsEnum.getByEnumConstantName(filterTypeOperator); + + if (compareStart != null) { + String lcCompareStart = compareStart.toLowerCase(locale); + boolean validComparison = compareTo != null; + String lcCompareTo = validComparison ? compareTo.toLowerCase(locale) : null; + + switch (textEnum) { + case CONTAINS: + result = validComparison ? lcCompareTo.contains(lcCompareStart) : false; + break; + case DOES_NOT_CONTAIN: + result = validComparison ? !lcCompareTo.contains(lcCompareStart) : false; + break; + case DOES_NOT_END_WITH: + result = validComparison ? !lcCompareTo.endsWith(lcCompareStart) : false; + break; + case DOES_NOT_START_WITH: + result = validComparison ? !lcCompareTo.startsWith(lcCompareStart) : false; + break; + case ENDS_WITH: + result = validComparison ? lcCompareTo.endsWith(lcCompareStart) : false; + break; + case EQUALS: + result = validComparison ? lcCompareTo.equals(lcCompareStart) : false; + break; + case IS_NOT_EQUAL_TO: + result = validComparison ? !lcCompareTo.equals(lcCompareStart) : defaultResult; + break; + case STARTS_WITH: + result = validComparison ? lcCompareTo.startsWith(lcCompareStart) : false; + break; + } + } + + return result; + } + +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeBooleanOperatorsEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeBooleanOperatorsEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeBooleanOperatorsEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeBooleanOperatorsEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,74 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + + +/** + * @author Narcis Marcu (narcism@users.sourceforge.net) + */ +public enum FilterTypeBooleanOperatorsEnum implements NamedEnum +{ + IS_TRUE("Is true"), + + IS_NOT_TRUE("Is not true"), + + IS_FALSE("Is false"), + + IS_NOT_FALSE("Is not false"); + + /** + * + */ + private final transient String name; + + private FilterTypeBooleanOperatorsEnum(String name) + { + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static FilterTypeBooleanOperatorsEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } + + /** + * + */ + public static FilterTypeBooleanOperatorsEnum getByEnumConstantName(String name) + { + return EnumUtil.getByConstantName(values(), name); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeBooleanOperatorsEnum.properties jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeBooleanOperatorsEnum.properties --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeBooleanOperatorsEnum.properties 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeBooleanOperatorsEnum.properties 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,4 @@ +net.sf.jasperreports.components.sort.FilterTypeBooleanOperatorsEnum.IS_TRUE=Is true +net.sf.jasperreports.components.sort.FilterTypeBooleanOperatorsEnum.IS_NOT_TRUE=Is not true +net.sf.jasperreports.components.sort.FilterTypeBooleanOperatorsEnum.IS_FALSE=Is false +net.sf.jasperreports.components.sort.FilterTypeBooleanOperatorsEnum.IS_NOT_FALSE=Is not false \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeDateOperatorsEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeDateOperatorsEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeDateOperatorsEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeDateOperatorsEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public enum FilterTypeDateOperatorsEnum implements NamedEnum +{ + EQUALS("Equals"), + + IS_NOT_EQUAL_TO("Is not Equal to"), + + IS_BETWEEN("Is Between"), + + IS_NOT_BETWEEN("Is not between"), + + IS_ON_OR_BEFORE("Is On or Before"), + + IS_BEFORE("Is Before"), + + IS_ON_OR_AFTER("Is On or After"), + + IS_AFTER("Is After"); + + /** + * + */ + private final transient String name; + + private FilterTypeDateOperatorsEnum(String name) + { + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static FilterTypeDateOperatorsEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } + + /** + * + */ + public static FilterTypeDateOperatorsEnum getByEnumConstantName(String name) + { + return EnumUtil.getByConstantName(values(), name); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeDateOperatorsEnum.properties jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeDateOperatorsEnum.properties --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeDateOperatorsEnum.properties 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeDateOperatorsEnum.properties 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,8 @@ +net.sf.jasperreports.components.sort.FilterTypeDateOperatorsEnum.EQUALS=Equals +net.sf.jasperreports.components.sort.FilterTypeDateOperatorsEnum.IS_NOT_EQUAL_TO=Is not equal to +net.sf.jasperreports.components.sort.FilterTypeDateOperatorsEnum.IS_BETWEEN=Is between +net.sf.jasperreports.components.sort.FilterTypeDateOperatorsEnum.IS_NOT_BETWEEN=Is not between +net.sf.jasperreports.components.sort.FilterTypeDateOperatorsEnum.IS_ON_OR_BEFORE=Is on or before +net.sf.jasperreports.components.sort.FilterTypeDateOperatorsEnum.IS_BEFORE=Is before +net.sf.jasperreports.components.sort.FilterTypeDateOperatorsEnum.IS_ON_OR_AFTER=Is on or after +net.sf.jasperreports.components.sort.FilterTypeDateOperatorsEnum.IS_AFTER=Is after \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeNumericOperatorsEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeNumericOperatorsEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeNumericOperatorsEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeNumericOperatorsEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public enum FilterTypeNumericOperatorsEnum implements NamedEnum +{ + EQUALS("Equals"), + + DOES_NOT_EQUAL("Does Not Equal"), + + GREATER_THAN("Greater Than"), + + GREATER_THAN_EQUAL_TO("Greater Than or Equal to"), + + LESS_THAN("Less Than"), + + LESS_THAN_EQUAL_TO("Less Than or Equal to"), + + IS_BETWEEN("Is Between"), + + IS_NOT_BETWEEN("Is not between"); + + /** + * + */ + private final transient String name; + + private FilterTypeNumericOperatorsEnum(String name) + { + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static FilterTypeNumericOperatorsEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } + + /** + * + */ + public static FilterTypeNumericOperatorsEnum getByEnumConstantName(String name) + { + return EnumUtil.getByConstantName(values(), name); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeNumericOperatorsEnum.properties jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeNumericOperatorsEnum.properties --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeNumericOperatorsEnum.properties 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeNumericOperatorsEnum.properties 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,8 @@ +net.sf.jasperreports.components.sort.FilterTypeNumericOperatorsEnum.EQUALS=Equals +net.sf.jasperreports.components.sort.FilterTypeNumericOperatorsEnum.DOES_NOT_EQUAL=Does not equal +net.sf.jasperreports.components.sort.FilterTypeNumericOperatorsEnum.GREATER_THAN=Greater than +net.sf.jasperreports.components.sort.FilterTypeNumericOperatorsEnum.GREATER_THAN_EQUAL_TO=Greater than or equal to +net.sf.jasperreports.components.sort.FilterTypeNumericOperatorsEnum.LESS_THAN=Less than +net.sf.jasperreports.components.sort.FilterTypeNumericOperatorsEnum.LESS_THAN_EQUAL_TO=Less than or equal to +net.sf.jasperreports.components.sort.FilterTypeNumericOperatorsEnum.IS_BETWEEN=Is between +net.sf.jasperreports.components.sort.FilterTypeNumericOperatorsEnum.IS_NOT_BETWEEN=Is not between \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypesEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypesEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypesEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypesEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,68 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public enum FilterTypesEnum implements NamedEnum +{ + NUMERIC("Numeric"), + + TEXT("Text"), + + DATE("Date"), + + BOOLEAN("Boolean"), + + TIME("Time"); + + /** + * + */ + private final transient String name; + + private FilterTypesEnum(String name) + { + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static FilterTypesEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeTextOperatorsEnum.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeTextOperatorsEnum.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeTextOperatorsEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeTextOperatorsEnum.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ +package net.sf.jasperreports.components.sort; + +import net.sf.jasperreports.engine.type.EnumUtil; +import net.sf.jasperreports.engine.type.NamedEnum; + + +/** + * @author Teodor Danciu (teodord@users.sourceforge.net) + */ +public enum FilterTypeTextOperatorsEnum implements NamedEnum +{ + EQUALS("Equals"), + + IS_NOT_EQUAL_TO("Is not Equal to"), + + CONTAINS("Contains"), + + DOES_NOT_CONTAIN("Does not Contain"), + + STARTS_WITH("Starts With"), + + DOES_NOT_START_WITH("Does not Start With"), + + ENDS_WITH("Ends With"), + + DOES_NOT_END_WITH("Does not End With"); + + /** + * + */ + private final transient String name; + + private FilterTypeTextOperatorsEnum(String name) + { + this.name = name; + } + + @Override + public String getName() + { + return name; + } + + /** + * + */ + public static FilterTypeTextOperatorsEnum getByName(String name) + { + return EnumUtil.getEnumByName(values(), name); + } + + /** + * + */ + public static FilterTypeTextOperatorsEnum getByEnumConstantName(String name) + { + return EnumUtil.getByConstantName(values(), name); + } +} diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeTextOperatorsEnum.properties jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeTextOperatorsEnum.properties --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeTextOperatorsEnum.properties 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/FilterTypeTextOperatorsEnum.properties 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,8 @@ +net.sf.jasperreports.components.sort.FilterTypeTextOperatorsEnum.EQUALS=Equals +net.sf.jasperreports.components.sort.FilterTypeTextOperatorsEnum.IS_NOT_EQUAL_TO=Is not equal to +net.sf.jasperreports.components.sort.FilterTypeTextOperatorsEnum.CONTAINS=Contains +net.sf.jasperreports.components.sort.FilterTypeTextOperatorsEnum.DOES_NOT_CONTAIN=Does not contain +net.sf.jasperreports.components.sort.FilterTypeTextOperatorsEnum.STARTS_WITH=Starts with +net.sf.jasperreports.components.sort.FilterTypeTextOperatorsEnum.DOES_NOT_START_WITH=Does not start with +net.sf.jasperreports.components.sort.FilterTypeTextOperatorsEnum.ENDS_WITH=Ends with +net.sf.jasperreports.components.sort.FilterTypeTextOperatorsEnum.DOES_NOT_END_WITH=Does not end with \ No newline at end of file diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/package-info.java jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/package-info.java --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/package-info.java 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,28 @@ +/* + * JasperReports - Free Java Reporting Library. + * Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved. + * http://www.jaspersoft.com + * + * Unless you have purchased a commercial license agreement from Jaspersoft, + * the following license terms apply: + * + * This program is part of JasperReports. + * + * JasperReports 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. + * + * JasperReports 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 JasperReports. If not, see . + */ + +/** +* Contains classes for the built-in Sort component. +*/ +package net.sf.jasperreports.components.sort; \ No newline at end of file Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/delete_edit.gif and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/delete_edit.gif differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/filter_over.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/filter_over.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/filter.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/filter.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/filter_wrong.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/filter_wrong.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/sort_asc_over.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/sort_asc_over.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/sort_asc.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/sort_asc.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/sort_desc_over.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/sort_desc_over.png differ Binary files /tmp/tmpLIkjxB/k3SMqQNH9a/jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/sort_desc.png and /tmp/tmpLIkjxB/KIsni1_8Zj/jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/resources/images/sort_desc.png differ diff -Nru jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/resources/jive.filterDialog.tmpl jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/resources/jive.filterDialog.tmpl --- jasperreports-6.2.2/jasperreports/src/net/sf/jasperreports/components/sort/resources/jive.filterDialog.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ jasperreports-6.3.1/jasperreports/src/net/sf/jasperreports/components/sort/resources/jive.filterDialog.tmpl 2016-10-03 16:57:52.000000000 +0000 @@ -0,0 +1,11 @@ +