com.jrefinery.report.targets.style
Class ElementDefaultStyleSheet

java.lang.Object
  extended bycom.jrefinery.report.targets.style.ElementStyleSheet
      extended bycom.jrefinery.report.targets.style.ElementDefaultStyleSheet
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, StyleChangeListener

public class ElementDefaultStyleSheet
extends ElementStyleSheet

The default element style sheet. This style sheet defines default attribute values for all elements.

Author:
Thomas Morgner
See Also:
Serialized Form

Field Summary
static java.awt.Font DEFAULT_FONT
          Deprecated. use the key DEFAULT_FONT_DEFINITION
static FontDefinition DEFAULT_FONT_DEFINITION
          The default font.
static java.awt.Color DEFAULT_PAINT
          The default paint.
 
Fields inherited from class com.jrefinery.report.targets.style.ElementStyleSheet
ALIGNMENT, BOLD, BOUNDS, DYNAMIC_HEIGHT, ELEMENT_LAYOUT_CACHEABLE, EMBEDDED_FONT, FONT, FONTENCODING, FONTSIZE, ITALIC, KEEP_ASPECT_RATIO, LINEHEIGHT, MAXIMUMSIZE, MINIMUMSIZE, PAINT, PREFERREDSIZE, SCALE, STRIKETHROUGH, STROKE, UNDERLINED, VALIGNMENT, VISIBLE
 
Constructor Summary
protected ElementDefaultStyleSheet()
          Creates a new style sheet.
 
Method Summary
 ElementStyleSheet getCopy()
          Clones the style-sheet.
static ElementDefaultStyleSheet getDefaultStyle()
          Returns the default element style sheet.
protected  boolean isLocked()
          Gets the locked state of this stylesheet.
protected  void setLocked(boolean locked)
          Defines the locked-state for this stylesheet.
 void setStyleProperty(StyleKey key, java.lang.Object value)
          Sets a style property (or removes the style if the value is null).
 void setStyleSheetCollection(StyleSheetCollection styleSheetCollection)
          Assigns a new stylesheet collection to this stylesheet.
 
Methods inherited from class com.jrefinery.report.targets.style.ElementStyleSheet
addDefaultParent, addDefaultParent, addListener, addParent, addParent, clone, equals, getBooleanStyleProperty, getBooleanStyleProperty, getDefaultParents, getDefinedPropertyNames, getFontDefinitionProperty, getFontStyleProperty, getId, getIntStyleProperty, getName, getParents, getStyleProperty, getStyleProperty, getStyleSheetCollection, hashCode, isAllowCaching, isSubStyleSheet, removeDefaultParent, removeListener, removeParent, setAllowCaching, setBooleanStyleProperty, setFontDefinitionProperty, setFontStyleProperty, styleChanged, styleRemoved
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PAINT

public static final java.awt.Color DEFAULT_PAINT
The default paint.


DEFAULT_FONT

public static final java.awt.Font DEFAULT_FONT
Deprecated. use the key DEFAULT_FONT_DEFINITION

The default font.


DEFAULT_FONT_DEFINITION

public static final FontDefinition DEFAULT_FONT_DEFINITION
The default font.

Constructor Detail

ElementDefaultStyleSheet

protected ElementDefaultStyleSheet()
Creates a new style sheet.

Method Detail

isLocked

protected boolean isLocked()
Gets the locked state of this stylesheet. After the first initialization the stylesheet gets locked, so that it could not be changed anymore.

Returns:
true, if this stylesheet is readonly.

setLocked

protected void setLocked(boolean locked)
Defines the locked-state for this stylesheet.

Parameters:
locked - true, if the stylesheet is locked and read-only, false otherwise.

getDefaultStyle

public static final ElementDefaultStyleSheet getDefaultStyle()
Returns the default element style sheet.

Returns:
the style-sheet.

setStyleProperty

public void setStyleProperty(StyleKey key,
                             java.lang.Object value)
Sets a style property (or removes the style if the value is null).

Overrides:
setStyleProperty in class ElementStyleSheet
Parameters:
key - the style key (null not permitted).
value - the value.
Throws:
java.lang.NullPointerException - if the given key is null.
java.lang.ClassCastException - if the value cannot be assigned with the given key.
java.lang.UnsupportedOperationException - as this style sheet is read only.

getCopy

public ElementStyleSheet getCopy()
Clones the style-sheet. The assigned parent style sheets are not cloned. The stylesheets are not assigned to the contained stylesheet collection, you have to reassign them manually ...

Overrides:
getCopy in class ElementStyleSheet
Returns:
the clone.

setStyleSheetCollection

public final void setStyleSheetCollection(StyleSheetCollection styleSheetCollection)
Assigns a new stylesheet collection to this stylesheet.

DefaultStylesheets are shared among all reports, as they are unmodifyable.

Overrides:
setStyleSheetCollection in class ElementStyleSheet
Parameters:
styleSheetCollection -
Throws:
java.lang.IllegalArgumentException