# ParticleIO (Slick - The 2D Library)
Date: 2013-06-03

## org.newdawn.slick.particles
Class ParticleIO

    java.lang.Object
      org.newdawn.slick.particles.ParticleIO

    public class ParticleIO

extends java.lang.Object

Utility methods to (de)serialize ConfigureEmitters to and from XML

Author:
  kevin

Constructor Summary
`ParticleIO()`

Method Summary
`static ParticleSystem` `loadConfiguredSystem(java.io.File ref)` Load a set of configured emitters into a single system
`static ParticleSystem` `loadConfiguredSystem(java.io.File ref, ConfigurableEmitterFactory factory)` Load a set of configured emitters into a single system
`static ParticleSystem` `loadConfiguredSystem(java.io.InputStream ref)` Load a set of configured emitters into a single system
`static ParticleSystem` `loadConfiguredSystem(java.io.InputStream ref, Color mask)` Load a set of configured emitters into a single system
`static ParticleSystem` `loadConfiguredSystem(java.io.InputStream ref, ConfigurableEmitterFactory factory)` Load a set of configured emitters into a single system
`static ParticleSystem` `loadConfiguredSystem(java.io.InputStream ref, ConfigurableEmitterFactory factory, ParticleSystem system, Color mask)` Load a set of configured emitters into a single system
`static ParticleSystem` `loadConfiguredSystem(java.lang.String ref)` Load a set of configured emitters into a single system
`static ParticleSystem` `loadConfiguredSystem(java.lang.String ref, Color mask)` Load a set of configured emitters into a single system
`static ParticleSystem` `loadConfiguredSystem(java.lang.String ref, ConfigurableEmitterFactory factory)` Load a set of configured emitters into a single system
`static ConfigurableEmitter` `loadEmitter(java.io.File ref)` Load a single emitter from an XML file
`static ConfigurableEmitter` `loadEmitter(java.io.File ref, ConfigurableEmitterFactory factory)` Load a single emitter from an XML file
`static ConfigurableEmitter` `loadEmitter(java.io.InputStream ref)` Load a single emitter from an XML file
`static ConfigurableEmitter` `loadEmitter(java.io.InputStream ref, ConfigurableEmitterFactory factory)` Load a single emitter from an XML file
`static ConfigurableEmitter` `loadEmitter(java.lang.String ref)` Load a single emitter from an XML file
`static ConfigurableEmitter` `loadEmitter(java.lang.String ref, ConfigurableEmitterFactory factory)` Load a single emitter from an XML file
`static void` `saveConfiguredSystem(java.io.File file, ParticleSystem system)` Save a particle system with only ConfigurableEmitters in to an XML file
`static void` `saveConfiguredSystem(java.io.OutputStream out, ParticleSystem system)` Save a particle system with only ConfigurableEmitters in to an XML file
`static void` `saveEmitter(java.io.File file, ConfigurableEmitter emitter)` Save a single emitter to the XML file
`static void` `saveEmitter(java.io.OutputStream out, ConfigurableEmitter emitter)` Save a single emitter to the XML file

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ParticleIO

    public ParticleIO()

Method Detail

### loadConfiguredSystem

    public static ParticleSystem loadConfiguredSystem(java.lang.String ref,
                                                      Color mask)
                                               throws java.io.IOException

  Load a set of configured emitters into a single system

  Parameters:
    `ref` - The reference to the XML file (file or classpath)
    `mask` -
  Returns:
    A configured particle system
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### loadConfiguredSystem

    public static ParticleSystem loadConfiguredSystem(java.lang.String ref)
                                               throws java.io.IOException

  Load a set of configured emitters into a single system

  Parameters:
    `ref` - The reference to the XML file (file or classpath)
  Returns:
    A configured particle system
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### loadConfiguredSystem

    public static ParticleSystem loadConfiguredSystem(java.io.File ref)
                                               throws java.io.IOException

  Load a set of configured emitters into a single system

  Parameters:
    `ref` - The XML file to read
  Returns:
    A configured particle system
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### loadConfiguredSystem

    public static ParticleSystem loadConfiguredSystem(java.io.InputStream ref,
                                                      Color mask)
                                               throws java.io.IOException

  Load a set of configured emitters into a single system

  Parameters:
    `ref` - The stream to read the XML from
    `mask` - The mask used to make the particle image transparent
  Returns:
    A configured particle system
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### loadConfiguredSystem

    public static ParticleSystem loadConfiguredSystem(java.io.InputStream ref)
                                               throws java.io.IOException

  Load a set of configured emitters into a single system

  Parameters:
    `ref` - The stream to read the XML from
  Returns:
    A configured particle system
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### loadConfiguredSystem

    public static ParticleSystem loadConfiguredSystem(java.lang.String ref,
                                                      ConfigurableEmitterFactory factory)
                                               throws java.io.IOException

  Load a set of configured emitters into a single system

  Parameters:
    `ref` - The reference to the XML file (file or classpath)
    `factory` - The factory used to create the emitter than will be poulated with loaded data.
  Returns:
    A configured particle system
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### loadConfiguredSystem

    public static ParticleSystem loadConfiguredSystem(java.io.File ref,
                                                      ConfigurableEmitterFactory factory)
                                               throws java.io.IOException

  Load a set of configured emitters into a single system

  Parameters:
    `ref` - The XML file to read
    `factory` - The factory used to create the emitter than will be poulated with loaded data.
  Returns:
    A configured particle system
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### loadConfiguredSystem

    public static ParticleSystem loadConfiguredSystem(java.io.InputStream ref,
                                                      ConfigurableEmitterFactory factory)
                                               throws java.io.IOException

  Load a set of configured emitters into a single system

  Parameters:
    `ref` - The stream to read the XML from
    `factory` - The factory used to create the emitter than will be poulated with loaded data.
  Returns:
    A configured particle system
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### loadConfiguredSystem

    public static ParticleSystem loadConfiguredSystem(java.io.InputStream ref,
                                                      ConfigurableEmitterFactory factory,
                                                      ParticleSystem system,
                                                      Color mask)
                                               throws java.io.IOException

  Load a set of configured emitters into a single system

  Parameters:
    `ref` - The stream to read the XML from
    `factory` - The factory used to create the emitter than will be poulated with loaded data.
    `system` - The particle system that will be loaded into
    `mask` - The mask used to make the image background transparent
  Returns:
    A configured particle system
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### saveConfiguredSystem

    public static void saveConfiguredSystem(java.io.File file,
                                            ParticleSystem system)
                                     throws java.io.IOException

  Save a particle system with only ConfigurableEmitters in to an XML file

  Parameters:
    `file` - The file to save to
    `system` - The system to store
  Throws:
    `java.io.IOException` - Indicates a failure to save or encode the system XML.

