java.lang.Object
org.tquadrat.foundation.xml.builder.internal.XMLElementImpl
org.tquadrat.foundation.xml.builder.spi.XMLElementAdapter
org.tquadrat.foundation.svg.internal.SVGElementImpl
org.tquadrat.foundation.svg.internal.SVGImpl
- All Implemented Interfaces:
AllowsConditionalProcessingAttributes,AllowsDocumentElementEventAttributes,AllowsDocumentEventAttributes,AllowsGraphicalEventAttributes,AllowsPresentationAttributes,AllowsStyleAttributes,SVG,SVGElement,SVGElementWithChildren,Element,XMLElement
@ClassVersion(sourceVersion="$Id: SVGImpl.java 1074 2023-10-02 12:05:06Z tquadrat $")
@API(status=INTERNAL,
since="0.0.5")
public final class SVGImpl
extends SVGElementImpl
implements SVG
The implementation for the interface
SVG
for the <svg> element.- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: SVGImpl.java 1074 2023-10-02 12:05:06Z tquadrat $
- Since:
- 0.0.5
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.svg.internal.SVGImpl"
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.tquadrat.foundation.xml.builder.XMLElement
XMLElement.Flags -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Lazy<SVGElementImpl> The optional<defs>element for this<svg>element.The style sheet for this<svg>element.Fields inherited from interface org.tquadrat.foundation.svg.AllowsConditionalProcessingAttributes
CONDITIONALPROCESSING_ATTRIBUTESFields inherited from interface org.tquadrat.foundation.svg.AllowsDocumentElementEventAttributes
DOCUMENTELEMENTEVENT_ATTRIBUTESFields inherited from interface org.tquadrat.foundation.svg.AllowsDocumentEventAttributes
DOCUMENTEVENT_ATTRIBUTESFields inherited from interface org.tquadrat.foundation.svg.AllowsGraphicalEventAttributes
GRAPHICALEVENT_ATTRIBUTESFields inherited from interface org.tquadrat.foundation.svg.AllowsPresentationAttributes
PRESENTATION_ATTRIBUTESFields inherited from interface org.tquadrat.foundation.svg.AllowsStyleAttributes
STYLE_ATTRIBUTESFields inherited from interface org.tquadrat.foundation.svg.SVGElement
CORE_ATTRIBUTESFields inherited from interface org.tquadrat.foundation.xml.builder.XMLElement
EMPTY_XMLElement_ARRAY, NO_APPEND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal <E extends SVGElement>
voidaddDefinition(E child) Adds a child to the definitions of this<svg>element.final voidAdds an SVG<style>element to the definitions of this<svg>element.private final SVGElementImplCreates the element for the definitions.final Collection<? extends Element> final booleanfinal voidsetContentScriptType(MimeType value) Sets the default scripting language used to process the type strings in event attributes.final SVGStylesetStyleSheet(CharSequence... styles) Sets the given CSS style definitions as a style sheet in an SVGstyleelement to the<defs>element of this<svg>element.final voidsetZoomAndPan(boolean flag) Sets the 'Zoom-and-Pan' flag; if enabled on a stand-alone instance of the<svg>element, it allows panning and zooming the image.private final Collection<String> Composes the list of the valid child elements for the<svg>element.Methods inherited from class org.tquadrat.foundation.svg.internal.SVGElementImpl
addChild, setAbortHandler, setActivationHandler, setAlignmentBaseline, setAttribute, setBaselineShift, setCancelHandler, setCanPlayHandler, setCanPlayThroughHandler, setChangeHandler, setClass, setClickHandler, setClip, setClipPath, setClipRule, setCloseHandler, setColor, setColorInterpolation, setColorInterpolationFilters, setColorProfile, setColorRendering, setCopyHandler, setCueChangeHandler, setCursor, setCutHandler, setDblClickHandler, setDescription, setDirection, setDisplay, setDominantBaseline, setDragEndHandler, setDragEnterHandler, setDragExitHandler, setDragHandler, setDragLeaveHandler, setDragOverHandler, setDragStartHandler, setDropHandler, setDurationChangeHandler, setEmptiedHandler, setEnableBackground, setEndedHandler, setErrorHandler, setExternalResourcesRequired, setFill, setFillOpacity, setFillRule, setFilter, setFloodColor, setFloodOpacity, setFocusHandler, setFocusInHandler, setFocusOutHandler, setFontFamily, setFontSize, setFontSizeAdjust, setFontStretch, setFontStyle, setFontVariant, setFontWeight, setGlyphOrientationHorizontal, setGlyphOrientationVertical, setHeight, setId, setImageRendering, setInputHandler, setInvalidHandler, setKerning, setKeyDownHandler, setKeyPressHandler, setKeyUpHandler, setLang, setLetterSpacing, setLightingColor, setLoadedDataHandler, setLoadedMetadataHandler, setLoadHandler, setLoadStartHandler, setMarkerEnd, setMarkerMid, setMarkerStart, setMask, setMouseDownHandler, setMouseEnterHandler, setMouseLeaveHandler, setMouseMoveHandler, setMouseOutHandler, setMouseOverHandler, setMouseUpHandler, setMouseWheelHandler, setOpacity, setOverflow, setPasteHandler, setPathLength, setPauseHandler, setPlayHandler, setPlayingHandler, setPointerEvents, setPreserveAspectRatio, setPreserveSpace, setProgressHandler, setRateChangeHandler, setReference, setRequiredExtensions, setRequiredFeatures, setResetHandler, setResizeHandler, setRx, setRy, setScrollHandler, setSeekedHandler, setSeekingHandler, setSelectHandler, setShapeRendering, setShowHandler, setStalledHandler, setStopColor, setStopOpacity, setStroke, setStrokeDashArray, setStrokeDashOffset, setStrokeLineCap, setStrokeLineJoin, setStrokeMiterLimit, setStrokeOpacity, setStrokeWidth, setStyle, setSubmitHandler, setSuspendHandler, setSystemLanguage, setTabIndex, setTextAnchor, setTextDecoration, setTextRendering, setTimeUpdateHandler, setTitle, setToggleHandler, setTransform, setUnicodeBidi, setUnloadHandler, setVectorEffect, setViewBox, setVisibility, setVolumeChangeHandler, setWaitHandler, setWidth, setWordSpacing, setWritingMode, setX, setXlinkActuate, setXLinkArcRole, setXLinkReference, setXLinkRole, setXLinkShow, setXLinkTitle, setXLinkType, setXMLBase, setXMLId, setXMLLang, setY, updateRegistriesMethods inherited from class org.tquadrat.foundation.xml.builder.internal.XMLElementImpl
addCDATA, addChild, addComment, addPredefinedMarkup, addText, getAttribute, getAttributes, getElementName, getFlags, getNamespaces, getParent, getSortOrder, registerAttributeSequence, registerAttributeSequence, registerValidAttributes, registerValidChildren, retrieveValidAttributes, retrieveValidChildren, setAttribute, setNamespace, setNamespace, setNamespace, setNamespace, setNamespace, setParent, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.tquadrat.foundation.svg.AllowsConditionalProcessingAttributes
setExternalResourcesRequired, setRequiredExtensions, setRequiredFeatures, setSystemLanguageMethods inherited from interface org.tquadrat.foundation.svg.AllowsDocumentElementEventAttributes
setCopyHandler, setCutHandler, setPasteHandlerMethods inherited from interface org.tquadrat.foundation.svg.AllowsDocumentEventAttributes
setAbortHandler, setErrorHandler, setResizeHandler, setScrollHandler, setUnloadHandlerMethods inherited from interface org.tquadrat.foundation.svg.AllowsGraphicalEventAttributes
setActivationHandler, setFocusInHandler, setFocusOutHandlerMethods inherited from interface org.tquadrat.foundation.svg.AllowsPresentationAttributes
setAlignmentBaseline, setBaselineShift, setClip, setClipPath, setClipRule, setColor, setColorInterpolation, setColorInterpolationFilters, setColorProfile, setColorRendering, setCursor, setDirection, setDisplay, setDominantBaseline, setEnableBackground, setFill, setFillOpacity, setFillRule, setFilter, setFloodColor, setFloodOpacity, setFontFamily, setFontSize, setFontSizeAdjust, setFontStretch, setFontStyle, setFontVariant, setFontWeight, setGlyphOrientationHorizontal, setGlyphOrientationVertical, setImageRendering, setKerning, setLetterSpacing, setLightingColor, setMarkerEnd, setMarkerMid, setMarkerStart, setMask, setOpacity, setOverflow, setPointerEvents, setShapeRendering, setStopColor, setStopOpacity, setStroke, setStrokeDashArray, setStrokeDashOffset, setStrokeLineCap, setStrokeLineJoin, setStrokeMiterLimit, setStrokeOpacity, setStrokeWidth, setTextAnchor, setTextDecoration, setTextRendering, setTransform, setUnicodeBidi, setVectorEffect, setVisibility, setWordSpacing, setWritingModeMethods inherited from interface org.tquadrat.foundation.svg.AllowsStyleAttributes
setClass, setStyleMethods inherited from interface org.tquadrat.foundation.xml.builder.spi.Element
getAttribute, getAttributes, getElementName, getNamespaces, getParent, isBlock, toStringMethods inherited from interface org.tquadrat.foundation.svg.SVG
setDimension, setHeight, setPreserveAspectRatio, setViewBox, setWidth, setX, setYMethods inherited from interface org.tquadrat.foundation.svg.SVGElement
addComment, getSVGElementCategory, setId, setLang, setPreserveSpace, setTabIndex, setTitle, setXMLBase, setXMLId, setXMLLangMethods inherited from interface org.tquadrat.foundation.svg.SVGElementWithChildren
addChild, setDescriptionMethods inherited from interface org.tquadrat.foundation.xml.builder.XMLElement
addCDATA, addCDATA, addCDATA, addCDATA, addCDATA, addCDATA, addCDATA, addCDATA, addCDATA, addCDATA, addCDATA, addCDATA, addCDATA, addText, addText, addText, addText, addText, addText, addText, addText, addText, addText, addText, addText, addText, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeIfNotEmpty, setAttributeIfNotEmpty
-
Field Details
-
m_Definitions
The optional<defs>element for this<svg>element. -
m_StyleSheet
The style sheet for this<svg>element.
-
-
Constructor Details
-
SVGImpl
public SVGImpl()Creates a newSVGImplinstance.
-
-
Method Details
-
addDefinition
public final <E extends SVGElement> void addDefinition(E child) throws IllegalArgumentException, IllegalStateException Adds a child to the definitions of this<svg>element.- Specified by:
addDefinitionin interfaceSVG- Type Parameters:
E- The implementation type for thechildren.- Parameters:
child- The child to add.- Throws:
IllegalArgumentException- The given child is not valid to be added to a<defs>element, or it does not have an id.IllegalStateException- The child has already a parent that is not this element.
-
addStyle
Adds an SVG<style>element to the definitions of this<svg>element. If there exists already a<style>element, the new one will be merged into the existing one.- Specified by:
addStylein interfaceSVG- Parameters:
style- The style to add.- Throws:
IllegalStateException- The child has already a parent that is not this element.IllegalArgumentException
-
createDefinitionsElement
Creates the element for the definitions.- Returns:
- The
<defs>element.
-
getChildren
- Specified by:
getChildrenin interfaceElement- Overrides:
getChildrenin classXMLElementImpl
-
hasChildren
- Specified by:
hasChildrenin interfaceElement- Overrides:
hasChildrenin classXMLElementImpl
-
setContentScriptType
Sets the default scripting language used to process the type strings in event attributes. This language must be used for all instances of script that do not specify their own scripting language.
The type specifies a media type as a MIME document identifier; the default type is
application/ecmascript.- Specified by:
setContentScriptTypein interfaceSVG- Parameters:
value- The default scripting language for this<svg>element.
-
setStyleSheet
Sets the given CSS style definitions as a style sheet in an SVG
styleelement to the<defs>element of this<svg>element.This is not an attribute; instead an SVG
<style>element will be created.Consecutive calls to this method will not create additional
<style>elements, instead the new styles will be added to the existing ones.- Specified by:
setStyleSheetin interfaceSVG- Parameters:
styles- The CSS style definitions.- Returns:
- The SVG
<style>element with the style sheet definitions.
-
setZoomAndPan
Sets the 'Zoom-and-Pan' flag; if enabled on a stand-alone instance of the<svg>element, it allows panning and zooming the image.- Specified by:
setZoomAndPanin interfaceSVG- Parameters:
flag-trueenables the feature by setting "magnify" to the attribute "zoomAndPan",falsedisables it by setting the attribute to "disable".
-
validChildElements
Composes the list of the valid child elements for the<svg>element.- Returns:
- The valid child elements.
-
