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.void
Add a valid SVG command directly.void
This is where you create your content by invoking various other methods available in this class.final void
Generate the content and write to a writer.final String
Mime type of the content.final String
File extension normally used for this type of content.double
Get the height.double
getWidth()
Get the width.void
next()
Create the next block (Next g tag).void
rotate
(double angleInDegrees) Rotate.void
rotate
(double angleInDegrees, double rotateX, double rotateY) Rotate.void
scale
(double x, double y) Scale.final void
Fill.void
setHeight
(double height) Set the height.final void
Stroke.void
setWidth
(double width) Set width.void
translate
(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:TextContentGenerator
Mime type of the content.- Specified by:
getContentType
in interfaceContentGenerator
- Specified by:
getContentType
in interfaceTextContentGenerator
- Returns:
- Default implementation returns "text/plain".
-
getFileExtension
Description copied from interface:TextContentGenerator
File extension normally used for this type of content.- Specified by:
getFileExtension
in interfaceContentGenerator
- Specified by:
getFileExtension
in 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:TextContentGenerator
Generate the content and write to a writer.- Specified by:
generateContent
in interfaceTextContentGenerator
- Parameters:
w
- Writer to collect the generated content.- Throws:
Exception
- if content can not be generated.
-