### saveConfiguredSystem

    public static void saveConfiguredSystem(java.io.OutputStream out,
                                            ParticleSystem system)
                                     throws java.io.IOException

  Save a particle system with only ConfigurableEmitters in to an XML file

  Parameters:
    `out` - The location to which we'll save
    `system` - The system to store
  Throws:
    `java.io.IOException` - Indicates a failure to save or encode the system XML.

### loadEmitter

    public static ConfigurableEmitter loadEmitter(java.lang.String ref)
                                           throws java.io.IOException

  Load a single emitter from an XML file

  Parameters:
    `ref` - The reference to the emitter XML file to load (classpath or file)
  Returns:
    The configured emitter
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### loadEmitter

    public static ConfigurableEmitter loadEmitter(java.io.File ref)
                                           throws java.io.IOException

  Load a single emitter from an XML file

  Parameters:
    `ref` - The XML file to read
  Returns:
    The configured emitter
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### loadEmitter

    public static ConfigurableEmitter loadEmitter(java.io.InputStream ref)
                                           throws java.io.IOException

  Load a single emitter from an XML file

  Parameters:
    `ref` - The stream to read the XML from
  Returns:
    The configured emitter
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### loadEmitter

    public static ConfigurableEmitter loadEmitter(java.lang.String ref,
                                                  ConfigurableEmitterFactory factory)
                                           throws java.io.IOException

  Load a single emitter from an XML file

  Parameters:
    `ref` - The reference to the emitter XML file to load (classpath or file)
    `factory` - The factory used to create the emitter than will be poulated with loaded data.
  Returns:
    The configured emitter
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### loadEmitter

    public static ConfigurableEmitter loadEmitter(java.io.File ref,
                                                  ConfigurableEmitterFactory factory)
                                           throws java.io.IOException

  Load a single emitter from an XML file

  Parameters:
    `ref` - The XML file to read
    `factory` - The factory used to create the emitter than will be poulated with loaded data.
  Returns:
    The configured emitter
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### loadEmitter

    public static ConfigurableEmitter loadEmitter(java.io.InputStream ref,
                                                  ConfigurableEmitterFactory factory)
                                           throws java.io.IOException

  Load a single emitter from an XML file

  Parameters:
    `ref` - The stream to read the XML from
    `factory` - The factory used to create the emitter than will be poulated with loaded data.
  Returns:
    The configured emitter
  Throws:
    `java.io.IOException` - Indicates a failure to find, read or parse the XML file

### saveEmitter

    public static void saveEmitter(java.io.File file,
                                   ConfigurableEmitter emitter)
                            throws java.io.IOException

  Save a single emitter to the XML file

  Parameters:
    `file` - The file to save the emitter to
    `emitter` - The emitter to store to the XML file
  Throws:
    `java.io.IOException` - Indicates a failure to write or encode the XML

### saveEmitter

    public static void saveEmitter(java.io.OutputStream out,
                                   ConfigurableEmitter emitter)
                            throws java.io.IOException

  Save a single emitter to the XML file

  Parameters:
    `out` - The location to which we should save
    `emitter` - The emitter to store to the XML file
  Throws:
    `java.io.IOException` - Indicates a failure to write or encode the XML

Copyright © 2006 New Dawn Software. All Rights Reserved.