|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.larvalabs.svgandroid.SVGBuilder
public class SVGBuilder
Builder for reading SVGs. Specify input, specify any parsing options (optional), then call build() to parse
and return a SVG.
| Constructor Summary | |
|---|---|
SVGBuilder()
|
|
| Method Summary | |
|---|---|
SVG |
build()
Loads, reads, parses the SVG. |
SVGBuilder |
clearColorSwap()
|
SVGBuilder |
readFromAsset(android.content.res.AssetManager assetMngr,
String svgPath)
Parse SVG data from an Android application asset. |
SVGBuilder |
readFromInputStream(InputStream svgData)
Parse SVG data from an input stream. |
SVGBuilder |
readFromResource(android.content.res.Resources resources,
int resId)
Parse SVG data from an Android application resource. |
SVGBuilder |
readFromString(String svgData)
Parse SVG data from a string. |
SVGBuilder |
setCloseInputStreamWhenDone(boolean closeInputStream)
Whether or not to close the input stream after reading (ie. |
SVGBuilder |
setColorFilter(android.graphics.ColorFilter colorFilter)
Applies a ColorFilter to the paint objects used to render the SVG. |
SVGBuilder |
setColorSwap(int searchColor,
int replaceColor)
Replaces a single colour with another. |
SVGBuilder |
setFillColorFilter(android.graphics.ColorFilter colorFilter)
Applies a ColorFilter to fills in the SVG. |
SVGBuilder |
setStrokeColorFilter(android.graphics.ColorFilter colorFilter)
Applies a ColorFilter to strokes in the SVG. |
SVGBuilder |
setWhiteMode(boolean whiteMode)
In white-mode, fills are drawn in white and strokes are not drawn at all. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SVGBuilder()
| Method Detail |
|---|
public SVGBuilder readFromInputStream(InputStream svgData)
svgData - the input stream, with SVG XML data in UTF-8 character encoding.
public SVGBuilder readFromString(String svgData)
svgData - the string containing SVG XML data.
public SVGBuilder readFromResource(android.content.res.Resources resources,
int resId)
resources - the Android context resources.resId - the ID of the raw resource SVG.
public SVGBuilder readFromAsset(android.content.res.AssetManager assetMngr,
String svgPath)
throws IOException
assetMngr - the Android asset manager.svgPath - the path to the SVG file in the application's assets.
IOException - if there was a problem reading the file.public SVGBuilder clearColorSwap()
public SVGBuilder setColorSwap(int searchColor,
int replaceColor)
searchColor - The colour in the SVG.replaceColor - The desired colour.public SVGBuilder setWhiteMode(boolean whiteMode)
public SVGBuilder setColorFilter(android.graphics.ColorFilter colorFilter)
ColorFilter to the paint objects used to render the SVG.
public SVGBuilder setStrokeColorFilter(android.graphics.ColorFilter colorFilter)
ColorFilter to strokes in the SVG.
public SVGBuilder setFillColorFilter(android.graphics.ColorFilter colorFilter)
ColorFilter to fills in the SVG.
public SVGBuilder setCloseInputStreamWhenDone(boolean closeInputStream)
build().
public SVG build()
throws SVGParseException
SVGParseException - if there is an error while parsing.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||