public StencilOperator instance(String name, Specializer specializer) throws SpecializationException { if (specializer.equals(moduleData.getDefaultSpecializer(name))) { if (name.equals("Index")) { return new Index(); } else if (name.equals("HeatScale")) { return new HeatScale(specializer); } else if (name.equals("Count")) { return new Count(); } else if (name.equals("Justify")) { throw new RuntimeException("Justify doesn't work yet...sorry."); } throw new IllegalArgumentException("Name not known : " + name); } else if (name.equals("Count") && specializer.getArgs().contains(1)) { return new SimpleCount(); } else { throw new SpecializationException(MODULE_NAME, name, specializer); } }
public HeatScale(Specializer spec) { cold = (Color) spec.getMap().get("cold").getValue(); hot = (Color) spec.getMap().get("hot").getValue(); }