Java Doc for Element.java in  » Report » pentaho-report » org » jfree » report » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Report » pentaho report » org.jfree.report 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jfree.report.Element

All known Subclasses:   org.jfree.report.TextElement,  org.jfree.report.DrawableElement,  org.jfree.report.Band,  org.jfree.report.ShapeElement,  org.jfree.report.AnchorElement,  org.jfree.report.ImageElement,
Element
public class Element implements DataTarget(Code)
Base class for all report elements (displays items that can appear within a report band).

Elements can either be Bands (which are container classes that group elements) or content-elements. Content elements produce printable values when the org.jfree.report.Element.getValue(org.jfree.report.function.ExpressionRuntime) method is called.

All elements have a non-null name and have a private style sheet defined. The style sheet is used to store and access all element properties that can be used to control the layout of the element or affect the elements appeareance in the generated content.

Elements can inherit all style information from its parent. A style value is inherited whenever the element's stylesheet does not define an own value for the corresponding key. Some style-keys cannot be inherited at all, in that case the default-style-sheets value is used as fall-back value. In addition to the bands stylesheet, elements may also inherit from stylesheets assigned to the current report definition's StyleSheetCollection. Foreign stylesheet will be lost after the local cloning is complete.

Use the following code to create and assign a global stylesheet to an element:

 JFreeReport report = .. // created elsewhere
 ElementStyleSheet globalStyle =
 report.getStyleSheetCollection().createStyleSheet ("a name for the global
 style");
 

Element element = .. // created elsewhere element.getStyleSheet().addParent(globalStyle); report.getItemBand().addElement (element);

Global stylesheets will always be queried before the parent's stylesheet gets queried. The order of the add-operation does matter, StyleSheets which are added last will be preferred over previously added stylesheets.
author:
   David Gilbert
author:
   Thomas Morgner



Field Summary
final public static  StringANONYMOUS_ELEMENT_PREFIX
     The internal constant to mark anonymous element names.

Constructor Summary
public  Element()
     Constructs an element.

The element inherits the element's defined default ElementStyleSheet to provide reasonable default values for common stylekeys.


Method Summary
public  Objectclone()
     Clones this Element, the datasource and the private stylesheet of this Element.
protected  ElementDefaultStyleSheetcreateGlobalDefaultStyle()
     Creates the global stylesheet for this element type.
public  StringgetContentType()
     Defines the content-type for this Element.
final public  DataSourcegetDataSource()
     Returns the datasource for this Element.
public  StringgetHRefTarget()
     Returns the currently set link target for this element.
public  Dimension2DgetMaximumSize()
     Returns the maximum size of this Element, if defined.
public  Dimension2DgetMinimumSize()
     Returns the minimum size of this Element, if defined.
public  StringgetName()
     Returns the name of the Element.
final public  ObjectgetObjectID()
     Returns a unique identifier for the given instance.
final public  BandgetParent()
     Return the parent of the Element.
public  Dimension2DgetPreferredSize()
     Returns the preferred size of this Element, if defined.
public  ReportDefinitiongetReportDefinition()
     Returns the currently assigned report definition.
public  ElementStyleSheetgetStyle()
     Returns this elements private stylesheet.
public  ExpressiongetStyleExpression(StyleKey property)
     Returns the expressions for the report.
Parameters:
  property - the stylekey for which an style-expression is returned.
public  MapgetStyleExpressions()
     Returns a map of all style expressions attached to this element.
final public  ObjectgetTreeLock()
     Returns the tree lock object for the self tree.
public  ObjectgetValue(ExpressionRuntime runtime)
     Queries this Element's datasource for a value.
Parameters:
  runtime - the expression runtime for evaluating inline expression.
public  booleanisDynamicContent()
     Checks, whether the layout of this element is dynamic and adjusts to the element's printable content.
public  booleanisLayoutCacheable()
     Returns whether the layout of this Element is cacheable.
public  booleanisVisible()
     Defines whether this Element should be painted.
public  voidsetDataSource(DataSource ds)
     Sets the data source for this Element.
public  voidsetDynamicContent(boolean dynamicContent)
     Defines the stylesheet property for the dynamic attribute.
public  voidsetHRefTarget(String target)
     Redefines the link target for this element.
public  voidsetLayoutCacheable(boolean layoutCacheable)
     Defines whether the layout of this Element can be cached.
public  voidsetMaximumSize(Dimension2D maximumSize)
     Defines the stylesheet property for the maximum Element size.
public  voidsetMinimumSize(Dimension2D minimumSize)
     Defines the stylesheet property for the minimum Element size.
public  voidsetName(String name)
     Defines the name for this Element.
final protected  voidsetParent(Band parent)
     Defines the parent of the Element.
public  voidsetPreferredSize(Dimension2D preferredSize)
     Defines the stylesheet property for the preferred Element size.
protected  voidsetReportDefinition(ReportDefinition reportDefinition)
     Assigns the given report definition to the Element.
public  voidsetStyleExpression(StyleKey property, Expression function)
     Adds a function to the report's collection of expressions.
public  voidsetVisible(boolean b)
     Defines, whether this Element should be visible in the output.

Field Detail
ANONYMOUS_ELEMENT_PREFIX
final public static String ANONYMOUS_ELEMENT_PREFIX(Code)
The internal constant to mark anonymous element names.




Constructor Detail
Element
public Element()(Code)
Constructs an element.

The element inherits the element's defined default ElementStyleSheet to provide reasonable default values for common stylekeys. When the element is added to the band, the bands stylesheet is set as parent to the element's stylesheet.

A datasource is assigned with this element is set to a default source, which always returns null.





Method Detail
clone
public Object clone() throws CloneNotSupportedException(Code)
Clones this Element, the datasource and the private stylesheet of this Element. The clone does no longer have a parent, as the old parent would not recognize that new object anymore. a clone of this Element.
throws:
  CloneNotSupportedException - should never happen.



createGlobalDefaultStyle
protected ElementDefaultStyleSheet createGlobalDefaultStyle()(Code)
Creates the global stylesheet for this element type. The global stylesheet is an immutable stylesheet that provides reasonable default values for some of the style keys.

The global default stylesheet is always the last stylesheet that will be queried for values. the global stylesheet.




getContentType
public String getContentType()(Code)
Defines the content-type for this Element. The content-type is used as a hint, how to process the contents of this Element. An Element implementation should restrict itself to the content-type set here, or the report processing may fail or the Element may not be printed.

An Element is not allowed to change its content-type after the report processing has started.

If an content-type is unknown to the output-target, the processor must ignore the content. the content-type as string.




getDataSource
final public DataSource getDataSource()(Code)
Returns the datasource for this Element. You cannot override this function as the Element needs always to be the last consumer in the chain of filters. This function must never return null. the assigned datasource.



getHRefTarget
public String getHRefTarget()(Code)
Returns the currently set link target for this element. the link target.



getMaximumSize
public Dimension2D getMaximumSize()(Code)
Returns the maximum size of this Element, if defined. the maximum size



getMinimumSize
public Dimension2D getMinimumSize()(Code)
Returns the minimum size of this Element, if defined. the minimum size



getName
public String getName()(Code)
Returns the name of the Element. The name of the Element is never null. the name.



getObjectID
final public Object getObjectID()(Code)
Returns a unique identifier for the given instance. The identifier can be used to recognize cloned instance which have the same anchestor. The identifier is unique as long as the element remains in the JVM, it does not guarantee uniqueness or the ability to recognize clones, after the element has been serialized. the object identifier.



getParent
final public Band getParent()(Code)
Return the parent of the Element. You can use this to explore the component tree. the parent of the self.



getPreferredSize
public Dimension2D getPreferredSize()(Code)
Returns the preferred size of this Element, if defined. the preferred size



getReportDefinition
public ReportDefinition getReportDefinition()(Code)
Returns the currently assigned report definition. the report definition or null, if no report has been assigned.



getStyle
public ElementStyleSheet getStyle()(Code)
Returns this elements private stylesheet. This sheet can be used to override the default values set in one of the parent-stylesheets. the Element's stylesheet



getStyleExpression
public Expression getStyleExpression(StyleKey property)(Code)
Returns the expressions for the report.
Parameters:
  property - the stylekey for which an style-expression is returned. the expressions.



getStyleExpressions
public Map getStyleExpressions()(Code)
Returns a map of all style expressions attached to this element. The map is keyed by an StyleKey and contains Expression instances. the expression.



getTreeLock
final public Object getTreeLock()(Code)
Returns the tree lock object for the self tree. If the element is part of a content hierarchy, the parent's tree lock is returned. the treelock object.



getValue
public Object getValue(ExpressionRuntime runtime)(Code)
Queries this Element's datasource for a value.
Parameters:
  runtime - the expression runtime for evaluating inline expression. the value of the datasource, which can be null.



isDynamicContent
public boolean isDynamicContent()(Code)
Checks, whether the layout of this element is dynamic and adjusts to the element's printable content. If set to false, the element's minimum-size will be also used as maximum size. true, if the Element's layout is dynamic, false otherwise.



isLayoutCacheable
public boolean isLayoutCacheable()(Code)
Returns whether the layout of this Element is cacheable. No matter what's defined here, dynamic elements cannot be cachable at all. returns always false, as this property is no longer used.



isVisible
public boolean isVisible()(Code)
Defines whether this Element should be painted. The detailed implementation is up to the outputtarget. the current visiblity state.



setDataSource
public void setDataSource(DataSource ds)(Code)
Sets the data source for this Element. The data source is used to produce or query the element's display value.
Parameters:
  ds - the datasource (null not permitted).
throws:
  NullPointerException - if the given data source is null.



setDynamicContent
public void setDynamicContent(boolean dynamicContent)(Code)
Defines the stylesheet property for the dynamic attribute. Calling this function with either parameter will override any previously defined value for the dynamic attribute. The value can no longer be inherited from parent stylesheets.
Parameters:
  dynamicContent - the new state of the dynamic flag.



setHRefTarget
public void setHRefTarget(String target)(Code)
Redefines the link target for this element.
Parameters:
  target - the target



setLayoutCacheable
public void setLayoutCacheable(boolean layoutCacheable)(Code)
Defines whether the layout of this Element can be cached.

This method has no effect.
Parameters:
  layoutCacheable - true, if the layout is cacheable, false otherwise.




setMaximumSize
public void setMaximumSize(Dimension2D maximumSize)(Code)
Defines the stylesheet property for the maximum Element size.
Parameters:
  maximumSize - the new maximum size or null, if the value should be inherited.



setMinimumSize
public void setMinimumSize(Dimension2D minimumSize)(Code)
Defines the stylesheet property for the minimum Element size.
Parameters:
  minimumSize - the new minimum size or null, if the value should be inherited.



setName
public void setName(String name)(Code)
Defines the name for this Element. The name must not be empty, or a NullPointerException is thrown.

Names can be used to lookup an element within a band. There is no requirement for element names to be unique.
Parameters:
  name - the name of this self (null not permitted)
throws:
  NullPointerException - if the given name is null.




setParent
final protected void setParent(Band parent)(Code)
Defines the parent of the Element. Only a band should call this method.
Parameters:
  parent - (null allowed).



setPreferredSize
public void setPreferredSize(Dimension2D preferredSize)(Code)
Defines the stylesheet property for the preferred Element size.
Parameters:
  preferredSize - the new preferred size or null, if the value is not defined.



setReportDefinition
protected void setReportDefinition(ReportDefinition reportDefinition)(Code)
Assigns the given report definition to the Element. If the reportdefinition is null, the Element is not part of a report definition at all.
Parameters:
  reportDefinition - the report definition (maybe null).



setStyleExpression
public void setStyleExpression(StyleKey property, Expression function)(Code)
Adds a function to the report's collection of expressions.
Parameters:
  property - the stylekey that will be modified by this element.
Parameters:
  function - the function.



setVisible
public void setVisible(boolean b)(Code)
Defines, whether this Element should be visible in the output. The interpretation of this flag is up to the content processor.
Parameters:
  b - the new visibility state



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.