jasperreports-4.1.3.orig/0000755000175000017500000000000011652520173015257 5ustar drazzibdrazzibjasperreports-4.1.3.orig/docs/0000755000175000017500000000000011654071731016212 5ustar drazzibdrazzibjasperreports-4.1.3.orig/docs/schema.reference.xsl0000644000175000017500000003645011614511014022134 0ustar drazzibdrazzib api/ http://jasperreports.sourceforge.net/api/ JasperReports <xsl:value-of select="$version"/> - Schema Reference
sample.reference.htmlSample Reference - schema.reference.htmlSchema Reference - config.reference.htmlConfiguration Reference - index.htmlAPI (Javadoc)

JasperReports - Schema Reference (version )


This document describes the structure of the JRXML report template files for the JasperReports library.

# (in ) (in )
</td><td>






top

(in ) (in )

Attributes



© 2001-2010 Jaspersoft Corporation www.jaspersoft.com

Contains


#<>

#attribute Type: Use: Values
Values
Values
Default:
# # *? ( # # *? (in ) (in ) | )*?
jasperreports-4.1.3.orig/docs/config.reference.xsl0000644000175000017500000002075511614511014022142 0ustar drazzibdrazzib api/ http://jasperreports.sourceforge.net/api/ JasperReports <xsl:value-of select="$version"/> - Configuration Reference
sample.reference.htmlSample Reference - schema.reference.htmlSchema Reference - config.reference.htmlConfiguration Reference - 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-2010 Jaspersoft Corporation www.jaspersoft.com
#


_blank jasperreports-4.1.3.orig/docs/sample.reference.xml0000644000175000017500000002015111652032450022142 0ustar drazzibdrazzib General Report Design Report Compilation Data Source / Query Executer Report Filling Report Export jasperreports-4.1.3.orig/docs/resources/0000755000175000017500000000000011654071732020225 5ustar drazzibdrazzibjasperreports-4.1.3.orig/docs/resources/jasperreports.png0000644000175000017500000000272311614511014023626 0ustar drazzibdrazzibPNG  IHDRi4rUsRGBbKGD pHYs  tIME !f3tEXtCommentCreated with GIMPW.IDAThZnF {2pAHO *'˫D .JTu\sR&9  ?8l ъ\R`az=ܟ曙]ر| is`kC7S[NҳY?0w Lx`uh..S<1CuIs*@ri<[ g?Q=WXm>d:Xd³me*ːPnL3_aLin;f\џ ')P 1<4: u u%c 22<:I -0hc,k Fœ ^&Klb.$P)^Z)e ,$  9fk,Mqlp9j2 P$!3C,hm%3S~IúKi C,[uq6"¥)<2*"I_ˢFs1胬)?)^*O=&S)f9]AA=IpLƵ*^t`Ȱj:HL.f&RSfL鶠p`cbTTkW8ՌZnfw9'Hy@m),MpkXٙ {{LJ7AnD7/a p x]REڬc}lx }_#%XPP>Z,sҸɩϛVw6^שJM_ӿ TzIENDB`jasperreports-4.1.3.orig/docs/resources/jr-16x16.png0000644000175000017500000000026111614511014022114 0ustar drazzibdrazzibPNG  IHDRh6gAMA ahIDAT8O 0 N!+SLʃG >l5'@uZ%p(9!u݌F 0F$Mii{]4eSeTʧ cIENDB`jasperreports-4.1.3.orig/docs/resources/px.gif0000644000175000017500000000144711614511014021335 0ustar drazzibdrazzibGIF89a!,;jasperreports-4.1.3.orig/docs/config.reference.xml0000644000175000017500000045077211652510743022154 0ustar drazzibdrazzib Data Source / Query Executer Report Compilation Report Design Report Filling Governors Crosstabs Chart Themes Report Export JasperReports Extensions Other 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 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/JRQueryExecuterFactory.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/util/JRProperties.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/util/JRProperties.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/util/JRProperties.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/util/JRProperties.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
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 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 3.5.0
Specifies the default split type for bands. See the splitType attribute of the report band. net/sf/jasperreports/engine/JRBand.html#PROPERTY_SPLIT_TYPE false Global | Report 3.5.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 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 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
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
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 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 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
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. net/sf/jasperreports/engine/util/FileBufferedOutputStream.html#PROPERTY_MEMORY_THRESHOLD 262144 Global 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/util/JRProperties.html#PROPERTIES_FILE jasperreports.properties System 1.0.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/util/JRProperties.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 create default exporter filter instances that filter out content based on element origin information. Possible values for the {format} token are pdf, html, xls, 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 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, 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
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 default for the CHARACTER_ENCODING export parameter, meaning the character encoding used for export. net/sf/jasperreports/engine/JRExporterParameter.html#PROPERTY_CHARACTER_ENCODING UTF-8 Global | Report 2.0.1 Property which allows rendering element borders in older reports using the legacy border offset technique that that was used in versions prior to the 2.0.3 release. net/sf/jasperreports/engine/export/legacy/BorderOffset.html#PROPERTY_LEGACY_BORDER_OFFSET net.sf.jasperreports.export.legacy.BorderOffset.DEFAULT Global | Report 3.0.0 net/sf/jasperreports/engine/export/JRCsvMetadataExporterParameter.html#PROPERTY_COLUMN_NAME N/A Element 4.0.0 net/sf/jasperreports/engine/export/JRCsvMetadataExporterParameter.html#PROPERTY_COLUMN_NAMES N/A Report 4.0.0 net/sf/jasperreports/engine/export/JRCsvMetadataExporterParameter.html#PROPERTY_DATA N/A Element 4.0.0 Property whose value is used as default for the FIELD_DELIMITER CSV export parameter. Contains the character or sequence of characters used to delimit two fields on the same record. net/sf/jasperreports/engine/export/JRCsvExporterParameter.html#PROPERTY_FIELD_DELIMITER , Global | Report 2.0.1 Property whose value is used as default for the RECORD_DELIMITER CSV export parameter. Contains the character or sequence of characters used to delimit two records. net/sf/jasperreports/engine/export/JRCsvExporterParameter.html#PROPERTY_RECORD_DELIMITER \n Global | Report 2.0.1 net/sf/jasperreports/engine/export/JRCsvMetadataExporterParameter.html#PROPERTY_REPEAT_VALUE false Element 4.0.0 net/sf/jasperreports/engine/export/JRCsvMetadataExporterParameter.html#PROPERTY_WRITE_HEADER Element 4.0.0 Property that provides a default value for the MINIMIZE_PRINTER_JOB_SIZE Graphics2D exporter parameter. This flag 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. net/sf/jasperreports/engine/export/JRGraphics2DExporter.html#MINIMIZE_PRINTER_JOB_SIZE true Global | Report 1.2.8 This property serves as default value for the IGNORE_PAGE_MARGINS export flag. Specifies whether page margins should be ignored when the report is exported using a grid-based exporter If the property is true, any page in the document will be exported without taking into account its margins. net/sf/jasperreports/engine/JRExporterParameter.html#PROPERTY_IGNORE_PAGE_MARGINS false Global | Report 2.0.5 This property serves as default value for the FRAMES_AS_NESTED_TABLES export parameter. If set to false, the frame content will be integrated into the master/page table. net/sf/jasperreports/engine/export/ooxml/JRDocxExporterParameter.html#PROPERTY_FRAMES_AS_NESTED_TABLES true Global | Report | Element 3.5.3 This property serves as default value for the FLEXIBLE_ROW_HEIGHT export parameter. If set to false, the table rows do not increase in height automatically and the user has to enlarge them manually. net/sf/jasperreports/engine/export/ooxml/JRDocxExporterParameter.html#PROPERTY_FRAMES_AS_NESTED_TABLES 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 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. net/sf/jasperreports/engine/export/JRHtmlExporter.html#PROPERTY_ACCESSIBLE false Global | Report 3.7.5 This property serves as default value for the FRAMES_AS_NESTED_TABLES export parameter. If set to false, the frame content will be integrated into the master/page HTML table. net/sf/jasperreports/engine/export/JRHtmlExporterParameter.html#PROPERTY_FRAMES_AS_NESTED_TABLES true Global | Report | Element 2.0.1 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/JRHtmlExporter.html#PROPERTY_HTML_ID N/A Element 3.7.0 Property whose value is used as default state of the IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS export flag. If set to true, blank lines that sometimes appear between rows as spacers, should be collapsed. net/sf/jasperreports/engine/export/JRHtmlExporterParameter.html#PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_ROWS false Global | Report 2.0.1 Property whose value is used as default for the SIZE_UNIT export parameter. A String value specifying the unit to use when measuring lengths or font size. net/sf/jasperreports/engine/export/JRHtmlExporterParameter.html#PROPERTY_SIZE_UNIT px Global | Report 2.0.1 Property whose value is used as default state of the IS_USING_IMAGES_TO_ALIGN export flag. It specifies whether the export engine should use small transparent spacer images for aligning content. net/sf/jasperreports/engine/export/JRHtmlExporterParameter.html#PROPERTY_USING_IMAGES_TO_ALIGN true Global | Report 2.0.1 Property whose value is used as default state of the IS_WHITE_PAGE_BACKGROUND export parameter. It specifies whether the report page background should be forced to white. net/sf/jasperreports/engine/export/JRHtmlExporterParameter.html#PROPERTY_WHITE_PAGE_BACKGROUND true Global | Report 2.0.1 Property whose value is used as default state of the IS_WRAP_BREAK_WORD export parameter. It specifies whether the export engine should force text wrapping by breaking words (CSS word-wrap: break-word). net/sf/jasperreports/engine/export/JRHtmlExporterParameter.html#PROPERTY_WRAP_BREAK_WORD false Global | Report 2.0.1 Boolean property enabling the JExcelApiExporter to use temporary files when creating large documents. net/sf/jasperreports/engine/export/JExcelApiExporter.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/engine/export/JExcelApiExporter.html#PROPERTY_COMPLEX_FORMAT false Global | Report | Element 3.7.6 Property that establishes the priority of export parameters against report hints. 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 whose value is used as default state of the IS_128_BIT_KEY export parameter. It specifies whether the encryption key is 128 bits. net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#PROPERTY_128_BIT_KEY false Global | Report 2.0.1 Property whose value is used as default state of the IS_COMPRESSED export flag. It specifies whether the PDF document should be compressed. net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#PROPERTY_COMPRESSED false Global | Report 2.0.1 Property whose value is used as default state of the IS_CREATING_BATCH_MODE_BOOKMARKS export flag. It specifies whether the PDF document should contain an outline section. net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#PROPERTY_CREATE_BATCH_MODE_BOOKMARKS false Global | Report 2.0.1 Property whose value is used as default state of the IS_ENCRYPTED export flag. It specifies whether the final PDF document should be encrypted. net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#PROPERTY_ENCRYPTED false Global | Report 2.0.1 Prefix of properties that specify font files for the PDF exporter. net/sf/jasperreports/engine/util/JRProperties.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/util/JRProperties.html#PDF_FONT_DIRS_PREFIX N/A Global 1.0.0 Property whose value is used as default state of the FORCE_LINEBREAK_POLICY export flag. It specifies whether the PDF exporter should use a SplitCharacter implementation to ensure that PDF text wrap behavior is the same as in AWT. net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#PROPERTY_FORCE_LINEBREAK_POLICY false Global | Report 2.0.1 4.1.1 Property whose value is used as default state of the FORCE_SVG_SHAPES export flag. It specifies whether the rendering of SVG images using shapes on the PDF Graphics2D context should be forced. net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#PROPERTY_FORCE_SVG_SHAPES true Global | Report 2.0.1 Property whose value is used as default state of the PDF_JAVASCRIPT export parameter. Contains the user defined JavaScript piece of code to be inserted into the generated PDF document. net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#PROPERTY_PDF_JAVASCRIPT N/A Global | Report 2.0.1 Property whose value is used as default state of the OWNER_PASSWORD export parameter. 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. net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#PROPERTY_OWNER_PASSWORD N/A Global | Report 2.0.1 Property whose value is used as default state of the PRINT_SCALING export parameter. Possible values are default and none. net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#PRINT_SCALING default Global | Report 3.6.1 Property whose value is used as default state of the USER_PASSWORD export parameter. Contains the user password needed to open the document, if it is encrypted. net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#PROPERTY_USER_PASSWORD N/A Global | Report 2.0.1 Property whose value is used as default state of the PDF_VERSION export parameter. Contains a Character instance representing the version of the generated PDF. net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#PROPERTY_PDF_VERSION N/A Global | Report 2.0.1 Property whose value is used as default state of the IS_TAGGED export flag. Specifies whether the exporter should put structure tags in the generated PDF. net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#PROPERTY_PDF_TAGGED false Global | Report 3.1.2 Property whose value is used as default state of the TAG_LANGUAGE export parameter. Specifies the language that the exporter should put in the language tag of the generated PDF. net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#PROPERTY_TAG_LANGUAGE N/A Global | Report 3.1.2 Property whose value is used as default state of the CHARACTER_WIDTH export parameter. net/sf/jasperreports/engine/export/JRTextExporterParameter.html#PROPERTY_CHARACTER_WIDTH N/A Global | Report 3.6.1 Property whose value is used as default state of the CHARACTER_HEIGHT export parameter. net/sf/jasperreports/engine/export/JRTextExporterParameter.html#PROPERTY_CHARACTER_HEIGHT N/A Global | Report 3.6.1 Property whose value is used as default state of the PAGE_WIDTH export parameter. net/sf/jasperreports/engine/export/JRTextExporterParameter.html#PROPERTY_PAGE_WIDTH N/A Global | Report 3.6.1 This element-level property is used to indicate the boundaries of the autofilter data range in the current sheet. Allowed values are: net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_AUTO_FILTER N/A Element 4.1.3 Property whose value is used as default state of the PAGE_HEIGHT export parameter. net/sf/jasperreports/engine/export/JRTextExporterParameter.html#PROPERTY_PAGE_HEIGHT N/A Global | Report 3.6.1 Property whose value is used as default state of the IS_COLLAPSE_ROW_SPAN export flag. Specifies whether row spans should be collapsed and merging cells across rows should be inhibited. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_COLLAPSE_ROW_SPAN false Global | Report 2.0.1 Represents the name for the column that should appear in the XLS export. It must be one of the values in PROPERTY_COLUMN_NAMES_PREFIX, if provided. net/sf/jasperreports/engine/export/JRXlsAbstractMetadataExporterParameter.html#PROPERTY_COLUMN_NAME N/A Element 4.0.2 Properties having this prefix contain comma-separated column names.
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/engine/export/JRXlsAbstractMetadataExporterParameter.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: 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. 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/engine/export/JRXlsAbstractExporterParameter.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. By default the property is considered (true), but it only has effect if the enclosing sheet is protected. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_CELL_LOCKED true Global | Report | Element 3.7.5 Property whose value is used as default state of the CREATE_CUSTOM_PALETTE export flag. This property is by default not set (false). net/sf/jasperreports/engine/export/JExcelApiExporterParameter.html#PROPERTY_CREATE_CUSTOM_PALETTE false Global | Report 2.0.0 Property that specifies which value to associate with PROPERTY_COLUMN_NAME.
By default this value is represented by the text value of the report element this property is assigned to.
net/sf/jasperreports/engine/export/JRXlsAbstractMetadataExporterParameter.html#PROPERTY_DATA N/A Element 4.0.2
Property whose value is used as default state of the IS_DETECT_CELL_TYPE export flag. Specifies whether the exporter should take into consideration the type of the original text field expressions and set the cell types and values accordingly. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.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. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.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. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_FIT_WIDTH N/A Global | Report 3.7.5 Property whose value is used as default state of the IS_FONT_SIZE_FIX_ENABLED export flag. Specifies whether the font size should be decreased so that texts fit into the specified cell height. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_FONT_SIZE_FIX_ENABLED false Global | Report 2.0.1 Property whose value is used as default state of the IS_IGNORE_CELL_BACKGROUND export flag. Specifies whether cell background color should be ignored. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_IGNORE_CELL_BACKGROUND false Global | Report 3.6.2 Property whose value is used as default state of the IS_IGNORE_CELL_BORDER export flag. Specifies whether cell borders should be ignored. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_IGNORE_CELL_BORDER false Global | Report 2.0.1 Property whose value is used as default state of the IS_IGNORE_GRAPHICS export flag. Specifies whether graphic elements should be ignored and only text elements be exported. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_IGNORE_GRAPHICS false Global | Report 2.0.1 Property whose value is used as default state of the IS_IMAGE_BORDER_FIX_ENABLED export parameter. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_IMAGE_BORDER_FIX_ENABLED false Global | Report 3.0.0 Property whose value is used as default state of the MAXIMUM_ROWS_PER_SHEET export parameter. 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. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_MAXIMUM_ROWS_PER_SHEET 0 Global | Report 2.0.1 Property whose value is used as default state of the IS_ONE_PAGE_PER_SHEET export flag. Specifies whether each report page should be written in a different XLS sheet. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_ONE_PAGE_PER_SHEET false Global | Report 2.0.1 Property whose value is used as default state of the IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS export flag. Specifies whether the empty spacer columns should be removed or not. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS false Global | Report 2.0.1 Property whose value is used as default state of the IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS export flag. Specifies whether the empty spacer rows should be removed or not. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_ROWS false Global | Report 2.0.1 Property whose value is used as default state of the IS_WHITE_PAGE_BACKGROUND export flag. Specifies whether the page background should be white or the default XLS background color. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_WHITE_PAGE_BACKGROUND true Global | Report 2.0.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:
net/sf/jasperreports/engine/export/JRXlsAbstractExporter.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: The property is available for:
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:
net/sf/jasperreports/engine/export/JRXlsAbstractExporter.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: The property is available for:
net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_FREEZE_ROW_EDGE N/A Report Element 4.1.1
Property whose value is used as default state of the PASSWORD export parameter.
Contains a String value representing the password in case of password protected sheets in documents.
This property is by default not set (null).
net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.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/JRAbstractXlsExporter.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. net/sf/jasperreports/engine/export/JRXlsAbstractMetadataExporterParameter.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: net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERTY_SHEET_DIRECTION LTR Global | Report 3.7.5 Custom property storing the text content of the sheet footer's center. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.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. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.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. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_SHEET_FOOTER_RIGHT N/A Global | Report 3.7.5 Custom property storing the text content of the sheet header's center. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.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. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.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. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.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/JRXlsAbstractExporterParameter.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.
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. 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.

  3. 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

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/engine/export/JRXlsAbstractExporterParameter.html#PROPERTY_SHEET_NAMES_PREFIX N/A Report 3.5.2
Custom element property specifying if text wrapping is allowed in a given cell. If set to false, text wrapping is forbidden, otherwise it is allowed. net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.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. net/sf/jasperreports/engine/export/JRXlsAbstractMetadataExporterParameter.html#PROPERTY_WRITE_HEADER false Element 4.0.2 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 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. It serves as default value for the FLUSH_OUTPUT export parameter. net/sf/jasperreports/engine/export/JRHtmlExporterParameter.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/engine/export/JRPdfExporterParameter.html#PROPERTY_COLLAPSE_MISSING_BOOKMARK_LEVELS false Global | Report 3.7.3
jasperreports-4.1.3.orig/docs/sample.xsl0000644000175000017500000003405111614511014020213 0ustar drazzibdrazzib ../../api/ http://jasperreports.sourceforge.net/api/ JasperReports <xsl:value-of select="$version"/> - <xsl:value-of select="sample/title"/>
../../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://jasperforge.org/scm/viewvc.php/tags//jasperreports/demo/samples//?root=jasperreports_blankBrowse Sample Source Files on SVN


Main Features in This Sample

Secondary Features


top

Documented by mailto:copy ,


Description / Goal

Since

Other Samples





© 2001-2010 Jaspersoft Corporation www.jaspersoft.com

#
..//index.html# ..//index.html


_blankelement ../../sample.reference//index.html# subtitle 0 ../../schema.reference.html#<> _blank ..//index.html/demo/samples/
jasperreports-4.1.3.orig/docs/sample.reference.xsl0000644000175000017500000001676511614511014022164 0ustar drazzibdrazzib api/ http://jasperreports.sourceforge.net/api/ JasperReports <xsl:value-of select="$version"/> - Sample Reference
sample.reference.htmlSample Reference - schema.reference.htmlSchema Reference - config.reference.htmlConfiguration Reference - 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-2010 Jaspersoft Corporation www.jaspersoft.com
sample.reference//index.html#incomplete sample.reference//index.html#complete sample.reference//index.html


_blank jasperreports-4.1.3.orig/build/0000755000175000017500000000000011654071731016361 5ustar drazzibdrazzibjasperreports-4.1.3.orig/pom.xml0000644000175000017500000003051611651610232016574 0ustar drazzibdrazzib 4.0.0 net.sf.jasperreports jasperreports 4.1.3 jar JasperReports http://jasperreports.sourceforge.net JasperReports Library GNU Lesser General Public License http://jasperreports.sourceforge.net/license.html repo scm:svn:http://jasperforge.org/svn/repos/jasperreports jr-4-1-3 http://jasperforge.org/scm/viewvc.php/?root=jasperreports teodord Teodor Danciu teodord@users.sourceforge.net http://sourceforge.net/users/teodord Jaspersoft Corporation http://www.jaspersoft.com architect developer +2 lucianc Lucian Chirita lucianc@users.sourceforge.net http://sourceforge.net/users/lucianc Jaspersoft Corporation http://www.jaspersoft.com architect developer +2 jasperreports http://jasperreports.sourceforge.net/maven2 src src **/*.dtd **/*.xsd **/*.rels **/*.xml **/*.properties **/*.png **/*.GIF **/*.gif **/*.ico **/*TokenTypes.txt **/*.vm **/*.js **/*.css org.apache.maven.plugins maven-compiler-plugin 1.5 1.5 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 sonatype-nexus-staging Nexus Release Repository http://oss.sonatype.org/service/local/staging/deploy/maven2/ commons-beanutils commons-beanutils 1.8.0 compile commons-collections commons-collections 2.1 compile commons-digester commons-digester 1.7 compile commons-logging commons-logging 1.0.2 compile org.hibernate hibernate 3.0.5 compile javax.transaction jta true com.lowagie itext 2.1.7 compile jfree jcommon 1.0.15 compile gnujaxp gnujaxp jfree jfreechart 1.0.12 compile gnujaxp gnujaxp org.apache.poi poi 3.7 compile true javax.servlet servlet-api 2.2 provided true xalan xalan 2.7.1 compile true xml-apis xml-apis 1.3.02 compile eclipse jdtcore 3.1.0 compile org.codehaus.groovy groovy-all 1.7.5 compile true rhino js 1.7R1 compile true org.apache.ant ant 1.7.1 compile true net.sourceforge.jexcelapi jxl 2.6.10 compile true com.keypoint png-encoder 1.5 compile true commons-javaflow commons-javaflow 20060411 compile true mondrian mondrian 3.1.1.12687 compile true javax.persistence persistence-api 1.0 true antlr antlr 2.7.5 true javax.xml.soap saaj-api 1.3 compile true javax.activation activation jaxen jaxen 1.1.1 compile true org.beanshell bsh 2.0b4 compile true org.apache.xmlgraphics batik-bridge 1.7 compile true org.apache.xmlgraphics batik-gvt 1.7 compile true org.apache.xmlgraphics batik-util 1.7 compile true org.apache.xmlgraphics batik-svg-dom 1.7 compile true org.apache.xmlgraphics batik-dom 1.7 compile true org.apache.xmlgraphics batik-script 1.7 compile true org.apache.xmlgraphics batik-css 1.7 compile true org.apache.xmlgraphics batik-svggen 1.7 compile true org.apache.xmlgraphics batik-awt-util 1.7 compile true org.springframework spring-core 2.5 compile true org.springframework spring-beans 2.5 compile true net.sf.barcode4j barcode4j 2.0 compile true net.sourceforge.barbecue barbecue 1.5-beta1 compile true org.codehaus.castor castor 1.2 compile org.apache.velocity velocity 1.7 compile true org.apache.poi poi-ooxml 3.7 org.codehaus.jackson jackson-core-lgpl 1.7.4 org.codehaus.jackson jackson-mapper-lgpl 1.7.4 jasperreports-4.1.3.orig/readme.txt0000644000175000017500000000534311614511014017252 0ustar drazzibdrazzib JasperReports Library ============================= 1. ANT Build Tool ----------------------------- In order to compile the project or to run the sample applications provided with this distribution, you need to have the ANT build tool installed on your system. You can get a copy of this tool and details about how to use it at this address: http://ant.apache.org/ 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 ----------------------------- Jaspersoft Corporation now offers support, services and training for JasperReports and you can learn more about all these here: http://www.jaspersoft.com/ss_overview.html jasperreports-4.1.3.orig/build.xml0000644000175000017500000005721411652516513017114 0ustar drazzibdrazzib Helps build the JasperReports distribution files.
JasperReports API (version ${version}) ]]> © 2001-2010 Jaspersoft Corporation
www.jaspersoft.com ]]> jasperreports-4.1.3.orig/lib/0000755000175000017500000000000011654071732016031 5ustar drazzibdrazzibjasperreports-4.1.3.orig/demo/0000755000175000017500000000000011654071731016206 5ustar drazzibdrazzibjasperreports-4.1.3.orig/dist/0000755000175000017500000000000011654071731016225 5ustar drazzibdrazzibjasperreports-4.1.3.orig/.classpath0000644000175000017500000000560511652454344017256 0ustar drazzibdrazzib jasperreports-4.1.3.orig/.project0000644000175000017500000000056411624723032016731 0ustar drazzibdrazzib jasperreports org.eclipse.jdt.core.javabuilder org.eclipse.jdt.core.javanature jasperreports-4.1.3.orig/license.txt0000644000175000017500000001672511614511014017445 0ustar drazzibdrazzib 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. jasperreports-4.1.3.orig/src/0000755000175000017500000000000011654071731016051 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/0000755000175000017500000000000011654071731016637 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/0000755000175000017500000000000011654071731017247 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/0000755000175000017500000000000011654071731022152 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/0000755000175000017500000000000011654071732024340 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/0000755000175000017500000000000011654071732026175 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/UPCAComponent.java0000644000175000017500000000373111632162654031457 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: UPCAComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ public class UPCAComponent extends BarcodeComponent { 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()); } public void receive(BarcodeVisitor visitor) { visitor.visitUPCA(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeComponent.java0000644000175000017500000001723411632162654032271 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.Serializable; import net.sf.jasperreports.engine.JRCloneable; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.JRExpression; 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; import net.sf.jasperreports.engine.util.JRProperties; import org.krysalis.barcode4j.HumanReadablePlacement; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BarcodeComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ public abstract class BarcodeComponent implements Component, Serializable, JRCloneable, JRChangeEventsSupport { public static final String PROPERTY_PREFIX = JRProperties.PROPERTY_PREFIX + "components.barcode4j."; public static final int ORIENTATION_UP = 0; public static final int ORIENTATION_LEFT = 90; public static final int ORIENTATION_DOWN = 180; 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_ORIENTATION = "orientation"; public static final String PROPERTY_CODE_EXPRESSION = "codeExpression"; 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 transient JRPropertyChangeSupport eventSupport; private EvaluationTimeEnum evaluationTimeValue; private String evaluationGroup; private int orientation; private JRExpression codeExpression; private JRExpression patternExpression; private Double moduleWidth; private String textPosition; private Double quietZone; private Double verticalQuietZone; public BarcodeComponent() { } 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); } 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 int getOrientation() { return orientation; } public void setOrientation(int orientation) { int old = this.orientation; this.orientation = orientation; getEventSupport().firePropertyChange(PROPERTY_ORIENTATION, old, this.orientation); } 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); } 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); } public String getTextPosition() { return textPosition; } public void setTextPosition(String textPosition) { Object old = this.textPosition; this.textPosition = textPosition; getEventSupport().firePropertyChange(PROPERTY_TEXT_POSITION, old, this.textPosition); } public void setTextPosition(HumanReadablePlacement textPosition) { setTextPosition(textPosition == null ? null : textPosition.getName()); } 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.patternExpression = JRCloneUtils.nullSafeClone(patternExpression); 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); public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } 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); } /* * These fields are only for serialization backward compatibility. */ private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD /** * @deprecated */ private byte evaluationTime; 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); } } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeExpressionCollector.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeExpressionCollector.ja0000644000175000017500000000333411632162654034002 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: BarcodeExpressionCollector.java 4595 2011-09-08 15:55:10Z teodord $ */ public class BarcodeExpressionCollector extends UniformBarcodeVisitor { private final JRExpressionCollector collector; public BarcodeExpressionCollector(JRExpressionCollector collector) { this.collector = collector; } protected void collectBarcode(BarcodeComponent barcode) { collector.addExpression(barcode.getCodeExpression()); collector.addExpression(barcode.getPatternExpression()); } protected void visitBarcode(BarcodeComponent barcode) { collectBarcode(barcode); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/CompiledBarcodeFactory.java0000644000175000017500000000433411632162654033410 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: CompiledBarcodeFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } protected void createCompiledBarcode(BarcodeComponent barcode) { compiledComponent = barcode.cloneObject(); JRExpression compiledCodeExpression = baseFactory.getExpression( barcode.getCodeExpression()); compiledComponent.setCodeExpression(compiledCodeExpression); JRExpression compiledPatternExpression = baseFactory.getExpression( barcode.getPatternExpression()); compiledComponent.setPatternExpression(compiledPatternExpression); } protected void visitBarcode(BarcodeComponent barcode) { createCompiledBarcode(barcode); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/EAN8Component.java0000644000175000017500000000373111632162654031422 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: EAN8Component.java 4595 2011-09-08 15:55:10Z teodord $ */ public class EAN8Component extends BarcodeComponent { 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()); } public void receive(BarcodeVisitor visitor) { visitor.visitEAN8(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/Code128Component.java0000644000175000017500000000266311632162654032037 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: Code128Component.java 4595 2011-09-08 15:55:10Z teodord $ */ public class Code128Component extends BarcodeComponent { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public void receive(BarcodeVisitor visitor) { visitor.visitCode128(this); } } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/FourStateBarcodeComponent.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/FourStateBarcodeComponent.jav0000644000175000017500000000616711632162654033770 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 net.sf.jasperreports.engine.JRConstants; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: FourStateBarcodeComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ public abstract class FourStateBarcodeComponent extends BarcodeComponent { 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); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/UPCEComponent.java0000644000175000017500000000373111632162654031463 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: UPCEComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ public class UPCEComponent extends BarcodeComponent { 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()); } public void receive(BarcodeVisitor visitor) { visitor.visitUPCE(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/EAN13Component.java0000644000175000017500000000373411632162654031501 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: EAN13Component.java 4595 2011-09-08 15:55:10Z teodord $ */ public class EAN13Component extends BarcodeComponent { 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()); } public void receive(BarcodeVisitor visitor) { visitor.visitEAN13(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/PDF417Component.java0000644000175000017500000000727611632162654031604 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: PDF417Component.java 4595 2011-09-08 15:55:10Z teodord $ */ public class PDF417Component extends BarcodeComponent { 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; 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); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeXmlWriter.java0000644000175000017500000002215011632162654032255 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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.XmlNamespace; import net.sf.jasperreports.engine.xml.JRXmlWriter; import net.sf.jasperreports.engine.xml.JRXmlConstants; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BarcodeXmlWriter.java 4595 2011-09-08 15:55:10Z teodord $ */ public class BarcodeXmlWriter implements BarcodeVisitor { private final JRXmlWriteHelper xmlWriteHelper; private final BarcodeComponent barcodeComponent; private final ComponentKey componentKey; public BarcodeXmlWriter(JRXmlWriter reportWriter, BarcodeComponent barcode, ComponentKey componentKey) { this.xmlWriteHelper = reportWriter.getXmlWriteHelper(); this.barcodeComponent = barcode; this.componentKey = componentKey; } 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); writeBaseAttributes(barcode); } protected void endBarcode() throws IOException { xmlWriteHelper.closeElement(); } protected void writeBaseAttributes(BarcodeComponent barcode) { if (barcode.getEvaluationTimeValue() != EvaluationTimeEnum.NOW) { xmlWriteHelper.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationTime, barcode.getEvaluationTimeValue()); } xmlWriteHelper.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationGroup, barcode.getEvaluationGroup()); xmlWriteHelper.addAttribute("orientation", barcode.getOrientation(), 0); xmlWriteHelper.addAttribute("moduleWidth", barcode.getModuleWidth()); xmlWriteHelper.addAttribute("textPosition", barcode.getTextPosition()); xmlWriteHelper.addAttribute("quietZone", barcode.getQuietZone()); xmlWriteHelper.addAttribute("verticalQuietZone", barcode.getVerticalQuietZone()); } protected void writeBaseContents(BarcodeComponent barcode) throws IOException { xmlWriteHelper.writeExpression("codeExpression", barcode.getCodeExpression()); xmlWriteHelper.writeExpression("patternExpression", barcode.getPatternExpression()); } public void visitCodabar(CodabarComponent codabar) { try { startBarcode(codabar); xmlWriteHelper.addAttribute("wideFactor", codabar.getWideFactor()); writeBaseContents(codabar); endBarcode(); } catch (IOException e) { throw new JRRuntimeException(e); } } public void visitCode128(Code128Component code128) { try { startBarcode(code128); writeBaseContents(code128); endBarcode(); } catch (IOException e) { throw new JRRuntimeException(e); } } public void visitDataMatrix(DataMatrixComponent dataMatrix) { try { startBarcode(dataMatrix); xmlWriteHelper.addAttribute("shape", dataMatrix.getShape()); writeBaseContents(dataMatrix); endBarcode(); } catch (IOException e) { throw new JRRuntimeException(e); } } public void visitEANCode128(EAN128Component ean128) { try { startBarcode(ean128); xmlWriteHelper.addAttribute("checksumMode", ean128.getChecksumMode()); writeBaseContents(ean128); endBarcode(); } catch (IOException e) { throw new JRRuntimeException(e); } } public void visitCode39(Code39Component code39) { try { startBarcode(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); } } public void visitUPCA(UPCAComponent upcA) { try { startBarcode(upcA); xmlWriteHelper.addAttribute("checksumMode", upcA.getChecksumMode()); writeBaseContents(upcA); endBarcode(); } catch (IOException e) { throw new JRRuntimeException(e); } } public void visitUPCE(UPCEComponent upcE) { try { startBarcode(upcE); xmlWriteHelper.addAttribute("checksumMode", upcE.getChecksumMode()); writeBaseContents(upcE); endBarcode(); } catch (IOException e) { throw new JRRuntimeException(e); } } public void visitEAN13(EAN13Component ean13) { try { startBarcode(ean13); xmlWriteHelper.addAttribute("checksumMode", ean13.getChecksumMode()); writeBaseContents(ean13); endBarcode(); } catch (IOException e) { throw new JRRuntimeException(e); } } public void visitEAN8(EAN8Component ean8) { try { startBarcode(ean8); xmlWriteHelper.addAttribute("checksumMode", ean8.getChecksumMode()); writeBaseContents(ean8); endBarcode(); } catch (IOException e) { throw new JRRuntimeException(e); } } public void visitInterleaved2Of5(Interleaved2Of5Component interleaved2Of5) { try { startBarcode(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()); } public void visitRoyalMailCustomer( RoyalMailCustomerComponent royalMailCustomer) { try { startBarcode(royalMailCustomer); writeFourStateAttributes(royalMailCustomer); writeBaseContents(royalMailCustomer); endBarcode(); } catch (IOException e) { throw new JRRuntimeException(e); } } public void visitUSPSIntelligentMail( USPSIntelligentMailComponent intelligentMail) { try { startBarcode(intelligentMail); writeFourStateAttributes(intelligentMail); writeBaseContents(intelligentMail); endBarcode(); } catch (IOException e) { throw new JRRuntimeException(e); } } public void visitPostnet(POSTNETComponent postnet) { try { startBarcode(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); } } public void visitPDF417(PDF417Component pdf417) { try { startBarcode(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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/DataMatrixComponent.java0000644000175000017500000000361711632162654032770 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.impl.datamatrix.SymbolShapeHint; import net.sf.jasperreports.engine.JRConstants; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: DataMatrixComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ public class DataMatrixComponent extends BarcodeComponent { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_SHAPE = "shape"; private String shape; 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()); } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/USPSIntelligentMailComponent.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/USPSIntelligentMailComponent.0000644000175000017500000000274011632162654033660 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: USPSIntelligentMailComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ public class USPSIntelligentMailComponent extends FourStateBarcodeComponent { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public void receive(BarcodeVisitor visitor) { visitor.visitUSPSIntelligentMail(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/EAN128Component.java0000644000175000017500000000375311632162654031571 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 net.sf.jasperreports.engine.JRConstants; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: EAN128Component.java 4595 2011-09-08 15:55:10Z teodord $ */ public class EAN128Component extends Code128Component { 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()); } public void receive(BarcodeVisitor visitor) { visitor.visitEANCode128(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeVerifier.java0000644000175000017500000001355711632162654032106 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.HumanReadablePlacement; import org.krysalis.barcode4j.impl.datamatrix.SymbolShapeHint; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BarcodeVerifier.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } verifyTextPosition(barcode); verifyOrientation(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 evalution 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); } } protected void verifyTextPosition(BarcodeComponent barcode) { try { String position = barcode.getTextPosition(); if (position != null) { HumanReadablePlacement.byName(position); } } catch (Exception e) { verifier.addBrokenRule(e, barcode); } } protected void verifyOrientation(BarcodeComponent barcode) { int orientation = barcode.getOrientation(); if (!(orientation == BarcodeComponent.ORIENTATION_UP || orientation == BarcodeComponent.ORIENTATION_LEFT || orientation == BarcodeComponent.ORIENTATION_DOWN || orientation == BarcodeComponent.ORIENTATION_RIGHT)) { verifier.addBrokenRule("Invalid barcode orientation, supported values are 0, 90, 180, 270", barcode); } } public void visitCodabar(CodabarComponent codabar) { verifyBarcode(codabar); } public void visitCode128(Code128Component code128) { verifyBarcode(code128); } public void visitEANCode128(EAN128Component ean128) { verifyBarcode(ean128); verifyChecksumMode(ean128.getChecksumMode(), ean128); } 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); } } public void visitCode39(Code39Component code39) { verifyBarcode(code39); verifyChecksumMode(code39.getChecksumMode(), code39); } public void visitUPCA(UPCAComponent upcA) { verifyBarcode(upcA); verifyChecksumMode(upcA.getChecksumMode(), upcA); } public void visitUPCE(UPCEComponent upcE) { verifyBarcode(upcE); verifyChecksumMode(upcE.getChecksumMode(), upcE); } public void visitEAN13(EAN13Component ean13) { verifyBarcode(ean13); verifyChecksumMode(ean13.getChecksumMode(), ean13); } public void visitEAN8(EAN8Component ean8) { verifyBarcode(ean8); verifyChecksumMode(ean8.getChecksumMode(), ean8); } public void visitInterleaved2Of5(Interleaved2Of5Component interleaved2Of5) { verifyBarcode(interleaved2Of5); verifyChecksumMode(interleaved2Of5.getChecksumMode(), interleaved2Of5); } public void visitRoyalMailCustomer( RoyalMailCustomerComponent royalMailCustomer) { verifyBarcode(royalMailCustomer); verifyChecksumMode(royalMailCustomer.getChecksumMode(), royalMailCustomer); } public void visitUSPSIntelligentMail( USPSIntelligentMailComponent intelligentMail) { verifyBarcode(intelligentMail); verifyChecksumMode(intelligentMail.getChecksumMode(), intelligentMail); } 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); } } } public void visitPDF417(PDF417Component pdf417) { verifyBarcode(pdf417); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/UniformBarcodeVisitor.java0000644000175000017500000000504011632162654033316 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: UniformBarcodeVisitor.java 4595 2011-09-08 15:55:10Z teodord $ */ public abstract class UniformBarcodeVisitor implements BarcodeVisitor { protected abstract void visitBarcode(BarcodeComponent barcode); public void visitCodabar(CodabarComponent codabar) { visitBarcode(codabar); } public void visitCode128(Code128Component code128) { visitBarcode(code128); } public void visitDataMatrix(DataMatrixComponent dataMatrix) { visitBarcode(dataMatrix); } public void visitEANCode128(EAN128Component ean128) { visitBarcode(ean128); } public void visitCode39(Code39Component code39) { visitBarcode(code39); } public void visitUPCA(UPCAComponent upcA) { visitBarcode(upcA); } public void visitUPCE(UPCEComponent upcE) { visitBarcode(upcE); } public void visitEAN13(EAN13Component ean13) { visitBarcode(ean13); } public void visitEAN8(EAN8Component ean8) { visitBarcode(ean8); } public void visitInterleaved2Of5(Interleaved2Of5Component interleaved2Of5) { visitBarcode(interleaved2Of5); } public void visitRoyalMailCustomer( RoyalMailCustomerComponent royalMailCustomer) { visitBarcode(royalMailCustomer); } public void visitUSPSIntelligentMail( USPSIntelligentMailComponent intelligentMail) { visitBarcode(intelligentMail); } public void visitPostnet(POSTNETComponent postnet) { visitBarcode(postnet); } public void visitPDF417(PDF417Component pdf417) { visitBarcode(pdf417); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeFillFactory.java0000644000175000017500000000367511632162654032551 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: BarcodeFillFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class BarcodeFillFactory implements ComponentFillFactory { public FillComponent toFillComponent(Component component, JRFillObjectFactory factory) { BarcodeComponent barcode = (BarcodeComponent) component; return new BarcodeFillComponent(barcode); } public FillComponent cloneFillComponent(FillComponent component, JRFillCloneFactory factory) { BarcodeFillComponent barcode = (BarcodeFillComponent) component; return new BarcodeFillComponent(barcode); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeSVGImageProducer.java0000644000175000017500000000511611632162654033431 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.StringWriter; 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 net.sf.jasperreports.engine.JRComponentElement; import net.sf.jasperreports.engine.JRRenderable; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.renderers.BatikRenderer; import org.krysalis.barcode4j.BarcodeGenerator; import org.krysalis.barcode4j.output.svg.SVGCanvasProvider; import org.w3c.dom.Document; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BarcodeSVGImageProducer.java 4595 2011-09-08 15:55:10Z teodord $ */ public class BarcodeSVGImageProducer implements BarcodeImageProducer { public JRRenderable createImage(JRComponentElement componentElement, BarcodeGenerator barcode, String message, int orientation) { try { SVGCanvasProvider provider = new SVGCanvasProvider(false, orientation); barcode.generateBarcode(provider, message); Document svgDoc = provider.getDOM(); Source source = new DOMSource(svgDoc); StringWriter outWriter = new StringWriter(); Result output = new StreamResult(outWriter); Transformer transformer = TransformerFactory.newInstance() .newTransformer(); transformer.transform(source, output); String svgString = outWriter.toString(); return new BatikRenderer(svgString, null); } catch (Exception e) { throw new JRRuntimeException(e); } } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/RoyalMailCustomerComponent.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/RoyalMailCustomerComponent.ja0000644000175000017500000000273211632162654034013 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: RoyalMailCustomerComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ public class RoyalMailCustomerComponent extends FourStateBarcodeComponent { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public void receive(BarcodeVisitor visitor) { visitor.visitRoyalMailCustomer(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/AbstractBarcodeEvaluator.java0000644000175000017500000003173011632162654033752 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRDefaultStyleProvider; import net.sf.jasperreports.engine.JRStyle; 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; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: AbstractBarcodeEvaluator.java 4595 2011-09-08 15:55:10Z teodord $ */ public abstract class AbstractBarcodeEvaluator implements BarcodeVisitor { protected final JRComponentElement componentElement; protected final BarcodeComponent barcodeComponent; protected final JRDefaultStyleProvider defaultStyleProvider; protected String message; protected AbstractBarcodeBean barcode; protected AbstractBarcodeEvaluator(JRComponentElement componentElement, JRDefaultStyleProvider defaultStyleProvider) { this.componentElement = componentElement; this.barcodeComponent = (BarcodeComponent) componentElement.getComponent(); this.defaultStyleProvider = defaultStyleProvider; } public void evaluateBarcode() { BarcodeComponent barcodeComponent = (BarcodeComponent) componentElement.getComponent(); barcodeComponent.receive(this); } public String getMessage() { return message; } public AbstractBarcodeBean getBarcode() { return barcode; } protected void setBaseAttributes(BarcodeComponent barcodeComponent) { JRStyle style = getElementStyle(); if (style != null) { String fontName = style.getFontName(); if (fontName != null) { barcode.setFontName(fontName); } Integer fontSize = style.getFontSize(); if (fontSize != null) { double barFontSize = UnitConv.pt2mm(fontSize.intValue()); barcode.setFontSize(barFontSize); } } Double moduleWidth = barcodeComponent.getModuleWidth(); if (moduleWidth != null) { barcode.setModuleWidth(UnitConv.pt2mm(moduleWidth.doubleValue())); } String textPlacement = barcodeComponent.getTextPosition(); if (textPlacement != null) { barcode.setMsgPosition( HumanReadablePlacement.byName(textPlacement)); } Double quietZone = barcodeComponent.getQuietZone(); if (quietZone != null) { barcode.doQuietZone(true); barcode.setQuietZone(UnitConv.pt2mm(quietZone.doubleValue())); } Double vQuietZone = barcodeComponent.getVerticalQuietZone(); if (vQuietZone != null) { barcode.setVerticalQuietZone(UnitConv.pt2mm(vQuietZone.doubleValue())); } // FIXME DataMatrix? double barcodeHeight; if (BarcodeUtils.isVertical(barcodeComponent)) { barcodeHeight = UnitConv.pt2mm(componentElement.getWidth()); } else { barcodeHeight = UnitConv.pt2mm(componentElement.getHeight()); } barcode.setHeight(barcodeHeight); } protected JRStyle getElementStyle() { JRStyle style = componentElement.getStyle(); if (style == null) { style = defaultStyleProvider.getDefaultStyle(); } return style; } public void visitCodabar(CodabarComponent codabar) { CodabarBean codabarBean = new CodabarBean(); barcode = codabarBean; evaluateCodabar(codabar); setBaseAttributes(codabar); if (codabar.getWideFactor() != null) { codabarBean.setWideFactor(codabar.getWideFactor().doubleValue()); } } protected abstract void evaluateCodabar(CodabarComponent codabar); public void visitCode128(Code128Component code128) { barcode = new Code128Bean(); evaluateCode128(code128); setBaseAttributes(code128); } protected abstract void evaluateCode128(Code128Component code128); public void visitDataMatrix(DataMatrixComponent dataMatrix) { DataMatrixBean dataMatrixBean = new DataMatrixBean(); barcode = dataMatrixBean; evaluateDataMatrix(dataMatrix); setBaseAttributes(dataMatrix); if (dataMatrix.getShape() != null) { dataMatrixBean.setShape(SymbolShapeHint.byName(dataMatrix.getShape())); } } protected abstract void evaluateDataMatrix(DataMatrixComponent dataMatrix); public void visitEANCode128(EAN128Component ean128) { EAN128Bean ean128Bean = new EAN128Bean(); barcode = ean128Bean; evaluateEANCode128(ean128); setBaseAttributes(ean128); if (ean128.getChecksumMode() != null) { ean128Bean.setChecksumMode(ChecksumMode.byName(ean128.getChecksumMode())); } } protected abstract void evaluateEANCode128(EAN128Component ean128); public void visitCode39(Code39Component code39) { Code39Bean code39Bean = new Code39Bean(); barcode = 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()); } } protected abstract void evaluateCode39(Code39Component code39); protected abstract void evaluateInterleaved2Of5(Interleaved2Of5Component interleaved2Of5); public void visitInterleaved2Of5(Interleaved2Of5Component interleaved2Of5) { Interleaved2Of5Bean interleaved2Of5Bean = new Interleaved2Of5Bean(); barcode = 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()); } } public void visitUPCA(UPCAComponent upcA) { UPCABean upcABean = new UPCABean(); barcode = upcABean; evaluateUPCA(upcA); setBaseAttributes(upcA); if (upcA.getChecksumMode() != null) { upcABean.setChecksumMode(ChecksumMode.byName(upcA.getChecksumMode())); } } protected abstract void evaluateUPCA(UPCAComponent upcA); public void visitUPCE(UPCEComponent upcE) { UPCEBean upcEBean = new UPCEBean(); barcode = upcEBean; evaluateUPCE(upcE); setBaseAttributes(upcE); if (upcE.getChecksumMode() != null) { upcEBean.setChecksumMode(ChecksumMode.byName(upcE.getChecksumMode())); } } protected abstract void evaluateUPCE(UPCEComponent upcE); public void visitEAN13(EAN13Component ean13) { EAN13Bean ean13Bean = new EAN13Bean(); barcode = ean13Bean; evaluateEAN13(ean13); setBaseAttributes(ean13); if (ean13.getChecksumMode() != null) { ean13Bean.setChecksumMode(ChecksumMode.byName(ean13.getChecksumMode())); } } protected abstract void evaluateEAN13(EAN13Component ean13); public void visitEAN8(EAN8Component ean8) { EAN8Bean ean8Bean = new EAN8Bean(); barcode = ean8Bean; evaluateEAN8(ean8); setBaseAttributes(ean8); if (ean8.getChecksumMode() != null) { ean8Bean.setChecksumMode(ChecksumMode.byName(ean8.getChecksumMode())); } } protected abstract void evaluateEAN8(EAN8Component ean8); public void visitRoyalMailCustomer( RoyalMailCustomerComponent royalMailCustomer) { RoyalMailCBCBean mailBean = new RoyalMailCBCBean(); barcode = mailBean; evaluateRoyalMailCustomer(royalMailCustomer); setBaseAttributes(royalMailCustomer); setFourStateAttributes(royalMailCustomer, mailBean); } 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); public void visitUSPSIntelligentMail( USPSIntelligentMailComponent intelligentMail) { USPSIntelligentMailBean mailBean = new USPSIntelligentMailBean(); barcode = mailBean; evaluateUSPSIntelligentMail(intelligentMail); setBaseAttributes(intelligentMail); setFourStateAttributes(intelligentMail, mailBean); } protected abstract void evaluateUSPSIntelligentMail( USPSIntelligentMailComponent intelligentMail); public void visitPostnet(POSTNETComponent postnet) { POSTNETBean postnetBean = new POSTNETBean(); barcode = 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())); } } protected abstract void evaluatePOSTNET( POSTNETComponent intelligentMail); public void visitPDF417(PDF417Component pdf417) { PDF417Bean pdf417Bean = new PDF417Bean(); barcode = 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()); } } protected abstract void evaluatePDF417(PDF417Component pdf417); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/Code39Component.java0000644000175000017500000001070411632162654031753 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: Code39Component.java 4595 2011-09-08 15:55:10Z teodord $ */ public class Code39Component extends BarcodeComponent { 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); } public void receive(BarcodeVisitor visitor) { visitor.visitCode39(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/Interleaved2Of5Component.java0000644000175000017500000000564311632162654033631 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: Interleaved2Of5Component.java 4595 2011-09-08 15:55:10Z teodord $ */ public class Interleaved2Of5Component extends BarcodeComponent { 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); } public void receive(BarcodeVisitor visitor) { visitor.visitInterleaved2Of5(this); } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeRasterizedImageProducer.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeRasterizedImageProduce0000644000175000017500000000574311632162654034012 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 net.sf.jasperreports.engine.JRComponentElement; import net.sf.jasperreports.engine.JRImageRenderer; import net.sf.jasperreports.engine.JRRenderable; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.util.JRProperties; import org.krysalis.barcode4j.BarcodeGenerator; import org.krysalis.barcode4j.output.bitmap.BitmapCanvasProvider; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BarcodeRasterizedImageProducer.java 4595 2011-09-08 15:55:10Z teodord $ */ 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"; public JRRenderable createImage(JRComponentElement componentElement, BarcodeGenerator barcode, String message, int orientation) { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); int resolution = JRProperties.getIntegerProperty( componentElement, PROPERTY_RESOLUTION, 300); boolean gray = JRProperties.getBooleanProperty( componentElement, PROPERTY_GRAY, true); boolean antiAlias = JRProperties.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, orientation); barcode.generateBarcode(provider, message); provider.finish(); byte[] imageData = out.toByteArray(); return JRImageRenderer.getInstance(imageData); } catch (Exception e) { throw new JRRuntimeException(e); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeVisitor.java0000644000175000017500000000362411632162654031764 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: BarcodeVisitor.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeFillComponent.java0000644000175000017500000001147511644765202033102 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRRenderable; 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 org.krysalis.barcode4j.impl.AbstractBarcodeBean; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BarcodeFillComponent.java 4648 2011-10-10 12:50:53Z lucianc $ */ public class BarcodeFillComponent extends BaseFillComponent { private final BarcodeComponent barcodeComponent; private final Map printTemplates = new HashMap(); private AbstractBarcodeBean barcode; private String message; public BarcodeFillComponent(BarcodeComponent barcodeComponent) { this.barcodeComponent = barcodeComponent; } public BarcodeFillComponent(BarcodeFillComponent barcode) { this.barcodeComponent = barcode.barcodeComponent; } 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(); barcode = evaluator.getBarcode(); message = evaluator.getMessage(); } public FillPrepareResult prepare(int availableHeight) { if (isEvaluateNow() && message == null) { return FillPrepareResult.NO_PRINT_NO_OVERFLOW; } return FillPrepareResult.PRINT_NO_STRETCH; } public JRPrintElement fill() { JRTemplateImage templateImage = getTemplateImage(); JRTemplatePrintImage image = new JRTemplatePrintImage(templateImage, elementId); JRComponentElement element = fillContext.getComponentElement(); 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; } 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; } protected void setBarcodeImage(JRTemplatePrintImage image) { if (message != null) { BarcodeImageProducer imageProducer = BarcodeUtils.getImageProducer( fillContext.getComponentElement()); JRRenderable barcodeImage = imageProducer.createImage( fillContext.getComponentElement(), barcode, message, barcodeComponent.getOrientation()); image.setRenderer(barcodeImage); } } public void evaluateDelayedElement(JRPrintElement element, byte evaluation) throws JRException { evaluateBarcode(evaluation); setBarcodeImage((JRTemplatePrintImage) element); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/CodabarComponent.java0000644000175000017500000000343511632162654032263 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: CodabarComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ public class CodabarComponent extends BarcodeComponent { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_WIDE_FACTOR = "wideFactor"; private Double wideFactor; 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); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeDesignEvaluator.java0000644000175000017500000001301611632162654033415 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 net.sf.jasperreports.engine.JRComponentElement; import net.sf.jasperreports.engine.JRDefaultStyleProvider; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JRRenderable; import net.sf.jasperreports.engine.util.JRExpressionUtil; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BarcodeDesignEvaluator.java 4595 2011-09-08 15:55:10Z teodord $ */ public class BarcodeDesignEvaluator extends AbstractBarcodeEvaluator { public BarcodeDesignEvaluator(JRComponentElement componentElement, JRDefaultStyleProvider defaultStyleProvider) { super(componentElement, defaultStyleProvider); } public JRRenderable evaluateImage() { evaluateBarcode(); BarcodeImageProducer imageProducer = BarcodeUtils.getImageProducer( componentElement); JRRenderable barcodeImage = imageProducer.createImage( componentElement, barcode, message, barcodeComponent.getOrientation()); return barcodeImage; } protected void evaluateBaseBarcode(BarcodeComponent barcodeComponent, String defaultMessage) { message = evaluateStringExpression(barcodeComponent.getCodeExpression(), defaultMessage); String pattern = evaluateStringExpression( barcodeComponent.getPatternExpression(), null); if (pattern != null) { barcode.setPattern(pattern); } } protected String evaluateStringExpression(JRExpression expression, String defaultValue) { String value = JRExpressionUtil.getSimpleExpressionText(expression); if (value == null) { value = defaultValue; } return value; } protected void evaluateCodabar(CodabarComponent codabar) { evaluateBaseBarcode(codabar, "0123456789"); } protected void evaluateCode128(Code128Component code128) { evaluateBaseBarcode(code128, "0123456789"); } protected void evaluateDataMatrix(DataMatrixComponent dataMatrix) { evaluateBaseBarcode(dataMatrix, "0123456789"); } protected void evaluateEANCode128(EAN128Component ean128) { evaluateBaseBarcode(ean128, "0101234567890128"); } protected void evaluateCode39(Code39Component code39) { evaluateBaseBarcode(code39, "01234567892"); } 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); } 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); } 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); } 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); } protected void evaluateInterleaved2Of5(Interleaved2Of5Component interleaved2Of5) { evaluateBaseBarcode(interleaved2Of5, "0123456784"); } 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); } protected void evaluateUSPSIntelligentMail( USPSIntelligentMailComponent intelligentMail) { evaluateBaseBarcode(intelligentMail, "00040123456200800001987654321"); } protected void evaluatePOSTNET(POSTNETComponent intelligentMail) { evaluateBaseBarcode(intelligentMail, "01234"); } protected void evaluatePDF417(PDF417Component pdf417) { evaluateBaseBarcode(pdf417, "01234"); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeDesignConverter.java0000644000175000017500000000525111632162654033424 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRPrintElement; import net.sf.jasperreports.engine.JRRenderable; 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 org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BarcodeDesignConverter.java 4595 2011-09-08 15:55:10Z teodord $ */ public class BarcodeDesignConverter implements ComponentDesignConverter { private static final Log log = LogFactory.getLog(BarcodeDesignConverter.class); public JRPrintElement convert(ReportConverter reportConverter, JRComponentElement element) { JRBasePrintImage printImage = new JRBasePrintImage( reportConverter.getDefaultStyleProvider()); reportConverter.copyBaseAttributes(element, printImage); printImage.setScaleImage(ScaleImageEnum.RETAIN_SHAPE); JRRenderable barcodeImage = evaluateBarcode(reportConverter, element); printImage.setRenderer(barcodeImage); return printImage; } protected JRRenderable evaluateBarcode(ReportConverter reportConverter, JRComponentElement element) { try { BarcodeDesignEvaluator evaluator = new BarcodeDesignEvaluator(element, reportConverter.getDefaultStyleProvider()); return evaluator.evaluateImage(); } catch (Exception e) { if (log.isWarnEnabled()) { log.warn("Failed to create barcode preview", e); } return null; } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/POSTNETComponent.java0000644000175000017500000000673411632162654032071 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: POSTNETComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ public class POSTNETComponent extends BarcodeComponent { 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; 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); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeImageProducer.java0000644000175000017500000000325611632162654033054 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRRenderable; import org.krysalis.barcode4j.BarcodeGenerator; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BarcodeImageProducer.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface BarcodeImageProducer { String PROPERTY_IMAGE_PRODUCER = BarcodeComponent.PROPERTY_PREFIX + "image.producer"; String PROPERTY_PREFIX_IMAGE_PRODUCER = BarcodeComponent.PROPERTY_PREFIX + "image.producer."; JRRenderable createImage(JRComponentElement componentElement, BarcodeGenerator barcode, String message, int orientation); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeCompiler.java0000644000175000017500000000434311632162654032076 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: BarcodeCompiler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class BarcodeCompiler implements ComponentCompiler { public void collectExpressions(Component component, JRExpressionCollector collector) { BarcodeComponent barcode = (BarcodeComponent) component; barcode.receive(new BarcodeExpressionCollector(collector)); } public Component toCompiledComponent(Component component, JRBaseObjectFactory baseFactory) { BarcodeComponent barcode = (BarcodeComponent) component; CompiledBarcodeFactory factory = new CompiledBarcodeFactory(baseFactory); return factory.toCompiledComponent(barcode); } public void verify(Component component, JRVerifier verifier) { BarcodeComponent barcode = (BarcodeComponent) component; BarcodeVerifier barcodeVerifier = new BarcodeVerifier(verifier); barcode.receive(barcodeVerifier); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeUtils.java0000644000175000017500000000470711632162654031430 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRRuntimeException; import net.sf.jasperreports.engine.util.JRProperties; import net.sf.jasperreports.engine.util.JRSingletonCache; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BarcodeUtils.java 4595 2011-09-08 15:55:10Z teodord $ */ public final class BarcodeUtils { protected static JRSingletonCache imageProducerCache = new JRSingletonCache(BarcodeImageProducer.class); public static BarcodeImageProducer getImageProducer( JRPropertiesHolder propertiesHolder) { String producerProperty = JRProperties.getProperty(propertiesHolder, BarcodeImageProducer.PROPERTY_IMAGE_PRODUCER); String producerClass = JRProperties.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 static boolean isVertical(BarcodeComponent barcode) { int orientation = barcode.getOrientation(); return orientation == BarcodeComponent.ORIENTATION_LEFT || orientation == BarcodeComponent.ORIENTATION_RIGHT; } private BarcodeUtils() { } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barcode4j/BarcodeEvaluator.java0000644000175000017500000000741511632162654032271 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BarcodeEvaluator.java 4595 2011-09-08 15:55:10Z teodord $ */ public class BarcodeEvaluator extends AbstractBarcodeEvaluator { private final FillContext fillContext; private final byte evaluationType; public BarcodeEvaluator(FillContext fillContext, byte evaluationType) { super(fillContext.getComponentElement(), fillContext.getDefaultStyleProvider()); this.fillContext = fillContext; this.evaluationType = evaluationType; } protected void evaluateBaseBarcode(BarcodeComponent barcodeComponent) { message = JRStringUtil.getString(evaluateExpression(barcodeComponent.getCodeExpression())); String pattern = JRStringUtil.getString(evaluateExpression(barcodeComponent.getPatternExpression())); if (pattern != null) { barcode.setPattern(pattern); } } protected Object evaluateExpression(JRExpression expression) { try { return fillContext.evaluate(expression, evaluationType); } catch (JRException e) { throw new JRRuntimeException(e); } } protected void evaluateCodabar(CodabarComponent codabar) { evaluateBaseBarcode(codabar); } protected void evaluateCode128(Code128Component code128) { evaluateBaseBarcode(code128); } protected void evaluateDataMatrix(DataMatrixComponent dataMatrix) { evaluateBaseBarcode(dataMatrix); } protected void evaluateEANCode128(EAN128Component ean128) { evaluateBaseBarcode(ean128); } protected void evaluateCode39(Code39Component code39) { evaluateBaseBarcode(code39); } protected void evaluateUPCA(UPCAComponent upcA) { evaluateBaseBarcode(upcA); } protected void evaluateUPCE(UPCEComponent upcE) { evaluateBaseBarcode(upcE); } protected void evaluateEAN13(EAN13Component ean13) { evaluateBaseBarcode(ean13); } protected void evaluateEAN8(EAN8Component ean8) { evaluateBaseBarcode(ean8); } protected void evaluateInterleaved2Of5(Interleaved2Of5Component interleaved2Of5) { evaluateBaseBarcode(interleaved2Of5); } protected void evaluateRoyalMailCustomer( RoyalMailCustomerComponent royalMailCustomer) { evaluateBaseBarcode(royalMailCustomer); } protected void evaluateUSPSIntelligentMail( USPSIntelligentMailComponent intelligentMail) { evaluateBaseBarcode(intelligentMail); } protected void evaluatePOSTNET(POSTNETComponent intelligentMail) { evaluateBaseBarcode(intelligentMail); } protected void evaluatePDF417(PDF417Component pdf417) { evaluateBaseBarcode(pdf417); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/charts/0000755000175000017500000000000011654071732025624 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/charts/FillChartSettings.java0000644000175000017500000001647311632162654032073 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: FillChartSettings.java 4595 2011-09-08 15:55:10Z teodord $ */ 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() */ public JRExpression getAnchorNameExpression() { return parent.getAnchorNameExpression(); } /** * @see net.sf.jasperreports.engine.JRAnchor#getBookmarkLevel() */ public int getBookmarkLevel() { return parent.getBookmarkLevel(); } /** * @see java.lang.Object#clone() */ 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() */ public byte getChartType() { return parent.getChartType(); } /** * @see net.sf.jasperreports.components.charts.ChartSettings#getLegendBackgroundColor() */ public Color getLegendBackgroundColor() { return parent.getLegendBackgroundColor(); } /** * @see net.sf.jasperreports.components.charts.ChartSettings#getLegendColor() */ public Color getLegendColor() { return parent.getLegendColor(); } /** * @see net.sf.jasperreports.components.charts.ChartSettings#getLegendFont() */ public JRFont getLegendFont() { return parent.getLegendFont(); } /** * @see net.sf.jasperreports.components.charts.ChartSettings#getLegendPosition() */ public EdgeEnum getLegendPosition() { return parent.getLegendPosition(); } /** * @see net.sf.jasperreports.components.charts.ChartSettings#getRenderType() */ public String getRenderType() { return parent.getRenderType() == null ? JRChart.RENDER_TYPE_DRAW : parent.getRenderType(); } /** * @see net.sf.jasperreports.components.charts.ChartSettings#getShowLegend() */ public Boolean getShowLegend() { return parent.getShowLegend(); } /** * @see net.sf.jasperreports.components.charts.ChartSettings#getSubtitleColor() */ public Color getSubtitleColor() { return parent.getSubtitleColor(); } /** * @see net.sf.jasperreports.components.charts.ChartSettings#getSubtitleExpression() */ public JRExpression getSubtitleExpression() { return parent.getSubtitleExpression(); } /** * @see net.sf.jasperreports.components.charts.ChartSettings#getSubtitleFont() */ public JRFont getSubtitleFont() { return parent.getSubtitleFont(); } /** * @see net.sf.jasperreports.components.charts.ChartSettings#getTitleColor() */ public Color getTitleColor() { return parent.getTitleColor(); } /** * @see net.sf.jasperreports.components.charts.ChartSettings#getTitleExpression() */ public JRExpression getTitleExpression() { return parent.getTitleExpression(); } /** * @see net.sf.jasperreports.components.charts.ChartSettings#getTitleFont() */ public JRFont getTitleFont() { return parent.getTitleFont(); } /** * @see net.sf.jasperreports.components.charts.ChartSettings#getTitlePosition() */ public EdgeEnum getTitlePosition() { return parent.getTitlePosition(); } /** * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkAnchorExpression() */ public JRExpression getHyperlinkAnchorExpression() { return parent.getHyperlinkAnchorExpression(); } /** * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkPageExpression() */ public JRExpression getHyperlinkPageExpression() { return parent.getHyperlinkPageExpression(); } /** * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkParameters() */ public JRHyperlinkParameter[] getHyperlinkParameters() { return parent.getHyperlinkParameters(); } /** * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkReferenceExpression() */ public JRExpression getHyperlinkReferenceExpression() { return parent.getHyperlinkReferenceExpression(); } /** * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkTarget() */ public byte getHyperlinkTarget() { return parent.getHyperlinkTarget(); } /** * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkTooltipExpression() */ public JRExpression getHyperlinkTooltipExpression() { return parent.getHyperlinkTooltipExpression(); } /** * @deprecated Replaced by {@link #getHyperlinkTypeValue()}. */ public byte getHyperlinkType() { return parent.getHyperlinkTypeValue() == null ? HyperlinkTypeEnum.NONE.getValue() : parent.getHyperlinkTypeValue().getValue(); } /** * @see net.sf.jasperreports.engine.JRHyperlink#getHyperlinkTypeValue() */ public HyperlinkTypeEnum getHyperlinkTypeValue() { return parent.getHyperlinkTypeValue(); } /** * @see net.sf.jasperreports.engine.JRHyperlink#getLinkTarget() */ public String getLinkTarget() { return parent.getLinkTarget(); } /** * @see net.sf.jasperreports.engine.JRHyperlink#getLinkType() */ public String getLinkType() { return parent.getLinkType(); } /** * @see net.sf.jasperreports.components.charts.ChartSettings#getLegendColor() */ public Color getBackcolor() { return parent.getBackcolor(); } /** * */ public String getCustomizerClass() { return parent.getCustomizerClass(); } /** * */ public void collectExpressions(JRExpressionCollector collector) { SpiderChartCompiler.collectExpressions(this, collector); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/charts/ChartPlot.java0000644000175000017500000000527511632162654030400 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: ChartPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/charts/AbstractChartCustomizer.java0000644000175000017500000001223311632162654033302 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: AbstractChartCustomizer.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/charts/ChartDataset.java0000644000175000017500000000247311632162654031044 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: ChartDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface ChartDataset extends JRElementDataset, Serializable { } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/charts/ChartCustomizer.java0000644000175000017500000000431411632162654031617 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General 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) * @version $Id: ChartCustomizer.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/charts/ChartComponent.java0000644000175000017500000000306611632162654031420 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.Component; import net.sf.jasperreports.engine.type.EvaluationTimeEnum; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: ChartComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface ChartComponent extends Component, Serializable { public ChartSettings getChartSettings(); public ChartDataset getDataset(); public ChartPlot getPlot(); public EvaluationTimeEnum getEvaluationTime(); public String getEvaluationGroup(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/charts/ChartSettings.java0000644000175000017500000000460411632162654031255 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: ChartSettings.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/charts/ChartSettingsXmlFactory.java0000644000175000017500000001127111632162654033264 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: ChartSettingsXmlFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class ChartSettingsXmlFactory extends JRBaseFactory { /** * */ 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 { 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 { 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 { /** * */ 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; } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/0000755000175000017500000000000011654071732025427 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/ColumnFactory.java0000644000175000017500000000513611632162655031065 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import java.util.ArrayList; import java.util.List; import net.sf.jasperreports.engine.base.JRBaseObjectFactory; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: ColumnFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class ColumnFactory implements ColumnVisitor { private final JRBaseObjectFactory factory; public ColumnFactory(JRBaseObjectFactory factory) { this.factory = factory; } public List createColumns(List columns) { List createdCols = new ArrayList(columns.size()); for (BaseColumn tableColumn : columns) { BaseColumn column = tableColumn.visitColumn(this); createdCols.add(column); } return createdCols; } public Cell createCell(Cell cell) { Cell newCell; if (cell == null) { newCell = null; } else { newCell = new CompiledCell(cell, factory); } return newCell; } public List createGroupCells(List cells) { List newCells; if (cells == null) { newCells = null; } else { newCells = new ArrayList(cells.size()); for (GroupCell groupCell : cells) { GroupCell newCell = new StandardGroupCell(groupCell, this); newCells.add(newCell); } } return newCells; } public BaseColumn visitColumn(Column column) { return new StandardColumn(column, this); } public BaseColumn visitColumnGroup(ColumnGroup columnGroup) { return new StandardColumnGroup(columnGroup, this); } public JRBaseObjectFactory getBaseObjectFactory() { return factory; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/ColumnVisitor.java0000644000175000017500000000243011632162655031107 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: ColumnVisitor.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface ColumnVisitor { R visitColumn(Column column); R visitColumnGroup(ColumnGroup columnGroup); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/TableComponent.java0000644000175000017500000000300411632162655031202 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import java.util.List; import net.sf.jasperreports.engine.JRCloneable; import net.sf.jasperreports.engine.JRDatasetRun; import net.sf.jasperreports.engine.component.Component; /** * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: TableComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface TableComponent extends Component, JRCloneable { JRDatasetRun getDatasetRun(); List getColumns(); WhenNoDataTypeTableEnum getWhenNoDataType(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/ColumnGroup.java0000644000175000017500000000241711632162655030551 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import java.util.List; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: ColumnGroup.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface ColumnGroup extends BaseColumn { List getColumns(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/GroupCell.java0000644000175000017500000000246011632162655030171 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import net.sf.jasperreports.engine.JRCloneable; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: GroupCell.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface GroupCell extends JRCloneable { String getGroupName(); Cell getCell(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/StandardColumnGroup.java0000644000175000017500000000572311632162655032235 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import java.util.ArrayList; import java.util.List; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.util.JRCloneUtils; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: StandardColumnGroup.java 4595 2011-09-08 15:55:10Z teodord $ */ public class StandardColumnGroup extends StandardBaseColumn implements ColumnGroup { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_COLUMNS = "columns"; private List children; public StandardColumnGroup() { children = new ArrayList(); } public StandardColumnGroup(ColumnGroup columnGroup, ColumnFactory factory) { super(columnGroup, factory); children = factory.createColumns(columnGroup.getColumns()); } public List getColumns() { return children; } public void setColumns(List columns) { Object old = this.children; this.children = columns; getEventSupport().firePropertyChange(PROPERTY_COLUMNS, old, this.children); } public void addColumn(BaseColumn column) { children.add(column); getEventSupport().fireCollectionElementAddedEvent(PROPERTY_COLUMNS, column, children.size() - 1); } public void addColumn(int index, BaseColumn column) { children.add(index, column); getEventSupport().fireCollectionElementAddedEvent(PROPERTY_COLUMNS, column, index); } public boolean removeColumn(BaseColumn column) { int idx = children.indexOf(column); if (idx >= 0) { children.remove(idx); getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_COLUMNS, column, idx); } return idx >= 0; } public R visitColumn(ColumnVisitor visitor) { return visitor.visitColumnGroup(this); } @Override public Object clone() { StandardColumnGroup clone = (StandardColumnGroup) super.clone(); clone.children = JRCloneUtils.cloneList(children); return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/ColumnExpressionCollector.java0000644000175000017500000000633511632162655033466 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import java.util.List; import net.sf.jasperreports.engine.JRElement; import net.sf.jasperreports.engine.JRExpressionCollector; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: ColumnExpressionCollector.java 4595 2011-09-08 15:55:10Z teodord $ */ public class ColumnExpressionCollector implements ColumnVisitor { private final JRExpressionCollector mainCollector; private final JRExpressionCollector datasetCollector; public ColumnExpressionCollector(JRExpressionCollector mainCollector, JRExpressionCollector datasetCollector) { this.mainCollector = mainCollector; this.datasetCollector = datasetCollector; } public void collectColumns(List columns) { for (BaseColumn column : columns) { column.visitColumn(this); } } public Void visitColumn(Column column) { mainCollector.addExpression(column.getPrintWhenExpression()); collectCell(column.getTableHeader()); collectCell(column.getTableFooter()); collectGroupCells(column.getGroupHeaders()); collectGroupCells(column.getGroupFooters()); collectCell(column.getColumnHeader()); collectCell(column.getColumnFooter()); collectCell(column.getDetailCell()); // nothing return null; } public Void visitColumnGroup(ColumnGroup columnGroup) { mainCollector.addExpression(columnGroup.getPrintWhenExpression()); collectCell(columnGroup.getTableHeader()); collectCell(columnGroup.getTableFooter()); collectGroupCells(columnGroup.getGroupHeaders()); collectGroupCells(columnGroup.getGroupFooters()); collectCell(columnGroup.getColumnHeader()); collectCell(columnGroup.getColumnFooter()); collectColumns(columnGroup.getColumns()); // nothing return null; } protected void collectGroupCells(List groupCells) { if (groupCells != null) { for (GroupCell groupCell : groupCells) { collectCell(groupCell.getCell()); } } } protected void collectCell(Cell cell) { if (cell == null) { return; } datasetCollector.collect(cell.getStyle()); JRElement[] elements = cell.getElements(); if (elements != null) { for (int i = 0; i < elements.length; i++) { elements[i].collectExpressions(datasetCollector); } } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/DesignCell.java0000644000175000017500000000744711632162655030320 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import java.awt.Color; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.JRDefaultStyleProvider; import net.sf.jasperreports.engine.JRLineBox; import net.sf.jasperreports.engine.JRStyle; import net.sf.jasperreports.engine.base.JRBaseLineBox; import net.sf.jasperreports.engine.design.DesignStyleContainer; import net.sf.jasperreports.engine.design.JRDesignElementGroup; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: DesignCell.java 4595 2011-09-08 15:55:10Z teodord $ */ public class DesignCell extends JRDesignElementGroup implements Cell, DesignStyleContainer { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_DEFAULT_STYLE_PROVIDER = "defaultStyleProvider"; public static final String PROPERTY_STYLE = "style"; public static final String PROPERTY_STYLE_NAME_REFERENCE = "styleNameReference"; public static final String PROPERTY_ROW_SPAN = "rowSpan"; public static final String PROPERTY_HEIGHT = "height"; private JRDefaultStyleProvider defaultStyleProvider; private JRStyle style; private String styleNameReference; private JRLineBox box; private Integer rowSpan; private Integer height; public DesignCell() { this.box = new JRBaseLineBox(this); } public Integer getHeight() { return height; } public Color getDefaultLineColor() { return Color.BLACK; } public JRLineBox getLineBox() { return box; } public JRDefaultStyleProvider getDefaultStyleProvider() { return defaultStyleProvider; } public JRStyle getStyle() { return style; } public String getStyleNameReference() { return styleNameReference; } public void setDefaultStyleProvider( JRDefaultStyleProvider defaultStyleProvider) { Object old = this.defaultStyleProvider; this.defaultStyleProvider = defaultStyleProvider; getEventSupport().firePropertyChange(PROPERTY_DEFAULT_STYLE_PROVIDER, old, this.defaultStyleProvider); } public void setStyle(JRStyle style) { Object old = this.style; this.style = style; getEventSupport().firePropertyChange(PROPERTY_STYLE, old, this.style); } public void setStyleNameReference(String styleName) { Object old = this.styleNameReference; this.styleNameReference = styleName; getEventSupport().firePropertyChange(PROPERTY_STYLE_NAME_REFERENCE, old, this.styleNameReference); } public void setHeight(Integer height) { Object old = this.height; this.height = height; getEventSupport().firePropertyChange(PROPERTY_HEIGHT, old, this.height); } public Integer getRowSpan() { return rowSpan; } public void setRowSpan(Integer rowSpan) { Object old = this.rowSpan; this.rowSpan = rowSpan; getEventSupport().firePropertyChange(PROPERTY_ROW_SPAN, old, this.rowSpan); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/StandardGroupCell.java0000644000175000017500000000623211632162655031653 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import java.io.Serializable; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; import net.sf.jasperreports.engine.util.JRCloneUtils; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: StandardGroupCell.java 4595 2011-09-08 15:55:10Z teodord $ */ public class StandardGroupCell implements GroupCell, Serializable, JRChangeEventsSupport { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_GROUP_NAME = "groupName"; public static final String PROPERTY_CELL = "cell"; private String groupName; private Cell cell; public StandardGroupCell() { } public StandardGroupCell(String groupName, Cell cell) { this.groupName = groupName; this.cell = cell; } public StandardGroupCell(GroupCell groupCell, ColumnFactory columnFactory) { this.groupName = groupCell.getGroupName(); this.cell = columnFactory.createCell(groupCell.getCell()); } public Cell getCell() { return cell; } public String getGroupName() { return groupName; } public void setGroupName(String groupName) { Object old = this.groupName; this.groupName = groupName; getEventSupport().firePropertyChange(PROPERTY_GROUP_NAME, old, this.groupName); } public void setCell(Cell cell) { Object old = this.cell; this.cell = cell; getEventSupport().firePropertyChange(PROPERTY_CELL, old, this.cell); } public Object clone() { StandardGroupCell clone = null; try { clone = (StandardGroupCell) super.clone(); } catch (CloneNotSupportedException e) { throw new JRRuntimeException(e); } clone.cell = JRCloneUtils.nullSafeClone(cell); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/BaseColumn.java0000644000175000017500000000330711632162655030326 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import java.util.List; import net.sf.jasperreports.engine.JRCloneable; import net.sf.jasperreports.engine.JRExpression; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BaseColumn.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface BaseColumn extends JRCloneable { JRExpression getPrintWhenExpression(); Cell getTableHeader(); Cell getTableFooter(); List getGroupHeaders(); Cell getGroupHeader(String groupName); List getGroupFooters(); Cell getGroupFooter(String groupName); Cell getColumnHeader(); Cell getColumnFooter(); Integer getWidth(); R visitColumn(ColumnVisitor visitor); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/TableDesignConverter.java0000644000175000017500000000654511632162655032356 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import java.awt.Rectangle; import java.util.List; import java.util.Map; import net.sf.jasperreports.components.table.util.TableUtil; 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.design.JasperDesign; /** * Table preview converter. * * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: TableDesignConverter.java 4595 2011-09-08 15:55:10Z teodord $ */ public class TableDesignConverter implements ComponentDesignConverter { public JRPrintElement convert(ReportConverter reportConverter, JRComponentElement element) { TableComponent table = (TableComponent) element.getComponent(); if (table == null)// || list.getContents() == null) { return null; } JRBasePrintFrame frame = new JRBasePrintFrame( reportConverter.getDefaultStyleProvider()); reportConverter.copyBaseAttributes(element, frame); TableUtil tableManager = new TableUtil( (StandardTable)table, (JasperDesign)reportConverter.getReport() ); Map cellBounds = tableManager.getCellBounds(); for (Map.Entry pair : cellBounds.entrySet()) { Cell cell = pair.getKey(); Rectangle rectangle = pair.getValue(); JRBasePrintFrame cellFrame = new JRBasePrintFrame( reportConverter.getDefaultStyleProvider() ); cellFrame.setX((int)rectangle.getX()); cellFrame.setY((int)rectangle.getY()); cellFrame.setWidth((int)rectangle.getWidth()); cellFrame.setHeight((int)rectangle.getHeight()); cellFrame.setStyle(reportConverter.resolveStyle(cell)); if (cell.getLineBox() != null) { cellFrame.copyBox(cell.getLineBox()); } List children = cell.getChildren(); if (children != null && children.size() > 0) { ConvertVisitor convertVisitor = new ConvertVisitor(reportConverter, cellFrame); for(int i = 0; i < children.size(); i++) { (children.get(i)).visit(convertVisitor); } } frame.addElement(cellFrame); } return frame; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/FillTableFactory.java0000644000175000017500000000367511632162655031474 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import net.sf.jasperreports.components.table.fill.FillTable; 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) * @version $Id: FillTableFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class FillTableFactory implements ComponentFillFactory { public FillComponent cloneFillComponent(FillComponent component, JRFillCloneFactory factory) { //TODO implement throw new UnsupportedOperationException(); } public FillComponent toFillComponent(Component component, JRFillObjectFactory factory) { TableComponent table = (TableComponent) component; return new FillTable(table, factory); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/StandardTableFactory.java0000644000175000017500000000331311632162655032333 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; 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) * @version $Id: StandardTableFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class StandardTableFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { StandardTable table = new StandardTable(); WhenNoDataTypeTableEnum whenNoDataType = WhenNoDataTypeTableEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_whenNoDataType)); if (whenNoDataType != null) { table.setWhenNoDataType(whenNoDataType); } return table; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/StandardTable.java0000644000175000017500000001110311632162655030777 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.JRDatasetRun; 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 Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: StandardTable.java 4595 2011-09-08 15:55:10Z teodord $ */ public class StandardTable implements TableComponent, Serializable, JRChangeEventsSupport { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_DATASET_RUN = "datasetRun"; public static final String PROPERTY_COLUMNS = "columns"; public static final String PROPERTY_WHEN_NO_DATA_TYPE = "whenNoDataType"; private JRDatasetRun datasetRun; private List columns; private WhenNoDataTypeTableEnum whenNoDataType; public StandardTable() { columns = new ArrayList(); } public StandardTable(TableComponent table, JRBaseObjectFactory factory) { whenNoDataType = table.getWhenNoDataType(); datasetRun = factory.getDatasetRun(table.getDatasetRun()); ColumnFactory columnFactory = new ColumnFactory(factory); columns = columnFactory.createColumns(table.getColumns()); } public List getColumns() { return columns; } public void setColumns(List columns) { Object old = this.columns; this.columns = columns; getEventSupport().firePropertyChange(PROPERTY_COLUMNS, old, this.columns); } public void addColumn(BaseColumn column) { columns.add(column); getEventSupport().fireCollectionElementAddedEvent(PROPERTY_COLUMNS, column, columns.size() - 1); } public void addColumn(int index, BaseColumn column) { columns.add(index, column); getEventSupport().fireCollectionElementAddedEvent(PROPERTY_COLUMNS, column, index); } public boolean removeColumn(BaseColumn column) { int idx = columns.indexOf(column); if (idx >= 0) { columns.remove(idx); getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_COLUMNS, column, idx); } return idx >= 0; } public JRDatasetRun getDatasetRun() { return datasetRun; } public void setDatasetRun(JRDatasetRun datasetRun) { Object old = this.datasetRun; this.datasetRun = datasetRun; getEventSupport().firePropertyChange(PROPERTY_DATASET_RUN, old, this.datasetRun); } public WhenNoDataTypeTableEnum getWhenNoDataType() { return whenNoDataType; } public void setWhenNoDataType(WhenNoDataTypeTableEnum whenNoDataType) { Object old = this.whenNoDataType; this.whenNoDataType = whenNoDataType; getEventSupport().firePropertyChange(PROPERTY_WHEN_NO_DATA_TYPE, old, this.whenNoDataType); } public Object clone() { StandardTable clone = null; try { clone = (StandardTable) super.clone(); } catch (CloneNotSupportedException e) { // never throw new JRRuntimeException(e); } clone.datasetRun = JRCloneUtils.nullSafeClone(datasetRun); clone.columns = JRCloneUtils.cloneList(columns); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/Column.java0000644000175000017500000000234511632162655027534 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: Column.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface Column extends BaseColumn { Cell getDetailCell(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/WhenNoDataTypeTableEnum.java0000644000175000017500000000504211632162655032723 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: WhenNoDataTypeTableEnum.java 4595 2011-09-08 15:55:10Z teodord $ */ public enum WhenNoDataTypeTableEnum implements JREnum { /** * Specifies that in case of empty datasources, the table output will be blank. */ BLANK((byte)1, "Blank"), /** * Specifies that in case of empty datasources, all table sections except the detail will displayed. */ ALL_SECTIONS_NO_DETAIL((byte)2, "AllSectionsNoDetail"); /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient byte value; private final transient String name; private WhenNoDataTypeTableEnum(byte value, String name) { this.value = value; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(value); } /** * */ public final byte getValue() { return value; } /** * */ public String getName() { return name; } /** * */ public static WhenNoDataTypeTableEnum getByName(String name) { return (WhenNoDataTypeTableEnum)EnumUtil.getByName(values(), name); } /** * */ public static WhenNoDataTypeTableEnum getByValue(Byte value) { return (WhenNoDataTypeTableEnum)EnumUtil.getByValue(values(), value); } /** * */ public static WhenNoDataTypeTableEnum getByValue(byte value) { return getByValue(new Byte(value)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/TableCompiler.java0000644000175000017500000003765311632162655031033 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.ListIterator; import java.util.Set; import net.sf.jasperreports.engine.JRDatasetRun; import net.sf.jasperreports.engine.JRElement; import net.sf.jasperreports.engine.JRExpressionCollector; import net.sf.jasperreports.engine.JRGroup; 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.JRDesignDataset; import net.sf.jasperreports.engine.design.JRVerifier; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: TableCompiler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class TableCompiler implements ComponentCompiler { public void collectExpressions(Component component, JRExpressionCollector collector) { TableComponent table = (TableComponent) component; JRDatasetRun datasetRun = table.getDatasetRun(); collector.collect(datasetRun); JRExpressionCollector datasetCollector = collector.getDatasetCollector( datasetRun.getDatasetName()); ColumnExpressionCollector columnCollector = new ColumnExpressionCollector( collector, datasetCollector); columnCollector.collectColumns(table.getColumns()); } public Component toCompiledComponent(Component component, JRBaseObjectFactory baseFactory) { TableComponent table = (TableComponent) component; return new StandardTable(table, baseFactory); } public void verify(Component component, JRVerifier verifier) { TableComponent table = (TableComponent) component; JRDatasetRun datasetRun = table.getDatasetRun(); if (datasetRun == null) { verifier.addBrokenRule("No list subdataset run set", table); } else { verifier.verifyDatasetRun(datasetRun); } List columns = table.getColumns(); if (columns == null || columns.isEmpty()) { verifier.addBrokenRule("No columns defined in the table", table); } else { if (!detectLoops(verifier, columns)) { verifyColumns(table, verifier); verifyColumnHeights(table, verifier); } } } protected boolean detectLoops(JRVerifier verifier, List columns) { Set parents = new HashSet(); return detectLoops(verifier, columns, parents); } protected boolean detectLoops(final JRVerifier verifier, List columns, final Set parents) { boolean loop = false; for (BaseColumn column : columns) { if (parents.contains(column)) { verifier.addBrokenRule("Table column is its own ancestor", column); loop = true; } else { loop = column.visitColumn(new ColumnVisitor() { public Boolean visitColumn(Column column) { return false; } public Boolean visitColumnGroup(ColumnGroup columnGroup) { parents.add(columnGroup); boolean loopDetected = detectLoops(verifier, columnGroup.getColumns(), parents); parents.remove(columnGroup); return loopDetected; } }); } if (loop) { break; } } return false; } protected void verifyColumns(final TableComponent table, final JRVerifier verifier) { ColumnVisitor columnVerifier = new ColumnVisitor() { public Void visitColumn(Column column) { verifyColumn(table, column, verifier); return null; } public Void visitColumnGroup(ColumnGroup columnGroup) { verifyBaseColumn(table, columnGroup, verifier); List subcolumns = columnGroup.getColumns(); if (subcolumns == null || subcolumns.isEmpty()) { verifier.addBrokenRule("No columns defined in column group", columnGroup); } else { int subwidth = 0; boolean subwidthValid = true; for (BaseColumn column : columnGroup.getColumns()) { column.visitColumn(this); Integer width = column.getWidth(); if (width == null) { subwidthValid = false; } else { subwidth += width; } } if (subwidthValid && columnGroup.getWidth() != null && columnGroup.getWidth() != subwidth) { verifier.addBrokenRule("Column group width " + columnGroup.getWidth() + " does not match sum of subcolumn widths " + subwidth, columnGroup); } } return null; } }; for (BaseColumn column : table.getColumns()) { column.visitColumn(columnVerifier); } } protected void verifyBaseColumn(TableComponent table, BaseColumn column, JRVerifier verifier) { Integer width = column.getWidth(); if (width == null) { verifier.addBrokenRule("Column width not set", column); } else if (width < 0) { verifier.addBrokenRule("Negative column width", column); } else { verifyCell(column.getTableHeader(), width, "table header", verifier); verifyCell(column.getTableFooter(), width, "table footer", verifier); verifyGroupCells(table, column.getGroupHeaders(), width, "group header", verifier); verifyGroupCells(table, column.getGroupFooters(), width, "group footer", verifier); verifyCell(column.getColumnHeader(), width, "column header", verifier); verifyCell(column.getColumnFooter(), width, "column footer", verifier); } } protected void verifyGroupCells(TableComponent table, List cells, int width, String cellName, JRVerifier verifier) { if (cells != null) { Set groupNames = new HashSet(); for (GroupCell groupCell : cells) { String groupName = groupCell.getGroupName(); if (groupName == null) { verifier.addBrokenRule("No group name set for table column group cell", groupCell); } else { if (!groupNames.add(groupName)) { verifier.addBrokenRule("Duplicate " + cellName + " for group \"" + groupName + "\"", groupCell); } JRDatasetRun datasetRun = table.getDatasetRun(); if (datasetRun != null) { JRDesignDataset dataset = (JRDesignDataset) verifier.getReportDesign().getDatasetMap().get( datasetRun.getDatasetName()); if (dataset != null && dataset.getGroupsMap().get(groupName) == null) { verifier.addBrokenRule("No group named " + groupName + "\" found in subdataset " + datasetRun.getDatasetName(), groupCell); } } } verifyCell(groupCell.getCell(), width, cellName, verifier); } } } protected void verifyCell(Cell cell, int width, String cellName, JRVerifier verifier) { if (cell == null) { return; } if (cell.getRowSpan() != null && cell.getRowSpan() < 1) { verifier.addBrokenRule("Negative or zero cell row span", cell); } Integer height = cell.getHeight(); if (height == null) { verifier.addBrokenRule("Cell height not set", cell); } else if (height < 0) { verifier.addBrokenRule("Negative cell height", cell); } else { JRElement[] elements = cell.getElements(); if (elements != null && elements.length > 0) { int topPadding = cell.getLineBox().getTopPadding().intValue(); int leftPadding = cell.getLineBox().getLeftPadding().intValue(); int bottomPadding = cell.getLineBox().getBottomPadding().intValue(); int rightPadding = cell.getLineBox().getRightPadding().intValue(); int avlblWidth = width - leftPadding - rightPadding; int avlblHeight = height - topPadding - bottomPadding; for (JRElement element : elements) { 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() > avlblHeight) { verifier.addBrokenRule("Element reaches outside table " + cellName + " contents height: y = " + element.getY() + ", height = " + element.getHeight() + ", cell available height = " + avlblHeight + ".", element); } if (element.getX() + element.getWidth() > avlblWidth) { verifier.addBrokenRule("Element reaches outside table " + cellName + " contents width: x = " + element.getX() + ", width = " + element.getWidth() + ", cell available width = " + avlblWidth + ".", element); } } } } } protected void verifyColumn(TableComponent table, Column column, JRVerifier verifier) { verifyBaseColumn(table, column, verifier); if (column.getWidth() != null) { Cell detailCell = column.getDetailCell(); verifyCell(detailCell, column.getWidth(), "detail", verifier); } } protected interface ColumnCellSelector { Cell getCell(Column column); Cell getCell(ColumnGroup group); String getCellName(); } protected void verifyColumnHeights(TableComponent table, JRVerifier verifier) { verifyColumnHeights(table, verifier, new BaseColumnCellSelector() { @Override protected Cell getCell(BaseColumn column) { return column.getTableHeader(); } public String getCellName() { return "table header"; } }); verifyColumnHeights(table, verifier, new BaseColumnCellSelector() { @Override protected Cell getCell(BaseColumn column) { return column.getTableFooter(); } public String getCellName() { return "table footer"; } }); JRDatasetRun datasetRun = table.getDatasetRun(); if (datasetRun != null) { JRDesignDataset dataset = (JRDesignDataset) verifier.getReportDesign().getDatasetMap().get( datasetRun.getDatasetName()); if (dataset != null) { JRGroup[] groups = dataset.getGroups(); if (groups != null) { for (int i = 0; i < groups.length; i++) { final String groupName = groups[i].getName(); verifyColumnHeights(table, verifier, new BaseColumnCellSelector() { @Override protected Cell getCell(BaseColumn column) { return column.getGroupHeader(groupName); } public String getCellName() { return "group " + groupName + " header"; } }); verifyColumnHeights(table, verifier, new BaseColumnCellSelector() { @Override protected Cell getCell(BaseColumn column) { return column.getGroupFooter(groupName); } public String getCellName() { return "group " + groupName + " footer"; } }); } } } } verifyColumnHeights(table, verifier, new BaseColumnCellSelector() { @Override protected Cell getCell(BaseColumn column) { return column.getColumnHeader(); } public String getCellName() { return "column header"; } }); verifyColumnHeights(table, verifier, new BaseColumnCellSelector() { @Override protected Cell getCell(BaseColumn column) { return column.getColumnFooter(); } public String getCellName() { return "column footer"; } }); verifyColumnHeights(table, verifier, new ColumnCellSelector() { public Cell getCell(Column column) { return column.getDetailCell(); } public Cell getCell(ColumnGroup group) { return null; } public String getCellName() { return "detail"; } }); } protected abstract class BaseColumnCellSelector implements ColumnCellSelector { public Cell getCell(Column column) { return getCell((BaseColumn) column); } public Cell getCell(ColumnGroup group) { return getCell((BaseColumn) group); } protected abstract Cell getCell(BaseColumn column); } protected void verifyColumnHeights(TableComponent table, JRVerifier verifier, final ColumnCellSelector cellSelector) { final List> tableCellRows = new ArrayList>(); ColumnVisitor cellCollector = new ColumnVisitor() { int rowIdx = 0; protected List getRow() { int currentRowCount = tableCellRows.size(); if (rowIdx >= currentRowCount) { for (int i = currentRowCount; i <= rowIdx; i++) { tableCellRows.add(new ArrayList()); } } return tableCellRows.get(rowIdx); } public Void visitColumn(Column column) { Cell cell = cellSelector.getCell(column); if (cell != null) { getRow().add(cell); } return null; } public Void visitColumnGroup(ColumnGroup columnGroup) { Cell cell = cellSelector.getCell(columnGroup); if (cell != null) { getRow().add(cell); } int span = cell == null ? 0 : 1; if (cell != null && cell.getRowSpan() != null && cell.getRowSpan() > 1) { span = cell.getRowSpan(); } rowIdx += span; for (BaseColumn subcolumn : columnGroup.getColumns()) { subcolumn.visitColumn(this); } rowIdx -= span; return null; } }; for (BaseColumn column : table.getColumns()) { column.visitColumn(cellCollector); } boolean validRowHeights = true; List rowHeights = new ArrayList(tableCellRows.size()); for (int rowIdx = 0; rowIdx < tableCellRows.size(); ++rowIdx) { Integer rowHeight = null; // going back on rows in order to determine row height int spanHeight = 0; prevRowLoop: for (int idx = rowIdx; idx >= 0; --idx) { for (Cell cell : tableCellRows.get(idx)) { int rowSpan = cell.getRowSpan() == null ? 1 : cell.getRowSpan(); if (idx + rowSpan - 1 == rowIdx && cell.getHeight() != null) { rowHeight = cell.getHeight() - spanHeight; break prevRowLoop; } } if (rowIdx > 0) { spanHeight += rowHeights.get(rowIdx - 1); } } if (rowHeight == null) { verifier.addBrokenRule("Unable to determine " + cellSelector.getCellName() + " row #" + (rowIdx + 1) + " height.", table); validRowHeights = false; } else { rowHeights.add(rowHeight); } } // don't do any more verifications if row heights could not be determined if (validRowHeights) { for (ListIterator> rowIt = tableCellRows.listIterator(); rowIt.hasNext();) { List row = rowIt.next(); int rowIdx = rowIt.previousIndex(); int rowHeight = rowHeights.get(rowIdx); for (Cell cell : row) { Integer rowSpan = cell.getRowSpan(); Integer height = cell.getHeight(); if ((rowSpan == null || rowSpan >= 1) && height != null) { int span = rowSpan == null ? 1 : rowSpan; if (rowIdx + span > tableCellRows.size()) { verifier.addBrokenRule("Row span of " + cellSelector.getCellName() + " exceeds number of rows", cell); } else { int spanHeight = rowHeight; for (int idx = 1; idx < span; ++idx) { spanHeight += rowHeights.get(rowIdx + idx); } if (cell.getHeight() != spanHeight) { verifier.addBrokenRule("Height " + cell.getHeight() + " of " + cellSelector.getCellName() + " does not match computed row height of " + spanHeight, cell); } } } } } } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/0000755000175000017500000000000011654071732026355 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/TableReportScriptlet.java0000644000175000017500000000321211632162655033334 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import net.sf.jasperreports.engine.JRDefaultScriptlet; import net.sf.jasperreports.engine.JRScriptletException; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: TableReportScriptlet.java 4595 2011-09-08 15:55:10Z teodord $ */ public class TableReportScriptlet extends JRDefaultScriptlet { private boolean detailOnPage; @Override public void afterDetailEval() throws JRScriptletException { detailOnPage = true; } @Override public void afterPageInit() throws JRScriptletException { detailOnPage = false; } public boolean hasDetailOnPage() { return detailOnPage; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/TableSubreport.java0000644000175000017500000000677511632162655032175 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import net.sf.jasperreports.engine.ElementDecorator; import net.sf.jasperreports.engine.JRDatasetParameter; import net.sf.jasperreports.engine.JRDatasetRun; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JRSubreport; import net.sf.jasperreports.engine.JRSubreportParameter; import net.sf.jasperreports.engine.JRSubreportReturnValue; import net.sf.jasperreports.engine.component.FillContext; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: TableSubreport.java 4595 2011-09-08 15:55:10Z teodord $ */ public class TableSubreport extends ElementDecorator implements JRSubreport { private final JRDatasetRun datasetRun; private final JRSubreportParameter[] parameters; public TableSubreport(JRDatasetRun datasetRun, FillContext fillContext) { super(fillContext.getComponentElement()); this.datasetRun = datasetRun; JRDatasetParameter[] datasetParameters = datasetRun.getParameters(); if (datasetParameters == null) { this.parameters = null; } else { this.parameters = new JRSubreportParameter[datasetParameters.length]; for (int i = 0; i < datasetParameters.length; i++) { JRDatasetParameter datasetParameter = datasetParameters[i]; TableSubreportParameter subreportParameter = new TableSubreportParameter(datasetParameter); this.parameters[i] = subreportParameter; } } } public JRExpression getConnectionExpression() { return datasetRun.getConnectionExpression(); } public JRExpression getDataSourceExpression() { return datasetRun.getDataSourceExpression(); } public JRExpression getExpression() { // no report expression return null; } public JRSubreportParameter[] getParameters() { return parameters; } public JRExpression getParametersMapExpression() { return datasetRun.getParametersMapExpression(); } public JRSubreportReturnValue[] getReturnValues() { // no return values return null; } /** * @deprecated Replaced by {@link #getUsingCache()}. */ public Boolean isOwnUsingCache() { return false; } public Boolean getUsingCache() { return Boolean.FALSE; } public Boolean isRunToBottom() { return false; } /** * @deprecated Replaced by {@link #getUsingCache()}. */ public boolean isUsingCache() { return false; } public void setRunToBottom(Boolean runToBottom) { throw new UnsupportedOperationException(); } public void setUsingCache(Boolean isUsingCache) { throw new UnsupportedOperationException(); } } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/BuiltinExpressionEvaluator.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/BuiltinExpressionEvaluator.j0000644000175000017500000000374211632162655034110 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import java.util.Map; import net.sf.jasperreports.engine.JRException; 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 Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BuiltinExpressionEvaluator.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface BuiltinExpressionEvaluator { void init(Map parametersMap, Map fieldsMap, Map variablesMap, WhenResourceMissingTypeEnum resourceMissingType) throws JRException; Object evaluate() throws JRExpressionEvalException; Object evaluateOld() throws JRExpressionEvalException; Object evaluateEstimated() throws JRExpressionEvalException; } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/TableReport.java0000644000175000017500000010614511647512041031445 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import net.sf.jasperreports.components.sort.FilterTypesEnum; import net.sf.jasperreports.components.sort.SortElement; import net.sf.jasperreports.components.sort.SortElementUtils; 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.TableComponent; import net.sf.jasperreports.engine.JRBand; import net.sf.jasperreports.engine.JRChild; import net.sf.jasperreports.engine.JRDataset; import net.sf.jasperreports.engine.JRElement; import net.sf.jasperreports.engine.JRElementGroup; 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.JRGroup; import net.sf.jasperreports.engine.JROrigin; import net.sf.jasperreports.engine.JRParameter; import net.sf.jasperreports.engine.JRPropertiesHolder; import net.sf.jasperreports.engine.JRPropertiesMap; import net.sf.jasperreports.engine.JRQuery; import net.sf.jasperreports.engine.JRReport; import net.sf.jasperreports.engine.JRReportTemplate; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.JRScriptlet; import net.sf.jasperreports.engine.JRSection; import net.sf.jasperreports.engine.JRSortField; import net.sf.jasperreports.engine.JRStaticText; import net.sf.jasperreports.engine.JRStyle; import net.sf.jasperreports.engine.JRTextField; import net.sf.jasperreports.engine.JRValueParameter; import net.sf.jasperreports.engine.JRVariable; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.component.FillContext; import net.sf.jasperreports.engine.design.JRDesignBand; import net.sf.jasperreports.engine.design.JRDesignElement; import net.sf.jasperreports.engine.design.JRDesignElementGroup; import net.sf.jasperreports.engine.design.JRDesignExpression; import net.sf.jasperreports.engine.design.JRDesignFrame; import net.sf.jasperreports.engine.design.JRDesignGenericElement; import net.sf.jasperreports.engine.design.JRDesignGenericElementParameter; import net.sf.jasperreports.engine.design.JRDesignGroup; import net.sf.jasperreports.engine.design.JRDesignSection; 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.BandTypeEnum; import net.sf.jasperreports.engine.type.ModeEnum; import net.sf.jasperreports.engine.type.OrientationEnum; import net.sf.jasperreports.engine.type.PrintOrderEnum; import net.sf.jasperreports.engine.type.RunDirectionEnum; import net.sf.jasperreports.engine.type.SortFieldTypeEnum; import net.sf.jasperreports.engine.type.SplitTypeEnum; import net.sf.jasperreports.engine.type.StretchTypeEnum; import net.sf.jasperreports.engine.type.WhenNoDataTypeEnum; import net.sf.jasperreports.engine.type.WhenResourceMissingTypeEnum; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: TableReport.java 4706 2011-10-18 08:57:28Z narcism $ */ public class TableReport implements JRReport { protected static final String SUMMARY_GROUP_NAME = "__SummaryGroup"; private final FillContext fillContext; private final TableComponent table; private final JasperReport parentReport; private final TableReportDataset mainDataset; private final Map builtinEvaluators; private final JRSection detail; private final JRDesignBand title; private final JRDesignBand summary; private final JRDesignBand columnHeader; private final JRDesignBand pageFooter; private final JRDesignBand lastPageFooter; public TableReport( FillContext fillContext, TableComponent table, TableReportDataset mainDataset, List fillColumns, Map builtinEvaluators ) { this.fillContext = fillContext; this.table = table; this.parentReport = fillContext.getFiller().getJasperReport(); this.mainDataset = mainDataset; this.builtinEvaluators = builtinEvaluators; this.detail = wrapBand(createDetailBand(fillColumns), new JROrigin(BandTypeEnum.DETAIL)); this.title = createTitle(fillColumns); this.summary = createSummary(fillColumns); this.columnHeader = createColumnHeader(fillColumns); this.pageFooter = createPageFooter(fillColumns); setGroupBands(fillColumns); if (pageFooter != null && summary != null) { // if the table has both column footers and table footers, we need to use // a dummy group's footer to print the last column footers so that they // appear before the table footers addSummaryGroup(fillColumns); // use an empty last page footer so that the regular page footer doesn't // show on the last page this.lastPageFooter = new JRDesignBand(); this.lastPageFooter.setHeight(0); } else { // use the regular page footer this.lastPageFooter = null; } } protected JRDesignExpression createBuiltinExpression(BuiltinExpressionEvaluator evaluator) { // we only need an empty expression object here // the evaluation logic is separate JRDesignExpression expression = new JRDesignExpression(); builtinEvaluators.put(expression, evaluator); return expression; } protected class ReportBandInfo { final JRDesignBand band; final List rowGroups = new ArrayList(); ReportBandInfo(JRDesignBand band) { this.band = band; } void addElement(int rowLevel, JRDesignElement element) { if (band.getHeight() < element.getHeight() + element.getY()) { band.setHeight(element.getHeight() + element.getY()); } JRDesignElementGroup rowGroup = getRowElementGroup(rowLevel); rowGroup.addElement(element); } JRDesignElementGroup getRowElementGroup(int rowLevel) { int rowCount = rowGroups.size(); if (rowLevel >= rowCount) { for (int level = rowCount; level <= rowLevel; ++level) { JRDesignElementGroup group = new JRDesignElementGroup(); band.addElementGroup(group); rowGroups.add(group); } } return rowGroups.get(rowLevel); } } protected abstract class ReportBandCreator implements ColumnVisitor { final ReportBandInfo bandInfo; final FillColumn fillColumn; int xOffset; int yOffset; int level; public ReportBandCreator(ReportBandInfo bandInfo, FillColumn fillColumn, int xOffset, int yOffset, int level) { this.bandInfo = bandInfo; this.fillColumn = fillColumn; this.xOffset = xOffset; this.yOffset = yOffset; this.level = level; } public Void visitColumn(Column column) { Cell cell = columnCell(column); if (cell != null) { JRDesignFrame cellFrame = createColumnCell(column, cell); int rowSpan = cell.getRowSpan() == null ? 1 : cell.getRowSpan(); bandInfo.addElement(level + rowSpan - 1, cellFrame); yOffset += cell.getHeight(); } xOffset += column.getWidth(); return null; } protected abstract Cell columnCell(Column column); protected JRDesignFrame createColumnCell(Column column, Cell cell) { return createCellFrame(cell, column.getWidth(), fillColumn.getWidth(), xOffset, yOffset); } public Void visitColumnGroup(ColumnGroup columnGroup) { Cell cell = columnGroupCell(columnGroup); int cellHeight = 0; int sublevel = level; if (cell != null) { int rowSpan = cell.getRowSpan() == null ? 1 : cell.getRowSpan(); JRDesignFrame cellFrame = createCellFrame(cell, columnGroup.getWidth(), fillColumn.getWidth(), xOffset, yOffset); bandInfo.addElement(level + rowSpan - 1, cellFrame); cellHeight = cell.getHeight(); sublevel += rowSpan; } for (FillColumn subcolumn : fillColumn.getSubcolumns()) { ReportBandCreator subVisitor = createSubVisitor(subcolumn, xOffset, yOffset + cellHeight, sublevel); subVisitor.visit(); xOffset = subVisitor.xOffset; } return null; } protected abstract Cell columnGroupCell(ColumnGroup group); protected abstract ReportBandCreator createSubVisitor(FillColumn subcolumn, int xOffset, int yOffset, int subLevel); public void visit() { fillColumn.getTableColumn().visitColumn(this); } } protected abstract class ReverseReportBandCreator extends ReportBandCreator { public ReverseReportBandCreator(ReportBandInfo bandInfo, FillColumn fillColumn, int xOffset, int yOffset, int level) { super(bandInfo, fillColumn, xOffset, yOffset, level); } @Override public Void visitColumnGroup(ColumnGroup columnGroup) { Cell cell = columnGroupCell(columnGroup); int rowSpan; if (cell == null) { rowSpan = 0; } else if (cell.getRowSpan() == null) { rowSpan = 1; } else { rowSpan = cell.getRowSpan(); } int origXOffset = xOffset; int origYOffset = yOffset; for (FillColumn subcolumn : fillColumn.getSubcolumns()) { ReportBandCreator subVisitor = createSubVisitor(subcolumn, xOffset, origYOffset, level + rowSpan); subVisitor.visit(); xOffset = subVisitor.xOffset; if (subVisitor.yOffset > yOffset) { yOffset = subVisitor.yOffset; } } if (cell != null) { JRDesignFrame cellFrame = createCellFrame(cell, columnGroup.getWidth(), fillColumn.getWidth(), origXOffset, yOffset); bandInfo.addElement(level + rowSpan - 1, cellFrame); yOffset += cell.getHeight(); } return null; } } protected class DetailBandCreator extends ReportBandCreator { public DetailBandCreator(ReportBandInfo bandInfo, FillColumn fillColumn, int xOffset, int yOffset, int level) { super(bandInfo, fillColumn, xOffset, yOffset, level); } @Override protected Cell columnCell(Column column) { return column.getDetailCell(); } @Override protected Cell columnGroupCell(ColumnGroup group) { return null; } @Override protected ReportBandCreator createSubVisitor(FillColumn subcolumn, int xOffset, int yOffset, int sublevel) { return new DetailBandCreator(bandInfo, subcolumn, xOffset, yOffset, sublevel); } } protected JRBand createDetailBand(List fillColumns) { final JRDesignBand detailBand = new JRDesignBand(); detailBand.setSplitType(SplitTypeEnum.PREVENT); ReportBandInfo bandInfo = new ReportBandInfo(detailBand); int xOffset = 0; for (FillColumn subcolumn : fillColumns) { DetailBandCreator subVisitor = new DetailBandCreator( bandInfo, subcolumn, xOffset, 0, 0); subVisitor.visit(); xOffset = subVisitor.xOffset; } return detailBand; } protected class ColumnHeaderCreator extends ReportBandCreator { public ColumnHeaderCreator(ReportBandInfo bandInfo, FillColumn fillColumn, int xOffset, int yOffset, int level) { super(bandInfo, fillColumn, xOffset, yOffset, level); } @Override protected Cell columnCell(Column column) { return column.getColumnHeader(); } @Override protected JRDesignFrame createColumnCell(Column column, Cell cell) { JRDesignFrame frame = super.createColumnCell(column, cell); JRTextField sortTextField = getColumnSortTextField(column); if (sortTextField != null) { addSortElement(column, frame, sortTextField.getExpression().getChunks()[0], sortTextField.getPattern()); } return frame; } protected JRTextField getColumnSortTextField(Column column) { Cell detailCell = column.getDetailCell(); List detailElements = detailCell == null ? null : detailCell.getChildren(); // only consider cells with a single text fields if (detailElements == null || detailElements.size() != 1) { return null; } JRChild detailElement = detailElements.get(0); if (!(detailElement instanceof JRTextField)) { return null; } // see if the text field expression is $F{..} of $V{..} JRTextField text = (JRTextField) detailElement; JRExpression textExpression = text.getExpression(); JRExpressionChunk[] chunks = textExpression == null ? null : textExpression.getChunks(); if (chunks == null || chunks.length != 1 || (chunks[0].getType() != JRExpressionChunk.TYPE_FIELD && chunks[0].getType() != JRExpressionChunk.TYPE_VARIABLE)) { return null; } // success return text; } protected JRExpression getColumnHeaderLabelExpression(Cell header) { List detailElements = header == null ? null : header.getChildren(); // only consider cells with a single text fields if (detailElements == null || detailElements.size() != 1) { return null; } JRChild detailElement = detailElements.get(0); if (detailElement instanceof JRTextField) { return ((JRTextField) detailElement).getExpression(); } if (detailElement instanceof JRStaticText) { return createBuiltinExpression(new ConstantBuiltinExpression(((JRStaticText)detailElement).getText())); } return null; } protected void addSortElement(Column column, JRDesignFrame frame, JRExpressionChunk sortExpression, String filterPattern) { Cell header = column.getColumnHeader(); JRDesignGenericElement genericElement = new JRDesignGenericElement(header.getDefaultStyleProvider()); genericElement.setGenericType(SortElement.SORT_ELEMENT_TYPE); genericElement.setPositionType(net.sf.jasperreports.engine.type.PositionTypeEnum.FIX_RELATIVE_TO_TOP); genericElement.setX(0); genericElement.setY(0); genericElement.setHeight(header.getHeight()); genericElement.setWidth(fillColumn.getWidth()); genericElement.setMode(ModeEnum.TRANSPARENT); genericElement.setStretchType(StretchTypeEnum.RELATIVE_TO_BAND_HEIGHT); genericElement.getPropertiesMap().setProperty(SortElement.PROPERTY_DATASET_RUN, getName()); String name = sortExpression.getText(); SortFieldTypeEnum columnType; FilterTypesEnum filterType = null; switch (sortExpression.getType()) { case JRExpressionChunk.TYPE_FIELD: columnType = SortFieldTypeEnum.FIELD; JRField field = getField(name); filterType = SortElementUtils.getFilterType(field.getValueClass()); break; case JRExpressionChunk.TYPE_VARIABLE: columnType = SortFieldTypeEnum.VARIABLE; JRVariable variable = getVariable(name); filterType = SortElementUtils.getFilterType(variable.getValueClass()); break; default: // never throw new JRRuntimeException("Unrecognized filter expression type " + sortExpression.getType()); } addElementParameter(genericElement, SortElement.PARAMETER_SORT_COLUMN_NAME, name); addElementParameter(genericElement, SortElement.PARAMETER_SORT_COLUMN_LABEL, getColumnHeaderLabelExpression(header)); addElementParameter(genericElement, SortElement.PARAMETER_SORT_COLUMN_TYPE, columnType.getName()); addElementParameter(genericElement, SortElement.PARAMETER_SORT_HANDLER_HORIZONTAL_ALIGN, "Right"); addElementParameter(genericElement, SortElement.PARAMETER_SORT_HANDLER_VERTICAL_ALIGN, "Middle"); if (filterType != null) { genericElement.getPropertiesMap().setProperty(SortElement.PROPERTY_FILTER_TYPE, filterType.getName()); } genericElement.getPropertiesMap().setProperty(SortElement.PROPERTY_FILTER_PATTERN, filterPattern); frame.addElement(genericElement); } protected void addElementParameter(JRDesignGenericElement element, String name, Object value) { JRDesignGenericElementParameter param = new JRDesignGenericElementParameter(); param.setName(name); JRDesignExpression valueExpression = createBuiltinExpression( new ConstantBuiltinExpression(value)); param.setValueExpression(valueExpression); element.addParameter(param); } protected void addElementParameter(JRDesignGenericElement element, String name, JRExpression expression) { JRDesignGenericElementParameter param = new JRDesignGenericElementParameter(); param.setName(name); param.setValueExpression(expression); element.addParameter(param); } @Override protected Cell columnGroupCell(ColumnGroup group) { return group.getColumnHeader(); } @Override protected ReportBandCreator createSubVisitor(FillColumn subcolumn, int xOffset, int yOffset, int sublevel) { return new ColumnHeaderCreator(bandInfo, subcolumn, xOffset, yOffset, sublevel); } } protected JRDesignBand createColumnHeader(List fillColumns) { JRDesignBand columnHeader = new JRDesignBand(); columnHeader.setSplitType(SplitTypeEnum.PREVENT); ReportBandInfo bandInfo = new ReportBandInfo(columnHeader); int xOffset = 0; for (FillColumn subcolumn : fillColumns) { ColumnHeaderCreator subVisitor = new ColumnHeaderCreator( bandInfo, subcolumn, xOffset, 0, 0); subVisitor.visit(); xOffset = subVisitor.xOffset; } if (columnHeader.getHeight() == 0) { columnHeader = null; } return columnHeader; } protected class PageFooterCreator extends ReverseReportBandCreator { public PageFooterCreator(ReportBandInfo bandInfo, FillColumn fillColumn, int xOffset, int yOffset, int level) { super(bandInfo, fillColumn, xOffset, yOffset, level); } @Override protected Cell columnCell(Column column) { return column.getColumnFooter(); } @Override protected Cell columnGroupCell(ColumnGroup group) { return group.getColumnFooter(); } @Override protected ReportBandCreator createSubVisitor(FillColumn subcolumn, int xOffset, int yOffset, int sublevel) { return new PageFooterCreator(bandInfo, subcolumn, xOffset, yOffset, sublevel); } } protected JRDesignBand createPageFooter(List fillColumns) { JRDesignBand pageFooter = new JRDesignBand(); pageFooter.setSplitType(SplitTypeEnum.PREVENT); ReportBandInfo bandInfo = new ReportBandInfo(pageFooter); int xOffset = 0; for (FillColumn subcolumn : fillColumns) { PageFooterCreator subVisitor = new PageFooterCreator( bandInfo, subcolumn, xOffset, 0, 0); subVisitor.visit(); xOffset = subVisitor.xOffset; } if (pageFooter.getHeight() == 0) { pageFooter = null; } return pageFooter; } protected class TitleCreator extends ReportBandCreator { public TitleCreator(ReportBandInfo bandInfo, FillColumn fillColumn, int xOffset, int yOffset, int level) { super(bandInfo, fillColumn, xOffset, yOffset, level); } @Override protected Cell columnCell(Column column) { return column.getTableHeader(); } @Override protected Cell columnGroupCell(ColumnGroup group) { return group.getTableHeader(); } @Override protected ReportBandCreator createSubVisitor(FillColumn subcolumn, int xOffset, int yOffset, int sublevel) { return new TitleCreator(bandInfo, subcolumn, xOffset, yOffset, sublevel); } } protected JRDesignBand createTitle(List fillColumns) { JRDesignBand title = new JRDesignBand(); title.setSplitType(SplitTypeEnum.PREVENT); ReportBandInfo bandInfo = new ReportBandInfo(title); int xOffset = 0; for (FillColumn subcolumn : fillColumns) { TitleCreator subVisitor = new TitleCreator( bandInfo, subcolumn, xOffset, 0, 0); subVisitor.visit(); xOffset = subVisitor.xOffset; } if (title.getHeight() == 0) { title = null; } return title; } protected class SummaryCreator extends ReverseReportBandCreator { public SummaryCreator(ReportBandInfo bandInfo, FillColumn fillColumn, int xOffset, int yOffset, int level) { super(bandInfo, fillColumn, xOffset, yOffset, level); } @Override protected Cell columnCell(Column column) { return column.getTableFooter(); } @Override protected Cell columnGroupCell(ColumnGroup group) { return group.getTableFooter(); } @Override protected ReportBandCreator createSubVisitor(FillColumn subcolumn, int xOffset, int yOffset, int sublevel) { return new SummaryCreator(bandInfo, subcolumn, xOffset, yOffset, sublevel); } } protected JRDesignBand createSummary(List fillColumns) { JRDesignBand summary = new JRDesignBand(); summary.setSplitType(SplitTypeEnum.PREVENT); ReportBandInfo bandInfo = new ReportBandInfo(summary); int xOffset = 0; for (FillColumn subcolumn : fillColumns) { SummaryCreator subVisitor = new SummaryCreator( bandInfo, subcolumn, xOffset, 0, 0); subVisitor.visit(); xOffset = subVisitor.xOffset; } if (summary.getHeight() == 0) { summary = null; } return summary; } protected class GroupHeaderCreator extends ReportBandCreator { private final String groupName; public GroupHeaderCreator(String groupName, ReportBandInfo bandInfo, FillColumn fillColumn, int xOffset, int yOffset, int level) { super(bandInfo, fillColumn, xOffset, yOffset, level); this.groupName = groupName; } @Override protected Cell columnCell(Column column) { return column.getGroupHeader(groupName); } @Override protected Cell columnGroupCell(ColumnGroup group) { return group.getGroupHeader(groupName); } @Override protected ReportBandCreator createSubVisitor(FillColumn subcolumn, int xOffset, int yOffset, int sublevel) { return new GroupHeaderCreator(groupName, bandInfo, subcolumn, xOffset, yOffset, sublevel); } } protected JRBand createGroupHeader(String groupName, List fillColumns) { JRDesignBand header = new JRDesignBand(); header.setSplitType(SplitTypeEnum.PREVENT); ReportBandInfo bandInfo = new ReportBandInfo(header); int xOffset = 0; for (FillColumn subcolumn : fillColumns) { GroupHeaderCreator subVisitor = new GroupHeaderCreator(groupName, bandInfo, subcolumn, xOffset, 0, 0); subVisitor.visit(); xOffset = subVisitor.xOffset; } if (header.getHeight() == 0) { header = null; } return header; } protected class GroupFooterCreator extends ReverseReportBandCreator { private final String groupName; public GroupFooterCreator(String groupName, ReportBandInfo bandInfo, FillColumn fillColumn, int xOffset, int yOffset, int level) { super(bandInfo, fillColumn, xOffset, yOffset, level); this.groupName = groupName; } @Override protected Cell columnCell(Column column) { return column.getGroupFooter(groupName); } @Override protected Cell columnGroupCell(ColumnGroup group) { return group.getGroupFooter(groupName); } @Override protected ReportBandCreator createSubVisitor(FillColumn subcolumn, int xOffset, int yOffset, int sublevel) { return new GroupFooterCreator(groupName, bandInfo, subcolumn, xOffset, yOffset, sublevel); } } protected JRBand createGroupFooter(String groupName, List fillColumns) { JRDesignBand footer = new JRDesignBand(); footer.setSplitType(SplitTypeEnum.PREVENT); ReportBandInfo bandInfo = new ReportBandInfo(footer); int xOffset = 0; for (FillColumn subcolumn : fillColumns) { GroupFooterCreator subVisitor = new GroupFooterCreator(groupName, bandInfo, subcolumn, xOffset, 0, 0); subVisitor.visit(); xOffset = subVisitor.xOffset; } if (footer.getHeight() == 0) { footer = null; } return footer; } private void setGroupBands(List fillColumns) { TableReportGroup[] groups = mainDataset.getTableGroups(); if (groups != null) { for (TableReportGroup group : groups) { JRBand header = createGroupHeader(group.getName(), fillColumns); if (header != null) { group.setGroupHeader(header); } JRBand footer = createGroupFooter(group.getName(), fillColumns); if (footer != null) { group.setGroupFooter(footer); } } } } protected static final String TABLE_SCRIPTLET_NAME = "__Table"; protected class SummaryGroupFooterPrintWhenEvaluator implements BuiltinExpressionEvaluator { private JRValueParameter tableScriptletParam; private TableReportScriptlet tableScriptlet; public void init(Map parametersMap, Map fieldsMap, Map variablesMap, WhenResourceMissingTypeEnum resourceMissingType) throws JRException { tableScriptletParam = parametersMap.get(TABLE_SCRIPTLET_NAME + JRScriptlet.SCRIPTLET_PARAMETER_NAME_SUFFIX); } protected void ensureValue() { if (tableScriptlet == null) { tableScriptlet = (TableReportScriptlet) tableScriptletParam.getValue(); } } public Object evaluate() throws JRExpressionEvalException { ensureValue(); return tableScriptlet.hasDetailOnPage(); } public Object evaluateEstimated() throws JRExpressionEvalException { ensureValue(); return tableScriptlet.hasDetailOnPage(); } public Object evaluateOld() throws JRExpressionEvalException { ensureValue(); return tableScriptlet.hasDetailOnPage(); } } protected int computeTableWidth(List fillColumns) { int width = 0; for (FillColumn column : fillColumns) { width += column.getWidth(); } return width; } protected void addSummaryGroup(List fillColumns) { JRDesignGroup summaryGroup = new JRDesignGroup(); summaryGroup.setName(SUMMARY_GROUP_NAME);//TODO check for uniqueness JRDesignBand groupFooter = new JRDesignBand(); groupFooter.setSplitType(SplitTypeEnum.PREVENT); groupFooter.setHeight(pageFooter.getHeight()); // we need to put everything in a frame so that we can tell the frame // not to print when there are no detail bands on the current page // // we can't do that directly to the band since its print when expression // is evaluated too soon JRDesignFrame footerFrame = new JRDesignFrame(); footerFrame.setX(0); footerFrame.setY(0); footerFrame.setWidth(computeTableWidth(fillColumns)); footerFrame.setHeight(pageFooter.getHeight()); footerFrame.getLineBox().setPadding(0); footerFrame.getLineBox().getPen().setLineWidth(0f); footerFrame.setRemoveLineWhenBlank(true); JRDesignExpression footerPrintWhen = createBuiltinExpression(new SummaryGroupFooterPrintWhenEvaluator()); footerFrame.setPrintWhenExpression(footerPrintWhen); // clone the contents of the page footer in the frame List footerElements = pageFooter.getChildren(); for (Iterator iterator = footerElements.iterator(); iterator .hasNext();) { JRChild child = iterator.next(); JRChild childClone = (JRChild) child.clone(footerFrame); if (childClone instanceof JRElement) { footerFrame.addElement((JRElement) childClone); } else if (childClone instanceof JRElementGroup) { footerFrame.addElementGroup((JRElementGroup) childClone); } else { throw new JRRuntimeException("Uknown child type " + childClone.getClass().getName()); } } groupFooter.addElement(footerFrame); ((JRDesignSection) summaryGroup.getGroupFooterSection()).addBand(groupFooter); mainDataset.addScriptlet(TABLE_SCRIPTLET_NAME, TableReportScriptlet.class); mainDataset.addFirstGroup(summaryGroup); } protected JRDesignFrame createCellFrame(Cell cell, int originalWidth, int width, int x, int y) { JRDesignFrame frame = new JRDesignFrame(this); frame.setX(x); frame.setY(y); frame.setWidth(width); frame.setHeight(cell.getHeight()); frame.setStretchType(StretchTypeEnum.RELATIVE_TO_TALLEST_OBJECT); frame.setStyle(cell.getStyle()); frame.setStyleNameReference(cell.getStyleNameReference()); frame.copyBox(cell.getLineBox()); for (Iterator it = cell.getChildren().iterator(); it.hasNext();) { JRChild child = it.next(); if (child instanceof JRElement) { JRElement element = (JRElement) child; // clone the element in order to set the frame as group element = (JRElement) element.clone(frame); if (width != originalWidth) { scaleCellElement(element, originalWidth, width); if (element instanceof JRElementGroup)//i.e. frame { JRElementGroup elementGroup = (JRElementGroup) element; for (JRElement subelement : elementGroup.getElements()) { scaleCellElement(subelement, originalWidth, width); } } } frame.addElement(element); } else if (child instanceof JRElementGroup) { JRElementGroup elementGroup = (JRElementGroup) child; // clone the elements in order to set the frame as group elementGroup = (JRElementGroup) elementGroup.clone(frame); frame.addElementGroup(elementGroup); if (width != originalWidth) { for (JRElement element : elementGroup.getElements()) { scaleCellElement(element, originalWidth, width); } } } else { throw new JRRuntimeException("Unknown JRChild type " + child.getClass().getName()); } } return frame; } protected void scaleCellElement(JRElement element, Integer cellWidth, int scaledCellWidth) { int scaledWidth = Math.round(((float) element.getWidth() * scaledCellWidth) / cellWidth); element.setWidth(scaledWidth); } protected JRSection wrapBand(JRBand band, JROrigin origin) { JRDesignSection section = new JRDesignSection(origin); section.addBand(band); return section; } public JRBand getBackground() { return null; } public int getBottomMargin() { return 0; } public int getColumnCount() { return 1; } public JRBand getColumnFooter() { return null; } public JRBand getColumnHeader() { return columnHeader; } public int getColumnSpacing() { return 0; } public int getColumnWidth() { return fillContext.getComponentElement().getWidth(); } public JRDataset[] getDatasets() { return parentReport.getDatasets(); } @Deprecated public JRBand getDetail() { // see #getDetailSection() return null; } public JRSection getDetailSection() { return detail; } public JRField[] getFields() { return mainDataset.getFields(); } protected JRField getField(String name) { JRField found = null; for (JRField field : getFields()) { if (name.equals(field.getName())) { found = field; break; } } return found; } public String getFormatFactoryClass() { return parentReport.getFormatFactoryClass(); } public JRGroup[] getGroups() { return mainDataset.getGroups(); } public String[] getImports() { return parentReport.getImports(); } public String getLanguage() { return parentReport.getLanguage(); } public JRBand getLastPageFooter() { return lastPageFooter; } public int getLeftMargin() { return 0; } public JRDataset getMainDataset() { return mainDataset; } public String getName() { return mainDataset.getName(); } public JRBand getNoData() { return null; } public OrientationEnum getOrientationValue() { return OrientationEnum.PORTRAIT; } public JRBand getPageFooter() { return pageFooter; } public JRBand getPageHeader() { return null; } public int getPageHeight() { return parentReport.getPageHeight(); } public int getPageWidth() { return fillContext.getComponentElement().getWidth(); } public JRParameter[] getParameters() { return mainDataset.getParameters(); } public PrintOrderEnum getPrintOrderValue() { return PrintOrderEnum.VERTICAL; } public RunDirectionEnum getColumnDirection() { return RunDirectionEnum.LTR; } public String getProperty(String name) { return mainDataset.getPropertiesMap().getProperty(name); } public String[] getPropertyNames() { return mainDataset.getPropertiesMap().getPropertyNames(); } public JRQuery getQuery() { return mainDataset.getQuery(); } public String getResourceBundle() { return mainDataset.getResourceBundle(); } public int getRightMargin() { return 0; } public String getScriptletClass() { return mainDataset.getScriptletClass(); } public JRScriptlet[] getScriptlets() { return mainDataset.getScriptlets(); } public JRSortField[] getSortFields() { return mainDataset.getSortFields(); } public JRStyle[] getStyles() { return parentReport.getStyles(); } public JRBand getSummary() { return summary; } public JRReportTemplate[] getTemplates() { // the parent report's templates are always used for the subreport return null; } public JRBand getTitle() { return title; } public int getTopMargin() { return 0; } public JRVariable[] getVariables() { return mainDataset.getVariables(); } protected JRVariable getVariable(String name) { JRVariable found = null; for (JRVariable var : getVariables()) { if (name.equals(var.getName())) { found = var; break; } } return found; } public WhenNoDataTypeEnum getWhenNoDataTypeValue() { WhenNoDataTypeEnum whenNoDataType = WhenNoDataTypeEnum.NO_PAGES; if (table.getWhenNoDataType() != null) { switch (table.getWhenNoDataType()) { case ALL_SECTIONS_NO_DETAIL : { whenNoDataType = WhenNoDataTypeEnum.ALL_SECTIONS_NO_DETAIL; break; } case BLANK : default : { whenNoDataType = WhenNoDataTypeEnum.NO_PAGES; break; } } } return whenNoDataType; } public WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue() { return mainDataset.getWhenResourceMissingTypeValue(); } public boolean isFloatColumnFooter() { return true; } public boolean isIgnorePagination() { return false; } public boolean isSummaryNewPage() { return false; } public boolean isSummaryWithPageHeaderAndFooter() { return false; } public boolean isTitleNewPage() { return false; } public void removeProperty(String name) { throw new UnsupportedOperationException(); } public void setProperty(String name, String value) { throw new UnsupportedOperationException(); } public void setWhenNoDataType(WhenNoDataTypeEnum whenNoDataType) { throw new UnsupportedOperationException(); } public void setWhenResourceMissingType( WhenResourceMissingTypeEnum whenResourceMissingType) { throw new UnsupportedOperationException(); } public JRStyle getDefaultStyle() { return parentReport.getDefaultStyle(); } public JRPropertiesHolder getParentProperties() { return null; } public JRPropertiesMap getPropertiesMap() { return mainDataset.getPropertiesMap(); } public boolean hasProperties() { return mainDataset.hasProperties(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/TableSubreportParameter.java0000644000175000017500000000366711632162655034033 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import net.sf.jasperreports.engine.JRDatasetParameter; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.JRSubreportParameter; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: TableSubreportParameter.java 4595 2011-09-08 15:55:10Z teodord $ */ public class TableSubreportParameter implements JRSubreportParameter { private final JRDatasetParameter datasetParameter; public TableSubreportParameter(JRDatasetParameter datasetParameter) { this.datasetParameter = datasetParameter; } public JRExpression getExpression() { return datasetParameter.getExpression(); } public String getName() { return datasetParameter.getName(); } public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { throw new JRRuntimeException(e); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/TableReportDataset.java0000644000175000017500000001315011632162655032752 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import java.util.ArrayList; import java.util.Collections; import java.util.List; import net.sf.jasperreports.engine.JRAbstractScriptlet; import net.sf.jasperreports.engine.JRDataset; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JRField; import net.sf.jasperreports.engine.JRGroup; import net.sf.jasperreports.engine.JRParameter; import net.sf.jasperreports.engine.JRPropertiesHolder; import net.sf.jasperreports.engine.JRPropertiesMap; import net.sf.jasperreports.engine.JRQuery; import net.sf.jasperreports.engine.JRScriptlet; import net.sf.jasperreports.engine.JRSortField; import net.sf.jasperreports.engine.JRVariable; import net.sf.jasperreports.engine.design.JRDesignParameter; import net.sf.jasperreports.engine.design.JRDesignScriptlet; import net.sf.jasperreports.engine.type.WhenResourceMissingTypeEnum; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: TableReportDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public class TableReportDataset implements JRDataset { private final JRDataset tableSubdataset; private final String name; private final TableReportGroup[] tableGroups; private final List groups; private final JRPropertiesMap properties; private final List scriptlets; private final List parameters; public TableReportDataset(JRDataset tableSubdataset, String name) { this.tableSubdataset = tableSubdataset; this.name = name; JRGroup[] datasetGroups = tableSubdataset.getGroups(); groups = new ArrayList(); if (datasetGroups == null) { tableGroups = null; } else { tableGroups = new TableReportGroup[datasetGroups.length]; for (int i = 0; i < datasetGroups.length; i++) { tableGroups[i] = new TableReportGroup(datasetGroups[i]); groups.add(tableGroups[i]); } } properties = tableSubdataset.getPropertiesMap().cloneProperties(); scriptlets = new ArrayList(); JRScriptlet[] datasetScriptlets = tableSubdataset.getScriptlets(); if (datasetScriptlets != null) { Collections.addAll(scriptlets, datasetScriptlets); } JRParameter[] datasetParameters = tableSubdataset.getParameters(); parameters = new ArrayList(); if (datasetParameters != null) { Collections.addAll(parameters, datasetParameters); } } public JRField[] getFields() { return tableSubdataset.getFields(); } public JRExpression getFilterExpression() { return tableSubdataset.getFilterExpression(); } public TableReportGroup[] getTableGroups() { return tableGroups; } public JRGroup[] getGroups() { return groups.toArray(new JRGroup[groups.size()]); } public void addFirstGroup(JRGroup group) { groups.add(0, group); } public String getName() { return name; } public JRParameter[] getParameters() { return parameters.toArray(new JRParameter[parameters.size()]); } public JRQuery getQuery() { return tableSubdataset.getQuery(); } public String getResourceBundle() { return tableSubdataset.getResourceBundle(); } public String getScriptletClass() { return tableSubdataset.getScriptletClass(); } public JRScriptlet[] getScriptlets() { return scriptlets.toArray(new JRScriptlet[scriptlets.size()]); } public JRSortField[] getSortFields() { return tableSubdataset.getSortFields(); } public JRVariable[] getVariables() { return tableSubdataset.getVariables(); } public WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue() { return tableSubdataset.getWhenResourceMissingTypeValue(); } public boolean isMainDataset() { // used as main dataset return true; } public void setWhenResourceMissingType( WhenResourceMissingTypeEnum whenResourceMissingType) { throw new UnsupportedOperationException(); } public JRPropertiesHolder getParentProperties() { return tableSubdataset.getParentProperties(); } public JRPropertiesMap getPropertiesMap() { return properties; } public boolean hasProperties() { return properties.hasProperties(); } public Object clone() { throw new UnsupportedOperationException(); } public void addScriptlet(String name, Class type) { JRDesignScriptlet scriptlet = new JRDesignScriptlet(); scriptlet.setName(name); scriptlet.setValueClass(type); JRDesignParameter parameter = new JRDesignParameter(); parameter.setName(name + JRScriptlet.SCRIPTLET_PARAMETER_NAME_SUFFIX); parameter.setValueClass(scriptlet.getValueClass()); parameter.setSystemDefined(true); parameter.setForPrompting(false); scriptlets.add(scriptlet); parameters.add(parameter); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/FillTable.java0000644000175000017500000002701111644765277031074 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import java.io.Serializable; 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.components.table.BaseColumn; 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.TableComponent; import net.sf.jasperreports.engine.JRDataset; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JROrigin; import net.sf.jasperreports.engine.JRPrintElement; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.JRStyle; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.component.BaseFillComponent; import net.sf.jasperreports.engine.component.FillPrepareResult; import net.sf.jasperreports.engine.design.JRAbstractCompiler; import net.sf.jasperreports.engine.design.JRReportCompileData; import net.sf.jasperreports.engine.fill.JRFillObjectFactory; import net.sf.jasperreports.engine.fill.JRTemplateFrame; import net.sf.jasperreports.engine.fill.JRTemplatePrintFrame; import net.sf.jasperreports.engine.util.JRReportUtils; import net.sf.jasperreports.engine.xml.JRXmlWriter; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: FillTable.java 4648 2011-10-10 12:50:53Z lucianc $ */ public class FillTable extends BaseFillComponent { private static final Log log = LogFactory.getLog(FillTable.class); private final TableComponent table; private final JRFillObjectFactory factory; private final Map, FillTableSubreport> fillSubreports = new HashMap, FillTableSubreport>(); private FillTableSubreport fillSubreport; private boolean filling; private List fillColumns; private int fillWidth; private Map printFrameTemplates = new HashMap(); public FillTable(TableComponent table, JRFillObjectFactory factory) { this.table = table; this.factory = factory; } public void evaluate(byte evaluation) throws JRException { if (filling) { log.warn("Table fill did not complete, canceling previous table subreport"); fillSubreport.cancelSubreportFill(); } filling = false; evaluateColumns(evaluation); if (!fillColumns.isEmpty()) { createFillSubreport(); fillSubreport.evaluateSubreport(evaluation); } } protected boolean toPrintColumn(BaseColumn column, byte evaluation) throws JRException { boolean toPrint; JRExpression printWhenExpression = column.getPrintWhenExpression(); if (printWhenExpression == null) { toPrint = true; } else { Boolean printWhenVal = (Boolean) evaluateExpression( printWhenExpression, evaluation); if (printWhenVal == null) { toPrint = false; } else { toPrint = printWhenVal.booleanValue(); } } return toPrint; } protected class FillColumnEvaluator implements ColumnVisitor { final byte evaluation; public FillColumnEvaluator(byte evaluation) { this.evaluation = evaluation; } public FillColumn visitColumn(Column column) { try { boolean toPrint = toPrintColumn(column, evaluation); return toPrint ? new FillColumn(column) : null; } catch (JRException e) { throw new JRRuntimeException(e); } } public FillColumn visitColumnGroup(ColumnGroup columnGroup) { try { boolean toPrint = toPrintColumn(columnGroup, evaluation); FillColumn fillColumn; if (toPrint) { List columns = columnGroup.getColumns(); List subColumns = new ArrayList(columns.size()); int printWidth = 0; for (BaseColumn column : columns) { FillColumn fillSubColumn = column.visitColumn(this); if (fillSubColumn != null) { printWidth += fillSubColumn.getWidth(); subColumns.add(fillSubColumn); } } if (subColumns.isEmpty()) { // no sub columns prints // the column group won't print either fillColumn = null; } else { fillColumn = new FillColumn(columnGroup, printWidth, subColumns); } } else { fillColumn = null; } return fillColumn; } catch (JRException e) { throw new JRRuntimeException(e); } } } protected void evaluateColumns(byte evaluation) { FillColumnEvaluator columnEvaluator = new FillColumnEvaluator(evaluation); List columns = table.getColumns(); fillColumns = new ArrayList(columns.size()); fillWidth = 0; for (BaseColumn column : columns) { FillColumn fillColumn = column.visitColumn(columnEvaluator); if (fillColumn != null) { fillColumns.add(fillColumn); fillWidth += fillColumn.getWidth(); } } } protected void createFillSubreport() throws JRException { fillSubreport = fillSubreports.get(fillColumns); if (fillSubreport == null) { fillSubreport = createFillTableSubreport(); fillSubreports.put(fillColumns, fillSubreport); } } protected FillTableSubreport createFillTableSubreport() throws JRException { JasperReport parentReport = fillContext.getFiller().getJasperReport(); JRDataset reportSubdataset = JRReportUtils.findSubdataset(table.getDatasetRun(), parentReport); Map builtinEvaluators = new HashMap(); String tableReportName = JRAbstractCompiler.getUnitName(parentReport, reportSubdataset); // clone the table subdataset in order to have a different instance for other // elements that might be using it. // we're cloning the subdataset via an object factory in order to preserve // the relationship between objects (e.g. variables and groups) in the cloned // dataset JRDataset tableSubdataset = DatasetCloneObjectFactory.cloneDataset(reportSubdataset); TableReportDataset reportDataset = new TableReportDataset(tableSubdataset, tableReportName); TableReport tableReport = new TableReport(fillContext, table, reportDataset, fillColumns, builtinEvaluators); if (log.isDebugEnabled()) { String tableReportXml = JRXmlWriter.writeReport(tableReport, "UTF-8"); log.debug("Generated table report:\n" + tableReportXml); } JRReportCompileData tableReportCompileData = createTableReportCompileData( parentReport, reportDataset);//reportSubdataset); //FIXMEJIVE check this JasperReport compiledTableReport = new JasperReport(tableReport, parentReport.getCompilerClass(), tableReportCompileData, new TableReportBaseObjectFactory(reportDataset), "");// no suffix as already included in the report name TableSubreport subreport = new TableSubreport(table.getDatasetRun(), fillContext); return new FillTableSubreport( fillContext.getFiller(), subreport, factory, compiledTableReport, builtinEvaluators); } protected JRReportCompileData createTableReportCompileData( JasperReport parentReport, JRDataset reportSubdataset) throws JRException { Serializable reportCompileDataObj = parentReport.getCompileData(); if (!(reportCompileDataObj instanceof JRReportCompileData)) { throw new JRRuntimeException("Unsupported compiled report data of type " + reportCompileDataObj.getClass().getName()); } JRReportCompileData reportCompileData = (JRReportCompileData) reportCompileDataObj; Serializable datasetCompileData = reportCompileData.getDatasetCompileData( reportSubdataset); JRReportCompileData tableReportCompileData = new TableReportCompileData( parentReport); tableReportCompileData.setMainDatasetCompileData(datasetCompileData); JRDataset[] datasets = parentReport.getDatasets(); if (datasets != null) { for (JRDataset dataset : datasets) { Serializable compileData = reportCompileData.getDatasetCompileData(dataset); tableReportCompileData.setDatasetCompileData(dataset, compileData); } } return tableReportCompileData; } public FillPrepareResult prepare(int availableHeight) { try { if (fillColumns.isEmpty()) { //no columns to print return FillPrepareResult.NO_PRINT_NO_OVERFLOW; } FillPrepareResult result = fillSubreport.prepareSubreport( availableHeight, filling); filling = result.willOverflow(); return result; } catch (JRException e) { throw new JRRuntimeException(e); } } public JRPrintElement fill() { JRTemplatePrintFrame printFrame = new JRTemplatePrintFrame(getFrameTemplate(), elementId); printFrame.setX(fillContext.getComponentElement().getX()); printFrame.setY(fillContext.getElementPrintY()); printFrame.setWidth(fillWidth); printFrame.setHeight(fillSubreport.getContentsStretchHeight()); List styles = fillSubreport.getSubreportStyles(); for (Iterator it = styles.iterator(); it.hasNext();) { JRStyle style = it.next(); try { fillContext.getFiller().addPrintStyle(style); } catch (JRException e) { throw new JRRuntimeException(e); } } List origins = fillSubreport.getSubreportOrigins(); for (Iterator it = origins.iterator(); it.hasNext();) { JROrigin origin = it.next(); fillContext.getFiller().getJasperPrint().addOrigin(origin); } Collection elements = fillSubreport.getPrintElements(); if (elements != null) { for (Iterator it = elements.iterator(); it.hasNext();) { JRPrintElement element = it.next(); printFrame.addElement(element); } } return printFrame; } 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 void rewind() { if (filling) { if (log.isDebugEnabled()) { log.debug("Rewinding table subreport"); } try { fillSubreport.rewind(); } catch (JRException e) { throw new JRRuntimeException(e); } filling = false; } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/TableReportGroup.java0000644000175000017500000001040511632162655032461 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import net.sf.jasperreports.engine.JRBand; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JRGroup; import net.sf.jasperreports.engine.JROrigin; import net.sf.jasperreports.engine.JRSection; import net.sf.jasperreports.engine.JRVariable; import net.sf.jasperreports.engine.design.JRDesignSection; import net.sf.jasperreports.engine.type.BandTypeEnum; import net.sf.jasperreports.engine.type.FooterPositionEnum; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: TableReportGroup.java 4595 2011-09-08 15:55:10Z teodord $ */ public class TableReportGroup implements JRGroup { private final JRGroup datasetGroup; private JRBand header; private JRSection headerSection; private JRBand footer; private JRSection footerSection; public TableReportGroup(JRGroup datasetGroup) { this.datasetGroup = datasetGroup; } public JRVariable getCountVariable() { return datasetGroup.getCountVariable(); } public JRExpression getExpression() { return datasetGroup.getExpression(); } public FooterPositionEnum getFooterPositionValue() { return FooterPositionEnum.NORMAL; } @Deprecated public JRBand getGroupFooter() { return footer; } public void setGroupFooter(JRBand footer) { this.footer = footer; this.footerSection = wrapBand(footer, BandTypeEnum.GROUP_FOOTER); } protected JRSection wrapBand(JRBand band, BandTypeEnum bandType) { if (band == null) { return null; } JROrigin origin = new JROrigin(null, getName(), bandType); JRDesignSection section = new JRDesignSection(origin); section.addBand(band); return section; } public JRSection getGroupFooterSection() { return footerSection; } @Deprecated public JRBand getGroupHeader() { return header; } public void setGroupHeader(JRBand header) { this.header = header; this.headerSection = wrapBand(header, BandTypeEnum.GROUP_HEADER); } public JRSection getGroupHeaderSection() { return headerSection; } public int getMinHeightToStartNewPage() { return 0; } public String getName() { return datasetGroup.getName(); } public boolean isKeepTogether() { return false; } public boolean isReprintHeaderOnEachPage() { return false; } public boolean isResetPageNumber() { return false; } public boolean isStartNewColumn() { return false; } public boolean isStartNewPage() { return false; } public void setFooterPosition(FooterPositionEnum footerPosition) { throw new UnsupportedOperationException(); } public void setKeepTogether(boolean keepTogether) { throw new UnsupportedOperationException(); } public void setMinHeightToStartNewPage(int minHeight) { throw new UnsupportedOperationException(); } public void setReprintHeaderOnEachPage(boolean isReprint) { throw new UnsupportedOperationException(); } public void setResetPageNumber(boolean isReset) { throw new UnsupportedOperationException(); } public void setStartNewColumn(boolean isStart) { throw new UnsupportedOperationException(); } public void setStartNewPage(boolean isStart) { throw new UnsupportedOperationException(); } public Object clone() { throw new UnsupportedOperationException(); } public JRGroup getOriginalGroup() { return datasetGroup; } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/BuiltinExpressionEvaluatorDecorator.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/BuiltinExpressionEvaluatorDe0000644000175000017500000000700111632162655034121 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import java.util.Map; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRExpression; 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 Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BuiltinExpressionEvaluatorDecorator.java 4595 2011-09-08 15:55:10Z teodord $ */ public class BuiltinExpressionEvaluatorDecorator implements DatasetExpressionEvaluator { private final DatasetExpressionEvaluator decorated; private final Map builtinEvaluators; public BuiltinExpressionEvaluatorDecorator(DatasetExpressionEvaluator decorated, Map builtinEvaluators) { this.decorated = decorated; this.builtinEvaluators = builtinEvaluators; } public void init(Map parametersMap, Map fieldsMap, Map variablesMap, WhenResourceMissingTypeEnum resourceMissingType) throws JRException { decorated.init(parametersMap, fieldsMap, variablesMap, resourceMissingType); for (BuiltinExpressionEvaluator builtinEvaluator : builtinEvaluators.values()) { builtinEvaluator.init(parametersMap, fieldsMap, variablesMap, resourceMissingType); } } public Object evaluate(JRExpression expression) throws JRExpressionEvalException { BuiltinExpressionEvaluator builtinEvaluator = builtinEvaluators.get(expression); if (builtinEvaluator != null) { return builtinEvaluator.evaluate(); } return decorated.evaluate(expression); } public Object evaluateEstimated(JRExpression expression) throws JRExpressionEvalException { BuiltinExpressionEvaluator builtinEvaluator = builtinEvaluators.get(expression); if (builtinEvaluator != null) { return builtinEvaluator.evaluateEstimated(); } return decorated.evaluateEstimated(expression); } public Object evaluateOld(JRExpression expression) throws JRExpressionEvalException { BuiltinExpressionEvaluator builtinEvaluator = builtinEvaluators.get(expression); if (builtinEvaluator != null) { return builtinEvaluator.evaluateOld(); } return decorated.evaluateOld(expression); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/TableReportCompileData.java0000644000175000017500000000423711632162655033555 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import net.sf.jasperreports.crosstabs.JRCrosstab; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.JRDataset; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.design.JRReportCompileData; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: TableReportCompileData.java 4595 2011-09-08 15:55:10Z teodord $ */ public class TableReportCompileData extends JRReportCompileData { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final JasperReport originialReport; public TableReportCompileData(JasperReport originialReport) { this.originialReport = originialReport; } @Override public String getUnitName(JasperReport jasperReport, JRDataset dataset) { String unitName; if (dataset.isMainDataset()) { unitName = super.getUnitName(jasperReport, dataset); } else { unitName = super.getUnitName(originialReport, dataset); } return unitName; } @Override public String getUnitName(JasperReport jasperReport, JRCrosstab crosstab) { return super.getUnitName(originialReport, crosstab); } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/TableReportBaseObjectFactory.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/TableReportBaseObjectFactory0000644000175000017500000000470211632162655034001 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import java.util.HashMap; import java.util.Map; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JRExpressionCollector; import net.sf.jasperreports.engine.JRGroup; import net.sf.jasperreports.engine.base.JRBaseGroup; import net.sf.jasperreports.engine.base.JRBaseObjectFactory; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: TableReportBaseObjectFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class TableReportBaseObjectFactory extends JRBaseObjectFactory { private Map tableGroupMap = new HashMap(); public TableReportBaseObjectFactory(TableReportDataset reportDataset) { super((JRExpressionCollector) null); TableReportGroup[] tableGroups = reportDataset.getTableGroups(); if (tableGroups != null) { for (TableReportGroup tableReportGroup : tableGroups) { tableGroupMap.put(tableReportGroup.getOriginalGroup(), tableReportGroup); } } } @Override public JRExpression getExpression(JRExpression expression, boolean assignNotUsedId) { // same expressions are used in the table report return expression; } @Override protected JRBaseGroup getGroup(JRGroup group) { JRGroup origGroup; if (tableGroupMap.containsKey(group)) { origGroup = tableGroupMap.get(group); } else { origGroup = group; } return super.getGroup(origGroup); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/FillColumn.java0000644000175000017500000000470411632162655031272 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import java.util.List; import net.sf.jasperreports.components.table.BaseColumn; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: FillColumn.java 4595 2011-09-08 15:55:10Z teodord $ */ public class FillColumn { private BaseColumn tableColumn; private int width; private List subcolumns; public FillColumn(BaseColumn tableColumn) { this(tableColumn, tableColumn.getWidth(), null); } public FillColumn(BaseColumn tableColumn, int width, List subcolumns) { super(); this.tableColumn = tableColumn; this.width = width; this.subcolumns = subcolumns; } public BaseColumn getTableColumn() { return tableColumn; } public int getWidth() { return width; } public List getSubcolumns() { return subcolumns; } @Override public boolean equals(Object obj) { if (obj == this) { //quick exit return true; } if (!(obj instanceof FillColumn)) { return false; } FillColumn col = (FillColumn) obj; return tableColumn == col.tableColumn // instance comparison && width == col.width && (subcolumns == null ? col.subcolumns == null : col.subcolumns != null && subcolumns.equals(col.subcolumns)); } @Override public int hashCode() { int hash = tableColumn.hashCode(); hash = hash * 37 + width; hash = hash * 37 + (subcolumns == null ? 0 : subcolumns.hashCode()); return hash; } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/ConstantBuiltinExpression.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/ConstantBuiltinExpression.ja0000644000175000017500000000455611632162655034104 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import java.util.Map; import net.sf.jasperreports.engine.JRException; 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; /** * Builtin expression that evaluates to a constant value. * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: ConstantBuiltinExpression.java 4595 2011-09-08 15:55:10Z teodord $ */ public class ConstantBuiltinExpression implements BuiltinExpressionEvaluator { private final Object value; /** * Creates an expression evaluator for a specified value. * * @param value the value */ public ConstantBuiltinExpression(Object value) { this.value = value; } public void init(Map parametersMap, Map fieldsMap, Map variablesMap, WhenResourceMissingTypeEnum resourceMissingType) throws JRException { // NOP } public Object evaluate() throws JRExpressionEvalException { return value; } public Object evaluateOld() throws JRExpressionEvalException { return value; } public Object evaluateEstimated() throws JRExpressionEvalException { return value; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/FillTableSubreport.java0000644000175000017500000001370311632162655032771 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import java.sql.Connection; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.ResourceBundle; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JROrigin; import net.sf.jasperreports.engine.JRParameter; import net.sf.jasperreports.engine.JRPrintElement; import net.sf.jasperreports.engine.JRQuery; import net.sf.jasperreports.engine.JRStyle; import net.sf.jasperreports.engine.JRSubreport; import net.sf.jasperreports.engine.JRTemplate; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.component.FillPrepareResult; import net.sf.jasperreports.engine.fill.DatasetExpressionEvaluator; import net.sf.jasperreports.engine.fill.JRBaseFiller; import net.sf.jasperreports.engine.fill.JRFillObjectFactory; import net.sf.jasperreports.engine.fill.JRFillSubreport; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: FillTableSubreport.java 4595 2011-09-08 15:55:10Z teodord $ */ public class FillTableSubreport extends JRFillSubreport { private final JasperReport tableReport; private final Map builtinEvaluators; protected FillTableSubreport(JRBaseFiller filler, JRSubreport subreport, JRFillObjectFactory factory, JasperReport tableReport, Map builtinEvaluators) { super(filler, subreport, factory); this.tableReport = tableReport; this.builtinEvaluators = builtinEvaluators; } @Override protected JasperReport evaluateReport(byte evaluation) throws JRException { return tableReport; } @Override protected DatasetExpressionEvaluator createEvaluator() throws JRException { DatasetExpressionEvaluator evaluator = super.createEvaluator(); if (!builtinEvaluators.isEmpty()) { // use the builtin expression evaluators evaluator = new BuiltinExpressionEvaluatorDecorator(evaluator, builtinEvaluators); } return evaluator; } @Override protected void evaluateSubreport(byte evaluation) throws JRException { // overriding this for package access super.evaluateSubreport(evaluation); } @Override protected Map evaluateParameterValues(byte evaluation) throws JRException { Map values = super.evaluateParameterValues(evaluation); copyConnectionParameter(values); copyResourceBundleParameter(values); copyTemplatesParameter(values); // TODO other built-in parameters? return values; } protected void copyConnectionParameter(Map parameterValues) { // copy the main report's connection parameter to the table subreport // this is done for consistency with subdataset runs if (!parameterValues.containsKey(JRParameter.REPORT_CONNECTION) && getConnectionExpression() == null) { JRQuery query = tableReport.getQuery(); if (query != null) { String language = query.getLanguage(); if (language.equals("sql") || language.equals("SQL")) { Connection connection = (Connection) filler.getParameterValuesMap().get( JRParameter.REPORT_CONNECTION); if (connection != null) { parameterValues.put(JRParameter.REPORT_CONNECTION, connection); } } } } } protected void copyResourceBundleParameter(Map parameterValues) { // copy the main report's resource bundle if the subdataset has no // resource bundle of its own if (!parameterValues.containsKey(JRParameter.REPORT_RESOURCE_BUNDLE) && tableReport.getResourceBundle() == null) { ResourceBundle resourceBundle = (ResourceBundle) filler.getParameterValuesMap().get( JRParameter.REPORT_RESOURCE_BUNDLE); if (resourceBundle != null) { parameterValues.put(JRParameter.REPORT_RESOURCE_BUNDLE, resourceBundle); } } } protected void copyTemplatesParameter(Map parameterValues) { // copy the main report's templates List templates = filler.getTemplates(); parameterValues.put(JRParameter.REPORT_TEMPLATES, templates); } protected FillPrepareResult prepareSubreport(int availableHeight, boolean isOverflow) throws JRException { boolean willOverflow = prepare(availableHeight, isOverflow); return FillPrepareResult.printStretch(getStretchHeight(), willOverflow); } @Override protected Collection getPrintElements() { // overriding this for package access return super.getPrintElements(); } @Override protected int getContentsStretchHeight() { // overriding this for package access return super.getContentsStretchHeight(); } protected List getSubreportStyles() { return subreportFiller.getJasperPrint().getStylesList(); } protected List getSubreportOrigins() { return subreportFiller.getJasperPrint().getOriginsList(); } @Override protected void cancelSubreportFill() throws JRException { // overriding this for package access super.cancelSubreportFill(); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/DatasetCloneObjectFactory.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/fill/DatasetCloneObjectFactory.ja0000644000175000017500000000367511632162655033732 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.fill; import net.sf.jasperreports.engine.JRDataset; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JRExpressionCollector; import net.sf.jasperreports.engine.base.JRBaseObjectFactory; /** * Object factory used to clone a report dataset. * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: DatasetCloneObjectFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class DatasetCloneObjectFactory extends JRBaseObjectFactory { public static JRDataset cloneDataset(JRDataset dataset) { DatasetCloneObjectFactory factory = new DatasetCloneObjectFactory(); return factory.getDataset(dataset); } public DatasetCloneObjectFactory() { super((JRExpressionCollector) null); } @Override public JRExpression getExpression(JRExpression expression, boolean assignNotUsedId) { // same expression objects are used in the cloned dataset return expression; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/util/0000755000175000017500000000000011654071732026404 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/util/TableUtil.java0000644000175000017500000001751611632162655031147 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table.util; import java.awt.Rectangle; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.Map; 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.TableComponent; import net.sf.jasperreports.engine.JRDataset; import net.sf.jasperreports.engine.JRDatasetRun; import net.sf.jasperreports.engine.JRGroup; import net.sf.jasperreports.engine.design.JasperDesign; /** * @author Veaceslav Chicu (schicu@users.sourceforge.net) * @version $Id: TableUtil.java 4595 2011-09-08 15:55:10Z teodord $ */ public class TableUtil { public static final int TABLE_HEADER = 0; public static final int TABLE_FOOTER = 1; public static final int COLUMN_HEADER = 2; public static final int COLUMN_FOOTER = 3; public static final int COLUMN_DETAIL = 4; public static final int COLUMN_GROUP_HEADER = 5; public static final int COLUMN_GROUP_FOOTER = 6; private TableComponent table; private Map boundsMap = new HashMap(); private JasperDesign jasperDesign; public TableUtil(TableComponent table, JasperDesign jasperDesign) { this.table = table; this.jasperDesign = jasperDesign; init(table); } public Map getCellBounds() { return boundsMap; } public void refresh() { init(table); } public void init(TableComponent table) { boundsMap.clear(); List allColumns = getAllColumns(table.getColumns()); int y = 0; int h = 0; Rectangle r = new Rectangle(0, 0, 0, 0); for (BaseColumn bc : table.getColumns()) { r = initHeader(r, bc, TABLE_HEADER, null); r.setLocation(r.x , y); if (h < r.height) h = r.height; } y += h; r = new Rectangle(0, y, 0, 0); h = 0; for (BaseColumn bc : table.getColumns()) { r = initHeader(r, bc, COLUMN_HEADER, null); r.setLocation(r.x, y); if (h < r.height) h = r.height; } List groupsList = getGroupList(); if (groupsList != null) for (Iterator it = groupsList.iterator(); it.hasNext();) { JRGroup jrGroup = (JRGroup) it.next(); y += h; r = new Rectangle(0, y, 0, 0); h = 0; for (BaseColumn bc : table.getColumns()) { r = initHeader(r, bc, COLUMN_GROUP_HEADER, jrGroup.getName()); r.setLocation(r.x, y); if (h < r.height) h = r.height; } } y += h; r = new Rectangle(0, y, 0, 0); h = 0; for (BaseColumn bc : allColumns) { r = initDetail(r, bc); r.setLocation(r.x, y); if (h < r.height) h = r.height; } if (groupsList != null) for (ListIterator it = groupsList.listIterator(groupsList.size()); it.hasPrevious();) { JRGroup jrGroup = (JRGroup) it.previous(); y += h; r = new Rectangle(0, y, 0, 0); h = 0; for (BaseColumn bc : table.getColumns()) { r = initFooter(r, bc, COLUMN_GROUP_FOOTER, jrGroup.getName()); r.setLocation(r.x, y); if (h < r.height) h = r.height; } } y += h; r = new Rectangle(0, y, 0, 0); h = 0; for (BaseColumn bc : table.getColumns()) { r = initFooter(r, bc, COLUMN_FOOTER, null); r.setLocation(r.x, y); if (h < r.height) h = r.height; } y += h; r = new Rectangle(0, y, 0, 0); for (BaseColumn bc : table.getColumns()) { r = initFooter(r, bc, TABLE_FOOTER, null); r.setLocation(r.x, y); } } public static List getAllColumns(TableComponent table) { return getAllColumns(table.getColumns()); } public static List getAllColumns(List cols) { List lst = new ArrayList(); for (BaseColumn bc : cols) { if (bc instanceof ColumnGroup) lst.addAll(getAllColumns(((ColumnGroup) bc).getColumns())); else lst.add(bc); } return lst; } private Rectangle initDetail(Rectangle p, BaseColumn bc) { int h = 0; int w = 0; if (bc != null && bc instanceof Column) { Cell c = ((Column) bc).getDetailCell(); w = bc.getWidth(); if (c != null) h = c.getHeight(); boundsMap.put(c, new Rectangle(p.x, p.y, w, h)); } return new Rectangle(p.x + w, p.y, w, h); } private Rectangle initHeader(Rectangle p, BaseColumn bc, int type, String grName) { int y = p.y; int h = 0; int w = bc.getWidth(); Cell c = getCell(bc, type, grName); if (c != null) { y = p.y + c.getHeight(); h = c.getHeight(); boundsMap.put(c, new Rectangle(p.x, p.y, w, h)); } if (bc instanceof ColumnGroup) { Rectangle pi = new Rectangle(p.x, y, w, h); int hi = 0; for (BaseColumn bcg : ((ColumnGroup) bc).getColumns()) { pi = initHeader(pi, bcg, type, grName); pi.setLocation(pi.x, y); if (hi < pi.height) hi = pi.height; } h += hi; } return new Rectangle(p.x + w, y, w, h); } private Rectangle initFooter(Rectangle p, BaseColumn bc, int type, String grName) { int y = p.y; int h = 0; int w = bc.getWidth(); Cell c = getCell(bc, type, grName); if (bc instanceof ColumnGroup) { Rectangle pi = new Rectangle(p.x, y, w, h); int hi = 0; for (BaseColumn bcg : ((ColumnGroup) bc).getColumns()) { pi = initFooter(pi, bcg, type, grName); pi.setLocation(pi.x, y); if (hi < pi.height) hi = pi.height; } h += hi; } if (c != null) { y = p.y + h; h = c.getHeight(); boundsMap.put(c, new Rectangle(p.x, y, w, h)); } return new Rectangle(p.x + w, y, w, h); } public Rectangle getBounds(int width, Cell cell, BaseColumn col) { Rectangle b = boundsMap.get(cell); if (b != null) return b; int w = col != null ? col.getWidth() : 0; int h = cell != null ? cell.getHeight() : 0; return new Rectangle(0, 0, w, h); } public List getGroupList() { return getGroupList(table, jasperDesign); } public static List getGroupList(TableComponent table, JasperDesign jd) { List groupsList = null; JRDatasetRun datasetRun = table.getDatasetRun(); if (datasetRun != null) { String dataSetName = datasetRun.getDatasetName(); JRDataset ds = jd.getDatasetMap().get(dataSetName); groupsList = (ds != null ? Arrays.asList(ds.getGroups()) : null); } return groupsList; } public static Cell getCell(BaseColumn bc, int type, String grName) { Cell cell = null; switch (type) { case TABLE_HEADER: cell = bc.getTableHeader(); break; case TABLE_FOOTER: cell = bc.getTableFooter(); break; case COLUMN_HEADER: cell = bc.getColumnHeader(); break; case COLUMN_FOOTER: cell = bc.getColumnFooter(); break; case COLUMN_DETAIL: if (bc instanceof Column) cell = ((Column) bc).getDetailCell(); break; case COLUMN_GROUP_HEADER: cell = bc.getGroupHeader(grName); break; case COLUMN_GROUP_FOOTER: cell = bc.getGroupFooter(grName); break; } return cell; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/Cell.java0000644000175000017500000000256311632162655027160 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import net.sf.jasperreports.engine.JRBoxContainer; import net.sf.jasperreports.engine.JRElementGroup; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: Cell.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface Cell extends JRElementGroup, JRBoxContainer { Integer getHeight(); Integer getRowSpan(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/CompiledCell.java0000644000175000017500000000542111632162655030631 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import java.awt.Color; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.JRDefaultStyleProvider; import net.sf.jasperreports.engine.JRLineBox; import net.sf.jasperreports.engine.JRStyle; import net.sf.jasperreports.engine.base.JRBaseElementGroup; import net.sf.jasperreports.engine.base.JRBaseLineBox; import net.sf.jasperreports.engine.base.JRBaseObjectFactory; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: CompiledCell.java 4595 2011-09-08 15:55:10Z teodord $ */ public class CompiledCell extends JRBaseElementGroup implements Cell { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private JRDefaultStyleProvider defaultStyleProvider; protected JRStyle style; protected String styleNameReference; private JRLineBox box; private Integer rowSpan; private Integer height; public CompiledCell() { super(); box = new JRBaseLineBox(this); } public CompiledCell(Cell cell, JRBaseObjectFactory factory) { super(cell, factory); this.defaultStyleProvider = factory.getDefaultStyleProvider(); this.style = factory.getStyle(cell.getStyle()); this.styleNameReference = cell.getStyleNameReference(); this.box = cell.getLineBox().clone(this); this.rowSpan = cell.getRowSpan(); this.height = cell.getHeight(); } public Integer getHeight() { return height; } public Color getDefaultLineColor() { return Color.BLACK; } public JRLineBox getLineBox() { return box; } public JRDefaultStyleProvider getDefaultStyleProvider() { return defaultStyleProvider; } public JRStyle getStyle() { return style; } public String getStyleNameReference() { return styleNameReference; } public Integer getRowSpan() { return rowSpan; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/TableReportContextXmlRule.java0000644000175000017500000000605711632162655033404 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import net.sf.jasperreports.engine.JRDatasetRun; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.xml.JRXmlLoader; import net.sf.jasperreports.engine.xml.XmlLoaderReportContext; import org.apache.commons.digester.Rule; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.xml.sax.Attributes; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: TableReportContextXmlRule.java 4595 2011-09-08 15:55:10Z teodord $ */ public class TableReportContextXmlRule extends Rule { private static final Log log = LogFactory.getLog(TableReportContextXmlRule.class); @Override public void begin(String namespace, String name, Attributes attributes) throws Exception { JRXmlLoader xmlLoader = getXmlLoader(); TableComponent table = getTableComponent(); JRDatasetRun datasetRun = table.getDatasetRun(); String datasetName = datasetRun == null ? null : datasetRun.getDatasetName(); if (log.isDebugEnabled()) { log.debug("Pushing report context for dataset name " + datasetName); } XmlLoaderReportContext reportContext = new XmlLoaderReportContext(datasetName); xmlLoader.pushReportContext(reportContext); } @Override public void end(String namespace, String name) throws Exception { JRXmlLoader xmlLoader = getXmlLoader(); if (log.isDebugEnabled()) { log.debug("Popping report context"); } xmlLoader.popReportContext(); } protected JRXmlLoader getXmlLoader() { return (JRXmlLoader) digester.peek(digester.getCount() - 1); } protected TableComponent getTableComponent() { TableComponent table = null; int stackCount = digester.getCount(); for (int idx = 0; idx < stackCount; ++idx) { Object stackObject = digester.peek(idx); if (stackObject instanceof TableComponent) { table = (TableComponent) stackObject; break; } } if (table == null) { throw new JRRuntimeException("Could not locate TableComponent object on the digester stack"); } return table; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/StandardBaseColumn.java0000644000175000017500000002326211632162655032011 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.ListIterator; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; import net.sf.jasperreports.engine.util.JRCloneUtils; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: StandardBaseColumn.java 4595 2011-09-08 15:55:10Z teodord $ */ public abstract class StandardBaseColumn implements BaseColumn, Serializable, JRChangeEventsSupport { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_PRINT_WHEN_EXPRESSION = "printWhenExpression"; public static final String PROPERTY_TABLE_HEADER = "tableHeader"; public static final String PROPERTY_TABLE_FOOTER = "tableFooter"; public static final String PROPERTY_COLUMN_HEADER = "columnHeader"; public static final String PROPERTY_COLUMN_FOOTER = "columnFooter"; public static final String PROPERTY_GROUP_HEADERS = "groupHeaders"; public static final String PROPERTY_GROUP_FOOTERS = "groupFooters"; public static final String PROPERTY_WIDTH = "width"; private JRExpression printWhenExpression; private Cell tableHeader; private Cell tableFooter; private List groupHeaders; private List groupFooters; private Cell columnHeader; private Cell columnFooter; private Integer width; public StandardBaseColumn() { groupHeaders = new ArrayList(); groupFooters = new ArrayList(); } public StandardBaseColumn(BaseColumn column, ColumnFactory factory) { this.printWhenExpression = factory.getBaseObjectFactory().getExpression( column.getPrintWhenExpression()); this.tableHeader = factory.createCell(column.getTableHeader()); this.tableFooter = factory.createCell(column.getTableFooter()); this.groupHeaders = factory.createGroupCells(column.getGroupHeaders()); this.groupFooters = factory.createGroupCells(column.getGroupFooters()); this.columnHeader = factory.createCell(column.getColumnHeader()); this.columnFooter = factory.createCell(column.getColumnFooter()); this.width = column.getWidth(); } public Cell getColumnHeader() { return columnHeader; } public Cell getColumnFooter() { return columnFooter; } public JRExpression getPrintWhenExpression() { return printWhenExpression; } public void setPrintWhenExpression(JRExpression printWhenExpression) { Object old = this.printWhenExpression; this.printWhenExpression = printWhenExpression; getEventSupport().firePropertyChange(PROPERTY_PRINT_WHEN_EXPRESSION, old, this.printWhenExpression); } public void setColumnHeader(Cell header) { Object old = this.columnHeader; this.columnHeader = header; getEventSupport().firePropertyChange(PROPERTY_COLUMN_HEADER, old, this.columnHeader); } public void setColumnFooter(Cell header) { Object old = this.columnFooter; this.columnFooter = header; getEventSupport().firePropertyChange(PROPERTY_COLUMN_FOOTER, old, this.columnFooter); } public Object clone() { StandardBaseColumn clone = null; try { clone = (StandardBaseColumn) super.clone(); } catch (CloneNotSupportedException e) { // never throw new JRRuntimeException(e); } clone.tableHeader = JRCloneUtils.nullSafeClone(tableHeader); clone.tableFooter = JRCloneUtils.nullSafeClone(tableFooter); clone.groupHeaders = JRCloneUtils.cloneList(groupHeaders); clone.groupFooters = JRCloneUtils.cloneList(groupFooters); clone.columnHeader = JRCloneUtils.nullSafeClone(columnHeader); clone.columnFooter = JRCloneUtils.nullSafeClone(columnFooter); clone.printWhenExpression = JRCloneUtils.nullSafeClone(printWhenExpression); clone.eventSupport = null; return clone; } public Cell getTableHeader() { return tableHeader; } public void setTableHeader(Cell tableHeader) { Object old = this.tableHeader; this.tableHeader = tableHeader; getEventSupport().firePropertyChange(PROPERTY_TABLE_HEADER, old, this.tableHeader); } public Cell getTableFooter() { return tableFooter; } public void setTableFooter(Cell tableFooter) { Object old = this.tableFooter; this.tableFooter = tableFooter; getEventSupport().firePropertyChange(PROPERTY_TABLE_FOOTER, old, this.tableFooter); } public Integer getWidth() { return width; } public void setWidth(Integer width) { Object old = this.width; this.width = width; getEventSupport().firePropertyChange(PROPERTY_WIDTH, old, this.width); } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } public List getGroupHeaders() { return groupHeaders; } public List getGroupFooters() { return groupFooters; } protected int findGroupCellIndex(List groupCells, String groupName) { int idx = -1; for (ListIterator it = groupCells.listIterator(); it.hasNext();) { GroupCell groupCell = it.next(); if (groupName.equals(groupCell.getGroupName())) { idx = it.previousIndex(); } } return idx; } public Cell getGroupFooter(String groupName) { int idx = findGroupCellIndex(groupFooters, groupName); return idx < 0 ? null : groupFooters.get(idx).getCell(); } public Cell getGroupHeader(String groupName) { int idx = findGroupCellIndex(groupHeaders, groupName); return idx < 0 ? null : groupHeaders.get(idx).getCell(); } public void setGroupHeaders(List groupHeaders) { Object old = this.groupHeaders; this.groupHeaders = groupHeaders; getEventSupport().firePropertyChange(PROPERTY_GROUP_HEADERS, old, this.groupHeaders); } public void setGroupFooters(List groupFooters) { Object old = this.groupFooters; this.groupFooters = groupFooters; getEventSupport().firePropertyChange(PROPERTY_GROUP_FOOTERS, old, this.groupFooters); } public void addGroupHeader(GroupCell groupCell) { groupHeaders.add(groupCell); getEventSupport().fireCollectionElementAddedEvent(PROPERTY_GROUP_HEADERS, groupCell, groupHeaders.size() - 1); } public void addGroupFooter(GroupCell groupCell) { groupFooters.add(groupCell); getEventSupport().fireCollectionElementAddedEvent(PROPERTY_GROUP_FOOTERS, groupCell, groupFooters.size() - 1); } public boolean removeGroupFooter(GroupCell groupCell) { int idx = groupFooters.indexOf(groupCell); if (idx >= 0) { groupFooters.remove(idx); getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_GROUP_FOOTERS, groupCell, idx); } return idx >= 0; } public boolean removeGroupHeader(GroupCell groupCell) { int idx = groupHeaders.indexOf(groupCell); if (idx >= 0) { groupHeaders.remove(idx); getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_GROUP_HEADERS, groupCell, idx); } return idx >= 0; } public void setGroupFooter(String groupName, Cell cell) { int idx = findGroupCellIndex(groupFooters, groupName); if (idx >= 0) { GroupCell old = groupFooters.get(idx); if (cell == null) { // removing group footer groupFooters.remove(idx); getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_GROUP_FOOTERS, old, idx); } else { // replacing group footer StandardGroupCell groupCell = new StandardGroupCell(groupName, cell); groupFooters.set(idx, groupCell); getEventSupport().fireIndexedPropertyChange(PROPERTY_GROUP_FOOTERS, idx, old, groupCell); } } else if (cell != null) { // adding group footer StandardGroupCell groupCell = new StandardGroupCell(groupName, cell); addGroupFooter(groupCell); } } public void setGroupHeader(String groupName, Cell cell) { int idx = findGroupCellIndex(groupHeaders, groupName); if (idx >= 0) { GroupCell old = groupHeaders.get(idx); if (cell == null) { // removing group header groupHeaders.remove(idx); getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_GROUP_HEADERS, old, idx); } else { // replacing group header StandardGroupCell groupCell = new StandardGroupCell(groupName, cell); groupHeaders.set(idx, groupCell); getEventSupport().fireIndexedPropertyChange(PROPERTY_GROUP_HEADERS, idx, old, groupCell); } } else if (cell != null) { // adding group header StandardGroupCell groupCell = new StandardGroupCell(groupName, cell); addGroupHeader(groupCell); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/table/StandardColumn.java0000644000175000017500000000440011632162655031207 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.table; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.util.JRCloneUtils; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: StandardColumn.java 4595 2011-09-08 15:55:10Z teodord $ */ public class StandardColumn extends StandardBaseColumn implements Column { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_DETAIL = "detail"; private Cell detail; public StandardColumn() { } public StandardColumn(Column column, ColumnFactory factory) { super(column, factory); Cell columnCell = column.getDetailCell(); if (columnCell != null) { this.detail = new CompiledCell(columnCell, factory.getBaseObjectFactory()); } } public Cell getDetailCell() { return detail; } public void setDetailCell(Cell detail) { Object old = this.detail; this.detail = detail; getEventSupport().firePropertyChange(PROPERTY_DETAIL, old, this.detail); } public R visitColumn(ColumnVisitor visitor) { return visitor.visitColumn(this); } @Override public Object clone() { StandardColumn clone = (StandardColumn) super.clone(); clone.detail = JRCloneUtils.nullSafeClone(detail); return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/0000755000175000017500000000000011654071732026650 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderDatasetXmlFactory.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderDatasetXmlFactory.jav0000644000175000017500000000273411632162655034126 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import net.sf.jasperreports.engine.xml.JRBaseFactory; import org.xml.sax.Attributes; /** * * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: SpiderDatasetXmlFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SpiderDatasetXmlFactory extends JRBaseFactory { public Object createObject(Attributes attrs) throws Exception { StandardSpiderDataset dataset = new StandardSpiderDataset(); return dataset; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderPlot.java0000644000175000017500000000421211632162655031600 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import java.awt.Color; import net.sf.jasperreports.components.charts.ChartPlot; import net.sf.jasperreports.components.spiderchart.type.SpiderRotationEnum; import net.sf.jasperreports.components.spiderchart.type.TableOrderEnum; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JRFont; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: SpiderPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface SpiderPlot extends ChartPlot { /** * */ public JRExpression getMaxValueExpression(); /** * */ public JRFont getLabelFont(); /** * */ public SpiderRotationEnum getRotation(); /** * */ public TableOrderEnum getTableOrder(); /** * */ public Boolean getWebFilled(); /** * */ public Double getStartAngle(); /** * */ public Double getHeadPercent(); /** * */ public Double getInteriorGap(); /** * */ public Color getAxisLineColor(); /** * */ public Float getAxisLineWidth(); /** * */ public Double getLabelGap(); /** * */ public Color getLabelColor(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderChartComponent.java0000644000175000017500000001301311632162655033605 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import net.sf.jasperreports.components.charts.ChartComponent; import net.sf.jasperreports.components.charts.ChartDataset; import net.sf.jasperreports.components.charts.ChartPlot; import net.sf.jasperreports.components.charts.ChartSettings; import net.sf.jasperreports.engine.JRCloneable; 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.util.JRCloneUtils; /** * * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: SpiderChartComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SpiderChartComponent implements ChartComponent, JRChangeEventsSupport, JRCloneable { private static final long serialVersionUID = 1L; public static final String PROPERTY_CHART_SETTINGS = "chartSettings"; public static final String PROPERTY_DATASET = "dataset"; public static final String PROPERTY_PLOT = "plot"; public static final String PROPERTY_EVALUATION_TIME = "evaluationTime"; public static final String PROPERTY_EVALUATION_GROUP = "evaluationGroup"; private EvaluationTimeEnum evaluationTime = EvaluationTimeEnum.NOW; private String evaluationGroup; private ChartSettings chartSettings; private SpiderDataset dataset; private SpiderPlot plot; public SpiderChartComponent() { } protected SpiderChartComponent(SpiderChartComponent chartComponent, JRBaseObjectFactory baseFactory) { this.evaluationTime = chartComponent.getEvaluationTime(); this.evaluationGroup = chartComponent.getEvaluationGroup(); this.chartSettings = new StandardChartSettings(chartComponent.getChartSettings(), baseFactory);//FIXMENOW check use of constructor here this.dataset = new StandardSpiderDataset((SpiderDataset)chartComponent.getDataset(), baseFactory); this.plot = new StandardSpiderPlot((SpiderPlot)chartComponent.getPlot(), baseFactory); } /** * @return the chart */ public ChartSettings getChartSettings() { return chartSettings; } /** * @param chartSettings the chart to set */ public void setChartSettings(ChartSettings chartSettings) { Object old = this.chartSettings; this.chartSettings = chartSettings; getEventSupport().firePropertyChange(PROPERTY_CHART_SETTINGS, old, this.chartSettings); } /** * @return the dataset */ public ChartDataset getDataset() { return this.dataset; } /** * @return the plot */ public ChartPlot getPlot() { return this.plot; } public void setDataset(ChartDataset dataset) { Object old = this.dataset; this.dataset = (SpiderDataset)dataset; getEventSupport().firePropertyChange(PROPERTY_DATASET, old, this.dataset); } public void setPlot(ChartPlot plot) { Object old = this.plot; this.plot = (SpiderPlot)plot; getEventSupport().firePropertyChange(PROPERTY_PLOT, old, this.plot); } /** * @return the evaluationTime */ public EvaluationTimeEnum getEvaluationTime() { return evaluationTime; } /** * @param evaluationTime the evaluationTime to set */ public void setEvaluationTime(EvaluationTimeEnum evaluationTime) { Object old = this.evaluationTime; this.evaluationTime = evaluationTime; getEventSupport().firePropertyChange(PROPERTY_EVALUATION_TIME, old, this.evaluationTime); } /** * @return the evaluationGroup */ public String getEvaluationGroup() { return evaluationGroup; } /** * @param evaluationGroup the evaluationGroup to set */ public void setEvaluationGroup(String evaluationGroup) { Object old = this.evaluationGroup; this.evaluationGroup = evaluationGroup; getEventSupport().firePropertyChange(PROPERTY_EVALUATION_GROUP, old, this.evaluationGroup); } /** * */ public Object clone() { SpiderChartComponent clone = null; try { clone = (SpiderChartComponent)super.clone(); } catch (CloneNotSupportedException e) { throw new JRRuntimeException(e); } clone.chartSettings = JRCloneUtils.nullSafeClone(chartSettings); clone.dataset = JRCloneUtils.nullSafeClone(dataset); clone.plot = JRCloneUtils.nullSafeClone(plot); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderChartCompiler.java0000644000175000017500000001443111632162655033422 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import net.sf.jasperreports.charts.JRCategorySeries; import net.sf.jasperreports.components.charts.ChartSettings; import net.sf.jasperreports.engine.JRExpressionCollector; import net.sf.jasperreports.engine.JRHyperlinkParameter; 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.design.JasperDesign; import net.sf.jasperreports.engine.type.EvaluationTimeEnum; /** * * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: SpiderChartCompiler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SpiderChartCompiler implements ComponentCompiler { public void collectExpressions(Component component, JRExpressionCollector collector) { SpiderChartComponent chart = (SpiderChartComponent) component; collectExpressions(chart.getChartSettings(), collector); collectExpressions((SpiderDataset)chart.getDataset(), collector); collectExpressions((SpiderPlot)chart.getPlot(), collector); } public static void collectExpressions(SpiderDataset dataset, JRExpressionCollector collector) { if(dataset != null) { collector.collect(dataset); JRCategorySeries[] categorySeries = dataset.getSeries(); if (categorySeries != null && categorySeries.length > 0) { JRExpressionCollector seriesCollector = collector.getCollector(dataset); for(int j = 0; j < categorySeries.length; j++) { seriesCollector.addExpression(categorySeries[j].getSeriesExpression()); seriesCollector.addExpression(categorySeries[j].getCategoryExpression()); seriesCollector.addExpression(categorySeries[j].getValueExpression()); seriesCollector.addExpression(categorySeries[j].getLabelExpression()); seriesCollector.collectHyperlink(categorySeries[j].getItemHyperlink()); } } } } public static void collectExpressions(SpiderPlot spiderPlot, JRExpressionCollector collector) { if(spiderPlot != null) { collector.addExpression(spiderPlot.getMaxValueExpression()); } } public static void collectExpressions(ChartSettings chart, JRExpressionCollector collector) { if(chart != null) { collector.addExpression(chart.getTitleExpression()); collector.addExpression(chart.getSubtitleExpression()); collector.addExpression(chart.getAnchorNameExpression()); collector.addExpression(chart.getHyperlinkReferenceExpression()); collector.addExpression(chart.getHyperlinkAnchorExpression()); collector.addExpression(chart.getHyperlinkPageExpression()); collector.addExpression(chart.getHyperlinkTooltipExpression()); JRHyperlinkParameter[] hyperlinkParameters = chart.getHyperlinkParameters(); if (hyperlinkParameters != null) { for (int i = 0; i < hyperlinkParameters.length; i++) { JRHyperlinkParameter parameter = hyperlinkParameters[i]; if (parameter != null) { collector.addExpression(parameter.getValueExpression()); } } } } } public void verify(Component component, JRVerifier verifier) { SpiderChartComponent chartComponent = (SpiderChartComponent) component; verifyEvaluation(verifier, chartComponent); ChartSettings chartSettings = chartComponent.getChartSettings(); if (chartSettings == null) { verifier.addBrokenRule("No chart settings for spider chart", chartComponent); } SpiderDataset dataset = (SpiderDataset)chartComponent.getDataset(); if (dataset == null) { verifier.addBrokenRule("No dataset for spider chart", chartComponent); } else { verify(verifier, dataset); } SpiderPlot spiderPlot = (SpiderPlot)chartComponent.getPlot(); if (dataset == null) { verifier.addBrokenRule("No plot set for spider chart", chartComponent); } else { verify(verifier, spiderPlot); } } protected void verifyEvaluation(JRVerifier verifier, SpiderChartComponent chart) { EvaluationTimeEnum evaluationTime = chart.getEvaluationTime(); if (evaluationTime == EvaluationTimeEnum.AUTO) { verifier.addBrokenRule("Spider chart evaluation time cannot be Auto", chart); } else if (evaluationTime == EvaluationTimeEnum.GROUP) { String groupName = chart.getEvaluationGroup(); if (groupName == null) { verifier.addBrokenRule("Evaluation group not set for spider chart", chart); } else { JasperDesign report = verifier.getReportDesign(); if (!report.getGroupsMap().containsKey(groupName)) { verifier.addBrokenRule("Spider chart evaluation group " + groupName + " not found in report", chart); } } } } protected void verify(JRVerifier verifier, SpiderDataset dataset) { verifier.verifyElementDataset(dataset); JRCategorySeries[] series = dataset.getSeries(); if (series != null) { for (int i = 0; i < series.length; i++) { verifier.verifyHyperlink(series[i].getItemHyperlink()); } } } protected void verify(JRVerifier verifier, SpiderPlot spiderPlot) { } public Component toCompiledComponent(Component component, JRBaseObjectFactory baseFactory) { SpiderChartComponent chart = (SpiderChartComponent) component; SpiderChartComponent compiledChart = new SpiderChartComponent(chart, baseFactory); return compiledChart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderDataset.java0000644000175000017500000000257011632162655032254 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import net.sf.jasperreports.charts.JRCategorySeries; import net.sf.jasperreports.components.charts.ChartDataset; /** * * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: SpiderDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface SpiderDataset extends ChartDataset { public JRCategorySeries[] getSeries(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderChartDigester.java0000644000175000017500000001745311632162655033425 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import net.sf.jasperreports.charts.design.JRDesignCategorySeries; import net.sf.jasperreports.charts.xml.JRCategorySeriesFactory; import net.sf.jasperreports.components.charts.ChartSettings; import net.sf.jasperreports.components.charts.ChartSettingsXmlFactory; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JRFont; import net.sf.jasperreports.engine.component.XmlDigesterConfigurer; import net.sf.jasperreports.engine.design.JRDesignExpression; import net.sf.jasperreports.engine.xml.JRElementDatasetFactory; import net.sf.jasperreports.engine.xml.JRExpressionFactory; import net.sf.jasperreports.engine.xml.JRFontFactory; import net.sf.jasperreports.engine.xml.JRXmlConstants; import org.apache.commons.digester.Digester; /** * * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: SpiderChartDigester.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SpiderChartDigester implements XmlDigesterConfigurer { public void configureDigester(Digester digester) { addSpiderChartRules(digester); } public static void addSpiderChartRules(Digester digester) { String componentNamespace = digester.getRuleNamespaceURI(); String jrNamespace = JRXmlConstants.JASPERREPORTS_NAMESPACE; String spiderChartPattern = "*/componentElement/spiderChart"; digester.addFactoryCreate(spiderChartPattern, SpiderChartXmlFactory.class.getName()); String chartSettingsPattern = spiderChartPattern + "/chartSettings"; digester.addFactoryCreate(chartSettingsPattern, ChartSettingsXmlFactory.class.getName()); digester.addSetNext(chartSettingsPattern, "setChartSettings", ChartSettings.class.getName()); digester.setRuleNamespaceURI(jrNamespace); String chartTitlePattern = chartSettingsPattern + "/chartTitle"; digester.addFactoryCreate(chartTitlePattern, ChartSettingsXmlFactory.ChartTitleFactory.class.getName()); digester.addFactoryCreate(chartTitlePattern + "/font", JRFontFactory.ChartFontFactory.class.getName()); digester.addSetNext(chartTitlePattern + "/font", "setTitleFont", JRFont.class.getName()); digester.addFactoryCreate(chartTitlePattern + "/titleExpression", JRExpressionFactory.StringExpressionFactory.class); digester.addSetNext(chartTitlePattern + "/titleExpression", "setTitleExpression", JRDesignExpression.class.getName()); digester.addCallMethod(chartTitlePattern + "/titleExpression", "setText", 0); String chartSubtitlePattern = chartSettingsPattern + "/chartSubtitle"; digester.addFactoryCreate(chartSubtitlePattern, ChartSettingsXmlFactory.ChartSubtitleFactory.class.getName()); digester.addFactoryCreate(chartSubtitlePattern + "/font", JRFontFactory.ChartFontFactory.class.getName()); digester.addSetNext(chartSubtitlePattern + "/font", "setSubtitleFont", JRFont.class.getName()); digester.addFactoryCreate(chartSubtitlePattern + "/subtitleExpression", JRExpressionFactory.StringExpressionFactory.class); digester.addSetNext(chartSubtitlePattern + "/subtitleExpression", "setSubtitleExpression", JRDesignExpression.class.getName()); digester.addCallMethod(chartSubtitlePattern + "/subtitleExpression", "setText", 0); digester.addFactoryCreate(chartSettingsPattern + "/chartLegend", ChartSettingsXmlFactory.ChartLegendFactory.class.getName()); digester.addFactoryCreate(chartSettingsPattern + "/chartLegend/font", JRFontFactory.ChartFontFactory.class.getName()); digester.addSetNext(chartSettingsPattern + "/chartLegend/font", "setLegendFont", JRFont.class.getName()); digester.setRuleNamespaceURI(componentNamespace); String spiderDatasetPattern = spiderChartPattern + "/spiderDataset"; digester.addFactoryCreate(spiderDatasetPattern, SpiderDatasetXmlFactory.class.getName()); digester.addSetNext(spiderDatasetPattern, "setDataset", SpiderDataset.class.getName()); digester.setRuleNamespaceURI(jrNamespace); String datasetPattern = spiderDatasetPattern + "/dataset"; digester.addFactoryCreate(datasetPattern, JRElementDatasetFactory.class.getName()); String datasetIncrementWhenExpressionPath = datasetPattern + JRXmlConstants.ELEMENT_incrementWhenExpression; digester.addFactoryCreate(datasetIncrementWhenExpressionPath, JRExpressionFactory.BooleanExpressionFactory.class.getName()); digester.addSetNext(datasetIncrementWhenExpressionPath, "setIncrementWhenExpression", JRExpression.class.getName()); digester.addCallMethod(datasetIncrementWhenExpressionPath, "setText", 0); String seriesPattern = spiderDatasetPattern + "/categorySeries"; digester.addFactoryCreate(seriesPattern, JRCategorySeriesFactory.class.getName()); digester.addSetNext(seriesPattern, "addCategorySeries", JRDesignCategorySeries.class.getName()); digester.addFactoryCreate(seriesPattern + "/seriesExpression", JRExpressionFactory.ComparableExpressionFactory.class); digester.addSetNext(seriesPattern + "/seriesExpression", "setSeriesExpression", JRDesignExpression.class.getName()); digester.addCallMethod(seriesPattern + "/seriesExpression", "setText", 0); digester.addFactoryCreate(seriesPattern + "/categoryExpression", JRExpressionFactory.ComparableExpressionFactory.class); digester.addSetNext(seriesPattern + "/categoryExpression", "setCategoryExpression", JRDesignExpression.class.getName()); digester.addCallMethod(seriesPattern + "/categoryExpression", "setText", 0); digester.addFactoryCreate(seriesPattern + "/labelExpression", JRExpressionFactory.StringExpressionFactory.class); digester.addSetNext(seriesPattern + "/labelExpression", "setLabelExpression", JRDesignExpression.class.getName()); digester.addCallMethod(seriesPattern + "/labelExpression", "setText", 0); digester.addFactoryCreate(seriesPattern + "/valueExpression", JRExpressionFactory.NumberExpressionFactory.class); digester.addSetNext(seriesPattern + "/valueExpression", "setValueExpression", JRDesignExpression.class.getName()); digester.addCallMethod(seriesPattern + "/valueExpression", "setText", 0); digester.setRuleNamespaceURI(componentNamespace); String plotPattern = spiderChartPattern + "/spiderPlot"; digester.addFactoryCreate(plotPattern, SpiderPlotXmlFactory.class.getName()); digester.addSetNext(plotPattern, "setPlot", SpiderPlot.class.getName()); digester.setRuleNamespaceURI(jrNamespace); String labelFontPattern = plotPattern + "/labelFont/font"; digester.addFactoryCreate(labelFontPattern, JRFontFactory.ChartFontFactory.class.getName()); digester.addSetNext(labelFontPattern, "setLabelFont", JRFont.class.getName()); digester.setRuleNamespaceURI(componentNamespace); String maxValueExpressionPattern = plotPattern + "/maxValueExpression"; digester.addFactoryCreate(maxValueExpressionPattern, JRExpressionFactory.DoubleExpressionFactory.class); digester.addSetNext(maxValueExpressionPattern, "setMaxValueExpression", JRDesignExpression.class.getName() ); digester.addCallMethod(maxValueExpressionPattern, "setText", 0 ); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/FillSpiderPlot.java0000644000175000017500000000716511632162655032421 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import java.awt.Color; import net.sf.jasperreports.components.spiderchart.type.SpiderRotationEnum; import net.sf.jasperreports.components.spiderchart.type.TableOrderEnum; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JRFont; import net.sf.jasperreports.engine.fill.JRFillObjectFactory; import org.jfree.chart.plot.PlotOrientation; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: FillSpiderPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class FillSpiderPlot implements SpiderPlot { /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; /** * */ protected SpiderPlot parent; /** * */ public FillSpiderPlot( SpiderPlot spiderPlot, JRFillObjectFactory factory ) { factory.put(spiderPlot, this); parent = spiderPlot; } /** * @return the labelFont */ public JRFont getLabelFont() { return parent.getLabelFont(); } /** * @return the maxValueExpression */ public JRExpression getMaxValueExpression() { return parent.getMaxValueExpression(); } /** * @return the rotation */ public SpiderRotationEnum getRotation() { return parent.getRotation(); } /** * @return the tableOrder */ public TableOrderEnum getTableOrder() { return parent.getTableOrder(); } /** * @return the webFilled */ public Boolean getWebFilled() { return parent.getWebFilled(); } /** * @return the startAngle */ public Double getStartAngle() { return parent.getStartAngle(); } /** * @return the headPercent */ public Double getHeadPercent() { return parent.getHeadPercent(); } /** * @return the interiorGap */ public Double getInteriorGap() { return parent.getInteriorGap(); } /** * @return the axisLineColor */ public Color getAxisLineColor() { return parent.getAxisLineColor(); } /** * @return the axisLineWidth */ public Float getAxisLineWidth() { return parent.getAxisLineWidth(); } /** * @return the labelGap */ public Double getLabelGap() { return parent.getLabelGap(); } /** * @return the labelColor */ public Color getLabelColor() { return parent.getLabelColor(); } public Color getBackcolor() { return parent.getBackcolor(); } public Float getBackgroundAlpha() { return parent.getBackgroundAlpha(); } public Float getForegroundAlpha() { return parent.getForegroundAlpha(); } public PlotOrientation getOrientation() { return parent.getOrientation(); } /** * */ public Object clone() { throw new UnsupportedOperationException(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/StandardSpiderPlot.java0000644000175000017500000002373211632162655033271 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import java.awt.Color; import net.sf.jasperreports.components.spiderchart.type.SpiderRotationEnum; import net.sf.jasperreports.components.spiderchart.type.TableOrderEnum; 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.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 org.jfree.chart.plot.PlotOrientation; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: StandardSpiderPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class StandardSpiderPlot implements SpiderPlot, JRChangeEventsSupport { /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_LABEL_FONT = "labelFont"; public static final String PROPERTY_MAX_VALUE_EXPRESSION = "maxValueExpression"; public static final String PROPERTY_ROTATION = "rotation"; public static final String PROPERTY_TABLE_ORDER = "tableOrder"; public static final String PROPERTY_WEB_FILLED = "webFilled"; public static final String PROPERTY_START_ANGLE = "startAngle"; public static final String PROPERTY_HEAD_PERCENT = "headPercent"; public static final String PROPERTY_INTERIOR_GAP = "interiorGap"; public static final String PROPERTY_AXIS_LINE_COLOR = "axisLineColor"; public static final String PROPERTY_AXIS_LINE_WIDTH = "axisLineWidth"; public static final String PROPERTY_LABEL_GAP = "labelGap"; public static final String PROPERTY_LABEL_COLOR = "labelColor"; public static final String PROPERTY_BACKCOLOR = "backcolor"; public static final String PROPERTY_BACKGROUND_ALPHA = "backgroundAlpha"; public static final String PROPERTY_FOREGROUND_ALPHA = "foregroundAlpha"; protected JRFont labelFont; protected JRExpression maxValueExpression; protected SpiderRotationEnum rotation; protected TableOrderEnum tableOrder; protected Boolean webFilled; protected Double startAngle; protected Double headPercent; protected Double interiorGap; protected Color axisLineColor; protected Float axisLineWidth; protected Double labelGap; protected Color labelColor; protected Color backcolor; protected Float backgroundAlpha; protected Float foregroundAlpha; /** * */ public StandardSpiderPlot() { } /** * */ public StandardSpiderPlot(SpiderPlot spiderPlot, JRBaseObjectFactory factory) { labelFont = spiderPlot.getLabelFont(); rotation = spiderPlot.getRotation(); tableOrder = spiderPlot.getTableOrder(); webFilled = spiderPlot.getWebFilled(); startAngle = spiderPlot.getStartAngle(); headPercent = spiderPlot.getHeadPercent(); interiorGap = spiderPlot.getInteriorGap(); axisLineColor = spiderPlot.getAxisLineColor(); axisLineWidth = spiderPlot.getAxisLineWidth(); labelGap = spiderPlot.getLabelGap(); labelColor = spiderPlot.getLabelColor(); backcolor = spiderPlot.getBackcolor(); backgroundAlpha = spiderPlot.getBackgroundAlpha(); foregroundAlpha = spiderPlot.getForegroundAlpha(); maxValueExpression = factory.getExpression( spiderPlot.getMaxValueExpression() ); } /** * @return the labelFont */ public JRFont getLabelFont() { return labelFont; } /** * @return the maxValueExpression */ public JRExpression getMaxValueExpression() { return maxValueExpression; } /** * @return the rotation */ public SpiderRotationEnum getRotation() { return rotation; } /** * @return the tableOrder */ public TableOrderEnum getTableOrder() { return tableOrder; } /** * @return the webFilled */ public Boolean getWebFilled() { return webFilled; } /** * @return the startAngle */ public Double getStartAngle() { return startAngle; } /** * @return the headPercent */ public Double getHeadPercent() { return headPercent; } /** * @return the interiorGap */ public Double getInteriorGap() { return interiorGap; } /** * @return the axisLineColor */ public Color getAxisLineColor() { return axisLineColor; } /** * @return the axisLineWidth */ public Float getAxisLineWidth() { return axisLineWidth; } /** * @return the labelGap */ public Double getLabelGap() { return labelGap; } /** * @return the labelColor */ public Color getLabelColor() { return labelColor; } /** * */ public void setLabelFont(JRFont labelFont) { Object old = this.labelFont; this.labelFont = labelFont; getEventSupport().firePropertyChange(PROPERTY_LABEL_FONT, old, this.labelFont); } /** * */ public void setMaxValueExpression(JRExpression maxValueExpression) { Object old = this.maxValueExpression; this.maxValueExpression = maxValueExpression; getEventSupport().firePropertyChange(PROPERTY_MAX_VALUE_EXPRESSION, old, this.maxValueExpression); } /** * */ public void setRotation(SpiderRotationEnum rotation) { Object old = this.rotation; this.rotation = rotation; getEventSupport().firePropertyChange(PROPERTY_ROTATION, old, this.rotation); } /** * */ public void setTableOrder(TableOrderEnum tableOrder) { Object old = this.tableOrder; this.tableOrder = tableOrder; getEventSupport().firePropertyChange(PROPERTY_TABLE_ORDER, old, this.tableOrder); } /** * */ public void setWebFilled(Boolean webFilled) { Object old = this.webFilled; this.webFilled = webFilled; getEventSupport().firePropertyChange(PROPERTY_WEB_FILLED, old, this.webFilled); } /** * */ public void setStartAngle(Double startAngle) { Object old = this.startAngle; this.startAngle = startAngle; getEventSupport().firePropertyChange(PROPERTY_START_ANGLE, old, this.startAngle); } /** * */ public void setHeadPercent(Double headPercent) { Object old = this.headPercent; this.headPercent = headPercent; getEventSupport().firePropertyChange(PROPERTY_HEAD_PERCENT, old, this.headPercent); } /** * */ public void setInteriorGap(Double interiorGap) { Object old = this.interiorGap; this.interiorGap = interiorGap; getEventSupport().firePropertyChange(PROPERTY_INTERIOR_GAP, old, this.interiorGap); } /** * */ public void setAxisLineColor(Color axisLineColor) { Object old = this.axisLineColor; this.axisLineColor = axisLineColor; getEventSupport().firePropertyChange(PROPERTY_AXIS_LINE_COLOR, old, this.axisLineColor); } /** * */ public void setAxisLineWidth(Float axisLineWidth) { Object old = this.axisLineWidth; this.axisLineWidth = axisLineWidth; getEventSupport().firePropertyChange(PROPERTY_AXIS_LINE_WIDTH, old, this.axisLineWidth); } /** * */ public void setLabelGap(Double labelGap) { Object old = this.labelGap; this.labelGap = labelGap; getEventSupport().firePropertyChange(PROPERTY_LABEL_GAP, old, this.labelGap); } /** * */ public void setLabelColor(Color labelColor) { Object old = this.labelColor; this.labelColor = labelColor; getEventSupport().firePropertyChange(PROPERTY_LABEL_COLOR, old, this.labelColor); } /** * @return the backcolor */ public Color getBackcolor() { return backcolor; } /** * @param backcolor the backcolor to set */ public void setBackcolor(Color backcolor) { Object old = this.backcolor; this.backcolor = backcolor; getEventSupport().firePropertyChange(PROPERTY_BACKCOLOR, old, this.backcolor); } /** * @return the backgroundAlpha */ public Float getBackgroundAlpha() { return backgroundAlpha; } /** * @param backgroundAlpha the backgroundAlpha to set */ public void setBackgroundAlpha(Float backgroundAlpha) { Object old = this.backgroundAlpha; this.backgroundAlpha = backgroundAlpha; getEventSupport().firePropertyChange(PROPERTY_BACKGROUND_ALPHA, old, this.backgroundAlpha); } /** * @return the foregroundAlpha */ public Float getForegroundAlpha() { return foregroundAlpha; } /** * @param foregroundAlpha the foregroundAlpha to set */ public void setForegroundAlpha(Float foregroundAlpha) { Object old = this.foregroundAlpha; this.foregroundAlpha = foregroundAlpha; getEventSupport().firePropertyChange(PROPERTY_FOREGROUND_ALPHA, old, this.foregroundAlpha); } public PlotOrientation getOrientation() { return null; } public void collectExpressions(JRExpressionCollector collector) { SpiderChartCompiler.collectExpressions(this, collector); } /** * */ public Object clone() { StandardSpiderPlot clone = null; try { clone = (StandardSpiderPlot)super.clone(); clone.eventSupport = null; } catch (CloneNotSupportedException e) { throw new JRRuntimeException(e); } return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderChartRendererEvaluator.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderChartRendererEvaluato0000644000175000017500000002325211632162655034200 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Font; import java.awt.geom.Rectangle2D; import java.util.Locale; import java.util.TimeZone; import net.sf.jasperreports.charts.type.EdgeEnum; import net.sf.jasperreports.charts.util.ChartUtil; import net.sf.jasperreports.components.charts.ChartCustomizer; import net.sf.jasperreports.components.charts.ChartSettings; import net.sf.jasperreports.engine.JRComponentElement; import net.sf.jasperreports.engine.JRRenderable; import net.sf.jasperreports.engine.util.JRFontUtil; import org.jfree.chart.JFreeChart; import org.jfree.chart.labels.StandardCategoryItemLabelGenerator; import org.jfree.chart.labels.StandardCategoryToolTipGenerator; import org.jfree.chart.plot.SpiderWebPlot; import org.jfree.chart.title.LegendTitle; import org.jfree.chart.title.TextTitle; import org.jfree.data.category.DefaultCategoryDataset; import org.jfree.ui.RectangleEdge; /** * Spider Chart design evaluator. * * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: SpiderChartRendererEvaluator.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SpiderChartRendererEvaluator { /** * */ public static final String FILL_DATASET = "fillDataset"; public static final String SAMPLE_DATASET = "sampleDataset"; public static final Double SAMPLE_MAXVALUE = Double.valueOf(10d); private static DefaultCategoryDataset sampleDataset; /** * */ public static JRRenderable evaluateRenderer( JRComponentElement element, SpiderChartSharedBean spiderchartBean, ChartCustomizer chartCustomizer, String defaultRenderType, String datasetType ) { SpiderChartComponent chartComponent = (SpiderChartComponent) element.getComponent(); ChartSettings chartSettings = chartComponent.getChartSettings(); SpiderPlot plot = (SpiderPlot)chartComponent.getPlot(); DefaultCategoryDataset dataset = null; StandardCategoryItemLabelGenerator labelGenerator = null; if(FILL_DATASET.equals(datasetType)) { dataset = ((FillSpiderDataset)spiderchartBean.getDataset()).getCustomDataset(); labelGenerator = ((FillSpiderDataset)spiderchartBean.getDataset()).getLabelGenerator(); } else { dataset = getSampleDataset(); labelGenerator = new StandardCategoryItemLabelGenerator(); } SpiderWebPlot spiderWebPlot = new SpiderWebPlot(dataset); if(plot.getAxisLineColor() != null) { spiderWebPlot.setAxisLinePaint(plot.getAxisLineColor()); } if(plot.getAxisLineWidth() != null) { spiderWebPlot.setAxisLineStroke(new BasicStroke(plot.getAxisLineWidth())); } if(plot.getBackcolor() != null) { spiderWebPlot.setBackgroundPaint(plot.getBackcolor()); } if(plot.getBackgroundAlpha() != null) { spiderWebPlot.setBackgroundAlpha(plot.getBackgroundAlpha()); } if(plot.getForegroundAlpha() != null) { spiderWebPlot.setForegroundAlpha(plot.getForegroundAlpha()); } if(plot.getHeadPercent() != null) { spiderWebPlot.setHeadPercent(plot.getHeadPercent()); } if(plot.getInteriorGap() != null) { spiderWebPlot.setInteriorGap(plot.getInteriorGap()); } if(plot.getLabelColor() != null) { spiderWebPlot.setLabelPaint(plot.getLabelColor()); } if(plot.getLabelFont() != null) { spiderWebPlot.setLabelFont(JRFontUtil.getAwtFont(plot.getLabelFont(), Locale.getDefault())); } if(plot.getLabelGap() != null) { spiderWebPlot.setAxisLabelGap(plot.getLabelGap()); } if(spiderchartBean.getMaxValue() != null) { spiderWebPlot.setMaxValue(spiderchartBean.getMaxValue()); } if(plot.getRotation() != null) { spiderWebPlot.setDirection(plot.getRotation().getRotation()); } if(plot.getStartAngle() != null) { spiderWebPlot.setStartAngle(plot.getStartAngle()); } if(plot.getTableOrder() != null) { spiderWebPlot.setDataExtractOrder(plot.getTableOrder().getOrder()); } if(plot.getWebFilled() != null) { spiderWebPlot.setWebFilled(plot.getWebFilled()); } spiderWebPlot.setToolTipGenerator(new StandardCategoryToolTipGenerator()); spiderWebPlot.setLabelGenerator(labelGenerator); Font titleFont = chartSettings.getTitleFont() != null ? JRFontUtil.getAwtFont(chartSettings.getTitleFont(), Locale.getDefault()) : TextTitle.DEFAULT_FONT; String titleText = spiderchartBean.getTitleText(); JFreeChart jfreechart = new JFreeChart(titleText, titleFont, spiderWebPlot, true); Color backcolor = chartSettings.getBackcolor() != null ? chartSettings.getBackcolor() : element.getBackcolor(); if(backcolor != null) { jfreechart.setBackgroundPaint(backcolor); } RectangleEdge titleEdge = getEdge(chartSettings.getTitlePosition(), RectangleEdge.TOP); if (titleText != null) { TextTitle title = jfreechart.getTitle(); title.setText(titleText); if(chartSettings.getTitleColor() != null) { title.setPaint(chartSettings.getTitleColor()); } title.setFont(titleFont); title.setPosition(titleEdge); jfreechart.setTitle(title); } String subtitleText = spiderchartBean.getSubtitleText(); if (subtitleText != null) { TextTitle subtitle = new TextTitle(subtitleText); subtitle.setText(subtitleText); if(chartSettings.getSubtitleColor() != null) { subtitle.setPaint(chartSettings.getSubtitleColor()); } if(chartSettings.getSubtitleColor() != null) { Font subtitleFont = chartSettings.getSubtitleFont() != null ? JRFontUtil.getAwtFont(chartSettings.getSubtitleFont(), Locale.getDefault()) : TextTitle.DEFAULT_FONT; subtitle.setFont(subtitleFont); } subtitle.setPosition(titleEdge); jfreechart.addSubtitle(subtitle); } // Apply all of the legend formatting options LegendTitle legend = jfreechart.getLegend(); if (legend != null) { legend.setVisible((chartSettings.getShowLegend() == null || chartSettings.getShowLegend())); if (legend.isVisible()) { if(chartSettings.getLegendColor() != null) { legend.setItemPaint(chartSettings.getLegendColor()); } if (chartSettings.getLegendBackgroundColor() != null) { legend.setBackgroundPaint(chartSettings.getLegendBackgroundColor()); } if(chartSettings.getLegendFont() != null) { legend.setItemFont(JRFontUtil.getAwtFont(chartSettings.getLegendFont(), Locale.getDefault())); } legend.setPosition(getEdge(chartSettings.getLegendPosition(), RectangleEdge.BOTTOM)); } } String renderType = chartSettings.getRenderType() == null ? defaultRenderType : chartSettings.getRenderType(); Rectangle2D rectangle = new Rectangle2D.Double(0,0,element.getWidth(),element.getHeight()); if (chartCustomizer != null) { chartCustomizer.customize(jfreechart, chartComponent); } return ChartUtil.getChartRendererFactory(renderType).getRenderer( jfreechart, spiderchartBean.getHyperlinkProvider(), rectangle ); } public static DefaultCategoryDataset getSampleDataset() { if (sampleDataset == null) { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(1.0, "Series 1", "Category 1"); dataset.addValue(5.0, "Series 1", "Category 2"); dataset.addValue(4.0, "Series 1", "Category 3"); dataset.addValue(3.0, "Series 1", "Category 4"); dataset.addValue(6.0, "Series 1", "Category 5"); dataset.addValue(4.0, "Series 1", "Category 6"); dataset.addValue(3.0, "Series 1", "Category 7"); dataset.addValue(5.0, "Series 2", "Category 1"); dataset.addValue(7.0, "Series 2", "Category 2"); dataset.addValue(8.0, "Series 2", "Category 3"); dataset.addValue(6.0, "Series 2", "Category 4"); dataset.addValue(9.0, "Series 2", "Category 5"); dataset.addValue(8.0, "Series 2", "Category 6"); dataset.addValue(7.0, "Series 2", "Category 7"); dataset.addValue(5.0, "Series 3", "Category 1"); dataset.addValue(4.0, "Series 3", "Category 2"); dataset.addValue(6.0, "Series 3", "Category 3"); dataset.addValue(3.0, "Series 3", "Category 4"); dataset.addValue(2.0, "Series 3", "Category 5"); dataset.addValue(7.0, "Series 3", "Category 6"); dataset.addValue(5.0, "Series 3", "Category 7"); sampleDataset = dataset; } return sampleDataset; } public Locale getLocale() { return null;//FIXMETHEME } public TimeZone getTimeZone() { return null; } /** * */ private static RectangleEdge getEdge(EdgeEnum position, RectangleEdge defaultPosition) { RectangleEdge edge = defaultPosition; if(position != null) { switch (position) { case TOP : { edge = RectangleEdge.TOP; break; } case BOTTOM : { edge = RectangleEdge.BOTTOM; break; } case LEFT : { edge = RectangleEdge.LEFT; break; } case RIGHT : { edge = RectangleEdge.RIGHT; break; } } } return edge; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderChartFillFactory.java0000644000175000017500000000354711632162655034074 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; 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 sanda zaharia (shertage@users.sourceforge.net) * @version $Id: SpiderChartFillFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SpiderChartFillFactory implements ComponentFillFactory { public FillComponent toFillComponent(Component component, JRFillObjectFactory factory) { return new FillSpiderChart((SpiderChartComponent) component, factory); } public FillComponent cloneFillComponent(FillComponent component, JRFillCloneFactory factory) { throw new UnsupportedOperationException(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/type/0000755000175000017500000000000011654071732027631 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/type/TableOrderEnum.java0000644000175000017500000000473511632162655033356 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart.type; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; import org.jfree.util.TableOrder; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: TableOrderEnum.java 4595 2011-09-08 15:55:10Z teodord $ */ public enum TableOrderEnum implements JREnum { /** * */ BY_ROW(TableOrder.BY_ROW, "Row"), /** * */ BY_COLUMN(TableOrder.BY_COLUMN, "Column"); /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient TableOrder value; private final transient String name; private TableOrderEnum(TableOrder order, String name) { this.value = order; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(getValue()); } /** * */ public final byte getValue() { return (byte)-1; } /** * */ public String getName() { return name; } /** * */ public final TableOrder getOrder() { return this.value; } /** * */ public static TableOrderEnum getByName(String name) { return (TableOrderEnum)EnumUtil.getByName(values(), name); } /** * */ public static TableOrderEnum getByValue(TableOrder order) { TableOrderEnum[] values = values(); if (values != null && order != null) { for(TableOrderEnum e:values) { if (order.equals(e.getOrder())) { return e; } } } return null; } } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/type/SpiderRotationEnum.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/type/SpiderRotationEnum.jav0000644000175000017500000000503711632162655034134 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart.type; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; import org.jfree.util.Rotation; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: SpiderRotationEnum.java 4595 2011-09-08 15:55:10Z teodord $ */ public enum SpiderRotationEnum implements JREnum { /** * */ CLOCKWISE(Rotation.CLOCKWISE, "Clockwise"), /** * */ ANTICLOCKWISE(Rotation.ANTICLOCKWISE, "Anticlockwise"); /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient Rotation value; private final transient String name; private SpiderRotationEnum(Rotation rotation, String name) { this.value = rotation; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(getValue()); } /** * */ public final byte getValue() { return (byte)-1; } /** * */ public String getName() { return name; } /** * */ public final Rotation getRotation() { return this.value; } /** * */ public static SpiderRotationEnum getByName(String name) { return (SpiderRotationEnum)EnumUtil.getByName(values(), name); } /** * */ public static SpiderRotationEnum getByValue(Rotation rotation) { SpiderRotationEnum[] values = values(); if (values != null && rotation != null) { for(SpiderRotationEnum e:values) { if (rotation.equals(e.getRotation())) { return e; } } } return null; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/FillSpiderDataset.java0000644000175000017500000001364011632162654033062 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import java.util.HashMap; import java.util.Map; import net.sf.jasperreports.charts.JRCategorySeries; import net.sf.jasperreports.charts.fill.JRFillCategorySeries; import net.sf.jasperreports.charts.util.CategoryLabelGenerator; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.JRExpressionCollector; 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.JRFillElementDataset; import net.sf.jasperreports.engine.fill.JRFillObjectFactory; import org.jfree.chart.labels.StandardCategoryItemLabelGenerator; import org.jfree.data.category.DefaultCategoryDataset; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: FillSpiderDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public class FillSpiderDataset extends JRFillElementDataset implements SpiderDataset { /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; /** * */ protected JRFillCategorySeries[] categorySeries; private DefaultCategoryDataset dataset; private Map, Map, String>> labelsMap; private Map,Map,JRPrintHyperlink>> itemHyperlinks; /** * */ public FillSpiderDataset( SpiderDataset spiderDataset, JRFillObjectFactory factory ) { super(spiderDataset, factory); /* */ JRCategorySeries[] srcCategorySeries = spiderDataset.getSeries(); if (srcCategorySeries != null && srcCategorySeries.length > 0) { categorySeries = new JRFillCategorySeries[srcCategorySeries.length]; for(int i = 0; i < srcCategorySeries.length; i++) { categorySeries[i] = (JRFillCategorySeries)factory.getCategorySeries(srcCategorySeries[i]); } } } /** * */ public JRCategorySeries[] getSeries() { return categorySeries; } /** * */ protected void customInitialize() { dataset = null; labelsMap = null; itemHyperlinks = null; } /** * */ 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); } } } /** * */ 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("Category series name is 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()); } } } } /** * */ public DefaultCategoryDataset getCustomDataset() { return dataset; } /** * */ public StandardCategoryItemLabelGenerator getLabelGenerator() { return labelsMap != null ? new CategoryLabelGenerator(labelsMap) : new StandardCategoryItemLabelGenerator(); } /** * */ public void collectExpressions(JRExpressionCollector collector) { SpiderChartCompiler.collectExpressions(this, collector); } 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; } public void finishDataset() { //one last increment is required in certain cases increment(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderChartXmlFactory.java0000644000175000017500000000412311632162655033735 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import net.sf.jasperreports.engine.type.EvaluationTimeEnum; 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) * @version $Id: SpiderChartXmlFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SpiderChartXmlFactory extends JRBaseFactory { public Object createObject(Attributes attrs) throws Exception { SpiderChartComponent chartComponent = new SpiderChartComponent(); EvaluationTimeEnum evaluationTime = EvaluationTimeEnum.getByName(attrs.getValue(JRXmlConstants.ATTRIBUTE_evaluationTime)); if (evaluationTime != null) { chartComponent.setEvaluationTime(evaluationTime); } else { chartComponent.setEvaluationTime(EvaluationTimeEnum.NOW); } if (chartComponent.getEvaluationTime() == EvaluationTimeEnum.GROUP) { String groupName = attrs.getValue(JRXmlConstants.ATTRIBUTE_evaluationGroup); chartComponent.setEvaluationGroup(groupName); } return chartComponent; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/StandardSpiderDataset.java0000644000175000017500000000654611632162655033744 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import java.util.ArrayList; import java.util.List; import net.sf.jasperreports.charts.JRCategorySeries; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.JRExpressionCollector; import net.sf.jasperreports.engine.base.JRBaseObjectFactory; import net.sf.jasperreports.engine.design.JRDesignElementDataset; /** * * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: StandardSpiderDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public class StandardSpiderDataset extends JRDesignElementDataset implements SpiderDataset { /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_CATEGORY_SERIES = "categorySeries"; private List categorySeriesList = new ArrayList(); public StandardSpiderDataset() { super(); } public StandardSpiderDataset(SpiderDataset dataset, JRBaseObjectFactory factory) { super(dataset, factory); JRCategorySeries[] srcCategorySeries = dataset.getSeries(); if (srcCategorySeries != null && srcCategorySeries.length > 0) { for(int i = 0; i < srcCategorySeries.length; i++) { addCategorySeries(factory.getCategorySeries(srcCategorySeries[i])); } } } public void collectExpressions(JRExpressionCollector collector) { SpiderChartCompiler.collectExpressions(this, collector); } 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 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderPlotXmlFactory.java0000644000175000017500000001006711632162655033616 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import java.awt.Color; import net.sf.jasperreports.components.spiderchart.type.SpiderRotationEnum; import net.sf.jasperreports.components.spiderchart.type.TableOrderEnum; 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) * @version $Id: SpiderPlotXmlFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SpiderPlotXmlFactory extends JRBaseFactory { public Object createObject(Attributes atts) { StandardSpiderPlot plot = new StandardSpiderPlot(); SpiderRotationEnum rotation = SpiderRotationEnum.getByName(atts.getValue(SpiderChartXmlWriter.ATTRIBUTE_rotation)); if (rotation != null) { plot.setRotation(rotation); } TableOrderEnum tableOrder = TableOrderEnum.getByName(atts.getValue(SpiderChartXmlWriter.ATTRIBUTE_tableOrder)); if (rotation != null) { plot.setTableOrder(tableOrder); } String webFilled = atts.getValue(SpiderChartXmlWriter.ATTRIBUTE_webFilled); if (webFilled != null && webFilled.length() > 0) { plot.setWebFilled(Boolean.valueOf(webFilled)); } String startAngle = atts.getValue(SpiderChartXmlWriter.ATTRIBUTE_startAngle); if(startAngle != null && startAngle.length() > 0){ plot.setStartAngle(Double.valueOf(startAngle)); } String headPercent = atts.getValue(SpiderChartXmlWriter.ATTRIBUTE_headPercent); if(headPercent != null && headPercent.length() > 0){ plot.setHeadPercent(Double.valueOf(headPercent)); } String interiorGap = atts.getValue(SpiderChartXmlWriter.ATTRIBUTE_interiorGap); if(interiorGap != null && interiorGap.length() > 0){ plot.setInteriorGap(Double.valueOf(interiorGap)); } String axisLineColor = atts.getValue(SpiderChartXmlWriter.ATTRIBUTE_axisLineColor); plot.setAxisLineColor(JRColorUtil.getColor(axisLineColor, null)); String axisLineWidth = atts.getValue(SpiderChartXmlWriter.ATTRIBUTE_axisLineWidth); if(axisLineWidth != null && axisLineWidth.length() > 0){ plot.setAxisLineWidth(Float.valueOf(axisLineWidth)); } String labelGap = atts.getValue(SpiderChartXmlWriter.ATTRIBUTE_labelGap); if(labelGap != null && labelGap.length() > 0){ plot.setLabelGap(Double.valueOf(labelGap)); } String labelColor = atts.getValue(SpiderChartXmlWriter.ATTRIBUTE_labelColor); plot.setLabelColor(JRColorUtil.getColor(labelColor, null)); Color color = JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_backcolor), Color.black); if (color != null) { plot.setBackcolor(color); } String foregroundAlpha = atts.getValue(JRXmlConstants.ATTRIBUTE_foregroundAlpha); if (foregroundAlpha != null && foregroundAlpha.length() > 0) { plot.setForegroundAlpha(Float.valueOf(foregroundAlpha)); } String backgroundAlpha = atts.getValue(JRXmlConstants.ATTRIBUTE_backgroundAlpha); if (backgroundAlpha != null && backgroundAlpha.length() > 0) { plot.setBackgroundAlpha(Float.valueOf(backgroundAlpha)); } return plot; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/StandardChartSettings.java0000644000175000017500000004706411632162655033772 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import java.awt.Color; import java.util.ArrayList; import java.util.List; import java.util.ListIterator; import net.sf.jasperreports.charts.type.EdgeEnum; import net.sf.jasperreports.components.charts.ChartSettings; import net.sf.jasperreports.engine.JRAnchor; 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.JRHyperlinkHelper; import net.sf.jasperreports.engine.JRHyperlinkParameter; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.base.JRBaseObjectFactory; import net.sf.jasperreports.engine.design.JRDesignHyperlink; import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport; import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; import net.sf.jasperreports.engine.type.HyperlinkTypeEnum; import net.sf.jasperreports.engine.util.JRCloneUtils; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: StandardChartSettings.java 4595 2011-09-08 15:55:10Z teodord $ */ public class StandardChartSettings implements ChartSettings, JRChangeEventsSupport { /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; /* * Chart properties */ public static final byte CHART_TYPE_SPIDER = 22; public static final String PROPERTY_LEGEND_BACKGROUND_COLOR = "legendBackgroundColor"; public static final String PROPERTY_LEGEND_COLOR = "legendColor"; public static final String PROPERTY_LEGEND_POSITION = "legendPosition"; public static final String PROPERTY_SHOW_LEGEND = "showLegend"; public static final String PROPERTY_SUBTITLE_COLOR = "subtitleColor"; public static final String PROPERTY_TITLE_COLOR = "titleColor"; public static final String PROPERTY_TITLE_POSITION = "titlePosition"; public static final String PROPERTY_RENDER_TYPE = "renderType"; public static final String PROPERTY_BOOKMARK_LEVEL = "bookmarkLevel"; public static final String PROPERTY_BACKCOLOR = "backcolor"; public static final String PROPERTY_ANCHOR_NAME_EXPRESSION = "anchorNameExpression"; public static final String PROPERTY_EVALUATION_GROUP = "evaluationGroup"; public static final String PROPERTY_EVALUATION_TIME = "evaluationTime"; public static final String PROPERTY_CHART_TYPE = "chartType"; public static final String PROPERTY_LEGEND_FONT = "legendFont"; public static final String PROPERTY_SUBTITLE_EXPRESSION = "subtitleExpression"; public static final String PROPERTY_SUBTITLE_FONT = "subtitleFont"; public static final String PROPERTY_TITLE_EXPRESSION = "titleExpression"; public static final String PROPERTY_TITLE_FONT = "titleFont"; public static final String PROPERTY_HYPERLINK_ANCHOR_EXPRESSION = "hyperlinkAnchorExpression"; public static final String PROPERTY_HYPERLINK_PAGE_EXPRESSION = "hyperlinkPageExpression"; public static final String PROPERTY_HYPERLINK_REFERENCE_EXPRESSION = "hyperlinkReferenceExpression"; public static final String PROPERTY_HYPERLINK_TARGET = "hyperlinkTarget"; public static final String PROPERTY_LINK_TARGET = "linkTarget"; public static final String PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION = "hyperlinkTooltipExpression"; public static final String PROPERTY_LINK_TYPE = "linkType"; public static final String PROPERTY_HYPERLINK_PARAMETERS = "hyperlinkParameters"; public static final String PROPERTY_CUSTOMIZER_CLASS = "customizerClass"; /** * */ protected Byte chartType = CHART_TYPE_SPIDER; /** * */ protected Boolean showLegend; protected String linkType; protected String linkTarget; protected List hyperlinkParameters = new ArrayList(); protected Color backcolor; protected Color titleColor; protected Color subtitleColor; protected Color legendColor; protected Color legendBackgroundColor; protected EdgeEnum legendPosition; protected EdgeEnum titlePosition; protected String renderType; /** * */ protected JRFont titleFont; protected JRFont subtitleFont; protected JRFont legendFont; /** * */ protected JRExpression titleExpression; protected JRExpression subtitleExpression; protected JRExpression anchorNameExpression; protected JRExpression hyperlinkReferenceExpression; protected JRExpression hyperlinkAnchorExpression; protected JRExpression hyperlinkPageExpression; protected JRExpression hyperlinkTooltipExpression; protected String customizerClass; /** * The bookmark level for the anchor associated with this chart. * @see JRAnchor#getBookmarkLevel() */ protected int bookmarkLevel = JRAnchor.NO_BOOKMARK; /** * */ public StandardChartSettings() { } public StandardChartSettings(ChartSettings chart, JRBaseObjectFactory factory) { showLegend = chart.getShowLegend(); backcolor = chart.getBackcolor(); linkType = chart.getLinkType(); linkTarget = chart.getLinkTarget(); titlePosition = chart.getTitlePosition(); titleColor = chart.getTitleColor(); subtitleColor = chart.getSubtitleColor(); legendColor = chart.getLegendColor(); legendBackgroundColor = chart.getLegendBackgroundColor(); legendPosition = chart.getLegendPosition(); renderType = chart.getRenderType(); titleFont = chart.getTitleFont(); subtitleFont = chart.getSubtitleFont(); legendFont = chart.getLegendFont(); titleExpression = factory.getExpression(chart.getTitleExpression()); subtitleExpression = factory.getExpression(chart.getSubtitleExpression()); anchorNameExpression = factory.getExpression(chart.getAnchorNameExpression()); hyperlinkReferenceExpression = factory.getExpression(chart.getHyperlinkReferenceExpression()); hyperlinkAnchorExpression = factory.getExpression(chart.getHyperlinkAnchorExpression()); hyperlinkPageExpression = factory.getExpression(chart.getHyperlinkPageExpression()); hyperlinkTooltipExpression = factory.getExpression(chart.getHyperlinkTooltipExpression()); bookmarkLevel = chart.getBookmarkLevel(); customizerClass = chart.getCustomizerClass(); JRHyperlinkParameter[] hyperlinkParams = chart.getHyperlinkParameters(); if (hyperlinkParams != null && hyperlinkParams.length > 0) { for(int i = 0; i < hyperlinkParams.length; i++) { addHyperlinkParameter(factory.getHyperlinkParameter(hyperlinkParams[i])); } } } /** * */ public Boolean getShowLegend() { return this.showLegend; } /** * */ public void setShowLegend(Boolean isShowLegend) { Object old = this.showLegend; this.showLegend = isShowLegend; getEventSupport().firePropertyChange(PROPERTY_SHOW_LEGEND, old, this.showLegend); } /** * */ public Color getBackcolor() { return this.backcolor; } /** * */ public void setBackcolor(Color backcolor) { Object old = this.backcolor; this.backcolor = backcolor; getEventSupport().firePropertyChange(PROPERTY_BACKCOLOR, old, this.backcolor); } /** * */ public JRFont getTitleFont() { return this.titleFont; } /** * */ public EdgeEnum getTitlePosition() { return this.titlePosition; } /** * */ public void setTitlePosition(EdgeEnum titlePosition) { Object old = this.titlePosition; this.titlePosition = titlePosition; getEventSupport().firePropertyChange(PROPERTY_TITLE_POSITION, old, this.titlePosition); } /** * */ public Color getTitleColor() { return this.titleColor; } /** * */ public void setTitleColor(Color titleColor) { Object old = this.titleColor; this.titleColor = titleColor; getEventSupport().firePropertyChange(PROPERTY_TITLE_COLOR, old, this.titleColor); } /** * */ public JRFont getSubtitleFont() { return this.subtitleFont; } /** * */ public Color getSubtitleColor() { return this.subtitleColor; } /** * */ public void setSubtitleColor(Color subtitleColor) { Object old = this.subtitleColor; this.subtitleColor = subtitleColor; getEventSupport().firePropertyChange(PROPERTY_SUBTITLE_COLOR, old, this.subtitleColor); } /** * */ public Color getLegendBackgroundColor() { return this.legendBackgroundColor; } /** * */ public Color getLegendColor() { return this.legendColor; } /** * */ public JRFont getLegendFont() { return this.legendFont; } /** * */ public void setLegendBackgroundColor(Color legendBackgroundColor) { Object old = this.legendBackgroundColor; this.legendBackgroundColor = legendBackgroundColor; getEventSupport().firePropertyChange(PROPERTY_LEGEND_BACKGROUND_COLOR, old, this.legendBackgroundColor); } /** * */ public void setLegendColor(Color legendColor) { Object old = this.legendColor; this.legendColor = legendColor; getEventSupport().firePropertyChange(PROPERTY_LEGEND_COLOR, old, this.legendColor); } /** * */ public EdgeEnum getLegendPosition() { return this.legendPosition; } /** * */ public void setLegendPosition(EdgeEnum legendPosition) { Object old = this.legendPosition; this.legendPosition = legendPosition; getEventSupport().firePropertyChange(PROPERTY_LEGEND_POSITION, old, this.legendPosition); } /** * @deprecated Replaced by {@link #getHyperlinkTypeValue()}. */ public byte getHyperlinkType() { return getHyperlinkTypeValue().getValue(); } /** * */ public HyperlinkTypeEnum getHyperlinkTypeValue() { return JRHyperlinkHelper.getHyperlinkTypeValue(this); } /** * */ public byte getHyperlinkTarget() { return JRHyperlinkHelper.getHyperlinkTarget(this); } /** * */ public JRExpression getTitleExpression() { return this.titleExpression; } /** * */ public JRExpression getSubtitleExpression() { return this.subtitleExpression; } /** * */ public JRExpression getAnchorNameExpression() { return this.anchorNameExpression; } /** * */ public JRExpression getHyperlinkReferenceExpression() { return this.hyperlinkReferenceExpression; } /** * */ public JRExpression getHyperlinkAnchorExpression() { return this.hyperlinkAnchorExpression; } /** * */ public JRExpression getHyperlinkPageExpression() { return this.hyperlinkPageExpression; } public byte getChartType() { return this.chartType; } /** * */ public String getRenderType() { return this.renderType; } /** * */ public void setRenderType(String renderType) { Object old = this.renderType; this.renderType = renderType; getEventSupport().firePropertyChange(PROPERTY_RENDER_TYPE, old, this.renderType); } public int getBookmarkLevel() { return this.bookmarkLevel; } /** * */ public void setBookmarkLevel(int bookmarkLevel) { Object old = this.bookmarkLevel; this.bookmarkLevel = bookmarkLevel; getEventSupport().firePropertyChange(PROPERTY_BOOKMARK_LEVEL, old, this.bookmarkLevel); } public String getLinkType() { return this.linkType; } public String getLinkTarget() { return this.linkTarget; } public JRExpression getHyperlinkTooltipExpression() { return this.hyperlinkTooltipExpression; } /** * @return the customizerClass */ public String getCustomizerClass() { return this.customizerClass; } /** * @param chartType the chartType to set */ public void setChartType(Byte chartType) { Object old = this.chartType; this.chartType = chartType; getEventSupport().firePropertyChange(PROPERTY_CHART_TYPE, old, this.chartType); } /** * @param linkType the linkType to set */ public void setLinkType(String linkType) { Object old = this.linkType; this.linkType = linkType; getEventSupport().firePropertyChange(PROPERTY_LINK_TYPE, old, this.linkType); } /** * @param linkTarget the linkTarget to set */ public void setLinkTarget(String linkTarget) { Object old = this.linkTarget; this.linkTarget = linkTarget; getEventSupport().firePropertyChange(PROPERTY_LINK_TARGET, old, this.linkTarget); } /** * @param titleFont the titleFont to set */ public void setTitleFont(JRFont titleFont) { Object old = this.linkTarget; this.titleFont = titleFont; getEventSupport().firePropertyChange(PROPERTY_TITLE_FONT, old, this.titleFont); } /** * @param subtitleFont the subtitleFont to set */ public void setSubtitleFont(JRFont subtitleFont) { Object old = this.subtitleFont; this.subtitleFont = subtitleFont; getEventSupport().firePropertyChange(PROPERTY_SUBTITLE_FONT, old, this.subtitleFont); } /** * @param legendFont the legendFont to set */ public void setLegendFont(JRFont legendFont) { Object old = this.legendFont; this.legendFont = legendFont; getEventSupport().firePropertyChange(PROPERTY_LEGEND_FONT, old, this.legendFont); } /** * @param titleExpression the titleExpression to set */ public void setTitleExpression(JRExpression titleExpression) { Object old = this.titleExpression; this.titleExpression = titleExpression; getEventSupport().firePropertyChange(PROPERTY_TITLE_EXPRESSION, old, this.titleExpression); } /** * @param subtitleExpression the subtitleExpression to set */ public void setSubtitleExpression(JRExpression subtitleExpression) { Object old = this.subtitleExpression; this.subtitleExpression = subtitleExpression; getEventSupport().firePropertyChange(PROPERTY_SUBTITLE_EXPRESSION, old, this.subtitleExpression); } /** * @param anchorNameExpression the anchorNameExpression to set */ public void setAnchorNameExpression(JRExpression anchorNameExpression) { Object old = this.anchorNameExpression; this.anchorNameExpression = anchorNameExpression; getEventSupport().firePropertyChange(PROPERTY_ANCHOR_NAME_EXPRESSION, old, this.anchorNameExpression); } /** * @param hyperlinkReferenceExpression the hyperlinkReferenceExpression to set */ public void setHyperlinkReferenceExpression(JRExpression hyperlinkReferenceExpression) { Object old = this.hyperlinkReferenceExpression; this.hyperlinkReferenceExpression = hyperlinkReferenceExpression; getEventSupport().firePropertyChange(PROPERTY_HYPERLINK_REFERENCE_EXPRESSION, old, this.hyperlinkReferenceExpression); } /** * @param hyperlinkAnchorExpression the hyperlinkAnchorExpression to set */ public void setHyperlinkAnchorExpression(JRExpression hyperlinkAnchorExpression) { Object old = this.hyperlinkAnchorExpression; this.hyperlinkAnchorExpression = hyperlinkAnchorExpression; getEventSupport().firePropertyChange(PROPERTY_HYPERLINK_ANCHOR_EXPRESSION, old, this.hyperlinkAnchorExpression); } /** * @param hyperlinkPageExpression the hyperlinkPageExpression to set */ public void setHyperlinkPageExpression(JRExpression hyperlinkPageExpression) { Object old = this.hyperlinkPageExpression; this.hyperlinkPageExpression = hyperlinkPageExpression; getEventSupport().firePropertyChange(PROPERTY_HYPERLINK_PAGE_EXPRESSION, old, this.hyperlinkPageExpression); } /** * @param hyperlinkTooltipExpression the hyperlinkTooltipExpression to set */ public void setHyperlinkTooltipExpression(JRExpression hyperlinkTooltipExpression) { Object old = this.hyperlinkTooltipExpression; this.hyperlinkTooltipExpression = hyperlinkTooltipExpression; getEventSupport().firePropertyChange(PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION, old, this.hyperlinkTooltipExpression); } /** * @param customizerClass the customizerClass to set */ public void setCustomizerClass(String customizerClass) { Object old = this.customizerClass; this.customizerClass = customizerClass; getEventSupport().firePropertyChange(PROPERTY_CUSTOMIZER_CLASS, old, this.customizerClass); } public void collectExpressions(JRExpressionCollector collector) { SpiderChartCompiler.collectExpressions(this, collector); } public Object clone() { StandardChartSettings clone = null; try { clone = (StandardChartSettings)super.clone(); } catch (CloneNotSupportedException e) { throw new JRRuntimeException(e); } clone.hyperlinkParameters = JRCloneUtils.cloneList(hyperlinkParameters); clone.titleExpression = JRCloneUtils.nullSafeClone(titleExpression); clone.subtitleExpression = JRCloneUtils.nullSafeClone(subtitleExpression); clone.anchorNameExpression = JRCloneUtils.nullSafeClone(anchorNameExpression); clone.hyperlinkReferenceExpression = JRCloneUtils.nullSafeClone(hyperlinkReferenceExpression); clone.hyperlinkAnchorExpression = JRCloneUtils.nullSafeClone(hyperlinkAnchorExpression); clone.hyperlinkPageExpression = JRCloneUtils.nullSafeClone(hyperlinkPageExpression); clone.hyperlinkTooltipExpression = JRCloneUtils.nullSafeClone(hyperlinkTooltipExpression); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } public JRHyperlinkParameter[] getHyperlinkParameters() { JRHyperlinkParameter[] parameters = null; if (!hyperlinkParameters.isEmpty()) { parameters = new JRHyperlinkParameter[hyperlinkParameters.size()]; hyperlinkParameters.toArray(parameters); } return parameters; } /** * Returns the list of custom hyperlink parameters. * * @return the list of custom hyperlink parameters */ public List getHyperlinkParametersList() { return hyperlinkParameters; } /** * Adds a custom hyperlink parameter. * * @param parameter the parameter to add */ public void addHyperlinkParameter(JRHyperlinkParameter parameter) { hyperlinkParameters.add(parameter); getEventSupport().fireCollectionElementAddedEvent(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS, parameter, hyperlinkParameters.size() - 1); } /** * Removes a custom hyperlink parameter. * * @param parameter the parameter to remove */ public void removeHyperlinkParameter(JRHyperlinkParameter parameter) { int idx = hyperlinkParameters.indexOf(parameter); if (idx >= 0) { hyperlinkParameters.remove(idx); getEventSupport().fireCollectionElementRemovedEvent(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS, parameter, idx); } } /** * Removes a custom hyperlink parameter. *

* If multiple parameters having the specified name exist, all of them * will be removed *

* * @param parameterName the parameter name */ public void removeHyperlinkParameter(String parameterName) { for (ListIterator it = hyperlinkParameters.listIterator(); it.hasNext();) { JRHyperlinkParameter parameter = it.next(); if (parameter.getName() != null && parameter.getName().equals(parameterName)) { it.remove(); getEventSupport().fireCollectionElementRemovedEvent(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS, parameter, it.nextIndex()); } } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/FillSpiderChart.java0000644000175000017500000002412011644765273032542 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import net.sf.jasperreports.charts.util.CategoryChartHyperlinkProvider; import net.sf.jasperreports.charts.util.ChartHyperlinkProvider; import net.sf.jasperreports.components.charts.AbstractChartCustomizer; import net.sf.jasperreports.components.charts.ChartCustomizer; import net.sf.jasperreports.components.charts.FillChartSettings; import net.sf.jasperreports.engine.JRChart; import net.sf.jasperreports.engine.JRComponentElement; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRPrintElement; import net.sf.jasperreports.engine.JRPrintHyperlinkParameters; import net.sf.jasperreports.engine.JRPrintImage; import net.sf.jasperreports.engine.JRRenderable; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.component.BaseFillComponent; 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.JRFillExpressionEvaluator; import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper; import net.sf.jasperreports.engine.fill.JRFillObjectFactory; 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.util.JRClassLoader; import net.sf.jasperreports.engine.util.JRStringUtil; /** * * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: FillSpiderChart.java 4648 2011-10-10 12:50:53Z lucianc $ */ public class FillSpiderChart extends BaseFillComponent implements JRFillCloneable { private final SpiderChartComponent chartComponent; private final FillChartSettings chartSettings; private final FillSpiderDataset dataset; private final FillSpiderPlot plot; private Double maxValue; private String titleText; private String subtitleText; private String anchorName; private String hyperlinkReference; private String hyperlinkAnchor; private Integer hyperlinkPage; private String hyperlinkTooltip; private Integer bookmarkLevel; private JRPrintHyperlinkParameters hyperlinkParameters; private JRFillExpressionEvaluator expressionEvaluator; private ChartHyperlinkProvider chartHyperlinkProvider; private JRRenderable renderer; private String customizerClass; protected ChartCustomizer chartCustomizer; public FillSpiderChart(SpiderChartComponent chartComponent, JRFillObjectFactory factory) { this.chartComponent = chartComponent; this.chartSettings = new FillChartSettings(chartComponent.getChartSettings(), factory); this.dataset = new FillSpiderDataset((SpiderDataset)chartComponent.getDataset(), factory); factory.registerElementDataset(this.dataset); this.plot = new FillSpiderPlot((SpiderPlot)chartComponent.getPlot(), factory); this.expressionEvaluator = factory.getExpressionEvaluator(); } protected boolean isEvaluateNow() { return chartComponent.getEvaluationTime() == EvaluationTimeEnum.NOW; } public void evaluate(byte evaluation) throws JRException { if (isEvaluateNow()) { evaluateRenderer(evaluation); } } /** * */ protected void evaluateRenderer(byte evaluation) throws JRException { maxValue = (Double) fillContext.evaluate(getPlot().getMaxValueExpression(), evaluation); titleText = JRStringUtil.getString(fillContext.evaluate(getChartSettings().getTitleExpression(), evaluation)); subtitleText = JRStringUtil.getString(fillContext.evaluate(getChartSettings().getSubtitleExpression(), evaluation)); anchorName = JRStringUtil.getString(fillContext.evaluate(getChartSettings().getAnchorNameExpression(), evaluation)); hyperlinkReference = JRStringUtil.getString(fillContext.evaluate(getChartSettings().getHyperlinkReferenceExpression(), evaluation)); hyperlinkAnchor = JRStringUtil.getString(fillContext.evaluate(getChartSettings().getHyperlinkAnchorExpression(), evaluation)); hyperlinkPage = (Integer) fillContext.evaluate(getChartSettings().getHyperlinkPageExpression(), evaluation); hyperlinkTooltip = JRStringUtil.getString(fillContext.evaluate(getChartSettings().getHyperlinkTooltipExpression(), evaluation)); hyperlinkParameters = JRFillHyperlinkHelper.evaluateHyperlinkParameters(getChartSettings(), expressionEvaluator, evaluation); dataset.evaluateDatasetRun(evaluation); dataset.finishDataset(); chartHyperlinkProvider = new CategoryChartHyperlinkProvider(dataset.getItemHyperlinks()); bookmarkLevel = getChartSettings().getBookmarkLevel(); JRComponentElement element = fillContext.getComponentElement(); SpiderChartSharedBean spiderChartSharedBean = new SpiderChartSharedBean( getChartSettings().getRenderType(), maxValue, titleText, subtitleText, chartHyperlinkProvider, dataset ); customizerClass = chartSettings.getCustomizerClass(); if (customizerClass != null && customizerClass.length() > 0) { try { Class myClass = JRClassLoader.loadClassForName(customizerClass); chartCustomizer = (ChartCustomizer) myClass.newInstance(); } catch (Exception e) { throw new JRRuntimeException("Could not create chart customizer instance.", e); } if (chartCustomizer instanceof AbstractChartCustomizer) { ((AbstractChartCustomizer) chartCustomizer).init(fillContext.getFiller(), getDataset()); } } renderer = SpiderChartRendererEvaluator.evaluateRenderer( element, spiderChartSharedBean, chartCustomizer, JRChart.RENDER_TYPE_DRAW, SpiderChartRendererEvaluator.FILL_DATASET); } public JRPrintElement fill() { JRComponentElement element = fillContext.getComponentElement(); JRTemplateImage templateImage = new JRTemplateImage(fillContext.getElementOrigin(), fillContext.getDefaultStyleProvider()); templateImage.setStyle(fillContext.getElementStyle()); templateImage.setLinkType(getLinkType()); templateImage.setLinkTarget(getLinkTarget()); templateImage = deduplicate(templateImage); JRTemplatePrintImage image = new JRTemplatePrintImage(templateImage, elementId); image.setX(element.getX()); image.setY(fillContext.getElementPrintY()); image.setWidth(element.getWidth()); image.setHeight(element.getHeight()); if (isEvaluateNow()) { copy(image); } else { fillContext.registerDelayedEvaluation(image, chartComponent.getEvaluationTime(), chartComponent.getEvaluationGroup()); } return image; } public FillPrepareResult prepare(int availableHeight) { return FillPrepareResult.PRINT_NO_STRETCH; } public JRFillCloneable createClone(JRFillCloneFactory factory) { throw new UnsupportedOperationException(); } public void evaluateDelayedElement(JRPrintElement element, byte evaluation) throws JRException { evaluateRenderer(evaluation); copy((JRPrintImage) element); } protected void copy(JRPrintImage printImage) { printImage.setRenderer(getRenderer()); printImage.setAnchorName(getAnchorName()); printImage.setHyperlinkReference(getHyperlinkReference()); printImage.setHyperlinkAnchor(getHyperlinkAnchor()); printImage.setHyperlinkPage(getHyperlinkPage()); printImage.setHyperlinkTooltip(getHyperlinkTooltip()); printImage.setBookmarkLevel(getBookmarkLevel()); printImage.setHyperlinkParameters(hyperlinkParameters); // transferProperties(printImage); } protected ChartHyperlinkProvider getHyperlinkProvider() { return chartHyperlinkProvider; } /** * @return the chartSettings */ public FillChartSettings getChartSettings() { return chartSettings; } /** * @return the dataset */ public FillSpiderDataset getDataset() { return dataset; } /** * @return the plot */ public FillSpiderPlot getPlot() { return plot; } /** * @return the maxValue */ public Double getMaxValue() { return maxValue; } /** * @return the titleText */ public String getTitleText() { return titleText; } /** * @return the subtitleText */ public String getSubtitleText() { return subtitleText; } /** * @return the anchorName */ public String getAnchorName() { return anchorName; } /** * @return the hyperlinkReference */ public String getHyperlinkReference() { return hyperlinkReference; } /** * @return the hyperlinkAnchor */ public String getHyperlinkAnchor() { return hyperlinkAnchor; } /** * @return the hyperlinkPage */ public Integer getHyperlinkPage() { return hyperlinkPage; } /** * @return the hyperlinkTooltip */ public String getHyperlinkTooltip() { return hyperlinkTooltip; } /** * @return the hyperlinkTooltip */ public Integer getBookmarkLevel() { return bookmarkLevel; } /** * @return the expressionEvaluator */ public JRFillExpressionEvaluator getExpressionEvaluator() { return expressionEvaluator; } /** * @return the renderer */ public JRRenderable getRenderer() { return renderer; } public String getLinkType() { return getChartSettings().getLinkType(); } public String getLinkTarget() { return getChartSettings().getLinkTarget(); } /** * @return the hyperlinkParameters */ public JRPrintHyperlinkParameters getHyperlinkParameters() { return hyperlinkParameters; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderChartSharedBean.java0000644000175000017500000000676311632162655033655 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import java.io.Serializable; import net.sf.jasperreports.charts.util.ChartHyperlinkProvider; import net.sf.jasperreports.engine.JRConstants; /** * * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: SpiderChartSharedBean.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SpiderChartSharedBean implements Serializable { /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private String renderType; private Double maxValue; private String titleText; private String subtitleText; private ChartHyperlinkProvider hyperlinkProvider; private SpiderDataset dataset; public SpiderChartSharedBean() { } public SpiderChartSharedBean( String renderType, Double maxValue, String titleText, String subtitleText, ChartHyperlinkProvider hyperlinkProvider, SpiderDataset dataset ) { setRenderType(renderType); setMaxValue(maxValue); setTitleText(titleText); setSubtitleText(subtitleText); setHyperlinkProvider(hyperlinkProvider); setDataset(dataset); } public ChartHyperlinkProvider getHyperlinkProvider() { return hyperlinkProvider; } /** * @return the maxValue */ public Double getMaxValue() { return maxValue; } /** * @return the titleText */ public String getTitleText() { return titleText; } /** * @return the subtitleText */ public String getSubtitleText() { return subtitleText; } /** * @return the renderType */ public String getRenderType() { return renderType; } /** * @param renderType the renderType to set */ public void setRenderType(String renderType) { this.renderType = renderType; } /** * @param hyperlinkProvider the ChartHyperlinkProvider to set */ public void setHyperlinkProvider(ChartHyperlinkProvider hyperlinkProvider) { this.hyperlinkProvider = hyperlinkProvider; } /** * @param maxValue the maxValue to set */ public void setMaxValue(Double maxValue) { this.maxValue = maxValue; } /** * @param titleText the titleText to set */ public void setTitleText(String titleText) { this.titleText = titleText; } /** * @param subtitleText the subtitleText to set */ public void setSubtitleText(String subtitleText) { this.subtitleText = subtitleText; } /** * @return the dataset */ public SpiderDataset getDataset() { return dataset; } /** * @param dataset the dataset to set */ public void setDataset(SpiderDataset dataset) { this.dataset = dataset; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderChartXmlWriter.java0000644000175000017500000003331711632162655033611 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import java.io.IOException; import net.sf.jasperreports.charts.JRCategorySeries; import net.sf.jasperreports.components.charts.ChartSettings; import net.sf.jasperreports.engine.JRAnchor; import net.sf.jasperreports.engine.JRFont; import net.sf.jasperreports.engine.JRHyperlinkParameter; 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.type.EvaluationTimeEnum; import net.sf.jasperreports.engine.type.HyperlinkTargetEnum; import net.sf.jasperreports.engine.type.HyperlinkTypeEnum; 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; /** * * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: SpiderChartXmlWriter.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SpiderChartXmlWriter implements ComponentXmlWriter { public static final String ELEMENT_spiderChart = "spiderChart"; public static final String ELEMENT_chartSettings = "chartSettings"; public static final String ELEMENT_spiderDataset = "spiderDataset"; public static final String ELEMENT_spiderPlot = "spiderPlot"; public static final String ELEMENT_maxValueExpression = "maxValueExpression"; public static final String ATTRIBUTE_rotation = "rotation"; public static final String ATTRIBUTE_tableOrder = "tableOrder"; public static final String ATTRIBUTE_webFilled = "isWebFilled"; public static final String ATTRIBUTE_startAngle = "startAngle"; public static final String ATTRIBUTE_headPercent = "headPercent"; public static final String ATTRIBUTE_interiorGap = "interiorGap"; public static final String ATTRIBUTE_axisLineColor = "axisLineColor"; public static final String ATTRIBUTE_axisLineWidth = "axisLineWidth"; public static final String ATTRIBUTE_labelGap = "labelGap"; public static final String ATTRIBUTE_labelColor = "labelColor"; public void writeToXml(ComponentKey componentKey, Component component, JRXmlWriter reportWriter) throws IOException { SpiderChartComponent spiderChartComponent = (SpiderChartComponent) component; JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); String namespaceURI = componentKey.getNamespace(); String schemaLocation = ComponentsEnvironment .getComponentsBundle(namespaceURI).getXmlParser().getPublicSchemaLocation(); XmlNamespace componentNamespace = new XmlNamespace(namespaceURI, componentKey.getNamespacePrefix(), schemaLocation); writer.startElement(ELEMENT_spiderChart, componentNamespace); writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationTime, spiderChartComponent.getEvaluationTime(), EvaluationTimeEnum.NOW); if (spiderChartComponent.getEvaluationTime() == EvaluationTimeEnum.GROUP) { writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_evaluationGroup, spiderChartComponent.getEvaluationGroup()); } ChartSettings chartSettings = spiderChartComponent.getChartSettings(); writeChart(chartSettings, writer, reportWriter, componentNamespace); SpiderDataset dataset = (SpiderDataset)spiderChartComponent.getDataset(); writeSpiderDataSet(dataset, writer, reportWriter, componentNamespace); SpiderPlot spiderPlot = (SpiderPlot)spiderChartComponent.getPlot(); writeSpiderPlot(spiderPlot, chartSettings, writer, componentNamespace); writer.closeElement();//spiderChart } /** * */ private void writeChart(ChartSettings chartSettings, JRXmlWriteHelper writer, JRXmlWriter reportWriter, XmlNamespace namespace) throws IOException { writer.startElement(ELEMENT_chartSettings, namespace); writer.addAttribute(JRXmlConstants.ATTRIBUTE_isShowLegend, chartSettings.getShowLegend()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_backcolor, chartSettings.getBackcolor()); writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_hyperlinkType, chartSettings.getLinkType(), HyperlinkTypeEnum.NONE.getName()); writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_hyperlinkTarget, chartSettings.getLinkTarget(), HyperlinkTargetEnum.SELF.getName()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_bookmarkLevel, chartSettings.getBookmarkLevel(), JRAnchor.NO_BOOKMARK); writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_customizerClass, chartSettings.getCustomizerClass()); writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_renderType, chartSettings.getRenderType()); // write title writer.startElement(JRXmlConstants.ELEMENT_chartTitle, JRXmlWriter.JASPERREPORTS_NAMESPACE); writer.addAttribute(JRXmlConstants.ATTRIBUTE_position, chartSettings.getTitlePosition()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_color, chartSettings.getTitleColor()); writeFont(chartSettings.getTitleFont(), writer); if (chartSettings.getTitleExpression() != null) { writer.writeExpression(JRXmlConstants.ELEMENT_titleExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, chartSettings.getTitleExpression()); } writer.closeElement(); // write subtitle writer.startElement(JRXmlConstants.ELEMENT_chartSubtitle, JRXmlWriter.JASPERREPORTS_NAMESPACE); writer.addAttribute(JRXmlConstants.ATTRIBUTE_color, chartSettings.getSubtitleColor()); writeFont(chartSettings.getSubtitleFont(), writer); if (chartSettings.getSubtitleExpression() != null) { writer.writeExpression(JRXmlConstants.ELEMENT_subtitleExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, chartSettings.getSubtitleExpression()); } writer.closeElement(); // write chartLegend writer.startElement(JRXmlConstants.ELEMENT_chartLegend, JRXmlWriter.JASPERREPORTS_NAMESPACE); if (chartSettings.getLegendColor() != null) { writer.addAttribute(JRXmlConstants.ATTRIBUTE_textColor, chartSettings.getLegendColor()); } if (chartSettings.getLegendBackgroundColor() != null) { writer.addAttribute(JRXmlConstants.ATTRIBUTE_backgroundColor, chartSettings.getLegendBackgroundColor()); } writer.addAttribute(JRXmlConstants.ATTRIBUTE_position, chartSettings.getLegendPosition()); writeFont(chartSettings.getLegendFont(), writer); writer.closeElement(); writer.writeExpression(JRXmlConstants.ELEMENT_anchorNameExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, chartSettings.getAnchorNameExpression()); writer.writeExpression(JRXmlConstants.ELEMENT_hyperlinkReferenceExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, chartSettings.getHyperlinkReferenceExpression()); writer.writeExpression(JRXmlConstants.ELEMENT_hyperlinkAnchorExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, chartSettings.getHyperlinkAnchorExpression()); writer.writeExpression(JRXmlConstants.ELEMENT_hyperlinkPageExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, chartSettings.getHyperlinkPageExpression()); writer.writeExpression(JRXmlConstants.ELEMENT_hyperlinkTooltipExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, chartSettings.getHyperlinkTooltipExpression()); writeHyperlinkParameters(chartSettings.getHyperlinkParameters(), writer); writer.closeElement(); } private void writeSpiderDataSet(SpiderDataset dataset, JRXmlWriteHelper writer, JRXmlWriter reportWriter, XmlNamespace namespace) throws IOException { writer.startElement(ELEMENT_spiderDataset, namespace); reportWriter.writeElementDataset(dataset); /* */ JRCategorySeries[] categorySeries = dataset.getSeries(); if (categorySeries != null && categorySeries.length > 0) { for(int i = 0; i < categorySeries.length; i++) { writeCategorySeries(categorySeries[i], writer, reportWriter); } } writer.closeElement(); } /** * */ private void writeCategorySeries(JRCategorySeries categorySeries, JRXmlWriteHelper writer, JRXmlWriter reportWriter) throws IOException { writer.startElement(JRXmlConstants.ELEMENT_categorySeries, JRXmlWriter.JASPERREPORTS_NAMESPACE); writer.writeExpression(JRXmlConstants.ELEMENT_seriesExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, categorySeries.getSeriesExpression()); writer.writeExpression(JRXmlConstants.ELEMENT_categoryExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, categorySeries.getCategoryExpression()); writer.writeExpression(JRXmlConstants.ELEMENT_valueExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, categorySeries.getValueExpression()); writer.writeExpression(JRXmlConstants.ELEMENT_labelExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, categorySeries.getLabelExpression()); reportWriter.writeHyperlink(JRXmlConstants.ELEMENT_itemHyperlink, JRXmlWriter.JASPERREPORTS_NAMESPACE, categorySeries.getItemHyperlink()); writer.closeElement(); } private void writeFont(JRFont font, JRXmlWriteHelper writer) throws IOException { if (font != null) { writer.startElement(JRXmlConstants.ELEMENT_font, JRXmlWriter.JASPERREPORTS_NAMESPACE); writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_fontName, font.getOwnFontName()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_size, font.getOwnFontSize()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_isBold, font.isOwnBold()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_isItalic, font.isOwnItalic()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_isUnderline, font.isOwnUnderline()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_isStrikeThrough, font.isOwnStrikeThrough()); writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_pdfFontName, font.getOwnPdfFontName()); writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_pdfEncoding, font.getOwnPdfEncoding()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_isPdfEmbedded, font.isOwnPdfEmbedded()); writer.closeElement(true); } } private void writeHyperlinkParameters(JRHyperlinkParameter[] parameters, JRXmlWriteHelper writer) throws IOException { if (parameters != null) { for (int i = 0; i < parameters.length; i++) { JRHyperlinkParameter parameter = parameters[i]; writeHyperlinkParameter(parameter, writer); } } } private void writeHyperlinkParameter(JRHyperlinkParameter parameter, JRXmlWriteHelper writer) throws IOException { if (parameter != null) { writer.startElement(JRXmlConstants.ELEMENT_hyperlinkParameter, JRXmlWriter.JASPERREPORTS_NAMESPACE); writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, parameter.getName()); writer.writeExpression(JRXmlConstants.ELEMENT_hyperlinkParameterExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, parameter.getValueExpression()); writer.closeElement(); } } private void writeSpiderPlot(SpiderPlot spiderPlot, ChartSettings chartSettings, JRXmlWriteHelper writer, XmlNamespace namespace) throws IOException { writer.startElement(ELEMENT_spiderPlot, namespace); writer.addAttribute(ATTRIBUTE_rotation, spiderPlot.getRotation()); writer.addAttribute(ATTRIBUTE_tableOrder, spiderPlot.getTableOrder()); writer.addAttribute(ATTRIBUTE_webFilled, spiderPlot.getWebFilled()); writer.addAttribute(ATTRIBUTE_startAngle, spiderPlot.getStartAngle()); writer.addAttribute(ATTRIBUTE_headPercent, spiderPlot.getHeadPercent()); writer.addAttribute(ATTRIBUTE_interiorGap, spiderPlot.getInteriorGap()); writer.addAttribute(ATTRIBUTE_axisLineColor, spiderPlot.getAxisLineColor()); writer.addAttribute(ATTRIBUTE_axisLineWidth, spiderPlot.getAxisLineWidth()); writer.addAttribute(ATTRIBUTE_labelGap, spiderPlot.getLabelGap()); writer.addAttribute(ATTRIBUTE_labelColor, spiderPlot.getLabelColor()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_backcolor, spiderPlot.getBackcolor()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_backgroundAlpha, spiderPlot.getBackgroundAlpha()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_foregroundAlpha, spiderPlot.getForegroundAlpha()); //FIXME: series colors // writeSeriesColors(spiderPlot.getSeriesColors(), writer); writeLabelFont(spiderPlot.getLabelFont(), writer); writer.writeExpression(ELEMENT_maxValueExpression, namespace, spiderPlot.getMaxValueExpression()); writer.closeElement(true); } /* private void writeSeriesColors(SortedSet seriesColors, JRXmlWriteHelper writer) throws IOException { if (seriesColors == null || seriesColors.size() == 0) { return; } JRSeriesColor[] colors = (JRSeriesColor[])seriesColors.toArray(new JRSeriesColor[seriesColors.size()]); for (int i = 0; i < colors.length; i++) { writer.startElement(JRXmlConstants.ELEMENT_seriesColor); writer.addAttribute(JRXmlConstants.ATTRIBUTE_seriesOrder, colors[i].getSeriesOrder()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_color, colors[i].getColor()); writer.closeElement(); } } */ private void writeLabelFont(JRFont labelFont, JRXmlWriteHelper writer) throws IOException { if (labelFont != null) { writer.startElement(JRXmlConstants.ELEMENT_labelFont, JRXmlWriter.JASPERREPORTS_NAMESPACE); writeFont(labelFont, writer); writer.closeElement(); } } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderChartDesignConverter.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/spiderchart/SpiderChartDesignConverter.0000644000175000017500000000656711632162655034122 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.spiderchart; import net.sf.jasperreports.components.charts.ChartSettings; import net.sf.jasperreports.engine.JRChart; 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.OnErrorTypeEnum; import net.sf.jasperreports.engine.type.ScaleImageEnum; import net.sf.jasperreports.engine.util.JRExpressionUtil; import net.sf.jasperreports.engine.util.JRProperties; /** * Spider Chart preview converter. * * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: SpiderChartDesignConverter.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SpiderChartDesignConverter implements ComponentDesignConverter { /** * */ public JRPrintElement convert(ReportConverter reportConverter, JRComponentElement element) { SpiderChartComponent chartComponent = (SpiderChartComponent) element.getComponent(); if (chartComponent == null) { return null; } JRBasePrintImage printImage = new JRBasePrintImage(reportConverter.getDefaultStyleProvider()); ChartSettings chartSettings = chartComponent.getChartSettings(); reportConverter.copyBaseAttributes(element, printImage); //TODO: spiderchart box // printImage.copyBox(element.getLineBox()); printImage.setAnchorName(JRExpressionUtil.getExpressionText(chartSettings.getAnchorNameExpression())); printImage.setBookmarkLevel(chartSettings.getBookmarkLevel()); printImage.setLinkType(chartSettings.getLinkType()); printImage.setOnErrorType(OnErrorTypeEnum.ICON); printImage.setScaleImage(ScaleImageEnum.CLIP); SpiderChartSharedBean spiderchartBean = new SpiderChartSharedBean( chartSettings.getRenderType(), SpiderChartRendererEvaluator.SAMPLE_MAXVALUE, JRExpressionUtil.getExpressionText(chartSettings.getTitleExpression()), JRExpressionUtil.getExpressionText(chartSettings.getSubtitleExpression()), null, null ); printImage.setRenderer(SpiderChartRendererEvaluator.evaluateRenderer( element, spiderchartBean, null, JRProperties.getProperty(reportConverter.getReport(), JRChart.PROPERTY_CHART_RENDER_TYPE), SpiderChartRendererEvaluator.SAMPLE_DATASET)); return printImage; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/0000755000175000017500000000000011654071732025327 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortElementUtils.java0000644000175000017500000000541011640566660031460 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.Date; import java.util.HashMap; import java.util.Map; import net.sf.jasperreports.engine.type.SortOrderEnum; /** * @author Narcis Marcu (narcism@users.sourceforge.net) * @version $Id: SortElementUtils.java 4631 2011-09-27 12:23:03Z narcism $ */ public class SortElementUtils { private static Map sortOrderMapping = new HashMap(); static { sortOrderMapping.put(SortElement.SORT_ORDER_ASC, SortOrderEnum.ASCENDING); sortOrderMapping.put(SortElement.SORT_ORDER_DESC, SortOrderEnum.DESCENDING); } public static String[] extractColumnInfo(String sortColumn) { return sortColumn.split(SortElement.SORT_COLUMN_TOKEN_SEPARATOR); } public static String packSortColumnInfo(String columnName, String columnType, String sortOrder) { StringBuffer sb = new StringBuffer(); sb.append(columnName) .append(SortElement.SORT_COLUMN_TOKEN_SEPARATOR) .append(columnType) .append(SortElement.SORT_COLUMN_TOKEN_SEPARATOR) .append(sortOrder); return sb.toString(); } public static boolean isValidSortData(String sortData) { return sortData != null && sortData.indexOf(SortElement.SORT_COLUMN_TOKEN_SEPARATOR) >= 0 && sortData.split(SortElement.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 (Date.class.isAssignableFrom(clazz)) { result = FilterTypesEnum.DATE; } return result; } }././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FilterTypeDateOperatorsEnum.propertiesjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FilterTypeDateOperatorsEnum.proper0000644000175000017500000000032511642264406034170 0ustar drazzibdrazzibEQUALS = 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././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FilterTypeTextOperatorsEnum.propertiesjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FilterTypeTextOperatorsEnum.proper0000644000175000017500000000035111642264406034236 0ustar drazzibdrazzibEQUALS = 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 withjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortElement.java0000644000175000017500000000751211647512043030435 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRGenericElementType; import net.sf.jasperreports.engine.JRParameter; import net.sf.jasperreports.engine.util.JRProperties; import net.sf.jasperreports.engine.xml.JRXmlConstants; /** * @author Narcis Marcu (narcism@users.sourceforge.net) * @version $Id: SortElement.java 4706 2011-10-18 08:57:28Z narcism $ */ public interface SortElement { public static final String SORT_ELEMENT_NAME = "sort"; public static final JRGenericElementType SORT_ELEMENT_TYPE = new JRGenericElementType(JRXmlConstants.JASPERREPORTS_NAMESPACE, SORT_ELEMENT_NAME); 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 PARAMETER_SORT_COLUMN_NAME = "sortColumnName"; public static final String PARAMETER_SORT_COLUMN_LABEL = "sortColumnLabel"; public static final String PARAMETER_SORT_COLUMN_TYPE = "sortColumnType"; public static final String PARAMETER_SORT_HANDLER_COLOR = "sortHandlerColor"; public static final String PARAMETER_SORT_HANDLER_FONT_SIZE = "sortHandlerFontSize"; public static final String PARAMETER_SORT_HANDLER_VERTICAL_ALIGN = "sortHandlerVerticalAlign"; public static final String PARAMETER_SORT_HANDLER_HORIZONTAL_ALIGN = "sortHandlerHorizontalAlign"; public static final String PARAMETER_SORT_HANDLER_FONT = "sortHandlerFont"; /** * */ public static final String REQUEST_PARAMETER_FILTER_FIELD = "jr.fltrFld"; public static final String REQUEST_PARAMETER_FILTER_VALUE_START = "jr.fltrVlStrt"; public static final String REQUEST_PARAMETER_FILTER_VALUE_END = "jr.fltrVlEnd"; public static final String REQUEST_PARAMETER_REMOVE_FILTER = "jr.rmvFltr"; public static final String REQUEST_PARAMETER_SORT_DATA = "jr.sort"; public static final String REQUEST_PARAMETER_DATASET_RUN = "jr.dsr";//FIXMEJIVE this parameter cannot uniquely identify a dataset run that repeats; check it public static final String REQUEST_PARAMETER_FILTER_TYPE = "jr.fltrTp"; public static final String REQUEST_PARAMETER_FILTER_TYPE_OPERATOR = "jr.fltrTpOprtr"; public static final String REQUEST_PARAMETER_FILTER_PATTERN = "jr.fltrPtrn"; public static final String PROPERTY_DATASET_RUN = JRProperties.PROPERTY_PREFIX + "export." + SortElement.REQUEST_PARAMETER_DATASET_RUN; public static final String PROPERTY_FILTER_TYPE = JRProperties.PROPERTY_PREFIX + "export." + SortElement.REQUEST_PARAMETER_FILTER_TYPE; public static final String PROPERTY_FILTER_PATTERN = JRProperties.PROPERTY_PREFIX + "export." + SortElement.REQUEST_PARAMETER_FILTER_PATTERN; public static final String SORT_FIELDS_PARAM_SUFFIX = "." + JRParameter.SORT_FIELDS; public static final String FILTER_FIELDS_PARAM_SUFFIX = "." + JRParameter.FILTER; }jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortComponentFill.java0000644000175000017500000001462411644765204031625 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRComponentElement; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRGenericPrintElement; import net.sf.jasperreports.engine.JRPrintElement; import net.sf.jasperreports.engine.component.BaseFillComponent; import net.sf.jasperreports.engine.component.FillPrepareResult; import net.sf.jasperreports.engine.design.JRAbstractCompiler; 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.JRFillField; import net.sf.jasperreports.engine.fill.JRFillVariable; 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.SortFieldTypeEnum; /** * * @author Narcis Marcu (narcism@users.sourceforge.net) * @version $Id: SortComponentFill.java 4648 2011-10-10 12:50:53Z lucianc $ */ public class SortComponentFill extends BaseFillComponent { private final SortComponent sortComponent; private JRTemplateGenericElement template; private JRTemplateGenericPrintElement printElement; public SortComponentFill(SortComponent sortComponent) { this.sortComponent = sortComponent; } protected SortComponent getSortComponent() { return sortComponent; } protected boolean isEvaluateNow() { return sortComponent.getEvaluationTime() == EvaluationTimeEnum.NOW; } public void evaluate(byte evaluation) throws JRException { if (isEvaluateNow()) { evaluateSortComponent(evaluation); } } protected void evaluateSortComponent(byte evaluation) throws JRException { } public JRPrintElement fill() { printElement.setY(fillContext.getElementPrintY()); return printElement; } public FillPrepareResult prepare(int availableHeight) { FillPrepareResult result = null; JRComponentElement element = fillContext.getComponentElement(); if (template == null) { template = new JRTemplateGenericElement( fillContext.getElementOrigin(), fillContext.getDefaultStyleProvider(), SortElement.SORT_ELEMENT_TYPE); template.setMode(sortComponent.getContext().getComponentElement().getModeValue()); template.setBackcolor(sortComponent.getContext().getComponentElement().getBackcolor()); template.setForecolor(sortComponent.getContext().getComponentElement().getForecolor()); template = deduplicate(template); } printElement = new JRTemplateGenericPrintElement(template, elementId); printElement.setX(element.getX()); printElement.setWidth(element.getWidth()); printElement.setHeight(element.getHeight()); if (isEvaluateNow()) { copy(printElement); } else { fillContext.registerDelayedEvaluation(printElement, sortComponent.getEvaluationTime(), null); } result = FillPrepareResult.PRINT_NO_STRETCH; return result; } public JRFillCloneable createClone(JRFillCloneFactory factory) { throw new UnsupportedOperationException(); } public void evaluateDelayedElement(JRPrintElement element, byte evaluation) throws JRException { evaluateSortComponent(evaluation); copy((JRGenericPrintElement) element); } protected void copy(JRGenericPrintElement printElement) { printElement.setParameterValue(SortElement.PARAMETER_SORT_COLUMN_NAME, sortComponent.getSortFieldName()); printElement.setParameterValue(SortElement.PARAMETER_SORT_COLUMN_TYPE, sortComponent.getSortFieldType().getName()); printElement.setParameterValue(SortElement.PARAMETER_SORT_HANDLER_COLOR, sortComponent.getHandlerColor()); printElement.setParameterValue(SortElement.PARAMETER_SORT_HANDLER_FONT, sortComponent.getSymbolFont()); if (sortComponent.getSymbolFont() != null ) { printElement.setParameterValue(SortElement.PARAMETER_SORT_HANDLER_FONT_SIZE, String.valueOf(sortComponent.getSymbolFont().getFontSize())); } if (sortComponent.getHandlerHorizontalAlign() != null) { printElement.setParameterValue(SortElement.PARAMETER_SORT_HANDLER_HORIZONTAL_ALIGN, sortComponent.getHandlerHorizontalAlign().getName()); } if (sortComponent.getHandlerVerticalAlign() != null) { printElement.setParameterValue(SortElement.PARAMETER_SORT_HANDLER_VERTICAL_ALIGN, sortComponent.getHandlerVerticalAlign().getName()); } FilterTypesEnum filterType = getFilterType(); if (filterType != null) { printElement.getPropertiesMap().setProperty(SortElement.PROPERTY_FILTER_TYPE, filterType.getName()); } String datasetName = JRAbstractCompiler.getUnitName( fillContext.getFiller().getJasperReport(), fillContext.getFillDataset()); printElement.getPropertiesMap().setProperty(SortElement.PROPERTY_DATASET_RUN, datasetName); } protected FilterTypesEnum getFilterType() { SortFieldTypeEnum type = sortComponent.getSortFieldType(); String name = sortComponent.getSortFieldName(); JRFillDataset dataset = fillContext.getFillDataset(); FilterTypesEnum filterType = null; if (SortFieldTypeEnum.FIELD.equals(type)) { JRFillField field = dataset.getFillField(name); filterType = SortElementUtils.getFilterType(field.getValueClass()); } else if (SortFieldTypeEnum.VARIABLE.equals(type)) { JRFillVariable variable = dataset.getFillVariable(name); filterType = SortElementUtils.getFilterType(variable.getValueClass()); } return filterType; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FieldTextComparator.java0000644000175000017500000000514211650262340032105 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRRuntimeException; /** * @author Narcis Marcu (narcism@users.sourceforge.net) * @version $Id: FieldTextComparator.java 4731 2011-10-21 08:43:23Z narcism $ */ public class FieldTextComparator extends AbstractFieldComparator { public FieldTextComparator() { } @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(); String lcCompareTo = compareTo.toLowerCase(); switch (textEnum) { case CONTAINS: result = lcCompareTo.contains(lcCompareStart); break; case DOES_NOT_CONTAIN: result = !lcCompareTo.contains(lcCompareStart); break; case DOES_NOT_END_WITH: result = !lcCompareTo.endsWith(lcCompareStart); break; case DOES_NOT_START_WITH: result = !lcCompareTo.startsWith(lcCompareStart); break; case ENDS_WITH: result = lcCompareTo.endsWith(lcCompareStart); break; case EQUALS: result = lcCompareTo.equals(lcCompareStart); break; case IS_NOT_EQUAL_TO: result = !lcCompareTo.equals(lcCompareStart); break; case STARTS_WITH: result = lcCompareTo.startsWith(lcCompareStart); break; } } return result; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FilterTypesEnum.java0000644000175000017500000000442311640566660031300 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: FilterTypesEnum.java 4633 2011-09-27 12:24:10Z narcism $ */ public enum FilterTypesEnum implements JREnum { NUMERIC((byte)1, "Numeric"), TEXT((byte)2, "Text"), DATE((byte)3, "Date"); /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient byte value; private final transient String name; private FilterTypesEnum(byte value, String name) { this.value = value; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(value); } /** * */ public final byte getValue() { return value; } /** * */ public String getName() { return name; } /** * */ public static FilterTypesEnum getByName(String name) { return (FilterTypesEnum)EnumUtil.getByName(values(), name); } /** * */ public static FilterTypesEnum getByValue(Byte value) { return (FilterTypesEnum)EnumUtil.getByValue(values(), value); } /** * */ public static FilterTypesEnum getByValue(byte value) { return getByValue(new Byte(value)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/resources/0000755000175000017500000000000011654071732027341 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/resources/SortElementHtmlTemplate.vmjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/resources/SortElementHtmlTemplate.0000644000175000017500000000725511652456470034141 0ustar drazzibdrazzib #if (${isSorted}) #end #if (${isFiltered}) #end #if (${isFilterable}) #endjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/resources/sort.js0000644000175000017500000002757511652456470030712 0ustar drazzibdrazzib/** * Defines 'sort' module in JasperReports namespace */ (function(global) { if (typeof global.JasperReports.modules.sort !== 'undefined') { return; } var js = { filters: { filterContainerId: "jasperreports_filters" } }; /** * Creates a unique filter div * * @param uniqueId * @param arrFilterDiv an array with div's html * @param filtersJsonString a JSON string of a java.util.List */ js.createFilterDiv = function (uniqueId, arrFilterDiv, filtersJsonString) { var gm = global.JasperReports.modules.global, filterContainerId = js.filters.filterContainerId, filterContainerDiv = "
", fcuid = '#' + filterContainerId, uid = '#' + uniqueId; // if filter container does not exist, create it if (jQuery(fcuid).size() == 0) { jQuery('body').append(filterContainerDiv); } // if filter with id of 'uniqueId' does not exist, append it to filter container if (jQuery(uid).size() == 0) { jQuery(fcuid).append(arrFilterDiv.join('')); var filterDiv = jQuery(uid); // attach filter form events jQuery('.hidefilter', filterDiv).bind(('createTouch' in document) ? 'touchend' : 'click', function(event){ jQuery(this).parent().hide(); }); filterDiv .draggable(); // 'Enter' key press for filter value triggers 'contextual' submit jQuery('.filterValue', filterDiv).bind('keypress', function(event) { if (event.keyCode == 13) { event.preventDefault(); if ('createTouch' in document) { // trigger does not seem to work on safari mobile; doing workaround var el = jQuery('.submitFilter', filterDiv).get(0); var evt = document.createEvent("MouseEvents"); evt.initMouseEvent("touchend", true, true); el.dispatchEvent(evt); } else { jQuery('.submitFilter', filterDiv).trigger('click'); } } }); jQuery('.submitFilter', filterDiv).live(('createTouch' in document) ? 'touchend' : 'click', function(event){ var params = {}, parentForm = jQuery(this).parent(), currentHref = parentForm.attr("action"), parentFilterDiv = jQuery(this).closest('.filterdiv'), contextStartPoint = jQuery('.' + parentFilterDiv.attr('data-forsortlink') + ':first'); // extract form params jQuery('.postable', parentForm).each(function(){ // prevent disabled inputs to get posted if(!jQuery(this).is(':disabled')) { params[this.name] = this.value; } }); var ctx = gm.getExecutionContext(contextStartPoint, currentHref, params); if (ctx) { parentFilterDiv.hide(); ctx.run(); } }); // show the second filter value for options containing 'between' jQuery('.filterOperatorTypeValueSelector', filterDiv).live('change', function (event) { var optionValue = jQuery(this).val(); if (optionValue && optionValue.toLowerCase().indexOf('between') != -1) { jQuery('.filterValueEnd', filterDiv) .removeClass('hidden') .removeAttr('disabled'); } else { jQuery('.filterValueEnd', filterDiv) .addClass('hidden') .attr('disabled', true); } }); jQuery('.clearFilter', filterDiv).live(('createTouch' in document) ? 'touchend' : 'click', function(event){ var params = {}, parentForm = jQuery(this).parent(), currentHref = parentForm.attr("action"), parentFilterDiv = jQuery(this).closest('.filterdiv'), contextStartPoint = jQuery('.' + parentFilterDiv.attr('data-forsortlink') + ':first'); // extract form params jQuery('.forClear', parentForm).each(function(){ // prevent disabled inputs to get posted if(!jQuery(this).is(':disabled')) { params[this.name] = this.value; } }); var ctx = gm.getExecutionContext(contextStartPoint, currentHref, params); if (ctx) { parentFilterDiv.hide(); ctx.run(); } }); } else { // update existing filter with values from filtersJsonString var arrFilters = jQuery.parseJSON(filtersJsonString); var found = false; if (arrFilters) { var filterDiv = jQuery(uid), currentFilterField = jQuery('.filterField', filterDiv).val(); for (var i=0, ln = arrFilters.length; i < ln; i++) { var filter = arrFilters[i]; if (filter.field === currentFilterField) { jQuery('.filterValueStart', filterDiv).val(filter.filterValueStart); jQuery('.filterValueEnd', filterDiv).val(filter.filterValueEnd); jQuery('.filterOperatorTypeValueSelector', filterDiv).val(filter.filterTypeOperator); if (filter.filterTypeOperator && filter.filterTypeOperator.toLowerCase().indexOf('between') != -1) { jQuery('.filterValueEnd', filterDiv).removeClass('hidden').removeAttr('disabled'); } else { jQuery('.filterValueEnd', filterDiv).addClass('hidden').attr('disabled', true); } // show clear button jQuery('.clearFilter', filterDiv).show(); found = true; break; } } // reset filter controls if (!found) { jQuery('.filterValueStart', filterDiv).val(""); jQuery('.filterValueEnd', filterDiv).val(""); jQuery('.filterOperatorTypeValueSelector :selected', filterDiv).attr('selected', false); // hide clear button jQuery('.clearFilter', filterDiv).hide(); } } } }; js.isLongTouch = function(event) { if (!js.touchStartOn) return false; var isSameElement = event.target == js.touchStartOn.element; var holdTimeStamp = event.timeStamp - js.touchStartOn.timeStamp; return isSameElement && (holdTimeStamp > 400) && !event.scrollEvent; }; js.init = function() { var gm = global.JasperReports.modules.global, sortEvent = gm.events.SORT_INIT; // init should be done only once if (sortEvent.status === 'default') { // disable browser contextual menu when right-clicking jQuery(document).bind("contextmenu",function(e){ return false; }); if ('createTouch' in document) { var sortlinks = jQuery('.sortlink'); jQuery('document').bind("touchmove",function(event){ js.touchStartOn = undefined; }); sortlinks.live('click', function(event){ event.preventDefault(); event.stopPropagation(); return false; }); /* * Capture long touch on touchstart. Also prevent default. */ sortlinks.bind("touchstart",function(event){ event.preventDefault(); // change sortSymbol hover image var sortImage = jQuery('.sortSymbolImage', jQuery(this)); sortImage.attr("src", sortImage.attr('data-hover')); !event.isStartData && (js.touchStartOn = { element: event.target, timeStamp: event.timeStamp }); event.isStartData = true; }); /* * If long touch do not trigger anchor link. */ sortlinks.live('touchend', function(event){ event.preventDefault(); if(js.isLongTouch(event)) { event.stopPropagation(); return false; } var currentHref = jQuery(this).attr("href"), ctx = gm.getExecutionContext(this, currentHref, null); if (ctx) { ctx.run(); } }); /* * Show filter div on long touch */ sortlinks.bind('touchend', function(event) { event.preventDefault(); if (js.isLongTouch(event) || event.which == 3) { var filterDiv = jQuery('#' + jQuery(this).attr('data-filterid')); // hide all other open filters FIXMEJIVE: this will close all visible filters from all reports on the same page jQuery('.filterdiv').filter(':visible').each(function (index, element) { jQuery(element).hide(); }); var touch = event.changedTouches ? event.changedTouches[0] : event.originalEvent.changedTouches[0]; filterDiv.css({ position: 'absolute', 'z-index': 999998, left: touch.pageX + "px", top: touch.pageY + "px" }); filterDiv.show(); // change sortSymbol hover image var sortImage = jQuery('.sortSymbolImage', jQuery(this)); sortImage.attr("src", sortImage.attr('data-src')); } }); } else { // add event for clickable sortlinks (up/down arrows) // jQuery('.sortlink').live('click', function(event){ jQuery('a').live('click', function(event) { event.preventDefault(); var currentHref = jQuery(this).attr("href"), ctx = gm.getExecutionContext(this, currentHref, null); if (ctx) { ctx.run(); } }); /** * Show filter div when right-clicking the table header */ jQuery('.sortlink').live('mousedown', function(event) { if (event.which == 3) { var filterDiv = jQuery('#' + jQuery(this).attr('data-filterid')); // hide all other open filters FIXMEJIVE: this will close all visible filters from all reports on the same page jQuery('.filterdiv').filter(':visible').each(function (index, element) { jQuery(element).hide(); }); if (filterDiv.size() == 1) { filterDiv.css({ position: 'absolute', 'z-index': 999998, left: (event.pageX) + "px", top: (event.pageY) + "px" }); filterDiv.show(); } /* var copy_what = jQuery(this).attr('data-resizecolumn'), absDiv = "
", jqAbsDiv = jQuery('#absDiv'); if (jqAbsDiv.size() == 0) { jQuery('body').append(absDiv); jqAbsDiv = jQuery('#absDiv'); } jQuery('.' + copy_what).removeClass('selected').each(function (index, element) { jQuery(element).parent().clone().appendTo(jqAbsDiv); }); */ } }); jQuery('.sortlink').hover( function() { var target = jQuery('.sortSymbolImage', jQuery(this)); target.attr("src", target.attr('data-hover')); }, function() { var target = jQuery('.sortSymbolImage', jQuery(this)); target.attr("src", target.attr('data-src')); } ); /* jQuery('.sortlink').live('mouseover', function(event) { var resize_what = jQuery(this).attr('data-resizecolumn'); jQuery('.' + resize_what).addClass('selected'); }); jQuery('.sortlink').live('mouseout', function(event) { var resize_what = jQuery(this).attr('data-resizecolumn'); jQuery('.' + resize_what).removeClass('selected'); }); */ } sortEvent.status = 'finished'; gm.processEvent(sortEvent.name); } }; global.JasperReports.modules.sort = js; } (this));jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/resources/images/0000755000175000017500000000000011654071733030607 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/resources/images/filter_over.png0000644000175000017500000000067511652456470033650 0ustar drazzibdrazzibPNG  IHDRFsRGBbKGD pHYs  tIME  70̛==IDAT(ϝR1xZdEU <lr6Uht (L84 62iL4M#sQ$BVV+UK%)6d?doS.v P7W +;cKbFDO@$P5f+7Bh߮L(AI+3y Mn BƌjZ9ٖN KQpoTI d+ؖ#JqY=X|&4]@49lvٵ'~ϡ 9=cql!PIENDB`jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/resources/images/filter_wrong.png0000644000175000017500000000061411652456470034022 0ustar drazzibdrazzibPNG  IHDRFsRGBbKGD pHYs  tIME  ~o IDAT(ϥJAI) I!Xbg`geI*o1iMZؘ4KpmvbYş;;?v _ 1tT('UUdr`pbqQ}uPaCaq7jHFK68=eH7USBtvP>-.f]t(P{i[4u%vԺ]lgs= Ű뢵vU_d?l+>J4 N֍kduIENDB`jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/resources/images/filter.png0000644000175000017500000000043511652456470032607 0ustar drazzibdrazzibPNG  IHDRFsRGBbKGD pHYs  tIME  7 srIDAT(ϥ10Egr!Z/BNah5m`͑ԖpA˝y77j)sSq@nUnZӶg@ߐB~<}; SI BM57R]`0cG1-Qܶ (ӶyM:1^!>H IENDB`jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/resources/images/sort_asc_over.png0000644000175000017500000000060711652456470034173 0ustar drazzibdrazzibPNG  IHDRFsRGBbKGD pHYs  tIME  ;? IDAT(ϝR0tx^8|ky1t`(nvДJ7um*G 8*y3@Gwwa/Kd-HcIjX8۾cY\Υln{8$AW97Jh}n ٟ8ʃ_<˗ Yr8 io3yC!L}q7+1'RSt$tը+Ћ >ۣ~oZOԿIENDB`jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/resources/images/sort_asc.png0000644000175000017500000000031711652456470033136 0ustar drazzibdrazzibPNG  IHDRFsRGBbKGD pHYs  tIME  :(d}&OIDAT(c @&`a```Xb#""(r0 qM d"D|^a"ŏ')k)IENDB`jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/resources/images/delete_edit.gif0000644000175000017500000000167011620457200033537 0ustar drazzibdrazzibGIF89a```___cccbbbYYYlllkkkSSSgggNNNOOONNNSSSJJJvvvvvv}}}||||||xxxxxxxxxsssmmmmmmmmmffffff}}}!1,cHaxQpah"Z( +H|(ċ%@A@ *8a 

~?va#bTIENDB`jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortComponentSymbolFactory.java0000644000175000017500000000532211642264406033523 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.awt.Color; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.type.HorizontalAlignEnum; import net.sf.jasperreports.engine.type.SortFieldTypeEnum; import net.sf.jasperreports.engine.type.VerticalAlignEnum; import net.sf.jasperreports.engine.util.JRColorUtil; import net.sf.jasperreports.engine.xml.JRBaseFactory; import org.xml.sax.Attributes; /** * @author Narcis Marcu (narcism@users.sourceforge.net) * @version $Id: SortComponentSymbolFactory.java 4638 2011-09-28 15:24:57Z narcism $ */ public class SortComponentSymbolFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) throws JRException { SortComponent sortComponent = (SortComponent)digester.peek(); // Set the text color String attrValue = atts.getValue(SortComponent.PROPERTY_HANDLER_COLOR); if (attrValue != null && attrValue.length() > 0) { Color color = JRColorUtil.getColor(attrValue, null); sortComponent.setHandlerColor(color); } sortComponent.setSortFieldName(atts.getValue(SortComponent.PROPERTY_COLUMN_NAME)); SortFieldTypeEnum fieldType = SortFieldTypeEnum.getByName(atts.getValue(SortComponent.PROPERTY_COLUMN_TYPE)); if (fieldType != null) { sortComponent.setSortFieldType(fieldType); } HorizontalAlignEnum hAlign = HorizontalAlignEnum.getByName(atts.getValue(SortComponent.PROPERTY_HANDLER_HORIZONTAL_ALIGN)); if (hAlign != null) { sortComponent.setHandlerHorizontalAlign(hAlign); } VerticalAlignEnum vAlign = VerticalAlignEnum.getByName(atts.getValue(SortComponent.PROPERTY_HANDLER_VERTICAL_ALIGN)); if (vAlign != null) { sortComponent.setHandlerVerticalAlign(vAlign); } return sortComponent; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FieldDateComparator.java0000644000175000017500000000722511647512043032046 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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) * @version $Id: FieldDateComparator.java 4707 2011-10-18 08:58:14Z narcism $ */ 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, compareTo.getClass()); } if (valueEnd != null && valueEnd.length() > 0) { compareEnd = FormatUtils.getFormattedDate((DateFormat)formatter, valueEnd, compareTo.getClass()); } } @Override public boolean compare(String filterTypeOperator) { boolean defaultResult = true, result = defaultResult, resultPart1 = true, resultPart2 = true; try { initValues(); } catch (Exception e) { throw new JRRuntimeException(e); } FilterTypeDateOperatorsEnum dateEnum = FilterTypeDateOperatorsEnum.getByEnumConstantName(filterTypeOperator); switch (dateEnum) { case EQUALS: result = compareStart != null ? compareTo.compareTo(compareStart) == 0 : defaultResult; break; case IS_AFTER: result = compareStart != null ? compareTo.compareTo(compareStart) > 0 : defaultResult; break; case IS_BEFORE: result = compareStart != null ? compareTo.compareTo(compareStart) < 0 : defaultResult; break; case IS_BETWEEN: resultPart1 = compareStart != null ? compareTo.compareTo(compareStart) >= 0 : defaultResult; resultPart2 = compareEnd != null ? compareTo.compareTo(compareEnd) <= 0 : defaultResult; result = resultPart1 && resultPart2; break; case IS_NOT_BETWEEN: resultPart1 = compareStart != null ? compareTo.compareTo(compareStart) >= 0 : defaultResult; resultPart2 = compareEnd != null ? compareTo.compareTo(compareEnd) <= 0 : defaultResult; result = !(resultPart1 && resultPart2); break; case IS_NOT_EQUAL_TO: result = compareStart != null ? compareTo.compareTo(compareStart) != 0 : defaultResult; break; case IS_ON_OR_AFTER: result = compareStart != null ? compareTo.compareTo(compareStart) >= 0 : defaultResult; break; case IS_ON_OR_BEFORE: result = compareStart != null ? compareTo.compareTo(compareStart) <= 0 : defaultResult; break; } return result; } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortParameterContributorExtensionFactory.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortParameterContributorExtensionF0000644000175000017500000000372111632162654034303 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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 SortParameterContributorFactory}. * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: SortParameterContributorExtensionFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SortParameterContributorExtensionFactory implements ExtensionsRegistryFactory { private static final ExtensionsRegistry REGISTRY = new SingletonExtensionRegistry(ParameterContributorFactory.class, SortParameterContributorFactory.getInstance()); public ExtensionsRegistry createRegistry(String registryId, JRPropertiesMap properties) { return REGISTRY; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FieldFilter.java0000644000175000017500000000775211647512043030373 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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; /** * A dataset filter that matches String values based on substrings. * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: FieldFilter.java 4707 2011-10-18 08:58:14Z narcism $ */ public class FieldFilter implements DatasetFilter { private final String field; private String filterValueStart; private String filterValueEnd; private String filterType; private String filterTypeOperator; private String filterPattern; private DatasetFillContext context; private Boolean isValid; private FilterTypesEnum filterTypeEnum; private AbstractFieldComparator fieldComparator; /** * 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; } public void init(DatasetFillContext context) { this.context = context; this.filterTypeEnum = FilterTypesEnum.getByName(filterType); if (fieldComparator == null) { fieldComparator = FieldComparatorFactory .createFieldComparator( filterTypeEnum, filterPattern, context.getLocale(), (TimeZone) context.getParameterValue(JRParameter.REPORT_TIME_ZONE)); } } public boolean matches(EvaluationType evaluation) { Object value = context.getFieldValue(field, evaluation); if (value == null) { return false; } 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 void setFilterPattern(String filterPattern) { this.filterPattern = filterPattern; } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortParameterContributorFactory.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortParameterContributorFactory.ja0000644000175000017500000000401611632162654034217 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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) * @version $Id: SortParameterContributorFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public final class SortParameterContributorFactory implements ParameterContributorFactory { private static final SortParameterContributorFactory INSTANCE = new SortParameterContributorFactory(); private SortParameterContributorFactory() { } /** * */ public static SortParameterContributorFactory getInstance() { return INSTANCE; } /** * */ public List getContributors(ParameterContributorContext context) throws JRException { return Collections.singletonList(new SortParameterContributor(context)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortComponentDigester.java0000644000175000017500000000504411642264406032475 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRFont; import net.sf.jasperreports.engine.component.XmlDigesterConfigurer; import net.sf.jasperreports.engine.type.EvaluationTimeEnum; import net.sf.jasperreports.engine.xml.JRXmlConstants; import net.sf.jasperreports.engine.xml.XmlConstantPropertyRule; import org.apache.commons.digester.Digester; /** * @author Narcis Marcu (narcism@users.sourceforge.net) * @version $Id: SortComponentDigester.java 4638 2011-09-28 15:24:57Z narcism $ */ public class SortComponentDigester implements XmlDigesterConfigurer { public void configureDigester(Digester digester) { addSortComponentRules(digester); } public static void addSortComponentRules(Digester digester) { String sortComponentPattern = "*/componentElement/sort"; digester.addObjectCreate(sortComponentPattern, SortComponent.class.getName()); digester.addSetProperties(sortComponentPattern, new String[] { SortComponent.PROPERTY_EVALUATION_TIME, }, new String[0]); digester.addRule(sortComponentPattern, new XmlConstantPropertyRule( SortComponent.PROPERTY_EVALUATION_TIME, EvaluationTimeEnum.values())); digester.addFactoryCreate(sortComponentPattern + "/symbol", SortComponentSymbolFactory.class.getName()); digester.setRuleNamespaceURI(JRXmlConstants.JASPERREPORTS_NAMESPACE); digester.addFactoryCreate(sortComponentPattern + "/symbol/font", SortComponentSymbolFontFactory.class.getName()); digester.addSetNext(sortComponentPattern + "/symbol/font", "setSymbolFont", JRFont.class.getName()); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/AbstractFieldComparator.java0000644000175000017500000000431611647512043032732 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.util.DefaultFormatFactory; import net.sf.jasperreports.engine.util.FormatFactory; /** * @author Narcis Marcu (narcism@users.sourceforge.net) * @version $Id: AbstractFieldComparator.java 4707 2011-10-18 08:58:14Z narcism $ */ public abstract class AbstractFieldComparator { protected String valueStart; protected String valueEnd; protected T compareStart; protected T compareEnd; protected T compareTo; 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 abstract boolean compare(String filterTypeOperator); public abstract void initValues() throws Exception; protected FormatFactory getFormatFactory() { return formatFactory; } public boolean isValid() { try { initValues(); } catch (Exception e) { return false; } return true; } } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FilterTypeNumericOperatorsEnum.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FilterTypeNumericOperatorsEnum.jav0000644000175000017500000000553411642264407034176 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: FilterTypeNumericOperatorsEnum.java 4639 2011-09-28 15:25:59Z narcism $ */ public enum FilterTypeNumericOperatorsEnum implements JREnum { EQUALS((byte)1, "Equals"), DOES_NOT_EQUAL((byte)2, "Does Not Equal"), GREATER_THAN((byte)3, "Greater Than"), GREATER_THAN_EQUAL_TO((byte)4, "Greater Than or Equal to"), LESS_THAN((byte)5, "Less Than"), LESS_THAN_EQUAL_TO((byte)6, "Less Than or Equal to"), IS_BETWEEN((byte)7, "Is Between"), IS_NOT_BETWEEN((byte)8, "Is not between"); /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient byte value; private final transient String name; private FilterTypeNumericOperatorsEnum(byte value, String name) { this.value = value; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(value); } /** * */ public final byte getValue() { return value; } /** * */ public String getName() { return name; } /** * */ public static FilterTypeNumericOperatorsEnum getByName(String name) { return (FilterTypeNumericOperatorsEnum)EnumUtil.getByName(values(), name); } /** * */ public static FilterTypeNumericOperatorsEnum getByEnumConstantName(String name) { return (FilterTypeNumericOperatorsEnum)EnumUtil.getByEnumConstantName(values(), name); } /** * */ public static FilterTypeNumericOperatorsEnum getByValue(Byte value) { return (FilterTypeNumericOperatorsEnum)EnumUtil.getByValue(values(), value); } /** * */ public static FilterTypeNumericOperatorsEnum getByValue(byte value) { return getByValue(new Byte(value)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FilterTypeTextOperatorsEnum.java0000644000175000017500000000546211642264406033660 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: FilterTypeTextOperatorsEnum.java 4639 2011-09-28 15:25:59Z narcism $ */ public enum FilterTypeTextOperatorsEnum implements JREnum { EQUALS((byte)1, "Equals"), IS_NOT_EQUAL_TO((byte)2, "Is not Equal to"), CONTAINS((byte)3, "Contains"), DOES_NOT_CONTAIN((byte)4, "Does not Contain"), STARTS_WITH((byte)5, "Starts With"), DOES_NOT_START_WITH((byte)6, "Does not Start With"), ENDS_WITH((byte)7, "Ends With"), DOES_NOT_END_WITH((byte)8, "Does not End With"); /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient byte value; private final transient String name; private FilterTypeTextOperatorsEnum(byte value, String name) { this.value = value; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(value); } /** * */ public final byte getValue() { return value; } /** * */ public String getName() { return name; } /** * */ public static FilterTypeTextOperatorsEnum getByName(String name) { return (FilterTypeTextOperatorsEnum)EnumUtil.getByName(values(), name); } /** * */ public static FilterTypeTextOperatorsEnum getByEnumConstantName(String name) { return (FilterTypeTextOperatorsEnum)EnumUtil.getByEnumConstantName(values(), name); } /** * */ public static FilterTypeTextOperatorsEnum getByValue(Byte value) { return (FilterTypeTextOperatorsEnum)EnumUtil.getByValue(values(), value); } /** * */ public static FilterTypeTextOperatorsEnum getByValue(byte value) { return getByValue(new Byte(value)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortParameterContributor.java0000644000175000017500000002244711647512043033223 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; 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.JRSortField; import net.sf.jasperreports.engine.ParameterContributor; import net.sf.jasperreports.engine.ParameterContributorContext; import net.sf.jasperreports.engine.ReportContext; import net.sf.jasperreports.engine.design.JRAbstractCompiler; import net.sf.jasperreports.engine.design.JRDesignSortField; import net.sf.jasperreports.engine.type.SortFieldTypeEnum; import net.sf.jasperreports.engine.type.SortOrderEnum; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; /** * * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: SortParameterContributor.java 4706 2011-10-18 08:57:28Z narcism $ */ public class SortParameterContributor implements ParameterContributor { private static final Log log = LogFactory.getLog(SortParameterContributor.class); private final ParameterContributorContext context; public SortParameterContributor (ParameterContributorContext context) { this.context = context; } public void contributeParameters(Map parameterValues) throws JRException { ReportContext reportContext = (ReportContext) parameterValues.get(JRParameter.REPORT_CONTEXT); if (reportContext != null) { String reportActionData = (String)reportContext.getParameterValue(SortElement.REQUEST_PARAMETER_SORT_DATA); String paramTableName = (String)reportContext.getParameterValue(SortElement.REQUEST_PARAMETER_DATASET_RUN); String currentDataset = JRAbstractCompiler.getUnitName(context.getJasperReport(), context.getDataset()); if (paramTableName == null || !paramTableName.equals(currentDataset)) { return; } String currentTableSortFieldsParam = paramTableName + SortElement.SORT_FIELDS_PARAM_SUFFIX; String currentTableFiltersParam = paramTableName + SortElement.FILTER_FIELDS_PARAM_SUFFIX; @SuppressWarnings("unchecked") List existingFields = (List) reportContext.getParameterValue(currentTableSortFieldsParam); List sortFields = new ArrayList(); // add existing sort fields first if (existingFields != null) { sortFields.addAll(existingFields); } if (reportActionData != null) { String[] tokens = reportActionData.split(","); for (int i = 0; i < tokens.length; i++) { String token = tokens[i]; String[] chunks = SortElementUtils.extractColumnInfo(token); if (log.isDebugEnabled()) { log.debug("Adding sort " + token); } overwriteExistingSortField( sortFields, new JRDesignSortField( chunks[0], SortFieldTypeEnum.getByName(chunks[1]), SortElementUtils.getSortOrder(chunks[2]) ) ); } } parameterValues.put(JRParameter.SORT_FIELDS, sortFields); reportContext.setParameterValue(currentTableSortFieldsParam, sortFields); String paramFieldName = (String)reportContext.getParameterValue(SortElement.REQUEST_PARAMETER_FILTER_FIELD); String paramFieldValueStart = (String)reportContext.getParameterValue(SortElement.REQUEST_PARAMETER_FILTER_VALUE_START); String paramFieldValueEnd = (String)reportContext.getParameterValue(SortElement.REQUEST_PARAMETER_FILTER_VALUE_END); String paramFilterType = (String)reportContext.getParameterValue(SortElement.REQUEST_PARAMETER_FILTER_TYPE); String paramFilterTypeOperator = (String)reportContext.getParameterValue(SortElement.REQUEST_PARAMETER_FILTER_TYPE_OPERATOR); String paramFilterPattern = (String)reportContext.getParameterValue(SortElement.REQUEST_PARAMETER_FILTER_PATTERN); DatasetFilter existingFilter = (DatasetFilter) reportContext.getParameterValue(currentTableFiltersParam); DatasetFilter combined = null; if (paramFieldName != null && paramFieldValueStart != null && paramFilterType != null && paramFilterTypeOperator != null) { if (log.isDebugEnabled()) { log.debug("Filtering by " + paramFieldName + ": " + paramFieldValueStart); } if (existingFilter != null && true) { //FIXMEJIVE: add parameter to allow single filter on the same field List filters = new ArrayList(); getFieldFilters(existingFilter, filters, null); FieldFilter filterForCurrentField = null; for (DatasetFilter df: filters){ if (((FieldFilter)df).getField().equals(paramFieldName)) { filterForCurrentField = (FieldFilter)df; break; } } // update filterForCurrentField if (filterForCurrentField != null) { filterForCurrentField.setFilterTypeOperator(paramFilterTypeOperator); filterForCurrentField.setFilterValueEnd(paramFieldValueEnd); filterForCurrentField.setFilterValueStart(paramFieldValueStart); filterForCurrentField.setIsValid(null); combined = new CompositeDatasetFilter(filters); } else { FieldFilter filter = new FieldFilter(paramFieldName, paramFieldValueStart, paramFieldValueEnd, paramFilterType, paramFilterTypeOperator); filter.setFilterPattern(paramFilterPattern); combined = CompositeDatasetFilter.combine(existingFilter, filter); } } else { FieldFilter filter = new FieldFilter(paramFieldName, paramFieldValueStart, paramFieldValueEnd, paramFilterType, paramFilterTypeOperator); filter.setFilterPattern(paramFilterPattern); combined = CompositeDatasetFilter.combine(existingFilter, filter); } } if (combined != null) { parameterValues.put(JRParameter.FILTER, combined); reportContext.setParameterValue(currentTableFiltersParam, combined); } else if (existingFilter != null) { parameterValues.put(JRParameter.FILTER, existingFilter); reportContext.setParameterValue(currentTableFiltersParam, existingFilter); } // remove filters String filterForFieldToRemove = (String) reportContext.getParameterValue(SortElement.REQUEST_PARAMETER_REMOVE_FILTER); if (filterForFieldToRemove != null && existingFilter != null ) { List filters = new ArrayList(); getFieldFilters(existingFilter, filters, null); FieldFilter filterToRemove = null; for (DatasetFilter df: filters){ if (((FieldFilter)df).getField().equals(filterForFieldToRemove)) { filterToRemove = (FieldFilter)df; break; } } if (filterToRemove != null) { filters.remove(filterToRemove); combined = new CompositeDatasetFilter(filters); parameterValues.put(JRParameter.FILTER, combined); reportContext.setParameterValue(currentTableFiltersParam, combined); } } } } private void overwriteExistingSortField(List sortFields, JRSortField newSortField) { int indexOfExistingSortField = sortFields.indexOf(newSortField); if (indexOfExistingSortField != -1) { // remove sortfield if previos order was 'Descending' boolean mustRemove = (sortFields.get(indexOfExistingSortField)).getOrderValue().equals(SortOrderEnum.DESCENDING); if (mustRemove) { sortFields.remove(indexOfExistingSortField); } else { ((JRDesignSortField)sortFields.get(indexOfExistingSortField)).setOrder(newSortField.getOrderValue()); } } else if (newSortField.getOrderValue() != null) { // this is necessary because a dummy order - None - is introduced sortFields.add(newSortField); } } private void getFieldFilters(DatasetFilter existingFilter, List fieldFilters, String fieldName) { if (existingFilter instanceof FieldFilter) { if ( fieldName == null || (fieldName != null && ((FieldFilter)existingFilter).getField().equals(fieldName))) { fieldFilters.add(existingFilter); } } else if (existingFilter instanceof CompositeDatasetFilter) { for (DatasetFilter filter : ((CompositeDatasetFilter)existingFilter).getFilters()) { getFieldFilters(filter, fieldFilters, fieldName); } } } public static void main(String[] args) throws JsonParseException, JsonMappingException, IOException { } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortComponent.java0000644000175000017500000001632011642264406031005 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.awt.Color; import java.io.Serializable; import net.sf.jasperreports.engine.JRFont; 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.events.JRChangeEventsSupport; import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport; import net.sf.jasperreports.engine.type.EvaluationTimeEnum; import net.sf.jasperreports.engine.type.HorizontalAlignEnum; import net.sf.jasperreports.engine.type.SortFieldTypeEnum; import net.sf.jasperreports.engine.type.VerticalAlignEnum; /** * @author Narcis Marcu (narcism@users.sourceforge.net) * @version $Id: SortComponent.java 4637 2011-09-28 15:24:12Z narcism $ */ public class SortComponent implements ContextAwareComponent, Serializable, JRChangeEventsSupport { /** * */ private static final long serialVersionUID = 1L; public static final String PROPERTY_EVALUATION_TIME = "evaluationTime"; public static final String PROPERTY_EVALUATION_GROUP = "evaluationGroup"; public static final String PROPERTY_COLUMN_NAME = "sortFieldName"; public static final String PROPERTY_COLUMN_TYPE = "sortFieldType"; public static final String PROPERTY_HANDLER_COLOR = "handlerColor"; public static final String PROPERTY_HANDLER_VERTICAL_ALIGN = "handlerVerticalAlign"; public static final String PROPERTY_HANDLER_HORIZONTAL_ALIGN = "handlerHorizontalAlign"; public static final String PROPERTY_SYMBOL_FONT = "symbolFont"; private EvaluationTimeEnum evaluationTime = EvaluationTimeEnum.NOW; private String evaluationGroup; private String sortFieldName; private SortFieldTypeEnum sortFieldType; private Color handlerColor; private VerticalAlignEnum handlerVerticalAlign = VerticalAlignEnum.MIDDLE; private HorizontalAlignEnum handlerHorizontalAlign = HorizontalAlignEnum.LEFT; private JRFont symbolFont; private ComponentContext context; private transient JRPropertyChangeSupport eventSupport; public SortComponent() { } public SortComponent(SortComponent component, JRBaseObjectFactory objectFactory) { this.evaluationTime= component.getEvaluationTime(); this.evaluationGroup = component.getEvaluationGroup(); this.context = new BaseComponentContext(component.getContext(), objectFactory); this.sortFieldName = component.getSortFieldName(); this.sortFieldType = component.getSortFieldType(); this.handlerColor = component.getHandlerColor(); this.handlerVerticalAlign = component.getHandlerVerticalAlign(); this.handlerHorizontalAlign = component.getHandlerHorizontalAlign(); this.symbolFont = component.getSymbolFont(); } public void setContext(ComponentContext context) { this.context = context; } public ComponentContext getContext() { return context; } /** * @return the evaluationTime */ public EvaluationTimeEnum getEvaluationTime() { return evaluationTime; } /** * @param evaluationTime the evaluationTime to set */ public void setEvaluationTime(EvaluationTimeEnum evaluationTime) { Object old = this.evaluationTime; this.evaluationTime = evaluationTime; getEventSupport().firePropertyChange(PROPERTY_EVALUATION_TIME, old, this.evaluationTime); } 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); } /** * @return the columnName */ public String getSortFieldName() { return sortFieldName; } /** * @param sortFieldName the sort field name to set */ public void setSortFieldName(String sortFieldName) { Object old = this.sortFieldName; this.sortFieldName = sortFieldName; getEventSupport().firePropertyChange(PROPERTY_COLUMN_NAME, old, this.sortFieldName); } /** * @return the columnType */ public SortFieldTypeEnum getSortFieldType() { return sortFieldType; } /** * @param sortFieldType the sort field type to set */ public void setSortFieldType(SortFieldTypeEnum sortFieldType) { Object old = this.sortFieldType; this.sortFieldType = sortFieldType; getEventSupport().firePropertyChange(PROPERTY_COLUMN_TYPE, old, this.sortFieldType); } /** * @return the handlerColor */ public Color getHandlerColor() { return handlerColor; } /** * @param handlerColor the handlerColor to set */ public void setHandlerColor(Color handlerColor) { Object old = this.handlerColor; this.handlerColor = handlerColor; getEventSupport().firePropertyChange(PROPERTY_HANDLER_COLOR, old, this.handlerColor); } /** * @return the handlerVerticalAlign */ public VerticalAlignEnum getHandlerVerticalAlign() { return handlerVerticalAlign; } /** * @param handlerVerticalAlign the handlerVerticalAlign to set */ public void setHandlerVerticalAlign(VerticalAlignEnum handlerVerticalAlign) { Object old = this.handlerVerticalAlign; this.handlerVerticalAlign = handlerVerticalAlign; getEventSupport().firePropertyChange(PROPERTY_HANDLER_VERTICAL_ALIGN, old, this.handlerVerticalAlign); } /** * @return the handlerHorizontalAlign */ public HorizontalAlignEnum getHandlerHorizontalAlign() { return handlerHorizontalAlign; } /** * @param handlerHorizontalAlign the handlerHorizontalAlign to set */ public void setHandlerHorizontalAlign(HorizontalAlignEnum handlerHorizontalAlign) { Object old = this.handlerHorizontalAlign; this.handlerHorizontalAlign = handlerHorizontalAlign; getEventSupport().firePropertyChange(PROPERTY_HANDLER_HORIZONTAL_ALIGN, old, this.handlerHorizontalAlign); } public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } public JRFont getSymbolFont() { return symbolFont; } public void setSymbolFont(JRFont symbolFont) { Object old = this.symbolFont; this.symbolFont = symbolFont; getEventSupport().firePropertyChange(PROPERTY_SYMBOL_FONT, old, this.symbolFont); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortComponentFillFactory.java0000644000175000017500000000373711632162654033155 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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 Narcis Marcu (narcism@users.sourceforge.net) * @version $Id: SortComponentFillFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SortComponentFillFactory implements ComponentFillFactory { public FillComponent toFillComponent(Component component, JRFillObjectFactory factory) { SortComponent sortComponent = (SortComponent) component; return new SortComponentFill(sortComponent); } public FillComponent cloneFillComponent(FillComponent component, JRFillCloneFactory factory) { SortComponentFill sortComponentFill = (SortComponentFill) component; return new SortComponentFill(sortComponentFill.getSortComponent()); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortComponentDesignConverter.java0000644000175000017500000000422311632162654034027 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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 Narcis Marcu (narcism@users.sourceforge.net) * @version $Id: SortComponentDesignConverter.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SortComponentDesignConverter extends ElementIconConverter implements ComponentDesignConverter { /** * */ private final static SortComponentDesignConverter INSTANCE = new SortComponentDesignConverter(); /** * */ private SortComponentDesignConverter() { super(JRImageLoader.SUBREPORT_IMAGE_RESOURCE); } /** * */ public static SortComponentDesignConverter getInstance() { return INSTANCE; } /** * */ public JRPrintElement convert(ReportConverter reportConverter, JRComponentElement element) { return convert(reportConverter, (JRElement)element); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FilterTypeDateOperatorsEnum.java0000644000175000017500000000543611642264406033612 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: FilterTypeDateOperatorsEnum.java 4639 2011-09-28 15:25:59Z narcism $ */ public enum FilterTypeDateOperatorsEnum implements JREnum { EQUALS((byte)1, "Equals"), IS_NOT_EQUAL_TO((byte)2, "Is not Equal to"), IS_BETWEEN((byte)3, "Is Between"), IS_NOT_BETWEEN((byte)4, "Is not between"), IS_ON_OR_BEFORE((byte)5, "Is On or Before"), IS_BEFORE((byte)6, "Is Before"), IS_ON_OR_AFTER((byte)7, "Is On or After"), IS_AFTER((byte)8, "Is After"); /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient byte value; private final transient String name; private FilterTypeDateOperatorsEnum(byte value, String name) { this.value = value; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(value); } /** * */ public final byte getValue() { return value; } /** * */ public String getName() { return name; } /** * */ public static FilterTypeDateOperatorsEnum getByName(String name) { return (FilterTypeDateOperatorsEnum)EnumUtil.getByName(values(), name); } /** * */ public static FilterTypeDateOperatorsEnum getByEnumConstantName(String name) { return (FilterTypeDateOperatorsEnum)EnumUtil.getByEnumConstantName(values(), name); } /** * */ public static FilterTypeDateOperatorsEnum getByValue(Byte value) { return (FilterTypeDateOperatorsEnum)EnumUtil.getByValue(values(), value); } /** * */ public static FilterTypeDateOperatorsEnum getByValue(byte value) { return getByValue(new Byte(value)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortComponentXmlWriter.java0000644000175000017500000001114311642264406032661 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.io.IOException; import net.sf.jasperreports.engine.JRFont; 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.type.EvaluationTimeEnum; 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; /** * @author Narcis Marcu (narcism@users.sourceforge.net) * @version $Id: SortComponentXmlWriter.java 4638 2011-09-28 15:24:57Z narcism $ */ public class SortComponentXmlWriter implements ComponentXmlWriter { public void writeToXml(ComponentKey componentKey, Component component, JRXmlWriter reportWriter) throws IOException { if (component instanceof SortComponent) { SortComponent sortComponent = (SortComponent) component; writeSortComponent(sortComponent, componentKey, reportWriter); } } protected void writeSortComponent(SortComponent sortComponent, ComponentKey componentKey, JRXmlWriter reportWriter) throws IOException { JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); String namespaceURI = componentKey.getNamespace(); String schemaLocation = ComponentsEnvironment .getComponentsBundle(namespaceURI).getXmlParser().getPublicSchemaLocation(); XmlNamespace componentNamespace = new XmlNamespace(namespaceURI, componentKey.getNamespacePrefix(), schemaLocation); writer.startElement("sort", componentNamespace); if (sortComponent.getEvaluationTime() != EvaluationTimeEnum.NOW) { writer.addAttribute(SortComponent.PROPERTY_EVALUATION_TIME, sortComponent.getEvaluationTime()); } writer.addAttribute(SortComponent.PROPERTY_EVALUATION_GROUP, sortComponent.getEvaluationGroup()); // write symbol settings writer.startElement("symbol"); if (sortComponent.getHandlerColor() != null) { writer.addAttribute(SortComponent.PROPERTY_HANDLER_COLOR, sortComponent.getHandlerColor()); } writer.addAttribute(SortComponent.PROPERTY_COLUMN_TYPE, sortComponent.getSortFieldType()); writer.addAttribute(SortComponent.PROPERTY_COLUMN_NAME, sortComponent.getSortFieldName()); writer.addAttribute(SortComponent.PROPERTY_HANDLER_HORIZONTAL_ALIGN, sortComponent.getHandlerHorizontalAlign()); writer.addAttribute(SortComponent.PROPERTY_HANDLER_VERTICAL_ALIGN, sortComponent.getHandlerVerticalAlign()); writeFont(writer, sortComponent.getSymbolFont()); writer.closeElement(); writer.closeElement(); } private void writeFont(JRXmlWriteHelper writer, JRFont font) throws IOException { if (font != null) { writer.startElement(JRXmlConstants.ELEMENT_font); writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_fontName, font.getOwnFontName()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_size, font.getOwnFontSize()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_isBold, font.isOwnBold()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_isItalic, font.isOwnItalic()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_isUnderline, font.isOwnUnderline()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_isStrikeThrough, font.isOwnStrikeThrough()); writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_pdfFontName, font.getOwnPdfFontName()); writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_pdfEncoding, font.getOwnPdfEncoding()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_isPdfEmbedded, font.isOwnPdfEmbedded()); writer.closeElement(true); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FieldNumberComparator.java0000644000175000017500000001000611650262431032405 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.DecimalFormat; import java.text.NumberFormat; import java.util.Locale; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.util.FormatUtils; /** * @author Narcis Marcu (narcism@users.sourceforge.net) * @version $Id: FieldNumberComparator.java 4718 2011-10-19 14:16:01Z narcism $ */ public class FieldNumberComparator extends AbstractFieldComparator { public FieldNumberComparator(String filterPattern, Locale locale) { if (locale == null) { formatter = NumberFormat.getNumberInstance(); } else { formatter = NumberFormat.getNumberInstance(locale); } if (filterPattern != null && filterPattern.trim().length() > 0) { if (formatter instanceof DecimalFormat) { ((DecimalFormat) formatter).applyPattern(filterPattern); } } } @Override public void initValues() throws Exception { if (valueStart != null && valueStart.length() > 0) { compareStart = FormatUtils.getFormattedNumber((NumberFormat)formatter, valueStart, compareTo.getClass()); } if (valueEnd != null && valueEnd.length() > 0) { compareEnd = FormatUtils.getFormattedNumber((NumberFormat)formatter, valueEnd, compareTo.getClass()); } } @Override public boolean compare(String filterTypeOperator) { boolean defaultResult = true, result = defaultResult, resultPart1 = true, resultPart2 = true; try { initValues(); } catch (Exception e) { throw new JRRuntimeException(e); } FilterTypeNumericOperatorsEnum numericEnum = FilterTypeNumericOperatorsEnum.getByEnumConstantName(filterTypeOperator); BigDecimal dbA = new BigDecimal(compareTo.toString()); BigDecimal dbStart = compareStart != null ? new BigDecimal(compareStart.toString()) : null; BigDecimal dbEnd = compareEnd != null ? new BigDecimal(compareEnd.toString()) : null; switch (numericEnum) { case DOES_NOT_EQUAL: result = dbStart != null ? dbA.compareTo(dbStart) != 0 : defaultResult; break; case EQUALS: result = dbStart != null ? dbA.compareTo(dbStart) == 0 : defaultResult; break; case GREATER_THAN: result = dbStart != null ? dbA.compareTo(dbStart) > 0 : defaultResult; break; case GREATER_THAN_EQUAL_TO: result = dbStart != null ? dbA.compareTo(dbStart) >= 0 : defaultResult; break; case IS_BETWEEN: resultPart1 = dbStart != null ? dbA.compareTo(dbStart) >= 0 : defaultResult; resultPart2 = dbEnd != null ? dbA.compareTo(dbEnd) <= 0 : defaultResult; result = resultPart1 && resultPart2; break; case IS_NOT_BETWEEN: resultPart1 = dbStart != null ? dbA.compareTo(dbStart) >= 0 : defaultResult; resultPart2 = dbEnd != null ? dbA.compareTo(dbEnd) <= 0 : defaultResult; result = !(resultPart1 && resultPart2); break; case LESS_THAN: result = dbStart != null ? dbA.compareTo(dbStart) < 0 : defaultResult; break; case LESS_THAN_EQUAL_TO: result = dbStart != null ? dbA.compareTo(dbStart) <= 0 : defaultResult; break; } return result; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortComponentCompiler.java0000644000175000017500000000361611632162654032505 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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 Narcis Marcu (narcism@users.sourceforge.net) * @version $Id: SortComponentCompiler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SortComponentCompiler implements ComponentCompiler { public void collectExpressions(Component component, JRExpressionCollector collector) { } public Component toCompiledComponent(Component component, JRBaseObjectFactory baseFactory) { SortComponent sortComponent = (SortComponent) component; return new SortComponent(sortComponent, baseFactory); } public void verify(Component component, JRVerifier verifier) { // TODO } } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortComponentSymbolFontFactory.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortComponentSymbolFontFactory.jav0000644000175000017500000000502111640566660034212 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.Map; import net.sf.jasperreports.engine.JRComponentElement; import net.sf.jasperreports.engine.JRFont; import net.sf.jasperreports.engine.JRStyle; import net.sf.jasperreports.engine.design.JRDesignFont; import net.sf.jasperreports.engine.design.JasperDesign; import net.sf.jasperreports.engine.xml.JRFontFactory; import net.sf.jasperreports.engine.xml.JRXmlConstants; import org.xml.sax.Attributes; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: SortComponentSymbolFontFactory.java 4630 2011-09-27 12:22:16Z narcism $ */ public class SortComponentSymbolFontFactory extends JRFontFactory { public JRFont getFont() { int i = 0; JRComponentElement component = null; while (component == null && i < digester.getCount()) { Object obj = digester.peek(i); component = obj instanceof JRComponentElement ? (JRComponentElement)obj : null; i++; } return new JRDesignFont(component); } public void setStyle(JRFont font, Attributes atts) { JRDesignFont designFont = (JRDesignFont)font; String styleName = atts.getValue(JRXmlConstants.ATTRIBUTE_reportFont); if (styleName != null) { JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); Map stylesMap = jasperDesign.getStylesMap(); if (stylesMap.containsKey(styleName)) { JRStyle style = stylesMap.get(styleName); designFont.setStyle(style); } else { designFont.setStyleNameReference(styleName); } } } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FilterTypeNumericOperatorsEnum.propertiesjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FilterTypeNumericOperatorsEnum.pro0000644000175000017500000000036611642264406034213 0ustar drazzibdrazzibEQUALS = 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 betweenjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/SortElementHtmlHandler.java0000644000175000017500000004421011652456470032563 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.awt.Color; import java.io.StringWriter; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.ResourceBundle; import net.sf.jasperreports.components.BaseElementHtmlHandler; import net.sf.jasperreports.engine.CompositeDatasetFilter; import net.sf.jasperreports.engine.DatasetFilter; import net.sf.jasperreports.engine.JRGenericPrintElement; import net.sf.jasperreports.engine.JRParameter; import net.sf.jasperreports.engine.JRPrintHyperlinkParameter; import net.sf.jasperreports.engine.JRPrintHyperlinkParameters; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.JRSortField; import net.sf.jasperreports.engine.ReportContext; import net.sf.jasperreports.engine.base.JRBaseFont; import net.sf.jasperreports.engine.base.JRBasePrintHyperlink; import net.sf.jasperreports.engine.export.JRHtmlExporterContext; import net.sf.jasperreports.engine.export.JRXhtmlExporter; import net.sf.jasperreports.engine.type.JREnum; import net.sf.jasperreports.engine.type.ModeEnum; import net.sf.jasperreports.engine.util.JRColorUtil; import net.sf.jasperreports.engine.util.JRProperties; import net.sf.jasperreports.web.WebReportContext; import net.sf.jasperreports.web.servlets.ReportServlet; import net.sf.jasperreports.web.servlets.ResourceServlet; import net.sf.jasperreports.web.util.VelocityUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.velocity.VelocityContext; import org.codehaus.jackson.map.ObjectMapper; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id:ChartThemesUtilities.java 2595 2009-02-10 17:56:51Z teodord $ */ public class SortElementHtmlHandler extends BaseElementHtmlHandler { private static final Log log = LogFactory.getLog(SortElementHtmlHandler.class); private static final String RESOURCE_SORT_JS = "net/sf/jasperreports/components/sort/resources/sort.js"; private static final String RESOURCE_IMAGE_CLOSE = "net/sf/jasperreports/components/sort/resources/images/delete_edit.gif"; private static final String RESOURCE_FILTER_SYMBOL = "net/sf/jasperreports/components/sort/resources/images/filter.png"; private static final String RESOURCE_WRONG_FILTER_SYMBOL = "net/sf/jasperreports/components/sort/resources/images/filter_wrong.png"; private static final String RESOURCE_SORT_SYMBOL_ASC = "net/sf/jasperreports/components/sort/resources/images/sort_asc.png"; private static final String RESOURCE_SORT_SYMBOL_ASC_HOVER = "net/sf/jasperreports/components/sort/resources/images/sort_asc_over.png"; private static final String RESOURCE_SORT_SYMBOL_DESC = "net/sf/jasperreports/components/sort/resources/images/sort_desc.png"; private static final String RESOURCE_SORT_SYMBOL_DESC_OVER = "net/sf/jasperreports/components/sort/resources/images/sort_desc_over.png"; private static final String SORT_ELEMENT_HTML_TEMPLATE = "net/sf/jasperreports/components/sort/resources/SortElementHtmlTemplate.vm"; protected static final String HTML_VERTICAL_ALIGN_TOP = "top"; protected static final String CSS_TEXT_ALIGN_LEFT = "left"; protected static final String SORT_SYMBOL_ASCENDING = "▲"; protected static final String SORT_SYMBOL_DESCENDING = "▼"; protected static final String FILTER_SYMBOL_ACTIVE = "Active"; protected static final String FILTER_SYMBOL_INACTIVE = "Inactive"; public String getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element) { String htmlFragment = null; ReportContext reportContext = context.getExporter().getReportContext(); if (reportContext != null)//FIXMEJIVE { String sortColumnName = (String) element.getParameterValue(SortElement.PARAMETER_SORT_COLUMN_NAME); String sortColumnLabel = (String) element.getParameterValue(SortElement.PARAMETER_SORT_COLUMN_LABEL); String sortColumnType = (String) element.getParameterValue(SortElement.PARAMETER_SORT_COLUMN_TYPE); String sortHandlerVAlign = (String) element.getParameterValue(SortElement.PARAMETER_SORT_HANDLER_VERTICAL_ALIGN); String sortHandlerHAlign = (String) element.getParameterValue(SortElement.PARAMETER_SORT_HANDLER_HORIZONTAL_ALIGN); String sortDatasetName = element.getPropertiesMap().getProperty(SortElement.PROPERTY_DATASET_RUN); JRBaseFont sortHandlerFont = (JRBaseFont) element.getParameterValue(SortElement.PARAMETER_SORT_HANDLER_FONT); if (sortHandlerFont == null) { sortHandlerFont = new JRBaseFont(element); } Color sortHandlerColor = (Color) element.getParameterValue(SortElement.PARAMETER_SORT_HANDLER_COLOR); if (sortHandlerColor == null) { sortHandlerColor = Color.WHITE; } FilterTypesEnum filterType = FilterTypesEnum.getByName(element.getPropertiesMap().getProperty(SortElement.PROPERTY_FILTER_TYPE)); String filterPattern = element.getPropertiesMap().getProperty(SortElement.PROPERTY_FILTER_PATTERN); Locale locale = (Locale) reportContext.getParameterValue(JRParameter.REPORT_LOCALE); if (log.isDebugEnabled()) { log.debug("report locale: " + locale); } if (locale == null) { locale = Locale.getDefault(); } Map translatedOperators = null; switch (filterType) { case NUMERIC: translatedOperators = getTranslatedOperators(FilterTypeNumericOperatorsEnum.class.getName(), FilterTypeNumericOperatorsEnum.values(), locale); break; case DATE: translatedOperators = getTranslatedOperators(FilterTypeDateOperatorsEnum.class.getName(), FilterTypeDateOperatorsEnum.values(), locale); break; case TEXT: translatedOperators = getTranslatedOperators(FilterTypeTextOperatorsEnum.class.getName(), FilterTypeTextOperatorsEnum.values(), locale); break; } String appContextPath = (String)reportContext.getParameterValue("net.sf.jasperreports.web.app.context.path");//FIXMEJIVE define constant VelocityContext velocityContext = new VelocityContext(); String webResourcesBasePath = JRProperties.getProperty("net.sf.jasperreports.web.resources.base.path"); if (webResourcesBasePath == null) { webResourcesBasePath = ResourceServlet.DEFAULT_PATH + "?" + ResourceServlet.RESOURCE_URI + "="; } String imagesResourcePath = (appContextPath == null ? "" : appContextPath) + webResourcesBasePath;//FIXMEJIVE velocityContext.put("resourceSortJs", webResourcesBasePath + SortElementHtmlHandler.RESOURCE_SORT_JS); velocityContext.put("elementX", ((JRXhtmlExporter)context.getExporter()).toSizeUnit(element.getX())); velocityContext.put("elementY", ((JRXhtmlExporter)context.getExporter()).toSizeUnit(element.getY())); velocityContext.put("elementWidth", element.getWidth()); velocityContext.put("elementHeight", element.getHeight()); velocityContext.put("sortLinkClass", sortDatasetName); velocityContext.put("sortHandlerHAlign", sortHandlerHAlign != null ? sortHandlerHAlign : CSS_TEXT_ALIGN_LEFT); velocityContext.put("sortHandlerVAlign", sortHandlerVAlign != null ? sortHandlerVAlign : HTML_VERTICAL_ALIGN_TOP); velocityContext.put("sortHandlerColor", JRColorUtil.getColorHexa(sortHandlerColor)); velocityContext.put("sortHandlerFontSize", sortHandlerFont.getFontSize()); velocityContext.put("isFilterable", filterType != null); velocityContext.put("filterDivId", "filter_" + sortDatasetName + "_" + sortColumnName); velocityContext.put("filterFormAction", getFilterFormActionLink(context)); velocityContext.put("filterReportUriParamName", ReportServlet.REQUEST_PARAMETER_REPORT_URI); velocityContext.put("filterReportUriParamValue", reportContext.getParameterValue(ReportServlet.REQUEST_PARAMETER_REPORT_URI)); velocityContext.put("filterFieldParamName", SortElement.REQUEST_PARAMETER_FILTER_FIELD); velocityContext.put("filterColumnName", sortColumnName); velocityContext.put("filterColumnNameLabel", sortColumnLabel != null ? sortColumnLabel : ""); velocityContext.put("filterTableNameParam", SortElement.REQUEST_PARAMETER_DATASET_RUN); velocityContext.put("filterTableNameValue", sortDatasetName); velocityContext.put("filterCloseDialogImageResource", imagesResourcePath + SortElementHtmlHandler.RESOURCE_IMAGE_CLOSE); velocityContext.put("filterTypeParamName", SortElement.REQUEST_PARAMETER_FILTER_TYPE); velocityContext.put("filterTypeParamNameValue", filterType.getName()); velocityContext.put("filterTypeOperatorParamName", SortElement.REQUEST_PARAMETER_FILTER_TYPE_OPERATOR); velocityContext.put("filterPatternParamName", SortElement.REQUEST_PARAMETER_FILTER_PATTERN); velocityContext.put("filterPatternParamValue", filterPattern); velocityContext.put("filterTypeValuesMap", translatedOperators); velocityContext.put("filterValueStartParamName", SortElement.REQUEST_PARAMETER_FILTER_VALUE_START); velocityContext.put("filterValueEndParamName", SortElement.REQUEST_PARAMETER_FILTER_VALUE_END); if (element.getModeValue() == ModeEnum.OPAQUE) { velocityContext.put("backgroundColor", JRColorUtil.getColorHexa(element.getBackcolor())); } String sortField = getCurrentSortField(reportContext, sortDatasetName, sortColumnName, sortColumnType); if (sortField == null) { velocityContext.put("sortHref", getSortLink(context, sortColumnName, sortColumnType, SortElement.SORT_ORDER_ASC, sortDatasetName)); velocityContext.put("isSorted", false); } else { String[] sortActionData = SortElementUtils.extractColumnInfo(sortField); boolean isAscending = SortElement.SORT_ORDER_ASC.equals(sortActionData[2]); String sortOrder = !isAscending ? SortElement.SORT_ORDER_NONE : SortElement.SORT_ORDER_DESC; velocityContext.put("sortHref", getSortLink(context, sortColumnName, sortColumnType, sortOrder, sortDatasetName)); velocityContext.put("isSorted", true); velocityContext.put("sortSymbolResource", isAscending ? imagesResourcePath + RESOURCE_SORT_SYMBOL_ASC : imagesResourcePath + RESOURCE_SORT_SYMBOL_DESC); velocityContext.put("sortSymbolHoverResource", isAscending ? imagesResourcePath + RESOURCE_SORT_SYMBOL_ASC_HOVER : imagesResourcePath + RESOURCE_SORT_SYMBOL_DESC_OVER); } // existing filters String currentDataset = (String) reportContext.getParameterValue(SortElement.REQUEST_PARAMETER_DATASET_RUN); String filterValueStart = ""; String filterValueEnd = ""; String filterTypeOperatorValue = ""; String filterActiveInactive = FILTER_SYMBOL_INACTIVE; boolean isFiltered = false; boolean enableFilterEndParameter = false; List fieldFilters = new ArrayList(); String filterSymbolImageResource = imagesResourcePath + SortElementHtmlHandler.RESOURCE_FILTER_SYMBOL; if (sortDatasetName != null && sortDatasetName.equals(currentDataset)) { String currentTableFiltersParam = currentDataset + SortElement.FILTER_FIELDS_PARAM_SUFFIX; DatasetFilter existingFilter = (DatasetFilter) reportContext.getParameterValue(currentTableFiltersParam); getFieldFilters(existingFilter, fieldFilters, sortColumnName); if (fieldFilters.size() > 0) { FieldFilter ff = fieldFilters.get(0); if (ff.getFilterValueStart() != null) { filterValueStart = ff.getFilterValueStart(); } if (ff.getFilterValueEnd() != null) { filterValueEnd = ff.getFilterValueEnd(); } filterTypeOperatorValue = ff.getFilterTypeOperator(); filterActiveInactive = FILTER_SYMBOL_ACTIVE; isFiltered = true; if (filterTypeOperatorValue != null && filterTypeOperatorValue.toLowerCase().contains("between")) { enableFilterEndParameter = true; } if (!ff.getIsValid()) { filterSymbolImageResource = imagesResourcePath + SortElementHtmlHandler.RESOURCE_WRONG_FILTER_SYMBOL; } } } velocityContext.put("isFiltered", isFiltered); velocityContext.put("filterSymbolImageResource", filterSymbolImageResource); velocityContext.put("filterToRemoveParamName", SortElement.REQUEST_PARAMETER_REMOVE_FILTER); velocityContext.put("filterToRemoveParamvalue", sortColumnName); String filtersJsonString = getJsonString(fieldFilters).replaceAll("\\\"", "\\\\\\\""); if (log.isDebugEnabled()) { log.debug("filtersJsonString: " + filtersJsonString); } velocityContext.put("filtersJsonString", filtersJsonString); velocityContext.put("filterValueStartParamValue", filterValueStart); velocityContext.put("filterValueEndParamValue", filterValueEnd); velocityContext.put("filterTypeOperatorParamValue", filterTypeOperatorValue); velocityContext.put("filterActiveInactive", filterActiveInactive); velocityContext.put("enableFilterEndParameter", enableFilterEndParameter); htmlFragment = VelocityUtil.processTemplate(SortElementHtmlHandler.SORT_ELEMENT_HTML_TEMPLATE, velocityContext); } return htmlFragment; } private String getSortLink(JRHtmlExporterContext context, String sortColumnName, String sortColumnType, String sortOrder, String sortTableName) { JRBasePrintHyperlink hyperlink = new JRBasePrintHyperlink(); hyperlink.setLinkType("ReportExecution"); JRPrintHyperlinkParameters parameters = new JRPrintHyperlinkParameters(); parameters.addParameter(new JRPrintHyperlinkParameter( SortElement.REQUEST_PARAMETER_SORT_DATA, String.class.getName(), SortElementUtils.packSortColumnInfo(sortColumnName, sortColumnType, sortOrder))); parameters.addParameter(new JRPrintHyperlinkParameter(SortElement.REQUEST_PARAMETER_DATASET_RUN, String.class.getName(), sortTableName)); ReportContext reportContext = context.getExporter().getReportContext(); parameters.addParameter(new JRPrintHyperlinkParameter(WebReportContext.REQUEST_PARAMETER_REPORT_CONTEXT_ID, String.class.getName(), reportContext.getId())); parameters.addParameter(new JRPrintHyperlinkParameter(ReportServlet.REQUEST_PARAMETER_RUN_REPORT, String.class.getName(), "true")); hyperlink.setHyperlinkParameters(parameters); return context.getHyperlinkURL(hyperlink); } private String getFilterFormActionLink(JRHtmlExporterContext context) { JRBasePrintHyperlink hyperlink = new JRBasePrintHyperlink(); hyperlink.setLinkType("ReportExecution"); JRPrintHyperlinkParameters parameters = new JRPrintHyperlinkParameters(); ReportContext reportContext = context.getExporter().getReportContext(); parameters.addParameter(new JRPrintHyperlinkParameter(WebReportContext.REQUEST_PARAMETER_REPORT_CONTEXT_ID, String.class.getName(), reportContext.getId())); parameters.addParameter(new JRPrintHyperlinkParameter(ReportServlet.REQUEST_PARAMETER_RUN_REPORT, String.class.getName(), "true")); hyperlink.setHyperlinkParameters(parameters); return context.getHyperlinkURL(hyperlink); } private String getCurrentSortField(ReportContext reportContext, String sortDatasetName, String sortColumnName, String sortColumnType) { String currentSortDataset = (String) reportContext.getParameterValue( SortElement.REQUEST_PARAMETER_DATASET_RUN); if (sortDatasetName == null || !sortDatasetName.equals(currentSortDataset)) { // sorting is on a different dataset return null; } String currentTableSortFieldsParam = currentSortDataset + SortElement.SORT_FIELDS_PARAM_SUFFIX; @SuppressWarnings("unchecked") List existingFields = (List) reportContext.getParameterValue(currentTableSortFieldsParam); 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 + SortElement.SORT_COLUMN_TOKEN_SEPARATOR + sortColumnType + SortElement.SORT_COLUMN_TOKEN_SEPARATOR; switch (field.getOrderValue()) { case ASCENDING: sortField += SortElement.SORT_ORDER_ASC; break; case DESCENDING: sortField += SortElement.SORT_ORDER_DESC; break; } break; } } } return sortField; } public boolean toExport(JRGenericPrintElement element) { return true; } private Map getTranslatedOperators(String bundleName, JREnum[] operators, Locale locale) { Map result = new LinkedHashMap(); ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale); for (JREnum operator: operators) { result.put(((Enum)operator).name(), rb.getString(((Enum)operator).name())); } return result; } private void getFieldFilters(DatasetFilter existingFilter, List fieldFilters, String fieldName) { if (existingFilter instanceof FieldFilter) { if ( fieldName == null || (fieldName != null && ((FieldFilter)existingFilter).getField().equals(fieldName))) { fieldFilters.add((FieldFilter)existingFilter); } } else if (existingFilter instanceof CompositeDatasetFilter) { for (DatasetFilter filter : ((CompositeDatasetFilter)existingFilter).getFilters()) { getFieldFilters(filter, fieldFilters, fieldName); } } } private String getJsonString(List fieldFilters) { ObjectMapper mapper = new ObjectMapper(); StringWriter writer = new StringWriter(128); try { mapper.writeValue(writer, fieldFilters); writer.flush(); writer.close(); } catch (Exception e) { throw new JRRuntimeException(e); } return writer.getBuffer().toString(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/sort/FieldComparatorFactory.java0000644000175000017500000000311711647512043032574 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * */ public class FieldComparatorFactory { private FieldComparatorFactory() { } public static AbstractFieldComparator createFieldComparator(FilterTypesEnum filterTypeEnum, String filterPattern, Locale locale, TimeZone timeZone){ switch (filterTypeEnum) { case DATE: return new FieldDateComparator(filterPattern, locale, timeZone); case NUMERIC: return new FieldNumberComparator(filterPattern, locale); case TEXT: return new FieldTextComparator(); default: return null; } } }jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barbecue/0000755000175000017500000000000011654071732026110 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barbecue/BarbecueComponent.java0000644000175000017500000000365711632162654032361 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: BarbecueComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barbecue/BarbecueCompiler.java0000644000175000017500000000632311632162654032162 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: BarbecueCompiler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class BarbecueCompiler implements ComponentCompiler { public void collectExpressions(Component component, JRExpressionCollector collector) { BarbecueComponent barcode = (BarbecueComponent) component; collector.addExpression(barcode.getCodeExpression()); collector.addExpression(barcode.getApplicationIdentifierExpression()); } public Component toCompiledComponent(Component component, JRBaseObjectFactory baseFactory) { BarbecueComponent barcode = (BarbecueComponent) component; return new StandardBarbecueComponent(barcode, baseFactory); } 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 evalution group \"" + evaluationGroup + " not found", barcode); } } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barbecue/BarbecueFillFactory.java0000644000175000017500000000373111632162654032626 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: BarbecueFillFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class BarbecueFillFactory implements ComponentFillFactory { public FillComponent toFillComponent(Component component, JRFillObjectFactory factory) { BarbecueComponent barcode = (BarbecueComponent) component; return new BarbecueFillComponent(barcode); } public FillComponent cloneFillComponent(FillComponent component, JRFillCloneFactory factory) { BarbecueFillComponent fillBarcode = (BarbecueFillComponent) component; return new BarbecueFillComponent(fillBarcode.getBarcode()); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barbecue/BarbecueFillComponent.java0000644000175000017500000001244511644765203033165 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: BarbecueFillComponent.java 4648 2011-10-10 12:50:53Z lucianc $ */ 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; } 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; } 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; } public JRPrintElement fill() { JRTemplateImage templateImage = getTemplateImage(); JRTemplatePrintImage image = new JRTemplatePrintImage(templateImage, elementId); JRComponentElement element = fillContext.getComponentElement(); 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; } 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); BarbecueRenderer renderer = new BarbecueRenderer(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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barbecue/BarcodeProvider.java0000644000175000017500000000256011632162654032030 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: BarcodeProvider.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface BarcodeProvider { Barcode createBarcode(BarcodeInfo barcodeInfo) throws BarcodeException; } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barbecue/BaseBarcodeProvider.java0000644000175000017500000000354611632162654032630 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: BaseBarcodeProvider.java 4595 2011-09-08 15:55:10Z teodord $ */ public abstract class BaseBarcodeProvider implements BarcodeProvider { 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; } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barbecue/BarbecueStyleResolver.java0000644000175000017500000000363411632162654033234 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRStyle; import net.sf.jasperreports.engine.type.RotationEnum; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * * @author Narcis Marcu (narcism@users.sourceforge.net) * @version $Id: BarbecueStyleResolver.java 4595 2011-09-08 15:55:10Z teodord $ */ public final class BarbecueStyleResolver { private BarbecueStyleResolver() { } /** * */ public static RotationEnum getRotationValue(JRComponentElement element) { RotationEnum ownRotation = ((BarbecueComponent)element.getComponent()).getOwnRotation(); if (ownRotation != null) { return ownRotation; } JRStyle style = JRStyleResolver.getBaseStyle(element); if (style != null) { RotationEnum rotation = style.getRotationValue(); if (rotation != null) { return rotation; } } return RotationEnum.NONE; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barbecue/BarbecueRenderer.java0000644000175000017500000001053611632162654032157 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.type.RotationEnum; import net.sourceforge.barbecue.Barcode; import net.sourceforge.barbecue.output.OutputException; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BarbecueRenderer.java 4595 2011-09-08 15:55:10Z teodord $ */ public class BarbecueRenderer extends JRAbstractSvgRenderer { private static final long serialVersionUID = 1L; private Barcode barcode; private RotationEnum rotation; public BarbecueRenderer(Barcode barcode) { this.barcode = barcode; } public Dimension2D getDimension() { 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(); } } public void render(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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barbecue/BarbecueDesignConverter.java0000644000175000017500000000733611632162654033516 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: BarbecueDesignConverter.java 4595 2011-09-08 15:55:10Z teodord $ */ public class BarbecueDesignConverter implements ComponentDesignConverter { private static final Log log = LogFactory.getLog(BarbecueDesignConverter.class); private static final String DEFAULT_PREVIEW_CODE = "01234567890"; 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); BarbecueRenderer renderer = new BarbecueRenderer(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; } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barbecue/BarcodeInfo.java0000644000175000017500000000457611632162654031142 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: BarcodeInfo.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barbecue/StandardBarbecueComponent.java0000644000175000017500000002072511632162654034035 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: StandardBarbecueComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } public void setContext(ComponentContext context) { this.context = context; } public ComponentContext getContext() { return context; } 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); } public String getType() { return type; } public void setType(String type) { Object old = this.type; this.type = type; getEventSupport().firePropertyChange(PROPERTY_TYPE, old, this.type); } 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); } 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); } 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); } public RotationEnum getRotation(){ return BarbecueStyleResolver.getRotationValue(getContext().getComponentElement()); } public RotationEnum getOwnRotation(){ return rotation; } public void setRotation(RotationEnum rotation){ Object old = this.rotation; this.rotation = rotation; getEventSupport().firePropertyChange(PROPERTY_ROTATION, old, this.rotation); } 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); } 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); } 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); } 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 JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } 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; 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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/barbecue/BarcodeProviders.java0000644000175000017500000002527611632162654032224 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: BarcodeProviders.java 4595 2011-09-08 15:55:10Z teodord $ */ public final class BarcodeProviders { 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("No barcode provider for type " + barcodeInfo.getType()); } try { return provider.createBarcode(barcodeInfo); } catch (BarcodeException e) { throw new JRRuntimeException("Error creating barcode", e); } } public static class Barcode2of7Provider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.create2of7(barcodeInfo.getCode()); } } public static class Barcode3of9Provider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.create3of9(barcodeInfo.getCode(), barcodeInfo.getRequiresChecksum()); } } public static class BooklandProvider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createBookland(barcodeInfo.getCode()); } } public static class CodabarProvider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createCodabar(barcodeInfo.getCode()); } } public static class Code128Provider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createCode128(barcodeInfo.getCode()); } } public static class Code128AProvider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createCode128A(barcodeInfo.getCode()); } } public static class Code128BProvider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createCode128B(barcodeInfo.getCode()); } } public static class Code128CProvider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createCode128C(barcodeInfo.getCode()); } } public static class Code39Provider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createCode39(barcodeInfo.getCode(), barcodeInfo.getRequiresChecksum()); } } public static class Code39ExtendedProvider extends BaseBarcodeProvider { 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 { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createEAN128(barcodeInfo.getCode()); } } public static class EAN13Provider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createEAN13(barcodeInfo.getCode()); } } public static class GlobalTradeItemNumberProvider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createGlobalTradeItemNumber(barcodeInfo.getCode()); } } public static class Int2of5Provider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createInt2of5( barcodeInfo.getCode(), barcodeInfo.getRequiresChecksum()); } } public static class MonarchProvider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createMonarch(barcodeInfo.getCode()); } } public static class NW7Provider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createNW7(barcodeInfo.getCode()); } } public static class PDF417Provider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createPDF417(barcodeInfo.getCode()); } } public static class PostNetProvider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createPostNet(barcodeInfo.getCode()); } } public static class RandomWeightUPCAProvider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createRandomWeightUPCA(barcodeInfo.getCode()); } } public static class SCC14ShippingCodeProvider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createSCC14ShippingCode(barcodeInfo.getCode()); } } public static class ShipmentIdentificationNumberProvider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createShipmentIdentificationNumber(barcodeInfo.getCode()); } } public static class SSCC18Provider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return new UCCEAN128Barcode(UCCEAN128Barcode.SSCC_18_AI, barcodeInfo.getCode(), barcodeInfo.getRequiresChecksum()); } } public static class Std2of5Provider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createStd2of5(barcodeInfo.getCode(), barcodeInfo.getRequiresChecksum()); } } public static class UCC128Provider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return new UCCEAN128Barcode(barcodeInfo.getApplicationIdentifier(), barcodeInfo.getCode(), barcodeInfo.getRequiresChecksum()); } } public static class UPCAProvider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createUPCA(barcodeInfo.getCode()); } } public static class USD3Provider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createUSD3(barcodeInfo.getCode(), barcodeInfo.getRequiresChecksum()); } } public static class USD4Provider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createUSD4(barcodeInfo.getCode()); } } public static class USPSProvider extends BaseBarcodeProvider { protected Barcode createBaseBarcode(BarcodeInfo barcodeInfo) throws BarcodeException { return BarcodeFactory.createUSPS(barcodeInfo.getCode()); } } private BarcodeProviders() { } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/0000755000175000017500000000000011654071732025115 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapFillComponent.java0000644000175000017500000001024611644765203031174 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRException; import net.sf.jasperreports.engine.JRGenericPrintElement; import net.sf.jasperreports.engine.JRPrintElement; import net.sf.jasperreports.engine.component.BaseFillComponent; import net.sf.jasperreports.engine.component.FillPrepareResult; import net.sf.jasperreports.engine.fill.JRTemplateGenericElement; import net.sf.jasperreports.engine.fill.JRTemplateGenericPrintElement; import net.sf.jasperreports.engine.type.EvaluationTimeEnum; /** * * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: MapFillComponent.java 4648 2011-10-10 12:50:53Z lucianc $ */ public class MapFillComponent extends BaseFillComponent { private final MapComponent mapComponent; private Float latitude; private Float longitude; private Integer zoom; public MapFillComponent(MapComponent map) { this.mapComponent = map; } protected MapComponent getMap() { return mapComponent; } public void evaluate(byte evaluation) throws JRException { if (isEvaluateNow()) { evaluateMap(evaluation); } } protected void evaluateMap(byte evaluation) throws JRException { latitude = (Float)fillContext.evaluate(mapComponent.getLatitudeExpression(), evaluation); longitude = (Float)fillContext.evaluate(mapComponent.getLongitudeExpression(), evaluation); zoom = (Integer)fillContext.evaluate(mapComponent.getZoomExpression(), evaluation); zoom = zoom == null ? MapComponent.DEFAULT_ZOOM : zoom; } protected boolean isEvaluateNow() { return mapComponent.getEvaluationTime() == EvaluationTimeEnum.NOW; } 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; } public JRPrintElement fill() { JRComponentElement element = fillContext.getComponentElement(); JRTemplateGenericElement template = new JRTemplateGenericElement( fillContext.getElementOrigin(), fillContext.getDefaultStyleProvider(), MapPrintElement.MAP_ELEMENT_TYPE); template = deduplicate(template); JRTemplateGenericPrintElement printElement = new JRTemplateGenericPrintElement(template, elementId); 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; } public void evaluateDelayedElement(JRPrintElement element, byte evaluation) throws JRException { evaluateMap(evaluation); copy((JRGenericPrintElement) element); } protected void copy(JRGenericPrintElement printElement) { printElement.setParameterValue(MapPrintElement.PARAMETER_LATITUDE, latitude); printElement.setParameterValue(MapPrintElement.PARAMETER_LONGITUDE, longitude); printElement.setParameterValue(MapPrintElement.PARAMETER_ZOOM, zoom); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapElementXlsxHandler.java0000644000175000017500000000466411632162654032176 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: MapElementXlsxHandler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class MapElementXlsxHandler implements GenericElementXlsxHandler { private static final MapElementXlsxHandler INSTANCE = new MapElementXlsxHandler(); public static MapElementXlsxHandler getInstance() { return INSTANCE; } public void exportElement( JRXlsxExporterContext exporterContext, JRGenericPrintElement element, JRExporterGridCell gridCell, int colIndex, int rowIndex ) { try { JRXlsxExporter exporter = (JRXlsxExporter)exporterContext.getExporter(); exporter.exportImage(getImage(element), gridCell, colIndex, rowIndex, 0, 0, null); } catch (Exception e) { throw new RuntimeException(e); } } public boolean toExport(JRGenericPrintElement element) { return true; } public JRPrintImage getImage(JRGenericPrintElement element) throws JRException { return MapElementImageProvider.getImage(element); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapElementDocxHandler.java0000644000175000017500000000462511632162654032132 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.GenericElementDocxHandler; import net.sf.jasperreports.engine.export.ooxml.JRDocxExporter; import net.sf.jasperreports.engine.export.ooxml.JRDocxExporterContext; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: MapElementDocxHandler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class MapElementDocxHandler implements GenericElementDocxHandler { private static final MapElementDocxHandler INSTANCE = new MapElementDocxHandler(); public static MapElementDocxHandler getInstance() { return INSTANCE; } public void exportElement( JRDocxExporterContext exporterContext, JRGenericPrintElement element, JRExporterGridCell gridCell ) { try { JRDocxExporter exporter = (JRDocxExporter)exporterContext.getExporter(); exporter.exportImage(exporterContext.getTableHelper(), getImage(element), gridCell); } catch (Exception e) { throw new RuntimeException(e); } } public boolean toExport(JRGenericPrintElement element) { return true; } public JRPrintImage getImage(JRGenericPrintElement element) throws JRException { return MapElementImageProvider.getImage(element); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapElementPdfHandler.java0000644000175000017500000000403211632162654031736 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: MapElementPdfHandler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class MapElementPdfHandler implements GenericElementPdfHandler { private static final MapElementPdfHandler INSTANCE = new MapElementPdfHandler(); public static MapElementPdfHandler getInstance() { return INSTANCE; } public void exportElement( JRPdfExporterContext exporterContext, JRGenericPrintElement element ) { try { JRPdfExporter exporter = (JRPdfExporter)exporterContext.getExporter(); exporter.exportImage(MapElementImageProvider.getImage(element)); } catch (Exception e) { throw new RuntimeException(e); } } public boolean toExport(JRGenericPrintElement element) { return true; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/resources/0000755000175000017500000000000011654071732027127 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/resources/map.js0000644000175000017500000000100111614510766030233 0ustar drazzibdrazzib/** * Defines 'map' module in JasperReports namespace */ (function(global) { if (typeof global.JasperReports.modules.map !== 'undefined') { return; } var jm = { callback: {} // defined in template }; jm.init = function() { var googleScriptUri = 'http://maps.google.com/maps/api/js?sensor=false&callback=JasperReports.modules.map.callback'; if (!global.google) { JasperReports.modules.global.loadScript('_googleApi', googleScriptUri); } }; global.JasperReports.modules.map = jm; } (this));jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/resources/templates/0000755000175000017500000000000011654071733031126 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/resources/templates/MapElementHtmlTemplate.vmjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/resources/templates/MapElementHtmlT0000644000175000017500000000344011620457204034044 0ustar drazzibdrazzib#if (${divId} && ${divClass})

#if (${gotReportContext}) #else #endjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapElementXmlHandler.java0000644000175000017500000000403111632162654031764 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: MapElementXmlHandler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class MapElementXmlHandler implements GenericElementXmlHandler { private static final MapElementXmlHandler INSTANCE = new MapElementXmlHandler(); public static MapElementXmlHandler getInstance() { return INSTANCE; } public void exportElement( JRXmlExporterContext exporterContext, JRGenericPrintElement element ) { try { JRXmlExporter exporter = (JRXmlExporter)exporterContext.getExporter(); exporter.exportImage(MapElementImageProvider.getImage(element)); } catch (Exception e) { throw new RuntimeException(e); } } public boolean toExport(JRGenericPrintElement element) { return true; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapComponent.java0000644000175000017500000000323411632162654030362 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.component.Component; import net.sf.jasperreports.engine.type.EvaluationTimeEnum; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: MapComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface MapComponent extends Component, JRCloneable { public static final Integer DEFAULT_ZOOM = 8; JRExpression getLatitudeExpression(); JRExpression getLongitudeExpression(); JRExpression getZoomExpression(); EvaluationTimeEnum getEvaluationTime(); String getEvaluationGroup(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapElementPptxHandler.java0000644000175000017500000000441411632162654032164 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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) * @version $Id: MapElementPptxHandler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class MapElementPptxHandler implements GenericElementPptxHandler { private static final MapElementPptxHandler INSTANCE = new MapElementPptxHandler(); public static MapElementPptxHandler getInstance() { return INSTANCE; } public void exportElement( JRPptxExporterContext exporterContext, JRGenericPrintElement element ) { try { JRPptxExporter exporter = (JRPptxExporter)exporterContext.getExporter(); exporter.exportImage(getImage(element)); } catch (Exception e) { throw new RuntimeException(e); } } public boolean toExport(JRGenericPrintElement element) { return true; } public JRPrintImage getImage(JRGenericPrintElement element) throws JRException { return MapElementImageProvider.getImage(element); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapElementOdtHandler.java0000644000175000017500000000426611632162654031764 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: MapElementOdtHandler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class MapElementOdtHandler implements GenericElementOdtHandler { private static final MapElementOdtHandler INSTANCE = new MapElementOdtHandler(); public static MapElementOdtHandler getInstance() { return INSTANCE; } public void exportElement( JROdtExporterContext exporterContext, JRGenericPrintElement element, JRExporterGridCell gridCell ) { try { JROdtExporter exporter = (JROdtExporter)exporterContext.getExporter(); exporter.exportImage(exporterContext.getTableBuilder(), MapElementImageProvider.getImage(element), gridCell); } catch (Exception e) { throw new RuntimeException(e); } } public boolean toExport(JRGenericPrintElement element) { return true; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapElementImageProvider.java0000644000175000017500000000731311632162654032471 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRImageRenderer; import net.sf.jasperreports.engine.JRPrintImage; import net.sf.jasperreports.engine.JRRenderable; import net.sf.jasperreports.engine.base.JRBasePrintImage; import net.sf.jasperreports.engine.type.HorizontalAlignEnum; import net.sf.jasperreports.engine.type.OnErrorTypeEnum; import net.sf.jasperreports.engine.type.ScaleImageEnum; import net.sf.jasperreports.engine.type.VerticalAlignEnum; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: MapElementImageProvider.java 4595 2011-09-08 15:55:10Z teodord $ */ public class MapElementImageProvider { public static JRPrintImage getImage(JRGenericPrintElement element) throws JRException { Float latitude = (Float)element.getParameterValue(MapPrintElement.PARAMETER_LATITUDE); latitude = latitude == null ? 0 : latitude; Float longitude = (Float)element.getParameterValue(MapPrintElement.PARAMETER_LONGITUDE); longitude = longitude == null ? 0 : longitude; Integer zoom = (Integer)element.getParameterValue(MapPrintElement.PARAMETER_ZOOM); zoom = zoom == null ? 0 : zoom; int elementWidth = element.getWidth(); int elementHeight = element.getHeight(); String imageLocation = "http://maps.google.com/maps/api/staticmap?center=" + latitude + "," + longitude + "&size=" + elementWidth + "x" + elementHeight + "&format=jpg" + "&zoom=" + zoom + "&sensor=false"; JRBasePrintImage printImage = new JRBasePrintImage(element.getDefaultStyleProvider()); 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()); printImage.setLazy(true); //FIXMEMAP there are no scale image, alignment and onError attributes defined for the map element printImage.setScaleImage(ScaleImageEnum.CLIP); printImage.setHorizontalAlignment(HorizontalAlignEnum.LEFT); printImage.setVerticalAlignment(VerticalAlignEnum.TOP); JRRenderable cacheRenderer = (JRRenderable)element.getParameterValue(MapPrintElement.PARAMETER_CACHE_RENDERER); if(cacheRenderer == null) { cacheRenderer = JRImageRenderer.getInstance(imageLocation, OnErrorTypeEnum.ERROR, false); cacheRenderer.getImageData(); element.setParameterValue(MapPrintElement.PARAMETER_CACHE_RENDERER, cacheRenderer); } printImage.setRenderer(cacheRenderer); return printImage; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapFillFactory.java0000644000175000017500000000362711632162654030644 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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) * @version $Id: MapFillFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class MapFillFactory implements ComponentFillFactory { public FillComponent toFillComponent(Component component, JRFillObjectFactory factory) { MapComponent map = (MapComponent) component; return new MapFillComponent(map); } public FillComponent cloneFillComponent(FillComponent component, JRFillCloneFactory factory) { MapFillComponent fillMap = (MapFillComponent) component; return new MapFillComponent(fillMap.getMap()); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapElementGraphics2DHandler.java0000644000175000017500000000572611632162654033166 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 java.util.ArrayList; import java.util.List; import net.sf.jasperreports.engine.JRGenericPrintElement; import net.sf.jasperreports.engine.JRPrintElement; import net.sf.jasperreports.engine.export.GenericElementGraphics2DHandler; import net.sf.jasperreports.engine.export.GenericElementXlsHandler; import net.sf.jasperreports.engine.export.JRExporterGridCell; import net.sf.jasperreports.engine.export.JRGraphics2DExporter; import net.sf.jasperreports.engine.export.JRGraphics2DExporterContext; import net.sf.jasperreports.engine.export.JRGridLayout; import net.sf.jasperreports.engine.export.JRXlsExporter; import net.sf.jasperreports.engine.export.JRXlsExporterContext; import net.sf.jasperreports.engine.export.draw.FrameDrawer; import net.sf.jasperreports.engine.export.draw.ImageDrawer; import net.sf.jasperreports.engine.export.draw.Offset; import net.sf.jasperreports.engine.export.draw.PrintDrawVisitor; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: MapElementGraphics2DHandler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class MapElementGraphics2DHandler implements GenericElementGraphics2DHandler { private static final MapElementGraphics2DHandler INSTANCE = new MapElementGraphics2DHandler(); public static MapElementGraphics2DHandler getInstance() { return INSTANCE; } public void exportElement( JRGraphics2DExporterContext exporterContext, JRGenericPrintElement element, Graphics2D grx, Offset offset) { try { JRGraphics2DExporter exporter = (JRGraphics2DExporter)exporterContext.getExporter(); ImageDrawer imageDrawer = exporter.getFrameDrawer().getDrawVisitor().getImageDrawer(); imageDrawer.draw( grx, MapElementImageProvider.getImage(element), offset.getX(), offset.getY() ); } catch (Exception e) { throw new RuntimeException(e); } } public boolean toExport(JRGenericPrintElement element) { return true; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapPrintElement.java0000644000175000017500000001030211632162654031020 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRGenericElementType; import net.sf.jasperreports.engine.xml.JRXmlConstants; /** * Utility class that creates generic print elements of map type. * * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: MapPrintElement.java 4595 2011-09-08 15:55:10Z teodord $ */ public final class MapPrintElement { /** * 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 latitude. */ public static final String PARAMETER_LATITUDE = "latitude"; /** * The name of the parameter that provides the longitude. */ public static final String PARAMETER_LONGITUDE = "longitude"; /** * The name of the parameter that provides the zoom. */ public static final String PARAMETER_ZOOM = "zoom"; /** * The cached image renderer. */ public static final String PARAMETER_CACHE_RENDERER = "cacheRenderer"; /** * */ public static final Float DEFAULT_LATITUDE = 0f; public static final Float DEFAULT_LONGITUDE = 0f; public static final Integer DEFAULT_ZOOM = 0; // /** // * 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() { } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/StandardMapComponent.java0000644000175000017500000001237111632162654032045 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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.util.JRCloneUtils; /** * * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: StandardMapComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ 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_ZOOM_EXPRESSION = "zoomExpression"; public static final String PROPERTY_EVALUATION_TIME = "evaluationTime"; public static final String PROPERTY_EVALUATION_GROUP = "evaluationGroup"; private JRExpression latitudeExpression; private JRExpression longitudeExpression; private JRExpression zoomExpression; private EvaluationTimeEnum evaluationTime = EvaluationTimeEnum.NOW; private String evaluationGroup; 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.zoomExpression = objectFactory.getExpression(map.getZoomExpression()); this.evaluationTime = map.getEvaluationTime(); this.evaluationGroup = map.getEvaluationGroup(); } 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); } 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); } 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); } 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); } 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 JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } 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.zoomExpression = JRCloneUtils.nullSafeClone(zoomExpression); clone.eventSupport = null; return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapElementHtmlHandler.java0000755000175000017500000001136511632145612032136 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.ReportContext; import net.sf.jasperreports.engine.export.GenericElementHtmlHandler; import net.sf.jasperreports.engine.export.JRHtmlExporter; import net.sf.jasperreports.engine.export.JRHtmlExporterContext; import net.sf.jasperreports.engine.export.JRXhtmlExporter; import net.sf.jasperreports.engine.type.ModeEnum; import net.sf.jasperreports.engine.util.JRColorUtil; import net.sf.jasperreports.engine.util.JRProperties; import net.sf.jasperreports.web.servlets.ResourceServlet; import net.sf.jasperreports.web.util.VelocityUtil; import org.apache.velocity.VelocityContext; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id:ChartThemesUtilities.java 2595 2009-02-10 17:56:51Z teodord $ */ public class MapElementHtmlHandler implements GenericElementHtmlHandler { private static final MapElementHtmlHandler INSTANCE = new MapElementHtmlHandler(); private static final String RESOURCE_MAP_JS = "net/sf/jasperreports/components/map/resources/map.js"; private static final String MAP_ELEMENT_HTML_TEMPLATE = "net/sf/jasperreports/components/map/resources/templates/MapElementHtmlTemplate.vm"; public static MapElementHtmlHandler getInstance() { return INSTANCE; } public String getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element) { Float latitude = (Float)element.getParameterValue(MapPrintElement.PARAMETER_LATITUDE); latitude = latitude == null ? MapPrintElement.DEFAULT_LATITUDE : latitude; Float longitude = (Float)element.getParameterValue(MapPrintElement.PARAMETER_LONGITUDE); longitude = longitude == null ? MapPrintElement.DEFAULT_LONGITUDE : longitude; Integer zoom = (Integer)element.getParameterValue(MapPrintElement.PARAMETER_ZOOM); zoom = zoom == null ? MapPrintElement.DEFAULT_ZOOM : zoom; VelocityContext velocityContext = new VelocityContext(); ReportContext reportContext = context.getExporter().getReportContext(); if (reportContext != null) { String webResourcesBasePath = JRProperties.getProperty("net.sf.jasperreports.web.resources.base.path"); if (webResourcesBasePath == null) { webResourcesBasePath = ResourceServlet.DEFAULT_PATH + "?" + ResourceServlet.RESOURCE_URI + "="; } velocityContext.put("resourceMapJs", webResourcesBasePath + MapElementHtmlHandler.RESOURCE_MAP_JS); } velocityContext.put("gotReportContext", reportContext != null); velocityContext.put("latitude", latitude); velocityContext.put("longitude", longitude); velocityContext.put("zoom", zoom); // velocityContext.put("divId", element.getPropertiesMap().getProperty("net.sf.jasperreports.export.html.id")); // velocityContext.put("divClass", element.getPropertiesMap().getProperty("net.sf.jasperreports.export.html.class")); if(context.getExporter() instanceof JRXhtmlExporter) { velocityContext.put("xhtml", "xhtml"); velocityContext.put("elementX", ((JRXhtmlExporter)context.getExporter()).toSizeUnit(element.getX())); velocityContext.put("elementY", ((JRXhtmlExporter)context.getExporter()).toSizeUnit(element.getY())); } else { velocityContext.put("elementX", ((JRHtmlExporter)context.getExporter()).toSizeUnit(element.getX())); velocityContext.put("elementY", ((JRHtmlExporter)context.getExporter()).toSizeUnit(element.getY())); } velocityContext.put("elementWidth", element.getWidth()); velocityContext.put("elementHeight", element.getHeight()); if (element.getModeValue() == ModeEnum.OPAQUE) { velocityContext.put("backgroundColor", JRColorUtil.getColorHexa(element.getBackcolor())); } return VelocityUtil.processTemplate(MAP_ELEMENT_HTML_TEMPLATE, velocityContext); } public boolean toExport(JRGenericPrintElement element) { return true; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapElementOdsHandler.java0000644000175000017500000000426611632162654031763 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.GenericElementOdsHandler; import net.sf.jasperreports.engine.export.oasis.JROdsExporter; import net.sf.jasperreports.engine.export.oasis.JROdsExporterContext; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: MapElementOdsHandler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class MapElementOdsHandler implements GenericElementOdsHandler { private static final MapElementOdsHandler INSTANCE = new MapElementOdsHandler(); public static MapElementOdsHandler getInstance() { return INSTANCE; } public void exportElement( JROdsExporterContext exporterContext, JRGenericPrintElement element, JRExporterGridCell gridCell ) { try { JROdsExporter exporter = (JROdsExporter)exporterContext.getExporter(); exporter.exportImage(exporterContext.getTableBuilder(), MapElementImageProvider.getImage(element), gridCell); } catch (Exception e) { throw new RuntimeException(e); } } public boolean toExport(JRGenericPrintElement element) { return true; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapCompiler.java0000644000175000017500000000547111632162654030177 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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) * @version $Id: MapCompiler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class MapCompiler implements ComponentCompiler { public void collectExpressions(Component component, JRExpressionCollector collector) { MapComponent map = (MapComponent) component; collector.addExpression(map.getLatitudeExpression()); collector.addExpression(map.getLongitudeExpression()); collector.addExpression(map.getZoomExpression()); } public Component toCompiledComponent(Component component, JRBaseObjectFactory baseFactory) { MapComponent map = (MapComponent) component; return new StandardMapComponent(map, baseFactory); } 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 evalution group \"" + evaluationGroup + " not found", map); } } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapElementRtfHandler.java0000644000175000017500000000403211632162654031760 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: MapElementRtfHandler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class MapElementRtfHandler implements GenericElementRtfHandler { private static final MapElementRtfHandler INSTANCE = new MapElementRtfHandler(); public static MapElementRtfHandler getInstance() { return INSTANCE; } public void exportElement( JRRtfExporterContext exporterContext, JRGenericPrintElement element ) { try { JRRtfExporter exporter = (JRRtfExporter)exporterContext.getExporter(); exporter.exportImage(MapElementImageProvider.getImage(element)); } catch (Exception e) { throw new RuntimeException(e); } } public boolean toExport(JRGenericPrintElement element) { return true; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapDesignConverter.java0000644000175000017500000000413311632162654031520 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: MapDesignConverter.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } /** * */ public JRPrintElement convert(ReportConverter reportConverter, JRComponentElement element) { return convert(reportConverter, (JRElement)element); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapElementJExcelApiHandler.java0000644000175000017500000000460111632162654033033 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.GenericElementJExcelApiHandler; import net.sf.jasperreports.engine.export.JExcelApiExporter; import net.sf.jasperreports.engine.export.JExcelApiExporterContext; import net.sf.jasperreports.engine.export.JRExporterGridCell; import net.sf.jasperreports.engine.export.JRGridLayout; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: MapElementJExcelApiHandler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class MapElementJExcelApiHandler implements GenericElementJExcelApiHandler { private static final MapElementJExcelApiHandler INSTANCE = new MapElementJExcelApiHandler(); public static MapElementJExcelApiHandler getInstance() { return INSTANCE; } public void exportElement( JExcelApiExporterContext exporterContext, JRGenericPrintElement element, JRExporterGridCell gridCell, int colIndex, int rowIndex, int emptyCols, int yCutsRow, JRGridLayout layout ) { try { JExcelApiExporter exporter = (JExcelApiExporter)exporterContext.getExporter(); exporter.exportImage(MapElementImageProvider.getImage(element), gridCell, colIndex, rowIndex, emptyCols, yCutsRow, layout); } catch (Exception e) { throw new RuntimeException(e); } } public boolean toExport(JRGenericPrintElement element) { return true; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/map/MapElementXlsHandler.java0000644000175000017500000000450311632162654031776 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: MapElementXlsHandler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class MapElementXlsHandler implements GenericElementXlsHandler { private static final MapElementXlsHandler INSTANCE = new MapElementXlsHandler(); public static MapElementXlsHandler getInstance() { return INSTANCE; } public void exportElement( JRXlsExporterContext exporterContext, JRGenericPrintElement element, JRExporterGridCell gridCell, int colIndex, int rowIndex, int emptyCols, int yCutsRow, JRGridLayout layout ) { try { JRXlsExporter exporter = (JRXlsExporter)exporterContext.getExporter(); exporter.exportImage(MapElementImageProvider.getImage(element), gridCell, colIndex, rowIndex, emptyCols, yCutsRow, layout); } catch (Exception e) { throw new RuntimeException(e); } } public boolean toExport(JRGenericPrintElement element) { return true; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/0000755000175000017500000000000011654071732025313 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/ListDesignConverter.java0000644000175000017500000000744011632162654032120 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: ListDesignConverter.java 4595 2011-09-08 15:55:10Z teodord $ */ public class ListDesignConverter implements ComponentDesignConverter { 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.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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/DesignListContents.java0000644000175000017500000000465711632162654031755 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: DesignListContents.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; 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); } 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)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/ListContents.java0000644000175000017500000000435411632162654030615 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: ListContents.java 4595 2011-09-08 15:55:10Z teodord $ * @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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/HorizontalFillList.java0000644000175000017500000002003411632162654031751 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.component.FillPrepareResult; 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) * @version $Id: HorizontalFillList.java 4595 2011-09-08 15:55:10Z teodord $ */ public class HorizontalFillList extends BaseFillList { private static final Log log = LogFactory.getLog(HorizontalFillList.class); 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); } 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("List row overflowed on 3 consecutive pages, " + "likely infinite loop"); } // 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(); 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); } } 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); } public void rewind() { super.rewind(); overflowStartPage = 0; overflowColumnIndex = 0; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/ListComponentCompiler.java0000644000175000017500000001250711632162654032454 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: ListComponentCompiler.java 4595 2011-09-08 15:55:10Z teodord $ */ public class ListComponentCompiler implements ComponentCompiler { 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); } } } public Component toCompiledComponent(Component component, JRBaseObjectFactory baseFactory) { ListComponent listComponent = (ListComponent) component; StandardListComponent compiledComponent = new StandardListComponent( listComponent, baseFactory); return compiledComponent; } 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); } } } } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/BaseListContents.java0000644000175000017500000000352211632162654031404 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: BaseListContents.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } public int getHeight() { return height; } public Integer getWidth() { return width; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/UnusedSpaceImageRenderer.java0000644000175000017500000000544411632162654033036 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRAbstractSvgRenderer; import net.sf.jasperreports.engine.JRException; /** * Am image renderer used to mark the unused vertical space in a list * component preview. * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: UnusedSpaceImageRenderer.java 4595 2011-09-08 15:55:10Z teodord $ */ public class UnusedSpaceImageRenderer extends JRAbstractSvgRenderer { 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; } public void render(Graphics2D grx, Rectangle2D rectangle) throws JRException { Graphics2D graphics = (Graphics2D) grx.create(); 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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/FillDatasetRun.java0000644000175000017500000001247511632162654031050 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 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.JRRewindableDataSource; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.fill.JRFillDataset; import net.sf.jasperreports.engine.fill.JRFillDatasetRun; import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator; import net.sf.jasperreports.engine.fill.JRFillObjectFactory; import net.sf.jasperreports.engine.fill.JRFillSubreport; import net.sf.jasperreports.engine.util.JRReportUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * Used to iterate on the list subdataset at fill time. * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: FillDatasetRun.java 4595 2011-09-08 15:55:10Z teodord $ */ public class FillDatasetRun extends JRFillDatasetRun { private static final Log log = LogFactory.getLog(FillDatasetRun.class); private final JRFillExpressionEvaluator expressionEvaluator; private Map parameterValues; private JRDataSource dataSource; private Connection connection; private boolean first; public FillDatasetRun(JRDatasetRun datasetRun, JRFillObjectFactory factory) throws JRException { super(factory.getFiller(), datasetRun, createFillDataset(datasetRun, factory)); this.expressionEvaluator = factory.getExpressionEvaluator(); } private static JRFillDataset createFillDataset(JRDatasetRun datasetRun, JRFillObjectFactory factory) throws JRException { JasperReport jasperReport = factory.getFiller().getJasperReport(); JRDataset reportDataset = JRReportUtils.findSubdataset(datasetRun, jasperReport); JRFillDataset fillDataset = new JRFillDataset(factory.getFiller(), reportDataset, factory); fillDataset.createCalculator(jasperReport); return fillDataset; } public void evaluate(byte evaluation) throws JRException { if (log.isDebugEnabled()) { log.debug("Evaluating list dataset run parameters"); } parameterValues = JRFillSubreport.getParameterValues( filler, expressionEvaluator, parametersMapExpression, parameters, evaluation, false, dataset.getResourceBundle() != null,//hasResourceBundle false//hasFormatFactory ); if (dataSourceExpression != null) { 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); } copyConnectionParameter(parameterValues); dataset.initCalculator(); dataset.setParameterValues(parameterValues); dataset.initDatasource(); dataset.start(); init(); first = true; } public boolean next() throws JRException { checkInterrupted(); if (dataset.next()) { if (!first) { group(); } detail(); return true; } return false; } public void end() { if (log.isDebugEnabled()) { log.debug("Closing the data source"); } dataset.closeDatasource(); } 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(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/FillListFactory.java0000644000175000017500000000467311632162654031242 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: FillListFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class FillListFactory implements ComponentFillFactory { public FillComponent cloneFillComponent(FillComponent component, JRFillCloneFactory factory) { //TODO implement throw new UnsupportedOperationException(); } 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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/BaseFillList.java0000644000175000017500000001323711644765201030501 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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) * @version $Id: BaseFillList.java 4648 2011-10-10 12:50:53Z lucianc $ */ public abstract class BaseFillList extends BaseFillComponent { 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 JRFillExpressionEvaluator createDatasetExpressionEvaluator() { return new JRFillExpressionEvaluator() { public Object evaluate(JRExpression expression, byte evaluationType) throws JRException { return datasetRun.evaluateDatasetExpression( expression, evaluationType); } public JRFillDataset getFillDataset() { return datasetRun.getDataset(); } }; } 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(), elementId); 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; } public JRPrintElement fill() { printFrame.setY(fillContext.getElementPrintY()); return printFrame; } 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(); } public void addElement(JRPrintElement element) { if (xOffset > 0) { element.setX(element.getX() + xOffset); } element.setY(initialContainerHeight + element.getY()); container.addElement(element); } public List getElements() { return container.getElements(); } public int getHeight() { throw new UnsupportedOperationException(); } public void setHeight(int height) { int newHeight = initialContainerHeight + height; if (newHeight > container.getHeight()) { container.setHeight(newHeight); } } public void setXOffset(int xOffset) { this.xOffset = xOffset; } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/ListComponent.java0000644000175000017500000000612211632162654030755 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.component.Component; import net.sf.jasperreports.engine.type.PrintOrderEnum; /** * List component interface. * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: ListComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface ListComponent extends Component, JRCloneable { /** * 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(); }jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/StandardListComponent.java0000644000175000017500000001305111632162654032435 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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.JRCloneUtils; /** * Standard {@link ListComponent} implementation. * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: StandardListComponent.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } 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); } 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; } 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; } /** * */ 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; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } 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; 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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/VerticalFillList.java0000644000175000017500000001022611632162654031373 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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) * @version $Id: VerticalFillList.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } 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(); 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/list/FillListContents.java0000644000175000017500000000627511632162654031430 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: FillListContents.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } protected int getContainerHeight() { return contentsHeight; } 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); } 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 protected int getStretchHeight() { return super.getStretchHeight(); } // overridden for access protected void rewind() throws JRException { super.rewind(); } protected void stretchTo(int height) { setStretchHeight(height); } protected void finalizeElementPositions() { stretchElements(); moveBandBottomElements(); removeBlankElements(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/BaseElementHtmlHandler.java0000644000175000017500000000247011640566643031522 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: BaseElementHtmlHandler.java 4625 2011-09-27 12:13:28Z narcism $ */ public abstract class BaseElementHtmlHandler implements GenericElementHtmlHandler { } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootjasperreports-4.1.3.orig/src/net/sf/jasperreports/components/ComponentsExtensionsRegistryFactory.javajasperreports-4.1.3.orig/src/net/sf/jasperreports/components/ComponentsExtensionsRegistryFactory.jav0000644000175000017500000001776711632162654034352 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.HashMap; 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.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.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.DefaultComponentManager; 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.SingletonExtensionRegistry; /** * 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) * @version $Id: ComponentsExtensionsRegistryFactory.java 4595 2011-09-08 15:55:10Z teodord $ * @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"; protected static final String LIST_COMPONENT_NAME = "list"; protected static final String TABLE_COMPONENT_NAME = "table"; protected static final String BARBECUE_COMPONENT_NAME = "barbecue"; protected static final String[] BARCODE4J_COMPONENT_NAMES = new String[]{"Codabar", "Code128", "EAN128", "DataMatrix", "Code39", "Interleaved2Of5", "UPCA", "UPCE", "EAN13", "EAN8", "USPSIntelligentMail", "RoyalMailCustomer", "POSTNET", "PDF417"}; protected static final String SPIDERCHART_COMPONENT_NAME = "spiderChart"; protected static final String MAP_COMPONENT_NAME = "map"; protected static final String SORT_COMPONENT_NAME = "sort"; private static final ExtensionsRegistry REGISTRY; static { final DefaultComponentsBundle bundle = new DefaultComponentsBundle(); ComponentsXmlHandler xmlHandler = new ComponentsXmlHandler(); DefaultComponentXmlParser parser = new DefaultComponentXmlParser(); parser.setNamespace(NAMESPACE); parser.setPublicSchemaLocation(XSD_LOCATION); parser.setInternalSchemaResource(XSD_RESOURCE); parser.setDigesterConfigurer(xmlHandler); bundle.setXmlParser(parser); HashMap componentManagers = new HashMap(); DefaultComponentManager listManager = new DefaultComponentManager(); listManager.setDesignConverter(new ListDesignConverter()); listManager.setComponentCompiler(new ListComponentCompiler()); listManager.setComponentXmlWriter(xmlHandler); listManager.setComponentFillFactory(new FillListFactory()); componentManagers.put(LIST_COMPONENT_NAME, listManager); DefaultComponentManager tableManager = new DefaultComponentManager(); tableManager.setDesignConverter(new TableDesignConverter()); tableManager.setComponentCompiler(new TableCompiler()); tableManager.setComponentXmlWriter(xmlHandler); tableManager.setComponentFillFactory(new FillTableFactory()); componentManagers.put(TABLE_COMPONENT_NAME, tableManager); DefaultComponentManager barbecueManager = new DefaultComponentManager(); barbecueManager.setDesignConverter(new BarbecueDesignConverter()); barbecueManager.setComponentCompiler(new BarbecueCompiler()); barbecueManager.setComponentXmlWriter(xmlHandler); barbecueManager.setComponentFillFactory(new BarbecueFillFactory()); componentManagers.put(BARBECUE_COMPONENT_NAME, barbecueManager); DefaultComponentManager barcode4jManager = new DefaultComponentManager(); barcode4jManager.setDesignConverter(new BarcodeDesignConverter()); barcode4jManager.setComponentCompiler(new BarcodeCompiler()); barcode4jManager.setComponentXmlWriter(xmlHandler); barcode4jManager.setComponentFillFactory(new BarcodeFillFactory()); for (int i = 0; i < BARCODE4J_COMPONENT_NAMES.length; i++) { componentManagers.put(BARCODE4J_COMPONENT_NAMES[i], barcode4jManager); } DefaultComponentManager spiderChartManager = new DefaultComponentManager(); spiderChartManager.setDesignConverter(new SpiderChartDesignConverter()); spiderChartManager.setComponentCompiler(new SpiderChartCompiler()); spiderChartManager.setComponentXmlWriter(xmlHandler); spiderChartManager.setComponentFillFactory(new SpiderChartFillFactory()); componentManagers.put(SPIDERCHART_COMPONENT_NAME, spiderChartManager); DefaultComponentManager mapManager = new DefaultComponentManager(); mapManager.setDesignConverter(MapDesignConverter.getInstance()); mapManager.setComponentCompiler(new MapCompiler()); mapManager.setComponentXmlWriter(xmlHandler); mapManager.setComponentFillFactory(new MapFillFactory()); componentManagers.put(MAP_COMPONENT_NAME, mapManager); DefaultComponentManager sortManager = new DefaultComponentManager(); sortManager.setDesignConverter(SortComponentDesignConverter.getInstance()); sortManager.setComponentCompiler(new SortComponentCompiler()); sortManager.setComponentXmlWriter(xmlHandler); sortManager.setComponentFillFactory(new SortComponentFillFactory()); componentManagers.put(SORT_COMPONENT_NAME, sortManager); bundle.setComponentManagers(componentManagers); REGISTRY = new SingletonExtensionRegistry(ComponentsBundle.class, bundle); } public ExtensionsRegistry createRegistry(String registryId, JRPropertiesMap properties) { return REGISTRY; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/components.xsd0000644000175000017500000006513411642264407027256 0ustar drazzibdrazzib 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. 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. 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 jasperreports-4.1.3.orig/src/net/sf/jasperreports/components/ComponentsXmlHandler.java0000644000175000017500000005717511632162654031326 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.barbecue.StandardBarbecueComponent; import net.sf.jasperreports.components.barcode4j.BarcodeComponent; import net.sf.jasperreports.components.barcode4j.BarcodeXmlWriter; 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.Interleaved2Of5Component; import net.sf.jasperreports.components.barcode4j.PDF417Component; import net.sf.jasperreports.components.barcode4j.POSTNETComponent; import net.sf.jasperreports.components.barcode4j.RoyalMailCustomerComponent; 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.list.DesignListContents; import net.sf.jasperreports.components.list.ListComponent; import net.sf.jasperreports.components.list.ListContents; import net.sf.jasperreports.components.list.StandardListComponent; import net.sf.jasperreports.components.map.MapComponent; import net.sf.jasperreports.components.map.StandardMapComponent; import net.sf.jasperreports.components.sort.SortComponent; import net.sf.jasperreports.components.sort.SortComponentDigester; import net.sf.jasperreports.components.sort.SortComponentXmlWriter; import net.sf.jasperreports.components.spiderchart.SpiderChartComponent; import net.sf.jasperreports.components.spiderchart.SpiderChartDigester; 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.DesignCell; import net.sf.jasperreports.components.table.GroupCell; 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.TableComponent; import net.sf.jasperreports.components.table.TableReportContextXmlRule; import net.sf.jasperreports.components.table.WhenNoDataTypeTableEnum; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JRRuntimeException; 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.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.util.JRXmlWriteHelper; import net.sf.jasperreports.engine.util.XmlNamespace; 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.XmlConstantPropertyRule; import org.apache.commons.digester.Digester; /** * XML handler (digester + writer) for built-in component implementations. * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: ComponentsXmlHandler.java 4595 2011-09-08 15:55:10Z teodord $ * @see ComponentsExtensionsRegistryFactory */ public class ComponentsXmlHandler implements XmlDigesterConfigurer, ComponentXmlWriter { public void configureDigester(Digester digester) { addListRules(digester); addBarbecueRules(digester); addBarcode4jRules(digester); addTableRules(digester); SpiderChartDigester.addSpiderChartRules(digester); addMapRules(digester); SortComponentDigester.addSortComponentRules(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"); } 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); 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); } protected void addBaseBarcode4jRules(Digester digester, String barcodePattern, Class barcodeComponentClass) { digester.addObjectCreate(barcodePattern, barcodeComponentClass); digester.addSetProperties(barcodePattern, //properties to be ignored by this rule new String[]{JRXmlConstants.ATTRIBUTE_evaluationTime}, 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()); String patternExpressionPattern = barcodePattern + "/patternExpression"; digester.addFactoryCreate(patternExpressionPattern, JRExpressionFactory.StringExpressionFactory.class.getName()); digester.addCallMethod(patternExpressionPattern, "setText", 0); digester.addSetNext(patternExpressionPattern, "setPatternExpression", JRExpression.class.getName()); } protected void addMapRules(Digester digester) { String mapPattern = "*/componentElement/map"; digester.addObjectCreate(mapPattern, StandardMapComponent.class); digester.addSetProperties(mapPattern, //properties to be ignored by this rule new String[]{JRXmlConstants.ATTRIBUTE_evaluationTime}, new String[0]); digester.addRule(mapPattern, new XmlConstantPropertyRule( JRXmlConstants.ATTRIBUTE_evaluationTime, "evaluationTime", EvaluationTimeEnum.values())); 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 zoomExpressionPattern = mapPattern + "/zoomExpression"; digester.addFactoryCreate(zoomExpressionPattern, JRExpressionFactory.class.getName()); digester.addCallMethod(zoomExpressionPattern, "setText", 0); digester.addSetNext(zoomExpressionPattern, "setZoomExpression", JRExpression.class.getName()); } 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); 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); 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); } } public void writeToXml(ComponentKey componentKey, Component component, JRXmlWriter reportWriter) throws IOException { if (component instanceof ListComponent) { ListComponent list = (ListComponent) component; writeList(list, componentKey, reportWriter); } else if (component instanceof TableComponent) { TableComponent table = (TableComponent) component; writeTable(table, componentKey, reportWriter); } else if (component instanceof BarbecueComponent) { BarbecueComponent barcode = (BarbecueComponent) component; writeBarbecue(barcode, componentKey, reportWriter); } else if (component instanceof BarcodeComponent) { BarcodeComponent barcode = (BarcodeComponent) component; BarcodeXmlWriter barcodeWriter = new BarcodeXmlWriter( reportWriter, barcode, componentKey); barcodeWriter.writeBarcode(); } else if (component instanceof SpiderChartComponent) { SpiderChartComponent spiderChart = (SpiderChartComponent) component; SpiderChartXmlWriter spiderChartWriter = new SpiderChartXmlWriter(); spiderChartWriter.writeToXml(componentKey, spiderChart, reportWriter); } else if (component instanceof SortComponent) { SortComponentXmlWriter sortWriter = new SortComponentXmlWriter(); sortWriter.writeToXml(componentKey, component, reportWriter); } else if (component instanceof MapComponent) { MapComponent map = (MapComponent) component; writeMap(map, componentKey, reportWriter); } } protected void writeList(ListComponent list, ComponentKey componentKey, JRXmlWriter reportWriter) throws IOException { JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); XmlNamespace namespace = new XmlNamespace( ComponentsExtensionsRegistryFactory.NAMESPACE, componentKey.getNamespacePrefix(), ComponentsExtensionsRegistryFactory.XSD_LOCATION); writer.startElement("list", namespace); 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(BarbecueComponent barcode, ComponentKey componentKey, JRXmlWriter reportWriter) throws IOException { JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); 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()); writer.addAttribute("rotation", barcode.getOwnRotation()); if (barcode.getEvaluationTimeValue() != EvaluationTimeEnum.NOW) { writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationTime, barcode.getEvaluationTimeValue()); } writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationGroup, barcode.getEvaluationGroup()); writer.writeExpression("codeExpression", barcode.getCodeExpression()); writer.writeExpression("applicationIdentifierExpression", barcode.getApplicationIdentifierExpression()); writer.closeElement(); } protected void writeMap(MapComponent map, ComponentKey componentKey, JRXmlWriter reportWriter) throws IOException { JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); 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()); writer.writeExpression("latitudeExpression", map.getLatitudeExpression()); writer.writeExpression("longitudeExpression", map.getLongitudeExpression()); writer.writeExpression("zoomExpression", map.getZoomExpression()); writer.closeElement(); } protected void writeTable(TableComponent table, ComponentKey componentKey, final JRXmlWriter reportWriter) throws IOException { final JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper(); XmlNamespace namespace = new XmlNamespace( ComponentsExtensionsRegistryFactory.NAMESPACE, componentKey.getNamespacePrefix(), ComponentsExtensionsRegistryFactory.XSD_LOCATION); writer.startElement("table", namespace); writer.addAttribute(JRXmlConstants.ATTRIBUTE_whenNoDataType, table.getWhenNoDataType(), WhenNoDataTypeTableEnum.BLANK); reportWriter.writeDatasetRun(table.getDatasetRun()); ColumnVisitor columnWriter = new ColumnVisitor() { public Void visitColumn(Column column) { try { writer.startElement("column"); writer.addAttribute("width", column.getWidth()); writer.writeExpression(JRXmlConstants.ELEMENT_printWhenExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, column.getPrintWhenExpression()); writeTableCell(column.getTableHeader(), "tableHeader", reportWriter); writeTableCell(column.getTableFooter(), "tableFooter", reportWriter); writeGroupCells(column.getGroupHeaders(), "groupHeader", reportWriter); writeGroupCells(column.getGroupFooters(), "groupFooter", reportWriter); writeTableCell(column.getColumnHeader(), "columnHeader", reportWriter); writeTableCell(column.getColumnFooter(), "columnFooter", reportWriter); writeTableCell(column.getDetailCell(), "detailCell", reportWriter); writer.closeElement(); } catch (IOException e) { throw new JRRuntimeException(e); } return null; } public Void visitColumnGroup(ColumnGroup columnGroup) { try { writer.startElement("columnGroup"); writer.addAttribute("width", columnGroup.getWidth()); writer.writeExpression(JRXmlConstants.ELEMENT_printWhenExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, columnGroup.getPrintWhenExpression()); writeTableCell(columnGroup.getTableHeader(), "tableHeader", reportWriter); writeTableCell(columnGroup.getTableFooter(), "tableFooter", reportWriter); writeGroupCells(columnGroup.getGroupHeaders(), "groupHeader", reportWriter); writeGroupCells(columnGroup.getGroupFooters(), "groupFooter", reportWriter); writeTableCell(columnGroup.getColumnHeader(), "columnHeader", reportWriter); writeTableCell(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(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(groupCell.getCell(), "cell", reportWriter); writer.closeElement(); } } } protected void writeTableCell(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()); reportWriter.writeBox(cell.getLineBox(), JRXmlWriter.JASPERREPORTS_NAMESPACE); reportWriter.writeChildElements(cell); writer.closeElement();//cell } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/0000755000175000017500000000000011654071732023437 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRCategoryPlot.java0000644000175000017500000000337211640566634027164 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRLinePlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRCategoryPlot extends JRChartPlot, JRCategoryAxisFormat, JRValueAxisFormat { /** * */ public JRExpression getCategoryAxisLabelExpression(); /** * */ public JRExpression getValueAxisLabelExpression(); /** * */ public JRExpression getDomainAxisMinValueExpression(); /** * */ public JRExpression getDomainAxisMaxValueExpression(); /** * */ public JRExpression getRangeAxisMinValueExpression(); /** * */ public JRExpression getRangeAxisMaxValueExpression(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRValueAxisFormat.java0000644000175000017500000000353311632162653027613 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRValueAxisFormat.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRThermometerPlot.java0000644000175000017500000000657311632162653027702 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRThermometerPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); /** * @deprecated No longer used. */ public boolean isShowValueLines(); /** * Returns the location where the value of the thermometer will be shown. The * return value will be one of net.sf.jasperreports.charts.type.ValueLocationEnum.NONE, * net.sf.jasperreports.charts.type.ValueLocationEnum.LEFT, net.sf.jasperreports.charts.type.ValueLocationEnum.RIGHT or * net.sf.jasperreports.charts.type.ValueLocationEnum.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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRValueDataset.java0000644000175000017500000000326011632162653027120 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRValueDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRValueDisplay.java0000644000175000017500000000410711632162653027141 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRValueDisplay.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRXyzSeries.java0000644000175000017500000000346211632162653026507 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRXyzSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRXyzSeries extends JRCloneable { public JRExpression getSeriesExpression(); public JRExpression getXValueExpression(); public JRExpression getYValueExpression(); 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRBar3DPlot.java0000644000175000017500000000312111640566635026273 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRBar3DPlot.java 4614 2011-09-18 09:21:57Z teodord $ */ public interface JRBar3DPlot extends JRCategoryPlot { /** * */ public Double getXOffsetDouble(); /** * */ public JRItemLabel getItemLabel(); /** * */ public void setXOffset(Double xOffset); /** * */ public Double getYOffsetDouble(); /** * */ public void setYOffset(Double yOffset); /** * */ public Boolean getShowLabels(); /** * */ public void setShowLabels(Boolean isShowLabels); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/ChartThemeBundle.java0000644000175000017500000000246711632162652027467 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: ChartThemeBundle.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface ChartThemeBundle { /** * */ public String[] getChartThemeNames(); /** * */ public ChartTheme getChartTheme(String themeName); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRCategoryAxisFormat.java0000644000175000017500000000535311632162652030315 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRCategoryAxisFormat.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRPieSeries.java0000644000175000017500000000346111632162653026431 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRPieSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRPieSeries extends JRCloneable { /** * */ public JRExpression getKeyExpression(); /** * */ public JRExpression getValueExpression(); /** * */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRPie3DPlot.java0000644000175000017500000000314711632162653026305 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRPie3DPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRPie3DPlot extends JRChartPlot { public static final double DEPTH_FACTOR_DEFAULT = 0.2; /** * */ public Double getDepthFactorDouble(); /** * */ public Boolean getCircular(); /** * */ public String getLabelFormat(); /** * */ public String getLegendLabelFormat(); /** * */ public JRItemLabel getItemLabel(); /** * */ public Boolean getShowLabels(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/package.html0000644000175000017500000000040611614510764025717 0ustar drazzibdrazzib Contains interfaces for chart plots and chart datasets.

Related Documentation

jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRTimePeriodDataset.java0000644000175000017500000000247311632162653030112 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRTimePeriodDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRTimePeriodDataset extends JRChartDataset { public JRTimePeriodSeries[] getSeries(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRBarPlot.java0000644000175000017500000000315211640566635026110 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBarPlot.java 4614 2011-09-18 09:21:57Z teodord $ */ public interface JRBarPlot extends JRCategoryPlot { /** * */ public Boolean getShowTickMarks(); /** * */ public void setShowTickMarks(Boolean isShowTickMarks); /** * */ public Boolean getShowTickLabels(); /** * */ public JRItemLabel getItemLabel(); /** * */ public void setShowTickLabels(Boolean isShowTickLabels); /** * */ public Boolean getShowLabels(); /** * */ public void setShowLabels( Boolean isShowLabels ); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRGanttDataset.java0000644000175000017500000000244411632162652027123 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Peter Risko (peter@risko.hu) * @version $Id: JRGanttDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRGanttDataset extends JRChartDataset { /** * */ public JRGanttSeries[] getSeries(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRXySeries.java0000644000175000017500000000354411632162653026316 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRXySeries.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRXySeries extends JRCloneable { /** * */ public JRExpression getSeriesExpression(); /** * */ public JRExpression getXValueExpression(); /** * */ public JRExpression getYValueExpression(); /** * */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/ChartContext.java0000644000175000017500000000347011632162652026712 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 org.jfree.data.general.Dataset; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: ChartContext.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface ChartContext { /** * */ 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; } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRCategoryDataset.java0000644000175000017500000000250011632162652027614 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRCategoryDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRCategoryDataset extends JRChartDataset { /** * */ public JRCategorySeries[] getSeries(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRXyDataset.java0000644000175000017500000000245611632162653026452 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRXyDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRXyDataset extends JRChartDataset { /** * */ public JRXySeries[] getSeries(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRTimePeriodSeries.java0000644000175000017500000000367211632162653027761 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRTimePeriodSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRTimePeriodSeries extends JRCloneable { /** * */ public JRExpression getSeriesExpression(); /** * */ public JRExpression getStartDateExpression(); /** * */ public JRExpression getEndDateExpression(); /** * */ public JRExpression getValueExpression(); /** * */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRCommonLinePlot.java0000644000175000017500000000263311650262322027432 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRLinePlot.java 4614 2011-09-18 09:21:57Z teodord $ */ public interface JRCommonLinePlot { /** * */ public Boolean getShowLines(); /** * */ public void setShowLines(Boolean isShowLines); /** * */ public Boolean getShowShapes(); /** * */ public void setShowShapes(Boolean isShowShapes); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRHighLowDataset.java0000644000175000017500000000404111632162652027402 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Ionut Nedelcu (ionutned@users.sourceforge.net) * @version $Id: JRHighLowDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRHighLowDataset extends JRChartDataset { /** * */ public JRExpression getSeriesExpression(); /** * */ public JRExpression getDateExpression(); /** * */ public JRExpression getHighExpression(); /** * */ public JRExpression getLowExpression(); /** * */ public JRExpression getOpenExpression(); /** * */ public JRExpression getCloseExpression(); /** * */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRXAxisFormat.java0000644000175000017500000000344611632162653026751 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRXAxisFormat.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRYAxisFormat.java0000644000175000017500000000345011632162653026745 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRYAxisFormat.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRScatterPlot.java0000644000175000017500000000337011650262324027000 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRScatterPlot.java 4734 2011-10-21 12:13:21Z teodord $ */ public interface JRScatterPlot extends JRChartPlot, JRXAxisFormat, JRYAxisFormat, JRCommonLinePlot { /** * */ public JRExpression getXAxisLabelExpression(); /** * */ public JRExpression getYAxisLabelExpression(); /** * */ public JRExpression getDomainAxisMinValueExpression(); /** * */ public JRExpression getDomainAxisMaxValueExpression(); /** * */ public JRExpression getRangeAxisMinValueExpression(); /** * */ public JRExpression getRangeAxisMaxValueExpression(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRLinePlot.java0000644000175000017500000000233211650262323026256 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRLinePlot.java 4734 2011-10-21 12:13:21Z teodord $ */ public interface JRLinePlot extends JRCategoryPlot, JRCommonLinePlot { } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRMultiAxisPlot.java0000644000175000017500000000321411632162653027313 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRMultiAxisPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRMultiAxisPlot extends JRChartPlot { /** * Returns a List of all the children axis. Each element is of type * net.sf.jasperreports.charts.util.JRChartAxis. */ public List getAxes(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRGanttSeries.java0000644000175000017500000000370311632162652026767 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Peter Risko (peter@risko.hu) * @version $Id: JRGanttSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRGanttSeries { /** * */ public JRExpression getSeriesExpression(); /** * */ public JRExpression getTaskExpression(); /** * */ public JRExpression getSubtaskExpression(); /** * */ public JRExpression getStartDateExpression(); /** * */ public JRExpression getEndDateExpression(); /** * */ public JRExpression getPercentExpression(); /** * */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRAreaPlot.java0000644000175000017500000000231011640566635026247 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 Flavus Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRAreaPlot.java 4614 2011-09-18 09:21:57Z teodord $ */ public interface JRAreaPlot extends JRCategoryPlot { } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/type/0000755000175000017500000000000011654071732024420 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/type/ValueLocationEnum.java0000644000175000017500000000531211632162653030655 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: ValueLocationEnum.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient byte value; private final transient String name; private ValueLocationEnum(byte value, String name) { this.value = value; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(value); } /** * */ public final byte getValue() { return value; } /** * */ public String getName() { return name; } /** * */ public static ValueLocationEnum getByName(String name) { return (ValueLocationEnum)EnumUtil.getByName(values(), name); } /** * */ public static ValueLocationEnum getByValue(Byte value) { return (ValueLocationEnum)EnumUtil.getByValue(values(), value); } /** * */ public static ValueLocationEnum getByValue(byte value) { return getByValue(new Byte(value)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/type/AxisPositionEnum.java0000644000175000017500000000475711632162653030555 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: AxisPositionEnum.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient byte value; private final transient String name; private AxisPositionEnum(byte value, String name) { this.value = value; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(value); } /** * */ public final byte getValue() { return value; } /** * */ public String getName() { return name; } /** * */ public static AxisPositionEnum getByName(String name) { return (AxisPositionEnum)EnumUtil.getByName(values(), name); } /** * */ public static AxisPositionEnum getByValue(Byte value) { return (AxisPositionEnum)EnumUtil.getByValue(values(), value); } /** * */ public static AxisPositionEnum getByValue(byte value) { return getByValue(new Byte(value)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/type/ScaleTypeEnum.java0000644000175000017500000000516611632162653030010 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; import org.jfree.chart.renderer.xy.XYBubbleRenderer; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: ScaleTypeEnum.java 4595 2011-09-08 15:55:10Z teodord $ */ public enum ScaleTypeEnum implements JREnum { /** * */ 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 static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient byte value; private final transient String name; private ScaleTypeEnum(byte value, String name) { this.value = value; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(value); } /** * */ public final byte getValue() { return value; } /** * */ public String getName() { return name; } /** * */ public static ScaleTypeEnum getByName(String name) { return (ScaleTypeEnum)EnumUtil.getByName(values(), name); } /** * */ public static ScaleTypeEnum getByValue(Integer value) { return (ScaleTypeEnum)EnumUtil.getByValue(values(), value); } /** * */ public static ScaleTypeEnum getByValue(Byte value) { return (ScaleTypeEnum)EnumUtil.getByValue(values(), value); } /** * */ public static ScaleTypeEnum getByValue(byte value) { return getByValue(new Byte(value)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/type/MeterShapeEnum.java0000644000175000017500000000552211632162653030150 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: MeterShapeEnum.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient byte value; private final transient String name; private MeterShapeEnum(byte value, String name) { this.value = value; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(value); } /** * */ public final byte getValue() { return value; } /** * */ public String getName() { return name; } /** * */ public static MeterShapeEnum getByName(String name) { return (MeterShapeEnum)EnumUtil.getByName(values(), name); } /** * */ public static MeterShapeEnum getByValue(Byte value) { return (MeterShapeEnum)EnumUtil.getByValue(values(), value); } /** * */ public static MeterShapeEnum getByValue(byte value) { return getByValue(new Byte(value)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/type/EdgeEnum.java0000644000175000017500000000445211632162653026760 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: EdgeEnum.java 4595 2011-09-08 15:55:10Z teodord $ */ public enum EdgeEnum implements JREnum { /** * */ TOP((byte)1, "Top"), /** * */ BOTTOM((byte)2, "Bottom"), /** * */ LEFT((byte)3, "Left"), /** * */ RIGHT((byte)4, "Right"); /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient byte value; private final transient String name; private EdgeEnum(byte value, String name) { this.value = value; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(value); } /** * */ public final byte getValue() { return value; } /** * */ public String getName() { return name; } /** * */ public static EdgeEnum getByName(String name) { return (EdgeEnum)EnumUtil.getByName(values(), name); } /** * */ public static EdgeEnum getByValue(Byte value) { return (EdgeEnum)EnumUtil.getByValue(values(), value); } /** * */ public static EdgeEnum getByValue(byte value) { return getByValue(new Byte(value)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/type/TimePeriodEnum.java0000644000175000017500000000614111632162653030152 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; 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) * @version $Id: TimePeriodEnum.java 4595 2011-09-08 15:55:10Z teodord $ */ public enum TimePeriodEnum implements JREnum { /** * */ 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 static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient Class value; private final transient String name; private TimePeriodEnum(Class clazz, String name) { this.value = clazz; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(getValue()); } /** * */ public final byte getValue() { return (byte)-1; } /** * */ public String getName() { return name; } /** * */ public final Class getTimePeriod() { return this.value; } /** * */ public static TimePeriodEnum getByName(String name) { return (TimePeriodEnum)EnumUtil.getByName(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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/type/PlotOrientationEnum.java0000644000175000017500000000512711632162653031246 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; import org.jfree.chart.plot.PlotOrientation; /** * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: PlotOrientationEnum.java 4595 2011-09-08 15:55:10Z teodord $ */ public enum PlotOrientationEnum implements JREnum { /** * */ HORIZONTAL(PlotOrientation.HORIZONTAL, "Horizontal"), /** * */ VERTICAL(PlotOrientation.VERTICAL, "Vertical"); /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient PlotOrientation value; private final transient String name; private PlotOrientationEnum(PlotOrientation orientation, String name) { this.value = orientation; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(getValue()); } /** * */ public final byte getValue() { return (byte)-1; } /** * */ public String getName() { return name; } /** * */ public final PlotOrientation getOrientation() { return this.value; } /** * */ public static PlotOrientationEnum getByName(String name) { return (PlotOrientationEnum)EnumUtil.getByName(values(), name); } /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRMeterPlot.java0000644000175000017500000001107211632162653026451 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * 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 * can be broken up into shaded regions to highlight portions of the range. * * @author Barry Klawans (bklawans@users.sourceforge.net) * @version $Id: JRMeterPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 net.sf.jasperreports.charts.util.JRMeterInterval} * * @return a list of all the intervals contained in this Meter */ public List getIntervals(); /** * Returns the size of the Meter face in degrees. * * @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 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRBubblePlot.java0000644000175000017500000000363611632162652026576 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRBubblePlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRBubblePlot extends JRChartPlot, JRXAxisFormat, JRYAxisFormat { /** * */ public JRExpression getXAxisLabelExpression(); /** * */ public JRExpression getYAxisLabelExpression(); /** * */ public ScaleTypeEnum getScaleTypeValue(); /** * */ public void setScaleType(ScaleTypeEnum scaleType); /** * */ public JRExpression getDomainAxisMinValueExpression(); /** * */ public JRExpression getDomainAxisMaxValueExpression(); /** * */ public JRExpression getRangeAxisMinValueExpression(); /** * */ public JRExpression getRangeAxisMaxValueExpression(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRCategorySeries.java0000644000175000017500000000356111632162652027471 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRCategorySeries.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRCategorySeries extends JRCloneable { /** * */ public JRExpression getSeriesExpression(); /** * */ public JRExpression getCategoryExpression(); /** * */ public JRExpression getValueExpression(); /** * */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRTimeSeriesDataset.java0000644000175000017500000000261211632162653030115 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRTimeSeriesDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRTimeSeriesDataset extends JRChartDataset { public JRTimeSeries[] getSeries(); public Class getTimePeriod(); public void setTimePeriod(Class timePeriod); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRDataRange.java0000644000175000017500000000332611632162652026366 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDataRange.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRPiePlot.java0000644000175000017500000000276011632162653026116 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRPiePlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRPiePlot extends JRChartPlot { /** * */ public Boolean getCircular(); /** * */ public String getLabelFormat(); /** * */ public String getLegendLabelFormat(); /** * */ public JRItemLabel getItemLabel(); /** * */ public Boolean getShowLabels(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRTimeSeriesPlot.java0000644000175000017500000000354011632162653027447 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRTimeSeriesPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRTimeSeriesPlot extends JRChartPlot, JRTimeAxisFormat, JRValueAxisFormat { /** * */ public JRExpression getTimeAxisLabelExpression(); /** * */ public JRExpression getValueAxisLabelExpression(); /** * */ public JRExpression getDomainAxisMinValueExpression(); /** * */ public JRExpression getDomainAxisMaxValueExpression(); /** * */ public JRExpression getRangeAxisMinValueExpression(); /** * */ public JRExpression getRangeAxisMaxValueExpression(); /** * */ public Boolean getShowLines(); /** * */ public Boolean getShowShapes(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRTimeAxisFormat.java0000644000175000017500000000351311632162653027433 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRTimeAxisFormat.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRItemLabel.java0000644000175000017500000000411711632162652026375 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * Represents the formatting option for the textual * representation of item labels in a category plot * * @author sanda zaharia (shertage@users.sourceforge.net) * @version $Id: JRItemLabel.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRItemLabel extends JRCloneable { /** * */ public JRChart getChart(); /** * Returns the item label font. * * @return the item label font */ public JRFont getFont(); /** * Returns the item label text color * * @return the item label text color */ public Color getColor(); /** * Returns the item label background color * * @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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/ChartTheme.java0000644000175000017500000000254111632162652026326 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: ChartTheme.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface ChartTheme { /** * */ public JFreeChart createChart(ChartContext chartContext) throws JRException; } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/0000755000175000017500000000000011654071732024351 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseXySeries.java0000644000175000017500000000670511632162653030025 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseXySeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 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()); } /** * */ public JRExpression getSeriesExpression() { return seriesExpression; } /** * */ public JRExpression getXValueExpression() { return xValueExpression; } /** * */ public JRExpression getYValueExpression() { return yValueExpression; } /** * */ public JRExpression getLabelExpression() { return labelExpression; } public JRHyperlink getItemHyperlink() { return itemHyperlink; } /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseTimePeriodSeries.java0000644000175000017500000000737511632162653031472 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseTimePeriodSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } public JRExpression getSeriesExpression(){ return seriesExpression; } public JRExpression getStartDateExpression(){ return startDateExpression; } public JRExpression getEndDateExpression(){ return endDateExpression; } public JRExpression getValueExpression(){ return valueExpression; } public JRExpression getLabelExpression(){ return labelExpression; } public JRHyperlink getItemHyperlink() { return itemHyperlink; } /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseBar3DPlot.java0000644000175000017500000002710211632162653027776 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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; import net.sf.jasperreports.engine.util.JRStyleResolver; import org.jfree.chart.renderer.category.BarRenderer3D; /** * @author Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRBaseBar3DPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRBaseBar3DPlot extends JRBaseChartPlot implements JRBar3DPlot { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_SHOW_LABELS = "showLabels"; 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) { super(plot, chart); JRBar3DPlot barPlot = plot instanceof JRBar3DPlot ? (JRBar3DPlot)plot : null; if (barPlot == null) { itemLabel = new JRBaseItemLabel(null, chart); } else { categoryAxisLabelFont = barPlot.getCategoryAxisLabelFont(); categoryAxisTickLabelFont = getCategoryAxisTickLabelFont(); valueAxisLabelFont = barPlot.getValueAxisLabelFont(); valueAxisTickLabelFont = barPlot.getValueAxisTickLabelFont(); itemLabel = new JRBaseItemLabel(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(barPlot.getChart(), barPlot.getCategoryAxisLabelFont()); categoryAxisLabelColor = barPlot.getOwnCategoryAxisLabelColor(); categoryAxisTickLabelFont = factory.getFont(barPlot.getChart(), 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(barPlot.getChart(), barPlot.getValueAxisLabelFont()); valueAxisLabelColor = barPlot.getOwnValueAxisLabelColor(); valueAxisTickLabelFont = factory.getFont(barPlot.getChart(), barPlot.getValueAxisTickLabelFont()); valueAxisTickLabelColor = barPlot.getOwnValueAxisTickLabelColor(); valueAxisTickLabelMask = barPlot.getValueAxisTickLabelMask(); valueAxisVerticalTickLabels = barPlot.getValueAxisVerticalTickLabels(); valueAxisLineColor = barPlot.getOwnValueAxisLineColor(); itemLabel = new JRBaseItemLabel(barPlot.getItemLabel(), factory); } /** * */ public JRExpression getCategoryAxisLabelExpression(){ return categoryAxisLabelExpression; } /** * */ public JRFont getCategoryAxisLabelFont() { return categoryAxisLabelFont; } /** * */ public Color getCategoryAxisLabelColor() { return JRStyleResolver.getCategoryAxisLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisLabelColor() { return categoryAxisLabelColor; } /** * */ public JRFont getCategoryAxisTickLabelFont() { return categoryAxisTickLabelFont; } /** * */ public Color getCategoryAxisTickLabelColor() { return JRStyleResolver.getCategoryAxisTickLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisTickLabelColor() { return categoryAxisTickLabelColor; } /** * */ public String getCategoryAxisTickLabelMask() { return categoryAxisTickLabelMask; } /** * */ public Boolean getCategoryAxisVerticalTickLabels() { return categoryAxisVerticalTickLabels; } /** * */ public Double getCategoryAxisTickLabelRotation() { return labelRotationDouble; } /** * */ public void setCategoryAxisTickLabelRotation(Double labelRotationDouble) { Object old = this.labelRotationDouble; this.labelRotationDouble = labelRotationDouble; getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_ROTATION, old, this.labelRotationDouble); } /** * */ public Color getCategoryAxisLineColor() { return JRStyleResolver.getCategoryAxisLineColor(this, this); } /** * */ public Color getOwnCategoryAxisLineColor() { return categoryAxisLineColor; } /** * */ public JRExpression getValueAxisLabelExpression(){ return valueAxisLabelExpression; } /** * */ public JRExpression getRangeAxisMinValueExpression(){ return rangeAxisMinValueExpression; } /** * */ public JRExpression getRangeAxisMaxValueExpression(){ return rangeAxisMaxValueExpression; } /** * */ public JRExpression getDomainAxisMinValueExpression(){ return domainAxisMinValueExpression; } /** * */ public JRExpression getDomainAxisMaxValueExpression(){ return domainAxisMaxValueExpression; } /** * */ public JRFont getValueAxisLabelFont() { return valueAxisLabelFont; } /** * */ public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor(this, this); } /** * */ public Color getOwnValueAxisLabelColor() { return valueAxisLabelColor; } /** * */ public JRFont getValueAxisTickLabelFont() { return valueAxisTickLabelFont; } /** * */ public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor(this, this); } /** * */ public Color getOwnValueAxisTickLabelColor() { return valueAxisTickLabelColor; } /** * */ public String getValueAxisTickLabelMask() { return valueAxisTickLabelMask; } /** * */ public Boolean getValueAxisVerticalTickLabels() { return valueAxisVerticalTickLabels; } /** * */ public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor(this, this); } /** * */ public Color getOwnValueAxisLineColor() { return valueAxisLineColor; } /** * */ public Double getXOffsetDouble(){ return xOffsetDouble; } /** * */ public JRItemLabel getItemLabel() { return itemLabel; } /** * */ public void setXOffset( Double xOffset ){ Double old = this.xOffsetDouble; this.xOffsetDouble = xOffset; getEventSupport().firePropertyChange(PROPERTY_X_OFFSET, old, this.xOffsetDouble); } /** * */ public Double getYOffsetDouble(){ return yOffsetDouble; } /** * */ public void setYOffset( Double yOffset ){ Double old = this.yOffsetDouble; this.yOffsetDouble = yOffset; getEventSupport().firePropertyChange(PROPERTY_Y_OFFSET, old, this.yOffsetDouble); } /** * */ 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); } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } /** * */ 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 = JRCloneUtils.nullSafeClone(itemLabel); 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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseBarPlot.java0000644000175000017500000002706011632162653027612 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRBaseBarPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRBaseBarPlot extends JRBaseChartPlot implements JRBarPlot { /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_SHOW_LABELS = "showLabels"; public static final String PROPERTY_SHOW_TICK_LABELS = "showTickLabels"; public static final String PROPERTY_SHOW_TICK_MARKS = "showTickMarks"; 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) { super(plot, chart); JRBarPlot barPlot = plot instanceof JRBarPlot ? (JRBarPlot)plot : null; if (barPlot == null) { itemLabel = new JRBaseItemLabel(null, chart); } else { categoryAxisLabelFont = barPlot.getCategoryAxisLabelFont(); categoryAxisTickLabelFont = barPlot.getCategoryAxisTickLabelFont(); valueAxisLabelFont = barPlot.getValueAxisLabelFont(); valueAxisTickLabelFont = barPlot.getValueAxisTickLabelFont(); itemLabel = new JRBaseItemLabel(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(barPlot.getChart(), barPlot.getCategoryAxisLabelFont()); categoryAxisLabelColor = barPlot.getOwnCategoryAxisLabelColor(); categoryAxisTickLabelFont = factory.getFont(barPlot.getChart(), 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(barPlot.getChart(), barPlot.getValueAxisLabelFont()); valueAxisLabelColor = barPlot.getOwnValueAxisLabelColor(); valueAxisTickLabelFont = factory.getFont(barPlot.getChart(), barPlot.getValueAxisTickLabelFont()); valueAxisTickLabelColor = barPlot.getOwnValueAxisTickLabelColor(); valueAxisTickLabelMask = barPlot.getValueAxisTickLabelMask(); valueAxisVerticalTickLabels = barPlot.getValueAxisVerticalTickLabels(); valueAxisLineColor = barPlot.getOwnValueAxisLineColor(); itemLabel = new JRBaseItemLabel(barPlot.getItemLabel(), factory); } /** * */ public JRExpression getCategoryAxisLabelExpression(){ return categoryAxisLabelExpression; } /** * */ public JRFont getCategoryAxisLabelFont() { return categoryAxisLabelFont; } /** * */ public Color getCategoryAxisLabelColor() { return JRStyleResolver.getCategoryAxisLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisLabelColor() { return categoryAxisLabelColor; } /** * */ public JRFont getCategoryAxisTickLabelFont() { return categoryAxisTickLabelFont; } /** * */ public Color getCategoryAxisTickLabelColor() { return JRStyleResolver.getCategoryAxisTickLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisTickLabelColor() { return categoryAxisTickLabelColor; } /** * */ public String getCategoryAxisTickLabelMask() { return categoryAxisTickLabelMask; } /** * */ public Boolean getCategoryAxisVerticalTickLabels() { return categoryAxisVerticalTickLabels; } /** * */ public Double getCategoryAxisTickLabelRotation() { return labelRotationDouble; } /** * */ public void setCategoryAxisTickLabelRotation(Double labelRotationDouble) { Object old = this.labelRotationDouble; this.labelRotationDouble = labelRotationDouble; getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_ROTATION, old, this.labelRotationDouble); } /** * */ public Color getCategoryAxisLineColor() { return JRStyleResolver.getCategoryAxisLineColor(this, this); } /** * */ public Color getOwnCategoryAxisLineColor() { return categoryAxisLineColor; } /** * */ public JRExpression getValueAxisLabelExpression(){ return valueAxisLabelExpression; } /** * */ public JRExpression getDomainAxisMinValueExpression(){ return domainAxisMinValueExpression; } /** * */ public JRExpression getDomainAxisMaxValueExpression(){ return domainAxisMaxValueExpression; } /** * */ public JRExpression getRangeAxisMinValueExpression(){ return rangeAxisMinValueExpression; } /** * */ public JRExpression getRangeAxisMaxValueExpression(){ return rangeAxisMaxValueExpression; } /** * */ public JRFont getValueAxisLabelFont() { return valueAxisLabelFont; } /** * */ public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor(this, this); } /** * */ public Color getOwnValueAxisLabelColor() { return valueAxisLabelColor; } /** * */ public JRFont getValueAxisTickLabelFont() { return valueAxisTickLabelFont; } /** * */ public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor(this, this); } /** * */ public Color getOwnValueAxisTickLabelColor() { return valueAxisTickLabelColor; } /** * */ public String getValueAxisTickLabelMask() { return valueAxisTickLabelMask; } /** * */ public Boolean getValueAxisVerticalTickLabels() { return valueAxisVerticalTickLabels; } /** * */ public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor(this, this); } /** * */ public Color getOwnValueAxisLineColor() { return valueAxisLineColor; } /** * */ public Boolean getShowLabels(){ return showLabels; } /** * */ public JRItemLabel getItemLabel() { return itemLabel; } /** * */ public void setShowLabels( Boolean showLabels ){ Boolean old = this.showLabels; this.showLabels = showLabels; getEventSupport().firePropertyChange(PROPERTY_SHOW_LABELS, old, this.showLabels); } /** * */ public Boolean getShowTickMarks() { return showTickMarks; } /** * */ public void setShowTickMarks(Boolean isShowTickMarks) { Boolean old = this.showTickMarks; this.showTickMarks = isShowTickMarks; getEventSupport().firePropertyChange(PROPERTY_SHOW_TICK_MARKS, old, this.showTickMarks); } /** * */ public Boolean getShowTickLabels() { return showTickLabels; } /** * */ public void setShowTickLabels(Boolean showTickLabels) { Boolean old = this.showTickLabels; this.showTickLabels = showTickLabels; getEventSupport().firePropertyChange(PROPERTY_SHOW_TICK_LABELS, old, this.showTickLabels); } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } /** * */ 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 = JRCloneUtils.nullSafeClone(itemLabel); 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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseDataRange.java0000644000175000017500000000741311632162653030075 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 JRDataRange, suitable for holding * a range. * * @author Barry Klawans (bklawans@users.sourceforge.net) * @version $Id: JRBaseDataRange.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } /** * */ public JRExpression getLowExpression() { return lowExpression; } /** * */ 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); } /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseHighLowDataset.java0000644000175000017500000001110111632162653031103 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseHighLowDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } public JRExpression getSeriesExpression() { return seriesExpression; } public JRExpression getDateExpression() { return dateExpression; } public JRExpression getHighExpression() { return highExpression; } public JRExpression getLowExpression() { return lowExpression; } public JRExpression getOpenExpression() { return openExpression; } public JRExpression getCloseExpression() { return closeExpression; } public JRExpression getVolumeExpression() { return volumeExpression; } /* (non-Javadoc) * @see net.sf.jasperreports.engine.JRChartDataset#getDatasetType() */ public byte getDatasetType() { return JRChartDataset.HIGHLOW_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public JRHyperlink getItemHyperlink() { return itemHyperlink; } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/package.html0000644000175000017500000000041211614510764026626 0ustar drazzibdrazzib Contains base implementations for chart related interfaces.

Related Documentation

jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseCandlestickPlot.java0000644000175000017500000002331711632162653031333 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Ionut Nedelcu (ionutned@users.sourceforge.net) * @version $Id: JRBaseCandlestickPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRBaseCandlestickPlot extends JRBaseChartPlot implements JRCandlestickPlot { /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_SHOW_VOLUME = "showVolume"; 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(candlestickPlot.getChart(), candlestickPlot.getTimeAxisLabelFont()); timeAxisLabelColor = candlestickPlot.getOwnTimeAxisLabelColor(); timeAxisTickLabelFont = factory.getFont(candlestickPlot.getChart(), 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(candlestickPlot.getChart(), candlestickPlot.getValueAxisLabelFont()); valueAxisLabelColor = candlestickPlot.getOwnValueAxisLabelColor(); valueAxisTickLabelFont = factory.getFont(candlestickPlot.getChart(), candlestickPlot.getValueAxisTickLabelFont()); valueAxisTickLabelColor = candlestickPlot.getOwnValueAxisTickLabelColor(); valueAxisTickLabelMask = candlestickPlot.getValueAxisTickLabelMask(); valueAxisVerticalTickLabels = candlestickPlot.getValueAxisVerticalTickLabels(); valueAxisLineColor = candlestickPlot.getOwnValueAxisTickLabelColor(); } /** * */ public JRExpression getTimeAxisLabelExpression(){ return timeAxisLabelExpression; } /** * */ public JRFont getTimeAxisLabelFont() { return timeAxisLabelFont; } /** * */ public Color getTimeAxisLabelColor() { return JRStyleResolver.getTimeAxisLabelColor(this, this); } /** * */ public Color getOwnTimeAxisLabelColor() { return timeAxisLabelColor; } /** * */ public JRFont getTimeAxisTickLabelFont() { return timeAxisTickLabelFont; } /** * */ public Color getTimeAxisTickLabelColor() { return JRStyleResolver.getTimeAxisTickLabelColor(this, this); } /** * */ public Color getOwnTimeAxisTickLabelColor() { return timeAxisTickLabelColor; } /** * */ public String getTimeAxisTickLabelMask() { return timeAxisTickLabelMask; } /** * */ public Boolean getTimeAxisVerticalTickLabels() { return timeAxisVerticalTickLabels; } /** * */ public Color getTimeAxisLineColor() { return JRStyleResolver.getTimeAxisLineColor(this, this); } /** * */ public Color getOwnTimeAxisLineColor() { return timeAxisLineColor; } /** * */ public JRExpression getValueAxisLabelExpression(){ return valueAxisLabelExpression; } /** * */ public JRExpression getDomainAxisMinValueExpression(){ return domainAxisMinValueExpression; } /** * */ public JRExpression getDomainAxisMaxValueExpression(){ return domainAxisMaxValueExpression; } /** * */ public JRExpression getRangeAxisMinValueExpression(){ return rangeAxisMinValueExpression; } /** * */ public JRExpression getRangeAxisMaxValueExpression(){ return rangeAxisMaxValueExpression; } /** * */ public JRFont getValueAxisLabelFont() { return valueAxisLabelFont; } /** * */ public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor(this, this); } /** * */ public Color getOwnValueAxisLabelColor() { return valueAxisLabelColor; } /** * */ public JRFont getValueAxisTickLabelFont() { return valueAxisTickLabelFont; } /** * */ public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor(this, this); } /** * */ public Color getOwnValueAxisTickLabelColor() { return valueAxisTickLabelColor; } /** * */ public String getValueAxisTickLabelMask() { return valueAxisTickLabelMask; } /** * */ public Boolean getValueAxisVerticalTickLabels() { return valueAxisVerticalTickLabels; } /** * */ public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor(this, this); } /** * */ public Color getOwnValueAxisLineColor() { return valueAxisLineColor; } /** * */ 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); } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } /** * */ 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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseCategoryDataset.java0000644000175000017500000000610511632162653031327 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseCategoryDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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]); } } } /** * */ public JRCategorySeries[] getSeries() { return categorySeries; } /* (non-Javadoc) * @see net.sf.jasperreports.engine.JRChartDataset#getDatasetType() */ public byte getDatasetType() { return JRChartDataset.CATEGORY_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ public Object clone() { JRBaseCategoryDataset clone = (JRBaseCategoryDataset)super.clone(); clone.categorySeries = JRCloneUtils.cloneArray(categorySeries); return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseThermometerPlot.java0000644000175000017500000001537411632162653031406 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseThermometerPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; /** * Indicates if the boundaries of each range should be shown. * @deprecated No longer used. */ protected boolean showValueLines; /** * 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); } } /** * */ public JRDataRange getDataRange() { return dataRange; } /** * */ public JRValueDisplay getValueDisplay() { return valueDisplay; } /** * @deprecated No longer used. */ public boolean isShowValueLines() { return showValueLines; } /** * */ public ValueLocationEnum getValueLocationValue() { return valueLocationObject; } /** * */ public Color getMercuryColor() { return mercuryColor; } /** * */ public JRDataRange getLowRange() { return lowRange; } /** * */ public JRDataRange getMediumRange() { return mediumRange; } /** * */ 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 */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } /** * */ public Object clone(JRChart parentChart) { JRBaseThermometerPlot clone = (JRBaseThermometerPlot)super.clone(parentChart); clone.dataRange = JRCloneUtils.nullSafeClone(dataRange); clone.valueDisplay = JRCloneUtils.nullSafeClone(valueDisplay); 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; 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; } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseChartAxis.java0000644000175000017500000000737311632162653030142 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * Base read-only implementation of {@link JRChartAxis JRChartAxis}. * * @author Barry Klawans (barry@users.sourceforge.net) * @version $Id: JRBaseChartAxis.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 */ 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 */ public JRChart getChart() { return chart; } /** * */ public Object clone() { JRBaseChartAxis clone = null; try { clone = (JRBaseChartAxis)super.clone(); } catch (CloneNotSupportedException e) { throw new JRRuntimeException(e); } 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; 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; } } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseBubblePlot.java0000644000175000017500000002310411632162653030274 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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; import net.sf.jasperreports.engine.util.JRStyleResolver; import org.jfree.chart.renderer.xy.XYBubbleRenderer; /** * @author Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRBaseBubblePlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(bubblePlot.getChart(), bubblePlot.getXAxisLabelFont()); xAxisLabelColor = bubblePlot.getOwnXAxisLabelColor(); xAxisTickLabelFont = factory.getFont(bubblePlot.getChart(), bubblePlot.getXAxisTickLabelFont()); xAxisTickLabelColor = bubblePlot.getOwnXAxisTickLabelColor(); xAxisTickLabelMask = bubblePlot.getXAxisTickLabelMask(); xAxisVerticalTickLabels = bubblePlot.getXAxisVerticalTickLabels(); xAxisLineColor = bubblePlot.getOwnXAxisLineColor(); yAxisLabelExpression = factory.getExpression( bubblePlot.getYAxisLabelExpression() ); yAxisLabelFont = factory.getFont(bubblePlot.getChart(), bubblePlot.getYAxisLabelFont()); yAxisLabelColor = bubblePlot.getOwnYAxisLabelColor(); yAxisTickLabelFont = factory.getFont(bubblePlot.getChart(), 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() ); } /** * */ public JRExpression getXAxisLabelExpression(){ return xAxisLabelExpression; } /** * */ public JRFont getXAxisLabelFont() { return xAxisLabelFont; } /** * */ public Color getXAxisLabelColor() { return JRStyleResolver.getXAxisLabelColor(this, this); } /** * */ public Color getOwnXAxisLabelColor() { return xAxisLabelColor; } /** * */ public JRFont getXAxisTickLabelFont() { return xAxisTickLabelFont; } /** * */ public Color getXAxisTickLabelColor() { return JRStyleResolver.getXAxisTickLabelColor(this, this); } /** * */ public Color getOwnXAxisTickLabelColor() { return xAxisTickLabelColor; } /** * */ public String getXAxisTickLabelMask() { return xAxisTickLabelMask; } /** * */ public Boolean getXAxisVerticalTickLabels() { return xAxisVerticalTickLabels; } /** * */ public Color getXAxisLineColor() { return JRStyleResolver.getXAxisLineColor(this, this); } /** * */ public Color getOwnXAxisLineColor() { return xAxisLineColor; } /** * */ public JRExpression getYAxisLabelExpression(){ return yAxisLabelExpression; } /** * */ public JRFont getYAxisLabelFont() { return yAxisLabelFont; } /** * */ public Color getYAxisLabelColor() { return JRStyleResolver.getYAxisLabelColor(this, this); } /** * */ public Color getOwnYAxisLabelColor() { return yAxisLabelColor; } /** * */ public JRFont getYAxisTickLabelFont() { return yAxisTickLabelFont; } /** * */ public Color getYAxisTickLabelColor() { return JRStyleResolver.getYAxisTickLabelColor(this, this); } /** * */ public Color getOwnYAxisTickLabelColor() { return yAxisTickLabelColor; } /** * */ public String getYAxisTickLabelMask() { return yAxisTickLabelMask; } /** * */ public Boolean getYAxisVerticalTickLabels() { return yAxisVerticalTickLabels; } /** * */ public Color getYAxisLineColor() { return JRStyleResolver.getYAxisLineColor(this, this); } /** * */ public Color getOwnYAxisLineColor() { return yAxisLineColor; } /** * */ public ScaleTypeEnum getScaleTypeValue(){ return scaleTypeValue; } /** * */ public JRExpression getDomainAxisMinValueExpression(){ return domainAxisMinValueExpression; } /** * */ public JRExpression getDomainAxisMaxValueExpression(){ return domainAxisMaxValueExpression; } /** * */ public JRExpression getRangeAxisMinValueExpression(){ return rangeAxisMinValueExpression; } /** * */ public JRExpression getRangeAxisMaxValueExpression(){ return rangeAxisMaxValueExpression; } /** * */ public void setScaleType( ScaleTypeEnum scaleTypeValue ){ ScaleTypeEnum old = this.scaleTypeValue; this.scaleTypeValue = scaleTypeValue; getEventSupport().firePropertyChange(PROPERTY_SCALE_TYPE, old, this.scaleTypeValue); } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } /** * */ 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; 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; } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseMultiAxisPlot.java0000644000175000017500000001001411632162653031014 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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; import net.sf.jasperreports.engine.util.JRCloneUtils; /** * An immutable representation of the layout options of a multiple axis chart. * * @author Barry Klawans (bklawans@users.sourceforge.net) * @version $Id: JRBaseMultiAxisPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 JRChartAxis} */ protected List axes = new java.util.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)); } } } /** * */ 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 */ public void collectExpressions(JRExpressionCollector collector) { Iterator iter = axes.iterator(); while (iter.hasNext()) { JRChartAxis axis = iter.next(); collector.collect(axis.getChart()); } } /** * */ public Object clone(JRChart parentChart) { JRBaseMultiAxisPlot clone = (JRBaseMultiAxisPlot)super.clone(parentChart); clone.axes = JRCloneUtils.cloneList(axes); return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseGanttDataset.java0000644000175000017500000000536311632162653030634 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseGanttDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ //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]); } } } /** * */ public JRGanttSeries[] getSeries() { return ganttSeries; } /* (non-Javadoc) * @see net.sf.jasperreports.engine.JRChartDataset#getDatasetType() */ public byte getDatasetType() { return JRChartDataset.GANTT_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseItemLabel.java0000644000175000017500000001014511632162653030101 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseItemLabel.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(itemLabel.getChart(), itemLabel.getFont()); } /** * */ public JRChart getChart() { return chart; } /** * */ public Color getColor() { return color; } /** * */ public Color getBackgroundColor() { return backgroundColor; } /** * */ // public String getMask() // { // return mask; // } /** * */ 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) { } /** * */ public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { throw new JRRuntimeException(e); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseTimeSeries.java0000644000175000017500000000677311632162653030330 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseTimeSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } /** * */ public JRExpression getSeriesExpression() { return seriesExpression; } /** * */ public JRExpression getTimePeriodExpression() { return timePeriodExpression; } /** * */ public JRExpression getValueExpression() { return valueExpression; } /** * */ public JRExpression getLabelExpression() { return labelExpression; } public JRHyperlink getItemHyperlink() { return itemHyperlink; } /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseTimePeriodDataset.java0000644000175000017500000000600311632162653031610 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseTimePeriodDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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] ); } } } public JRTimePeriodSeries[] getSeries(){ return timePeriodSeries; } /** * */ public byte getDatasetType() { return JRChartDataset.TIMEPERIOD_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ public Object clone() { JRBaseTimePeriodDataset clone = (JRBaseTimePeriodDataset)super.clone(); clone.timePeriodSeries = JRCloneUtils.cloneArray(timePeriodSeries); return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseScatterPlot.java0000644000175000017500000002323311632162653030511 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRBaseScatterPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRBaseScatterPlot extends JRBaseChartPlot implements JRScatterPlot { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_SHOW_LINES = "showLines"; public static final String PROPERTY_SHOW_SHAPES = "showShapes"; 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(scatterPlot.getChart(), scatterPlot.getXAxisLabelFont()); xAxisLabelColor = scatterPlot.getOwnXAxisLabelColor(); xAxisTickLabelFont = factory.getFont(scatterPlot.getChart(), scatterPlot.getXAxisTickLabelFont()); xAxisTickLabelColor = scatterPlot.getOwnXAxisTickLabelColor(); xAxisTickLabelMask = scatterPlot.getXAxisTickLabelMask(); xAxisVerticalTickLabels = scatterPlot.getXAxisVerticalTickLabels(); xAxisLineColor = scatterPlot.getOwnXAxisLineColor(); yAxisLabelExpression = factory.getExpression( scatterPlot.getYAxisLabelExpression() ); yAxisLabelFont = factory.getFont(scatterPlot.getChart(), scatterPlot.getYAxisLabelFont()); yAxisLabelColor = scatterPlot.getOwnYAxisLabelColor(); yAxisTickLabelFont = factory.getFont(scatterPlot.getChart(), 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() ); } /** * */ public JRExpression getXAxisLabelExpression(){ return xAxisLabelExpression; } /** * */ public JRFont getXAxisLabelFont() { return xAxisLabelFont; } /** * */ public Color getXAxisLabelColor() { return JRStyleResolver.getXAxisLabelColor(this, this); } /** * */ public Color getOwnXAxisLabelColor() { return xAxisLabelColor; } /** * */ public JRFont getXAxisTickLabelFont() { return xAxisTickLabelFont; } /** * */ public Color getXAxisTickLabelColor() { return JRStyleResolver.getXAxisTickLabelColor(this, this); } /** * */ public Color getOwnXAxisTickLabelColor() { return xAxisTickLabelColor; } /** * */ public String getXAxisTickLabelMask() { return xAxisTickLabelMask; } /** * */ public Boolean getXAxisVerticalTickLabels() { return xAxisVerticalTickLabels; } /** * */ public Color getXAxisLineColor() { return JRStyleResolver.getXAxisLineColor(this, this); } /** * */ public Color getOwnXAxisLineColor() { return xAxisLineColor; } /** * */ public JRExpression getYAxisLabelExpression() { return yAxisLabelExpression; } /** * */ public JRFont getYAxisLabelFont() { return yAxisLabelFont; } /** * */ public Color getYAxisLabelColor() { return JRStyleResolver.getYAxisLabelColor(this, this); } /** * */ public Color getOwnYAxisLabelColor() { return yAxisLabelColor; } /** * */ public JRFont getYAxisTickLabelFont() { return yAxisTickLabelFont; } /** * */ public Color getYAxisTickLabelColor() { return JRStyleResolver.getYAxisTickLabelColor(this, this); } /** * */ public Color getOwnYAxisTickLabelColor() { return yAxisTickLabelColor; } /** * */ public String getYAxisTickLabelMask() { return yAxisTickLabelMask; } /** * */ public Boolean getYAxisVerticalTickLabels() { return yAxisVerticalTickLabels; } /** * */ public Color getYAxisLineColor() { return JRStyleResolver.getYAxisLineColor(this, this); } /** * */ public Color getOwnYAxisLineColor() { return yAxisLineColor; } /** * */ public Boolean getShowShapes(){ return showShapes; } /** * */ public Boolean getShowLines(){ return showLines; } /** * */ public JRExpression getDomainAxisMinValueExpression(){ return domainAxisMinValueExpression; } /** * */ public JRExpression getDomainAxisMaxValueExpression(){ return domainAxisMaxValueExpression; } /** * */ public JRExpression getRangeAxisMinValueExpression(){ return rangeAxisMinValueExpression; } /** * */ public JRExpression getRangeAxisMaxValueExpression(){ return rangeAxisMaxValueExpression; } /** * */ public void setShowShapes( Boolean value ){ Boolean old = this.showShapes; this.showShapes = value; getEventSupport().firePropertyChange(PROPERTY_SHOW_SHAPES, old, this.showShapes); } /** * */ public void setShowLines( Boolean value ){ Boolean old = this.showLines; this.showLines = value; getEventSupport().firePropertyChange(PROPERTY_SHOW_LINES, old, this.showLines); } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } /** * */ 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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseTimeSeriesDataset.java0000644000175000017500000000737211632162653031632 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseTimeSeriesDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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]); } } } public JRTimeSeries[] getSeries(){ return timeSeries; } public Class getTimePeriod(){ return timePeriod; } public void setTimePeriod( Class timePeriod ){ Object old = this.timePeriod; this.timePeriod = timePeriod; getEventSupport().firePropertyChange(PROPERTY_TIME_PERIOD, old, this.timePeriod); } /** * */ public byte getDatasetType() { return JRChartDataset.TIMESERIES_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ public Object clone() { JRBaseTimeSeriesDataset clone = (JRBaseTimeSeriesDataset)super.clone(); clone.timeSeries = JRCloneUtils.cloneArray(timeSeries); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBasePie3DPlot.java0000644000175000017500000001356711632162653030021 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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) * @version $Id: JRBasePie3DPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRBasePie3DPlot extends JRBaseChartPlot implements JRPie3DPlot { /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_CIRCULAR = "circular"; 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 = "showLabels"; protected Double depthFactorDouble; protected Boolean circular; protected String labelFormat; protected String legendLabelFormat; protected JRItemLabel itemLabel; protected Boolean showLabels; /** * */ public JRBasePie3DPlot(JRChartPlot chartPlot, JRChart chart) { super(chartPlot, chart); JRPie3DPlot pie3DPlot = chartPlot instanceof JRPie3DPlot ? (JRPie3DPlot)chartPlot : null; if (pie3DPlot == null) { itemLabel = new JRBaseItemLabel(null, chart); } else { itemLabel = new JRBaseItemLabel(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(); } /** * */ public Double getDepthFactorDouble() { return depthFactorDouble; } /** * */ 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); } /** * */ public void collectExpressions(JRExpressionCollector collector) { } /** * */ 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 */ 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 */ 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); } /** * */ 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); } /* * 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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseXyzSeries.java0000644000175000017500000000656611632162653030224 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseXyzSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } public JRExpression getSeriesExpression(){ return seriesExpression; } public JRExpression getXValueExpression(){ return xValueExpression; } public JRExpression getYValueExpression(){ return yValueExpression; } public JRExpression getZValueExpression(){ return zValueExpression; } public JRHyperlink getItemHyperlink() { return itemHyperlink; } /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseGanttSeries.java0000644000175000017500000001050311632162653030471 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseGanttSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } /** * */ public JRExpression getSeriesExpression() { return seriesExpression; } /** * */ public JRExpression getTaskExpression() { return taskExpression; } /** * */ public JRExpression getSubtaskExpression() { return subtaskExpression; } /** * */ public JRExpression getStartDateExpression() { return startDateExpression; } /** * */ public JRExpression getEndDateExpression() { return endDateExpression; } /** * */ public JRExpression getPercentExpression() { return percentExpression; } /** * */ public JRExpression getLabelExpression() { return labelExpression; } public JRHyperlink getItemHyperlink() { return itemHyperlink; } /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseXyzDataset.java0000644000175000017500000000545611632162653030354 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseXyzDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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] ); } } } public JRXyzSeries[] getSeries(){ return xyzSeries; } /** * */ public byte getDatasetType() { return JRChartDataset.XYZ_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ public Object clone() { JRBaseXyzDataset clone = (JRBaseXyzDataset)super.clone(); clone.xyzSeries = JRCloneUtils.cloneArray(xyzSeries); return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseTimeSeriesPlot.java0000644000175000017500000002373411632162653031163 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRBaseTimeSeriesPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRBaseTimeSeriesPlot extends JRBaseChartPlot implements JRTimeSeriesPlot { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_SHOW_LINES = "showLines"; public static final String PROPERTY_SHOW_SHAPES = "showShapes"; 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(plot.getChart(), plot.getTimeAxisLabelFont());//FIXMETHEME check this plot.getChart(); don't we get the design chart? timeAxisLabelColor = plot.getOwnTimeAxisLabelColor(); timeAxisTickLabelFont = factory.getFont(plot.getChart(), 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(plot.getChart(), plot.getValueAxisLabelFont()); valueAxisLabelColor = plot.getOwnValueAxisLabelColor(); valueAxisTickLabelFont = factory.getFont(plot.getChart(), plot.getValueAxisTickLabelFont()); valueAxisTickLabelColor = plot.getOwnValueAxisTickLabelColor(); valueAxisTickLabelMask = plot.getValueAxisTickLabelMask(); valueAxisVerticalTickLabels = plot.getValueAxisVerticalTickLabels(); valueAxisLineColor = plot.getOwnValueAxisTickLabelColor(); } /** * */ public JRExpression getTimeAxisLabelExpression(){ return timeAxisLabelExpression; } /** * */ public JRFont getTimeAxisLabelFont() { return timeAxisLabelFont; } /** * */ public Color getTimeAxisLabelColor() { return JRStyleResolver.getTimeAxisLabelColor(this, this); } /** * */ public Color getOwnTimeAxisLabelColor() { return timeAxisLabelColor; } /** * */ public JRFont getTimeAxisTickLabelFont() { return timeAxisTickLabelFont; } /** * */ public Color getTimeAxisTickLabelColor() { return JRStyleResolver.getTimeAxisTickLabelColor(this, this); } /** * */ public Color getOwnTimeAxisTickLabelColor() { return timeAxisTickLabelColor; } /** * */ public String getTimeAxisTickLabelMask() { return timeAxisTickLabelMask; } /** * */ public Boolean getTimeAxisVerticalTickLabels() { return timeAxisVerticalTickLabels; } /** * */ public Color getTimeAxisLineColor() { return JRStyleResolver.getTimeAxisLineColor(this, this); } /** * */ public Color getOwnTimeAxisLineColor() { return timeAxisLineColor; } /** * */ public JRExpression getValueAxisLabelExpression(){ return valueAxisLabelExpression; } /** * */ public JRExpression getDomainAxisMinValueExpression(){ return domainAxisMinValueExpression; } /** * */ public JRExpression getDomainAxisMaxValueExpression(){ return domainAxisMaxValueExpression; } /** * */ public JRExpression getRangeAxisMinValueExpression(){ return rangeAxisMinValueExpression; } /** * */ public JRExpression getRangeAxisMaxValueExpression(){ return rangeAxisMaxValueExpression; } /** * */ public JRFont getValueAxisLabelFont() { return valueAxisLabelFont; } /** * */ public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor(this, this); } /** * */ public Color getOwnValueAxisLabelColor() { return valueAxisLabelColor; } /** * */ public JRFont getValueAxisTickLabelFont() { return valueAxisTickLabelFont; } /** * */ public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor(this, this); } /** * */ public Color getOwnValueAxisTickLabelColor() { return valueAxisTickLabelColor; } /** * */ public String getValueAxisTickLabelMask() { return valueAxisTickLabelMask; } /** * */ public Boolean getValueAxisVerticalTickLabels() { return valueAxisVerticalTickLabels; } /** * */ public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor(this, this); } /** * */ public Color getOwnValueAxisLineColor() { return valueAxisLineColor; } /** * */ public Boolean getShowLines(){ return showLines; } /** * */ public Boolean getShowShapes(){ return showShapes; } /** * */ public void setShowLines( Boolean val ){ Boolean old = this.showLines; this.showLines = val; getEventSupport().firePropertyChange(PROPERTY_SHOW_LINES, old, this.showLines); } /** * */ public void setShowShapes( Boolean val ){ Boolean old = this.showShapes; this.showShapes = val; getEventSupport().firePropertyChange(PROPERTY_SHOW_SHAPES, old, this.showShapes); } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } /** * */ 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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseLinePlot.java0000644000175000017500000002504411632162653027775 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRBaseLinePlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRBaseLinePlot extends JRBaseChartPlot implements JRLinePlot { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_SHOW_LINES = "showLines"; public static final String PROPERTY_SHOW_SHAPES = "showShapes"; 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(linePlot.getChart(), linePlot.getCategoryAxisLabelFont()); categoryAxisLabelColor = linePlot.getOwnCategoryAxisLabelColor(); categoryAxisTickLabelFont = factory.getFont(linePlot.getChart(), 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(linePlot.getChart(), linePlot.getValueAxisLabelFont()); valueAxisLabelColor = linePlot.getOwnValueAxisLabelColor(); valueAxisTickLabelFont = factory.getFont(linePlot.getChart(), linePlot.getValueAxisTickLabelFont()); valueAxisTickLabelColor = linePlot.getOwnValueAxisTickLabelColor(); valueAxisTickLabelMask = linePlot.getValueAxisTickLabelMask(); valueAxisVerticalTickLabels = linePlot.getValueAxisVerticalTickLabels(); valueAxisLineColor = linePlot.getOwnValueAxisLineColor(); } /** * */ public JRExpression getCategoryAxisLabelExpression(){ return categoryAxisLabelExpression; } /** * */ public JRFont getCategoryAxisLabelFont() { return categoryAxisLabelFont; } /** * */ public Color getCategoryAxisLabelColor() { return JRStyleResolver.getCategoryAxisLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisLabelColor() { return categoryAxisLabelColor; } /** * */ public JRFont getCategoryAxisTickLabelFont() { return categoryAxisTickLabelFont; } /** * */ public Color getCategoryAxisTickLabelColor() { return JRStyleResolver.getCategoryAxisTickLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisTickLabelColor() { return categoryAxisTickLabelColor; } /** * */ public String getCategoryAxisTickLabelMask() { return categoryAxisTickLabelMask; } /** * */ public Boolean getCategoryAxisVerticalTickLabels() { return categoryAxisVerticalTickLabels; } /** * */ public Double getCategoryAxisTickLabelRotation() { return labelRotationDouble; } /** * */ public void setCategoryAxisTickLabelRotation(Double labelRotationDouble) { Object old = this.labelRotationDouble; this.labelRotationDouble = labelRotationDouble; getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_ROTATION, old, this.labelRotationDouble); } /** * */ public Color getCategoryAxisLineColor() { return JRStyleResolver.getCategoryAxisLineColor(this, this); } /** * */ public Color getOwnCategoryAxisLineColor() { return categoryAxisLineColor; } /** * */ public JRExpression getValueAxisLabelExpression(){ return valueAxisLabelExpression; } /** * */ public JRExpression getRangeAxisMinValueExpression(){ return rangeAxisMinValueExpression; } /** * */ public JRExpression getRangeAxisMaxValueExpression(){ return rangeAxisMaxValueExpression; } /** * */ public JRExpression getDomainAxisMinValueExpression(){ return domainAxisMinValueExpression; } /** * */ public JRExpression getDomainAxisMaxValueExpression(){ return domainAxisMaxValueExpression; } /** * */ public JRFont getValueAxisLabelFont() { return valueAxisLabelFont; } /** * */ public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor(this, this); } /** * */ public Color getOwnValueAxisLabelColor() { return valueAxisLabelColor; } /** * */ public JRFont getValueAxisTickLabelFont() { return valueAxisTickLabelFont; } /** * */ public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor(this, this); } /** * */ public Color getOwnValueAxisTickLabelColor() { return valueAxisTickLabelColor; } /** * */ public String getValueAxisTickLabelMask() { return valueAxisTickLabelMask; } /** * */ public Boolean getValueAxisVerticalTickLabels() { return valueAxisVerticalTickLabels; } /** * */ public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor(this, this); } /** * */ public Color getOwnValueAxisLineColor() { return valueAxisLineColor; } /** * */ public Boolean getShowShapes(){ return showShapes; } /** * */ public Boolean getShowLines(){ return showLines; } /** * */ public void setShowShapes( Boolean value ){ Boolean old = this.showShapes; this.showShapes = value; getEventSupport().firePropertyChange(PROPERTY_SHOW_SHAPES, old, this.showShapes); } /** * */ public void setShowLines( Boolean value ){ Boolean old = this.showLines; this.showLines = value; getEventSupport().firePropertyChange(PROPERTY_SHOW_SHAPES, old, this.showLines); } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } /** * */ 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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBasePieDataset.java0000644000175000017500000001421711632162653030272 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBasePieDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } /** * */ public Float getMinPercentage() { return minPercentage; } /** * */ public void setMinPercentage(Float minPercentage) { Object old = this.minPercentage; this.minPercentage = minPercentage; getEventSupport().firePropertyChange(PROPERTY_MIN_PERCENTAGE, old, this.minPercentage); } /** * */ public Integer getMaxCount() { return maxCount; } /** * */ public void setMaxCount(Integer maxCount) { Object old = this.maxCount; this.maxCount = maxCount; getEventSupport().firePropertyChange(PROPERTY_MAX_COUNT, old, this.maxCount); } /** * */ public JRPieSeries[] getSeries() { return pieSeries; } /** * */ public JRExpression getOtherKeyExpression() { return otherKeyExpression; } /** * */ public JRExpression getOtherLabelExpression() { return otherLabelExpression; } /** * */ public JRHyperlink getOtherSectionHyperlink() { return otherSectionHyperlink; } /** * */ public byte getDatasetType() { return JRChartDataset.PIE_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } /** * */ public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ 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; 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; } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseCategorySeries.java0000644000175000017500000000705711632162653031203 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseCategorySeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } /** * */ public JRExpression getSeriesExpression() { return seriesExpression; } /** * */ public JRExpression getCategoryExpression() { return categoryExpression; } /** * */ public JRExpression getValueExpression() { return valueExpression; } /** * */ public JRExpression getLabelExpression() { return labelExpression; } public JRHyperlink getItemHyperlink() { return itemHyperlink; } /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBasePiePlot.java0000644000175000017500000001443011632162653027620 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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; import net.sf.jasperreports.engine.util.JRCloneUtils; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRBasePiePlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRBasePiePlot extends JRBaseChartPlot implements JRPiePlot { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_CIRCULAR = "circular"; 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 = "showLabels"; /* * 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) { super(chartPlot, chart); JRPiePlot piePlot = chartPlot instanceof JRPiePlot ? (JRPiePlot)chartPlot : null; if (piePlot == null) { itemLabel = new JRBaseItemLabel(null, chart); } else { itemLabel = new JRBaseItemLabel(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(); } /** * */ public void collectExpressions(JRExpressionCollector collector) { } /** * @return the circular */ 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 */ 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 */ public String getLegendLabelFormat() { return legendLabelFormat; } /** * */ 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); } /** * */ 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); } /** * */ public Object clone(JRChart parentChart) { JRBasePiePlot clone = (JRBasePiePlot)super.clone(parentChart); clone.itemLabel = JRCloneUtils.nullSafeClone(itemLabel); 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 SVN 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); 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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBasePieSeries.java0000644000175000017500000000626411632162653030142 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBasePieSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } /** * */ public JRExpression getKeyExpression() { return keyExpression; } /** * */ public JRExpression getValueExpression() { return valueExpression; } /** * */ public JRExpression getLabelExpression() { return labelExpression; } public JRHyperlink getSectionHyperlink() { return sectionHyperlink; } /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseAreaPlot.java0000644000175000017500000002226611632162653027761 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRBaseAreaPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(areaPlot.getChart(), areaPlot.getCategoryAxisLabelFont()); categoryAxisLabelColor = areaPlot.getOwnCategoryAxisLabelColor(); categoryAxisTickLabelFont = factory.getFont(areaPlot.getChart(), 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(areaPlot.getChart(), areaPlot.getValueAxisLabelFont()); valueAxisLabelColor = areaPlot.getOwnValueAxisLabelColor(); valueAxisTickLabelFont = factory.getFont(areaPlot.getChart(), areaPlot.getValueAxisTickLabelFont()); valueAxisTickLabelColor = areaPlot.getOwnValueAxisTickLabelColor(); valueAxisTickLabelMask = areaPlot.getValueAxisTickLabelMask(); valueAxisVerticalTickLabels = areaPlot.getValueAxisVerticalTickLabels(); valueAxisLineColor = areaPlot.getOwnValueAxisLineColor(); } /** * */ public JRExpression getCategoryAxisLabelExpression(){ return categoryAxisLabelExpression; } /** * */ public JRFont getCategoryAxisLabelFont() { return categoryAxisLabelFont; } /** * */ public Color getCategoryAxisLabelColor() { return JRStyleResolver.getCategoryAxisLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisLabelColor() { return categoryAxisLabelColor; } /** * */ public JRFont getCategoryAxisTickLabelFont() { return categoryAxisTickLabelFont; } /** * */ public Color getCategoryAxisTickLabelColor() { return JRStyleResolver.getCategoryAxisTickLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisTickLabelColor() { return categoryAxisTickLabelColor; } /** * */ public String getCategoryAxisTickLabelMask() { return categoryAxisTickLabelMask; } /** * */ public Boolean getCategoryAxisVerticalTickLabels() { return categoryAxisVerticalTickLabels; } /** * */ public Double getCategoryAxisTickLabelRotation() { return labelRotationDouble; } /** * */ public void setCategoryAxisTickLabelRotation(Double labelRotationDouble) { Object old = this.labelRotationDouble; this.labelRotationDouble = labelRotationDouble; getEventSupport().firePropertyChange(PROPERTY_CATEGORY_AXIS_TICK_LABEL_ROTATION, old, this.labelRotationDouble); } /** * */ public Color getCategoryAxisLineColor() { return JRStyleResolver.getCategoryAxisLineColor(this, this); } /** * */ public Color getOwnCategoryAxisLineColor() { return categoryAxisLineColor; } /** * */ public JRExpression getValueAxisLabelExpression(){ return valueAxisLabelExpression; } /** * */ public JRExpression getDomainAxisMinValueExpression(){ return domainAxisMinValueExpression; } /** * */ public JRExpression getDomainAxisMaxValueExpression(){ return domainAxisMaxValueExpression; } /** * */ public JRExpression getRangeAxisMinValueExpression(){ return rangeAxisMinValueExpression; } /** * */ public JRExpression getRangeAxisMaxValueExpression(){ return rangeAxisMaxValueExpression; } /** * */ public JRFont getValueAxisLabelFont() { return valueAxisLabelFont; } /** * */ public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor(this, this); } /** * */ public Color getOwnValueAxisLabelColor() { return valueAxisLabelColor; } /** * */ public JRFont getValueAxisTickLabelFont() { return valueAxisTickLabelFont; } /** * */ public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor(this, this); } /** * */ public Color getOwnValueAxisTickLabelColor() { return valueAxisTickLabelColor; } /** * */ public String getValueAxisTickLabelMask() { return valueAxisTickLabelMask; } /** * */ public Boolean getValueAxisVerticalTickLabels() { return valueAxisVerticalTickLabels; } /** * */ public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor(this, this); } /** * */ public Color getOwnValueAxisLineColor() { return valueAxisLineColor; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseHighLowPlot.java0000644000175000017500000002425011632162653030445 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Ionut Nedelcu (ionutned@users.sourceforge.net) * @version $Id: JRBaseHighLowPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRBaseHighLowPlot extends JRBaseChartPlot implements JRHighLowPlot { /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; public static final String PROPERTY_SHOW_CLOSE_TICKS = "showCloseTicks"; public static final String PROPERTY_SHOW_OPEN_TICKS = "showOpenTicks"; 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(highLowPlot.getChart(), highLowPlot.getTimeAxisLabelFont()); timeAxisLabelColor = highLowPlot.getOwnTimeAxisLabelColor(); timeAxisTickLabelFont = factory.getFont(highLowPlot.getChart(), 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(highLowPlot.getChart(), highLowPlot.getValueAxisLabelFont()); valueAxisLabelColor = highLowPlot.getOwnValueAxisLabelColor(); valueAxisTickLabelFont = factory.getFont(highLowPlot.getChart(), highLowPlot.getValueAxisTickLabelFont()); valueAxisTickLabelColor = highLowPlot.getOwnValueAxisTickLabelColor(); valueAxisTickLabelMask = highLowPlot.getValueAxisTickLabelMask(); valueAxisVerticalTickLabels = highLowPlot.getValueAxisVerticalTickLabels(); valueAxisLineColor = highLowPlot.getOwnValueAxisTickLabelColor(); } /** * */ public JRExpression getTimeAxisLabelExpression(){ return timeAxisLabelExpression; } /** * */ public JRFont getTimeAxisLabelFont() { return timeAxisLabelFont; } /** * */ public Color getTimeAxisLabelColor() { return JRStyleResolver.getTimeAxisLabelColor(this, this); } /** * */ public Color getOwnTimeAxisLabelColor() { return timeAxisLabelColor; } /** * */ public JRFont getTimeAxisTickLabelFont() { return timeAxisTickLabelFont; } /** * */ public Color getTimeAxisTickLabelColor() { return JRStyleResolver.getTimeAxisTickLabelColor(this, this); } /** * */ public Color getOwnTimeAxisTickLabelColor() { return timeAxisTickLabelColor; } /** * */ public String getTimeAxisTickLabelMask() { return timeAxisTickLabelMask; } /** * */ public Boolean getTimeAxisVerticalTickLabels() { return timeAxisVerticalTickLabels; } /** * */ public Color getTimeAxisLineColor() { return JRStyleResolver.getTimeAxisLineColor(this, this); } /** * */ public Color getOwnTimeAxisLineColor() { return timeAxisLineColor; } /** * */ public JRExpression getValueAxisLabelExpression(){ return valueAxisLabelExpression; } /** * */ public JRExpression getDomainAxisMinValueExpression(){ return domainAxisMinValueExpression; } /** * */ public JRExpression getDomainAxisMaxValueExpression(){ return domainAxisMaxValueExpression; } /** * */ public JRExpression getRangeAxisMinValueExpression(){ return rangeAxisMinValueExpression; } /** * */ public JRExpression getRangeAxisMaxValueExpression(){ return rangeAxisMaxValueExpression; } /** * */ public JRFont getValueAxisLabelFont() { return valueAxisLabelFont; } /** * */ public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor(this, this); } /** * */ public Color getOwnValueAxisLabelColor() { return valueAxisLabelColor; } /** * */ public JRFont getValueAxisTickLabelFont() { return valueAxisTickLabelFont; } /** * */ public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor(this, this); } /** * */ public Color getOwnValueAxisTickLabelColor() { return valueAxisTickLabelColor; } /** * */ public String getValueAxisTickLabelMask() { return valueAxisTickLabelMask; } /** * */ public Boolean getValueAxisVerticalTickLabels() { return valueAxisVerticalTickLabels; } /** * */ public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor(this, this); } /** * */ public Color getOwnValueAxisLineColor() { return valueAxisLineColor; } /** * */ 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); } /** * */ 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); } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } /** * */ 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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseXyDataset.java0000644000175000017500000000563311632162653030157 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseXyDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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]); } } } /** * */ public JRXySeries[] getSeries() { return xySeries; } /* (non-Javadoc) * @see net.sf.jasperreports.engine.JRChartDataset#getDatasetType() */ public byte getDatasetType() { return JRChartDataset.XY_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ public Object clone() { JRBaseXyDataset clone = (JRBaseXyDataset)super.clone(); clone.xySeries = JRCloneUtils.cloneArray(xySeries); return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseValueDisplay.java0000644000175000017500000001011711632162653030644 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseValueDisplay.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(valueDisplay.getChart(), valueDisplay.getFont()); } /** * */ public JRChart getChart() { return chart; } /** * */ public Color getColor() { return color; } /** * */ public String getMask() { return mask; } /** * */ 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) { } /** * */ public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { throw new JRRuntimeException(e); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseValueDataset.java0000644000175000017500000000713411632162653030631 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseValueDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } /** * */ public JRExpression getValueExpression() { return valueExpression; } /** * */ 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 */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ public Object clone() { JRBaseValueDataset clone = (JRBaseValueDataset)super.clone(); clone.valueExpression = JRCloneUtils.nullSafeClone(valueExpression); return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/base/JRBaseMeterPlot.java0000644000175000017500000001762711632162653030172 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBaseMeterPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 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(); meterBackgroundColor = meterPlot.getMeterBackgroundColor(); needleColor = meterPlot.getNeedleColor(); tickColor = meterPlot.getTickColor(); tickLabelFont = factory.getFont(this.getChart(), meterPlot.getTickLabelFont()); } /** * */ public JRDataRange getDataRange() { return dataRange; } /** * */ public JRValueDisplay getValueDisplay() { return valueDisplay; } /** * */ public MeterShapeEnum getShapeValue() { return shapeValue; } /** * */ public List getIntervals(){ return intervals; } /** * */ public Integer getMeterAngleInteger() { return meterAngleInteger; } /** * */ public String getUnits() { return units; } /** * */ public Double getTickIntervalDouble() { return tickIntervalDouble; } /** * */ public Color getMeterBackgroundColor() { return meterBackgroundColor; } /** * */ public Color getNeedleColor() { return needleColor; } /** * */ public Color getTickColor() { return tickColor; } /** * */ 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 */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } /** * */ public Object clone(JRChart parentChart) { JRBaseMeterPlot clone = (JRBaseMeterPlot)super.clone(parentChart); clone.dataRange = JRCloneUtils.nullSafeClone(dataRange); clone.valueDisplay = JRCloneUtils.nullSafeClone(valueDisplay); 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; 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; } } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/0000755000175000017500000000000011654071732024365 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillXyzDataset.java0000644000175000017500000001152211632162653030373 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillXyzDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRFillXyzDataset extends JRFillChartDataset implements JRXyzDataset { 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]); } } } public JRXyzSeries[] getSeries(){ return xyzSeries; } protected void customInitialize() { dataset = new DefaultXYZDataset(); itemHyperlinks = new HashMap, Map>(); } 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 ); } } } 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("XYZ series name is 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()); } } } } /** * */ public Object getLabelGenerator() { return null; } public Dataset getCustomDataset() { return dataset; } /** * */ public byte getDatasetType() { return JRChartDataset.XYZ_DATASET; } /** * */ 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; } public void validate(JRVerifier verifier) { verifier.verify(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillBar3DPlot.java0000644000175000017500000001641711632162653030035 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRFillBar3DPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } /** * */ public JRExpression getCategoryAxisLabelExpression() { return ((JRBar3DPlot)parent).getCategoryAxisLabelExpression(); } /** * */ public JRFont getCategoryAxisLabelFont() { return categoryAxisLabelFont; } /** * */ public Color getCategoryAxisLabelColor() { return JRStyleResolver.getCategoryAxisLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisLabelColor() { return categoryAxisLabelColor; } /** * */ public void setCategoryAxisLabelColor(Color color) { } /** * */ public JRFont getCategoryAxisTickLabelFont() { return categoryAxisTickLabelFont; } /** * */ public Color getCategoryAxisTickLabelColor() { return JRStyleResolver.getCategoryAxisTickLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisTickLabelColor() { return categoryAxisTickLabelColor; } /** * */ public void setCategoryAxisTickLabelColor(Color color) { } /** * */ public String getCategoryAxisTickLabelMask() { return ((JRBar3DPlot)parent).getCategoryAxisTickLabelMask(); } /** * */ public Boolean getCategoryAxisVerticalTickLabels() { return ((JRBar3DPlot)parent).getCategoryAxisVerticalTickLabels(); } /** * */ public Double getCategoryAxisTickLabelRotation() { return ((JRBar3DPlot)parent).getCategoryAxisTickLabelRotation(); } /** * */ public void setCategoryAxisTickLabelRotation(Double labelRotation) { } /** * */ public Color getCategoryAxisLineColor() { return JRStyleResolver.getCategoryAxisLineColor(this, this); } /** * */ public Color getOwnCategoryAxisLineColor() { return categoryAxisLineColor; } /** * */ public void setCategoryAxisLineColor(Color color) { } /** * */ public JRExpression getValueAxisLabelExpression() { return ((JRBar3DPlot)parent).getValueAxisLabelExpression(); } /** * */ public JRExpression getDomainAxisMinValueExpression() { return ((JRBar3DPlot)parent).getDomainAxisMinValueExpression(); } /** * */ public JRExpression getDomainAxisMaxValueExpression() { return ((JRBar3DPlot)parent).getDomainAxisMaxValueExpression(); } /** * */ public JRExpression getRangeAxisMinValueExpression() { return ((JRBar3DPlot)parent).getRangeAxisMinValueExpression(); } /** * */ public JRExpression getRangeAxisMaxValueExpression() { return ((JRBar3DPlot)parent).getRangeAxisMaxValueExpression(); } /** * */ public JRFont getValueAxisLabelFont() { return valueAxisLabelFont; } /** * */ public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor(this, this); } /** * */ public Color getOwnValueAxisLabelColor() { return valueAxisLabelColor; } /** * */ public void setValueAxisLabelColor(Color color) { } /** * */ public JRFont getValueAxisTickLabelFont() { return valueAxisTickLabelFont; } /** * */ public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor(this, this); } /** * */ public Color getOwnValueAxisTickLabelColor() { return valueAxisTickLabelColor; } /** * */ public void setValueAxisTickLabelColor(Color color) { } /** * */ public String getValueAxisTickLabelMask() { return ((JRBar3DPlot)parent).getValueAxisTickLabelMask(); } /** * */ public Boolean getValueAxisVerticalTickLabels() { return ((JRBar3DPlot)parent).getValueAxisVerticalTickLabels(); } /** * */ public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor(this, this); } /** * */ public Color getOwnValueAxisLineColor() { return valueAxisLineColor; } /** * */ public void setValueAxisLineColor(Color color) { } /** * */ public Double getXOffsetDouble(){ return ((JRBar3DPlot)parent).getXOffsetDouble(); } /** * */ public void setXOffset( Double xOffset ){ } /** * */ public Double getYOffsetDouble(){ return ((JRBar3DPlot)parent).getYOffsetDouble(); } /** * */ public void setYOffset( Double yOffset ){ } /** * */ public Boolean getShowLabels(){ return ((JRBar3DPlot)parent).getShowLabels(); } /** * */ public JRItemLabel getItemLabel() { return ((JRBar3DPlot)parent).getItemLabel(); } /** * */ public void setItemLabel( JRItemLabel itemLabel ){ } /** * */ public void setShowLabels( Boolean isShowLabels ){ } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillTimeSeriesDataset.java0000644000175000017500000001516411632162653031660 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillTimeSeriesDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRFillTimeSeriesDataset extends JRFillChartDataset implements JRTimeSeriesDataset { /** * */ 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]); } } } public JRTimeSeries[] getSeries() { return timeSeries; } protected void customInitialize() { seriesNames = null; seriesMap = null; labelsMap = null; itemHyperlinks = null; } 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 ); } } } 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("Time series name is 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()); } } } } 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; } public Class getTimePeriod() { return ((JRTimeSeriesDataset)parent).getTimePeriod(); } public void setTimePeriod(Class timePeriod) { } /** * */ public byte getDatasetType() { return JRChartDataset.TIMESERIES_DATASET; } public Object getLabelGenerator(){ return new TimeSeriesLabelGenerator(labelsMap);//FIXMETHEME this and other similar implementations should be able to return null and chart themes should be protected agains null; } /** * */ 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; } public void validate(JRVerifier verifier) { verifier.verify(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillChartAxis.java0000644000175000017500000000526311632162653030166 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRConstants; 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) * @version $Id: JRFillChartAxis.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRFillChartAxis implements JRChartAxis { protected JRChartAxis parent; /** * The filled version of the chart field. Contains evaluated * expressions and data. */ protected JRFillChart fillChart; private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; 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; } public JRChart getChart() { return parent.getChart(); } public AxisPositionEnum getPositionValue() { return parent.getPositionValue(); } /** * */ public Object clone() { throw new UnsupportedOperationException(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillBubblePlot.java0000644000175000017500000001362211632162653030330 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRFillBubblePlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } /** * */ public JRExpression getXAxisLabelExpression() { return ((JRBubblePlot)parent).getXAxisLabelExpression(); } /** * */ public JRFont getXAxisLabelFont() { return xAxisLabelFont; } /** * */ public Color getXAxisLabelColor() { return JRStyleResolver.getXAxisLabelColor(this, this); } /** * */ public Color getOwnXAxisLabelColor() { return xAxisLabelColor; } /** * */ public JRFont getXAxisTickLabelFont() { return xAxisTickLabelFont; } /** * */ public Color getXAxisTickLabelColor() { return JRStyleResolver.getXAxisTickLabelColor(this, this); } /** * */ public Color getOwnXAxisTickLabelColor() { return xAxisTickLabelColor; } /** * */ public String getXAxisTickLabelMask() { return ((JRBubblePlot)parent).getXAxisTickLabelMask(); } /** * */ public Boolean getXAxisVerticalTickLabels() { return ((JRBubblePlot)parent).getXAxisVerticalTickLabels(); } /** * */ public Color getXAxisLineColor() { return JRStyleResolver.getXAxisLineColor(this, this); } /** * */ public Color getOwnXAxisLineColor() { return xAxisLineColor; } /** * */ public JRExpression getYAxisLabelExpression() { return ((JRBubblePlot)parent).getYAxisLabelExpression(); } /** * */ public JRFont getYAxisLabelFont() { return yAxisLabelFont; } /** * */ public Color getYAxisLabelColor() { return JRStyleResolver.getYAxisLabelColor(this, this); } /** * */ public Color getOwnYAxisLabelColor() { return yAxisLabelColor; } /** * */ public JRFont getYAxisTickLabelFont() { return yAxisTickLabelFont; } /** * */ public Color getYAxisTickLabelColor() { return JRStyleResolver.getYAxisTickLabelColor(this, this); } /** * */ public Color getOwnYAxisTickLabelColor() { return yAxisTickLabelColor; } /** * */ public String getYAxisTickLabelMask() { return ((JRBubblePlot)parent).getYAxisTickLabelMask(); } /** * */ public Boolean getYAxisVerticalTickLabels() { return ((JRBubblePlot)parent).getYAxisVerticalTickLabels(); } /** * */ public Color getYAxisLineColor() { return JRStyleResolver.getYAxisLineColor(this, this); } /** * */ public Color getOwnYAxisLineColor() { return yAxisLineColor; } /** * */ public ScaleTypeEnum getScaleTypeValue() { return ((JRBubblePlot)parent).getScaleTypeValue(); } /** * */ public void setScaleType( ScaleTypeEnum scaleType ) { throw new UnsupportedOperationException(); } /** * */ public JRExpression getDomainAxisMinValueExpression() { return ((JRBubblePlot)parent).getDomainAxisMinValueExpression(); } /** * */ public JRExpression getDomainAxisMaxValueExpression() { return ((JRBubblePlot)parent).getDomainAxisMaxValueExpression(); } /** * */ public JRExpression getRangeAxisMinValueExpression() { return ((JRBubblePlot)parent).getRangeAxisMinValueExpression(); } /** * */ public JRExpression getRangeAxisMaxValueExpression() { return ((JRBubblePlot)parent).getRangeAxisMaxValueExpression(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillTimePeriodSeries.java0000644000175000017500000001020711632162653031506 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillTimePeriodSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } public JRExpression getSeriesExpression(){ return parent.getSeriesExpression(); } public JRExpression getStartDateExpression(){ return parent.getStartDateExpression(); } public JRExpression getEndDateExpression(){ return parent.getEndDateExpression(); } public JRExpression getValueExpression(){ return parent.getValueExpression(); } 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); } } public JRHyperlink getItemHyperlink() { return parent.getItemHyperlink(); } public boolean hasItemHyperlink() { return !JRHyperlinkHelper.isEmpty(getItemHyperlink()); } public JRPrintHyperlink getPrintItemHyperlink() { return itemHyperlink; } /** * */ public Object clone() { throw new UnsupportedOperationException(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/package.html0000644000175000017500000000042011614510763026640 0ustar drazzibdrazzib Contains fill time implementations for chart related interfaces.

Related Documentation

jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillCategoryDataset.java0000644000175000017500000001344011632162653031357 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillCategoryDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRFillCategoryDataset extends JRFillChartDataset implements JRCategoryDataset { /** * */ 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]); } } } /** * */ public JRCategorySeries[] getSeries() { return categorySeries; } /** * */ protected void customInitialize() { dataset = null; labelsMap = null; itemHyperlinks = null; } /** * */ 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); } } } /** * */ 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("Category series name is 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()); } } } } /** * */ public Dataset getCustomDataset() { return dataset; } /** * */ public byte getDatasetType() { return JRChartDataset.CATEGORY_DATASET; } /** * */ public Object getLabelGenerator() { return new CategoryLabelGenerator(labelsMap); } /** * */ 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; } public void validate(JRVerifier verifier) { verifier.verify(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillDataRange.java0000644000175000017500000000350511632162653030123 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillDataRange.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRFillDataRange implements JRDataRange { protected JRDataRange parent; /** * */ public JRFillDataRange(JRDataRange dataRange, JRFillObjectFactory factory) { factory.put(dataRange, this); parent = dataRange; } /** * */ public JRExpression getLowExpression() { return parent.getLowExpression(); } /** * */ public JRExpression getHighExpression() { return parent.getHighExpression(); } /** * */ public Object clone() { throw new UnsupportedOperationException(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillHighLowDataset.java0000644000175000017500000001701111632162653031141 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillHighLowDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRFillHighLowDataset extends JRFillChartDataset implements JRHighLowDataset { /** * */ 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); } protected void customInitialize() { elements = new ArrayList(); itemHyperlinks = new ArrayList(); } 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); } } protected void customIncrement() { elements.add(new HighLowElement(date, high, low, open, close, volume)); if (hasItemHyperlink()) { itemHyperlinks.add(itemHyperlink); } } 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; } public Object getLabelGenerator() { return null; } public JRExpression getSeriesExpression() { return ((JRHighLowDataset)parent).getSeriesExpression(); } public JRExpression getDateExpression() { return ((JRHighLowDataset)parent).getDateExpression(); } public JRExpression getHighExpression() { return ((JRHighLowDataset)parent).getHighExpression(); } public JRExpression getLowExpression() { return ((JRHighLowDataset)parent).getLowExpression(); } public JRExpression getOpenExpression() { return ((JRHighLowDataset)parent).getOpenExpression(); } public JRExpression getCloseExpression() { return ((JRHighLowDataset)parent).getCloseExpression(); } 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("Date value is null in high-low series."); } this.date = date; if (high == null) { throw new JRRuntimeException("High value is null in high-low series."); } this.high = high; if (low == null) { throw new JRRuntimeException("Low value is null in high-low series."); } this.low = low; if (open == null) { throw new JRRuntimeException("Open value is null in high-low series."); } this.open = open; if (close == null) { throw new JRRuntimeException("Close value is null in high-low series."); } this.close = close; if (volume == null) { throw new JRRuntimeException("Volume value is null in high-low series."); } 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; } } /** * */ public byte getDatasetType() { return JRChartDataset.HIGHLOW_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public JRHyperlink getItemHyperlink() { return ((JRHighLowDataset) parent).getItemHyperlink(); } public boolean hasItemHyperlink() { return !JRHyperlinkHelper.isEmpty(getItemHyperlink()); } public List getItemHyperlinks() { return itemHyperlinks; } public void validate(JRVerifier verifier) { verifier.verify(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillXyzSeries.java0000644000175000017500000000744611632162653030252 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillXyzSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } public JRExpression getSeriesExpression(){ return parent.getSeriesExpression(); } public JRExpression getXValueExpression(){ return parent.getXValueExpression(); } public JRExpression getYValueExpression(){ return parent.getYValueExpression(); } 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); } } public JRHyperlink getItemHyperlink() { return parent.getItemHyperlink(); } public boolean hasItemHyperlinks() { return !JRHyperlinkHelper.isEmpty(getItemHyperlink()); } /** * */ public Object clone() { throw new UnsupportedOperationException(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillScatterPlot.java0000644000175000017500000001354011632162653030541 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRFillScatterPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } /** * */ public JRExpression getXAxisLabelExpression() { return ((JRScatterPlot)parent).getXAxisLabelExpression(); } /** * */ public JRFont getXAxisLabelFont() { return xAxisLabelFont; } /** * */ public Color getXAxisLabelColor() { return JRStyleResolver.getXAxisLabelColor(this, this); } /** * */ public Color getOwnXAxisLabelColor() { return xAxisLabelColor; } /** * */ public JRFont getXAxisTickLabelFont() { return xAxisTickLabelFont; } /** * */ public Color getXAxisTickLabelColor() { return JRStyleResolver.getXAxisTickLabelColor(this, this); } /** * */ public Color getOwnXAxisTickLabelColor() { return xAxisTickLabelColor; } /** * */ public String getXAxisTickLabelMask() { return ((JRScatterPlot)parent).getXAxisTickLabelMask(); } /** * */ public Boolean getXAxisVerticalTickLabels() { return ((JRScatterPlot)parent).getXAxisVerticalTickLabels(); } /** * */ public Color getXAxisLineColor() { return JRStyleResolver.getXAxisLineColor(this, this); } /** * */ public Color getOwnXAxisLineColor() { return xAxisLineColor; } /** * */ public JRExpression getYAxisLabelExpression() { return ((JRScatterPlot)parent).getYAxisLabelExpression(); } /** * */ public JRFont getYAxisLabelFont() { return yAxisLabelFont; } /** * */ public Color getYAxisLabelColor() { return JRStyleResolver.getYAxisLabelColor(this, this); } /** * */ public Color getOwnYAxisLabelColor() { return yAxisLabelColor; } /** * */ public JRFont getYAxisTickLabelFont() { return yAxisTickLabelFont; } /** * */ public Color getYAxisTickLabelColor() { return JRStyleResolver.getYAxisTickLabelColor(this, this); } /** * */ public Color getOwnYAxisTickLabelColor() { return yAxisTickLabelColor; } /** * */ public String getYAxisTickLabelMask() { return ((JRScatterPlot)parent).getYAxisTickLabelMask(); } /** * */ public Boolean getYAxisVerticalTickLabels() { return ((JRScatterPlot)parent).getYAxisVerticalTickLabels(); } /** * */ public Color getYAxisLineColor() { return JRStyleResolver.getYAxisLineColor(this, this); } /** * */ public Color getOwnYAxisLineColor() { return yAxisLineColor; } /** * */ public Boolean getShowShapes(){ return ((JRScatterPlot)parent).getShowShapes(); } /** * */ public void setShowShapes( Boolean value ){ } /** * */ public Boolean getShowLines(){ return ((JRScatterPlot)parent).getShowLines(); } /** * */ public void setShowLines( Boolean value ){ } /** * */ public JRExpression getDomainAxisMinValueExpression() { return ((JRScatterPlot)parent).getDomainAxisMinValueExpression(); } /** * */ public JRExpression getDomainAxisMaxValueExpression() { return ((JRScatterPlot)parent).getDomainAxisMaxValueExpression(); } /** * */ public JRExpression getRangeAxisMinValueExpression() { return ((JRScatterPlot)parent).getRangeAxisMinValueExpression(); } /** * */ public JRExpression getRangeAxisMaxValueExpression() { return ((JRScatterPlot)parent).getRangeAxisMaxValueExpression(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillTimePeriodDataset.java0000644000175000017500000001520011632162653031637 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillTimePeriodDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRFillTimePeriodDataset extends JRFillChartDataset implements JRTimePeriodDataset { /** * */ 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]); } } } public JRTimePeriodSeries[] getSeries() { return timePeriodSeries; } protected void customInitialize() { seriesNames = null; seriesMap = null; labelsMap = null; itemHyperlinks = null; } 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); } } } 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("Time period series name is 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()); } } } } 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; } /** * */ public byte getDatasetType() { return JRChartDataset.TIMEPERIOD_DATASET; } /** * */ public Object getLabelGenerator() { return new TimePeriodDatasetLabelGenerator(labelsMap); } /** * */ 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; } public void validate(JRVerifier verifier) { verifier.verify(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillPieSeries.java0000644000175000017500000000735311632162653030172 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillPieSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } /** * */ public JRExpression getKeyExpression() { return parent.getKeyExpression(); } /** * */ public JRExpression getValueExpression() { return parent.getValueExpression(); } /** * */ 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()); } public JRHyperlink getSectionHyperlink() { return parent.getSectionHyperlink(); } /** * */ public Object clone() { throw new UnsupportedOperationException(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillGanttSeries.java0000644000175000017500000001102511632162653030521 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillGanttSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } /** * */ public JRExpression getSeriesExpression() { return parent.getSeriesExpression(); } public JRExpression getStartDateExpression(){ return parent.getStartDateExpression(); } public JRExpression getEndDateExpression(){ return parent.getEndDateExpression(); } /** * */ public JRExpression getTaskExpression() { return parent.getTaskExpression(); } /** * */ public JRExpression getSubtaskExpression() { return parent.getSubtaskExpression(); } /** * */ public JRExpression getPercentExpression() { return parent.getPercentExpression(); } /** * */ 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); } } public JRHyperlink getItemHyperlink() { return parent.getItemHyperlink(); } public boolean hasItemHyperlinks() { return getItemHyperlink() != null; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillPieDataset.java0000644000175000017500000002042011632162653030313 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillPieDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRFillPieDataset extends JRFillChartDataset implements JRPieDataset { /** * */ protected JRFillPieSeries[] pieSeries; /** * */ private Map, Number> values; private Map, String> labels; private Map, JRPrintHyperlink> sectionHyperlinks; 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]); } } } /** * */ public Float getMinPercentage() { return ((JRPieDataset)parent).getMinPercentage(); } /** * */ public void setMinPercentage(Float minPercentage) { } /** * */ public Integer getMaxCount() { return ((JRPieDataset)parent).getMaxCount(); } /** * */ public void setMaxCount(Integer maxCount) { } /** * */ public JRPieSeries[] getSeries() { return pieSeries; } /** * */ public JRExpression getOtherKeyExpression() { return ((JRPieDataset)parent).getOtherKeyExpression(); } /** * */ public JRExpression getOtherLabelExpression() { return ((JRPieDataset)parent).getOtherLabelExpression(); } /** * */ public JRHyperlink getOtherSectionHyperlink() { return ((JRPieDataset) parent).getOtherSectionHyperlink(); } /** * */ protected void customInitialize() { values = new LinkedHashMap, Number>(); labels = new HashMap, String>(); sectionHyperlinks = new HashMap, JRPrintHyperlink>(); } /** * */ 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); } } /** * */ 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("Key is null in pie dataset."); } values.put(key, crtPieSeries.getValue()); if (crtPieSeries.getLabelExpression() != null) { labels.put(key, crtPieSeries.getLabel()); } if (crtPieSeries.hasSectionHyperlinks()) { sectionHyperlinks.put(key, crtPieSeries.getPrintSectionHyperlink()); } } } } /** * */ 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() */ public byte getDatasetType() { return JRChartDataset.PIE_DATASET; } 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 ); } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public Map, JRPrintHyperlink> getSectionHyperlinks() { return sectionHyperlinks; } public void validate(JRVerifier verifier) { verifier.verify(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillCategorySeries.java0000644000175000017500000001002511632162653031220 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillCategorySeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } /** * */ public JRExpression getSeriesExpression() { return parent.getSeriesExpression(); } /** * */ public JRExpression getCategoryExpression() { return parent.getCategoryExpression(); } /** * */ public JRExpression getValueExpression() { return parent.getValueExpression(); } /** * */ 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()); } public JRHyperlink getItemHyperlink() { return parent.getItemHyperlink(); } /** * */ public Object clone() { throw new UnsupportedOperationException(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillHighLowPlot.java0000644000175000017500000001477011632162653030503 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Ionut Nedelcu (ionutned@users.sourceforge.net) * @version $Id: JRFillHighLowPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } /** * */ public JRExpression getTimeAxisLabelExpression() { return ((JRHighLowPlot)parent).getTimeAxisLabelExpression(); } /** * */ public JRFont getTimeAxisLabelFont() { return timeAxisLabelFont; } /** * */ public Color getTimeAxisLabelColor() { return JRStyleResolver.getTimeAxisLabelColor(this, this); } /** * */ public Color getOwnTimeAxisLabelColor() { return timeAxisLabelColor; } /** * */ public void setTimeAxisLabelColor(Color color) { } /** * */ public JRFont getTimeAxisTickLabelFont() { return timeAxisTickLabelFont; } /** * */ public Color getTimeAxisTickLabelColor() { return JRStyleResolver.getTimeAxisTickLabelColor(this, this); } /** * */ public Color getOwnTimeAxisTickLabelColor() { return timeAxisTickLabelColor; } /** * */ public void setTimeAxisTickLabelColor(Color color) { } /** * */ public String getTimeAxisTickLabelMask() { return ((JRHighLowPlot)parent).getTimeAxisTickLabelMask(); } /** * */ public Boolean getTimeAxisVerticalTickLabels() { return ((JRHighLowPlot)parent).getTimeAxisVerticalTickLabels(); } /** * */ public Color getTimeAxisLineColor() { return JRStyleResolver.getTimeAxisLineColor(this, this); } /** * */ public Color getOwnTimeAxisLineColor() { return timeAxisLineColor; } /** * */ public void setTimeAxisLineColor(Color color) { } /** * */ public JRExpression getValueAxisLabelExpression() { return ((JRHighLowPlot)parent).getValueAxisLabelExpression(); } /** * */ public JRExpression getDomainAxisMinValueExpression() { return ((JRHighLowPlot)parent).getDomainAxisMinValueExpression(); } /** * */ public JRExpression getDomainAxisMaxValueExpression() { return ((JRHighLowPlot)parent).getDomainAxisMaxValueExpression(); } /** * */ public JRExpression getRangeAxisMinValueExpression() { return ((JRHighLowPlot)parent).getRangeAxisMinValueExpression(); } /** * */ public JRExpression getRangeAxisMaxValueExpression() { return ((JRHighLowPlot)parent).getRangeAxisMaxValueExpression(); } /** * */ public JRFont getValueAxisLabelFont() { return valueAxisLabelFont; } /** * */ public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor(this, this); } /** * */ public Color getOwnValueAxisLabelColor() { return valueAxisLabelColor; } /** * */ public void setValueAxisLabelColor(Color color) { } /** * */ public JRFont getValueAxisTickLabelFont() { return valueAxisTickLabelFont; } /** * */ public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor(this, this); } /** * */ public Color getOwnValueAxisTickLabelColor() { return valueAxisTickLabelColor; } /** * */ public void setValueAxisTickLabelColor(Color color) { } /** * */ public String getValueAxisTickLabelMask() { return ((JRHighLowPlot)parent).getValueAxisTickLabelMask(); } /** * */ public Boolean getValueAxisVerticalTickLabels() { return ((JRHighLowPlot)parent).getValueAxisVerticalTickLabels(); } /** * */ public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor(this, this); } /** * */ public Color getOwnValueAxisLineColor() { return valueAxisLineColor; } /** * */ public void setValueAxisLineColor(Color color) { } /** * */ public Boolean getShowOpenTicks() { return ((JRHighLowPlot)parent).getShowOpenTicks(); } /** * */ public Boolean getShowCloseTicks() { return ((JRHighLowPlot)parent).getShowCloseTicks(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillMultiAxisPlot.java0000644000175000017500000000434311632162653031054 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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) * @version $Id: JRFillMultiAxisPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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)); } } public List getAxes() { return axes; } public JRFillChartDataset getMainDataset() { return (JRFillChartDataset) ((JRFillChartAxis) axes.get(0)).getFillChart().getDataset(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillGanttDataset.java0000644000175000017500000001726111632162653030664 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillGanttDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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]); } } } /** * */ public JRGanttSeries[] getSeries() { return ganttSeries; } /** * */ protected void customInitialize() { seriesNames = null; seriesMap = null; labelsMap = null; itemHyperlinks = null; } /** * */ 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); } } } /** * */ 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()); } } } } /** * */ 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; } /** * */ public byte getDatasetType() { return JRChartDataset.GANTT_DATASET; } /** * */ public Object getLabelGenerator(){ return new CategoryLabelGenerator(labelsMap); } /** * */ 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; } public void validate(JRVerifier verifier) { verifier.verify(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillMeterPlot.java0000644000175000017500000000571011632162653030210 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillMeterPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRFillMeterPlot extends JRFillChartPlot implements JRMeterPlot { /** * */ public JRFillMeterPlot(JRMeterPlot meterPlot, JRFillObjectFactory factory) { super(meterPlot, factory); } /** * */ public JRDataRange getDataRange() { return ((JRMeterPlot)parent).getDataRange(); } /** * */ public JRValueDisplay getValueDisplay() { return ((JRMeterPlot)parent).getValueDisplay(); } /** * */ public MeterShapeEnum getShapeValue() { return ((JRMeterPlot)parent).getShapeValue(); } /** * */ public List getIntervals(){ return ((JRMeterPlot)parent).getIntervals(); } /** * */ public Integer getMeterAngleInteger() { return ((JRMeterPlot)parent).getMeterAngleInteger(); } /** * */ public String getUnits() { return ((JRMeterPlot)parent).getUnits(); } /** * */ public Double getTickIntervalDouble() { return ((JRMeterPlot)parent).getTickIntervalDouble(); } /** * */ public Color getMeterBackgroundColor() { return ((JRMeterPlot)parent).getMeterBackgroundColor(); } /** * */ public Color getNeedleColor() { return ((JRMeterPlot)parent).getNeedleColor(); } /** * */ public Color getTickColor() { return ((JRMeterPlot)parent).getTickColor(); } public JRFont getTickLabelFont() { return ((JRMeterPlot)parent).getTickLabelFont(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillLinePlot.java0000644000175000017500000001550011632162653030021 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRFillLinePlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } /** * */ public JRExpression getCategoryAxisLabelExpression() { return ((JRLinePlot)parent).getCategoryAxisLabelExpression(); } /** * */ public JRFont getCategoryAxisLabelFont() { return categoryAxisLabelFont; } /** * */ public Color getCategoryAxisLabelColor() { return JRStyleResolver.getCategoryAxisLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisLabelColor() { return categoryAxisLabelColor; } /** * */ public void setCategoryAxisLabelColor(Color color) { } /** * */ public JRFont getCategoryAxisTickLabelFont() { return categoryAxisTickLabelFont; } /** * */ public Color getCategoryAxisTickLabelColor() { return JRStyleResolver.getCategoryAxisTickLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisTickLabelColor() { return categoryAxisTickLabelColor; } /** * */ public void setCategoryAxisTickLabelColor(Color color) { } /** * */ public String getCategoryAxisTickLabelMask() { return ((JRLinePlot)parent).getCategoryAxisTickLabelMask(); } /** * */ public Boolean getCategoryAxisVerticalTickLabels() { return ((JRLinePlot)parent).getCategoryAxisVerticalTickLabels(); } /** * */ public Double getCategoryAxisTickLabelRotation() { return ((JRLinePlot)parent).getCategoryAxisTickLabelRotation(); } /** * */ public void setCategoryAxisTickLabelRotation(Double labelRotation) { } /** * */ public Color getCategoryAxisLineColor() { return JRStyleResolver.getCategoryAxisLineColor(this, this); } /** * */ public Color getOwnCategoryAxisLineColor() { return categoryAxisLineColor; } /** * */ public void setCategoryAxisLineColor(Color color) { } /** * */ public JRExpression getValueAxisLabelExpression() { return ((JRLinePlot)parent).getValueAxisLabelExpression(); } /** * */ public JRExpression getDomainAxisMinValueExpression() { return ((JRLinePlot)parent).getDomainAxisMinValueExpression(); } /** * */ public JRExpression getDomainAxisMaxValueExpression() { return ((JRLinePlot)parent).getDomainAxisMaxValueExpression(); } /** * */ public JRExpression getRangeAxisMinValueExpression() { return ((JRLinePlot)parent).getRangeAxisMinValueExpression(); } /** * */ public JRExpression getRangeAxisMaxValueExpression() { return ((JRLinePlot)parent).getRangeAxisMaxValueExpression(); } /** * */ public JRFont getValueAxisLabelFont() { return valueAxisLabelFont; } /** * */ public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor(this, this); } /** * */ public Color getOwnValueAxisLabelColor() { return valueAxisLabelColor; } /** * */ public void setValueAxisLabelColor(Color color) { } /** * */ public JRFont getValueAxisTickLabelFont() { return valueAxisTickLabelFont; } /** * */ public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor(this, this); } /** * */ public Color getOwnValueAxisTickLabelColor() { return valueAxisTickLabelColor; } /** * */ public void setValueAxisTickLabelColor(Color color) { } /** * */ public String getValueAxisTickLabelMask() { return ((JRLinePlot)parent).getValueAxisTickLabelMask(); } /** * */ public Boolean getValueAxisVerticalTickLabels() { return ((JRLinePlot)parent).getValueAxisVerticalTickLabels(); } /** * */ public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor(this, this); } /** * */ public Color getOwnValueAxisLineColor() { return valueAxisLineColor; } /** * */ public void setValueAxisLineColor(Color color) { } /** * */ public Boolean getShowShapes(){ return ((JRLinePlot)parent).getShowShapes(); } /** * */ public void setShowShapes( Boolean value ){ } /** * */ public Boolean getShowLines(){ return ((JRLinePlot)parent).getShowLines(); } /** * */ public void setShowLines( Boolean value ){ } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillValueDisplay.java0000644000175000017500000000416611632162653030703 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillValueDisplay.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } /** * */ public JRChart getChart() { return chart; } /** * */ public Color getColor() { return parent.getColor(); } /** * */ public String getMask(){ return parent.getMask(); } /** * */ public JRFont getFont() { return parent.getFont(); } /** * */ public Object clone() { throw new UnsupportedOperationException(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillBarPlot.java0000644000175000017500000001643211632162653027643 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRFillBarPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } /** * */ public JRExpression getCategoryAxisLabelExpression() { return ((JRBarPlot)parent).getCategoryAxisLabelExpression(); } /** * */ public JRFont getCategoryAxisLabelFont() { return categoryAxisLabelFont; } /** * */ public Color getCategoryAxisLabelColor() { return JRStyleResolver.getCategoryAxisLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisLabelColor() { return categoryAxisLabelColor; } /** * */ public void setCategoryAxisLabelColor(Color color) { } /** * */ public JRFont getCategoryAxisTickLabelFont() { return categoryAxisTickLabelFont; } /** * */ public Color getCategoryAxisTickLabelColor() { return JRStyleResolver.getCategoryAxisTickLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisTickLabelColor() { return categoryAxisTickLabelColor; } /** * */ public JRItemLabel getItemLabel() { return ((JRBarPlot)parent).getItemLabel(); } /** * */ public void setItemLabel( JRItemLabel itemLabel ){ } /** * */ public void setCategoryAxisTickLabelColor(Color color) { } /** * */ public String getCategoryAxisTickLabelMask() { return ((JRBarPlot)parent).getCategoryAxisTickLabelMask(); } /** * */ public Boolean getCategoryAxisVerticalTickLabels() { return ((JRBarPlot)parent).getCategoryAxisVerticalTickLabels(); } /** * */ public Double getCategoryAxisTickLabelRotation() { return ((JRBarPlot)parent).getCategoryAxisTickLabelRotation(); } /** * */ public void setCategoryAxisTickLabelRotation(Double labelRotation) { } /** * */ public Color getCategoryAxisLineColor() { return JRStyleResolver.getCategoryAxisLineColor(this, this); } /** * */ public Color getOwnCategoryAxisLineColor() { return categoryAxisLineColor; } /** * */ public void setCategoryAxisLineColor(Color color) { } /** * */ public JRExpression getValueAxisLabelExpression() { return ((JRBarPlot)parent).getValueAxisLabelExpression(); } /** * */ public JRExpression getDomainAxisMinValueExpression() { return ((JRBarPlot)parent).getDomainAxisMinValueExpression(); } /** * */ public JRExpression getDomainAxisMaxValueExpression() { return ((JRBarPlot)parent).getDomainAxisMaxValueExpression(); } /** * */ public JRExpression getRangeAxisMinValueExpression() { return ((JRBarPlot)parent).getRangeAxisMinValueExpression(); } /** * */ public JRExpression getRangeAxisMaxValueExpression() { return ((JRBarPlot)parent).getRangeAxisMaxValueExpression(); } /** * */ public JRFont getValueAxisLabelFont() { return valueAxisLabelFont; } /** * */ public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor(this, this); } /** * */ public Color getOwnValueAxisLabelColor() { return valueAxisLabelColor; } /** * */ public void setValueAxisLabelColor(Color color) { } /** * */ public JRFont getValueAxisTickLabelFont() { return valueAxisTickLabelFont; } /** * */ public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor(this, this); } /** * */ public Color getOwnValueAxisTickLabelColor() { return valueAxisTickLabelColor; } /** * */ public void setValueAxisTickLabelColor(Color color) { } /** * */ public String getValueAxisTickLabelMask() { return ((JRBarPlot)parent).getValueAxisTickLabelMask(); } /** * */ public Boolean getValueAxisVerticalTickLabels() { return ((JRBarPlot)parent).getValueAxisVerticalTickLabels(); } /** * */ public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor(this, this); } /** * */ public Color getOwnValueAxisLineColor() { return valueAxisLineColor; } /** * */ public void setValueAxisLineColor(Color color) { } /** * */ public Boolean getShowTickMarks() { return ((JRBarPlot)parent).getShowTickMarks(); } /** * */ public void setShowTickMarks(Boolean isShowTickMarks) { } /** * */ public Boolean getShowTickLabels() { return ((JRBarPlot)parent).getShowTickLabels(); } /** * */ public void setShowTickLabels(Boolean isShowTickLabels) { } /** * */ public Boolean getShowLabels(){ return ((JRBarPlot)parent).getShowLabels(); } /** * */ public void setShowLabels( Boolean isShowLabels ){ } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillItemLabel.java0000644000175000017500000000427111632162653030134 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillItemLabel.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } /** * */ public JRChart getChart() { return chart; } /** * */ public Color getColor() { return parent.getColor(); } /** * */ public Color getBackgroundColor() { return parent.getBackgroundColor(); } /** * */ // public String getMask(){ // return parent.getMask(); // } /** * */ public JRFont getFont() { return parent.getFont(); } /** * */ public Object clone() { throw new UnsupportedOperationException(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillValueDataset.java0000644000175000017500000000572411632162653030664 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillValueDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRFillValueDataset extends JRFillChartDataset implements JRValueDataset { private Number value; /** * */ private DefaultValueDataset valueDataset = new DefaultValueDataset(); /** * */ public JRFillValueDataset(JRValueDataset valueDataset, JRFillObjectFactory factory) { super(valueDataset, factory); } /** * */ public JRExpression getValueExpression() { return ((JRValueDataset)parent).getValueExpression(); } /** * */ protected void customInitialize() { valueDataset = new DefaultValueDataset(); } /** * */ protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException { value = (Number)calculator.evaluate(getValueExpression()); } /** * */ protected void customIncrement() { valueDataset.setValue(value); } /** * */ public Dataset getCustomDataset() { return valueDataset; } /** * */ public Object getLabelGenerator() { return null; } /** * */ public byte getDatasetType() { return JRChartDataset.VALUE_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillThermometerPlot.java0000644000175000017500000000522611632162653031431 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillThermometerPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRFillThermometerPlot extends JRFillChartPlot implements JRThermometerPlot { /** * */ public JRFillThermometerPlot(JRThermometerPlot thermoPlot, JRFillObjectFactory factory) { super(thermoPlot, factory); } /** * */ public JRDataRange getDataRange() { return ((JRThermometerPlot)parent).getDataRange(); } /** * */ public JRValueDisplay getValueDisplay() { return ((JRThermometerPlot)parent).getValueDisplay(); } /** * @deprecated No longer used. */ public boolean isShowValueLines() { return ((JRThermometerPlot)parent).isShowValueLines(); } /** * */ public ValueLocationEnum getValueLocationValue() { return ((JRThermometerPlot)parent).getValueLocationValue(); } /** * */ public Color getMercuryColor() { return ((JRThermometerPlot)parent).getMercuryColor(); } /** * */ public JRDataRange getLowRange() { return ((JRThermometerPlot)parent).getLowRange(); } /** * */ public JRDataRange getMediumRange() { return ((JRThermometerPlot)parent).getMediumRange(); } /** * */ public JRDataRange getHighRange() { return ((JRThermometerPlot)parent).getHighRange(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillXyDataset.java0000644000175000017500000001375011632162653030206 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillXyDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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]); } } } /** * */ public JRXySeries[] getSeries() { return xySeries; } /** * */ protected void customInitialize() { seriesNames = null; seriesMap = null; labelsMap = null; itemHyperlinks = null; } /** * */ 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); } } } /** * */ 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) { xySrs = new XYSeries(seriesName); 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()); } } } } /** * */ 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; } /** * */ public byte getDatasetType() { return JRChartDataset.XY_DATASET; } /** * */ public Object getLabelGenerator(){ return new XYDatasetLabelGenerator(labelsMap); } /** * */ 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; } public void validate(JRVerifier verifier) { verifier.verify(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillAreaPlot.java0000644000175000017500000001507511632162653030011 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRFillAreaPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 ); 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(); } /** * */ public JRExpression getCategoryAxisLabelExpression() { return ((JRAreaPlot)parent).getCategoryAxisLabelExpression(); } /** * */ public JRFont getCategoryAxisLabelFont() { return categoryAxisLabelFont; } /** * */ public Color getCategoryAxisLabelColor() { return JRStyleResolver.getCategoryAxisLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisLabelColor() { return categoryAxisLabelColor; } /** * */ public void setCategoryAxisLabelColor(Color color) { } /** * */ public JRFont getCategoryAxisTickLabelFont() { return categoryAxisTickLabelFont; } /** * */ public Color getCategoryAxisTickLabelColor() { return JRStyleResolver.getCategoryAxisTickLabelColor(this, this); } /** * */ public Color getOwnCategoryAxisTickLabelColor() { return categoryAxisTickLabelColor; } /** * */ public void setCategoryAxisTickLabelColor(Color color) { } /** * */ public String getCategoryAxisTickLabelMask() { return ((JRAreaPlot)parent).getCategoryAxisTickLabelMask(); } /** * */ public Boolean getCategoryAxisVerticalTickLabels() { return ((JRAreaPlot)parent).getCategoryAxisVerticalTickLabels(); } /** * */ public Double getCategoryAxisTickLabelRotation() { return ((JRAreaPlot)parent).getCategoryAxisTickLabelRotation(); } /** * */ public void setCategoryAxisTickLabelRotation(Double labelRotation) { } /** * */ public Color getCategoryAxisLineColor() { return JRStyleResolver.getCategoryAxisLineColor(this, this); } /** * */ public Color getOwnCategoryAxisLineColor() { return categoryAxisLineColor; } /** * */ public void setCategoryAxisLineColor(Color color) { } /** * */ public JRExpression getValueAxisLabelExpression() { return ((JRAreaPlot)parent).getValueAxisLabelExpression(); } /** * */ public JRExpression getDomainAxisMinValueExpression() { return ((JRAreaPlot)parent).getDomainAxisMinValueExpression(); } /** * */ public JRExpression getDomainAxisMaxValueExpression() { return ((JRAreaPlot)parent).getDomainAxisMaxValueExpression(); } /** * */ public JRExpression getRangeAxisMinValueExpression() { return ((JRAreaPlot)parent).getRangeAxisMinValueExpression(); } /** * */ public JRExpression getRangeAxisMaxValueExpression() { return ((JRAreaPlot)parent).getRangeAxisMaxValueExpression(); } /** * */ public JRFont getValueAxisLabelFont() { return valueAxisLabelFont; } /** * */ public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor(this, this); } /** * */ public Color getOwnValueAxisLabelColor() { return valueAxisLabelColor; } /** * */ public void setValueAxisLabelColor(Color color) { } /** * */ public JRFont getValueAxisTickLabelFont() { return valueAxisTickLabelFont; } /** * */ public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor(this, this); } /** * */ public Color getOwnValueAxisTickLabelColor() { return valueAxisTickLabelColor; } /** * */ public void setValueAxisTickLabelColor(Color color) { } /** * */ public String getValueAxisTickLabelMask() { return ((JRAreaPlot)parent).getValueAxisTickLabelMask(); } /** * */ public Boolean getValueAxisVerticalTickLabels() { return ((JRAreaPlot)parent).getValueAxisVerticalTickLabels(); } /** * */ public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor(this, this); } /** * */ public Color getOwnValueAxisLineColor() { return valueAxisLineColor; } /** * */ public void setValueAxisLineColor(Color color) { } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillPie3DPlot.java0000644000175000017500000000430511632162653030037 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillPie3DPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRFillPie3DPlot extends JRFillChartPlot implements JRPie3DPlot { /** * */ public JRFillPie3DPlot( JRPie3DPlot pie3DPlot, JRFillObjectFactory factory ) { super(pie3DPlot, factory); } /** * */ public Double getDepthFactorDouble() { return ((JRPie3DPlot)parent).getDepthFactorDouble(); } /** * */ public Boolean getCircular() { return ((JRPie3DPlot)parent).getCircular(); } /** * */ public String getLabelFormat() { return ((JRPie3DPlot)parent).getLabelFormat(); } /** * */ public String getLegendLabelFormat() { return ((JRPie3DPlot)parent).getLegendLabelFormat(); } /** * */ public JRItemLabel getItemLabel() { return ((JRPie3DPlot)parent).getItemLabel(); } /** * */ public Boolean getShowLabels() { return ((JRPie3DPlot)parent).getShowLabels(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillTimeSeries.java0000644000175000017500000001000711632162653030341 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillTimeSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } /** * */ public JRExpression getSeriesExpression() { return parent.getSeriesExpression(); } /** * */ public JRExpression getTimePeriodExpression() { return parent.getTimePeriodExpression(); } /** * */ public JRExpression getValueExpression() { return parent.getValueExpression(); } /** * */ 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); } } public JRHyperlink getItemHyperlink() { return parent.getItemHyperlink(); } public boolean hasItemHyperlink() { return !JRHyperlinkHelper.isEmpty(getItemHyperlink()); } public JRPrintHyperlink getPrintItemHyperlink() { return itemHyperlink; } /** * */ public Object clone() { throw new UnsupportedOperationException(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillXySeries.java0000644000175000017500000000772211632162653030055 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillXySeries.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRFillXySeries implements JRXySeries { /** * */ protected JRXySeries parent; private Comparable series; private Number xValue; private Number yValue; private String label; private JRPrintHyperlink itemHyperlink; /** * */ public JRFillXySeries( JRXySeries xySeries, JRFillObjectFactory factory ) { factory.put(xySeries, this); parent = xySeries; } /** * */ public JRExpression getSeriesExpression() { return parent.getSeriesExpression(); } /** * */ public JRExpression getXValueExpression() { return parent.getXValueExpression(); } /** * */ public JRExpression getYValueExpression() { return parent.getYValueExpression(); } /** * */ public JRExpression getLabelExpression() { return parent.getLabelExpression(); } /** * */ 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); } } public JRHyperlink getItemHyperlink() { return parent.getItemHyperlink(); } public boolean hasItemHyperlinks() { return !JRHyperlinkHelper.isEmpty(getItemHyperlink()); } /** * */ public Object clone() { throw new UnsupportedOperationException(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillPiePlot.java0000644000175000017500000000403211632162653027645 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRFillPiePlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRFillPiePlot extends JRFillChartPlot implements JRPiePlot { /** * */ public JRFillPiePlot( JRPiePlot piePlot, JRFillObjectFactory factory ) { super(piePlot, factory); } /** * */ public Boolean getCircular() { return ((JRPiePlot)parent).getCircular(); } public String getLabelFormat() { return ((JRPiePlot)parent).getLabelFormat(); } public String getLegendLabelFormat() { return ((JRPiePlot)parent).getLegendLabelFormat(); } /** * */ public JRItemLabel getItemLabel() { return ((JRPiePlot)parent).getItemLabel(); } /** * */ public Boolean getShowLabels(){ return ((JRPiePlot)parent).getShowLabels(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillTimeSeriesPlot.java0000644000175000017500000001475211632162653031213 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRFillTimeSeriesPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } /** * */ public JRExpression getTimeAxisLabelExpression() { return ((JRTimeSeriesPlot)parent).getTimeAxisLabelExpression(); } /** * */ public JRFont getTimeAxisLabelFont() { return timeAxisLabelFont; } /** * */ public Color getTimeAxisLabelColor() { return JRStyleResolver.getTimeAxisLabelColor(this, this); } /** * */ public Color getOwnTimeAxisLabelColor() { return timeAxisLabelColor; } /** * */ public void setTimeAxisLabelColor(Color color) { } /** * */ public JRFont getTimeAxisTickLabelFont() { return timeAxisTickLabelFont; } /** * */ public Color getTimeAxisTickLabelColor() { return JRStyleResolver.getTimeAxisTickLabelColor(this, this); } /** * */ public Color getOwnTimeAxisTickLabelColor() { return timeAxisTickLabelColor; } /** * */ public void setTimeAxisTickLabelColor(Color color) { } /** * */ public String getTimeAxisTickLabelMask() { return ((JRTimeSeriesPlot)parent).getTimeAxisTickLabelMask(); } /** * */ public Boolean getTimeAxisVerticalTickLabels() { return ((JRTimeSeriesPlot)parent).getTimeAxisVerticalTickLabels(); } /** * */ public Color getTimeAxisLineColor() { return JRStyleResolver.getTimeAxisLineColor(this, this); } /** * */ public Color getOwnTimeAxisLineColor() { return timeAxisLineColor; } /** * */ public void setTimeAxisLineColor(Color color) { } /** * */ public JRExpression getValueAxisLabelExpression() { return ((JRTimeSeriesPlot)parent).getValueAxisLabelExpression(); } /** * */ public JRExpression getDomainAxisMinValueExpression() { return ((JRTimeSeriesPlot)parent).getDomainAxisMinValueExpression(); } /** * */ public JRExpression getDomainAxisMaxValueExpression() { return ((JRTimeSeriesPlot)parent).getDomainAxisMaxValueExpression(); } /** * */ public JRExpression getRangeAxisMinValueExpression() { return ((JRTimeSeriesPlot)parent).getRangeAxisMinValueExpression(); } /** * */ public JRExpression getRangeAxisMaxValueExpression() { return ((JRTimeSeriesPlot)parent).getRangeAxisMaxValueExpression(); } /** * */ public JRFont getValueAxisLabelFont() { return valueAxisLabelFont; } /** * */ public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor(this, this); } /** * */ public Color getOwnValueAxisLabelColor() { return valueAxisLabelColor; } /** * */ public void setValueAxisLabelColor(Color color) { } /** * */ public JRFont getValueAxisTickLabelFont() { return valueAxisTickLabelFont; } /** * */ public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor(this, this); } /** * */ public Color getOwnValueAxisTickLabelColor() { return valueAxisTickLabelColor; } /** * */ public void setValueAxisTickLabelColor(Color color) { } /** * */ public String getValueAxisTickLabelMask() { return ((JRTimeSeriesPlot)parent).getValueAxisTickLabelMask(); } /** * */ public Boolean getValueAxisVerticalTickLabels() { return ((JRTimeSeriesPlot)parent).getValueAxisVerticalTickLabels(); } /** * */ public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor(this, this); } /** * */ public Color getOwnValueAxisLineColor() { return valueAxisLineColor; } /** * */ public Boolean getShowLines(){ return ((JRTimeSeriesPlot)parent).getShowLines(); } /** * */ public void setShowLines(Boolean showLines){ } /** * */ public Boolean getShowShapes(){ return ((JRTimeSeriesPlot)parent).getShowShapes(); } /** * */ public void setShowShapes(Boolean showLines){ } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/fill/JRFillCandlestickPlot.java0000644000175000017500000001501111632162653031353 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; import net.sf.jasperreports.engine.util.JRStyleResolver; /** * @author Ionut Nedelcu (ionutned@users.sourceforge.net) * @version $Id: JRFillCandlestickPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } /** * */ public JRExpression getTimeAxisLabelExpression() { return ((JRCandlestickPlot)parent).getTimeAxisLabelExpression(); } /** * */ public JRFont getTimeAxisLabelFont() { return timeAxisLabelFont; } /** * */ public Color getTimeAxisLabelColor() { return JRStyleResolver.getTimeAxisLabelColor(this, this); } /** * */ public Color getOwnTimeAxisLabelColor() { return timeAxisLabelColor; } /** * */ public void setTimeAxisLabelColor(Color color) { } /** * */ public JRFont getTimeAxisTickLabelFont() { return timeAxisTickLabelFont; } /** * */ public Color getTimeAxisTickLabelColor() { return JRStyleResolver.getTimeAxisTickLabelColor(this, this); } /** * */ public Color getOwnTimeAxisTickLabelColor() { return timeAxisTickLabelColor; } /** * */ public void setTimeAxisTickLabelColor(Color color) { } /** * */ public String getTimeAxisTickLabelMask() { return ((JRCandlestickPlot)parent).getTimeAxisTickLabelMask(); } /** * */ public Boolean getTimeAxisVerticalTickLabels() { return ((JRCandlestickPlot)parent).getTimeAxisVerticalTickLabels(); } /** * */ public Color getTimeAxisLineColor() { return JRStyleResolver.getTimeAxisLineColor(this, this); } /** * */ public Color getOwnTimeAxisLineColor() { return timeAxisLineColor; } /** * */ public void setTimeAxisLineColor(Color color) { } /** * */ public JRExpression getValueAxisLabelExpression() { return ((JRCandlestickPlot)parent).getValueAxisLabelExpression(); } /** * */ public JRExpression getDomainAxisMinValueExpression() { return ((JRCandlestickPlot)parent).getDomainAxisMinValueExpression(); } /** * */ public JRExpression getDomainAxisMaxValueExpression() { return ((JRCandlestickPlot)parent).getDomainAxisMaxValueExpression(); } /** * */ public JRExpression getRangeAxisMinValueExpression() { return ((JRCandlestickPlot)parent).getRangeAxisMinValueExpression(); } /** * */ public JRExpression getRangeAxisMaxValueExpression() { return ((JRCandlestickPlot)parent).getRangeAxisMaxValueExpression(); } /** * */ public JRFont getValueAxisLabelFont() { return valueAxisLabelFont; } /** * */ public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor(this, this); } /** * */ public Color getOwnValueAxisLabelColor() { return valueAxisLabelColor; } /** * */ public void setValueAxisLabelColor(Color color) { } /** * */ public JRFont getValueAxisTickLabelFont() { return valueAxisTickLabelFont; } /** * */ public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor(this, this); } /** * */ public Color getOwnValueAxisTickLabelColor() { return valueAxisTickLabelColor; } /** * */ public void setValueAxisTickLabelColor(Color color) { } /** * */ public String getValueAxisTickLabelMask() { return ((JRCandlestickPlot)parent).getValueAxisTickLabelMask(); } /** * */ public Boolean getValueAxisVerticalTickLabels() { return ((JRCandlestickPlot)parent).getValueAxisVerticalTickLabels(); } /** * */ public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor(this, this); } /** * */ public Color getOwnValueAxisLineColor() { return valueAxisLineColor; } /** * */ public void setValueAxisLineColor(Color color) { } /** * */ public Boolean getShowVolume() { return ((JRCandlestickPlot)parent).getShowVolume(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRHighLowPlot.java0000644000175000017500000000353611632162652026743 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Ionut Nedelcu (ionutned@users.sourceforge.net) * @version $Id: JRHighLowPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/0000755000175000017500000000000011654071732024237 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRItemLabelFactory.java0000644000175000017500000000451011632162654030524 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRItemLabelFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ 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"; /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRTimeSeriesPlotFactory.java0000644000175000017500000000413511632162654031601 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRTimeSeriesPlotFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRTimeSeriesPlotFactory extends JRBaseFactory { private static final String ATTRIBUTE_isShowShapes = "isShowShapes"; private static final String ATTRIBUTE_isShowLines = "isShowLines"; 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRXyLineChartFactory.java0000644000175000017500000000327211632162654031064 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRXyLineChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRXyLineChartFactory extends JRBaseFactory { public Object createObject( Attributes attrs ){ JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_XYLINE); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRCategoryDatasetFactory.java0000644000175000017500000000275711632162654031764 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRCategoryDatasetFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRCategoryDatasetFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { JRChart chart = (JRChart) digester.peek(); return chart.getDataset(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRBarPlotFactory.java0000644000175000017500000000454611632162654030242 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBarPlotFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ 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"; 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRValueDatasetFactory.java0000644000175000017500000000275311632162654031257 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRValueDatasetFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRValueDatasetFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { JRChart chart = (JRChart) digester.peek(); return chart.getDataset(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRTimePeriodDatasetFactory.java0000644000175000017500000000354211632162654032241 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRTimePeriodDatasetFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRTimePeriodDatasetFactory extends JRBaseFactory { 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRMeterIntervalFactory.java0000644000175000017500000000420111632162654031444 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRMeterIntervalFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ 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"; /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRChartAxisFactory.java0000644000175000017500000000377711632145612030565 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRChartAxisFactory.java 1578 2007-02-09 16:27:52Z shertage $ */ public class JRChartAxisFactory extends JRBaseFactory { public static final String ELEMENT_axis = "axis"; public static final String ATTRIBUTE_position = "position"; /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/package.html0000644000175000017500000000043711614510763026522 0ustar drazzibdrazzib Contains classes for loading chart related tags from report templates XML files.

Related Documentation

jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRAreaPlotFactory.java0000644000175000017500000000310311632162654030372 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRAreaPlotFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRAreaPlotFactory extends JRBaseFactory { public Object createObject( Attributes attrs ){ JRChart chart = (JRChart)digester.peek(); JRDesignAreaPlot plot = (JRDesignAreaPlot)chart.getPlot(); return plot; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRMultiAxisChartFactory.java0000644000175000017500000000332411632162654031571 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRMultiAxisChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRMultiAxisChartFactory extends JRBaseFactory { /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRBarChartFactory.java0000644000175000017500000000327511632162654030363 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBarChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRBarChartFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_BAR); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRScatterChartFactory.java0000644000175000017500000000327511632162654031264 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRScatterChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRScatterChartFactory extends JRBaseFactory { public Object createObject( Attributes attrs ){ JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_SCATTER); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRPiePlotFactory.java0000644000175000017500000000435711632162654030253 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRPiePlotFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRPiePlotFactory extends JRBaseFactory { private static final String ATTRIBUTE_isShowLabels = "isShowLabels"; /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRXyzSeriesFactory.java0000644000175000017500000000272611632162654030642 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRXyzSeriesFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRXyzSeriesFactory extends JRBaseFactory { /** * */ public Object createObject( Attributes attrs ) { return new JRDesignXyzSeries(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRStackedBar3DChartFactory.java0000644000175000017500000000333111632162654032042 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRStackedBar3DChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRStackedBar3DChartFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_STACKEDBAR3D); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRThermometerChartFactory.java0000644000175000017500000000332611632162654032147 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRThermometerChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRThermometerChartFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_THERMOMETER); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRGanttDatasetFactory.java0000644000175000017500000000343011632162654031251 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRGanttDatasetFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRGanttDatasetFactory extends JRBaseFactory { /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRScatterPlotFactory.java0000644000175000017500000000411111632162654031127 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRScatterPlotFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRScatterPlotFactory extends JRBaseFactory { private static final String ATTRIBUTE_isShowShapes = "isShowShapes"; private static final String ATTRIBUTE_isShowLines = "isShowLines"; 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRPieSeriesFactory.java0000644000175000017500000000271411632162654030562 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRPieSeriesFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRPieSeriesFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { return new JRDesignPieSeries(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRTimePeriodSeriesFactory.java0000644000175000017500000000276311632162654032112 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRTimePeriodSeriesFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRTimePeriodSeriesFactory extends JRBaseFactory { /** * */ public Object createObject( Attributes attrs ) { return new JRDesignTimePeriodSeries(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRHighLowDatasetFactory.java0000644000175000017500000000275711632162654031550 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRHighLowDatasetFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRHighLowDatasetFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { JRChart chart = (JRChart) digester.peek(); return chart.getDataset(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRMeterPlotFactory.java0000644000175000017500000000663711632162654030615 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRMeterPlotFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 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)); } return meterPlot; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRBar3DChartFactory.java0000644000175000017500000000327611632162654030553 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBar3DChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRBar3DChartFactory extends JRBaseFactory { public Object createObject( Attributes attrs ){ JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_BAR3D); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRXyDatasetFactory.java0000644000175000017500000000343611632162654030602 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRXyDatasetFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRXyDatasetFactory extends JRBaseFactory { /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRGanttSeriesFactory.java0000644000175000017500000000270311632162654031120 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRGanttSeriesFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRGanttSeriesFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { return new JRDesignGanttSeries(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRPieDatasetFactory.java0000644000175000017500000000412111632162654030707 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRPieDatasetFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRPieDatasetFactory extends JRBaseFactory { private static final String ATTRIBUTE_minPercentage = "minPercentage"; private static final String ATTRIBUTE_maxCount = "maxCount"; /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRBar3DPlotFactory.java0000644000175000017500000000435711632162654030431 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBar3DPlotFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ 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"; 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRCandlestickPlotFactory.java0000644000175000017500000000355511632162654031761 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRCandlestickPlotFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRCandlestickPlotFactory extends JRBaseFactory { private static final String ATTRIBUTE_isShowVolume = "isShowVolume"; /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRTimeSeriesChartFactory.java0000644000175000017500000000331511632162654031723 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRTimeSeriesChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRTimeSeriesChartFactory extends JRBaseFactory { public Object createObject( Attributes attrs ){ JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_TIMESERIES ); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRStackedBarChartFactory.java0000644000175000017500000000332311632162654031654 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRStackedBarChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRStackedBarChartFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_STACKEDBAR); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRCandlestickChartFactory.java0000644000175000017500000000332611632162654032100 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRCandlestickChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRCandlestickChartFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_CANDLESTICK); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRPie3DPlotFactory.java0000644000175000017500000000501511632162654030432 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRPie3DPlotFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRPie3DPlotFactory extends JRBaseFactory { /** * */ private static final String ATTRIBUTE_depthFactor = "depthFactor"; private static final String ATTRIBUTE_isShowLabels = "isShowLabels"; /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRAreaChartFactory.java0000644000175000017500000000327611632162653030527 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRAreaChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRAreaChartFactory extends JRBaseFactory { public Object createObject( Attributes atts ){ JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart areaChart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_AREA); return areaChart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRThermometerPlotFactory.java0000644000175000017500000000551011632162654032021 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRThermometerPlotFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRThermometerPlotFactory extends JRBaseFactory { 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"; /** * @deprecated No longer used. */ public static final String ATTRIBUTE_showValueLines = "isShowValueLines"; public static final String ATTRIBUTE_valueLocation = "valueLocation"; public static final String ATTRIBUTE_mercuryColor = "mercuryColor"; /** * */ 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("Invalid thermometer value location: " + 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRBubblePlotFactory.java0000644000175000017500000000356311632162654030727 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBubblePlotFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRBubblePlotFactory extends JRBaseFactory { private static final String ATTRIBUTE_scaleType = "scaleType"; 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRPieChartFactory.java0000644000175000017500000000327611632162654030375 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRPieChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRPieChartFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_PIE); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRBubbleChartFactory.java0000644000175000017500000000327711632162654031054 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRBubbleChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRBubbleChartFactory extends JRBaseFactory { public Object createObject( Attributes attrs ){ JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_BUBBLE); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRXyBarChartFactory.java0000644000175000017500000000330311632162654030674 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRXyBarChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRXyBarChartFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_XYBAR); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRXySeriesFactory.java0000644000175000017500000000271111632162654030442 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRXySeriesFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRXySeriesFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { return new JRDesignXySeries(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRGanttChartFactory.java0000644000175000017500000000324711632162654030733 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRGanttChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRGanttChartFactory extends JRBaseFactory { public Object createObject( Attributes attrs ){ JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_GANTT); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRDataRangeFactory.java0000644000175000017500000000271711632162654030523 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDataRangeFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRDataRangeFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { return new JRDesignDataRange(null); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRPie3DChartFactory.java0000644000175000017500000000330411632162654030554 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRPie3DChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRPie3DChartFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_PIE3D); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRHighLowChartFactory.java0000644000175000017500000000331211632162654031210 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRHighLowChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRHighLowChartFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_HIGHLOW); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRXyAreaChartFactory.java0000644000175000017500000000327011632162654031043 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRXyAreaChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRXyAreaChartFactory extends JRBaseFactory { public Object createObject( Attributes atts ){ JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_XYAREA); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRLinePlotFactory.java0000644000175000017500000000407611632162654030423 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRLinePlotFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRLinePlotFactory extends JRBaseFactory { private static final String ATTRIBUTE_isShowShapes = "isShowShapes"; private static final String ATTRIBUTE_isShowLines = "isShowLines"; 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRHighLowPlotFactory.java0000644000175000017500000000421411632162654031067 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRHighLowPlotFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRHighLowPlotFactory extends JRBaseFactory { private static final String ATTRIBUTE_isShowOpenTicks = "isShowOpenTicks"; private static final String ATTRIBUTE_isShowCloseTicks = "isShowCloseTicks"; /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRXyzDatasetFactory.java0000644000175000017500000000273311632162654030773 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRXyzDatasetFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRXyzDatasetFactory extends JRBaseFactory { public Object createObject( Attributes attrs ){ JRChart chart = (JRChart)digester.peek(); return chart.getDataset(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRMeterChartFactory.java0000644000175000017500000000330711632162654030727 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRMeterChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRMeterChartFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_METER); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRStackedAreaChartFactory.java0000644000175000017500000000332611632162654032023 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRStackedAreaChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRStackedAreaChartFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_STACKEDAREA); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRMultiAxisPlotFactory.java0000644000175000017500000000336511632162654031453 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRMultiAxisPlotFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRMultiAxisPlotFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) throws JRException { JRDesignChart chart = (JRDesignChart)digester.peek(); JRDesignMultiAxisPlot multiAxisPlot = (JRDesignMultiAxisPlot)chart.getPlot(); multiAxisPlot.setChart(chart); return multiAxisPlot; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRCategorySeriesFactory.java0000644000175000017500000000274011632162654031621 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRCategorySeriesFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRCategorySeriesFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { return new JRDesignCategorySeries(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRTimeSeriesDatasetFactory.java0000644000175000017500000000422011632162654032243 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRTimeSeriesDatasetFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRTimeSeriesDatasetFactory extends JRBaseFactory { private static final String ATTRIBUTE_timePeriod = "timePeriod"; /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRValueDisplayFactory.java0000644000175000017500000000406111632162654031271 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRValueDisplayFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRValueDisplayFactory extends JRBaseFactory { private static final String ATTRIBUTE_color = "color"; private static final String ATTRIBUTE_mask = "mask"; /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRLineChartFactory.java0000644000175000017500000000327011632162654030541 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRLineChartFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRLineChartFactory extends JRBaseFactory { public Object createObject( Attributes attrs ){ JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignChart chart = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_LINE); return chart; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/xml/JRTimeSeriesFactory.java0000644000175000017500000000272011632162654030740 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRTimeSeriesFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRTimeSeriesFactory extends JRBaseFactory { /** * */ public Object createObject(Attributes atts) { return new JRDesignTimeSeries(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRCandlestickPlot.java0000644000175000017500000000345611632162652027627 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Ionut Nedelcu (ionutned@users.sourceforge.net) * @version $Id: JRCandlestickPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRXyzDataset.java0000644000175000017500000000244511632162653026642 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Flavius Sana (flavius_sana@users.sourceforge.net) * @version $Id: JRXyzDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRXyzDataset extends JRChartDataset { public JRXyzSeries[] getSeries(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRChartAxis.java0000644000175000017500000000377411632162652026435 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRChartAxis.java 4595 2011-09-08 15:55:10Z teodord $ */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRPieDataset.java0000644000175000017500000000371211632162653026563 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRPieDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRPieDataset extends JRChartDataset { /** * */ public Float getMinPercentage(); /** * */ public void setMinPercentage(Float minPercentage); /** * */ public Integer getMaxCount(); /** * */ public void setMaxCount(Integer maxCount); /** * */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/0000755000175000017500000000000011654071732024414 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/XYChartHyperlinkProvider.java0000644000175000017500000000521111632162653032200 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: XYChartHyperlinkProvider.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } 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; } public boolean hasHyperlinks() { return itemHyperlinks != null && itemHyperlinks.size() > 0; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/TimeSeriesLabelGenerator.java0000644000175000017500000000422211632162653032136 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 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) * @version $Id: TimeSeriesLabelGenerator.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 = labelsMap; } 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 ); } }jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/TimePeriodChartHyperlinkProvider.java0000644000175000017500000000525611632162653033712 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: TimePeriodChartHyperlinkProvider.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } 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; } public boolean hasHyperlinks() { return itemHyperlinks != null && itemHyperlinks.size() > 0; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/package.html0000644000175000017500000000040411614510764026672 0ustar drazzibdrazzib Contains utility classes for complex chart datasets.

Related Documentation

jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/TimeSeriesChartHyperlinkProvider.java0000644000175000017500000000526511632162653033722 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: TimeSeriesChartHyperlinkProvider.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } 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; } public boolean hasHyperlinks() { return itemHyperlinks != null && itemHyperlinks.size() > 0; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/MultiAxisChartHyperlinkProvider.java0000644000175000017500000000773011632162653033567 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: MultiAxisChartHyperlinkProvider.java 4595 2011-09-08 15:55:10Z teodord $ */ 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. */ 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. */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/CategoryChartHyperlinkProvider.java0000644000175000017500000000464311632162653033425 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: CategoryChartHyperlinkProvider.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } 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; } public boolean hasHyperlinks() { return itemHyperlinks != null && itemHyperlinks.size() > 0; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/DrawChartRendererFactory.java0000644000175000017500000000306011632162653032153 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 net.sf.jasperreports.engine.JRRenderable; import org.jfree.chart.JFreeChart; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: DrawChartRendererFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class DrawChartRendererFactory implements ChartRendererFactory { public JRRenderable getRenderer( JFreeChart chart, ChartHyperlinkProvider chartHyperlinkProvider, Rectangle2D rectangle ) { return new DrawChartRenderer(chart, chartHyperlinkProvider); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/PieChartHyperlinkProvider.java0000644000175000017500000000424511632162653032363 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: PieChartHyperlinkProvider.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } public JRPrintHyperlink getEntityHyperlink(ChartEntity entity) { JRPrintHyperlink printHyperlink = null; if (hasHyperlinks() && entity instanceof PieSectionEntity) { PieSectionEntity pieEntity = (PieSectionEntity) entity; printHyperlink = sectionHyperlinks.get(pieEntity.getSectionKey()); } return printHyperlink; } public boolean hasHyperlinks() { return sectionHyperlinks != null && sectionHyperlinks.size() > 0; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/DrawChartRenderer.java0000644000175000017500000000535411632162653030633 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 net.sf.jasperreports.engine.JRAbstractSvgRenderer; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRImageMapRenderer; import net.sf.jasperreports.engine.JRPrintImageAreaHyperlink; import org.jfree.chart.JFreeChart; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: DrawChartRenderer.java 4595 2011-09-08 15:55:10Z teodord $ */ public class DrawChartRenderer extends JRAbstractSvgRenderer implements JRImageMapRenderer { 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; } public void render(Graphics2D grx, Rectangle2D rectangle) { if (chart != null) { chart.draw(grx, rectangle); } } public List renderWithHyperlinks(Graphics2D grx, Rectangle2D rectangle) { render(grx, rectangle); return ChartUtil.getImageAreaHyperlinks(chart, chartHyperlinkProvider, grx, rectangle); } /** * @deprecated Replaced by {@link #renderWithHyperlinks(Graphics2D, Rectangle2D)} */ public List getImageAreaHyperlinks(Rectangle2D renderingArea) throws JRException { return ChartUtil.getImageAreaHyperlinks(chart, chartHyperlinkProvider, null, renderingArea); } public boolean hasImageAreaHyperlinks() { return chartHyperlinkProvider != null && chartHyperlinkProvider.hasHyperlinks(); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/XYZElement.java0000644000175000017500000000452111632162653027264 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: XYZElement.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/SvgChartRendererFactory.java0000644000175000017500000000532011632162653032016 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.util.List; import net.sf.jasperreports.engine.JRPrintImageAreaHyperlink; import net.sf.jasperreports.engine.JRRenderable; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.renderers.BatikRenderer; 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; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: SvgChartRendererFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class SvgChartRendererFactory implements ChartRendererFactory { public JRRenderable getRenderer( 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); return new BatikRenderer(swriter.getBuffer().toString(), areaHyperlinks); } catch (SVGGraphics2DIOException e) { throw new JRRuntimeException(e); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/XYDatasetLabelGenerator.java0000644000175000017500000000404411632162653031735 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 org.jfree.chart.labels.StandardXYItemLabelGenerator; import org.jfree.data.xy.XYDataset; import org.jfree.data.xy.XYSeriesCollection; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: XYDatasetLabelGenerator.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 = labelsMap; } 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 ); } }jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/DefaultXYZDataset.java0000644000175000017500000000706611632162653030574 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: DefaultXYZDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 ); } } /** * */ public int getSeriesCount() { int retVal = 0; if( dataset != null ){ retVal = dataset.size(); } return retVal; } /** * */ 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; } /** * */ public int getItemCount(int series ) { int retVal = 0; if( dataset != null ){ if( series < getSeriesCount() ){ XYZElement element = dataset.get( series ); retVal = element.getCount(); } } return retVal; } /** * */ 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; } /** * */ 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; } /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/HighLowChartHyperlinkProvider.java0000644000175000017500000000427511632162653033212 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: HighLowChartHyperlinkProvider.java 4595 2011-09-08 15:55:10Z teodord $ */ public class HighLowChartHyperlinkProvider implements ChartHyperlinkProvider { private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private List itemHyperlinks; public HighLowChartHyperlinkProvider(List itemHyperlinks) { this.itemHyperlinks = itemHyperlinks; } 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; } public boolean hasHyperlinks() { return itemHyperlinks != null && itemHyperlinks.size() > 0; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/ChartUtil.java0000644000175000017500000001340711632162653027162 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.ArrayList; import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; import net.sf.jasperreports.charts.ChartTheme; import net.sf.jasperreports.charts.ChartThemeBundle; 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.JRRuntimeException; import net.sf.jasperreports.engine.fill.DefaultChartTheme; import net.sf.jasperreports.engine.util.JRProperties; import net.sf.jasperreports.engine.util.JRSingletonCache; import net.sf.jasperreports.extensions.ExtensionsEnvironment; import org.jfree.chart.ChartRenderingInfo; import org.jfree.chart.JFreeChart; import org.jfree.chart.entity.ChartEntity; import org.jfree.chart.entity.EntityCollection; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: ChartUtil.java 4595 2011-09-08 15:55:10Z teodord $ */ public final class ChartUtil { /** * */ private static final JRSingletonCache CHART_RENDERER_FACTORY_CACHE = new JRSingletonCache(ChartRendererFactory.class); /** * */ 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 (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 static ChartTheme getChartTheme(String themeName) { if (themeName == null) { return new DefaultChartTheme(); } List themeBundles = ExtensionsEnvironment.getExtensionsRegistry().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("Chart theme '" + themeName + "' not found."); } /** * */ public static ChartRendererFactory getChartRendererFactory(String renderType) { ChartRendererFactory chartRendererFactory = null; String factoryClass = JRProperties.getProperty(ChartRendererFactory.PROPERTY_CHART_RENDERER_FACTORY_PREFIX + renderType); if (factoryClass == null) { throw new JRRuntimeException("No chart renderer factory specifyed for '" + renderType + "' render type."); } try { chartRendererFactory = CHART_RENDERER_FACTORY_CACHE.getCachedInstance(factoryClass); } catch (JRException e) { throw new JRRuntimeException(e); } return chartRendererFactory; } private ChartUtil() { } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/ImageChartRendererFactory.java0000644000175000017500000000542011632162653032302 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRPrintImageAreaHyperlink; import net.sf.jasperreports.engine.JRRenderable; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.util.JRImageLoader; import net.sf.jasperreports.engine.util.JRProperties; import net.sf.jasperreports.renderers.JRSimpleImageMapRenderer; import org.jfree.chart.JFreeChart; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: ImageChartRendererFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public class ImageChartRendererFactory implements ChartRendererFactory { public JRRenderable getRenderer( JFreeChart chart, ChartHyperlinkProvider chartHyperlinkProvider, Rectangle2D rectangle ) { int dpi = JRProperties.getIntegerProperty(JRRenderable.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 ); Graphics2D grx = bi.createGraphics(); grx.scale(scale, scale); List areaHyperlinks = null; if (chartHyperlinkProvider != null && chartHyperlinkProvider.hasHyperlinks()) { areaHyperlinks = ChartUtil.getImageAreaHyperlinks(chart, chartHyperlinkProvider, (Graphics2D)bi.getGraphics(), rectangle); } else { chart.draw(grx, rectangle); } try { return new JRSimpleImageMapRenderer(JRImageLoader.loadImageDataFromAWTImage(bi, JRRenderable.IMAGE_TYPE_PNG), areaHyperlinks); } catch (JRException e) { throw new JRRuntimeException(e); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/JRMeterInterval.java0000644000175000017500000001303311632162653030273 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRMeterInterval.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } /** * */ 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); } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/ChartHyperlinkProvider.java0000644000175000017500000000270211632162653031721 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: ChartHyperlinkProvider.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface ChartHyperlinkProvider extends Serializable { public JRPrintHyperlink getEntityHyperlink(ChartEntity entity); public boolean hasHyperlinks(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/CategoryLabelGenerator.java0000644000175000017500000000403311632162653031642 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 org.jfree.chart.labels.StandardCategoryItemLabelGenerator; import org.jfree.data.category.CategoryDataset; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: CategoryLabelGenerator.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 = labelsMap; } 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); } }jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/ChartRendererFactory.java0000644000175000017500000000321111632162653031333 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 net.sf.jasperreports.engine.JRRenderable; import net.sf.jasperreports.engine.util.JRProperties; import org.jfree.chart.JFreeChart; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: ChartRendererFactory.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface ChartRendererFactory { /** * */ public static final String PROPERTY_CHART_RENDERER_FACTORY_PREFIX = JRProperties.PROPERTY_PREFIX + "chart.renderer.factory."; public JRRenderable getRenderer( JFreeChart chart, ChartHyperlinkProvider chartHyperlinkProvider, Rectangle2D rectangle ); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/JRAxisFormat.java0000644000175000017500000001313611632162653027573 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRAxisFormat.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/PieLabelGenerator.java0000644000175000017500000000372711632162653030613 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: PieLabelGenerator.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } public String generateSectionLabel(PieDataset arg0, Comparable arg1) { return labels.get( arg1 ); } public AttributedString generateAttributedSectionLabel(PieDataset arg0, Comparable arg1) { return new AttributedString(generateSectionLabel(arg0, arg1));//FIXMECHART check this } }jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/util/TimePeriodDatasetLabelGenerator.java0000644000175000017500000000422711632162653033441 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 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) * @version $Id: TimePeriodDatasetLabelGenerator.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 = labelsMap; } 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 ); } }jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/JRTimeSeries.java0000644000175000017500000000355311632162653026614 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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 Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: JRTimeSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRTimeSeries extends JRCloneable { /** * */ public JRExpression getSeriesExpression(); /** * */ public JRExpression getTimePeriodExpression(); /** * */ public JRExpression getValueExpression(); /** * */ 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(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/0000755000175000017500000000000011654071732024710 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignTimeSeriesPlot.java0000644000175000017500000002505011632162653032052 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignTimeSeriesPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignPieDataset.java0000644000175000017500000002254111632162653031167 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.JRCloneable; 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) * @version $Id: JRDesignPieDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ public Float getMinPercentage() { return minPercentage; } /** * */ public void setMinPercentage(Float minPercentage) { Object old = this.minPercentage; this.minPercentage = minPercentage; getEventSupport().firePropertyChange(PROPERTY_MIN_PERCENTAGE, old, this.minPercentage); } /** * */ public Integer getMaxCount() { return maxCount; } /** * */ public void setMaxCount(Integer maxCount) { Object old = this.maxCount; this.maxCount = maxCount; getEventSupport().firePropertyChange(PROPERTY_MAX_COUNT, old, this.maxCount); } /** * */ 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); } /** * */ 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); } /** * */ 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); } /** * */ 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); } /** * */ public byte getDatasetType() { return JRChartDataset.PIE_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ 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; } } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignTimePeriodSeries.java0000644000175000017500000001042111632162653032352 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignTimePeriodSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ public Object clone() { JRDesignTimePeriodSeries clone = (JRDesignTimePeriodSeries)super.clone(); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignCategoryPlot.java0000644000175000017500000000521511640566635031566 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignLinePlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignBubblePlot.java0000644000175000017500000002374611632162653031206 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignBubblePlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/package.html0000644000175000017500000000042211614510764027166 0ustar drazzibdrazzib Contains design time implementations for chart related interfaces.

Related Documentation

jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignTimePeriodDataset.java0000644000175000017500000000763511632162653032522 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignTimePeriodDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 ); } /** * */ 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; } /** * */ public byte getDatasetType() { return JRChartDataset.TIMEPERIOD_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ public Object clone() { JRDesignTimePeriodDataset clone = (JRDesignTimePeriodDataset)super.clone(); clone.timePeriodSeriesList = JRCloneUtils.cloneList(timePeriodSeriesList); return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignScatterPlot.java0000644000175000017500000002374411632162653031416 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignScatterPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignThermometerPlot.java0000644000175000017500000001264611632162653032303 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignThermometerPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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"; /** * @deprecated No longer used. */ public static final String PROPERTY_SHOW_VALUE_LINES = "showValueLines"; 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); } /** * @deprecated No longer used. */ public void setShowValueLines(boolean showValueLines) { boolean old = this.showValueLines; this.showValueLines = showValueLines; getEventSupport().firePropertyChange(PROPERTY_SHOW_VALUE_LINES, old, this.showValueLines); } /** * 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); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignCategoryDataset.java0000644000175000017500000000744111632162653032231 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignCategoryDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ 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; } /** * */ public byte getDatasetType() { return JRChartDataset.CATEGORY_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ public Object clone() { JRDesignCategoryDataset clone = (JRDesignCategoryDataset)super.clone(); clone.categorySeriesList = JRCloneUtils.cloneList(categorySeriesList); return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignXySeries.java0000644000175000017500000000755011632162653030722 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignXySeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 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 Object clone() { JRDesignXySeries clone = (JRDesignXySeries)super.clone(); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignChartAxis.java0000644000175000017500000001146111632162653031031 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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.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) * @version $Id: JRDesignChartAxis.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ public Object clone() { JRDesignChartAxis clone = (JRDesignChartAxis)super.clone(); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignGanttSeries.java0000644000175000017500000001164611632162653031400 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignGanttSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ public Object clone() { JRDesignGanttSeries clone = (JRDesignGanttSeries)super.clone(); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignPieSeries.java0000644000175000017500000000703011632162653031030 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignPieSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ public Object clone() { JRDesignPieSeries clone = (JRDesignPieSeries)super.clone(); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignBarPlot.java0000644000175000017500000002511311640566635030514 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignBarPlot.java 4614 2011-09-18 09:21:57Z teodord $ */ 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); } /** * */ 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); } /** * */ 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 setItemLabel(JRItemLabel itemLabel) { Object old = this.itemLabel; this.itemLabel = itemLabel; getEventSupport().firePropertyChange(PROPERTY_ITEM_LABEL, old, this.itemLabel); } /** * */ 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()); } /** * */ 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()); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignTimeSeriesDataset.java0000644000175000017500000001003611632162653032517 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignTimeSeriesDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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 ); } /** * */ 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; } /** * */ public Class getTimePeriod() { return timePeriod; } /** * */ public void setTimePeriod( Class timePeriod ) { Object old = this.timePeriod; this.timePeriod = timePeriod; getEventSupport().firePropertyChange(PROPERTY_TIME_PERIOD, old, this.timePeriod); } /** * */ public byte getDatasetType() { return JRChartDataset.TIMESERIES_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ public Object clone() { JRDesignTimeSeriesDataset clone = (JRDesignTimeSeriesDataset)super.clone(); clone.timeSeriesList = JRCloneUtils.cloneList(timeSeriesList); return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignXyDataset.java0000644000175000017500000000674411632162653031061 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignXyDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ 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; } /** * */ public byte getDatasetType() { return JRChartDataset.XY_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ public Object clone() { JRDesignXyDataset clone = (JRDesignXyDataset)super.clone(); clone.xySeriesList = JRCloneUtils.cloneList(xySeriesList); return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignCandlestickPlot.java0000644000175000017500000002507011632162653032227 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignCandlestickPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignLinePlot.java0000644000175000017500000002437711640566635030712 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignLinePlot.java 4614 2011-09-18 09:21:57Z teodord $ */ 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); } /** * */ 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); } /** * */ 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 setCategoryAxisFormat(JRAxisFormat axisFormat) { setCategoryAxisLabelFont(axisFormat.getLabelFont()); setCategoryAxisLabelColor(axisFormat.getLabelColor()); setCategoryAxisTickLabelFont(axisFormat.getTickLabelFont()); setCategoryAxisTickLabelColor(axisFormat.getTickLabelColor()); setCategoryAxisTickLabelMask(axisFormat.getTickLabelMask()); setCategoryAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); setCategoryAxisLineColor(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()); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignValueDataset.java0000644000175000017500000001006511632162653031524 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignValueDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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; } } /** * */ 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 * JRChartDataset.VALUE_DATASET */ 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 */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ public Object clone() { JRDesignValueDataset clone = (JRDesignValueDataset)super.clone(); clone.valueExpression = JRCloneUtils.nullSafeClone(valueExpression); return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignValueDisplay.java0000644000175000017500000000736311632162653031553 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignValueDisplay.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ public Object clone() { JRDesignValueDisplay clone = (JRDesignValueDisplay)super.clone(); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignCategorySeries.java0000644000175000017500000000762611632162653032103 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignCategorySeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ public Object clone() { JRDesignCategorySeries clone = (JRDesignCategorySeries)super.clone(); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignMeterPlot.java0000644000175000017500000002016211632162653031054 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignMeterPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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_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. Must be one of * MeterShapeEnum.CHORD, MeterShapeEnum.CIRCLE, * MeterShapeEnum.PIE or MeterShapeEnum.DIAL. * * @param shape the shape of the meter * @throws JRException invalid shape was specified */ public void setShape(MeterShapeEnum shape) throws JRException { if (shape != null && (shape.getValue() < 0 || shape.getValue() > MeterShapeEnum.DIAL.getValue())) { throw new JRException("Unknown shape for MeterPlot"); } 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 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); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignGanttDataset.java0000644000175000017500000000654611632162653031536 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignGanttDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ 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; } /** * */ public byte getDatasetType() { return JRChartDataset.GANTT_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignTimeSeries.java0000644000175000017500000000736711632162653031226 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignTimeSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ public Object clone() { JRDesignTimeSeries clone = (JRDesignTimeSeries)super.clone(); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignPiePlot.java0000644000175000017500000000313611632162653030517 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignPiePlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRDesignPiePlot extends JRBasePiePlot { /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; /** * */ public JRDesignPiePlot(JRChartPlot piePlot, JRChart chart) { super(piePlot, chart); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignItemLabel.java0000644000175000017500000001023211632162653030774 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignItemLabel.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ public Object clone() { JRDesignItemLabel clone = (JRDesignItemLabel)super.clone(); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignBar3DPlot.java0000644000175000017500000002512211640566635030703 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignBar3DPlot.java 4614 2011-09-18 09:21:57Z teodord $ */ 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); } /** * */ 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); } /** * */ 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 setItemLabel( JRItemLabel itemLabel ){ JRItemLabel old = this.itemLabel; this.itemLabel = itemLabel; getEventSupport().firePropertyChange(PROPERTY_ITEM_LABEL, old, this.itemLabel); } /** * */ 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()); } /** * */ 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()); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignXyzSeries.java0000644000175000017500000000746611632162653031122 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignXyzSeries.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ public Object clone() { JRDesignXyzSeries clone = (JRDesignXyzSeries)super.clone(); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignHighLowDataset.java0000644000175000017500000001462211632162653032014 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignHighLowDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } 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); } 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); } 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); } 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); } 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); } 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); } 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); } /** * */ public byte getDatasetType() { return JRChartDataset.HIGHLOW_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } 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); } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ 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; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignPie3DPlot.java0000644000175000017500000000315411632162653030706 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignPie3DPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRDesignPie3DPlot extends JRBasePie3DPlot { /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; /** * */ public JRDesignPie3DPlot(JRChartPlot pie3DPlot, JRChart chart) { super(pie3DPlot, chart); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignAreaPlot.java0000644000175000017500000002450711640566635030666 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignAreaPlot.java 4614 2011-09-18 09:21:57Z teodord $ */ 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); } /** * */ 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); } /** * */ 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 setCategoryAxisFormat(JRAxisFormat axisFormat) { setCategoryAxisLabelFont(axisFormat.getLabelFont()); setCategoryAxisLabelColor(axisFormat.getLabelColor()); setCategoryAxisTickLabelFont(axisFormat.getTickLabelFont()); setCategoryAxisTickLabelColor(axisFormat.getTickLabelColor()); setCategoryAxisTickLabelMask(axisFormat.getTickLabelMask()); setCategoryAxisVerticalTickLabels(axisFormat.getVerticalTickLabels()); setCategoryAxisLineColor(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()); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignHighLowPlot.java0000644000175000017500000002504511632162653031346 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignHighLowPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ 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()); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignXyzDataset.java0000644000175000017500000000702511632162653031244 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignXyzDataset.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ 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; } /** * */ public byte getDatasetType() { return JRChartDataset.XYZ_DATASET; } /** * */ public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public void validate(JRVerifier verifier) { verifier.verify(this); } /** * */ public Object clone() { JRDesignXyzDataset clone = (JRDesignXyzDataset)super.clone(); clone.xyzSeriesList = JRCloneUtils.cloneList(xyzSeriesList); return clone; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignMultiAxisPlot.java0000644000175000017500000001050611632162653031720 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignMultiAxisPlot.java 4595 2011-09-08 15:55:10Z teodord $ */ public class JRDesignMultiAxisPlot extends JRBaseMultiAxisPlot { public static final String PROPERTY_CHART = "chart"; public static final String PROPERTY_AXES = "axes"; private JRDesignChart chart; /** * */ 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) { chart.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) { chart.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); chart.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()); } chart.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); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/charts/design/JRDesignDataRange.java0000644000175000017500000000663611632162653031001 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more 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) * @version $Id: JRDesignDataRange.java 4595 2011-09-08 15:55:10Z teodord $ */ 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); } /** * */ public Object clone() { JRDesignDataRange clone = (JRDesignDataRange)super.clone(); clone.eventSupport = null; return clone; } private transient JRPropertyChangeSupport eventSupport; public JRPropertyChangeSupport getEventSupport() { synchronized (this) { if (eventSupport == null) { eventSupport = new JRPropertyChangeSupport(this); } } return eventSupport; } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/crosstabs/0000755000175000017500000000000011654071732024156 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/crosstabs/JRCrosstabParameter.java0000644000175000017500000000340011632162655030674 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with JasperReports. If not, see . */ package net.sf.jasperreports.crosstabs; import net.sf.jasperreports.engine.JRDatasetParameter; import net.sf.jasperreports.engine.JRParameter; /** * Crosstab parameters interface. *

* Crosstab parameters are used to use external values inside a crosstab. *

* A parameter consists of a name and a value expression. The values can also * be set by using a {@link java.util.Map Map} object with name/value mappings. * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: JRCrosstabParameter.java 4595 2011-09-08 15:55:10Z teodord $ * @see net.sf.jasperreports.crosstabs.JRCrosstab#getParameters() * @see net.sf.jasperreports.crosstabs.JRCrosstab#getParametersMapExpression() */ public interface JRCrosstabParameter extends JRParameter, JRDatasetParameter { } jasperreports-4.1.3.orig/src/net/sf/jasperreports/crosstabs/JRCrosstabBucket.java0000644000175000017500000000670511632162655030204 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with JasperReports. If not, see . */ package net.sf.jasperreports.crosstabs; import net.sf.jasperreports.engine.JRCloneable; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.type.SortOrderEnum; /** * Crosstab groups bucketing information interface. *

* The bucketing information consists of the grouping expression * and sorting information. * The buckets can be sorted according to the natural sorting (if the values * implement {@link java.lang.Comparable Comparable}) or using a comparator. * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: JRCrosstabBucket.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRCrosstabBucket extends JRCloneable { /** * Returns the class of the bucket value. Any class is allowed as long as it is in the classpath at compile and run time. * @return a Class instance representing the bucket value class */ public Class getValueClass(); /** * Returns the string name of the bucket value class. */ public String getValueClassName(); /** * Returns the bucket sorting type. *

* The possible values are: *

    *
  • {@link SortOrderEnum#ASCENDING SortOrderEnum.ASCENDING}
  • *
  • {@link SortOrderEnum#DESCENDING SortOrderEnum.DESCENDING}
  • *
* * @return the bucket sorting type */ public SortOrderEnum getOrderValue(); /** * Returns the grouping expression. * * @return the grouping expression */ public JRExpression getExpression(); /** * Returns the comparator expression. *

* The result of this expression is used to sort the buckets, in ascending or * descending order (given by {@link #getOrderValue() getOrderValue()}. * If the bucket has an order by expression, the comparator will be used to * compare values as produced by that expression. * If no comparator expression is specified, the natural order will be used. *

* * @return the comparator expression * @see #getOrderByExpression() */ public JRExpression getComparatorExpression(); /** * Returns an expression that provides order by values for group buckets. * If not set, the bucket values as returned by {@link #getExpression()} * are used to order the buckets. * *

* The expression is evaluated in the context of the crosstab group and can * reference measure variables, which evaluate to group totals. *

* * @return the order by value expression for the group bucket */ public JRExpression getOrderByExpression(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/crosstabs/JRCrosstabRowGroup.java0000644000175000017500000000476611632162655030560 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with JasperReports. If not, see . */ package net.sf.jasperreports.crosstabs; import net.sf.jasperreports.crosstabs.type.CrosstabRowPositionEnum; /** * Crosstab row group interface. * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: JRCrosstabRowGroup.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRCrosstabRowGroup extends JRCrosstabGroup { /** * Returns the width of the group headers. * * @return the width of the group headers * @see JRCrosstabGroup#getHeader() * @see JRCrosstabGroup#getTotalHeader() */ public int getWidth(); /** * Returns the position of the header contents for header stretching. *

* The row group headers stretch vertically when there are multiple sub group entries. * The header contents will be adjusted to the new height depending on this attribute: *

    *
  • {@link CrosstabRowPositionEnum#TOP CrosstabRowPositionEnum.TOP} - the contents will be rendered at the top of of the header
  • *
  • {@link CrosstabRowPositionEnum#MIDDLE CrosstabRowPositionEnum.MIDDLE} - the contents will be rendered on the center of the header
  • *
  • {@link CrosstabRowPositionEnum#BOTTOM JCrosstabRowPositionEnum.BOTTOM} - the contents will be rendered at the bottom of the header
  • *
  • {@link CrosstabRowPositionEnum#STRETCH CrosstabRowPositionEnum.STRETCH} - the contents will be proportionally stretched to the new header size
  • *
* * @return the position of the header contents for header stretching */ public CrosstabRowPositionEnum getPositionValue(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/crosstabs/type/0000755000175000017500000000000011654071732025137 5ustar drazzibdrazzibjasperreports-4.1.3.orig/src/net/sf/jasperreports/crosstabs/type/CrosstabPercentageEnum.java0000644000175000017500000000502311632162655032406 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with JasperReports. If not, see . */ package net.sf.jasperreports.crosstabs.type; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: CrosstabPercentageEnum.java 4595 2011-09-08 15:55:10Z teodord $ */ public enum CrosstabPercentageEnum implements JREnum { /** * Percentage type indicating that the value will not be calculated * as a percentage. */ NONE((byte)0, "None"), /** * Percentage type indicating that the value will be calculated as percentage * of the grand total value. */ GRAND_TOTAL((byte)1, "GrandTotal"); /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient byte value; private final transient String name; private CrosstabPercentageEnum(byte value, String name) { this.value = value; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(value); } /** * */ public final byte getValue() { return value; } /** * */ public String getName() { return name; } /** * */ public static CrosstabPercentageEnum getByName(String name) { return (CrosstabPercentageEnum)EnumUtil.getByName(values(), name); } /** * */ public static CrosstabPercentageEnum getByValue(Byte value) { return (CrosstabPercentageEnum)EnumUtil.getByValue(values(), value); } /** * */ public static CrosstabPercentageEnum getByValue(byte value) { return getByValue(new Byte(value)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/crosstabs/type/CrosstabColumnPositionEnum.java0000644000175000017500000000545611632162655033325 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with JasperReports. If not, see . */ package net.sf.jasperreports.crosstabs.type; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: CrosstabColumnPositionEnum.java 4595 2011-09-08 15:55:10Z teodord $ */ public enum CrosstabColumnPositionEnum implements JREnum { /** * Horizontal stretch position indicating that the contents will be rendered on the left side. */ LEFT((byte)1, "Left"), /** * Horizontal stretch position indicating that the contents will be rendered on the center. */ CENTER((byte)2, "Center"), /** * Horizontal stretch position indicating that the contents will be rendered on the right side. */ RIGHT((byte)3, "Right"), /** * Horizontal stretch position indicating that the contents will be horizontally stretched. */ STRETCH((byte)4 ,"Stretch"); /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient byte value; private final transient String name; private CrosstabColumnPositionEnum(byte value, String name) { this.value = value; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(value); } /** * */ public final byte getValue() { return value; } /** * */ public String getName() { return name; } /** * */ public static CrosstabColumnPositionEnum getByName(String name) { return (CrosstabColumnPositionEnum)EnumUtil.getByName(values(), name); } /** * */ public static CrosstabColumnPositionEnum getByValue(Byte value) { return (CrosstabColumnPositionEnum)EnumUtil.getByValue(values(), value); } /** * */ public static CrosstabColumnPositionEnum getByValue(byte value) { return getByValue(new Byte(value)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/crosstabs/type/CrosstabRowPositionEnum.java0000644000175000017500000000541311632162655032630 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with JasperReports. If not, see . */ package net.sf.jasperreports.crosstabs.type; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: CrosstabRowPositionEnum.java 4595 2011-09-08 15:55:10Z teodord $ */ public enum CrosstabRowPositionEnum implements JREnum { /** * Vertical stretch position indicating that the contents will be rendered on the top. */ TOP((byte)1, "Top"), /** * Vertical stretch position indicating that the contents will be rendered on the middle. */ MIDDLE((byte)2, "Middle"), /** * Vertical stretch position indicating that the contents will be rendered on the bottom. */ BOTTOM((byte)3, "Bottom"), /** * Vertical stretch position indicating that the contents will be rendered vertically stretched. */ STRETCH((byte)4, "Stretch"); /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient byte value; private final transient String name; private CrosstabRowPositionEnum(byte value, String name) { this.value = value; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(value); } /** * */ public final byte getValue() { return value; } /** * */ public String getName() { return name; } /** * */ public static CrosstabRowPositionEnum getByName(String name) { return (CrosstabRowPositionEnum)EnumUtil.getByName(values(), name); } /** * */ public static CrosstabRowPositionEnum getByValue(Byte value) { return (CrosstabRowPositionEnum)EnumUtil.getByValue(values(), value); } /** * */ public static CrosstabRowPositionEnum getByValue(byte value) { return getByValue(new Byte(value)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/crosstabs/type/CrosstabTotalPositionEnum.java0000644000175000017500000000515711632162655033151 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with JasperReports. If not, see . */ package net.sf.jasperreports.crosstabs.type; import net.sf.jasperreports.engine.JRConstants; import net.sf.jasperreports.engine.type.EnumUtil; import net.sf.jasperreports.engine.type.JREnum; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: CrosstabTotalPositionEnum.java 4595 2011-09-08 15:55:10Z teodord $ */ public enum CrosstabTotalPositionEnum implements JREnum { /** * Constant indicating that total are not required for this bucket. */ NONE((byte)0, "None"), /** * Constants indicating that totals are to be positioned before the other buckets. */ START((byte)1, "Start"), /** * Constants indicating that totals are to be positioned at the end of the other buckets. */ END((byte)2, "End"); /** * */ private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; private final transient byte value; private final transient String name; private CrosstabTotalPositionEnum(byte value, String name) { this.value = value; this.name = name; } /** * */ public Byte getValueByte() { return new Byte(value); } /** * */ public final byte getValue() { return value; } /** * */ public String getName() { return name; } /** * */ public static CrosstabTotalPositionEnum getByName(String name) { return (CrosstabTotalPositionEnum)EnumUtil.getByName(values(), name); } /** * */ public static CrosstabTotalPositionEnum getByValue(Byte value) { return (CrosstabTotalPositionEnum)EnumUtil.getByValue(values(), value); } /** * */ public static CrosstabTotalPositionEnum getByValue(byte value) { return getByValue(new Byte(value)); } } jasperreports-4.1.3.orig/src/net/sf/jasperreports/crosstabs/JRCrosstabMeasure.java0000644000175000017500000001170211632162655030361 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with JasperReports. If not, see . */ package net.sf.jasperreports.crosstabs; import net.sf.jasperreports.crosstabs.type.CrosstabPercentageEnum; import net.sf.jasperreports.engine.JRCloneable; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JRVariable; import net.sf.jasperreports.engine.type.CalculationEnum; /** * Crosstab measure interface. *

* A measure is a value that is accumulated by the crosstab and is displayed * in the crosstab cells. * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: JRCrosstabMeasure.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRCrosstabMeasure extends JRCloneable { /** * Returns the name of the measure. * * @return the name of the measure * @see #getVariable() */ public String getName(); /** * Returns the name of the value class for this measure. * * @return the name of the value class for this measure */ public String getValueClassName(); /** * Returns the value class of this measure. * * @return the value class of this measure */ public Class getValueClass(); /** * Returns the measure expression. * * @return the measure expression */ public JRExpression getValueExpression(); /** * Returns the calculation type which will be performed on the measure values. *

* The incrementer factory associated with this measure will create * an incrementer which will sum the measure values. *

* The possible calculation type are the same as the ones used for variables * (see {@link JRVariable#getCalculationValue() JRVariable.getCalculationValue()} with * the exception of {@link CalculationEnum#SYSTEM CalculationEnum.SYSTEM}. * * @return the calculation type which will be performed on the measure values * @see #getIncrementerFactoryClassName() * @see net.sf.jasperreports.engine.fill.JRExtendedIncrementerFactory * @see net.sf.jasperreports.engine.fill.JRExtendedIncrementer */ public CalculationEnum getCalculationValue(); /** * Returns the incrementer factory class name. *

* Crosstab measures require extended incrementers, therefore * the incrementer class should implement * {@link net.sf.jasperreports.engine.fill.JRExtendedIncrementerFactory JRExtendedIncrementerFactory}. * * @return the incrementer factory class name */ public String getIncrementerFactoryClassName(); /** * Returns the incrementer factory class. * * @return the incrementer factory class * @see #getIncrementerFactoryClassName() */ public Class getIncrementerFactoryClass(); /** * Returns the percentage calculation type performed on this measure. *

* Currently, only percentage out of grand total is supported. *

* The possible values are: *

    *
  • {@link CrosstabPercentageEnum#NONE CrosstabPercentageEnum.NONE}
  • *
  • {@link CrosstabPercentageEnum#GRAND_TOTAL CrosstabPercentageEnum.GRAND_TOTAL}
  • *
*

* If percentage calculation is required, the value class should be one of the built-in supported * percentage types or the percentage calculator class should be specified. * * @return the percentage calculation type * @see net.sf.jasperreports.crosstabs.fill.JRPercentageCalculatorFactory#hasBuiltInCalculator(Class) * @see #getPercentageCalculatorClassName() */ public CrosstabPercentageEnum getPercentageType(); /** * Returns the percentage calculator class name. * * @return the percentage calculator class name */ public String getPercentageCalculatorClassName(); /** * Returns the percentage calculator class. * * @return the percentage calculator class */ public Class getPercentageCalculatorClass(); /** * Returns the variable associated with this measure. *

* The variable can be used inside the crosstab data cells as the * measure value. The variable has the same name and value class as * the measure. * * @return the variable associated with this measure */ public JRVariable getVariable(); } jasperreports-4.1.3.orig/src/net/sf/jasperreports/crosstabs/JRCrosstabGroup.java0000644000175000017500000001147311632162655030061 0ustar drazzibdrazzib/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with JasperReports. If not, see . */ package net.sf.jasperreports.crosstabs; import net.sf.jasperreports.crosstabs.type.CrosstabTotalPositionEnum; import net.sf.jasperreports.engine.JRCloneable; import net.sf.jasperreports.engine.JRVariable; /** * Base interface for crosstab row and column groups. * * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: JRCrosstabGroup.java 4595 2011-09-08 15:55:10Z teodord $ */ public interface JRCrosstabGroup extends JRCloneable { /** * Returns the name of the group. * * @return the name of the group * @see #getVariable() */ public String getName(); /** * Returns the position of the total row/column for this group. *

* A group can have a total row/column summing the values for all the * entries in the group. E.g. if there is a Year group having Month as * a subgroup, the total row/column for the Year group would sum the values * for all the years and the total row/column for the Month group would sum * the values for all the months of an year. *

* Possible values for this attribute are: *