ElegantJ PDF Library Java API Specification v1.1

com.elegantj.pdf
Class PDFPattern

java.lang.Object
  extended bycom.elegantj.pdf.PDFObject
      extended bycom.elegantj.pdf.PDFPattern

public class PDFPattern
extends PDFObject

Provides the PDFPattern object with the no. of Predefined Patterns like STAR, CIRCLE, OVAL, CHECK, HORIZONTAL, VERTICAL and INCLINED lines One can supply the customizable background and foreground for the PDFPattern It can works with PDFImage and user specified Graphics too. PDFPattern will be renderered according to the following preference : 1. First preference will be given to the PatternGraphics 2. Second preference will be given to the PDFImage 3. If both PatternGraphics and PDFImage are null, then Pattern will be renderered according to the PatternStyle.


Field Summary
static int CHECK_PATTERN
          Represents the CHECK pattern The possible value for the PDFPattern style
static int CIRCLE_PATTERN
          Represents the CIRCLE pattern The possible value for the PDFPattern style
static int HORIZONTAL_LINE_PATTERN
          Represents the HORIZONTAL LINE pattern The possible value for the PDFPattern style
static int INCLINED_LINE_PATTERN
          Represents the INCLINED LINE pattern The possible value for the PDFPattern style
static int OVAL_PATTERN
          Represents the OVAL pattern The possible value for the PDFPattern style
static int STAR_PATTERN
          Represents the STAR pattern The possible value for the PDFPattern style
static int VERTICAL_LINE_PATTERN
          Represents the VERTICAL LINE pattern The possible value for the PDFPattern style
 
Constructor Summary
PDFPattern()
          Constructs the PDFPattern
 
Method Summary
 java.lang.Object clone()
          Returns the clone of this object
 java.awt.Color getBackground()
          Returns the background color of the PDFPattern
 int getBoundingBoxHeight()
          Returns the bounding box height of the PDFPattern
 int getBoundingBoxWidth()
          Returns the bounding box width of the PDFPattern
 java.awt.Color getForeground()
          Returns the foreground color of the PDFPattern
 java.lang.String getName()
          Returns the name of the PDFPattern
 java.lang.String getPatternGraphics()
          Returns the pattern graphics of the PDFPattern
 int getPatternStyle()
          Returns the pattern style of the PDFPattern
 PDFImage getPDFImage()
          Returns the PDFImage, which used as a pattern
 void setBackground(java.awt.Color background)
          Sets the background color for the PDFPattern
 void setBoundingBoxHeight(int boundingBoxHeight)
          Sets the bounding box height for the PDFPattern
 void setBoundingBoxWidth(int boundingBoxWidth)
          Sets the bounding box width for the PDFPattern
 void setForeground(java.awt.Color foreground)
          Sets the foreground color for the PDFPattern
 void setImage(PDFImage pdfImage)
          Sets the PDFImage as a pattern
 void setPatternGraphics(java.lang.String patternGraphics)
          Sets the pattern graphics for the PDFPattern
 void setPatternStyle(int patternStyle)
          Sets the PatternStyle for the PDFPattern
 
Methods inherited from class com.elegantj.pdf.PDFObject
getPDFObjectID, getPDFObjectRefStr, getPDFObjectType, setPDFObjectID, setPDFObjectType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STAR_PATTERN

public static final int STAR_PATTERN
Represents the STAR pattern The possible value for the PDFPattern style

See Also:
Constant Field Values

CIRCLE_PATTERN

public static final int CIRCLE_PATTERN
Represents the CIRCLE pattern The possible value for the PDFPattern style

See Also:
Constant Field Values

OVAL_PATTERN

public static final int OVAL_PATTERN
Represents the OVAL pattern The possible value for the PDFPattern style

See Also:
Constant Field Values

CHECK_PATTERN

public static final int CHECK_PATTERN
Represents the CHECK pattern The possible value for the PDFPattern style

See Also:
Constant Field Values

HORIZONTAL_LINE_PATTERN

public static final int HORIZONTAL_LINE_PATTERN
Represents the HORIZONTAL LINE pattern The possible value for the PDFPattern style

See Also:
Constant Field Values

VERTICAL_LINE_PATTERN

public static final int VERTICAL_LINE_PATTERN
Represents the VERTICAL LINE pattern The possible value for the PDFPattern style

See Also:
Constant Field Values

