if (Objects.equals(chart.getType(), _type) && _threeD == chart.isThreeD()) { return _chartImpl; _chartImpl = chart.isThreeD() ? new Pie3d() : new Pie(); _chartImpl = chart.isThreeD() ? new Bar3d() : new Bar(); _chartImpl = chart.isThreeD() ? new Line3d() : new Line(); _chartImpl = chart.isThreeD() ? new StackedBar3d() : new StackedBar(); throw new UiException("Unsupported chart type yet: "+chart.getType()); _threeD = chart.isThreeD(); _type = chart.getType(); return _chartImpl;