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_ATTRIBUTES
Fields inherited from interface org.tquadrat.foundation.svg.AllowsDocumentElementEventAttributes
DOCUMENTELEMENTEVENT_ATTRIBUTES
Fields inherited from interface org.tquadrat.foundation.svg.AllowsDocumentEventAttributes
DOCUMENTEVENT_ATTRIBUTES
Fields inherited from interface org.tquadrat.foundation.svg.AllowsGraphicalEventAttributes
GRAPHICALEVENT_ATTRIBUTES
Fields inherited from interface org.tquadrat.foundation.svg.AllowsPresentationAttributes
PRESENTATION_ATTRIBUTES
Fields inherited from interface org.tquadrat.foundation.svg.AllowsStyleAttributes
STYLE_ATTRIBUTES
Fields inherited from interface org.tquadrat.foundation.svg.SVGElement
CORE_ATTRIBUTES
Fields 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 void
Adds an SVG<style>
element to the definitions of this<svg>
element.private final SVGElementImpl
Creates the element for the definitions.final Collection
<? extends Element> final boolean
final void
setContentScriptType
(MimeType value) Sets the default scripting language used to process the type strings in event attributes.final SVGStyle
setStyleSheet
(CharSequence... styles) Sets the given CSS style definitions as a style sheet in an SVGstyle
element to the<defs>
element of this<svg>
element.final void
setZoomAndPan
(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, updateRegistries
Methods 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, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.tquadrat.foundation.svg.AllowsConditionalProcessingAttributes
setExternalResourcesRequired, setRequiredExtensions, setRequiredFeatures, setSystemLanguage
Methods inherited from interface org.tquadrat.foundation.svg.AllowsDocumentElementEventAttributes
setCopyHandler, setCutHandler, setPasteHandler
Methods inherited from interface org.tquadrat.foundation.svg.AllowsDocumentEventAttributes
setAbortHandler, setErrorHandler, setResizeHandler, setScrollHandler, setUnloadHandler
Methods inherited from interface org.tquadrat.foundation.svg.AllowsGraphicalEventAttributes
setActivationHandler, setFocusInHandler, setFocusOutHandler
Methods 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, setWritingMode
Methods inherited from interface org.tquadrat.foundation.svg.AllowsStyleAttributes
setClass, setStyle
Methods inherited from interface org.tquadrat.foundation.xml.builder.spi.Element
getAttribute, getAttributes, getElementName, getNamespaces, getParent, isBlock, toString
Methods inherited from interface org.tquadrat.foundation.svg.SVG
setDimension, setHeight, setPreserveAspectRatio, setViewBox, setWidth, setX, setY
Methods inherited from interface org.tquadrat.foundation.svg.SVGElement
addComment, getSVGElementCategory, setId, setLang, setPreserveSpace, setTabIndex, setTitle, setXMLBase, setXMLId, setXMLLang
Methods inherited from interface org.tquadrat.foundation.svg.SVGElementWithChildren
addChild, setDescription
Methods 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 newSVGImpl
instance.
-
-
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:
addDefinition
in 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:
addStyle
in 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:
getChildren
in interfaceElement
- Overrides:
getChildren
in classXMLElementImpl
-
hasChildren
- Specified by:
hasChildren
in interfaceElement
- Overrides:
hasChildren
in 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:
setContentScriptType
in 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
style
element 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:
setStyleSheet
in 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:
setZoomAndPan
in interfaceSVG
- Parameters:
flag
-true
enables the feature by setting "magnify
" to the attribute "zoomAndPan",false
disables 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.
-