Package net.sf.jasperreports.engine.base
Class JRBasePen
- java.lang.Object
-
- net.sf.jasperreports.engine.base.JRBasePen
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Deduplicable
,JRChangeEventsSupport
,JRPen
- Direct Known Subclasses:
JRBaseBoxPen
public class JRBasePen extends Object implements JRPen, Serializable, Cloneable, JRChangeEventsSupport, Deduplicable
This is useful for drawing borders around text elements and images. Boxes can have borders and paddings, which can have different width and colour on each side of the element.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Color
lineColor
protected LineStyleEnum
lineStyle
protected Float
lineWidth
protected JRPenContainer
penContainer
static String
PROPERTY_LINE_COLOR
static String
PROPERTY_LINE_STYLE
static String
PROPERTY_LINE_WIDTH
-
Fields inherited from interface net.sf.jasperreports.engine.JRPen
LINE_WIDTH_0, LINE_WIDTH_1
-
-
Constructor Summary
Constructors Constructor Description JRBasePen()
JRBasePen(JRPenContainer penContainer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JRPen
clone(JRPenContainer penContainer)
JRPropertyChangeSupport
getEventSupport()
Returns the property change support object for this instance.int
getHashCode()
Returns a hash code to be used for the deduplicate map.Color
getLineColor()
Gets the line color.LineStyleEnum
getLineStyle()
Indicates the line style used for this pen.Float
getLineWidth()
Gets the line width used for this pen.Color
getOwnLineColor()
LineStyleEnum
getOwnLineStyle()
Indicates the line style used for this pen.Float
getOwnLineWidth()
JRPenContainer
getPenContainer()
String
getStyleNameReference()
protected StyleResolver
getStyleResolver()
boolean
isIdentical(Object object)
Determines if this instance is identical to another object.void
populateStyle()
void
setLineColor(Color lineColor)
Sets the line color.void
setLineStyle(LineStyleEnum lineStyle)
Specifies the line style.void
setLineWidth(Float lineWidth)
Sets the line width.
-
-
-
Field Detail
-
PROPERTY_LINE_WIDTH
public static final String PROPERTY_LINE_WIDTH
- See Also:
- Constant Field Values
-
PROPERTY_LINE_STYLE
public static final String PROPERTY_LINE_STYLE
- See Also:
- Constant Field Values
-
PROPERTY_LINE_COLOR
public static final String PROPERTY_LINE_COLOR
- See Also:
- Constant Field Values
-
penContainer
protected JRPenContainer penContainer
-
lineWidth
protected Float lineWidth
-
lineStyle
protected LineStyleEnum lineStyle
-
lineColor
protected Color lineColor
-
-
Constructor Detail
-
JRBasePen
public JRBasePen()
-
JRBasePen
public JRBasePen(JRPenContainer penContainer)
-
-
Method Detail
-
getPenContainer
public JRPenContainer getPenContainer()
- Specified by:
getPenContainer
in interfaceJRPen
-
getStyleResolver
protected StyleResolver getStyleResolver()
-
getLineWidth
public Float getLineWidth()
Description copied from interface:JRPen
Gets the line width used for this pen.- Specified by:
getLineWidth
in interfaceJRPen
- Returns:
- line width
-
getOwnLineWidth
public Float getOwnLineWidth()
- Specified by:
getOwnLineWidth
in interfaceJRPen
-
setLineWidth
public void setLineWidth(Float lineWidth)
Description copied from interface:JRPen
Sets the line width.- Specified by:
setLineWidth
in interfaceJRPen
- Parameters:
lineWidth
- the line width
-
getLineStyle
public LineStyleEnum getLineStyle()
Description copied from interface:JRPen
Indicates the line style used for this pen.- Specified by:
getLineStyle
in interfaceJRPen
- Returns:
- a value representing one of the line style constants in
LineStyleEnum
-
getOwnLineStyle
public LineStyleEnum getOwnLineStyle()
Description copied from interface:JRPen
Indicates the line style used for this pen.- Specified by:
getOwnLineStyle
in interfaceJRPen
- Returns:
- a value representing one of the line style constants in
LineStyleEnum
-
setLineStyle
public void setLineStyle(LineStyleEnum lineStyle)
Description copied from interface:JRPen
Specifies the line style.- Specified by:
setLineStyle
in interfaceJRPen
- Parameters:
lineStyle
- a value representing one of the line style constants inLineStyleEnum
-
getLineColor
public Color getLineColor()
Description copied from interface:JRPen
Gets the line color.- Specified by:
getLineColor
in interfaceJRPen
-
getOwnLineColor
public Color getOwnLineColor()
- Specified by:
getOwnLineColor
in interfaceJRPen
-
setLineColor
public void setLineColor(Color lineColor)
Description copied from interface:JRPen
Sets the line color.- Specified by:
setLineColor
in interfaceJRPen
-
getStyleNameReference
public String getStyleNameReference()
-
clone
public JRPen clone(JRPenContainer penContainer)
-
getEventSupport
public JRPropertyChangeSupport 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
-
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
-
isIdentical
public boolean isIdentical(Object object)
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
-
populateStyle
public void populateStyle()
- Specified by:
populateStyle
in interfaceJRPen
-
-