INCLINED_LINE_PATTERN

public static final int INCLINED_LINE_PATTERN
Represents the INCLINED LINE pattern The possible value for the PDFPattern style

See Also:
Constant Field Values
Constructor Detail

PDFPattern

public PDFPattern()
Constructs the PDFPattern

Method Detail

setPatternStyle

public void setPatternStyle(int patternStyle)
Sets the PatternStyle for the PDFPattern

Parameters:
patternStyle - The possible values are STAR_PATTERN, CIRCLE_PATTERN, OVAL_PATTERN, CHECK_PATTERN, HORIZONTAL_LINE_PATTERN, "VERTICAL_LINE_PATTERN, INCLINED_LINE_PATTERN

getPatternStyle

public int getPatternStyle()
Returns the pattern style of the PDFPattern

Returns:
The pattern style of the PDFPattern The possible values are STAR_PATTERN, CIRCLE_PATTERN, OVAL_PATTERN, CHECK_PATTERN, HORIZONTAL_LINE_PATTERN, "VERTICAL_LINE_PATTERN, INCLINED_LINE_PATTERN

setBackground

public void setBackground(java.awt.Color background)
Sets the background color for the PDFPattern

Parameters:
background - The background color This background color will be considered only, if PDFImage is not set as a PDFPattern using metohd setImage, and also user specified pattern is not set using method setPatternGraphics Default value of the background color is White

getBackground

public java.awt.Color getBackground()
Returns the background color of the PDFPattern

Returns:
The background color

setForeground

public void setForeground(java.awt.Color foreground)
Sets the foreground color for the PDFPattern

Parameters:
foreground - The background color This foreground color will be considered only, if PDFImage is not set as a PDFPattern using method setImage, and also user specified pattern is not set using method setPatternGraphics Default value of the foreground color is Blue

getForeground

public java.awt.Color getForeground()
Returns the foreground color of the PDFPattern

Returns:
The foreground color

setImage

public void setImage(PDFImage pdfImage)
Sets the PDFImage as a pattern

Parameters:
pdfImage - The PDFImage, to set as a pattern If one can set the PDFImage for the PDFPattern then the Pattern Style, Background, Foreground and PatternGraphics will not be considered

getPDFImage

public PDFImage getPDFImage()
Returns the PDFImage, which used as a pattern

Returns:
The PDFImage, which used as a pattern

setBoundingBoxWidth

public void setBoundingBoxWidth(int boundingBoxWidth)
Sets the bounding box width for the PDFPattern

Parameters:
boundingBoxWidth - The bounding box width If user want only predefined types of Pattern style then no need to set it This will be only considered, if the customize graphics pattern is set and predefined pattern style is not set

getBoundingBoxWidth

public int getBoundingBoxWidth()
Returns the bounding box width of the PDFPattern

Returns:
The bounding box width

setBoundingBoxHeight

public void setBoundingBoxHeight(int boundingBoxHeight)
Sets the bounding box height for the PDFPattern


getBoundingBoxHeight

public int getBoundingBoxHeight()
Returns the bounding box height of the PDFPattern

Returns:
The bounding box width

setPatternGraphics

public void setPatternGraphics(java.lang.String patternGraphics)
Sets the pattern graphics for the PDFPattern

Parameters:
patternGraphics - The pattern graphics for the PDFPattern If user want to use only predefined types of Pattern style, then no need to set it. This graphics must be according to the PDF Specification. If this graphics is not proper, then Acrobat Reader could not open this PDF file successfully. If one can set the pattern graphics for the PDFPattern explicitly, then the Foreground, Background, PatternStyle will be not considered, also user have to set the BoundingBoxWidth and BoundingBoxHeight if has set the pattern graphics, Other wise this pattern graphics not working and the pattern generated based on the current pattern style

getPatternGraphics

public java.lang.String getPatternGraphics()
Returns the pattern graphics of the PDFPattern

Returns:
patternGraphics The pattern graphics for the PDFPattern

getName

public java.lang.String getName()
Returns the name of the PDFPattern

Returns:
The name of the PDFPattern

clone

public java.lang.Object clone()
Returns the clone of this object

Returns:
The clone of this object

ElegantJ PDF Library Java API Specification v1.1

For any feedback, suggestion, or query, please revert back to support@elegantjpdf.com

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjpdf.com
All Rights Reserved.