001 package jp.osdl.jbento2.chart; 002 003 public final class ChartTypeFactory { 004 005 private ChartTypeFactory() { 006 } 007 008 public static ChartType create(String name) { 009 if (name.equals("StackedXYArea")) { 010 return new StackedXYAreaChartType(); 011 } else if (name.equals("XYLine")) { 012 return new XYLineChartType(); 013 } else if (name.equals("Line")) { 014 return new LineChartType(); 015 } else if (name.equals("Time")) { 016 return new TimeSeriesChartType(); 017 } else if (name.equals("StackedTime")) { 018 return new StackedTimeSeriesChartType(); 019 } 020 throw new IllegalArgumentException("Unknown chart type:" + name); 021 } 022 }