Ejemplo n.º 1
0
  public static ColorScale loadFromXML(String filename) throws ColorScaleException {
    try {
      InputStream stream = null;
      try {
        stream = new FileInputStream(filename);
        ColorScale cs = new ColorScale();
        cs.fromXML(stream);

        return cs;
      } finally {
        if (stream != null) {
          IOUtils.closeQuietly(stream);
        }
      }
    } catch (IOException e) {
      e.printStackTrace();
      throw new ColorScaleException(e);
    }
  }
Ejemplo n.º 2
0
  public static ColorScale loadFromXML(InputStream stream) throws ColorScaleException {
    ColorScale cs = new ColorScale();
    cs.fromXML(stream);

    return cs;
  }