📄 reportconfiguration.java
字号:
* Returns <code>true</code> if logging is disabled, and <code>false</code> otherwise.
*
* @return true, if logging is completly disabled, false otherwise.
*/
public boolean isDisableLogging()
{
return getConfigProperty
(DISABLE_LOGGING, DISABLE_LOGGING_DEFAULT).equalsIgnoreCase("true");
}
/**
* Sets the flag that disables logging.
* <p>
* To switch off logging globally, you can use the following code:
* <p>
* <code>ReportConfiguration.getGlobalConfig().setDisableLogging(true);</code>
*
* @param disableLogging the flag.
*/
public void setDisableLogging(final boolean disableLogging)
{
setConfigProperty(DISABLE_LOGGING, String.valueOf(disableLogging));
}
/**
* Returns the PDF encoding property value.
*
* @return the PDF encoding property value.
*/
public String getPdfTargetEncoding()
{
return getConfigProperty(PDFTARGET_ENCODING, PDFTARGET_ENCODING_DEFAULT);
}
/**
* Sets the PDF encoding property value.
*
* @param pdfTargetEncoding the new encoding.
*/
public void setPdfTargetEncoding(final String pdfTargetEncoding)
{
setConfigProperty(PDFTARGET_ENCODING, pdfTargetEncoding);
}
/**
* Returns the collection of properties for the configuration.
*
* @return the properties.
*/
protected Properties getConfiguration()
{
return configuration;
}
/**
* Returns the global configuration for JFreeReport.
* <p>
* In the current implementation, the configuration has no properties defined,
* but references a parent configuration that:
* <ul>
* <li>copies across all the <code>System</code> properties to use as report
* configuration properties (obviously the majority of them will not apply to reports);</li>
* <li>itself references a parent configuration that reads its properties from a file
* <code>jfreereport.properties</code>.
* </ul>
*
* @return the global configuration.
*/
public static synchronized ReportConfiguration getGlobalConfig()
{
if (globalConfig == null)
{
globalConfig = new ReportConfiguration();
final PropertyFileReportConfiguration rootProperty = new PropertyFileReportConfiguration();
rootProperty.load("/com/jrefinery/report/jfreereport.properties");
globalConfig.insertConfiguration(rootProperty);
final PropertyFileReportConfiguration baseProperty = new PropertyFileReportConfiguration();
baseProperty.load("/jfreereport.properties");
globalConfig.insertConfiguration(baseProperty);
final SystemPropertyConfiguration systemConfig = new SystemPropertyConfiguration();
globalConfig.insertConfiguration(systemConfig);
// todo; loadExtensions ();
// rootProperty.insertConfiguration();
}
return globalConfig;
}
/**
* The new configuartion will be inserted into the list of report configuration,
* so that this configuration has the given report configuration instance as parent.
*
* @param config the new report configuration.
*/
protected void insertConfiguration(final ReportConfiguration config)
{
config.setParentConfig(getParentConfig());
setParentConfig(config);
}
/**
* Set the parent configuration. The parent configuration is queried, if the
* requested configuration values was not found in this report configuration.
*
* @param config the parent configuration.
*/
protected void setParentConfig(final ReportConfiguration config)
{
if (parentConfiguration == this)
{
throw new IllegalArgumentException("Cannot add myself as parent configuration.");
}
parentConfiguration = config;
}
/**
* Returns the parent configuration. The parent configuration is queried, if the
* requested configuration values was not found in this report configuration.
*
* @return the parent configuration.
*/
protected ReportConfiguration getParentConfig()
{
return parentConfiguration;
}
/**
* Returns the current log target.
*
* @return the log target.
*/
public String getLogTarget()
{
return getConfigProperty(LOGTARGET, LOGTARGET_DEFAULT);
}
/**
* Sets the log target.
*
* @param logTarget the new log target.
*/
public void setLogTarget(final String logTarget)
{
setConfigProperty(LOGTARGET, logTarget);
}
/**
* Returns true, if invalid columns in the dataRow are logged as warning.
*
* @return true, if invalid columns in the dataRow are logged as warning.
*/
public boolean isWarnInvalidColumns()
{
return getConfigProperty(WARN_INVALID_COLUMNS,
WARN_INVALID_COLUMNS_DEFAULT).equalsIgnoreCase("true");
}
/**
* Set to true, if you want to get informed when invalid column-requests are
* made to the DataRow.
*
* @param warnInvalidColumns the warning flag
*/
public void setWarnInvalidColumns(final boolean warnInvalidColumns)
{
setConfigProperty(WARN_INVALID_COLUMNS, String.valueOf(warnInvalidColumns));
}
/**
* Returns true, if physical operation comments should be added to the physical page.
* This is only usefull for debugging.
*
* @return true, if comments are enabled.
*/
public boolean isPrintOperationComment()
{
return getConfigProperty(PRINT_OPERATION_COMMENT,
PRINT_OPERATION_COMMENT_DEFAULT).equalsIgnoreCase("true");
}
/**
* set to true, if physical operation comments should be added to the physical page.
* This is only usefull for debugging.
*
* @param print set to true, if comments should be enabled.
*/
public void setPrintOperationComment(final boolean print)
{
setConfigProperty(PRINT_OPERATION_COMMENT, String.valueOf(print));
}
/**
* Returns true, if the Graphics2D should use aliasing to render text. Defaults to false.
*
* @return true, if aliasing is enabled.
*/
public boolean isG2TargetUseAliasing()
{
return getConfigProperty(G2TARGET_USEALIASING,
G2TARGET_USEALIASING_DEFAULT).equalsIgnoreCase("true");
}
/**
* set to true, if the Graphics2D should use aliasing to render text. Defaults to false.
*
* @param alias set to true, if the Graphics2D should use aliasing.
*/
public void setG2TargetUseAliasing(final boolean alias)
{
setConfigProperty(G2TARGET_USEALIASING, String.valueOf(alias));
}
/**
* Returns true, if the Graphics2D should use aliasing to render text. Defaults to false.
*
* @return true, if aliasing is enabled.
*/
public boolean isPDFTargetEmbedFonts()
{
return getConfigProperty(PDFTARGET_EMBED_FONTS,
PDFTARGET_EMBED_FONTS_DEFAULT).equalsIgnoreCase("true");
}
/**
* set to true, if the PDFOutputTarget should embed all fonts.
*
* @param embed set to true, if the PDFOutputTarget should use embedded fonts.
*/
public void setPDFTargetEmbedFonts(final boolean embed)
{
setConfigProperty(PDFTARGET_EMBED_FONTS, String.valueOf(embed));
}
/**
* Returns true, if the Graphics2D implementation is buggy and is not really able
* to place/calculate the fontsizes correctly. Defaults to false. (SunJDK on Windows
* is detected and corrected, Linux SunJDK 1.3 is buggy, but not detectable).
*
* @return true, if the Graphics2D implementation does not calculate the string
* positions correctly and an alternative implementation should be used.
*/
public boolean isG2BuggyFRC()
{
return getConfigProperty(G2TARGET_ISBUGGY_FRC,
G2TARGET_ISBUGGY_FRC_DEFAULT).equalsIgnoreCase("true");
}
/**
* set to true, if the Graphics2D implementation is buggy and is not really able
* to place/calculate the fontsizes correctly. Defaults to false. (SunJDK on Windows
* is detected and corrected, Linux SunJDK 1.3 is buggy, but not detectable).
*
* @param buggy set to true, if the Graphics2D implementation does not calculate the string
* positions correctly and an alternative implementation should be used.
*/
public void setG2BuggyFRC(final boolean buggy)
{
setConfigProperty(G2TARGET_ISBUGGY_FRC, String.valueOf(buggy));
}
/**
* Returns all defined configuration properties for the report. The enumeration
* contains all keys of the changed properties, properties set from files or
* the system properties are not included.
*
* @return all defined configuration properties for the report.
*/
public Enumeration getConfigProperties()
{
return configuration.keys();
}
/**
* Set to false, to globaly disable the xml-validation.
*
* @param validate true, if the parser should validate the xml files.
*/
public void setValidateXML(final boolean validate)
{
setConfigProperty(PARSER_VALIDATE, String.valueOf(validate));
}
/**
* returns true, if the parser should validate the xml files against the DTD
* supplied with JFreeReport.
*
* @return true, if the parser should validate, false otherwise.
*/
public boolean isValidateXML()
{
return getConfigProperty(PARSER_VALIDATE, PARSER_VALIDATE_DEFAULT).equalsIgnoreCase("true");
}
/**
* returns true, if the TableWriter should perform a stricter layout translation.
* When set to true, all element bounds are used to create the table. This could result
* in a complex layout, more suitable for printing. If set to false, only the starting
* bounds (the left and the upper border) are used to create the layout. This will result
* is lesser cells and rows, the layout will be better suitable for later processing.
*
* @return true, if strict layouting rules should be applied, false otherwise.
*/
public boolean isStrictTableLayout()
{
return getConfigProperty(STRICT_TABLE_LAYOUT,
STRICT_TABLE_LAYOUT_DEFAULT).equalsIgnoreCase("true");
}
/**
* Defines whether strict layouting rules should be used for the TableLayouter.
*
* @param strict set to true, to use strict layouting rules, false otherwise.
*
* @see ReportConfiguration#isStrictTableLayout
*/
public void setStrictTableLayout(final boolean strict)
{
setConfigProperty(STRICT_TABLE_LAYOUT, String.valueOf(strict));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -