|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.report.Element
Base class for all report elements (display items that can appear within a report band).
All elements have a non-null name and have a style sheet defined. The style sheet is used to store and access all element properties that can be used to layout the element or affect the elements appeareance in a ReportProcessor.
Field Summary | |
static java.lang.String |
ANONYMOUS_ELEMENT_PREFIX
The internal constant to mark anonymous element names. |
Constructor Summary | |
protected |
Element()
Constructs an element. |
Method Summary | |
java.lang.Object |
clone()
Clones this Element, the datasource and the private stylesheet of this element. |
abstract java.lang.String |
getContentType()
Defines the content-type for this element. |
DataSource |
getDataSource()
Returns the datasource for this element. |
java.awt.geom.Dimension2D |
getMaximumSize()
Returns the maximum size of this element, if defined. |
java.awt.geom.Dimension2D |
getMinimumSize()
Returns the minimum size of this element, if defined. |
java.lang.String |
getName()
Returns the name of the element. |
Band |
getParent()
Return the parent of the element. |
java.awt.geom.Dimension2D |
getPreferredSize()
Returns the preferred size of this element, if defined. |
ElementStyleSheet |
getStyle()
Returns this elements private stylesheet. |
StyleSheetCollection |
getStyleSheetCollection()
Returns the stylesheet collection which is assigned with this element and all stylesheets of this element. |
java.lang.Object |
getTreeLock()
Returns the tree lock object for the element tree. |
java.lang.Object |
getValue()
Queries this element's datasource for a value. |
protected void |
handleRegisterStyleSheetCollection()
Handles the registration of the stylesheet collection. |
protected void |
handleUnregisterStyleSheetCollection()
Handles the unregistration of the stylesheet collection. |
boolean |
isDynamicContent()
Checks, whether the layout manager should compute the size of this element based on the current content. |
boolean |
isLayoutCacheable()
Returns whether the layout of this element is cacheable. |
boolean |
isVisible()
Defines whether this element should be painted. |
void |
registerStyleSheetCollection(StyleSheetCollection styleSheetCollection)
Registers the given StyleSheet collection with this element. |
void |
setDataSource(DataSource ds)
Sets the data source for this element. |
void |
setDynamicContent(boolean dynamicContent)
Defines the stylesheet property for the dynamic attribute. |
void |
setLayoutCacheable(boolean layoutCacheable)
Defines whether the layout of this element can be cached. |
void |
setMaximumSize(java.awt.geom.Dimension2D maximumSize)
Defines the stylesheet property for the maximum element size. |
void |
setMinimumSize(java.awt.geom.Dimension2D minimumSize)
Defines the stylesheet property for the minimum element size. |
void |
setName(java.lang.String name)
Defines the name for this element. |
protected void |
setParent(Band parent)
defines the parent of the element. |
void |
setPreferredSize(java.awt.geom.Dimension2D preferredSize)
Defines the stylesheet property for the preferred element size. |
void |
setVisible(boolean b)
Defines, whether this element should be drawn. |
void |
unregisterStyleSheetCollection(StyleSheetCollection styleSheetCollection)
Unregisters the given stylesheet collection from this element. |
void |
updateStyleSheetCollection(StyleSheetCollection sc)
Updates the stylesheet collection for this element and all substylesheets. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String ANONYMOUS_ELEMENT_PREFIX
Constructor Detail |
protected Element()
The element inherits the DefaultElementStyleSheet. When the element is added to the band, the bands default stylesheet is also added to the elements style.
A datasource is assigned with this element is set to a default source, which always returns null.
Method Detail |
public final Band getParent()
protected final void setParent(Band parent)
parent
- (null allowed).public void setName(java.lang.String name)
name
- the name of this element (null not permitted)public java.lang.String getName()
public final DataSource getDataSource()
getDataSource
in interface DataTarget
public void setDataSource(DataSource ds)
setDataSource
in interface DataTarget
ds
- the datasource (null
not permitted).public java.lang.Object getValue()
public boolean isVisible()
public void setVisible(boolean b)
b
- the new visibility statepublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface DataTarget
java.lang.CloneNotSupportedException
- should never happen.public ElementStyleSheet getStyle()
public abstract java.lang.String getContentType()
An element is not allowed to change its content-type after ther report processing has started.
If an content-type is unknown to the output-target, the processor should ignore the content or clearly document its internal reprocessing. Ignoring is preferred.
public StyleSheetCollection getStyleSheetCollection()
public void registerStyleSheetCollection(StyleSheetCollection styleSheetCollection) throws InvalidStyleSheetCollectionException
InvalidStyleSheetCollectionException
.
styleSheetCollection
- the stylesheet collection that should be registered.
InvalidStyleSheetCollectionException
- if there is already an other
stylesheet registered.
java.lang.NullPointerException
- if the given stylesheet collection is null.public void unregisterStyleSheetCollection(StyleSheetCollection styleSheetCollection) throws InvalidStyleSheetCollectionException
InvalidStyleSheetCollectionException
styleSheetCollection
- the stylesheet collection that should be unregistered.
InvalidStyleSheetCollectionException
- if there is already an other stylesheet
registered.
java.lang.NullPointerException
- if the given stylesheet collection is null.protected void handleUnregisterStyleSheetCollection()
protected void handleRegisterStyleSheetCollection()
public void updateStyleSheetCollection(StyleSheetCollection sc) throws InvalidStyleSheetCollectionException
If you don't call this function after cloning prepare to be doomed. This method will replace all inherited stylesheets with clones from the stylesheet collection.
sc
- the stylesheet collection that contains the updated information and
that should be assigned with that element.
java.lang.NullPointerException
- if the given stylesheet collection is null.
InvalidStyleSheetCollectionException
- if there is an other stylesheet
collection already registered with that element.public final java.lang.Object getTreeLock()
public boolean isDynamicContent()
public void setDynamicContent(boolean dynamicContent)
dynamicContent
- the new state of the dynamic flag.public boolean isLayoutCacheable()
public void setLayoutCacheable(boolean layoutCacheable)
Calling this function with either parameter will override any previously defined value for the layoutcachable attribute. The value can no longer be inherited from parent stylesheets.
layoutCacheable
- true, if the layout is cacheable, false otherwise.public java.awt.geom.Dimension2D getMinimumSize()
public void setMinimumSize(java.awt.geom.Dimension2D minimumSize)
minimumSize
- the new minimum size or null, if the value should
be inherited.public java.awt.geom.Dimension2D getMaximumSize()
public void setMaximumSize(java.awt.geom.Dimension2D maximumSize)
maximumSize
- the new maximum size or null, if the value should
be inherited.public java.awt.geom.Dimension2D getPreferredSize()
public void setPreferredSize(java.awt.geom.Dimension2D preferredSize)
preferredSize
- the new preferred size or null, if the value should
be inherited.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |