Class EncodeComponent


  • public class EncodeComponent
    extends java.lang.Object
    Used to encode components into different image file formats. ie .GIF and .PNG
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  EncodeComponent.Encoding
      Class used to enumerate valid encodings
    • Constructor Summary

      Constructors 
      Constructor Description
      EncodeComponent()  
    • Method Summary

      Modifier and Type Method Description
      static void encode​(EncodeComponent.Encoding encoding, java.awt.Component component, java.io.File file)
      Invoke this methods on Java components to encode their image into the specified format
      static void encode​(EncodeComponent.Encoding encoding, java.awt.Component component, java.io.OutputStream output)
      Invoke this methods on Java components to encode their image into the specified format
      • Methods inherited from class java.lang.Object

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

      • EncodeComponent

        public EncodeComponent()
    • Method Detail

      • encode

        public static void encode​(EncodeComponent.Encoding encoding,
                                  java.awt.Component component,
                                  java.io.OutputStream output)
                           throws java.io.IOException,
                                  EncoderException
        Invoke this methods on Java components to encode their image into the specified format
        Parameters:
        component - component to encode
        encoding - type of encoding to use (Currently GIF or PNG)
        output - stream to which to write the encoding
        Throws:
        java.io.IOException - an io exception
        EncoderException - a special encoder exception
      • encode

        public static void encode​(EncodeComponent.Encoding encoding,
                                  java.awt.Component component,
                                  java.io.File file)
                           throws java.io.IOException,
                                  EncoderException
        Invoke this methods on Java components to encode their image into the specified format
        Parameters:
        component - component to encode
        encoding - type of encoding to use (GIF, PNG, JPEG, EPS, PS, PDF, or PCL)
        file - file to which to write the encoding
        Throws:
        java.io.IOException - an io exception
        EncoderException - a special encoder exception