Class SaveGraphicsService

  • All Implemented Interfaces:

    
    public class SaveGraphicsService
    
                        

    Class is responsible for taking a component and saving it as a JPEG, PNG or TIFF. The class is very simple. Thanks to Batik and the developers who worked so hard on it.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      void saveJComponent(String filename, int type, JComponent component) Method will save the JComponent as an image.
      void savePNGWithBatik(String filename, BufferedImage image) Use Batik to save a PNG of the graph
      void saveTIFFWithBatik(String filename, BufferedImage image) Use Batik to save a TIFF file of the graph
      • Methods inherited from class java.lang.Object

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

      • SaveGraphicsService

        SaveGraphicsService()
    • Method Detail

      • saveJComponent

         void saveJComponent(String filename, int type, JComponent component)

        Method will save the JComponent as an image. The formats are PNG, and TIFF.

        Parameters:
        filename - name of the file to store the image into
        type - of the image to be stored.
        component - to draw the image on
      • savePNGWithBatik

         void savePNGWithBatik(String filename, BufferedImage image)

        Use Batik to save a PNG of the graph

        Parameters:
        filename - name of the file to store the image into
        image - to be stored
      • saveTIFFWithBatik

         void saveTIFFWithBatik(String filename, BufferedImage image)

        Use Batik to save a TIFF file of the graph

        Parameters:
        filename - name of the file to store the image into
        image - to be stored