com.foxit.sdk.common.GraphState Class Reference

Public Member Functions

 GraphState (float line_width, int line_join, float miter_limit, int line_cap, float dash_phase, FloatArray dashes)
 Constructor, with parameters. More...
 
 GraphState ()
 Constructor.

 
 GraphState (GraphState state)
 Constructor, with another GraphState object. More...
 
float getDash_phase ()
 Get dash phase for dash pattern. More...
 
FloatArray getDashes ()
 Get a dash array that represents the dash patterns. More...
 
int getLine_cap ()
 Get line cap style. More...
 
int getLine_join ()
 Get line join style. More...
 
float getLine_width ()
 Get line width. More...
 
float getMiter_limit ()
 Get the miter limit for line join. More...
 
void set (float line_width, int line_join, float miter_limit, int line_cap, float dash_phase, FloatArray dashes)
 Set value. More...
 
void setDash_phase (float value)
 Set dash phase for dash pattern. More...
 
void setDashes (FloatArray value)
 Set a dash array that represents the dash patterns. More...
 
void setLine_cap (int value)
 Set line cap style. More...
 
void setLine_join (int value)
 Set line join style. More...
 
void setLine_width (float value)
 Set line width. More...
 
void setMiter_limit (float value)
 Set the miter limit for line join. More...
 

Static Public Attributes

static final int e_LineCapButt = 0
 Butt cap. The stroke is squared off at the endpoint of a path. There is no projection beyond the end of a path.
 
static final int e_LineCapRound = 1
 Round cap. A semicircular arc with a diameter equal to the line width is drawn around the endpoint and filled in.
 
static final int e_LineCapSquare = 2
 Projecting square cap. The stroke continues beyond the endpoint of the path for a distance equal to half the line width and is squared off.
 
static final int e_LineJoinBevel = 2
 Bevel line join type. More...
 
static final int e_LineJoinMiter = 0
 Miter line join type. More...
 
static final int e_LineJoinRound = 1
 Round line join type. More...
 

Detailed Description

This class represents PDF graph states.

Constructor & Destructor Documentation

◆ GraphState() [1/2]

com.foxit.sdk.common.GraphState.GraphState ( float  line_width,
int  line_join,
float  miter_limit,
int  line_cap,
float  dash_phase,
FloatArray  dashes 
)

Constructor, with parameters.

Parameters
line_widthLine width. If 0 is set to this, it will be treated as 1 by default.
line_joinLine join style. Please refer to values starting from e_LineJoinMiter and this should be one of these values.
miter_limitThe miter limit for line join.
line_capLine cap style. Please refer to values starting from e_LineCapButt and this should be one of these values.
dash_phaseDash phase for line dash pattern.
dashesA dash array that represents the dash patterns. The value of each element in this array should not be negative.

◆ GraphState() [2/2]

com.foxit.sdk.common.GraphState.GraphState ( GraphState  state)

Constructor, with another GraphState object.

Parameters
stateAnother GraphState object.

Member Function Documentation

◆ getDash_phase()

com.foxit.sdk.common.GraphState.getDash_phase ( )

Get dash phase for dash pattern.

Returns
Dash phase for dash pattern.

◆ getDashes()

com.foxit.sdk.common.GraphState.getDashes ( )

Get a dash array that represents the dash patterns.

Returns
A dash array that represents the dash patterns. Value of each element in this array should not be negative.

◆ getLine_cap()

com.foxit.sdk.common.GraphState.getLine_cap ( )

Get line cap style.

The line cap style specifies the shape to be used at the ends of open sub-paths (and dashes, if any) when they are stroked. Please refer to values starting from e_LineCapButt and this should be one of these values.

Returns
Line cap style.

◆ getLine_join()

com.foxit.sdk.common.GraphState.getLine_join ( )

Get line join style.

The line join style specifies the shape to be used at the corners of paths that are stroked. Please refer to values starting from e_LineJoinMiter and this should be one of these values.

Returns
Line join style.

◆ getLine_width()

com.foxit.sdk.common.GraphState.getLine_width ( )

Get line width.

