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:
ILcdCircleILcdPolylineILcdPolygonILcdTextILcdBoundsILcdShapeListILcdEllipse
ILcdPointILcdArcBand
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this writer is a True SVG writer or not.voidsetTrueSVG(boolean aTrueSVG) Set to write true SVG or not.protected abstract voidwriteArcBand(ILcdArcBand aArcBand, Writer aTarget) Appends anILcdArcBandto aStringBuffer.protected abstract voidwriteBounds(ILcdBounds aBounds, Writer aTarget) Appends anILcdBoundsto aStringBuffer.protected abstract voidwriteCircle(ILcdCircle aCircle, Writer aTarget) Appends anILcdCircleto aStringBuffer.voidwriteElement(Object aObject, Writer aTarget) Writes an object on the writer as an SVG element.protected abstract voidwriteEllipse(ILcdEllipse aEllipse, Writer aTarget) Appends anILcdEllipseto aStringBuffer.protected abstract voidwritePoint(ILcdPoint aPoint, Writer aTarget) Appends anILcdPointto aStringBuffer.protected abstract voidwritePolygon(ILcdPolygon aPolygon, Writer aTarget) Appends anILcdPolygonto aStringBuffer.protected abstract voidwritePolyline(ILcdPolyline aPolyline, Writer aTarget) Appends anILcdPolylineto aStringBuffer.protected voidwriteProperty(String aKey, double aValue, Writer aStringBuffer) Appends a property with a given key and a double value to a givenStringBuffer.protected voidwriteProperty(String aKey, StringBuffer aValue, Writer aStringBuffer) Appends a property with a given key and aStringBuffervalue to a givenStringBuffer.protected voidwriteProperty(String aKey, String aValue, Writer aStringBuffer) Appends a property with a given key and aStringvalue to a givenStringBuffer.protected abstract voidwriteShapeList(ILcdShapeList aShapeList, Writer aTarget) Appends anILcdShapeListto aStringBuffer.protected abstract voidAppends anILcdTextto aStringBuffer.protected abstract voidwriteUnknownShape(ILcdShape aShape, Writer aTarget) Appends an unknownILcdShapeto aStringBuffer.
-
Constructor Details
-
ALcdSVGShapeWriter
public ALcdSVGShapeWriter()
-
-
Method Details
-
setTrueSVG
public void setTrueSVG(boolean aTrueSVG) Set to write true SVG or not.- Specified by:
setTrueSVGin 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:
writeElementin interfaceILcdSVGShapeWriter- Parameters:
aObject- theObjectto be written.aTarget- theStringBufferto write the given element to/- Throws:
IOException- when output to aTarget fails.
-
writeUnknownShape
Appends an unknownILcdShapeto aStringBuffer.- Parameters:
aShape- the unknownILcdShapeaTarget- theStringBuffer- Throws:
IOException- for I/O errors.
-
writeCircle
Appends anILcdCircleto aStringBuffer.- Parameters:
aCircle- theILcdCircleelementaTarget- theStringBuffer- Throws:
IOException- when output to aTarget fails.
-
writePolyline
Appends anILcdPolylineto aStringBuffer.- Parameters:
aPolyline- theILcdPolylineaTarget- theStringBuffer- Throws:
IOException- when output to aTarget fails.
-
writePolygon
Appends anILcdPolygonto aStringBuffer.- Parameters:
aPolygon- theILcdPolygonaTarget- theStringBuffer- Throws:
IOException- when output to aTarget fails.
-
writeBounds
Appends anILcdBoundsto aStringBuffer.- Parameters:
aBounds- theILcdBoundsaTarget- theStringBuffer- Throws:
IOException- when output to aTarget fails.
-
writeText
Appends anILcdTextto aStringBuffer.- Parameters:
aText- theILcdTextaTarget- theStringBuffer- Throws:
IOException- when output to aTarget fails.
-
writeShapeList
Appends anILcdShapeListto aStringBuffer.- Parameters:
aShapeList- theILcdShapeListaTarget- theStringBuffer- Throws:
IOException- when output to aTarget fails.
-
writePoint
Appends anILcdPointto aStringBuffer. Warning: not a true svg tag shape !- Parameters:
aPoint- theILcdPointaTarget- theStringBuffer- Throws:
IOException- when output to aTarget fails.
-
writeArcBand
Appends anILcdArcBandto aStringBuffer. Warning: not a true svg tag shape !- Parameters:
aArcBand- theILcdArcBandaTarget- theStringBuffer- Throws:
IOException- when output to aTarget fails.
-
writeEllipse
Appends anILcdEllipseto aStringBuffer. Warning: not a true svg tag shape !- Parameters:
aEllipse- theILcdEllipseaTarget- 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- aStringcontaining the key of the propertyaValue- adoublecontaining 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 aStringBuffervalue to a givenStringBuffer.- Parameters:
aKey- aStringcontaining the key of the propertyaValue- aStringBuffercontaining the value of the propertyaStringBuffer- theStringBuffer- Throws:
IOException- when output to aStringBuffer fails.
-
writeProperty
Appends a property with a given key and aStringvalue to a givenStringBuffer.- Parameters:
aKey- aStringcontaining the key of the propertyaValue- aStringcontaining the value of the propertyaStringBuffer- theStringBuffer- Throws:
IOException- when output to aStringBuffer fails.
-