|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.pentaho.reporting.engine.classic.core.style.AbstractStyleSheet org.pentaho.reporting.engine.classic.core.style.ElementStyleSheet
public abstract class ElementStyleSheet
An element style-sheet contains zero, one or many attributes that affect the appearance of report elements. For each attribute, there is a predefined key that can be used to access that attribute in the style sheet.
Every report element has an associated style-sheet. A style-sheet maintains a list of parent style-sheets. If an attribute is not defined in a style-sheet, the code refers to the parent style-sheets to see if the attribute is defined there. All StyleSheet entries are checked against the StyleKeyDefinition for validity. As usual, this implementation is not synchronized, we need the performance during the reporting.
Field Summary | |
---|---|
static StyleKey |
ALIGNMENT
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
BOLD
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
DYNAMIC_HEIGHT
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
EMBEDDED_FONT
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
EXCEL_DATA_FORMAT_STRING
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
EXCEL_WRAP_TEXT
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
FONT
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
FONTENCODING
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
FONTSIZE
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
HREF_TARGET
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
HREF_WINDOW
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
ITALIC
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
KEEP_ASPECT_RATIO
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
LINEHEIGHT
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
MAXIMUMSIZE
Deprecated. use the minimum-width and minimum-height style-keys instead. |
static StyleKey |
MINIMUMSIZE
Deprecated. use the minimum-width and minimum-height style-keys instead. |
static StyleKey |
PAINT
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
PREFERREDSIZE
Deprecated. use the minimum-width and minimum-height style-keys instead. |
static StyleKey |
RESERVED_LITERAL
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
SCALE
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
STRIKETHROUGH
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
STROKE
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
TRIM_TEXT_CONTENT
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
UNDERLINED
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
VALIGNMENT
Deprecated. use ElementStyleKeys instead.. |
static StyleKey |
VISIBLE
Deprecated. use ElementStyleKeys instead.. |
Method Summary | |
---|---|
void |
addListener(StyleChangeListener l)
Adds a StyleChangeListener . |
void |
addParent(ElementStyleSheet parent)
Adds a parent style-sheet. |
void |
addParent(int position,
ElementStyleSheet parent)
Adds a parent style-sheet. |
Object |
clone()
Creates and returns a copy of this object. |
StyleSheet |
derive()
|
ElementStyleSheet |
getCascadeStyleSheet()
|
long |
getChangeTracker()
|
ElementStyleSheet |
getCopy()
Clones the style-sheet. |
Iterator |
getDefinedPropertyNames()
Returns an enumeration of all local property keys. |
StyleKey[] |
getDefinedPropertyNamesArray()
|
FontDefinition |
getFontDefinitionProperty()
Deprecated. This method will be removed in the next version. |
ElementDefaultStyleSheet |
getGlobalDefaultStyleSheet()
Returns the global default (if defined). |
String |
getName()
Returns the name of the style-sheet. |
ElementStyleSheet[] |
getParents()
Returns a list of the parent style-sheets. |
StyleKey[] |
getPropertyKeys()
Returns the property keys. |
Object |
getStyleProperty(StyleKey key,
Object defaultValue)
Returns the value of a style. |
boolean |
isAllowCaching()
Deprecated. has no effect. Always return true. |
boolean |
isGlobalDefault()
Returns true, if this stylesheet is one of the global default stylesheets. |
boolean |
isLocalKey(StyleKey key)
Returns true, if the given key is locally defined, false otherwise. |
void |
removeListener(StyleChangeListener l)
Removes a StyleChangeListener . |
void |
removeParent(ElementStyleSheet parent)
Removes a parent style-sheet. |
void |
setAllowCaching(boolean allowCaching)
Deprecated. has no effect - there is always some caching now |
void |
setBooleanStyleProperty(StyleKey key,
boolean value)
Sets a boolean style property. |
void |
setCascadeStyleSheet(ElementStyleSheet cascadeStyleSheet)
|
void |
setFontDefinitionProperty(FontDefinition font)
Deprecated. This method will be removed in the next version. |
void |
setGlobalDefaultStyleSheet(ElementDefaultStyleSheet defaultStyleSheet)
|
void |
setStyleProperty(StyleKey key,
Object value)
Sets a style property (or removes the style if the value is null ). |
void |
styleChanged(ElementStyleSheet source,
StyleKey key,
Object value)
Forwards a change event notification to all registered StyleChangeListener objects. |
void |
styleRemoved(ElementStyleSheet source,
StyleKey key)
Forwards a change event notification to all registered StyleChangeListener objects. |
Object[] |
toArray()
|
Methods inherited from class org.pentaho.reporting.engine.classic.core.style.AbstractStyleSheet |
---|
getBooleanStyleProperty, getBooleanStyleProperty, getDoubleStyleProperty, getId, getIntStyleProperty, getStyleProperty |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final StyleKey MINIMUMSIZE
public static final StyleKey MAXIMUMSIZE
public static final StyleKey PREFERREDSIZE
public static final StyleKey VISIBLE
public static final StyleKey PAINT
public static final StyleKey STROKE
public static final StyleKey ALIGNMENT
public static final StyleKey VALIGNMENT
public static final StyleKey SCALE
public static final StyleKey KEEP_ASPECT_RATIO
public static final StyleKey DYNAMIC_HEIGHT
public static final StyleKey HREF_TARGET
public static final StyleKey HREF_WINDOW
public static final StyleKey EXCEL_WRAP_TEXT
public static final StyleKey EXCEL_DATA_FORMAT_STRING
public static final StyleKey FONT
public static final StyleKey FONTSIZE
public static final StyleKey LINEHEIGHT
public static final StyleKey BOLD
public static final StyleKey ITALIC
public static final StyleKey UNDERLINED
public static final StyleKey STRIKETHROUGH
public static final StyleKey EMBEDDED_FONT
public static final StyleKey FONTENCODING
public static final StyleKey RESERVED_LITERAL
public static final StyleKey TRIM_TEXT_CONTENT
Method Detail |
---|
public final boolean isAllowCaching()
true
if caching is allowed, and false
otherwise.
public long getChangeTracker()
getChangeTracker
in interface StyleSheet
getChangeTracker
in class AbstractStyleSheet
public boolean isLocalKey(StyleKey key)
key
- the key to test
public void setAllowCaching(boolean allowCaching)
allowCaching
- the flag value.public String getName()
null
).public void addParent(ElementStyleSheet parent)
parent
- the parent (null
not permitted).public void addParent(int position, ElementStyleSheet parent)
position
- the position where to insert the parent style sheetparent
- the parent (null
not permitted).
IndexOutOfBoundsException
- if the position is invalid (pos < 0 or pos >= numberOfParents)public void removeParent(ElementStyleSheet parent)
parent
- the style-sheet to remove (null
not permitted).public ElementStyleSheet[] getParents()
public ElementDefaultStyleSheet getGlobalDefaultStyleSheet()
public void setGlobalDefaultStyleSheet(ElementDefaultStyleSheet defaultStyleSheet)
public ElementStyleSheet getCascadeStyleSheet()
public void setCascadeStyleSheet(ElementStyleSheet cascadeStyleSheet)
public final Object[] toArray()
toArray
in interface StyleSheet
public Object getStyleProperty(StyleKey key, Object defaultValue)
null
) is returned.
getStyleProperty
in interface StyleSheet
key
- the style key.defaultValue
- the default value (null
permitted).
public void setBooleanStyleProperty(StyleKey key, boolean value)
key
- the style key (null
not permitted).value
- the value.
NullPointerException
- if the given key is null.
ClassCastException
- if the value cannot be assigned with the given key.public void setStyleProperty(StyleKey key, Object value)
null
).
key
- the style key (null
not permitted).value
- the value.
NullPointerException
- if the given key is null.
ClassCastException
- if the value cannot be assigned with the given key.public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Cloneable
public StyleSheet derive() throws CloneNotSupportedException
derive
in class AbstractStyleSheet
CloneNotSupportedException
public ElementStyleSheet getCopy() throws CloneNotSupportedException
CloneNotSupportedException
public FontDefinition getFontDefinitionProperty()
getFontDefinitionProperty
in class AbstractStyleSheet
public void setFontDefinitionProperty(FontDefinition font)
font
- the font (null
not permitted).public Iterator getDefinedPropertyNames()
public StyleKey[] getDefinedPropertyNamesArray()
public void addListener(StyleChangeListener l)
StyleChangeListener
.
l
- the listener.public void removeListener(StyleChangeListener l)
StyleChangeListener
.
l
- the listener.public void styleChanged(ElementStyleSheet source, StyleKey key, Object value)
StyleChangeListener
objects.
styleChanged
in interface StyleChangeListener
source
- the source of the change.key
- the style key.value
- the new value.public void styleRemoved(ElementStyleSheet source, StyleKey key)
StyleChangeListener
objects.
styleRemoved
in interface StyleChangeListener
source
- the source of the change.key
- the style key.public boolean isGlobalDefault()
public StyleKey[] getPropertyKeys()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |