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.SVGElementAdapter
- All Implemented Interfaces:
AllowsConditionalProcessingAttributes,AllowsDocumentElementEventAttributes,AllowsDocumentEventAttributes,AllowsGlobalEventAttributes,AllowsGraphicalEventAttributes,AllowsPresentationAttributes,AllowsStyleAttributes,AllowsXLinkAttributes,SVGClipPath,SVGElement,SVGElementWithChildren,SVGGroup,SVGLine,SVGMarker,SVGPath,SVGPositionedMarker,SVGRectangle,SVGStyle,SVGSymbol,SVGText,SVGTSpan,SVGUse,Element,XMLElement
- Direct Known Subclasses:
SVGGenericElement
@ClassVersion(sourceVersion="$Id: SVGElementAdapter.java 980 2022-01-06 15:29:19Z tquadrat $")
@API(status=STABLE,
since="0.0.5")
public abstract non-sealed class SVGElementAdapter
extends SVGElementImpl
implements AllowsDocumentElementEventAttributes, AllowsDocumentEventAttributes, SVGClipPath, SVGGroup, SVGLine, SVGPath, SVGPositionedMarker, SVGRectangle, SVGStyle, SVGSymbol, SVGText, SVGTSpan, SVGUse
This is the base class for a custom type that wants to extend an SVG element with additional features.
Basically, an implementation may look like this (in this example, for
an SVG <symbol> extension:
…
public class MySymbol extends SVGElementBase
{
…
public MySymbol()
{
super( SVGUtils.SVGELEMENT_Symbol, ALLOW_CHILDREN );
…
}
…
}- Note:
-
- Such a custom element implements all the other interfaces; it is all the other element type at the same time! But that does not mean that it will inherit their features automatically! Especially it will not validate children or attributes!
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: SVGElementAdapter.java 980 2022-01-06 15:29:19Z tquadrat $
- Since:
- 0.0.5
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.svg.SVGElementAdapter"
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.tquadrat.foundation.xml.builder.XMLElement
XMLElement.Flags -
Field Summary
FieldsModifier and TypeFieldDescriptionThe lines of the CSS style definitions.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.AllowsGlobalEventAttributes
GLOBALEVENT_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.AllowsXLinkAttributes
XLINK_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
ConstructorsModifierConstructorDescriptionprotectedSVGElementAdapter(String elementName, XMLElement.Flags... flags) Creates a newSVGElementAdapterinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStyle(CharSequence... styles) Adds a CSS style definition to this style.voiddefineLine(SVGNumber x1, SVGNumber y1, SVGNumber x2, SVGNumber y2) Sets the start and end points for this line.Returns the style sheet.voidMerges the given SVG<style>element into this one.
Only the CSS style definitions are taken from the other element, no attributes or comments.voidsetClipPathUnits(boolean flag) Sets the "clipPathUnits" attribute that defines the coordinate system for the contents of this<clipPath>element.voidSets a list of lengths which move the characters relative to the absolute position of the last glyph drawn.voidSets a list of heights which move the characters relative to the absolute position of the last glyph drawn.voidsetLengthAdjust(boolean flag) Sets the way the text length will be adjusted in order to meet the target length set bySVGText.setTextLength(SVGNumber).voidsetMarkerHeight(SVGNumber value) Sets the height of the viewport into which the<marker>is to be fitted when it is rendered.voidsetMarkerUnits(boolean flag) Sets the marker units attribute that defines the coordinate system for the attributes "markerWidth" and "markerHeight".voidsetMarkerWidth(SVGNumber value) Sets the width of the viewport into which the<marker>is to be fitted when it is rendered.voidSets the orientation of the marker.voidSets the orientation of the marker.voidsetPathDefinition(SVGPathElement... pathElements) Sets the path definition for this SVG<path>element.voidsetPathLength(double length) Sets the length of the path represented by this SVG<line>element.voidsetPathLength(long length) Sets the length of the path represented by this SVG<line>element.voidsetPosition(SVGNumber value) Sets the relative position for this marker.voidsetReferenceX(SVGNumber value) Sets the x coordinate of the marker reference point.voidsetReferenceY(SVGNumber value) Sets the y coordinate of the marker reference point.voidsetRotate(SVGNumber.SVGDegree... values) Sets a list of rotations for the glyphs.voidsetTextLength(SVGNumber value) Sets the target length for the text that an SVG viewer will attempt to display the text between by adjusting the spacing and/or the glyphs.voidSets a list of x-axis position.voidSets the x coordinate of the starting point for this line.voidSets the x coordinate of the ending point for this line.voidSets a list of y-axis position.voidSets the y coordinate of the starting point for this line.voidSets the y coordinate of the ending point for this line.toString(int indentationLevel, boolean prettyPrint) 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, getChildren, getElementName, getFlags, getNamespaces, getParent, getSortOrder, hasChildren, 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.AllowsGlobalEventAttributes
setCancelHandler, setCanPlayHandler, setCanPlayThroughHandler, setChangeHandler, setClickHandler, setCloseHandler, setCueChangeHandler, setDblClickHandler, setDragEndHandler, setDragEnterHandler, setDragExitHandler, setDragHandler, setDragLeaveHandler, setDragOverHandler, setDragStartHandler, setDropHandler, setDurationChangeHandler, setEmptiedHandler, setEndedHandler, setErrorHandler, setFocusHandler, setInputHandler, setInvalidHandler, setKeyDownHandler, setKeyPressHandler, setKeyUpHandler, setLoadedDataHandler, setLoadedMetadataHandler, setLoadHandler, setLoadStartHandler, setMouseDownHandler, setMouseEnterHandler, setMouseLeaveHandler, setMouseMoveHandler, setMouseOutHandler, setMouseOverHandler, setMouseUpHandler, setMouseWheelHandler, setPauseHandler, setPlayHandler, setPlayingHandler, setProgressHandler, setRateChangeHandler, setResetHandler, setResizeHandler, setScrollHandler, setSeekedHandler, setSeekingHandler, setSelectHandler, setShowHandler, setStalledHandler, setSubmitHandler, setSuspendHandler, setTimeUpdateHandler, setToggleHandler, setVolumeChangeHandler, setWaitHandlerMethods 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, setUnicodeBidi, setVectorEffect, setVisibility, setWordSpacing, setWritingModeMethods inherited from interface org.tquadrat.foundation.svg.AllowsStyleAttributes
setClass, setStyleMethods inherited from interface org.tquadrat.foundation.svg.AllowsXLinkAttributes
setXlinkActuate, setXLinkArcRole, setXLinkReference, setXLinkRole, setXLinkShow, setXLinkTitle, setXLinkTypeMethods inherited from interface org.tquadrat.foundation.xml.builder.spi.Element
getAttribute, getAttributes, getChildren, getElementName, getNamespaces, getParent, hasChildren, isBlockMethods 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.svg.SVGLine
setEndPoint, setPathLength, setStartPointMethods inherited from interface org.tquadrat.foundation.svg.SVGMarker
setExternalResourcesRequired, setMarkerDimensions, setPreserveAspectRatio, setReferencePoint, setTransform, setViewBoxMethods inherited from interface org.tquadrat.foundation.svg.SVGPath
setPathLengthMethods inherited from interface org.tquadrat.foundation.svg.SVGRectangle
defineRectangle, setHeight, setPathLength, setRx, setRy, setWidth, setX, setYMethods inherited from interface org.tquadrat.foundation.svg.SVGSymbol
setExternalResourcesRequired, setPreserveAspectRatio, setViewBoxMethods 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_StyleDefinitions
The lines of the CSS style definitions.
-
-
Constructor Details
-
SVGElementAdapter
Creates a newSVGElementAdapterinstance.- Parameters:
elementName- The name of the element.flags- The flags that determine the behaviour of the new element.
-
-
Method Details
-
addStyle
Adds a CSS style definition to this style. -
defineLine
Sets the start and end points for this line.- Specified by:
defineLinein interfaceSVGLine- Parameters:
x1- The x coordinate for the starting point of the line.y1- The y coordinate for the starting point of the line.x2- The x coordinate for the ending point of the line.y2- The y coordinate for the ending point of the line.
-
setPathLength
Sets the length of the path represented by this SVG<line>element.- Specified by:
setPathLengthin interfaceSVGLine- Specified by:
setPathLengthin interfaceSVGPath- Specified by:
setPathLengthin interfaceSVGRectangle- Parameters:
length- The author's computation of the total length of the path, in user units. This type is used to calibrate the user agent's own distance-along-a-path calculations with that of the author. The user agent will scale all distance-along-a-path computations by the ratio of this type to the user agent's own computed type for total path length.
A type of zero is valid, but a negative type is an error.
-
setPathLength
Sets the length of the path represented by this SVG<line>element.- Specified by:
setPathLengthin interfaceSVGLine- Specified by:
setPathLengthin interfaceSVGPath- Specified by:
setPathLengthin interfaceSVGRectangle- Parameters:
length- The author's computation of the total length of the path, in user units. This type is used to calibrate the user agent's own distance-along-a-path calculations with that of the author. The user agent will scale all distance-along-a-path computations by the ratio of this type to the user agent's own computed type for total path length.
A type of zero is valid, but a negative type is an error.
-
getStyleSheet
Returns the style sheet.- Specified by:
getStyleSheetin interfaceSVGStyle- Returns:
- The style definitions.
-
merge
Merges the given SVG<style>element into this one.
Only the CSS style definitions are taken from the other element, no attributes or comments. -
setClipPathUnits
Sets the "clipPathUnits" attribute that defines the coordinate system for the contents of this<clipPath>element.- Specified by:
setClipPathUnitsin interfaceSVGClipPath- Parameters:
flag-trueif the user coordinate system for the contents of the<clipPath>element is established using the bounding box of the element to which the clipping path is applied,falseif the contents of the<clipPath>element represents values in the current user coordinate system in place at the time when the<clipPath>element is referenced.
-
setDx
Sets a list of lengths which move the characters relative to the absolute position of the last glyph drawn. The nth length is given to nth character in the text. If there are additional characters after the positions run out, the last length is applied to them. -
setDy
Sets a list of heights which move the characters relative to the absolute position of the last glyph drawn. The nth height is given to nth character in the text. If there are additional characters after the positions run out, the last height is applied to them. -
setLengthAdjust
Sets the way the text length will be adjusted in order to meet the target length set bySVGText.setTextLength(SVGNumber).- Specified by:
setLengthAdjustin interfaceSVGText- Specified by:
setLengthAdjustin interfaceSVGTSpan- Parameters:
flag-truemeans that both, spacing and glyph size will be adjusted to match,falseindicates that only the spacing will be changed.
-
setMarkerHeight
Sets the height of the viewport into which the<marker>is to be fitted when it is rendered.- Specified by:
setMarkerHeightin interfaceSVGMarker- Parameters:
value- The height.- See Also:
-
setMarkerUnits
Sets the marker units attribute that defines the coordinate system for the attributes "markerWidth" and "markerHeight".- Specified by:
setMarkerUnitsin interfaceSVGMarker- Parameters:
flag-trueif the user space should be used,falsefor the stroke width.
-
setMarkerWidth
Sets the width of the viewport into which the<marker>is to be fitted when it is rendered.- Specified by:
setMarkerWidthin interfaceSVGMarker- Parameters:
value- The width.- See Also:
-
setOrientation
Sets the orientation of the marker. Basically, this means how it is rotated when it is placed at its position on the markable element.- Specified by:
setOrientationin interfaceSVGMarker- Parameters:
value- The orientation.
-
setOrientation
Sets the orientation of the marker. Basically, this means how it is rotated when it is placed at its position on the markable element.- Specified by:
setOrientationin interfaceSVGMarker- Parameters:
value- The orientation.
-
setPathDefinition
Sets the path definition for this SVG<path>element.- Specified by:
setPathDefinitionin interfaceSVGPath- Parameters:
pathElements- The elements of the path.
-
setPosition
Sets the relative position for this marker.- Specified by:
setPositionin interfaceSVGPositionedMarker- Parameters:
value- The distance.
-
setReferenceX
Sets the x coordinate of the marker reference point.- Specified by:
setReferenceXin interfaceSVGMarker- Parameters:
value- The coordinate type.- See Also:
-
setReferenceY
Sets the y coordinate of the marker reference point.- Specified by:
setReferenceYin interfaceSVGMarker- Parameters:
value- The coordinate type.- See Also:
-
setRotate
Sets a list of rotations for the glyphs. The nth rotation is given to nth character in the text. Additional characters are not given the last rotation (although some browsers may handle that differently). -
setTextLength
Sets the target length for the text that an SVG viewer will attempt to display the text between by adjusting the spacing and/or the glyphs.- Specified by:
setTextLengthin interfaceSVGText- Specified by:
setTextLengthin interfaceSVGTSpan- Parameters:
value- The intended text length.
-
setX
Sets a list of x-axis position. The nth x-axis position is given to nth character in the text. If there are additional characters after the positions run out, they are placed after the last character. -
setX1
Sets the x coordinate of the starting point for this line. -
setX2
Sets the x coordinate of the ending point for this line. -
setY
Sets a list of y-axis position. The nth y-axis position is given to nth character in the text. If there are additional characters after the positions run out, they are placed after the last character. -
setY1
Sets the y coordinate of the starting point for this line. -
setY2
Sets the y coordinate of the ending point for this line. -
toString
-
