Package org.eclnt.util.image
Class SVGImageManager
java.lang.Object
org.eclnt.util.image.SVGImageManager
Utility for flexibly adapting flat SVG icon images and update their fill
color and their size.
Purpose: have one icon imagea definition and derive all variations of the icon by this utility instead of copying/pasting the SVG multiple times.
The utitily already covers quite typical definitions of flat SVG icon images but of course can not cover all - because there is some individual variation how SVG is structured. You may add own conversion algorithms by calling
The utility can be called by URL as well (".ccsvg" access,
Purpose: have one icon imagea definition and derive all variations of the icon by this utility instead of copying/pasting the SVG multiple times.
The utitily already covers quite typical definitions of flat SVG icon images but of course can not cover all - because there is some individual variation how SVG is structured. You may add own conversion algorithms by calling
addSVGImageUpdate(ISVGImageUpdate).The utility can be called by URL as well (".ccsvg" access,
DynamicImageServlet.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceWhen resolving the SVG for a dynamically created SVG image (.ccsvg) then the reading of the SVG Source reader can be done by implementing this interface. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddSVGImageUpdate(ISVGImageUpdate svgImageUpdate) During the SVG image update you can add own algorithms - that are executed before the default SVG update is executed.static voidaddSVGSourceReader(SVGImageManager.ISVGSourceReader svgSourceReader) static StringcleanSvgForParsing(String svg) byte[]createImageCCSVG(String path) createSVGImage(String svgResource, String backgroundColor, String color, int width, int height) byte[]createSVGImageBytes(String svgResource, String backgroundColor, String color, int width, int height) byte[]Structure: "/svg(resourcePath,color,width[,height])" Example: "/svg(images/iconssvg/test.svg,#000000,32)"protected Stringstatic voidremoveSVGImageUpdate(ISVGImageUpdate svgImageUpdate) static voidremoveSVGSourceReader(SVGImageManager.ISVGSourceReader svgSourceReader) static StringupdateBackgroundColor(String svg, String backgroundColor) static Stringstatic StringupdateWidthHeight(String svg, int width, int height)
-
Constructor Details
-
SVGImageManager
public SVGImageManager()
-
-
Method Details
-
addSVGSourceReader
-
removeSVGSourceReader
-
addSVGImageUpdate
During the SVG image update you can add own algorithms - that are executed before the default SVG update is executed. -
removeSVGImageUpdate
-
findImage
Structure: "/svg(resourcePath,color,width[,height])" Example: "/svg(images/iconssvg/test.svg,#000000,32)" -
createImageCCSVG
- Parameters:
path- Format: [.] .[ .][ .]
The color values are either sent with "#" as first character or with "_" as first character.- Returns:
-
createSVGImageBytes
-
createSVGImage
-
updateSVG
-
cleanSvgForParsing
-
updateBackgroundColor
-
updateWidthHeight
-
readSVG
-