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_Class;
022import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_Height;
023import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_Id;
024import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_PathLength;
025import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_Style;
026import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_Width;
027import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_rx;
028import static org.tquadrat.foundation.svg.SVGUtils.SVGATTRIBUTE_ry;
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_Rectangle;
032import static org.tquadrat.foundation.svg.type.SVGElementCategory.ANIMATION;
033import static org.tquadrat.foundation.svg.type.SVGElementCategory.DESCRIPTIVE;
034import static org.tquadrat.foundation.xml.builder.XMLElement.Flags.ALLOWS_CHILDREN;
035import static org.tquadrat.foundation.xml.builder.XMLElement.Flags.VALIDATES_ATTRIBUTES;
036import static org.tquadrat.foundation.xml.builder.XMLElement.Flags.VALIDATES_CHILDREN;
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.SVGRectangle;
046
047/**
048 *  The implementation of the interface
049 *  {@link SVGRectangle}
050 *  for the SVG {@code <rect>} element.
051 *
052 *  @extauthor Thomas Thrien - thomas.thrien@tquadrat.org
053 *  @version $Id: SVGRectangleImpl.java 1151 2025-10-01 21:32:15Z tquadrat $
054 *  @since 0.0.5
055 *
056 *  @UMLGraph.link
057 */
058@ClassVersion( sourceVersion = "$Id: SVGRectangleImpl.java 1151 2025-10-01 21:32:15Z tquadrat $" )
059@API( status = INTERNAL, since = "0.0.5" )
060public final class SVGRectangleImpl extends SVGElementImpl implements SVGRectangle
061{
062        /*--------------*\
063    ====** Constructors **=====================================================
064        \*--------------*/
065    /**
066     *  Creates a new {@code SVGRectangleImpl} instance.
067     */
068    public SVGRectangleImpl()
069    {
070        super( SVGELEMENT_Rectangle, ALLOWS_CHILDREN, VALIDATES_ATTRIBUTES, VALIDATES_CHILDREN );
071
072        //---* The children and attributes for the <marker> element *----------
073        final Collection<String> childElements = new HashSet<>();
074        childElements.addAll( ANIMATION.getElements() );
075        childElements.addAll( DESCRIPTIVE.getElements() );
076
077        final Collection<String> attributes = new ArrayList<>();
078        attributes.addAll( List.of( SVGATTRIBUTE_Id,
079            SVGATTRIBUTE_x, SVGATTRIBUTE_y, SVGATTRIBUTE_Width,
080            SVGATTRIBUTE_Height, SVGATTRIBUTE_rx, SVGATTRIBUTE_ry,
081            SVGATTRIBUTE_PathLength, SVGATTRIBUTE_Class, SVGATTRIBUTE_Style ) );
082        attributes.addAll( CORE_ATTRIBUTES );
083        attributes.addAll( STYLE_ATTRIBUTES );
084        attributes.addAll( CONDITIONALPROCESSING_ATTRIBUTES );
085        attributes.addAll( GLOBALEVENT_ATTRIBUTES );
086        attributes.addAll( GRAPHICALEVENT_ATTRIBUTES );
087        attributes.addAll( PRESENTATION_ATTRIBUTES );
088
089        updateRegistries( childElements, attributes );
090    }   //  SVGRectangleImpl()
091}
092//  class SVGRectangleImpl
093
094/*
095 *  End of File
096 */