Gnostice PDFOne
Pro. Ed. v5.0.0


com.gnostice.pdfone.graphics
Class PdfBrush

java.lang.Object
  extended bycom.gnostice.pdfone.graphics.PdfBrush
All Implemented Interfaces:
Cloneable

public class PdfBrush
extends Object
implements Cloneable

This class represents the brush with which text and shapes in a document are filled.

// Create a page
PdfPage page = new PdfPage();

// Create a brush and set its properties
PdfBrush brush = new PdfBrush();
brush.fillColor = Color.RED;
brush.brushPattern = PdfBrush.PATTERN_CROSS;

// Create a pen and set its properties
PdfPen pen = new PdfPen();
pen.capStyle = PdfPen.CAPSTYLE_ROUND;
pen.miterLimit = PdfPen.DEFAULT_MITERLIMIT * 2;
pen.width = PdfPen.DEFAULT_WIDTH * 50;
pen.joinStyle = PdfPen.JOINSTYLE_BEVEL;
pen.strokeColor = Color.GREEN;

// Set the pen and brush to the page
page.setBrush(brush);        
page.setPen(pen);

// Render a PDF element on the page
// with the pen and brush
page.drawSquare(100, 100, 50, true, true);

// Make some changes to the properties of the pen and brush
brush.fillColor = Color.YELLOW;
brush.brushPattern = PdfBrush.PATTERN_SOLID;
pen.strokeColor = Color.RED;

// Render another PDF element on the page
// with the modified pend and brush
page.drawCircle(300, 100, 50, true, true);

See Also:
PdfPen
Sample Code
See example.

Field Summary
 int brushPattern
          Fill pattern used by the brush.
 Color fillColor
          Color used by the brush.
static int PATTERN_BACKWARD_DIAGONAL
          Constant specfying the fill pattern consisting of vertical lines with their tops angled to the right.
static int PATTERN_CROSS
          Constant specfying the fill pattern that is a combination of PATTERN_VERTICAL and PATTERN_HORIZONTAL.
static int PATTERN_DIAGONAL_CROSS
          Constant specfying the fill pattern that is a combination of PATTERN_FORWARD_DIAGONAL and PATTERN_BACKWARD_DIAGONAL.
static int PATTERN_FORWARD_DIAGONAL
          Constant specfying the fill pattern consisting of vertical lines with their tops angled to the left.
static int PATTERN_HORIZONTAL
          Constant specfying a fill pattern consisting of horizontal lines.
static int PATTERN_SOLID
          Constant specfying the fill pattern that is made of solid color.
static int PATTERN_VERTICAL
          Constant specfying a fill pattern consisting of vertical lines.
 
Constructor Summary
PdfBrush()
           
PdfBrush(Color fillColor)
           
 
Method Summary
 Object clone()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATTERN_HORIZONTAL

public static final int PATTERN_HORIZONTAL
Constant specfying a fill pattern consisting of horizontal lines.

See Also:
Constant Field Values

PATTERN_VERTICAL

public static final int PATTERN_VERTICAL
Constant specfying a fill pattern consisting of vertical lines.

See Also:
Constant Field Values

PATTERN_FORWARD_DIAGONAL

public static final int PATTERN_FORWARD_DIAGONAL
Constant specfying the fill pattern consisting of vertical lines with their tops angled to the left.

See Also:
Constant Field Values

PATTERN_BACKWARD_DIAGONAL

public static final int PATTERN_BACKWARD_DIAGONAL
Constant specfying the fill pattern consisting of vertical lines with their tops angled to the right.

See Also:
Constant Field Values

PATTERN_CROSS

public static final int PATTERN_CROSS
Constant specfying the fill pattern that is a combination of PATTERN_VERTICAL and PATTERN_HORIZONTAL.

See Also:
Constant Field Values

PATTERN_DIAGONAL_CROSS

public static final int PATTERN_DIAGONAL_CROSS
Constant specfying the fill pattern that is a combination of PATTERN_FORWARD_DIAGONAL and PATTERN_BACKWARD_DIAGONAL.

See Also:
Constant Field Values

PATTERN_SOLID

public static final int PATTERN_SOLID
Constant specfying the fill pattern that is made of solid color.

See Also:
Constant Field Values

fillColor

public Color fillColor
Color used by the brush.


brushPattern

public int brushPattern
Fill pattern used by the brush.

Constructor Detail

PdfBrush

public PdfBrush()

PdfBrush

public PdfBrush(Color fillColor)
Method Detail

clone

public Object clone()

Gnostice PDFOne
Pro. Ed. v5.0.0

To contact our support team, send an e-mail to support@gnostice.com.
 
© 2010 Gnostice Information Technologies Private Limited. All rights reserved.
www.gnostice.com