Package net.sf.jasperreports.engine.base
Class JRBaseStyle
java.lang.Object
net.sf.jasperreports.engine.base.JRBaseStyle
- All Implemented Interfaces:
Serializable
,Cloneable
,Deduplicable
,JRChangeEventsSupport
,JRBoxContainer
,JRCloneable
,JRParagraphContainer
,JRPenContainer
,JRStyle
,JRStyleContainer
- Direct Known Subclasses:
JRBaseConditionalStyle
,JRDesignStyle
public class JRBaseStyle
extends Object
implements JRStyle, Serializable, JRChangeEventsSupport, Deduplicable
- Author:
- Ionut Nedelcu (ionutned@users.sourceforge.net)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Color
protected JRConditionalStyle[]
protected final JRDefaultStyleProvider
static final String
protected FillEnum
protected String
protected Float
protected Color
protected HorizontalImageAlignEnum
protected HorizontalTextAlignEnum
protected Boolean
protected Boolean
protected boolean
protected Boolean
protected Boolean
protected Boolean
protected Boolean
protected JRLineBox
protected JRPen
protected String
protected ModeEnum
protected String
protected JRParagraph
protected JRStyle
protected String
protected String
protected String
protected String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected Integer
protected RotationEnum
protected ScaleImageEnum
protected VerticalImageAlignEnum
protected VerticalTextAlignEnum
Fields inherited from interface net.sf.jasperreports.engine.JRStyle
PROPERTY_EVALUATION_TIME_ENABLED
-
Constructor Summary
ConstructorsConstructorDescriptionJRBaseStyle
(String name) JRBaseStyle
(JRDefaultStyleProvider defaultStyleProvider) JRBaseStyle
(JRDefaultStyleProvider defaultStyleProvider, String name) JRBaseStyle
(JRStyle style, JRAbstractObjectFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
clone()
Returns the property change support object for this instance.getFill()
Indicates the fill type used for this element.int
Returns a hash code to be used for the deduplicate map.Gets the horizontal image alignment of the element.Gets the horizontal text alignment of the element.Returns the markup language used to format the text.getMode()
Returns the element transparency mode.getName()
Gets the style unique name.Gets the text own rotation.Gets the image own scale type.Gets the pattern used for this text field.Indicates the corner radius for rectangles with round corners.Gets the text rotation.Gets the image scale type.getStyle()
Returns this object's style.Returns the name of an external style which is to be used by this object.protected StyleResolver
Gets the vertical image alignment of the element.Gets the vertical text alignment of the element.protected boolean
identicalStyle
(JRBaseStyle style) isBold()
boolean
Gets a flag that specifies if this is the default report style.boolean
isIdentical
(Object object) Determines if this instance is identical to another object.isItalic()
void
Changes the name of this style.void
setBackcolor
(Color backcolor) void
setBlankWhenNull
(Boolean isBlankWhenNull) void
void
void
setFontName
(String fontName) void
setFontSize
(Float fontSize) void
setForecolor
(Color forecolor) void
setHorizontalImageAlign
(HorizontalImageAlignEnum horizontalImageAlign) void
setHorizontalTextAlign
(HorizontalTextAlignEnum horizontalTextAlign) void
void
void
protected void
setParentStyle
(JRStyle parentStyle) void
setPattern
(String pattern) void
setPdfEmbedded
(Boolean pdfEmbedded) void
setPdfEncoding
(String pdfEncoding) void
setPdfFontName
(String pdfFontName) void
void
setRotation
(RotationEnum rotation) void
setScaleImage
(ScaleImageEnum scaleImage) void
setStrikeThrough
(Boolean strikeThrough) void
setUnderline
(Boolean underline) void
setVerticalImageAlign
(VerticalImageAlignEnum verticalImageAlign) void
setVerticalTextAlign
(VerticalTextAlignEnum verticalTextAlign) Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.sf.jasperreports.engine.JRStyleContainer
getStyleName
-
Field Details
-
EXCEPTION_MESSAGE_KEY_CIRCULAR_DEPENDENCY
- See Also:
-
PROPERTY_BACKCOLOR
- See Also:
-
PROPERTY_BLANK_WHEN_NULL
- See Also:
-
PROPERTY_BOLD
- See Also:
-
PROPERTY_FILL
- See Also:
-
PROPERTY_FONT_NAME
- See Also:
-
PROPERTY_FONT_SIZE
- See Also:
-
PROPERTY_FORECOLOR
- See Also:
-
PROPERTY_HORIZONTAL_TEXT_ALIGNMENT
- See Also:
-
PROPERTY_HORIZONTAL_IMAGE_ALIGNMENT
- See Also:
-
PROPERTY_ITALIC
- See Also:
-
PROPERTY_MODE
- See Also:
-
PROPERTY_PATTERN
- See Also:
-
PROPERTY_PDF_EMBEDDED
- See Also:
-
PROPERTY_PDF_ENCODING
- See Also:
-
PROPERTY_PDF_FONT_NAME
- See Also:
-
PROPERTY_RADIUS
- See Also:
-
PROPERTY_ROTATION
- See Also:
-
PROPERTY_SCALE_IMAGE
- See Also:
-
PROPERTY_STRIKE_THROUGH
- See Also:
-
PROPERTY_MARKUP
- See Also:
-
PROPERTY_UNDERLINE
- See Also:
-
PROPERTY_VERTICAL_TEXT_ALIGNMENT
- See Also:
-
PROPERTY_VERTICAL_IMAGE_ALIGNMENT
- See Also:
-
defaultStyleProvider
-
parentStyle
-
parentStyleNameReference
-
name
-
isDefault
protected boolean isDefault -
mode
-
forecolor
-
backcolor
-
linePen
-
fill
-
radius
-
scaleImage
-
horizontalTextAlign
-
verticalTextAlign
-
horizontalImageAlign
-
verticalImageAlign
-
lineBox
-
paragraph
-
fontName
-
isBold
-
isItalic
-
isUnderline
-
isStrikeThrough
-
fontSize
-
pdfFontName
-
pdfEncoding
-
isPdfEmbedded
-
rotation
-
markup
-
pattern
-
isBlankWhenNull
-
conditionalStyles
-
-
Constructor Details
-
JRBaseStyle
public JRBaseStyle() -
JRBaseStyle
-
JRBaseStyle
-
JRBaseStyle
-
JRBaseStyle
-
-
Method Details
-
setParentStyle
-
checkCircularParent
protected void checkCircularParent() -
getDefaultStyleProvider
- Specified by:
getDefaultStyleProvider
in interfaceJRStyleContainer
-
getStyleResolver
-
getStyle
Description copied from interface:JRStyleContainer
Returns this object's style.- Specified by:
getStyle
in interfaceJRStyleContainer
- Returns:
- this object's style
-
getName
Description copied from interface:JRStyle
Gets the style unique name. -
rename
Changes the name of this style. Note that this method is mostly meant to be used internally. Use cautiously as it might have unexpected consequences.- Parameters:
newName
- the new name
-
isDefault
public boolean isDefault()Description copied from interface:JRStyle
Gets a flag that specifies if this is the default report style. -
getForecolor
- Specified by:
getForecolor
in interfaceJRStyle
-
getOwnForecolor
- Specified by:
getOwnForecolor
in interfaceJRStyle
-
getBackcolor
- Specified by:
getBackcolor
in interfaceJRStyle
-
getOwnBackcolor
- Specified by:
getOwnBackcolor
in interfaceJRStyle
-
getLinePen
- Specified by:
getLinePen
in interfaceJRStyle
-
getFill
Description copied from interface:JRStyle
Indicates the fill type used for this element. -
getOwnFill
- Specified by:
getOwnFill
in interfaceJRStyle
-
getRadius
Description copied from interface:JRStyle
Indicates the corner radius for rectangles with round corners. The default is 0. -
getOwnRadius
- Specified by:
getOwnRadius
in interfaceJRStyle
-
getScaleImage
Description copied from interface:JRStyle
Gets the image scale type.- Specified by:
getScaleImage
in interfaceJRStyle
- Returns:
- one of the scale types defined in
ScaleImageEnum
-
getOwnScaleImage
Description copied from interface:JRStyle
Gets the image own scale type.- Specified by:
getOwnScaleImage
in interfaceJRStyle
- Returns:
- one of the scale types defined in
ScaleImageEnum
-
getHorizontalTextAlign
Description copied from interface:JRStyle
Gets the horizontal text alignment of the element.- Specified by:
getHorizontalTextAlign
in interfaceJRStyle
- Returns:
- one of the alignment values defined in
HorizontalTextAlignEnum
-
getOwnHorizontalTextAlign
- Specified by:
getOwnHorizontalTextAlign
in interfaceJRStyle
-
getVerticalTextAlign
Description copied from interface:JRStyle
Gets the vertical text alignment of the element.- Specified by:
getVerticalTextAlign
in interfaceJRStyle
- Returns:
- one of the alignment values defined in
VerticalTextAlignEnum
-
getOwnVerticalTextAlign
- Specified by:
getOwnVerticalTextAlign
in interfaceJRStyle
-
getHorizontalImageAlign
Description copied from interface:JRStyle
Gets the horizontal image alignment of the element.- Specified by:
getHorizontalImageAlign
in interfaceJRStyle
- Returns:
- one of the alignment values defined in
HorizontalImageAlignEnum
-
getOwnHorizontalImageAlign
- Specified by:
getOwnHorizontalImageAlign
in interfaceJRStyle
-
getVerticalImageAlign
Description copied from interface:JRStyle
Gets the vertical image alignment of the element.- Specified by:
getVerticalImageAlign
in interfaceJRStyle
- Returns:
- one of the alignment values defined in
VerticalImageAlignEnum
-
getOwnVerticalImageAlign
- Specified by:
getOwnVerticalImageAlign
in interfaceJRStyle
-
getLineBox
- Specified by:
getLineBox
in interfaceJRBoxContainer
-
getParagraph
- Specified by:
getParagraph
in interfaceJRParagraphContainer
-
getRotation
Description copied from interface:JRStyle
Gets the text rotation.- Specified by:
getRotation
in interfaceJRStyle
- Returns:
- a value representing one of the rotation values in the
RotationEnum
.
-
getOwnRotation
Description copied from interface:JRStyle
Gets the text own rotation.- Specified by:
getOwnRotation
in interfaceJRStyle
- Returns:
- a value representing one of the rotation values in the
RotationEnum
.
-
setRotation
- Specified by:
setRotation
in interfaceJRStyle
-
getMarkup
Description copied from interface:JRStyle
Returns the markup language used to format the text. -
getOwnMarkup
- Specified by:
getOwnMarkup
in interfaceJRStyle
-
isBlankWhenNull
- Specified by:
isBlankWhenNull
in interfaceJRStyle
-
isOwnBlankWhenNull
- Specified by:
isOwnBlankWhenNull
in interfaceJRStyle
-
getFontName
- Specified by:
getFontName
in interfaceJRStyle
-
getOwnFontName
- Specified by:
getOwnFontName
in interfaceJRStyle
-
isBold
-
isOwnBold
-
isItalic
-
isOwnItalic
- Specified by:
isOwnItalic
in interfaceJRStyle
-
isUnderline
- Specified by:
isUnderline
in interfaceJRStyle
-
isOwnUnderline
- Specified by:
isOwnUnderline
in interfaceJRStyle
-
isStrikeThrough
- Specified by:
isStrikeThrough
in interfaceJRStyle
-
isOwnStrikeThrough
- Specified by:
isOwnStrikeThrough
in interfaceJRStyle
-
getFontSize
- Specified by:
getFontSize
in interfaceJRStyle
-
getOwnFontSize
- Specified by:
getOwnFontSize
in interfaceJRStyle
-
getPdfFontName
- Specified by:
getPdfFontName
in interfaceJRStyle
-
getOwnPdfFontName
- Specified by:
getOwnPdfFontName
in interfaceJRStyle
-
getPdfEncoding
- Specified by:
getPdfEncoding
in interfaceJRStyle
-
getOwnPdfEncoding
- Specified by:
getOwnPdfEncoding
in interfaceJRStyle
-
isPdfEmbedded
- Specified by:
isPdfEmbedded
in interfaceJRStyle
-
isOwnPdfEmbedded
- Specified by:
isOwnPdfEmbedded
in interfaceJRStyle
-
getPattern
Description copied from interface:JRStyle
Gets the pattern used for this text field. The pattern will be used in a SimpleDateFormat for dates and a DecimalFormat for numeric text fields. The pattern format must follow one of these two classes formatting rules, as specified in the JDK API docs.- Specified by:
getPattern
in interfaceJRStyle
- Returns:
- a string containing the pattern.
-
getOwnPattern
- Specified by:
getOwnPattern
in interfaceJRStyle
-
getMode
Description copied from interface:JRStyle
Returns the element transparency mode. The default value depends on the type of the report element. Graphic elements like rectangles and lines are opaque by default, but the images are transparent. Both static texts and text fields are transparent by default, and so are the subreport elements. -
getOwnMode
- Specified by:
getOwnMode
in interfaceJRStyle
-
setForecolor
- Specified by:
setForecolor
in interfaceJRStyle
-
setBackcolor
- Specified by:
setBackcolor
in interfaceJRStyle
-
setMode
-
setFill
-
setRadius
-
setScaleImage
- Specified by:
setScaleImage
in interfaceJRStyle
-
setHorizontalImageAlign
- Specified by:
setHorizontalImageAlign
in interfaceJRStyle
-
setVerticalImageAlign
- Specified by:
setVerticalImageAlign
in interfaceJRStyle
-
setHorizontalTextAlign
- Specified by:
setHorizontalTextAlign
in interfaceJRStyle
-
setVerticalTextAlign
- Specified by:
setVerticalTextAlign
in interfaceJRStyle
-
setFontName
- Specified by:
setFontName
in interfaceJRStyle
-
setBold
-
setItalic
-
setPdfEmbedded
- Specified by:
setPdfEmbedded
in interfaceJRStyle
-
setStrikeThrough
- Specified by:
setStrikeThrough
in interfaceJRStyle
-
setMarkup
-
setBlankWhenNull
- Specified by:
setBlankWhenNull
in interfaceJRStyle
-
setUnderline
- Specified by:
setUnderline
in interfaceJRStyle
-
setPattern
- Specified by:
setPattern
in interfaceJRStyle
-
setPdfEncoding
- Specified by:
setPdfEncoding
in interfaceJRStyle
-
setPdfFontName
- Specified by:
setPdfFontName
in interfaceJRStyle
-
setFontSize
- Specified by:
setFontSize
in interfaceJRStyle
-
getConditionalStyles
- Specified by:
getConditionalStyles
in interfaceJRStyle
-
getStyleNameReference
Description copied from interface:JRStyleContainer
Returns the name of an external style which is to be used by this object. External styles are defined intemplates
and are resolved at fill time. This attribute is only effective if no direct style (as returned bygetStyle()
is specified for this object.- Specified by:
getStyleNameReference
in interfaceJRStyleContainer
- Returns:
- the name of an external style
-
getDefaultLineWidth
- Specified by:
getDefaultLineWidth
in interfaceJRPenContainer
-
getDefaultLineColor
- Specified by:
getDefaultLineColor
in interfaceJRBoxContainer
- Specified by:
getDefaultLineColor
in interfaceJRPenContainer
-
getEventSupport
Description copied from interface:JRChangeEventsSupport
Returns the property change support object for this instance.- Specified by:
getEventSupport
in interfaceJRChangeEventsSupport
- Returns:
- the property change support object for this instance
-
clone
- Specified by:
clone
in interfaceJRCloneable
- Overrides:
clone
in classObject
-
getHashCode
public int getHashCode()Description copied from interface:Deduplicable
Returns a hash code to be used for the deduplicate map. The returned hash code should be consitent wiwhDeduplicable.isIdentical(Object)
, i.e. if two objects are identical they should have the same hash code.- Specified by:
getHashCode
in interfaceDeduplicable
- Returns:
- deduplication hash code
-
addStyleHash
-
isIdentical
Description copied from interface:Deduplicable
Determines if this instance is identical to another object.- Specified by:
isIdentical
in interfaceDeduplicable
- Parameters:
object
- the object to compare with this instance- Returns:
true
if the two objects are identical and can be deduplicated
-
identicalStyle
-