class StyleFactory {

    public FeatureVisualizationStyle newStyle(Collection<? extends Action> actions, DataTypeInfo dataType,
            FeatureVisualizationStyle defaultStyle)
    {
        FeatureVisualizationStyle style = null;
        FeatureVisualizationStyle defaultStyleCopy = clone(defaultStyle, dataType);
        boolean containsLabelAction = false;
        if (actions.size() == 1)
        {
            Action action = actions.iterator().next();
            if (action instanceof StyleAction)
            {
                style = newStyleStyle((StyleAction)action, dataType, defaultStyleCopy);
            }
            else if (action instanceof LabelAction)
            {
                containsLabelAction = true;
                style = addLabelStyle((LabelAction)action, dataType, defaultStyleCopy);
            }
        }
        else
        {
            Map<Class<?>, Action> classToAction = New.map();
            for (Action action : actions)
            {
                if (action instanceof StyleAction)
                {
                    StyleAction previousAction = (StyleAction)classToAction.get(action.getClass());
                    classToAction.put(action.getClass(), merge(previousAction, (StyleAction)action));
                }
                else
                {
                    classToAction.put(action.getClass(), action);
                }
            }
            StyleAction styleAction = (StyleAction)classToAction.get(StyleAction.class);
            LabelAction labelAction = (LabelAction)classToAction.get(LabelAction.class);

            // The idea here is to create the style one first and then attach
            // the label settings to it, if possible
            if (styleAction != null)
            {
                style = newStyleStyle(styleAction, dataType, defaultStyleCopy);
            }
            if (labelAction != null)
            {
                containsLabelAction = true;
                if (style == null)
                {
                    style = defaultStyleCopy;
                }
                style = addLabelStyle(labelAction, dataType, style);
            }
        }

        myLabelApplier.applyLabel(style, containsLabelAction, defaultStyleCopy);

        return style;
    }

    public  StyleFactory(Toolbox toolbox);

}