001/* 002 * ============================================================================ 003 * Copyright © 2002-2025 by Thomas Thrien. 004 * All Rights Reserved. 005 * ============================================================================ 006 * Licensed to the public under the agreements of the GNU Lesser General Public 007 * License, version 3.0 (the "License"). You may obtain a copy of the License at 008 * 009 * http://www.gnu.org/licenses/lgpl.html 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 013 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 014 * License for the specific language governing permissions and limitations 015 * under the License. 016 */ 017 018package org.tquadrat.foundation.svg.internal; 019 020import static org.apiguardian.api.API.Status.INTERNAL; 021import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_Id; 022import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_LengthAdjust; 023import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_Rotate; 024import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_TextLength; 025import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_dx; 026import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_dy; 027import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_x; 028import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_y; 029import static org.tquadrat.foundation.svg.SVGUtils.SVGELEMENT_AltGlyph; 030import static org.tquadrat.foundation.svg.SVGUtils.SVGELEMENT_Anchor; 031import static org.tquadrat.foundation.svg.SVGUtils.SVGELEMENT_Animate; 032import static org.tquadrat.foundation.svg.SVGUtils.SVGELEMENT_AnimateColor; 033import static org.tquadrat.foundation.svg.SVGUtils.SVGELEMENT_Set; 034import static org.tquadrat.foundation.svg.SVGUtils.SVGELEMENT_TRef; 035import static org.tquadrat.foundation.svg.SVGUtils.SVGELEMENT_TSpan; 036import static org.tquadrat.foundation.svg.type.SVGElementCategory.DESCRIPTIVE; 037 038import java.util.ArrayList; 039import java.util.Collection; 040import java.util.HashSet; 041import java.util.List; 042 043import org.apiguardian.api.API; 044import org.tquadrat.foundation.annotation.ClassVersion; 045import org.tquadrat.foundation.svg.SVGTSpan; 046 047/** 048 * The implementation of the interface 049 * {@link SVGTSpan}. 050 * 051 * @extauthor Thomas Thrien - thomas.thrien@tquadrat.org 052 * @version $Id: SVGTSpanImpl.java 1151 2025-10-01 21:32:15Z tquadrat $ 053 * @since 0.0.5 054 * 055 * @UMLGraph.link 056 */ 057@ClassVersion( sourceVersion = "$Id: SVGTSpanImpl.java 1151 2025-10-01 21:32:15Z tquadrat $" ) 058@API( status = INTERNAL, since = "0.0.5" ) 059public final class SVGTSpanImpl extends SVGTextBase implements SVGTSpan 060{ 061 /*--------------*\ 062 ====** Constructors **===================================================== 063 \*--------------*/ 064 /** 065 * Creates a new {@code SVGTSpanImpl} instance. 066 */ 067 public SVGTSpanImpl() 068 { 069 super( SVGELEMENT_TSpan ); 070 071 //---* The children and attributes for the <tspan> element *----------- 072 final Collection<String> childElements = new HashSet<>(); 073 childElements.addAll( DESCRIPTIVE.getElements() ); 074 childElements.addAll( List.of( SVGELEMENT_Anchor, SVGELEMENT_AltGlyph, 075 SVGELEMENT_Animate, SVGELEMENT_AnimateColor, SVGELEMENT_Set, 076 SVGELEMENT_TRef, SVGELEMENT_TSpan ) ); 077 078 final Collection<String> attributes = new ArrayList<>(); 079 attributes.addAll( List.of( SVGATTRIBUTE_Id, SVGATTRIBUTE_x, 080 SVGATTRIBUTE_y, SVGATTRIBUTE_dx, SVGATTRIBUTE_dy, 081 SVGATTRIBUTE_Rotate, SVGATTRIBUTE_TextLength, 082 SVGATTRIBUTE_LengthAdjust ) ); 083 attributes.addAll( CONDITIONALPROCESSING_ATTRIBUTES ); 084 attributes.addAll( CORE_ATTRIBUTES ); 085 attributes.addAll( GRAPHICALEVENT_ATTRIBUTES ); 086 attributes.addAll( STYLE_ATTRIBUTES ); 087 attributes.addAll( PRESENTATION_ATTRIBUTES ); 088 089 updateRegistries( childElements, attributes ); 090 } // SVGTSpanImpl() 091} 092// class SVGTSpanImpl 093 094/* 095 * End of File 096 */