* @param problems problem collection used to collect problems occurred within this method
* @return the matching BlendMode
*/
protected BlendMode parseBlendMode(String value, BlendMode defMode, Collection<ICompilerProblem> problems)
{
FXGVersion fileVersion = ((GraphicNode)(this.getDocumentNode())).getVersion();
if (FXG_BLENDMODE_ADD_VALUE.equals(value))
{
return BlendMode.ADD;
}
else if (FXG_BLENDMODE_ALPHA_VALUE.equals(value))
{
return BlendMode.ALPHA;
}
else if (FXG_BLENDMODE_DARKEN_VALUE.equals(value))
{
return BlendMode.DARKEN;
}
else if (FXG_BLENDMODE_DIFFERENCE_VALUE.equals(value))
{
return BlendMode.DIFFERENCE;
}
else if (FXG_BLENDMODE_ERASE_VALUE.equals(value))
{
return BlendMode.ERASE;
}
else if (FXG_BLENDMODE_HARDLIGHT_VALUE.equals(value))
{
return BlendMode.HARDLIGHT;
}
else if (FXG_BLENDMODE_INVERT_VALUE.equals(value))
{
return BlendMode.INVERT;
}
else if (FXG_BLENDMODE_LAYER_VALUE.equals(value))
{
return BlendMode.LAYER;
}
else if (FXG_BLENDMODE_LIGHTEN_VALUE.equals(value))
{
return BlendMode.LIGHTEN;
}
else if (FXG_BLENDMODE_MULTIPLY_VALUE.equals(value))
{
return BlendMode.MULTIPLY;
}
else if (FXG_BLENDMODE_NORMAL_VALUE.equals(value))
{
return BlendMode.NORMAL;
}
else if (FXG_BLENDMODE_OVERLAY_VALUE.equals(value))
{
return BlendMode.OVERLAY;
}
else if (FXG_BLENDMODE_SCREEN_VALUE.equals(value))
{
return BlendMode.SCREEN;
}
else if (FXG_BLENDMODE_SUBTRACT_VALUE.equals(value))
{
return BlendMode.SUBTRACT;
}
else if (fileVersion.equalTo(FXGVersion.v1_0))
{
// Rest of the blend modes are unknown for FXG 1.0
//Unknown blend mode: {0}.
problems.add(new FXGUnknownAttributeValueProblem(getDocumentPath(),
getStartLine(), getStartColumn(), FXG_BLENDMODE_ATTRIBUTE, value));