Class ALcdSVGShapeWriter

java.lang.Object
com.luciad.format.svg.ALcdSVGShapeWriter
All Implemented Interfaces:
ILcdSVGShapeWriter
Direct Known Subclasses:
TLcdSVGUnStyledShapeWriter

public abstract class ALcdSVGShapeWriter extends Object implements ILcdSVGShapeWriter
This is the abstract superclass for TLcdSVGUnStyledShapeWriter. It contains an implementation of the writeElement method and some utility methods to write properties of elements. Protected method are added for supported elements:
  • ILcdCircle
  • ILcdPolyline
  • ILcdPolygon
  • ILcdText
  • ILcdBounds
  • ILcdShapeList
  • ILcdEllipse
When the property TrueSVG is false ( default value), additional non-svg shapes can be written
  • ILcdPoint
  • ILcdArcBand
  • Constructor Details

    • ALcdSVGShapeWriter

      public ALcdSVGShapeWriter()
  • Method Details

    • setTrueSVG

      public void setTrueSVG(boolean aTrueSVG)
      Set to write true SVG or not.
      Specified by:
      setTrueSVG in interface ILcdSVGShapeWriter
      Parameters:
      aTrueSVG - if true, true SVG will be written, if false additional shapes can be written.
    • isTrueSVG

      public boolean isTrueSVG()
      Checks if this writer is a True SVG writer or not.
      Returns:
      true if the writer is a true SVG writer.
    • writeElement

      public void writeElement(Object aObject, Writer aTarget) throws IOException
      Writes an object on the writer as an SVG element. This implementation checks the class of the object and writes the following shapes:
      • ILcdCircle
      • ILcdPolyline
      • ILcdPolygon
      • ILcdText
      • ILcdEllipse
      • ILcdShapeList
      • ILcdBounds
      unconditionally as elements. If trueSVG is set to true, these shapes are also written to the writer:
      • ILcdPoint
      • ILcdArcband
      All these shapes are written using the according write method. If the object is none of the above, nothing is passed to the writer.
      Specified by:
      writeElement in interface ILcdSVGShapeWriter
      Parameters:
      aObject - the Object to be written.
      aTarget - the StringBuffer to write the given element to/
      Throws:
      IOException - when output to aTarget fails.
    • writeUnknownShape

      protected abstract void writeUnknownShape(ILcdShape aShape, Writer aTarget) throws IOException
      Appends an unknown ILcdShape to a StringBuffer.
      Parameters:
      aShape - the unknown ILcdShape
      aTarget - the StringBuffer
      Throws:
      IOException - for I/O errors.
    • writeCircle

      protected abstract void writeCircle(ILcdCircle aCircle, Writer aTarget) throws IOException
      Appends an ILcdCircle to a StringBuffer.
      Parameters:
      aCircle - the ILcdCircle element
      aTarget - the StringBuffer
      Throws:
      IOException - when output to aTarget fails.
    • writePolyline

      protected abstract void writePolyline(ILcdPolyline aPolyline, Writer aTarget) throws IOException
      Appends an ILcdPolyline to a StringBuffer.
      Parameters:
      aPolyline - the ILcdPolyline
      aTarget - the StringBuffer
      Throws:
      IOException - when output to aTarget fails.
    • writePolygon

      protected abstract void writePolygon(ILcdPolygon aPolygon, Writer aTarget) throws IOException
      Appends an ILcdPolygon to a StringBuffer.
      Parameters:
      aPolygon - the ILcdPolygon
      aTarget - the StringBuffer
      Throws:
      IOException - when output to aTarget fails.
    • writeBounds

      protected abstract void writeBounds(ILcdBounds aBounds, Writer aTarget) throws IOException
      Appends an ILcdBounds to a StringBuffer.
      Parameters:
      aBounds - the ILcdBounds
      aTarget - the StringBuffer
      Throws:
      IOException - when output to aTarget fails.
    • writeText

      protected abstract void writeText(ILcdText aText, Writer aTarget) throws IOException
      Appends an ILcdText to a StringBuffer.
      Parameters:
      aText - the ILcdText
      aTarget - the StringBuffer
      Throws:
      IOException - when output to aTarget fails.
    • writeShapeList

      protected abstract void writeShapeList(ILcdShapeList aShapeList, Writer aTarget) throws IOException
      Appends an ILcdShapeList to a StringBuffer.
      Parameters:
      aShapeList - the ILcdShapeList
      aTarget - the StringBuffer
      Throws:
      IOException - when output to aTarget fails.
    • writePoint

      protected abstract void writePoint(ILcdPoint aPoint, Writer aTarget) throws IOException
      Appends an ILcdPoint to a StringBuffer. Warning: not a true svg tag shape !
      Parameters:
      aPoint - the ILcdPoint
      aTarget - the StringBuffer
      Throws:
      IOException - when output to aTarget fails.
    • writeArcBand

      protected abstract void writeArcBand(ILcdArcBand aArcBand, Writer aTarget) throws IOException
      Appends an ILcdArcBand to a StringBuffer. Warning: not a true svg tag shape !
      Parameters:
      aArcBand - the ILcdArcBand
      aTarget - the StringBuffer
      Throws:
      IOException - when output to aTarget fails.
    • writeEllipse

      protected abstract void writeEllipse(ILcdEllipse aEllipse, Writer aTarget) throws IOException
      Appends an ILcdEllipse to a StringBuffer. Warning: not a true svg tag shape !
      Parameters:
      aEllipse - the ILcdEllipse
      aTarget - the StringBuffer
      Throws:
      IOException - when output to aTarget fails.
    • writeProperty

      protected void writeProperty(String aKey, double aValue, Writer aStringBuffer) throws IOException
      Appends a property with a given key and a double value to a given StringBuffer.
      Parameters:
      aKey - a String containing the key of the property
      aValue - adouble containing the value of the property
      aStringBuffer - the StringBuffer
      Throws:
      IOException - when output to aStringBuffer fails.
    • writeProperty

      protected void writeProperty(String aKey, StringBuffer aValue, Writer aStringBuffer) throws IOException
      Appends a property with a given key and a StringBuffer value to a given StringBuffer.
      Parameters:
      aKey - a String containing the key of the property
      aValue - aStringBuffer containing the value of the property
      aStringBuffer - the StringBuffer
      Throws:
      IOException - when output to aStringBuffer fails.
    • writeProperty

      protected void writeProperty(String aKey, String aValue, Writer aStringBuffer) throws IOException
      Appends a property with a given key and a String value to a given StringBuffer.
      Parameters:
      aKey - a String containing the key of the property
      aValue - aString containing the value of the property
      aStringBuffer - the StringBuffer
      Throws:
      IOException - when output to aStringBuffer fails.