It should be a non-negative number in PDF coordinate system . If 0 is set to this, it will be treated as 1 by default.

Returns
Line width.

◆ getMiter_limit()

com.foxit.sdk.common.GraphState.getMiter_limit ( )

Get the miter limit for line join.

When two line segments meet at a sharp angle and mitered joins have been specified as the line join style, it is possible for the miter to extend far beyond the thickness of the line stroking the path. The miter limit imposes a maximum on the ratio of the miter length to the line width. When the limit is exceeded, the join is converted from a miter to a bevel.
Please refer to <PDF Reference 1.7> P217 "Miter Limit" for more details.

Returns
The miter limit for line join.

◆ set()

void com.foxit.sdk.common.GraphState.set ( float  line_width,
int  line_join,
float  miter_limit,
int  line_cap,
float  dash_phase,
FloatArray  dashes 
)

Set value.

Parameters
line_widthLine width. If 0 is set to this, it will be treated as 1 by default.
line_joinLine join style. Please refer to values starting from e_LineJoinMiter and this should be one of these values.
miter_limitThe miter limit for line join.
line_capLine cap style. Please refer to values starting from e_LineCapButt and this should be one of these values.
dash_phaseDash phase for line dash pattern.
dashesA dash array that represents the dash patterns. The value of each element in this array should not be negative.
Returns
None.

◆ setDash_phase()

com.foxit.sdk.common.GraphState.setDash_phase ( float  value)

Set dash phase for dash pattern.

Parameters
[in]dash_phaseDash phase for dash pattern.
Returns
None.

◆ setDashes()

com.foxit.sdk.common.GraphState.setDashes ( FloatArray  value)

Set a dash array that represents the dash patterns.

Parameters
[in]dashesA dash array that represents the dash patterns. Value of each element in this array should not be negative.
Returns
None.

◆ setLine_cap()

com.foxit.sdk.common.GraphState.setLine_cap ( int  value)

Set line cap style.

The line cap style specifies the shape to be used at the ends of open sub-paths (and dashes, if any) when they are stroked. Please refer to values starting from e_LineCapButt and this should be one of these values.

Parameters
[in]line_capLine cap style.
Returns
None.

◆ setLine_join()

com.foxit.sdk.common.GraphState.setLine_join ( int  value)

Set line join style.

The line join style specifies the shape to be used at the corners of paths that are stroked. Please refer to values starting from e_LineJoinMiter and this should be one of these values.

Parameters
[in]line_joinLine join style.
Returns
None.

◆ setLine_width()

com.foxit.sdk.common.GraphState.setLine_width ( float  value)

Set line width.

It should be a non-negative number in PDF coordinate system . If 0 is set to this, it will be treated as 1 by default.

Parameters
[in]line_widthLine width.
Returns
None.

◆ setMiter_limit()

com.foxit.sdk.common.GraphState.setMiter_limit ( float  value)

Set the miter limit for line join.

When two line segments meet at a sharp angle and mitered joins have been specified as the line join style, it is possible for the miter to extend far beyond the thickness of the line stroking the path. The miter limit imposes a maximum on the ratio of the miter length to the line width. When the limit is exceeded, the join is converted from a miter to a bevel.
Please refer to <PDF Reference 1.7> P217 "Miter Limit" for more details.

Parameters
[in]miter_limitThe miter limit for line join.
Returns
None.

Member Data Documentation

◆ e_LineJoinBevel

static final int com.foxit.sdk.common.GraphState.e_LineJoinBevel = 2
static

Bevel line join type.

The two segments are finished with butt caps and the resulting notch beyond the end of the segments is filled with a triangle.

◆ e_LineJoinMiter

static final int com.foxit.sdk.common.GraphState.e_LineJoinMiter = 0
static

Miter line join type.

The outer edges of the strokes for the two segments are extended until they meet at an angle.

◆ e_LineJoinRound

static final int com.foxit.sdk.common.GraphState.e_LineJoinRound = 1
static

Round line join type.

An arc of a circle with a diameter equal to the line width is drawn around the point where the two segments meet, connecting the outer edges of the strokes for the two segments.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.