Package com.storedobject.common
Class SVG
java.lang.Object
com.storedobject.common.SVG
-
Field Summary
Fields inherited from interface com.storedobject.common.ContentGenerator
ext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchild()Create a child SVG.voidAdd a valid SVG command directly.voidThis is where you create your content by invoking various other methods available in this class.final voidGenerate the content and write to a writer.final StringMime type of the content.final StringFile extension normally used for this type of content.doubleGet the height.doublegetWidth()Get the width.voidnext()Create the next block (Next g tag).voidrotate(double angleInDegrees) Rotate.voidrotate(double angleInDegrees, double rotateX, double rotateY) Rotate.voidscale(double x, double y) Scale.final voidFill.voidsetHeight(double height) Set the height.final voidStroke.voidsetWidth(double width) Set width.voidtranslate(double x, double y) Translate.
-
Constructor Details
-
SVG
public SVG()Constructor.
-
-
Method Details
-
next
public void next()Create the next block (Next g tag). -
setWidth
public void setWidth(double width) Set width.- Parameters:
width- Width.
-
getWidth
public double getWidth()Get the width.- Returns:
- Width.
-
setHeight
public void setHeight(double height) Set the height.- Parameters:
height- Height.
-
getHeight
public double getHeight()Get the height.- Returns:
- Height.
-
translate
public void translate(double x, double y) Translate.- Parameters:
x- X.y- Y.
-
scale
public void scale(double x, double y) Scale.- Parameters:
x- X.y- Y.
-
rotate
public void rotate(double angleInDegrees) Rotate.- Parameters:
angleInDegrees- Angle in degrees.
-
rotate
public void rotate(double angleInDegrees, double rotateX, double rotateY) Rotate.- Parameters:
angleInDegrees- Angle in degrees.rotateX- X.rotateY- Y.
-
child
-
command
Add a valid SVG command directly. (Note: No error checking is done).- Parameters:
text- Command text to add.
-
setFill
-
setStroke
-
getContentType
Description copied from interface:TextContentGeneratorMime type of the content.- Specified by:
getContentTypein interfaceContentGenerator- Specified by:
getContentTypein interfaceTextContentGenerator- Returns:
- Default implementation returns "text/plain".
-
getFileExtension
Description copied from interface:TextContentGeneratorFile extension normally used for this type of content.- Specified by:
getFileExtensionin interfaceContentGenerator- Specified by:
getFileExtensionin interfaceTextContentGenerator- Returns:
- Default implementation returns "txt".
-
generateContent
public void generateContent()This is where you create your content by invoking various other methods available in this class. So, you may override this method. -
generateContent
Description copied from interface:TextContentGeneratorGenerate the content and write to a writer.- Specified by:
generateContentin interfaceTextContentGenerator- Parameters:
w- Writer to collect the generated content.- Throws:
Exception- if content can not be generated.
-