Class 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
  • Field Details

    • coords

      protected int[] coords
      array of x/y coordinates
    • relative

      protected boolean relative
      if true, then uses relative drawing order
  • Constructor Details

    • 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 Details

    • getDataLength

      public int getDataLength()
      Returns the data length of this structured field
      Returns:
      the data length of this structured field
    • writeToStream

      public void writeToStream(OutputStream os) throws IOException
      DataStream objects must implement the writeToStream() method to write its data to the given OutputStream
      Parameters:
      os - the outputsteam stream
      Throws:
      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 String toString()
      Overrides:
      toString in class Object
    • isRelative

      protected boolean isRelative()
      Returns true if this is a relative drawing order
      Returns:
      true if this is a relative drawing order