Class SvgGraphic

  • Direct Known Subclasses:
    SvgContainer, SvgShape, SvgUse

    public abstract class SvgGraphic
    extends SvgElement
    A base abstract class for all types of svg elements which can be applied (painted) to a graphics context. These may be shapes which can be painted directly, or containers which will paint their children.
    • Constructor Detail

      • SvgGraphic

        SvgGraphic​(SvgContainer container,
                   java.lang.String id)
    • Method Detail

      • apply

        public abstract void apply​(org.eclipse.swt.graphics.GC gc)
        Apply this svg graphic to the given graphics context.

        Note that to support the rather abstract structure of svg, each time this method is called all transformations and css properties to be calculated and applied. If this is a shape, it will be painted to the graphics context. Containers will recursively make this call on their children.

        Parameters:
        gc - the gc to use in all graphics operations
      • getDescription

        public java.lang.String getDescription()
        Returns the value of the desc element that is a child of this svg element. If there is no desc element that is a direct decendent of this element, null is returned.
        Returns:
        the desc of this svg element
      • getTransform

        org.eclipse.swt.graphics.Transform getTransform​(org.eclipse.swt.graphics.GC gc)
      • getTitle

        public java.lang.String getTitle()
        Returns the value of the title element that is a child of this svg element. If there is no title element that is a direct decendent of this element, null is returned.
        Returns:
        the title of this svg element