Class ImageInfo

java.lang.Object
com.iizigo.image.ImageInfo
All Implemented Interfaces:
EventListener, Runnable

public class ImageInfo extends Object implements EventListener, Runnable
The image info used by the image editor components.
Author:
Christopher Mindus
  • Constructor Details

    • ImageInfo

      public ImageInfo(IFile file)
      Creates an instance from an existing file to load the image.
  • Method Details

    • grab

      public static ImageInfo grab(AssetReference ref, GProp<?> anyPropInTree)
      From a AssetReference, gets the ImageInfo instance and adds a reference count to it.
    • addListener

      public void addListener(IImageInfoChanged listener)
      Adds listener.
    • removeListener

      public void removeListener(IImageInfoChanged listener)
      Adds listener.
    • dispose

      public void dispose()
      Disposes of the instance, i.e. the image.
    • release

      public void release()
      Releases this instance that was "grabbed".
    • onEvent

      public void onEvent(GEvent event)
      Property event.
      Specified by:
      onEvent in interface EventListener
      Parameters:
      event - The event.
    • run

      public void run()
      Called at async prop events.
      Specified by:
      run in interface Runnable
    • isValid

      public boolean isValid()
      Checks for validity.
    • getImage

      public Image getImage()
      Gets the image.
    • getWidth

      public int getWidth()
      Gets the width.
    • getHeight

      public int getHeight()
      Gets the height.
    • getSize

      public Size getSize()
      Gets the size.
      Returns:
      The size, or null if not valid.
    • getFile

      public IFile getFile()
      Gets the file.
    • getError

      public String getError()
      Gets the error text when not valid.
      Returns:
      The error string, null when valid.
    • getAssetReference

      public AssetReference getAssetReference()
      Gets the reference.
    • toString

      public String toString()
      Prints a string representation.
      Overrides:
      toString in class Object