de.caff.vic

## Class SimpleVectorImageReader

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - de.caff.vic.SimpleVectorImageReader

- All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

      public class SimpleVectorImageReader
      extends org.xml.sax.helpers.DefaultHandler

  Minimalistic reader for vector icons.
  Author:
    Rammi

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ATTR_ALPHA`
    `static java.lang.String` | `ATTR_CAP`
    `static java.lang.String` | `ATTR_CENTERX`
    `static java.lang.String` | `ATTR_CENTERY`
    `static java.lang.String` | `ATTR_COLORS`
    `static java.lang.String` | `ATTR_CYCLE`
    `static java.lang.String` | `ATTR_DASHES`
    `static java.lang.String` | `ATTR_DASHPHASE`
    `static java.lang.String` | `ATTR_DATA`
    `static java.lang.String` | `ATTR_DRAW`
    `static java.lang.String` | `ATTR_ENDX`
    `static java.lang.String` | `ATTR_ENDY`
    `static java.lang.String` | `ATTR_FILL`
    `static java.lang.String` | `ATTR_FOCUSX`
    `static java.lang.String` | `ATTR_FOCUSY`
    `static java.lang.String` | `ATTR_FORMAT`
    `static java.lang.String` | `ATTR_FRACTIONS`
    `static java.lang.String` | `ATTR_HEIGHT`
    `static java.lang.String` | `ATTR_ID`
    `static java.lang.String` | `ATTR_IMAGE`
    `static java.lang.String` | `ATTR_JOIN`
    `static java.lang.String` | `ATTR_MITERLIMIT`
    `static java.lang.String` | `ATTR_PATH`
    `static java.lang.String` | `ATTR_RADIUS`
    `static java.lang.String` | `ATTR_RESET`
    `static java.lang.String` | `ATTR_RULE`
    `static java.lang.String` | `ATTR_STARTX`
    `static java.lang.String` | `ATTR_STARTY`
    `static java.lang.String` | `ATTR_STROKE`
    `static java.lang.String` | `ATTR_TRAFO`
    `static java.lang.String` | `ATTR_VERSION`
    `static java.lang.String` | `ATTR_WIDTH`
    `static java.lang.String` | `ATTR_WINDING`
    `static java.lang.String` | `TAG_CLIP`
    `static java.lang.String` | `TAG_COMPOSITE`
    `static java.lang.String` | `TAG_DISPLAY`
    `static java.lang.String` | `TAG_GROUP`
    `static java.lang.String` | `TAG_IMAGE`
    `static java.lang.String` | `TAG_LINEAR`
    `static java.lang.String` | `TAG_RADIAL`
    `static java.lang.String` | `TAG_RESTORE_TRANSFORM`
    `static java.lang.String` | `TAG_SHAPE`
    `static java.lang.String` | `TAG_STORE_TRANSFORM`
    `static java.lang.String` | `TAG_STROKE`
    `static java.lang.String` | `TAG_TRANSFORM`
    `static java.lang.String` | `TAG_VICON` Tag of the root element.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleVectorImageReader()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)` Receive notification of the end of an element.
    `VectorImage` | `getImage()` Get the icon.
    `static VectorImage` | `loadImage(java.io.InputStream is)` Read an icon from an input stream.
    `void` | `startDocument()` Receive notification of the beginning of the document.
    `void` | `startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)` Receive notification of the start of an element.

    - ### Methods inherited from class org.xml.sax.helpers.DefaultHandler

      `characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TAG_VICON

          public static final java.lang.String TAG_VICON

      Tag of the root element.
      See Also:
        Constant Field Values

    - #### ATTR_WIDTH

          public static final java.lang.String ATTR_WIDTH

      See Also:
        Constant Field Values

    - #### ATTR_HEIGHT

          public static final java.lang.String ATTR_HEIGHT

      See Also:
        Constant Field Values

    - #### ATTR_VERSION

          public static final java.lang.String ATTR_VERSION

      See Also:
        Constant Field Values

    - #### ATTR_ID

          public static final java.lang.String ATTR_ID

      See Also:
        Constant Field Values

    - #### TAG_LINEAR

          public static final java.lang.String TAG_LINEAR

      See Also:
        Constant Field Values

    - #### ATTR_STARTX

          public static final java.lang.String ATTR_STARTX

      See Also:
        Constant Field Values

    - #### ATTR_STARTY

          public static final java.lang.String ATTR_STARTY

      See Also:
        Constant Field Values

    - #### ATTR_ENDX

          public static final java.lang.String ATTR_ENDX

      See Also:
        Constant Field Values

    - #### ATTR_ENDY

          public static final java.lang.String ATTR_ENDY

      See Also:
        Constant Field Values

    - #### ATTR_FRACTIONS

          public static final java.lang.String ATTR_FRACTIONS

      See Also:
        Constant Field Values

    - #### ATTR_COLORS

          public static final java.lang.String ATTR_COLORS

      See Also:
        Constant Field Values

    - #### ATTR_CYCLE

          public static final java.lang.String ATTR_CYCLE

      See Also:
        Constant Field Values

    - #### TAG_RADIAL

          public static final java.lang.String TAG_RADIAL

      See Also:
        Constant Field Values

    - #### ATTR_CENTERX

          public static final java.lang.String ATTR_CENTERX

      See Also:
        Constant Field Values

    - #### ATTR_CENTERY

          public static final java.lang.String ATTR_CENTERY

      See Also:
        Constant Field Values

    - #### ATTR_RADIUS

          public static final java.lang.String ATTR_RADIUS

      See Also:
        Constant Field Values

    - #### ATTR_FOCUSX

          public static final java.lang.String ATTR_FOCUSX

      See Also:
        Constant Field Values

    - #### ATTR_FOCUSY

          public static final java.lang.String ATTR_FOCUSY

      See Also:
        Constant Field Values

    - #### TAG_STROKE

          public static final java.lang.String TAG_STROKE

      See Also:
        Constant Field Values

    - #### ATTR_CAP

          public static final java.lang.String ATTR_CAP

      See Also:
        Constant Field Values

    - #### ATTR_JOIN

          public static final java.lang.String ATTR_JOIN

      See Also:
        Constant Field Values

    - #### ATTR_MITERLIMIT

          public static final java.lang.String ATTR_MITERLIMIT

      See Also:
        Constant Field Values

    - #### ATTR_DASHES

          public static final java.lang.String ATTR_DASHES

      See Also:
        Constant Field Values

    - #### ATTR_DASHPHASE

          public static final java.lang.String ATTR_DASHPHASE

      See Also:
        Constant Field Values

    - #### TAG_SHAPE

          public static final java.lang.String TAG_SHAPE

      See Also:
        Constant Field Values

    - #### ATTR_PATH

          public static final java.lang.String ATTR_PATH

      See Also:
        Constant Field Values

    - #### ATTR_WINDING

          public static final java.lang.String ATTR_WINDING

      See Also:
        Constant Field Values

    - #### ATTR_STROKE

          public static final java.lang.String ATTR_STROKE

      See Also:
        Constant Field Values

    - #### ATTR_DRAW

          public static final java.lang.String ATTR_DRAW

      See Also:
        Constant Field Values

    - #### ATTR_FILL

          public static final java.lang.String ATTR_FILL

      See Also:
        Constant Field Values

    - #### TAG_IMAGE

          public static final java.lang.String TAG_IMAGE

      See Also:
        Constant Field Values

    - #### ATTR_FORMAT

          public static final java.lang.String ATTR_FORMAT

      See Also:
        Constant Field Values

    - #### ATTR_DATA

          public static final java.lang.String ATTR_DATA

      See Also:
        Constant Field Values

    - #### TAG_CLIP

          public static final java.lang.String TAG_CLIP

      See Also:
        Constant Field Values

    - #### ATTR_RESET

          public static final java.lang.String ATTR_RESET

      See Also:
        Constant Field Values

    - #### TAG_COMPOSITE

          public static final java.lang.String TAG_COMPOSITE

      See Also:
        Constant Field Values

    - #### ATTR_RULE

          public static final java.lang.String ATTR_RULE

      See Also:
        Constant Field Values

    - #### ATTR_ALPHA

          public static final java.lang.String ATTR_ALPHA

      See Also:
        Constant Field Values

    - #### TAG_TRANSFORM

          public static final java.lang.String TAG_TRANSFORM

      See Also:
        Constant Field Values

    - #### TAG_STORE_TRANSFORM

          public static final java.lang.String TAG_STORE_TRANSFORM

      See Also:
        Constant Field Values

    - #### TAG_RESTORE_TRANSFORM

          public static final java.lang.String TAG_RESTORE_TRANSFORM

      See Also:
        Constant Field Values

    - #### TAG_GROUP

          public static final java.lang.String TAG_GROUP

      See Also:
        Constant Field Values

    - #### TAG_DISPLAY

          public static final java.lang.String TAG_DISPLAY

      See Also:
        Constant Field Values

    - #### ATTR_IMAGE

          public static final java.lang.String ATTR_IMAGE

      See Also:
        Constant Field Values

    - #### ATTR_TRAFO

          public static final java.lang.String ATTR_TRAFO

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SimpleVectorImageReader

          public SimpleVectorImageReader()

  - ### Method Detail

    - #### startDocument

          public void startDocument()

      Receive notification of the beginning of the document.

      By default, do nothing. Application writers may override this method in a subclass to take specific actions at the beginning of a document (such as allocating the root node of a tree or creating an output file).

      Specified by:
        `startDocument` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `startDocument` in class `org.xml.sax.helpers.DefaultHandler`

    - #### startElement

          public void startElement(java.lang.String uri,
                                   java.lang.String localName,
                                   java.lang.String qName,
                                   org.xml.sax.Attributes attributes)
                            throws org.xml.sax.SAXException

      Receive notification of the start of an element.

      By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).

      Specified by:
        `startElement` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `startElement` in class `org.xml.sax.helpers.DefaultHandler`
      Parameters:
        `uri` - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
        `localName` - The local name (without prefix), or the empty string if Namespace processing is not being performed.
        `qName` - The qualified name (with prefix), or the empty string if qualified names are not available.
        `attributes` - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
      Throws:
        `org.xml.sax.SAXException` - Any SAX exception, possibly wrapping another exception.

    - #### endElement

          public void endElement(java.lang.String uri,
                                 java.lang.String localName,
                                 java.lang.String qName)

      Receive notification of the end of an element.

      By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).

      Specified by:
        `endElement` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `endElement` in class `org.xml.sax.helpers.DefaultHandler`
      Parameters:
        `uri` - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
        `localName` - The local name (without prefix), or the empty string if Namespace processing is not being performed.
        `qName` - The qualified name (with prefix), or the empty string if qualified names are not available.

    - #### getImage

          public VectorImage getImage()

      Get the icon.
      Returns:
        icon

    - #### loadImage

          public static VectorImage loadImage(java.io.InputStream is)
                                       throws javax.xml.parsers.ParserConfigurationException,
                                              org.xml.sax.SAXException,
                                              java.io.IOException

      Read an icon from an input stream.
      Parameters:
        `is` - input stream
      Returns:
        the icon
      Throws:
        `javax.xml.parsers.ParserConfigurationException` - on parser config errors
        `org.xml.sax.SAXException` - on format errors
        `java.io.IOException` - on read errors