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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface net.sf.jasperreports.engine.JRStyle
PROPERTY_EVALUATION_TIME_ENABLED
-
-
Constructor Summary
Constructors Constructor Description JRBaseStyle()JRBaseStyle(String name)JRBaseStyle(JRDefaultStyleProvider defaultStyleProvider)JRBaseStyle(JRDefaultStyleProvider defaultStyleProvider, String name)JRBaseStyle(JRStyle style, JRAbstractObjectFactory factory)
-
Method Summary
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_CIRCULAR_DEPENDENCY
public static final String EXCEPTION_MESSAGE_KEY_CIRCULAR_DEPENDENCY
- See Also:
- Constant Field Values
-
PROPERTY_BACKCOLOR
public static final String PROPERTY_BACKCOLOR
- See Also:
- Constant Field Values
-
PROPERTY_BLANK_WHEN_NULL
public static final String PROPERTY_BLANK_WHEN_NULL
- See Also:
- Constant Field Values
-
PROPERTY_BOLD
public static final String PROPERTY_BOLD
- See Also:
- Constant Field Values
-
PROPERTY_FILL
public static final String PROPERTY_FILL
- See Also:
- Constant Field Values
-
PROPERTY_FONT_NAME
public static final String PROPERTY_FONT_NAME
- See Also:
- Constant Field Values
-
PROPERTY_FONT_SIZE
public static final String PROPERTY_FONT_SIZE
- See Also:
- Constant Field Values
-
PROPERTY_FORECOLOR
public static final String PROPERTY_FORECOLOR
- See Also:
- Constant Field Values
-
PROPERTY_HORIZONTAL_ALIGNMENT
public static final String PROPERTY_HORIZONTAL_ALIGNMENT
Deprecated.Replaced byPROPERTY_HORIZONTAL_TEXT_ALIGNMENTandPROPERTY_HORIZONTAL_IMAGE_ALIGNMENT.- See Also:
- Constant Field Values
-
PROPERTY_HORIZONTAL_TEXT_ALIGNMENT
public static final String PROPERTY_HORIZONTAL_TEXT_ALIGNMENT
- See Also:
- Constant Field Values
-
PROPERTY_HORIZONTAL_IMAGE_ALIGNMENT
public static final String PROPERTY_HORIZONTAL_IMAGE_ALIGNMENT
- See Also:
- Constant Field Values
-
PROPERTY_ITALIC
public static final String PROPERTY_ITALIC
- See Also:
- Constant Field Values
-
PROPERTY_LINE_SPACING
public static final String PROPERTY_LINE_SPACING
Deprecated.Replaced byJRBaseParagraph.PROPERTY_LINE_SPACING- See Also:
- Constant Field Values
-
PROPERTY_MODE
public static final String PROPERTY_MODE
- See Also:
- Constant Field Values
-
PROPERTY_PATTERN
public static final String PROPERTY_PATTERN
- See Also:
- Constant Field Values
-
PROPERTY_PDF_EMBEDDED
public static final String PROPERTY_PDF_EMBEDDED
- See Also:
- Constant Field Values
-
PROPERTY_PDF_ENCODING
public static final String PROPERTY_PDF_ENCODING
- See Also:
- Constant Field Values
-
PROPERTY_PDF_FONT_NAME
public static final String PROPERTY_PDF_FONT_NAME
- See Also:
- Constant Field Values
-
PROPERTY_RADIUS
public static final String PROPERTY_RADIUS
- See Also:
- Constant Field Values
-
PROPERTY_ROTATION
public static final String PROPERTY_ROTATION
- See Also:
- Constant Field Values
-
PROPERTY_SCALE_IMAGE
public static final String PROPERTY_SCALE_IMAGE
- See Also:
- Constant Field Values
-
PROPERTY_STRIKE_THROUGH
public static final String PROPERTY_STRIKE_THROUGH
- See Also:
- Constant Field Values
-
PROPERTY_MARKUP
public static final String PROPERTY_MARKUP
- See Also:
- Constant Field Values
-
PROPERTY_UNDERLINE
public static final String PROPERTY_UNDERLINE
- See Also:
- Constant Field Values
-
PROPERTY_VERTICAL_ALIGNMENT
public static final String PROPERTY_VERTICAL_ALIGNMENT
Deprecated.Replaced byPROPERTY_VERTICAL_TEXT_ALIGNMENTand "verticalImageAlignment".- See Also:
- Constant Field Values
-
PROPERTY_VERTICAL_TEXT_ALIGNMENT
public static final String PROPERTY_VERTICAL_TEXT_ALIGNMENT
- See Also:
- Constant Field Values
-
PROPERTY_VERTICAL_IMAGE_ALIGNMENT
public static final String PROPERTY_VERTICAL_IMAGE_ALIGNMENT
- See Also:
- Constant Field Values
-
defaultStyleProvider
protected final JRDefaultStyleProvider defaultStyleProvider
-
parentStyle
protected JRStyle parentStyle
-
parentStyleNameReference
protected String parentStyleNameReference
-
name
protected String name
-
isDefault
protected boolean isDefault
-
positionType
protected Byte positionType
-
stretchType
protected Byte stretchType
-
modeValue
protected ModeEnum modeValue
-
forecolor
protected Color forecolor
-
backcolor
protected Color backcolor
-
linePen
protected JRPen linePen
-
fillValue
protected FillEnum fillValue
-
radius
protected Integer radius
-
scaleImageValue
protected ScaleImageEnum scaleImageValue
-
horizontalTextAlign
protected HorizontalTextAlignEnum horizontalTextAlign
-
verticalTextAlign
protected VerticalTextAlignEnum verticalTextAlign
-
horizontalImageAlign
protected HorizontalImageAlignEnum horizontalImageAlign
-
verticalImageAlign
protected VerticalImageAlignEnum verticalImageAlign
-
lineBox
protected JRLineBox lineBox
-
paragraph
protected JRParagraph paragraph
-
fontName
protected String fontName
-
isBold
protected Boolean isBold
-
isItalic
protected Boolean isItalic
-
isUnderline
protected Boolean isUnderline
-
isStrikeThrough
protected Boolean isStrikeThrough
-
fontsize
protected Float fontsize
-
pdfFontName
protected String pdfFontName
-
pdfEncoding
protected String pdfEncoding
-
isPdfEmbedded
protected Boolean isPdfEmbedded
-
rotationValue
protected RotationEnum rotationValue
-
markup
protected String markup
-
pattern
protected String pattern
-
isBlankWhenNull
protected Boolean isBlankWhenNull
-
conditionalStyles
protected JRConditionalStyle[] conditionalStyles
-
-
Constructor Detail
-
JRBaseStyle
public JRBaseStyle()
-
JRBaseStyle
public JRBaseStyle(JRDefaultStyleProvider defaultStyleProvider)
-
JRBaseStyle
public JRBaseStyle(String name)
-
JRBaseStyle
public JRBaseStyle(JRDefaultStyleProvider defaultStyleProvider, String name)
-
JRBaseStyle
public JRBaseStyle(JRStyle style, JRAbstractObjectFactory factory)
-
-
Method Detail
-
setParentStyle
protected void setParentStyle(JRStyle parentStyle)
-
checkCircularParent
protected void checkCircularParent()
-
getDefaultStyleProvider
public JRDefaultStyleProvider getDefaultStyleProvider()
- Specified by:
getDefaultStyleProviderin interfaceJRStyleContainer
-
getStyleResolver
protected StyleResolver getStyleResolver()
-
getStyle
public JRStyle getStyle()
Description copied from interface:JRStyleContainerReturns this object's style.- Specified by:
getStylein interfaceJRStyleContainer- Returns:
- this object's style
-
getName
public String getName()
Description copied from interface:JRStyleGets the style unique name.
-
rename
public void rename(String newName)
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
public Color getForecolor()
- Specified by:
getForecolorin interfaceJRStyle
-
getOwnForecolor
public Color getOwnForecolor()
- Specified by:
getOwnForecolorin interfaceJRStyle
-
getBackcolor
public Color getBackcolor()
- Specified by:
getBackcolorin interfaceJRStyle
-
getOwnBackcolor
public Color getOwnBackcolor()
- Specified by:
getOwnBackcolorin interfaceJRStyle
-
getLinePen
public JRPen getLinePen()
- Specified by:
getLinePenin interfaceJRStyle
-
getFillValue
public FillEnum getFillValue()
Description copied from interface:JRStyleIndicates the fill type used for this element.- Specified by:
getFillValuein interfaceJRStyle- Returns:
- one of the fill constants in
FillEnum.
-
getOwnFillValue
public FillEnum getOwnFillValue()
- Specified by:
getOwnFillValuein interfaceJRStyle
-
getRadius
public Integer getRadius()
Description copied from interface:JRStyleIndicates the corner radius for rectangles with round corners. The default is 0.
-
getOwnRadius
public Integer getOwnRadius()
- Specified by:
getOwnRadiusin interfaceJRStyle
-
getScaleImageValue
public ScaleImageEnum getScaleImageValue()
Description copied from interface:JRStyleGets the image scale type.- Specified by:
getScaleImageValuein interfaceJRStyle- Returns:
- one of the scale types defined in
ScaleImageEnum
-
getOwnScaleImageValue
public ScaleImageEnum getOwnScaleImageValue()
Description copied from interface:JRStyleGets the image own scale type.- Specified by:
getOwnScaleImageValuein interfaceJRStyle- Returns:
- one of the scale types defined in
ScaleImageEnum
-
getHorizontalTextAlign
public HorizontalTextAlignEnum 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
public HorizontalTextAlignEnum getOwnHorizontalTextAlign()
- Specified by:
getOwnHorizontalTextAlignin interfaceJRStyle
-
getVerticalTextAlign
public VerticalTextAlignEnum 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
public VerticalTextAlignEnum getOwnVerticalTextAlign()
- Specified by:
getOwnVerticalTextAlignin interfaceJRStyle
-
getHorizontalImageAlign
public HorizontalImageAlignEnum 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
public HorizontalImageAlignEnum getOwnHorizontalImageAlign()
- Specified by:
getOwnHorizontalImageAlignin interfaceJRStyle
-
getVerticalImageAlign
public VerticalImageAlignEnum 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
public VerticalImageAlignEnum getOwnVerticalImageAlign()
- Specified by:
getOwnVerticalImageAlignin interfaceJRStyle
-
getLineBox
public JRLineBox getLineBox()
- Specified by:
getLineBoxin interfaceJRBoxContainer- Specified by:
getLineBoxin interfaceJRStyle
-
getParagraph
public JRParagraph getParagraph()
- Specified by:
getParagraphin interfaceJRParagraphContainer
-
getRotationValue
public RotationEnum getRotationValue()
Description copied from interface:JRStyleGets the text rotation.- Specified by:
getRotationValuein interfaceJRStyle- Returns:
- a value representing one of the rotation values in the
RotationEnum.
-
getOwnRotationValue
public RotationEnum getOwnRotationValue()
Description copied from interface:JRStyleGets the text own rotation.- Specified by:
getOwnRotationValuein interfaceJRStyle- Returns:
- a value representing one of the rotation values in the
RotationEnum.
-
setRotation
public void setRotation(RotationEnum rotationValue)
- Specified by:
setRotationin interfaceJRStyle
-
getMarkup
public String getMarkup()
Description copied from interface:JRStyleReturns the markup language used to format the text.
-
getOwnMarkup
public String getOwnMarkup()
- Specified by:
getOwnMarkupin interfaceJRStyle
-
isBlankWhenNull
public Boolean isBlankWhenNull()
- Specified by:
isBlankWhenNullin interfaceJRStyle
-
isOwnBlankWhenNull
public Boolean isOwnBlankWhenNull()
- Specified by:
isOwnBlankWhenNullin interfaceJRStyle
-
getFontName
public String getFontName()
- Specified by:
getFontNamein interfaceJRStyle
-
getOwnFontName
public String getOwnFontName()
- Specified by:
getOwnFontNamein interfaceJRStyle
-
isOwnItalic
public Boolean isOwnItalic()
- Specified by:
isOwnItalicin interfaceJRStyle
-
isUnderline
public Boolean isUnderline()
- Specified by:
isUnderlinein interfaceJRStyle
-
isOwnUnderline
public Boolean isOwnUnderline()
- Specified by:
isOwnUnderlinein interfaceJRStyle
-
isStrikeThrough
public Boolean isStrikeThrough()
- Specified by:
isStrikeThroughin interfaceJRStyle
-
isOwnStrikeThrough
public Boolean isOwnStrikeThrough()
- Specified by:
isOwnStrikeThroughin interfaceJRStyle
-
getFontsize
public Float getFontsize()
- Specified by:
getFontsizein interfaceJRStyle
-
getOwnFontsize
public Float getOwnFontsize()
- Specified by:
getOwnFontsizein interfaceJRStyle
-
getPdfFontName
public String getPdfFontName()
- Specified by:
getPdfFontNamein interfaceJRStyle
-
getOwnPdfFontName
public String getOwnPdfFontName()
- Specified by:
getOwnPdfFontNamein interfaceJRStyle
-
getPdfEncoding
public String getPdfEncoding()
- Specified by:
getPdfEncodingin interfaceJRStyle
-
getOwnPdfEncoding
public String getOwnPdfEncoding()
- Specified by:
getOwnPdfEncodingin interfaceJRStyle
-
isPdfEmbedded
public Boolean isPdfEmbedded()
- Specified by:
isPdfEmbeddedin interfaceJRStyle
-
isOwnPdfEmbedded
public Boolean isOwnPdfEmbedded()
- Specified by:
isOwnPdfEmbeddedin interfaceJRStyle
-
getPattern
public String 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
public String getOwnPattern()
- Specified by:
getOwnPatternin interfaceJRStyle
-
getModeValue
public ModeEnum getModeValue()
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.- Specified by:
getModeValuein interfaceJRStyle
-
getOwnModeValue
public ModeEnum getOwnModeValue()
- Specified by:
getOwnModeValuein interfaceJRStyle
-
setForecolor
public void setForecolor(Color forecolor)
- Specified by:
setForecolorin interfaceJRStyle
-
setBackcolor
public void setBackcolor(Color backcolor)
- Specified by:
setBackcolorin interfaceJRStyle
-
setScaleImage
public void setScaleImage(ScaleImageEnum scaleImageValue)
- Specified by:
setScaleImagein interfaceJRStyle
-
setHorizontalImageAlign
public void setHorizontalImageAlign(HorizontalImageAlignEnum horizontalImageAlign)
- Specified by:
setHorizontalImageAlignin interfaceJRStyle
-
setVerticalImageAlign
public void setVerticalImageAlign(VerticalImageAlignEnum verticalImageAlign)
- Specified by:
setVerticalImageAlignin interfaceJRStyle
-
setHorizontalTextAlign
public void setHorizontalTextAlign(HorizontalTextAlignEnum horizontalTextAlign)
- Specified by:
setHorizontalTextAlignin interfaceJRStyle
-
setVerticalTextAlign
public void setVerticalTextAlign(VerticalTextAlignEnum verticalTextAlign)
- Specified by:
setVerticalTextAlignin interfaceJRStyle
-
setFontName
public void setFontName(String fontName)
- Specified by:
setFontNamein interfaceJRStyle
-
setPdfEmbedded
public void setPdfEmbedded(Boolean pdfEmbedded)
- Specified by:
setPdfEmbeddedin interfaceJRStyle
-
setStrikeThrough
public void setStrikeThrough(Boolean strikeThrough)
- Specified by:
setStrikeThroughin interfaceJRStyle
-
setBlankWhenNull
public void setBlankWhenNull(Boolean isBlankWhenNull)
- Specified by:
setBlankWhenNullin interfaceJRStyle
-
setUnderline
public void setUnderline(Boolean underline)
- Specified by:
setUnderlinein interfaceJRStyle
-
setPattern
public void setPattern(String pattern)
- Specified by:
setPatternin interfaceJRStyle
-
setPdfEncoding
public void setPdfEncoding(String pdfEncoding)
- Specified by:
setPdfEncodingin interfaceJRStyle
-
setPdfFontName
public void setPdfFontName(String pdfFontName)
- Specified by:
setPdfFontNamein interfaceJRStyle
-
setFontSize
public void setFontSize(Float fontSize)
- Specified by:
setFontSizein interfaceJRStyle
-
getConditionalStyles
public JRConditionalStyle[] getConditionalStyles()
- Specified by:
getConditionalStylesin interfaceJRStyle
-
getStyleNameReference
public String 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
public Float getDefaultLineWidth()
- Specified by:
getDefaultLineWidthin interfaceJRPenContainer
-
getDefaultLineColor
public Color getDefaultLineColor()
- Specified by:
getDefaultLineColorin interfaceJRBoxContainer- Specified by:
getDefaultLineColorin interfaceJRPenContainer
-
getEventSupport
public JRPropertyChangeSupport 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
public Object 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
protected void addStyleHash(ObjectUtils.HashCode hash)
-
isIdentical
public boolean isIdentical(Object object)
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
protected boolean identicalStyle(JRBaseStyle style)
-
-