Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| xmlgraphics-commons 2.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xmlgraphics.ps
Class PSState

    java.lang.Object
      org.apache.xmlgraphics.ps.PSState

All Implemented Interfaces:
  Serializable

    public class PSState

extends Object
implements Serializable

This class holds the current state of the PostScript interpreter.

Version:
  $Id: PSState.java 1681108 2015-05-22 13:26:12Z ssteiner $
See Also:
  Serialized Form

Field Summary
`static String` | `DEFAULT_DASH` Default for setdash
`static Color` | `DEFAULT_RGB_COLOR` Default color in PostScript

Constructor Summary
`PSState()` Default constructor
`PSState(PSState org, boolean copyTransforms)` Copy constructor

Method Summary
`boolean` | `checkTransform(AffineTransform tf)` Check the current transform.
`void` | `concatMatrix(AffineTransform transform)` Concats the given transformation matrix with the current one.
`AffineTransform` | `getTransform()` Returns the transform.
`void` | `reestablish(PSGenerator gen)` Reestablishes the graphics state represented by this instance by issueing the necessary commands.
`boolean` | `useColor(Color value)` Establishes the specified color (RGB).
`boolean` | `useDash(String pattern)` Establishes the specified dash.
`boolean` | `useFont(String name, float size)` Establishes the specified font and size.
`boolean` | `useLineCap(int value)` Establishes the specified line cap.
`boolean` | `useLineJoin(int value)` Establishes the specified line join.
`boolean` | `useLineWidth(double value)` Establishes the specified line width.
`boolean` | `useMiterLimit(float value)` Establishes the specified miter limit.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_DASH

    public static final String DEFAULT_DASH

  Default for setdash

  See Also:
    Constant Field Values

### DEFAULT_RGB_COLOR

    public static final Color DEFAULT_RGB_COLOR

  Default color in PostScript

Constructor Detail

### PSState

    public PSState()

  Default constructor

### PSState

    public PSState(PSState org,
                   boolean copyTransforms)

  Copy constructor

  Parameters:
    `org` - the original to copy from
    `copyTransforms` - true if the list of matrix concats should be cloned, too

Method Detail

### getTransform

    public AffineTransform getTransform()

  Returns the transform.

  Returns:
    the current transformation matrix

### checkTransform

    public boolean checkTransform(AffineTransform tf)

  Check the current transform. The transform for the current state is the combination of all transforms in the current state. The parameter is compared against this current transform.

  Parameters:
    `tf` - the transform the check against
  Returns:
    true if the new transform is different then the current transform

### concatMatrix

    public void concatMatrix(AffineTransform transform)

  Concats the given transformation matrix with the current one.

  Parameters:
    `transform` - The new transformation matrix

### useLineCap

    public boolean useLineCap(int value)

  Establishes the specified line cap.

  Parameters:
    `value` - line cap (0, 1 or 2) as defined by the setlinecap command
  Returns:
    true if the line cap changed compared to the previous setting

### useLineJoin

    public boolean useLineJoin(int value)

  Establishes the specified line join.

  Parameters:
    `value` - line join (0, 1 or 2) as defined by the setlinejoin command
  Returns:
    true if the line join changed compared to the previous setting

### useMiterLimit

    public boolean useMiterLimit(float value)

  Establishes the specified miter limit.

  Parameters:
    `value` - the miter limit as defined by the setmiterlimit command
  Returns:
    true if the miter limit changed compared to the previous setting

### useLineWidth

    public boolean useLineWidth(double value)

  Establishes the specified line width.

  Parameters:
    `value` - line width as defined by the setlinewidth command
  Returns:
    true if the line width changed compared to the previous setting

### useDash

    public boolean useDash(String pattern)

  Establishes the specified dash.

  Parameters:
    `pattern` - dash pattern as defined by the setdash command
  Returns:
    true if the dash pattern changed compared to the previous setting

### useColor

    public boolean useColor(Color value)

  Establishes the specified color (RGB).

  Parameters:
    `value` - color as defined by the setrgbcolor command
  Returns:
    true if the color changed compared to the previous setting

### useFont

    public boolean useFont(String name,
                           float size)

  Establishes the specified font and size.

  Parameters:
    `name` - name of the font for the "F" command (see FOP Std Proc Set)
    `size` - size of the font
  Returns:
    true if the font changed compared to the previous setting

### reestablish

    public void reestablish(PSGenerator gen)
                     throws IOException

  Reestablishes the graphics state represented by this instance by issueing the necessary commands.

  Parameters:
    `gen` - The generator to use for output
  Throws:
    `IOException` - In case of an I/O problem

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| xmlgraphics-commons 2.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 1999-2017 The Apache Software Foundation. All Rights Reserved.