org.apache.fop.afp.goca

## Class AbstractGraphicsCoord

- java.lang.Object
- - org.apache.fop.afp.modca.AbstractAFPObject
  - - org.apache.fop.afp.goca.AbstractGraphicsDrawingOrder
    - - org.apache.fop.afp.goca.AbstractGraphicsCoord

- All Implemented Interfaces:
    Streamable, StructuredData
  Direct Known Subclasses:
    GraphicsBox, GraphicsCharacterString, GraphicsFillet, GraphicsFullArc, GraphicsLine, GraphicsSetArcParameters, GraphicsSetCurrentPosition

      public abstract class AbstractGraphicsCoord
      extends AbstractGraphicsDrawingOrder

  A base class encapsulating the structure of coordinate based GOCA objects

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.fop.afp.modca.AbstractAFPObject

      `AbstractAFPObject.Category, AbstractAFPObject.Type`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int[]` | `coords` array of x/y coordinates
    `protected boolean` | `relative` if true, then uses relative drawing order

    - ### Fields inherited from class org.apache.fop.afp.modca.AbstractAFPObject

      `LOG, SF_CLASS, SF_HEADER_LENGTH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractGraphicsCoord(int[] coords)` Constructor
    `AbstractGraphicsCoord(int[] coords, boolean relative)` Constructor
    `AbstractGraphicsCoord(int x, int y)` Constructor
    `AbstractGraphicsCoord(int x1, int y1, int x2, int y2)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addCoords(byte[] data, int fromIndex)` Adds the coordinates to the structured field data
    `int` | `getDataLength()` Returns the data length of this structured field
    `protected boolean` | `isRelative()` Returns true if this is a relative drawing order
    `java.lang.String` | `toString()`
    `void` | `writeToStream(java.io.OutputStream os)` DataStream objects must implement the writeToStream() method to write its data to the given OutputStream

    - ### Methods inherited from class org.apache.fop.afp.goca.AbstractGraphicsDrawingOrder

      `getName`

    - ### Methods inherited from class org.apache.fop.afp.modca.AbstractAFPObject

      `copySF, copySF, truncate, writeChunksToStream, writeObjects`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### coords

          protected int[] coords

      array of x/y coordinates

    - #### relative

          protected boolean relative

      if true, then uses relative drawing order

  - ### Constructor Detail

    - #### AbstractGraphicsCoord

          public AbstractGraphicsCoord(int[] coords)

      Constructor
      Parameters:
        `coords` - the x/y coordinates for this object

    - #### AbstractGraphicsCoord

          public AbstractGraphicsCoord(int[] coords,
                                       boolean relative)

      Constructor
      Parameters:
        `coords` - the x/y coordinates for this object
        `relative` - true if relative drawing order

    - #### AbstractGraphicsCoord

          public AbstractGraphicsCoord(int x,
                                       int y)

      Constructor
      Parameters:
        `x` - the x coordinate for this object
        `y` - the y coordinate for this object

    - #### AbstractGraphicsCoord

          public AbstractGraphicsCoord(int x1,
                                       int y1,
                                       int x2,
                                       int y2)

      Constructor
      Parameters:
        `x1` - the x1 coordinate for this object
        `y1` - the y1 coordinate for this object
        `x2` - the x2 coordinate for this object
        `y2` - the y2 coordinate for this object

  - ### Method Detail

    - #### getDataLength

          public int getDataLength()

      Returns the data length of this structured field
      Returns:
        the data length of this structured field

    - #### writeToStream

          public void writeToStream(java.io.OutputStream os)
                             throws java.io.IOException

      DataStream objects must implement the writeToStream() method to write its data to the given OutputStream
      Parameters:
        `os` - the outputsteam stream
      Throws:
        `java.io.IOException` - an I/O exception of some sort has occurred.

    - #### addCoords

          protected void addCoords(byte[] data,
                                   int fromIndex)

      Adds the coordinates to the structured field data
      Parameters:
        `data` - the structured field data
        `fromIndex` - the start index

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### isRelative

          protected boolean isRelative()

      Returns true if this is a relative drawing order
      Returns:
        true if this is a relative drawing order

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