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 Colorprotected JRConditionalStyle[]protected final JRDefaultStyleProviderstatic final Stringprotected FillEnumprotected Stringprotected Floatprotected Colorprotected HorizontalImageAlignEnumprotected HorizontalTextAlignEnumprotected Booleanprotected Booleanprotected booleanprotected Booleanprotected Booleanprotected Booleanprotected Booleanprotected JRLineBoxprotected JRPenprotected Stringprotected ModeEnumprotected Stringprotected JRParagraphprotected JRStyleprotected Stringprotected Stringprotected Stringprotected Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Integerprotected RotationEnumprotected ScaleImageEnumprotected VerticalImageAlignEnumprotected VerticalTextAlignEnumFields 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 voidprotected voidclone()Returns the property change support object for this instance.getFill()Indicates the fill type used for this element.intReturns 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 StyleResolverGets the vertical image alignment of the element.Gets the vertical text alignment of the element.protected booleanidenticalStyle(JRBaseStyle style) isBold()booleanGets a flag that specifies if this is the default report style.booleanisIdentical(Object object) Determines if this instance is identical to another object.isItalic()voidChanges the name of this style.voidsetBackcolor(Color backcolor) voidsetBlankWhenNull(Boolean isBlankWhenNull) voidvoidvoidsetFontName(String fontName) voidsetFontSize(Float fontSize) voidsetForecolor(Color forecolor) voidsetHorizontalImageAlign(HorizontalImageAlignEnum horizontalImageAlign) voidsetHorizontalTextAlign(HorizontalTextAlignEnum horizontalTextAlign) voidvoidvoidprotected voidsetParentStyle(JRStyle parentStyle) voidsetPattern(String pattern) voidsetPdfEmbedded(Boolean pdfEmbedded) voidsetPdfEncoding(String pdfEncoding) voidsetPdfFontName(String pdfFontName) voidvoidsetRotation(RotationEnum rotation) voidsetScaleImage(ScaleImageEnum scaleImage) voidsetStrikeThrough(Boolean strikeThrough) voidsetUnderline(Boolean underline) voidsetVerticalImageAlign(VerticalImageAlignEnum verticalImageAlign) voidsetVerticalTextAlign(VerticalTextAlignEnum verticalTextAlign) Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getDefaultStyleProviderin interfaceJRStyleContainer
-
getStyleResolver
-
getStyle
Description copied from interface:JRStyleContainerReturns this object's style.- Specified by:
getStylein interfaceJRStyleContainer- Returns:
- this object's style
-
getName
Description copied from interface:JRStyleGets 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:JRStyleGets a flag that specifies if this is the default report style. -
getForecolor
- Specified by:
getForecolorin interfaceJRStyle
-
getOwnForecolor
- Specified by:
getOwnForecolorin interfaceJRStyle
-
getBackcolor
- Specified by:
getBackcolorin interfaceJRStyle
-
getOwnBackcolor
- Specified by:
getOwnBackcolorin interfaceJRStyle
-
getLinePen
- Specified by:
getLinePenin interfaceJRStyle
-
getFill
Description copied from interface:JRStyleIndicates the fill type used for this element. -
getOwnFill
- Specified by:
getOwnFillin interfaceJRStyle
-
getRadius
Description copied from interface:JRStyleIndicates the corner radius for rectangles with round corners. The default is 0. -
getOwnRadius
- Specified by:
getOwnRadiusin interfaceJRStyle
-
getScaleImage
Description copied from interface:JRStyleGets the image scale type.- Specified by:
getScaleImagein interfaceJRStyle- Returns:
- one of the scale types defined in
ScaleImageEnum
-
getOwnScaleImage
Description copied from interface:JRStyleGets the image own scale type.- Specified by:
getOwnScaleImagein interfaceJRStyle- Returns:
- one of the scale types defined in
ScaleImageEnum
-
getHorizontalTextAlign
Description copied from interface:JRStyleGets the horizontal text alignment of the element.- Specified by:
getHorizontalTextAlignin interfaceJRStyle- Returns:
- one of the alignment values defined in
HorizontalTextAlignEnum
-
getOwnHorizontalTextAlign
- Specified by:
getOwnHorizontalTextAlignin interfaceJRStyle
-
getVerticalTextAlign
Description copied from interface:JRStyleGets the vertical text alignment of the element.- Specified by:
getVerticalTextAlignin interfaceJRStyle- Returns:
- one of the alignment values defined in
VerticalTextAlignEnum
-
getOwnVerticalTextAlign
- Specified by:
getOwnVerticalTextAlignin interfaceJRStyle
-
getHorizontalImageAlign
Description copied from interface:JRStyleGets the horizontal image alignment of the element.- Specified by:
getHorizontalImageAlignin interfaceJRStyle- Returns:
- one of the alignment values defined in
HorizontalImageAlignEnum
-
getOwnHorizontalImageAlign
- Specified by:
getOwnHorizontalImageAlignin interfaceJRStyle
-
getVerticalImageAlign
Description copied from interface:JRStyleGets the vertical image alignment of the element.- Specified by:
getVerticalImageAlignin interfaceJRStyle- Returns:
- one of the alignment values defined in
VerticalImageAlignEnum
-
getOwnVerticalImageAlign
- Specified by:
getOwnVerticalImageAlignin interfaceJRStyle
-
getLineBox
- Specified by:
getLineBoxin interfaceJRBoxContainer
-
getParagraph
- Specified by:
getParagraphin interfaceJRParagraphContainer
-
getRotation
Description copied from interface:JRStyleGets the text rotation.- Specified by:
getRotationin interfaceJRStyle- Returns:
- a value representing one of the rotation values in the
RotationEnum.
-
getOwnRotation
Description copied from interface:JRStyleGets the text own rotation.- Specified by:
getOwnRotationin interfaceJRStyle- Returns:
- a value representing one of the rotation values in the
RotationEnum.
-
setRotation
- Specified by:
setRotationin interfaceJRStyle
-
getMarkup
Description copied from interface:JRStyleReturns the markup language used to format the text. -
getOwnMarkup
- Specified by:
getOwnMarkupin interfaceJRStyle
-
isBlankWhenNull
- Specified by:
isBlankWhenNullin interfaceJRStyle
-
isOwnBlankWhenNull
- Specified by:
isOwnBlankWhenNullin interfaceJRStyle
-
getFontName
- Specified by:
getFontNamein interfaceJRStyle
-
getOwnFontName
- Specified by:
getOwnFontNamein interfaceJRStyle
-
isBold
-
isOwnBold
-
isItalic
-
isOwnItalic
- Specified by:
isOwnItalicin interfaceJRStyle
-
isUnderline
- Specified by:
isUnderlinein interfaceJRStyle
-
isOwnUnderline
- Specified by:
isOwnUnderlinein interfaceJRStyle
-
isStrikeThrough
- Specified by:
isStrikeThroughin interfaceJRStyle
-
isOwnStrikeThrough
- Specified by:
isOwnStrikeThroughin interfaceJRStyle
-
getFontSize
- Specified by:
getFontSizein interfaceJRStyle
-
getOwnFontSize
- Specified by:
getOwnFontSizein interfaceJRStyle
-
getPdfFontName
- Specified by:
getPdfFontNamein interfaceJRStyle
-
getOwnPdfFontName
- Specified by:
getOwnPdfFontNamein interfaceJRStyle
-
getPdfEncoding
- Specified by:
getPdfEncodingin interfaceJRStyle
-
getOwnPdfEncoding
- Specified by:
getOwnPdfEncodingin interfaceJRStyle
-
isPdfEmbedded
- Specified by:
isPdfEmbeddedin interfaceJRStyle
-
isOwnPdfEmbedded
- Specified by:
isOwnPdfEmbeddedin interfaceJRStyle
-
getPattern
Description copied from interface:JRStyleGets 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:
getPatternin interfaceJRStyle- Returns:
- a string containing the pattern.
-
getOwnPattern
- Specified by:
getOwnPatternin interfaceJRStyle
-
getMode
Description copied from interface:JRStyleReturns 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:
getOwnModein interfaceJRStyle
-
setForecolor
- Specified by:
setForecolorin interfaceJRStyle
-
setBackcolor
- Specified by:
setBackcolorin interfaceJRStyle
-
setMode
-
setFill
-
setRadius
-
setScaleImage
- Specified by:
setScaleImagein interfaceJRStyle
-
setHorizontalImageAlign
- Specified by:
setHorizontalImageAlignin interfaceJRStyle
-
setVerticalImageAlign
- Specified by:
setVerticalImageAlignin interfaceJRStyle
-
setHorizontalTextAlign
- Specified by:
setHorizontalTextAlignin interfaceJRStyle
-
setVerticalTextAlign
- Specified by:
setVerticalTextAlignin interfaceJRStyle
-
setFontName
- Specified by:
setFontNamein interfaceJRStyle
-
setBold
-
setItalic
-
setPdfEmbedded
- Specified by:
setPdfEmbeddedin interfaceJRStyle
-
setStrikeThrough
- Specified by:
setStrikeThroughin interfaceJRStyle
-
setMarkup
-
setBlankWhenNull
- Specified by:
setBlankWhenNullin interfaceJRStyle
-
setUnderline
- Specified by:
setUnderlinein interfaceJRStyle
-
setPattern
- Specified by:
setPatternin interfaceJRStyle
-
setPdfEncoding
- Specified by:
setPdfEncodingin interfaceJRStyle
-
setPdfFontName
- Specified by:
setPdfFontNamein interfaceJRStyle
-
setFontSize
- Specified by:
setFontSizein interfaceJRStyle
-
getConditionalStyles
- Specified by:
getConditionalStylesin interfaceJRStyle
-
getStyleNameReference
Description copied from interface:JRStyleContainerReturns the name of an external style which is to be used by this object. External styles are defined intemplatesand are resolved at fill time. This attribute is only effective if no direct style (as returned bygetStyle()is specified for this object.- Specified by:
getStyleNameReferencein interfaceJRStyleContainer- Returns:
- the name of an external style
-
getDefaultLineWidth
- Specified by:
getDefaultLineWidthin interfaceJRPenContainer
-
getDefaultLineColor
- Specified by:
getDefaultLineColorin interfaceJRBoxContainer- Specified by:
getDefaultLineColorin interfaceJRPenContainer
-
getEventSupport
Description copied from interface:JRChangeEventsSupportReturns the property change support object for this instance.- Specified by:
getEventSupportin interfaceJRChangeEventsSupport- Returns:
- the property change support object for this instance
-
clone
- Specified by:
clonein interfaceJRCloneable- Overrides:
clonein classObject
-
getHashCode
public int getHashCode()Description copied from interface:DeduplicableReturns 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:
getHashCodein interfaceDeduplicable- Returns:
- deduplication hash code
-
addStyleHash
-
isIdentical
Description copied from interface:DeduplicableDetermines if this instance is identical to another object.- Specified by:
isIdenticalin interfaceDeduplicable- Parameters:
object- the object to compare with this instance- Returns:
trueif the two objects are identical and can be deduplicated
-
identicalStyle
-