Class SVGDefinition

All Implemented Interfaces:
EventListener, IAssetReferenceListener, IGProp<GProp<?>[]>, IImageTarget, IPropCnr, Cloneable
Direct Known Subclasses:
EditorSVGDefinition

public class SVGDefinition extends AbstractImageDefinition implements IImageTarget, IAssetReferenceListener
The SVG Image Definition property container contains a reference to an SVG file in the Assets.
Author:
Christopher Mindus
  • Constructor Details

    • SVGDefinition

      public SVGDefinition()
      Creates the Images Definition property container without a name. The name must be set in all cases using the setPropertyAtom call.
    • SVGDefinition

      public SVGDefinition(Atom propertyAtom)
      Creates the Images Definition property container with the specified name. All system-reserved names for components begins with "$".
      Parameters:
      propertyAtom - the name of the component, unique within it's parent.
  • Method Details

    • clone

      public PropCnr clone() throws CloneNotSupportedException
      Clone of image forces creation of the source client image data.
      Overrides:
      clone in class PropCnr
      Throws:
      CloneNotSupportedException - If a subclass doesn't allow cloning, e.g. the client properties.
    • isImageTargetValid

      public boolean isImageTargetValid()
      Checks if this target is valid.
      Specified by:
      isImageTargetValid in interface IImageTarget
    • onEventSelf

      public void onEventSelf(GEvent event)
      Overridden to check for cache clearing...
      Specified by:
      onEventSelf in interface IGProp<GProp<?>[]>
      Overrides:
      onEventSelf in class GProp<GProp<?>[]>
      Parameters:
      event - The property event.
    • getClientImageData

      public ClientImageData getClientImageData()
      Gets the Client image data.
      Specified by:
      getClientImageData in interface IImageTarget
    • getSVGInfo

      public SVGInfo getSVGInfo()
      Gets the SVG information.
      Returns:
      The SVG information, null if SVG file is undefined or it is not available due to XML errors in the SVG.
    • getAssetReference

      public AssetReference getAssetReference()
      Gets the asset reference.
      Returns:
      The reference, or null for failure.
    • onAssetReferenceChanged

      public void onAssetReferenceChanged(AssetReference ref)
      Called when an asset file has been changed, either using new reference or the file contents. This enables verification of e.g. image size.
      Specified by:
      onAssetReferenceChanged in interface IAssetReferenceListener
      Parameters:
      ref - The asset reference that was changed.