Package com.iizix.urn.svg
Class SVG_URN
java.lang.Object
com.iizix.urn.URN
com.iizix.urn.svg.SVG_URN
- All Implemented Interfaces:
- Serializable,- Cloneable
SVG image Uniform Resource Naming (URN) instance class, holding the SVG data.
- Author:
- Christopher Mindus
- See Also:
- Field Summary
- Method SummaryModifier and TypeMethodDescription- booleanChecks if two instances are equal.- static SVG_URNCreates a SVG URN from an SVG string.Gets the parameter string for the- URN.toString()method.Gets the scaled size in logical pixels.Gets the HTML SVG rendering string.- getURL()Gets the URL of this as a data URL containing SVG code.- int- hashCode()Hash code of this instance.- Methods inherited from class com.iizix.urn.URN- asURNResource, from, getImageTarget, getURNString, isImageTargetSupported, isURNResource, toString
- Method Details- fromURLpublic static SVG_URN fromURL- (String svgString, int width, int height) throws IOException, SAXException Creates a SVG URN from an SVG string.- Parameters:
- svgString- The SVG string.
- width- Scale to width in logical pixels, zero or negative for no scaling of the width. If non-zero, the- heightmust also be non-zero, otherwise no width scaling is assumed.
- height- Scale to height in logical pixels, zero or negative for no scaling of the height. If non-zero, the- widthmust also be non-zero, otherwise no height scaling is assumed.
- Throws:
- NullPointerException- If the- svgStringis null.
- IOException- For read errors.
- SAXException- For XML (SVG) parser errors.
 
- getURLGets the URL of this as a data URL containing SVG code.
- getScaledSizeGets the scaled size in logical pixels.- Returns:
- The scaling size, or nullfor no scaling.
 
- getSVGForHTMLGets the HTML SVG rendering string.- Returns:
- The SVG string in HTML format, i.e. without XML heading.
 
- getParamStringGets the parameter string for the- URN.toString()method.- Specified by:
- getParamStringin class- URN
- Returns:
- The parameter string, always non-null, formatted as"svg=SVG_DATA,size=[width=W,height=H]"where thescaleinformation is not present if scaling is not performed on the SVG. If scaled, thewidthandheightare integer values in logical pixels.
 
- hashCodepublic int hashCode()Hash code of this instance.
- equalsChecks if two instances are equal.