public abstract class ALcdSVGShapeWriter extends Object implements ILcdSVGShapeWriter
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 and Description |
---|
ALcdSVGShapeWriter() |
Modifier and Type | Method and Description |
---|---|
boolean |
isTrueSVG()
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 an
ILcdArcBand to a StringBuffer . |
protected abstract void |
writeBounds(ILcdBounds aBounds,
Writer aTarget)
Appends an
ILcdBounds to a StringBuffer . |
protected abstract void |
writeCircle(ILcdCircle aCircle,
Writer aTarget)
Appends an
ILcdCircle to a StringBuffer . |
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 an
ILcdEllipse to a StringBuffer . |
protected abstract void |
writePoint(ILcdPoint aPoint,
Writer aTarget)
Appends an
ILcdPoint to a StringBuffer . |
protected abstract void |
writePolygon(ILcdPolygon aPolygon,
Writer aTarget)
Appends an
ILcdPolygon to a StringBuffer . |
protected abstract void |
writePolyline(ILcdPolyline aPolyline,
Writer aTarget)
Appends an
ILcdPolyline to a StringBuffer . |
protected void |
writeProperty(String aKey,
double aValue,
Writer aStringBuffer)
Appends a property with a given key and a double value to a given
StringBuffer . |
protected void |
writeProperty(String aKey,
StringBuffer aValue,
Writer aStringBuffer)
Appends a property with a given key and a
StringBuffer value to a given StringBuffer . |
protected void |
writeProperty(String aKey,
String aValue,
Writer aStringBuffer)
Appends a property with a given key and a
String value to a given StringBuffer . |
protected abstract void |
writeShapeList(ILcdShapeList aShapeList,
Writer aTarget)
Appends an
ILcdShapeList to a StringBuffer . |
protected abstract void |
writeText(ILcdText aText,
Writer aTarget)
Appends an
ILcdText to a StringBuffer . |
protected abstract void |
writeUnknownShape(ILcdShape aShape,
Writer aTarget)
Appends an unknown
ILcdShape to a StringBuffer . |
public void setTrueSVG(boolean aTrueSVG)
setTrueSVG
in interface ILcdSVGShapeWriter
aTrueSVG
- if true, true SVG will be written, if false additional shapes can be written.public boolean isTrueSVG()
public void writeElement(Object aObject, Writer aTarget) throws IOException
writeElement
in interface ILcdSVGShapeWriter
aObject
- the Object
to be written.aTarget
- the StringBuffer
to write the given element to/IOException
- when output to aTarget fails.protected abstract void writeUnknownShape(ILcdShape aShape, Writer aTarget) throws IOException
ILcdShape
to a StringBuffer
.aShape
- the unknown ILcdShape
aTarget
- the StringBuffer
IOException
- for I/O errors.protected abstract void writeCircle(ILcdCircle aCircle, Writer aTarget) throws IOException
ILcdCircle
to a StringBuffer
.aCircle
- the ILcdCircle element
aTarget
- the StringBuffer
IOException
- when output to aTarget fails.protected abstract void writePolyline(ILcdPolyline aPolyline, Writer aTarget) throws IOException
ILcdPolyline
to a StringBuffer
.aPolyline
- the ILcdPolyline
aTarget
- the StringBuffer
IOException
- when output to aTarget fails.protected abstract void writePolygon(ILcdPolygon aPolygon, Writer aTarget) throws IOException
ILcdPolygon
to a StringBuffer
.aPolygon
- the ILcdPolygon
aTarget
- the StringBuffer
IOException
- when output to aTarget fails.protected abstract void writeBounds(ILcdBounds aBounds, Writer aTarget) throws IOException
ILcdBounds
to a StringBuffer
.aBounds
- the ILcdBounds
aTarget
- the StringBuffer
IOException
- when output to aTarget fails.protected abstract void writeText(ILcdText aText, Writer aTarget) throws IOException
ILcdText
to a StringBuffer
.aText
- the ILcdText
aTarget
- the StringBuffer
IOException
- when output to aTarget fails.protected abstract void writeShapeList(ILcdShapeList aShapeList, Writer aTarget) throws IOException
ILcdShapeList
to a StringBuffer
.aShapeList
- the ILcdShapeList
aTarget
- the StringBuffer
IOException
- when output to aTarget fails.protected abstract void writePoint(ILcdPoint aPoint, Writer aTarget) throws IOException
ILcdPoint
to a StringBuffer
.
Warning: not a true svg tag shape !aPoint
- the ILcdPoint
aTarget
- the StringBuffer
IOException
- when output to aTarget fails.protected abstract void writeArcBand(ILcdArcBand aArcBand, Writer aTarget) throws IOException
ILcdArcBand
to a StringBuffer
.
Warning: not a true svg tag shape !aArcBand
- the ILcdArcBand
aTarget
- the StringBuffer
IOException
- when output to aTarget fails.protected abstract void writeEllipse(ILcdEllipse aEllipse, Writer aTarget) throws IOException
ILcdEllipse
to a StringBuffer
.
Warning: not a true svg tag shape !aEllipse
- the ILcdEllipse
aTarget
- the StringBuffer
IOException
- when output to aTarget fails.protected void writeProperty(String aKey, double aValue, Writer aStringBuffer) throws IOException
StringBuffer
.aKey
- a String
containing the key of the propertyaValue
- adouble
containing the value of the propertyaStringBuffer
- the StringBuffer
IOException
- when output to aStringBuffer fails.protected void writeProperty(String aKey, StringBuffer aValue, Writer aStringBuffer) throws IOException
StringBuffer
value to a given StringBuffer
.aKey
- a String
containing the key of the propertyaValue
- aStringBuffer
containing the value of the propertyaStringBuffer
- the StringBuffer
IOException
- when output to aStringBuffer fails.protected void writeProperty(String aKey, String aValue, Writer aStringBuffer) throws IOException
String
value to a given StringBuffer
.aKey
- a String
containing the key of the propertyaValue
- aString
containing the value of the propertyaStringBuffer
- the StringBuffer
IOException
- when output to aStringBuffer fails.