public interface JRStyle extends JRStyleContainer, JRBoxContainer, JRPenContainer, JRParagraphContainer, JRCloneable
The name
attribute of a <style>
element is mandatory. It must be unique because it
references the corresponding report style throughout the report.
One can use isDefault="true"
for one of your report style declarations to mark the
default for elements that do not or cannot have another style specified.
Each report style definition can reference another style definition from which it will
inherit some or all of its properties. The style
attribute inside a <style>
element
specifies the name of the parent report style.
Below is a list with the main style attributes:
name
- the name of the style. Required.isDefault
- flag that specifies if the style represents the default report style.style
- the name of the parent stylemode
- specifies whether report elements are opaque or transparent. Possible values are:
Opaque
Transparent
forecolor
- the font color for text elements or the line color for graphic elementsbackcolor
- the element background colorfill
- the fill pattern. Possible value is Solid
radius
- the radius for some graphic elementshTextAlign
- the horizontal alignment of the text within a text element. Possible values are:
Left
- default settingCenter
Right
Justified
vTextAlign
- the vertical alignment of the text within a text element. Possible values are:
Top
- default settingMiddle
Bottom
hImageAlign
- the horizontal alignment of the image within an image element. Possible values are:
Left
- default settingCenter
Right
vImageAlign
- the vertical alignment of the image within an image element. Possible values are:
Top
- default settingMiddle
Bottom
rotation
- the text rotation within a text element. Possible values are:
None
- default settingLeft
Right
UpsideDown
fontName
- the name of the font facefontSize
- the font sizeisBold
- flag that specifies whether the font is boldisItalic
- flag that specifies whether the font is italicisUnderline
- flag that specifies whether the font is underlinedisStrikeThrough
- flag that specifies whether the font is strike throughpattern
- specifies the format pattern for text elementsisBlankWhenNull
- flag that specifies whether null values should be represented as blanksmarkup
- the markup style for the text elements. Possible values are:
none
- default settingstyled
html
rtf
A style also may contain:
JRPen
element that can be retrieved
using the getLinePen()
method.JRLineBox
element that can be retrieved
using the getLineBox()
method.JRParagraph
element that can be retrieved
using the JRParagraphContainer.getParagraph()
method inherited from the
JRParagraphContainer
interface.All report elements can reference a report style to inherit all or part of the style properties. A report style declaration groups all the style-related properties supported throughout the library, but an individual element inherits only those style properties that apply to it. The others will be ignored.
A conditional style has two elements: a Boolean condition expression and a style
. The
style is used only if the condition evaluates to true.
An important aspect is the priority of styles. When applied, a conditional style will override the properties of its parent style.
A style can contain more than one conditional style. In this case, all conditionals that evaluate to true will be appended to the existing style (the second style will be appended to the first, and so on).
By default, the style condition expressions are evaluated during the report filling process
at the time that the style reference is used. The conditional expression evaluation will use
the current values of referenced variables and fields, regardless of the evaluationTime
attribute of the element that makes use of the style.
If the evaluation of the condition expression of the style needs to be delayed, just like the
value of the text field or the image element that uses the conditional style, the
net.sf.jasperreports.style.evaluation.time.enabled
configuration property
should be set to true.
A style template is an XML file that contains one or more style definitions. A template can include references to other style template files, hence one can organize a style library as a hierarchical set of style template files.
Style template files use by convention the *.jrtx
extension, but this is not mandatory.
A report can use style templates by explicitly referring them in its definition. References
to a style templates are included in JRXML reports as <template>
elements. Such an
element contains an expression that is resolved at fill time to a style template instance.
JRLineBox
,
JRParagraph
,
JRPen
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_EVALUATION_TIME_ENABLED
A flag the determines whether the style of an element is evaluated at
the element evaluation time, or at the time the band on which the element
is placed is rendered.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getBackcolor() |
JRConditionalStyle[] |
getConditionalStyles() |
FillEnum |
getFillValue()
Indicates the fill type used for this element.
|
java.lang.String |
getFontName() |
java.lang.Float |
getFontsize() |
java.lang.Integer |
getFontSize()
Deprecated.
Replaced by
getFontsize() . |
java.awt.Color |
getForecolor() |
HorizontalAlignEnum |
getHorizontalAlignmentValue()
Deprecated.
Replaced by
getHorizontalTextAlign() and getHorizontalImageAlign() . |
HorizontalImageAlignEnum |
getHorizontalImageAlign()
Gets the horizontal image alignment of the element.
|
HorizontalTextAlignEnum |
getHorizontalTextAlign()
Gets the horizontal text alignment of the element.
|
JRLineBox |
getLineBox() |
JRPen |
getLinePen() |
LineSpacingEnum |
getLineSpacingValue()
Deprecated.
Replaced by
JRParagraph.getLineSpacing() . |
java.lang.String |
getMarkup()
Returns the markup language used to format the text.
|
ModeEnum |
getModeValue()
Returns the element transparency mode.
|
java.lang.String |
getName()
Gets the style unique name.
|
java.awt.Color |
getOwnBackcolor() |
FillEnum |
getOwnFillValue() |
java.lang.String |
getOwnFontName() |
java.lang.Float |
getOwnFontsize() |
java.lang.Integer |
getOwnFontSize()
Deprecated.
Replaced by
getOwnFontsize() . |
java.awt.Color |
getOwnForecolor() |
HorizontalAlignEnum |
getOwnHorizontalAlignmentValue()
Deprecated.
Replaced by
getOwnHorizontalTextAlign() and getOwnHorizontalImageAlign() . |
HorizontalImageAlignEnum |
getOwnHorizontalImageAlign() |
HorizontalTextAlignEnum |
getOwnHorizontalTextAlign() |
LineSpacingEnum |
getOwnLineSpacingValue()
Deprecated.
Replaced by
JRParagraph.getOwnLineSpacing() . |
java.lang.String |
getOwnMarkup() |
ModeEnum |
getOwnModeValue() |
java.lang.String |
getOwnPattern() |
java.lang.String |
getOwnPdfEncoding() |
java.lang.String |
getOwnPdfFontName() |
java.lang.Integer |
getOwnRadius() |
RotationEnum |
getOwnRotationValue()
Gets the text own rotation.
|
ScaleImageEnum |
getOwnScaleImageValue()
Gets the image own scale type.
|
VerticalAlignEnum |
getOwnVerticalAlignmentValue()
Deprecated.
Replaced by
getOwnVerticalTextAlign() and getOwnVerticalImageAlign() . |
VerticalImageAlignEnum |
getOwnVerticalImageAlign() |
VerticalTextAlignEnum |
getOwnVerticalTextAlign() |
java.lang.String |
getPattern()
Gets the pattern used for this text field.
|
java.lang.String |
getPdfEncoding() |
java.lang.String |
getPdfFontName() |
java.lang.Integer |
getRadius()
Indicates the corner radius for rectangles with round corners.
|
RotationEnum |
getRotationValue()
Gets the text rotation.
|
ScaleImageEnum |
getScaleImageValue()
Gets the image scale type.
|
VerticalAlignEnum |
getVerticalAlignmentValue()
Deprecated.
Replaced by
getVerticalTextAlign() and getVerticalImageAlign() . |
VerticalImageAlignEnum |
getVerticalImageAlign()
Gets the vertical image alignment of the element.
|
VerticalTextAlignEnum |
getVerticalTextAlign()
Gets the vertical text alignment of the element.
|
java.lang.Boolean |
isBlankWhenNull() |
java.lang.Boolean |
isBold() |
boolean |
isDefault()
Gets a flag that specifies if this is the default report style.
|
java.lang.Boolean |
isItalic() |
java.lang.Boolean |
isOwnBlankWhenNull() |
java.lang.Boolean |
isOwnBold() |
java.lang.Boolean |
isOwnItalic() |
java.lang.Boolean |
isOwnPdfEmbedded() |
java.lang.Boolean |
isOwnStrikeThrough() |
java.lang.Boolean |
isOwnUnderline() |
java.lang.Boolean |
isPdfEmbedded() |
java.lang.Boolean |
isStrikeThrough() |
java.lang.Boolean |
isUnderline() |
void |
setBackcolor(java.awt.Color backcolor) |
void |
setBlankWhenNull(boolean isBlankWhenNull) |
void |
setBlankWhenNull(java.lang.Boolean isBlankWhenNull) |
void |
setBold(boolean bold) |
void |
setBold(java.lang.Boolean bold) |
void |
setFill(FillEnum fill) |
void |
setFontName(java.lang.String fontName) |
void |
setFontSize(java.lang.Float fontSize) |
void |
setFontSize(int fontSize)
Deprecated.
Replaced by
setFontSize(Float) . |
void |
setFontSize(java.lang.Integer fontSize)
Deprecated.
Replaced by
setFontSize(Float) . |
void |
setForecolor(java.awt.Color forecolor) |
void |
setHorizontalAlignment(HorizontalAlignEnum horizontalAlignment)
Deprecated.
|
void |
setHorizontalImageAlign(HorizontalImageAlignEnum horizontalAlignment) |
void |
setHorizontalTextAlign(HorizontalTextAlignEnum horizontalAlignment) |
void |
setItalic(boolean italic) |
void |
setItalic(java.lang.Boolean italic) |
void |
setLineSpacing(LineSpacingEnum lineSpacing)
Deprecated.
Replaced by
JRParagraph.setLineSpacing(LineSpacingEnum) |
void |
setMarkup(java.lang.String markup) |
void |
setMode(ModeEnum mode) |
void |
setPattern(java.lang.String pattern) |
void |
setPdfEmbedded(boolean pdfEmbedded) |
void |
setPdfEmbedded(java.lang.Boolean pdfEmbedded) |
void |
setPdfEncoding(java.lang.String pdfEncoding) |
void |
setPdfFontName(java.lang.String pdfFontName) |
void |
setRadius(int radius) |
void |
setRadius(java.lang.Integer radius) |
void |
setRotation(RotationEnum rotation) |
void |
setScaleImage(ScaleImageEnum scaleImage) |
void |
setStrikeThrough(boolean strikeThrough) |
void |
setStrikeThrough(java.lang.Boolean strikeThrough) |
void |
setUnderline(boolean underline) |
void |
setUnderline(java.lang.Boolean underline) |
void |
setVerticalAlignment(VerticalAlignEnum verticalAlignment)
Deprecated.
|
void |
setVerticalImageAlign(VerticalImageAlignEnum verticalAlignment) |
void |
setVerticalTextAlign(VerticalTextAlignEnum verticalAlignment) |
getDefaultLineColor
getDefaultLineColor, getDefaultLineWidth
getParagraph
getDefaultStyleProvider, getStyle, getStyleNameReference
clone
static final java.lang.String PROPERTY_EVALUATION_TIME_ENABLED
This applies to report elements that can have delayed evaluations times
(such as text fields and images). When this flag is set to
true
, conditional style expressions of the style that is
associated with the element are evaluated at the moment the element is
set to evaluate, and the resulting style to the generated print element.
By default, this flag is set to false
. The property can be
set globally, at report level and at element level.
java.lang.String getName()
boolean isDefault()
ModeEnum getModeValue()
ModeEnum getOwnModeValue()
java.awt.Color getForecolor()
java.awt.Color getOwnForecolor()
java.awt.Color getBackcolor()
java.awt.Color getOwnBackcolor()
JRPen getLinePen()
FillEnum getFillValue()
FillEnum
.FillEnum getOwnFillValue()
java.lang.Integer getRadius()
java.lang.Integer getOwnRadius()
ScaleImageEnum getScaleImageValue()
ScaleImageEnum
ScaleImageEnum getOwnScaleImageValue()
ScaleImageEnum
HorizontalAlignEnum getHorizontalAlignmentValue()
getHorizontalTextAlign()
and getHorizontalImageAlign()
.HorizontalAlignEnum
HorizontalAlignEnum getOwnHorizontalAlignmentValue()
getOwnHorizontalTextAlign()
and getOwnHorizontalImageAlign()
.VerticalAlignEnum getVerticalAlignmentValue()
getVerticalTextAlign()
and getVerticalImageAlign()
.VerticalAlignEnum
VerticalAlignEnum getOwnVerticalAlignmentValue()
getOwnVerticalTextAlign()
and getOwnVerticalImageAlign()
.HorizontalTextAlignEnum getHorizontalTextAlign()
HorizontalTextAlignEnum
HorizontalTextAlignEnum getOwnHorizontalTextAlign()
VerticalTextAlignEnum getVerticalTextAlign()
VerticalTextAlignEnum
VerticalTextAlignEnum getOwnVerticalTextAlign()
HorizontalImageAlignEnum getHorizontalImageAlign()
HorizontalImageAlignEnum
HorizontalImageAlignEnum getOwnHorizontalImageAlign()
VerticalImageAlignEnum getVerticalImageAlign()
VerticalImageAlignEnum
VerticalImageAlignEnum getOwnVerticalImageAlign()
JRLineBox getLineBox()
getLineBox
in interface JRBoxContainer
RotationEnum getRotationValue()
RotationEnum
.RotationEnum getOwnRotationValue()
RotationEnum
.LineSpacingEnum getLineSpacingValue()
JRParagraph.getLineSpacing()
.LineSpacingEnum getOwnLineSpacingValue()
JRParagraph.getOwnLineSpacing()
.java.lang.String getMarkup()
java.lang.String getOwnMarkup()
java.lang.String getFontName()
java.lang.String getOwnFontName()
java.lang.Boolean isBold()
java.lang.Boolean isOwnBold()
java.lang.Boolean isItalic()
java.lang.Boolean isOwnItalic()
java.lang.Boolean isUnderline()
java.lang.Boolean isOwnUnderline()
java.lang.Boolean isStrikeThrough()
java.lang.Boolean isOwnStrikeThrough()
java.lang.Float getFontsize()
java.lang.Float getOwnFontsize()
java.lang.Integer getFontSize()
getFontsize()
.java.lang.Integer getOwnFontSize()
getOwnFontsize()
.java.lang.String getPdfFontName()
java.lang.String getOwnPdfFontName()
java.lang.String getPdfEncoding()
java.lang.String getOwnPdfEncoding()
java.lang.Boolean isPdfEmbedded()
java.lang.Boolean isOwnPdfEmbedded()
java.lang.String getPattern()
java.lang.String getOwnPattern()
java.lang.Boolean isBlankWhenNull()
java.lang.Boolean isOwnBlankWhenNull()
void setForecolor(java.awt.Color forecolor)
void setBackcolor(java.awt.Color backcolor)
void setMode(ModeEnum mode)
void setFill(FillEnum fill)
void setRadius(int radius)
void setRadius(java.lang.Integer radius)
void setScaleImage(ScaleImageEnum scaleImage)
void setHorizontalAlignment(HorizontalAlignEnum horizontalAlignment)
setHorizontalTextAlign(HorizontalTextAlignEnum)
and setHorizontalImageAlign(HorizontalImageAlignEnum)
.void setVerticalAlignment(VerticalAlignEnum verticalAlignment)
setVerticalTextAlign(VerticalTextAlignEnum)
and setVerticalImageAlign(VerticalImageAlignEnum)
.void setHorizontalTextAlign(HorizontalTextAlignEnum horizontalAlignment)
void setVerticalTextAlign(VerticalTextAlignEnum verticalAlignment)
void setHorizontalImageAlign(HorizontalImageAlignEnum horizontalAlignment)
void setVerticalImageAlign(VerticalImageAlignEnum verticalAlignment)
void setRotation(RotationEnum rotation)
void setFontName(java.lang.String fontName)
void setBold(boolean bold)
void setBold(java.lang.Boolean bold)
void setItalic(boolean italic)
void setItalic(java.lang.Boolean italic)
void setPdfEmbedded(boolean pdfEmbedded)
void setPdfEmbedded(java.lang.Boolean pdfEmbedded)
void setStrikeThrough(boolean strikeThrough)
void setStrikeThrough(java.lang.Boolean strikeThrough)
void setMarkup(java.lang.String markup)
void setUnderline(boolean underline)
void setUnderline(java.lang.Boolean underline)
void setLineSpacing(LineSpacingEnum lineSpacing)
JRParagraph.setLineSpacing(LineSpacingEnum)
void setPattern(java.lang.String pattern)
void setBlankWhenNull(boolean isBlankWhenNull)
void setBlankWhenNull(java.lang.Boolean isBlankWhenNull)
void setPdfEncoding(java.lang.String pdfEncoding)
void setPdfFontName(java.lang.String pdfFontName)
void setFontSize(java.lang.Float fontSize)
void setFontSize(int fontSize)
setFontSize(Float)
.void setFontSize(java.lang.Integer fontSize)
setFontSize(Float)
.JRConditionalStyle[] getConditionalStyles()
© 2001-2014 TIBCO Software Inc. www.jaspersoft.com