PDF Clown
0.1.2

org.pdfclown.documents.contents.objects
Class DrawCurve

java.lang.Object
  extended by org.pdfclown.documents.contents.objects.ContentObject
      extended by org.pdfclown.documents.contents.objects.Operation
          extended by org.pdfclown.documents.contents.objects.DrawCurve

@PDF(value=PDF10)
public final class DrawCurve
extends Operation

'Append a cubic Bezier curve to the current path' operation [PDF:1.6:4.4.1].

Such curves are defined by four points: two endpoints (the current point and the final point) and two control points (the first control point, associated to the current point, and the second control point, associated to the final point).

Since:
0.0.7
Version:
0.1.2, 02/04/12
Author:
Stefano Chizzolini (http://www.stefanochizzolini.it)

Field Summary
static String FinalOperator
          Specifies only the second control point (the first control point coincides with the initial point of the curve).
static String FullOperator
          Specifies both control points explicitly.
static String InitialOperator
          Specifies only the first control point (the second control point coincides with the final point of the curve).
 
Fields inherited from class org.pdfclown.documents.contents.objects.Operation
operands, operator
 
Constructor Summary
DrawCurve(double pointX, double pointY, double control1X, double control1Y, double control2X, double control2Y)
          Creates a fully-explicit curve.
DrawCurve(Point2D point, Point2D control1, Point2D control2)
          Creates a fully-explicit curve.
DrawCurve(Point2D point, Point2D control, String operator)
          Creates a partially-explicit curve.
DrawCurve(String operator, List<PdfDirectObject> operands)
           
 
Method Summary
 Point2D getControl1()
          Gets the first control point.
 Point2D getControl2()
          Gets the second control point.
 Point2D getPoint()
          Gets the final endpoint.
 void scan(ContentScanner.GraphicsState state)
          Applies this object to the specified graphics context, updating the specified graphics state.
 void setControl1(Point2D value)
           
 void setControl2(Point2D value)
           
 void setPoint(Point2D value)
           
 
Methods inherited from class org.pdfclown.documents.contents.objects.Operation
get, getOperands, getOperator, toString, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FinalOperator

public static final String FinalOperator
Specifies only the second control point (the first control point coincides with the initial point of the curve).

See Also:
Constant Field Values

FullOperator

public static final String FullOperator
Specifies both control points explicitly.

See Also:
Constant Field Values

InitialOperator

public static final String InitialOperator
Specifies only the first control point (the second control point coincides with the final point of the curve).

See Also:
Constant Field Values
Constructor Detail

DrawCurve

public DrawCurve(Point2D point,
                 Point2D control1,
                 Point2D control2)
Creates a fully-explicit curve.

Parameters:
point - Final endpoint.
control1 - First control point.
control2 - Second control point.

DrawCurve

public DrawCurve(double pointX,
                 double pointY,
                 double control1X,
                 double control1Y,
                 double control2X,
                 double control2Y)
Creates a fully-explicit curve.


DrawCurve

public DrawCurve(Point2D point,
                 Point2D control,
                 String operator)
Creates a partially-explicit curve.

Parameters:
point - Final endpoint.
control - Explicit control point.
operator - Operator (either InitialOperator or FinalOperator). It defines how to interpret the control parameter.

DrawCurve

public DrawCurve(String operator,
                 List<PdfDirectObject> operands)
Method Detail

getControl1

public Point2D getControl1()
Gets the first control point.


getControl2

public Point2D getControl2()
Gets the second control point.


getPoint

public Point2D getPoint()
Gets the final endpoint.


scan

public void scan(ContentScanner.GraphicsState state)
Description copied from class: ContentObject
Applies this object to the specified graphics context, updating the specified graphics state.

Overrides:
scan in class ContentObject
Parameters:
state - Graphics state.

setControl1

public void setControl1(Point2D value)
See Also:
getControl1()

setControl2

public void setControl2(Point2D value)
See Also:
getControl2()

setPoint

public void setPoint(Point2D value)
See Also:
getPoint()

PDF Clown
0.1.2

Project home page

Copyright © 2006-2013 Stefano Chizzolini. Some Rights Reserved.
This documentation is available under the terms of the GNU Free Documentation License.