Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
com.foxit.sdk.common.GraphState Class Reference

## Public Member Functions
| GraphState ()
| Constructor.
| GraphState (float line_width, int line_join, float miter_limit, int line_cap, float dash_phase, FloatArray dashes)
| Constructor, with parameters. More...
| GraphState (GraphState state)
| Constructor, with another graph state object. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. 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

  [in] | line_width | Line width. If 0 is set to this, it will be treated as 1 by default.
  [in] | line_join | Line join style. Please refer to values starting from com.foxit.sdk.common.GraphState.e_LineJoinMiter and this should be one of these values.
  [in] | miter_limit | The miter limit for line join.
  [in] | line_cap | Line cap style. Please refer to values starting from com.foxit.sdk.common.GraphState.e_LineCapButt and this should be one of these values.
  [in] | dash_phase | Dash phase for line dash pattern.
  [in] | dashes | A 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 graph state object.

Parameters

  [in] | state | Another graph state object.

## Member Function Documentation

## ◆ delete()

synchronized void com.foxit.sdk.common.GraphState.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

## ◆ 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 com.foxit.sdk.common.GraphState.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 com.foxit.sdk.common.GraphState.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

  [in] | line_width | Line width. If 0 is set to this, it will be treated as 1 by default.
  [in] | line_join | Line join style. Please refer to values starting from com.foxit.sdk.common.GraphState.e_LineJoinMiter and this should be one of these values.
  [in] | miter_limit | The miter limit for line join.
  [in] | line_cap | Line cap style. Please refer to values starting from com.foxit.sdk.common.GraphState.e_LineCapButt and this should be one of these values.
  [in] | dash_phase | Dash phase for line dash pattern.
  [in] | dashes | A 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] | value | Dash 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] | value | A 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 com.foxit.sdk.common.GraphState.e_LineCapButt and this should be one of these values.

Parameters

  [in] | value | Line 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 com.foxit.sdk.common.GraphState.e_LineJoinMiter and this should be one of these values.

Parameters

  [in] | value | Line 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] | value | Line 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] | value | The miter limit for line join.

Returns
  None.

## Member Data Documentation

## ◆ e_LineJoinBevel

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

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

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.