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
- Version:
- $Id: JRBaseStyle.java 5180 2012-03-29 13:23:12Z teodord $
- Author:
- Ionut Nedelcu (ionutned@users.sourceforge.net)
- See Also:
- Serialized Form
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
- 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 by
JRBaseParagraph.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
- See Also:
- Constant Field Values
defaultStyleProvider
protected 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
horizontalAlignmentValue
protected HorizontalAlignEnum horizontalAlignmentValue
verticalAlignmentValue
protected VerticalAlignEnum verticalAlignmentValue
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 Integer 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
JRBaseStyle
public JRBaseStyle()
JRBaseStyle
public JRBaseStyle(String name)
JRBaseStyle
public JRBaseStyle(JRStyle style,
JRAbstractObjectFactory factory)
setParentStyle
protected void setParentStyle(JRStyle parentStyle)
checkCircularParent
protected void checkCircularParent()
getDefaultStyleProvider
public JRDefaultStyleProvider getDefaultStyleProvider()
- Specified by:
getDefaultStyleProvider in interface JRStyleContainer
getStyle
public JRStyle getStyle()
- Description copied from interface:
JRStyleContainer
- Returns this object's style.
- Specified by:
getStyle in interface JRStyleContainer
- Returns:
- this object's style
getName
public String getName()
- Description copied from interface:
JRStyle
- Gets the style unique name.
- Specified by:
getName in interface JRStyle
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:
JRStyle
- Gets a flag that specifies if this is the default report style.
- Specified by:
isDefault in interface JRStyle
getForecolor
public Color getForecolor()
- Specified by:
getForecolor in interface JRStyle
getOwnForecolor
public Color getOwnForecolor()
- Specified by:
getOwnForecolor in interface JRStyle
getBackcolor
public Color getBackcolor()
- Specified by:
getBackcolor in interface JRStyle
getOwnBackcolor
public Color getOwnBackcolor()
- Specified by:
getOwnBackcolor in interface JRStyle
getLinePen
public JRPen getLinePen()
- Specified by:
getLinePen in interface JRStyle
getFillValue
public FillEnum getFillValue()
- Description copied from interface:
JRStyle
- Indicates the fill type used for this element.
- Specified by:
getFillValue in interface JRStyle
- Returns:
- one of the fill constants in
FillEnum.
getOwnFillValue
public FillEnum getOwnFillValue()
- Specified by:
getOwnFillValue in interface JRStyle
getRadius
public Integer getRadius()
- Description copied from interface:
JRStyle
- Indicates the corner radius for rectangles with round corners. The default is 0.
- Specified by:
getRadius in interface JRStyle
getOwnRadius
public Integer getOwnRadius()
- Specified by:
getOwnRadius in interface JRStyle
getScaleImageValue
public ScaleImageEnum getScaleImageValue()
- Description copied from interface:
JRStyle
- Gets the image scale type.
- Specified by:
getScaleImageValue in interface JRStyle
- Returns:
- one of the scale types defined in
ScaleImageEnum
getOwnScaleImageValue
public ScaleImageEnum getOwnScaleImageValue()
- Description copied from interface:
JRStyle
- Gets the image own scale type.
- Specified by:
getOwnScaleImageValue in interface JRStyle
- Returns:
- one of the scale types defined in
ScaleImageEnum
getHorizontalAlignmentValue
public HorizontalAlignEnum getHorizontalAlignmentValue()
- Description copied from interface:
JRStyle
- Gets the horizontal alignment of the element.
- Specified by:
getHorizontalAlignmentValue in interface JRStyle
- Returns:
- one of the alignment values defined in
HorizontalAlignEnum
getOwnHorizontalAlignmentValue
public HorizontalAlignEnum getOwnHorizontalAlignmentValue()
- Specified by:
getOwnHorizontalAlignmentValue in interface JRStyle
getVerticalAlignmentValue
public VerticalAlignEnum getVerticalAlignmentValue()
- Description copied from interface:
JRStyle
- Gets the vertical alignment of the element.
- Specified by:
getVerticalAlignmentValue in interface JRStyle
- Returns:
- one of the alignment values defined in
JRAlignment
getOwnVerticalAlignmentValue
public VerticalAlignEnum getOwnVerticalAlignmentValue()
- Specified by:
getOwnVerticalAlignmentValue in interface JRStyle
getLineBox
public JRLineBox getLineBox()
- Specified by:
getLineBox in interface JRBoxContainer- Specified by:
getLineBox in interface JRStyle
getParagraph
public JRParagraph getParagraph()
- Specified by:
getParagraph in interface JRParagraphContainer
getRotationValue
public RotationEnum getRotationValue()
- Description copied from interface:
JRStyle
- Gets the text rotation.
- Specified by:
getRotationValue in interface JRStyle
- Returns:
- a value representing one of the rotation values in the
RotationEnum.
getOwnRotationValue
public RotationEnum getOwnRotationValue()
- Description copied from interface:
JRStyle
- Gets the text own rotation.
- Specified by:
getOwnRotationValue in interface JRStyle
- Returns:
- a value representing one of the rotation values in the
RotationEnum.
setRotation
public void setRotation(RotationEnum rotationValue)
- Specified by:
setRotation in interface JRStyle
getLineSpacingValue
public LineSpacingEnum getLineSpacingValue()
- Deprecated. Replaced by
JRParagraph.getLineSpacing().
- Specified by:
getLineSpacingValue in interface JRStyle
getOwnLineSpacingValue
public LineSpacingEnum getOwnLineSpacingValue()
- Deprecated. Replaced by
JRParagraph.getOwnLineSpacing().
- Specified by:
getOwnLineSpacingValue in interface JRStyle
getMarkup
public String getMarkup()
- Description copied from interface:
JRStyle
- Returns the markup language used to format the text.
- Specified by:
getMarkup in interface JRStyle
getOwnMarkup
public String getOwnMarkup()
- Specified by:
getOwnMarkup in interface JRStyle
isBlankWhenNull
public Boolean isBlankWhenNull()
- Specified by:
isBlankWhenNull in interface JRStyle
isOwnBlankWhenNull
public Boolean isOwnBlankWhenNull()
- Specified by:
isOwnBlankWhenNull in interface JRStyle
getFontName
public String getFontName()
- Specified by:
getFontName in interface JRStyle
getOwnFontName
public String getOwnFontName()
- Specified by:
getOwnFontName in interface JRStyle
isBold
public Boolean isBold()
- Specified by:
isBold in interface JRStyle
isOwnBold
public Boolean isOwnBold()
- Specified by:
isOwnBold in interface JRStyle
isItalic
public Boolean isItalic()
- Specified by:
isItalic in interface JRStyle
isOwnItalic
public Boolean isOwnItalic()
- Specified by:
isOwnItalic in interface JRStyle
isUnderline
public Boolean isUnderline()
- Specified by:
isUnderline in interface JRStyle
isOwnUnderline
public Boolean isOwnUnderline()
- Specified by:
isOwnUnderline in interface JRStyle
isStrikeThrough
public Boolean isStrikeThrough()
- Specified by:
isStrikeThrough in interface JRStyle
isOwnStrikeThrough
public Boolean isOwnStrikeThrough()
- Specified by:
isOwnStrikeThrough in interface JRStyle
getFontSize
public Integer getFontSize()
- Specified by:
getFontSize in interface JRStyle
getOwnFontSize
public Integer getOwnFontSize()
- Specified by:
getOwnFontSize in interface JRStyle
getPdfFontName
public String getPdfFontName()
- Specified by:
getPdfFontName in interface JRStyle
getOwnPdfFontName
public String getOwnPdfFontName()
- Specified by:
getOwnPdfFontName in interface JRStyle
getPdfEncoding
public String getPdfEncoding()
- Specified by:
getPdfEncoding in interface JRStyle
getOwnPdfEncoding
public String getOwnPdfEncoding()
- Specified by:
getOwnPdfEncoding in interface JRStyle
isPdfEmbedded
public Boolean isPdfEmbedded()
- Specified by:
isPdfEmbedded in interface JRStyle
isOwnPdfEmbedded
public Boolean isOwnPdfEmbedded()
- Specified by:
isOwnPdfEmbedded in interface JRStyle
getPattern
public String 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 interface JRStyle
- Returns:
- a string containing the pattern.
getOwnPattern
public String getOwnPattern()
- Specified by:
getOwnPattern in interface JRStyle
getModeValue
public ModeEnum getModeValue()
- 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.
- Specified by:
getModeValue in interface JRStyle
getOwnModeValue
public ModeEnum getOwnModeValue()
- Specified by:
getOwnModeValue in interface JRStyle
setForecolor
public void setForecolor(Color forecolor)
- Specified by:
setForecolor in interface JRStyle
setBackcolor
public void setBackcolor(Color backcolor)
- Specified by:
setBackcolor in interface JRStyle
setMode
public void setMode(ModeEnum modeValue)
- Specified by:
setMode in interface JRStyle
setFill
public void setFill(FillEnum fillValue)
- Specified by:
setFill in interface JRStyle
setRadius
public void setRadius(int radius)
- Specified by:
setRadius in interface JRStyle
setRadius
public void setRadius(Integer radius)
- Specified by:
setRadius in interface JRStyle
setScaleImage
public void setScaleImage(ScaleImageEnum scaleImageValue)
- Specified by:
setScaleImage in interface JRStyle
setHorizontalAlignment
public void setHorizontalAlignment(HorizontalAlignEnum horizontalAlignmentValue)
- Specified by:
setHorizontalAlignment in interface JRStyle
setVerticalAlignment
public void setVerticalAlignment(VerticalAlignEnum verticalAlignmentValue)
- Specified by:
setVerticalAlignment in interface JRStyle
setFontName
public void setFontName(String fontName)
- Specified by:
setFontName in interface JRStyle
setBold
public void setBold(boolean bold)
- Specified by:
setBold in interface JRStyle
setBold
public void setBold(Boolean bold)
- Specified by:
setBold in interface JRStyle
setItalic
public void setItalic(boolean italic)
- Specified by:
setItalic in interface JRStyle
setItalic
public void setItalic(Boolean italic)
- Specified by:
setItalic in interface JRStyle
setPdfEmbedded
public void setPdfEmbedded(boolean pdfEmbedded)
- Specified by:
setPdfEmbedded in interface JRStyle
setPdfEmbedded
public void setPdfEmbedded(Boolean pdfEmbedded)
- Specified by:
setPdfEmbedded in interface JRStyle
setStrikeThrough
public void setStrikeThrough(boolean strikeThrough)
- Specified by:
setStrikeThrough in interface JRStyle
setStrikeThrough
public void setStrikeThrough(Boolean strikeThrough)
- Specified by:
setStrikeThrough in interface JRStyle
setMarkup
public void setMarkup(String markup)
- Specified by:
setMarkup in interface JRStyle
setBlankWhenNull
public void setBlankWhenNull(boolean isBlankWhenNull)
- Specified by:
setBlankWhenNull in interface JRStyle
setBlankWhenNull
public void setBlankWhenNull(Boolean isBlankWhenNull)
- Specified by:
setBlankWhenNull in interface JRStyle
setUnderline
public void setUnderline(boolean underline)
- Specified by:
setUnderline in interface JRStyle
setUnderline
public void setUnderline(Boolean underline)
- Specified by:
setUnderline in interface JRStyle
setLineSpacing
public void setLineSpacing(LineSpacingEnum lineSpacing)
- Deprecated. Replaced by
JRParagraph.setLineSpacing(LineSpacingEnum).
- Specified by:
setLineSpacing in interface JRStyle
setPattern
public void setPattern(String pattern)
- Specified by:
setPattern in interface JRStyle
setPdfEncoding
public void setPdfEncoding(String pdfEncoding)
- Specified by:
setPdfEncoding in interface JRStyle
setPdfFontName
public void setPdfFontName(String pdfFontName)
- Specified by:
setPdfFontName in interface JRStyle
setFontSize
public void setFontSize(int fontSize)
- Specified by:
setFontSize in interface JRStyle
setFontSize
public void setFontSize(Integer fontSize)
- Specified by:
setFontSize in interface JRStyle
getConditionalStyles
public JRConditionalStyle[] getConditionalStyles()
- Specified by:
getConditionalStyles in interface JRStyle
getStyleNameReference
public String 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 in
templates and are resolved
at fill time.
This attribute is only effective if no direct style (as returned by getStyle()
is specified for this object.
- Specified by:
getStyleNameReference in interface JRStyleContainer
- Returns:
- the name of an external style
getDefaultLineWidth
public Float getDefaultLineWidth()
- Specified by:
getDefaultLineWidth in interface JRPenContainer
getDefaultLineColor
public Color getDefaultLineColor()
- Specified by:
getDefaultLineColor in interface JRBoxContainer- Specified by:
getDefaultLineColor in interface JRPenContainer
getEventSupport
public JRPropertyChangeSupport getEventSupport()
- Description copied from interface:
JRChangeEventsSupport
- Returns the property change support object for this instance.
- Specified by:
getEventSupport in interface JRChangeEventsSupport
- Returns:
- the property change support object for this instance
clone
public Object clone()
- Specified by:
clone in interface JRCloneable- Overrides:
clone in class Object
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 wiwh
Deduplicable.isIdentical(Object),
i.e. if two objects are identical they should have the same hash code.
- Specified by:
getHashCode in interface Deduplicable
- Returns:
- deduplication hash code
addStyleHash
protected void addStyleHash(ObjectUtils.HashCode hash)
isIdentical
public boolean isIdentical(Object object)
- Description copied from interface:
Deduplicable
- Determines if this instance is identical to another object.
- Specified by:
isIdentical in interface Deduplicable
- Parameters:
object - the object to compare with this instance
- Returns:
true if the two objects are identical and can be deduplicated
identicalStyle
protected boolean identicalStyle(JRBaseStyle style)
Copyright © 2012. All Rights Reserved.