Package com.luciad.format.svg
Class ALcdSVGShapeWriter
java.lang.Object
com.luciad.format.svg.ALcdSVGShapeWriter
- All Implemented Interfaces:
ILcdSVGShapeWriter
- Direct Known Subclasses:
TLcdSVGUnStyledShapeWriter
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
ILcdPoint
ILcdArcBand
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if this writer is a True SVG writer or not.void
setTrueSVG
(boolean aTrueSVG) Set to write true SVG or not.protected abstract void
writeArcBand
(ILcdArcBand aArcBand, Writer aTarget) Appends anILcdArcBand
to aStringBuffer
.protected abstract void
writeBounds
(ILcdBounds aBounds, Writer aTarget) Appends anILcdBounds
to aStringBuffer
.protected abstract void
writeCircle
(ILcdCircle aCircle, Writer aTarget) Appends anILcdCircle
to aStringBuffer
.void
writeElement
(Object aObject, Writer aTarget) Writes an object on the writer as an SVG element.protected abstract void
writeEllipse
(ILcdEllipse aEllipse, Writer aTarget) Appends anILcdEllipse
to aStringBuffer
.protected abstract void
writePoint
(ILcdPoint aPoint, Writer aTarget) Appends anILcdPoint
to aStringBuffer
.protected abstract void
writePolygon
(ILcdPolygon aPolygon, Writer aTarget) Appends anILcdPolygon
to aStringBuffer
.protected abstract void
writePolyline
(ILcdPolyline aPolyline, Writer aTarget) Appends anILcdPolyline
to aStringBuffer
.protected void
writeProperty
(String aKey, double aValue, Writer aStringBuffer) Appends a property with a given key and a double value to a givenStringBuffer
.protected void
writeProperty
(String aKey, StringBuffer aValue, Writer aStringBuffer) Appends a property with a given key and aStringBuffer
value to a givenStringBuffer
.protected void
writeProperty
(String aKey, String aValue, Writer aStringBuffer) Appends a property with a given key and aString
value to a givenStringBuffer
.protected abstract void
writeShapeList
(ILcdShapeList aShapeList, Writer aTarget) Appends anILcdShapeList
to aStringBuffer
.protected abstract void
Appends anILcdText
to aStringBuffer
.protected abstract void
writeUnknownShape
(ILcdShape aShape, Writer aTarget) Appends an unknownILcdShape
to aStringBuffer
.
-
Constructor Details
-
ALcdSVGShapeWriter
public ALcdSVGShapeWriter()
-
-
Method Details
-
setTrueSVG
public void setTrueSVG(boolean aTrueSVG) Set to write true SVG or not.- Specified by:
setTrueSVG
in interfaceILcdSVGShapeWriter
- 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
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
- ILcdPoint
- ILcdArcband
- Specified by:
writeElement
in interfaceILcdSVGShapeWriter
- Parameters:
aObject
- theObject
to be written.aTarget
- theStringBuffer
to write the given element to/- Throws:
IOException
- when output to aTarget fails.
-
writeUnknownShape
Appends an unknownILcdShape
to aStringBuffer
.- Parameters:
aShape
- the unknownILcdShape
aTarget
- theStringBuffer
- Throws:
IOException
- for I/O errors.
-
writeCircle
Appends anILcdCircle
to aStringBuffer
.- Parameters:
aCircle
- theILcdCircle
element
aTarget
- theStringBuffer
- Throws:
IOException
- when output to aTarget fails.
-
writePolyline
Appends anILcdPolyline
to aStringBuffer
.- Parameters:
aPolyline
- theILcdPolyline
aTarget
- theStringBuffer
- Throws:
IOException
- when output to aTarget fails.
-
writePolygon
Appends anILcdPolygon
to aStringBuffer
.- Parameters:
aPolygon
- theILcdPolygon
aTarget
- theStringBuffer
- Throws:
IOException
- when output to aTarget fails.
-
writeBounds
Appends anILcdBounds
to aStringBuffer
.- Parameters:
aBounds
- theILcdBounds
aTarget
- theStringBuffer
- Throws:
IOException
- when output to aTarget fails.
-
writeText
Appends anILcdText
to aStringBuffer
.- Parameters:
aText
- theILcdText
aTarget
- theStringBuffer
- Throws:
IOException
- when output to aTarget fails.
-
writeShapeList
Appends anILcdShapeList
to aStringBuffer
.- Parameters:
aShapeList
- theILcdShapeList
aTarget
- theStringBuffer
- Throws:
IOException
- when output to aTarget fails.
-
writePoint
Appends anILcdPoint
to aStringBuffer
. Warning: not a true svg tag shape !- Parameters:
aPoint
- theILcdPoint
aTarget
- theStringBuffer
- Throws:
IOException
- when output to aTarget fails.
-
writeArcBand
Appends anILcdArcBand
to aStringBuffer
. Warning: not a true svg tag shape !- Parameters:
aArcBand
- theILcdArcBand
aTarget
- theStringBuffer
- Throws:
IOException
- when output to aTarget fails.
-
writeEllipse
Appends anILcdEllipse
to aStringBuffer
. Warning: not a true svg tag shape !- Parameters:
aEllipse
- theILcdEllipse
aTarget
- theStringBuffer
- Throws:
IOException
- when output to aTarget fails.
-
writeProperty
Appends a property with a given key and a double value to a givenStringBuffer
.- Parameters:
aKey
- aString
containing the key of the propertyaValue
- adouble
containing the value of the propertyaStringBuffer
- theStringBuffer
- 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 aStringBuffer
value to a givenStringBuffer
.- Parameters:
aKey
- aString
containing the key of the propertyaValue
- aStringBuffer
containing the value of the propertyaStringBuffer
- theStringBuffer
- Throws:
IOException
- when output to aStringBuffer fails.
-
writeProperty
Appends a property with a given key and aString
value to a givenStringBuffer
.- Parameters:
aKey
- aString
containing the key of the propertyaValue
- aString
containing the value of the propertyaStringBuffer
- theStringBuffer
- Throws:
IOException
- when output to aStringBuffer fails.
-