Class AFPPainter.AFPGraphicsPainter

java.lang.Object
org.apache.fop.render.afp.AFPPainter.AFPGraphicsPainter
All Implemented Interfaces:
GraphicsPainter
Enclosing class:
AFPPainter

private static final class AFPPainter.AFPGraphicsPainter extends Object implements GraphicsPainter
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final AFPBorderPainter
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    arcTo(double startAngle, double endAngle, int cx, int cy, int width, int height)
    Draws an arc on the ellipse centered at (cx, cy) with width width and height height from start angle startAngle (with respect to the x-axis counter-clockwise) to the end angle endAngle.
    void
    Reduces the current clipping region to the current path.
    void
    Closes the current path.
    void
    drawBorderLine(int x1, int y1, int x2, int y2, boolean horz, boolean startOrBefore, int style, Color color)
    Draws a border line.
    void
    drawLine(Point start, Point end, int width, Color color, RuleStyle style)
    Draws a line/rule.
    void
    lineTo(int x, int y)
    Draws a line from the current cursor position to the given coordinates.
    void
    moveTo(int x, int y)
    Moves the cursor to the given coordinate.
    void
    Restore the last graphics state from the stack.
    void
    rotateCoordinates(double angle)
    Rotate the coordinate frame
    void
    Save the graphics state on the stack.
    void
    scaleCoordinates(float xScale, float yScale)
    Scale the coordinate frame
    private float
    toPoints(int mpt)
     
    void
    translateCoordinates(int xTranslate, int yTranslate)
    Translate the coordinate frame

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • drawBorderLine

      public void drawBorderLine(int x1, int y1, int x2, int y2, boolean horz, boolean startOrBefore, int style, Color color) throws IOException
      Description copied from interface: GraphicsPainter
      Draws a border line.
      Specified by:
      drawBorderLine in interface GraphicsPainter
      Parameters:
      x1 - X coordinate of the upper left corner of the line's bounding rectangle (in millipoints)
      y1 - start Y coordinate of the upper left corner of the line's bounding rectangle (in millipoints)
      x2 - end X coordinate of the lower right corner of the line's bounding rectangle (in millipoints)
      y2 - end y coordinate of the lower right corner of the line's bounding rectangle (in millipoints)
      horz - true if it is a horizontal line
      startOrBefore - true if the line is the start or end edge of a border box
      style - the border style
      color - the border color
      Throws:
      IOException - if an I/O error occurs
    • toPoints

      private float toPoints(int mpt)
    • drawLine

      public void drawLine(Point start, Point end, int width, Color color, RuleStyle style) throws IOException
      Description copied from interface: GraphicsPainter
      Draws a line/rule.
      Specified by:
      drawLine in interface GraphicsPainter
      Parameters:
      start - start point (coordinates in millipoints)
      end - end point (coordinates in millipoints)
      width - width of the line
      color - the line color
      style - the rule style
      Throws:
      IOException - if an I/O error occurs
    • moveTo

      public void moveTo(int x, int y) throws IOException
      Description copied from interface: GraphicsPainter
      Moves the cursor to the given coordinate.
      Specified by:
      moveTo in interface GraphicsPainter
      Parameters:
      x - the X coordinate (in millipoints)
      y - the Y coordinate (in millipoints)
      Throws:
      IOException - if an I/O error occurs
    • lineTo

      public void lineTo(int x, int y) throws IOException
      Description copied from interface: GraphicsPainter
      Draws a line from the current cursor position to the given coordinates.
      Specified by:
      lineTo in interface GraphicsPainter
      Parameters:
      x - the X coordinate (in millipoints)
      y - the Y coordinate (in millipoints)
      Throws:
      IOException - if an I/O error occurs
    • arcTo

      public void arcTo(double startAngle, double endAngle, int cx, int cy, int width, int height) throws IOException
      Description copied from interface: GraphicsPainter
      Draws an arc on the ellipse centered at (cx, cy) with width width and height height from start angle startAngle (with respect to the x-axis counter-clockwise) to the end angle endAngle. The ellipses major axis are assumed to coincide with the coordinate axis. The current position MUST coincide with the starting position on the ellipse.
      Specified by:
      arcTo in interface GraphicsPainter
      Parameters:
      startAngle - the start angle
      endAngle - the end angle
      cx - the x coordinate of the ellipse center
      cy - the y coordinate of the ellipse center
      width - the extent of the ellipse in the x direction
      height - the extent of the ellipse in the y direction
      Throws:
      IOException - if an I/O error occurs
    • rotateCoordinates

      public void rotateCoordinates(double angle) throws IOException
      Description copied from interface: GraphicsPainter
      Rotate the coordinate frame
      Specified by:
      rotateCoordinates in interface GraphicsPainter
      Parameters:
      angle - angle in radians to rotate the coordinate frame
      Throws:
      IOException - if an I/O error occurs
    • translateCoordinates

      public void translateCoordinates(int xTranslate, int yTranslate) throws IOException
      Description copied from interface: GraphicsPainter
      Translate the coordinate frame
      Specified by:
      translateCoordinates in interface GraphicsPainter
      Parameters:
      xTranslate - translation in the x direction
      yTranslate - translation in the y direction
      Throws:
      IOException - if an I/O error occurs
    • scaleCoordinates

      public void scaleCoordinates(float xScale, float yScale) throws IOException
      Description copied from interface: GraphicsPainter
      Scale the coordinate frame
      Specified by:
      scaleCoordinates in interface GraphicsPainter
      Parameters:
      xScale - scale factor in the x direction
      yScale - scale factor in the y direction
      Throws:
      IOException - if an I/O error occurs
    • closePath

      public void closePath() throws IOException
      Description copied from interface: GraphicsPainter
      Closes the current path.
      Specified by:
      closePath in interface GraphicsPainter
      Throws:
      IOException - if an I/O error occurs
    • clip

      public void clip() throws IOException
      Description copied from interface: GraphicsPainter
      Reduces the current clipping region to the current path.
      Specified by:
      clip in interface GraphicsPainter
      Throws:
      IOException - if an I/O error occurs
    • saveGraphicsState

      public void saveGraphicsState() throws IOException
      Description copied from interface: GraphicsPainter
      Save the graphics state on the stack.
      Specified by:
      saveGraphicsState in interface GraphicsPainter
      Throws:
      IOException - if an I/O error occurs
    • restoreGraphicsState

      public void restoreGraphicsState() throws IOException
      Description copied from interface: GraphicsPainter
      Restore the last graphics state from the stack.
      Specified by:
      restoreGraphicsState in interface GraphicsPainter
      Throws:
      IOException - if an I/O error occurs