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_TextAnchor; 025import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_TextLength; 026import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_Transform; 027import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_dx; 028import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_dy; 029import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_x; 030import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_y; 031import static org.tquadrat.foundation.svg.SVGUtils.SVGELEMENT_Anchor; 032import static org.tquadrat.foundation.svg.SVGUtils.SVGELEMENT_Text; 033import static org.tquadrat.foundation.svg.type.SVGElementCategory.ANIMATION; 034import static org.tquadrat.foundation.svg.type.SVGElementCategory.DESCRIPTIVE; 035import static org.tquadrat.foundation.svg.type.SVGElementCategory.TEXT_CONTENT; 036 037import java.util.ArrayList; 038import java.util.Collection; 039import java.util.HashSet; 040import java.util.List; 041 042import org.apiguardian.api.API; 043import org.tquadrat.foundation.annotation.ClassVersion; 044import org.tquadrat.foundation.svg.SVGText; 045 046/** 047 * The implementation of the interface 048 * {@link SVGText}. 049 * 050 * @extauthor Thomas Thrien - thomas.thrien@tquadrat.org 051 * @version $Id: SVGTextImpl.java 1151 2025-10-01 21:32:15Z tquadrat $ 052 * @since 0.0.5 053 * 054 * @UMLGraph.link 055 */ 056@ClassVersion( sourceVersion = "$Id: SVGTextImpl.java 1151 2025-10-01 21:32:15Z tquadrat $" ) 057@API( status = INTERNAL, since = "0.0.5" ) 058public final class SVGTextImpl extends SVGTextBase implements SVGText 059{ 060 /*--------------*\ 061 ====** Constructors **===================================================== 062 \*--------------*/ 063 /** 064 * Creates a new {@code SVGTextImpl} instance. 065 */ 066 public SVGTextImpl() 067 { 068 super( SVGELEMENT_Text ); 069 070 //---* The children and attributes for the <text> element *------------ 071 final Collection<String> childElements = new HashSet<>(); 072 childElements.addAll( ANIMATION.getElements() ); 073 childElements.addAll( DESCRIPTIVE.getElements() ); 074 childElements.addAll( TEXT_CONTENT.getElements() ); 075 childElements.add( SVGELEMENT_Anchor ); 076 077 final Collection<String> attributes = new ArrayList<>(); 078 attributes.addAll( List.of( SVGATTRIBUTE_Id, SVGATTRIBUTE_x, 079 SVGATTRIBUTE_y, SVGATTRIBUTE_dx, SVGATTRIBUTE_dy, 080 SVGATTRIBUTE_TextAnchor, SVGATTRIBUTE_Rotate, 081 SVGATTRIBUTE_TextLength, SVGATTRIBUTE_LengthAdjust, 082 SVGATTRIBUTE_Transform ) ); 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 } // SVGTextImpl() 091} 092// class SVGTextImpl 093 094/* 095 * End of File 096 */