RenderingStrategy strategy = null; try { switch (model) { case RenderingDefConstants.GS: strategy = new GreyScaleStrategy(); break; case RenderingDefConstants.HSB: strategy = new HSBStrategy(); break; case RenderingDefConstants.RGB: strategy = new RGBStrategy(); break; default:  strategy = new GreyScaleStrategy();  } } catch(NumberFormatException nfe) { throw new RuntimeException("Invalid model ID "+model+".", nfe); } return strategy;
String value = model.getValue(); if (value == Renderer.MODEL_GREYSCALE) return new GreyScaleStrategy(); else if (value == Renderer.MODEL_HSB) return new HSBStrategy(); else if (value == Renderer.MODEL_RGB) return new RGBStrategy(); log.warn("WARNING: Unknown model '" + value + "' using greyscale."); return new GreyScaleStrategy();
	static RenderingStrategy makeNew(int model)	{		RenderingStrategy strategy = null;		try {			switch (model) {				case RenderingDefConstants.GS:					strategy = new GreyScaleStrategy();					break;				case RenderingDefConstants.HSB:                    strategy = new HSBStrategy();                    break;				case RenderingDefConstants.RGB:					strategy = new RGBStrategy();					break;				default:					//Set the GreyScaleStrategy as the default one.					strategy = new GreyScaleStrategy();					//TODO: log debug?			}			} catch(NumberFormatException nfe) {   			throw new RuntimeException("Invalid model ID "+model+".", nfe);		} 		return strategy;	}