Class AppleImage

  • Direct Known Subclasses:
    ImageIoImage, SunJpegImage

    public abstract class AppleImage
    extends java.lang.Object
    AppleImage is an abstract class that represents a generic interface for handing graphic images. This abstraction is needed because not all graphic routines use BufferedImage. AppleImage itself acts as a factory for creating "the best" AppleImage subclass.

    Date Created: Mar 25, 2003

    • Constructor Summary

      Constructors 
      Constructor Description
      AppleImage​(java.lang.String[] availableExtensions)
      Construct AppleImage.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static AppleImage create​(int width, int height)
      Create a specific instance of AppleImage.
      java.lang.String[] getAvailableExtensions()
      Return a list of file extensions that this specific implementation can handle.
      java.lang.String getDefaultExtension()
      Get the default file extension.
      java.lang.String getFileExtension()
      Returns the file extension.
      abstract int getHeight()
      Return the height of the image.
      abstract int getPoint​(int x, int y)
      Get a color point.
      abstract int getWidth()
      Return the width of the image.
      abstract void save​(java.io.OutputStream outputStream)
      Save the image.
      protected void setAvailableExtensions​(java.lang.String[] availableExtensions)
      Set the list of file extensions that can be handled.
      void setFileExtension​(java.lang.String fileExtension)
      Sets the file extension.
      abstract void setPoint​(int x, int y, int color)
      Set a color point.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AppleImage

        public AppleImage​(java.lang.String[] availableExtensions)
        Construct AppleImage.
    • Method Detail

      • create

        public static AppleImage create​(int width,
                                        int height)
        Create a specific instance of AppleImage. This has been coded using Reflection to ease native compilation for the most part.
      • getDefaultExtension

        public java.lang.String getDefaultExtension()
        Get the default file extension. Used to "prime" the graphics FileFilter.
      • getAvailableExtensions

        public java.lang.String[] getAvailableExtensions()
        Return a list of file extensions that this specific implementation can handle.
      • setAvailableExtensions

        protected void setAvailableExtensions​(java.lang.String[] availableExtensions)
        Set the list of file extensions that can be handled.
      • getFileExtension

        public java.lang.String getFileExtension()
        Returns the file extension.
      • setFileExtension

        public void setFileExtension​(java.lang.String fileExtension)
        Sets the file extension.
      • setPoint

        public abstract void setPoint​(int x,
                                      int y,
                                      int color)
        Set a color point.
      • getPoint

        public abstract int getPoint​(int x,
                                     int y)
        Get a color point.
      • save

        public abstract void save​(java.io.OutputStream outputStream)
                           throws java.io.IOException
        Save the image.
        Throws:
        java.io.IOException
      • getWidth

        public abstract int getWidth()
        Return the width of the image.
      • getHeight

        public abstract int getHeight()
        Return the height of the image.