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 interface
When 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 void
addSVGImageUpdate
(ISVGImageUpdate svgImageUpdate) During the SVG image update you can add own algorithms - that are executed before the default SVG update is executed.static void
addSVGSourceReader
(SVGImageManager.ISVGSourceReader svgSourceReader) static String
cleanSvgForParsing
(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 String
static void
removeSVGImageUpdate
(ISVGImageUpdate svgImageUpdate) static void
removeSVGSourceReader
(SVGImageManager.ISVGSourceReader svgSourceReader) static String
updateBackgroundColor
(String svg, String backgroundColor) static String
static String
updateWidthHeight
(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
-