Commit 32bb3000 authored by lafabregue's avatar lafabregue

color import fix for samarah

parent 32156493
......@@ -909,7 +909,7 @@ public abstract class ClusteringResult implements Serializable, MemoryFlush {
* les nouvelles couleurs
*/
public void setColors(final List<Color> colors) {
for (int i = 0; i < colors.size(); i++) {
for (int i = 0; i < clusters.length; i++) {
this.clusters[i].setColor(colors.get(i));
}
}
......
......@@ -126,6 +126,8 @@ public class HybridClassification extends Classification implements Runnable, It
/** specify if the the classification come from an import or not */
protected boolean imported = false;
protected List<Color> importedColors = null;
/** pour Germain ! */
public int[] overall_stat;
......@@ -1380,7 +1382,8 @@ public class HybridClassification extends Classification implements Runnable, It
final ClusteringResult tmp = ClusteringResult.gerenerateDefaultClusteringResult(null, ff,
new GlobalWeights(data.getOneDataObject()), nbClasses, data,
HybridClassification.QUALITY_INDICES, null);
HybridClassification.QUALITY_INDICES, importedColors);
importedColors = null;
return tmp;
}
......@@ -1494,7 +1497,6 @@ public class HybridClassification extends Classification implements Runnable, It
*/
protected Classification importHybridClassification(String model, HybridClassification classification)
throws MethodNotImplementedException, JCLFormatException {
List<Color> colors = null;
List<String> agents = null;
List<String> sections = null;
Vector<LearningAgent> lagents = null;
......@@ -1508,7 +1510,7 @@ public class HybridClassification extends Classification implements Runnable, It
for (String s : sections) {
switch (JCLModelExchange.getSectionTitle(s)) {
case JCLModelExchange.MODEL_COLOR_SECTION :
colors = JCLModelExchange.stringToColors(JCLModelExchange.getSectionBody(s));
classification.importedColors = JCLModelExchange.stringToColors(JCLModelExchange.getSectionBody(s));
break;
case JCLModelExchange.MODEL_PARAMETERS_SECTION :
// we have to remove the title but also the second line that only describes the parameters
......@@ -1546,10 +1548,6 @@ public class HybridClassification extends Classification implements Runnable, It
agentClassifIDs = JCLModelExchange.stringToIDs(JCLModelExchange.getSectionBody(s));
}
}
if (colors != null) {
//TODO add the possibility to add pre-defined color set to a Classification
}
lagents = new Vector<LearningAgent>();
for (int i = 0 ; i < agents.size() ; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment