Class StopElement
java.lang.Object
com.vaadin.flow.dom.Node<com.vaadin.flow.dom.Element>
com.vaadin.flow.dom.Element
org.vaadin.firitin.element.svg.SvgElement
org.vaadin.firitin.element.svg.StopElement
- All Implemented Interfaces:
Serializable
A typed Java API for the SVG
<stop> element.
The <stop> element defines a color and its position in a gradient.
It is used inside <linearGradient> or <radialGradient> elements.
Write-Only vs Read-Write Methods
This class provides two variants for each attribute setter:
- Default methods (e.g.,
offset(),stopColor()) - Use an optimized write-only approach. Attribute values are NOT stored on the server and cannot be retrieved viagetAttribute(). - RW methods (e.g.,
offsetRW(),stopColorRW()) - Use traditionalsetAttribute()which stores values on the server for later retrieval.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class SvgElement
SvgElement.PreserveAspectRatio -
Constructor Summary
ConstructorsConstructorDescriptionStopElement(double offset, in.virit.color.Color color) Creates a stop element with offset and color.StopElement(double offset, String color) Creates a stop element with offset and color string. -
Method Summary
Modifier and TypeMethodDescriptionoffset(double offset) Sets the offset where this gradient stop is placed.Sets the offset where this gradient stop is placed.offsetRW(double offset) Sets the offset where this gradient stop is placed (read-write).Sets the offset where this gradient stop is placed (read-write).stopColor(in.virit.color.Color color) Sets the color at this gradient stop.Sets the color at this gradient stop.stopColorRW(in.virit.color.Color color) Sets the color at this gradient stop (read-write).stopColorRW(String color) Sets the color at this gradient stop (read-write).stopOpacity(double opacity) Sets the opacity at this gradient stop.stopOpacityRW(double opacity) Sets the opacity at this gradient stop (read-write).Methods inherited from class SvgElement
emptySvgRoot, flushPendingAttributes, getOuterHTML, getPendingOrAttribute, getStyle, height, height, id, preserveAspectRatio, preserveAspectRatio, scheduleBeforeClientResponse, setAttribute, setWriteOnlyAttribute, size, size, viewBox, width, widthMethods inherited from class com.vaadin.flow.dom.Element
addAttachListener, addDetachListener, addEventListener, addPropertyChangeListener, addPropertyChangeListener, as, attachShadow, bindAttribute, bindProperty, bindText, callJsFunction, callJsFunction, createText, executeJs, executeJs, get, get, getAttribute, getAttributeNames, getChild, getChildCount, getChildren, getClassList, getComponent, getParent, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyBean, getPropertyBean, getPropertyNames, getPropertyRaw, getSelf, getShadowRoot, getTag, getText, getTextRecursively, getThemeList, hasAttribute, hasProperty, isEnabled, isTextNode, isVisible, removeAttribute, removeFromParent, removeFromTree, removeFromTree, removeProperty, scrollIntoView, scrollIntoView, setAttribute, setAttribute, setAttribute, setEnabled, setProperty, setProperty, setProperty, setPropertyBean, setPropertyJson, setPropertyList, setPropertyMap, setText, setVisible, toStringMethods inherited from class com.vaadin.flow.dom.Node
accept, appendChild, appendChild, appendVirtualChild, appendVirtualChild, ensureChildHasParent, equals, getNode, getParentNode, getStateProvider, hashCode, indexOfChild, insertChild, insertChild, isVirtualChild, removeAllChildren, removeChild, removeChild, removeChild, removeVirtualChild, removeVirtualChild, setChild
-
Constructor Details
-
StopElement
public StopElement() -
StopElement
public StopElement(double offset, in.virit.color.Color color) Creates a stop element with offset and color.- Parameters:
offset- the offset (0.0 to 1.0 or percentage string like "50%")color- the stop color
-
StopElement
Creates a stop element with offset and color string.- Parameters:
offset- the offset (0.0 to 1.0)color- the stop color as string
-
-
Method Details
-
offset
Sets the offset where this gradient stop is placed.Uses write-only optimization. Use
offsetRW(double)if you need to read the value back.- Parameters:
offset- the offset from 0.0 (start) to 1.0 (end)- Returns:
- this element for method chaining
-
offset
Sets the offset where this gradient stop is placed.Uses write-only optimization. Use
offsetRW(String)if you need to read the value back.- Parameters:
offset- the offset as percentage string (e.g., "50%")- Returns:
- this element for method chaining
-
offsetRW
Sets the offset where this gradient stop is placed (read-write).- Parameters:
offset- the offset from 0.0 (start) to 1.0 (end)- Returns:
- this element for method chaining
-
offsetRW
Sets the offset where this gradient stop is placed (read-write).- Parameters:
offset- the offset as percentage string (e.g., "50%")- Returns:
- this element for method chaining
-
stopColor
Sets the color at this gradient stop.Uses write-only optimization. Use
stopColorRW(Color)if you need to read the value back.- Parameters:
color- the stop color- Returns:
- this element for method chaining
-
stopColor
Sets the color at this gradient stop.Uses write-only optimization. Use
stopColorRW(String)if you need to read the value back.- Parameters:
color- the stop color (e.g., "red", "#ff0000", "rgb(255,0,0)")- Returns:
- this element for method chaining
-
stopColorRW
Sets the color at this gradient stop (read-write).- Parameters:
color- the stop color- Returns:
- this element for method chaining
-
stopColorRW
Sets the color at this gradient stop (read-write).- Parameters:
color- the stop color (e.g., "red", "#ff0000", "rgb(255,0,0)")- Returns:
- this element for method chaining
-
stopOpacity
Sets the opacity at this gradient stop.Uses write-only optimization. Use
stopOpacityRW(double)if you need to read the value back.- Parameters:
opacity- the opacity from 0.0 (transparent) to 1.0 (opaque)- Returns:
- this element for method chaining
-
stopOpacityRW
Sets the opacity at this gradient stop (read-write).- Parameters:
opacity- the opacity from 0.0 (transparent) to 1.0 (opaque)- Returns:
- this element for method chaining
-