Package org.apache.fop.traits
Class BorderProps
- java.lang.Object
-
- org.apache.fop.traits.BorderProps
-
- All Implemented Interfaces:
java.io.Serializable
public class BorderProps extends java.lang.Object implements java.io.Serializable
Border properties. Class to store border trait properties for the area tree.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
BorderProps.BorderPropsDeserializer
static class
BorderProps.Mode
-
Field Summary
Fields Modifier and Type Field Description java.awt.Color
color
Border colorprivate BorderProps.Mode
mode
Border modeprivate int
radiusEnd
private int
radiusStart
private static long
serialVersionUID
int
style
Border style (one of EN_*)int
width
Border width
-
Constructor Summary
Constructors Modifier Constructor Description BorderProps(int style, int width, int radiusStart, int radiusEnd, java.awt.Color color, BorderProps.Mode mode)
Constructs a new BorderProps instance.private
BorderProps(java.lang.String style, int width, int radiusStart, int radiusEnd, java.awt.Color color, BorderProps.Mode mode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
static int
getClippedWidth(BorderProps bp)
private static int
getConstantForStyle(java.lang.String style)
BorderProps.Mode
getMode()
int
getRadiusEnd()
int
getRadiusStart()
private java.lang.String
getStyleString()
int
hashCode()
boolean
isCollapseOuter()
static BorderProps
makeRectangular(int style, int width, java.awt.Color color, BorderProps.Mode mode)
Factory method for a new BorderProps instance with rectangular corners.java.lang.String
toString()
static BorderProps
valueOf(FOUserAgent foUserAgent, java.lang.String s)
Returns a BorderProps represtation of a string of the format as written by BorderProps.toString().
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
style
public final int style
Border style (one of EN_*)
-
color
public final java.awt.Color color
Border color
-
width
public final int width
Border width
-
radiusStart
private final int radiusStart
-
radiusEnd
private final int radiusEnd
-
mode
private final BorderProps.Mode mode
Border mode
-
-
Constructor Detail
-
BorderProps
public BorderProps(int style, int width, int radiusStart, int radiusEnd, java.awt.Color color, BorderProps.Mode mode)
Constructs a new BorderProps instance.- Parameters:
style
- border style (one of EN_*)width
- border widthradiusStart
- radius of start corner in the direction perpendicular to border segmentradiusEnd
- radius of end corner in the direction perpendicular to border segmentcolor
- border colormode
- border mode ((one of SEPARATE, COLLAPSE_INNER and COLLAPSE_OUTER)
-
BorderProps
private BorderProps(java.lang.String style, int width, int radiusStart, int radiusEnd, java.awt.Color color, BorderProps.Mode mode)
-
-
Method Detail
-
makeRectangular
public static BorderProps makeRectangular(int style, int width, java.awt.Color color, BorderProps.Mode mode)
Factory method for a new BorderProps instance with rectangular corners.- Parameters:
style
- border style (one of EN_*)width
- border widthcolor
- border colormode
- border mode ((one of SEPARATE, COLLAPSE_INNER and COLLAPSE_OUTER)
-
getRadiusStart
public int getRadiusStart()
- Returns:
- the radius of the corner adjacent to the before or start border
-
getRadiusEnd
public int getRadiusEnd()
- Returns:
- the radius of the corner adjacent to the after or end border
-
getMode
public BorderProps.Mode getMode()
- Returns:
- the border mode ((one of SEPARATE, COLLAPSE_INNER and COLLAPSE_OUTER)
-
getClippedWidth
public static int getClippedWidth(BorderProps bp)
- Parameters:
bp
- the border properties or null- Returns:
- the effective width of the clipped part of the border
-
getStyleString
private java.lang.String getStyleString()
-
getConstantForStyle
private static int getConstantForStyle(java.lang.String style)
-
isCollapseOuter
public boolean isCollapseOuter()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
valueOf
public static BorderProps valueOf(FOUserAgent foUserAgent, java.lang.String s)
Returns a BorderProps represtation of a string of the format as written by BorderProps.toString().- Parameters:
foUserAgent
- FOP user agent caching ICC profiless
- the string- Returns:
- a BorderProps instance
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-