class CategorizedColor extends CategorizedLegend<Color> {

    public void setParameter(ColorParameter param) {
        if(param instanceof ColorLiteral){
            parameter = param;
            fireTypeChanged();
        } else if(param instanceof Categorize2Color){
            RealParameter rp = ((Categorize2Color) param).getLookupValue();
            if(rp instanceof RealAttribute){
                parameter = param;
                field = ((RealAttribute) rp).getColumnName();
                fireTypeChanged();
            } else {
                throw new IllegalArgumentException("The given ColorParameter instance can't be recognized as a " +
                        "valid CategorizedColor.");
            }
        } else {
            throw new IllegalArgumentException("The given ColorParameter instance can't be recognized as a " +
                    "valid CategorizedColor.");
        }
    }

    public  CategorizedColor(ColorParameter sp);

}