Revision 6899 org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.legend/org.gvsig.raster.lib.legend.impl/src/main/java/org/gvsig/raster/lib/legend/impl/io/gvSIGColorTableIO.java

View differences:

gvSIGColorTableIO.java
11 11
import java.util.ArrayList;
12 12
import java.util.List;
13 13

  
14
import org.gvsig.raster.lib.legend.api.ColorTable;
15
import org.gvsig.raster.lib.legend.api.ColorTableClass;
16
import org.gvsig.raster.lib.legend.api.ColorTableIO;
17 14
import org.gvsig.raster.lib.legend.api.RasterLegendLocator;
18 15
import org.gvsig.raster.lib.legend.api.RasterLegendManager;
16
import org.gvsig.raster.lib.legend.api.colortable.ColorTable;
17
import org.gvsig.raster.lib.legend.api.colortable.ColorTableClass;
18
import org.gvsig.raster.lib.legend.api.colortable.ColorTableIO;
19 19
import org.gvsig.raster.lib.legend.api.exceptions.ColorTableIOException;
20

  
20 21
import org.kxml2.io.KXmlParser;
21 22
import org.kxml2.io.KXmlSerializer;
22 23
import org.slf4j.Logger;
......
25 26

  
26 27
/**
27 28
 * {@link ColorTableIO} to read and write gvSIG color tables.
28
 * 
29
 *
29 30
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
30 31
 *
31 32
 */
......
87 88
        for (int i = 0; i < parser.getAttributeCount(); i++) {
88 89
            if (parser.getAttributeName(i).equals("name")) {
89 90
                colorTable.setName(parser.getAttributeValue(i));
90
                break;
91
                continue;
92
            } else if (parser.getAttributeName(i).equals("interpolated")) {
93
                colorTable.setInterpolated(Boolean.parseBoolean(parser.getAttributeValue(i)));
94
                continue;
91 95
            }
96

  
92 97
        }
93 98

  
94 99
        try {
......
182 187
            // Just notice but not throw an exception
183 188
            LOG.warn("Can not close input stream", e);
184 189
        }
185
        
190

  
186 191
        colorTable.setClasses(classes, false);
187 192
        return colorTable;
188 193
    }
......
212 217
            parserOutput.startDocument("UTF-8", null);
213 218
            parserOutput.startTag(null, "ColorTable");
214 219
            parserOutput.attribute(null, "name", colorTable.getName());
220
            parserOutput.attribute(null, "interpolated", String.valueOf(colorTable.isInterpolated()));
215 221
            parserOutput.attribute(null, "version", "1.1");
216 222
            parserOutput.text("\n");
217 223

  

Also available in: Unified diff