franta-hg@1: package de.laures.cewolf.taglib; franta-hg@1: franta-hg@1: import org.apache.commons.logging.Log; franta-hg@1: import org.apache.commons.logging.LogFactory; franta-hg@1: import org.jfree.chart.axis.Axis; franta-hg@1: import org.jfree.chart.axis.CategoryAxis; franta-hg@1: import org.jfree.chart.axis.DateAxis; franta-hg@1: import org.jfree.chart.axis.NumberAxis; franta-hg@1: import org.jfree.chart.axis.ValueAxis; franta-hg@1: franta-hg@1: /** franta-hg@1: * @author guido franta-hg@1: * franta-hg@1: * To change this generated comment edit the template variable "typecomment": franta-hg@1: * Window>Preferences>Java>Templates. franta-hg@1: * To enable and disable the creation of type comments go to franta-hg@1: * Window>Preferences>Java>Code Generation. franta-hg@1: */ franta-hg@1: public class AxisFactory implements AxisConstants { franta-hg@1: franta-hg@1: protected Log log = LogFactory.getLog(AxisFactory.class.getName()); franta-hg@1: franta-hg@1: private static final AxisFactory instance = new AxisFactory(); franta-hg@1: franta-hg@1: protected AxisFactory(){ franta-hg@1: } franta-hg@1: franta-hg@1: public static final AxisFactory getInstance(){ franta-hg@1: return instance; franta-hg@1: } franta-hg@1: franta-hg@1: public Axis createAxis(int orientation, int type, String label) { franta-hg@1: switch (type) { franta-hg@1: case AXIS_TYPE_DATE : franta-hg@1: return new DateAxis(label); franta-hg@1: case AXIS_TYPE_NUMBER : franta-hg@1: return new NumberAxis(label); franta-hg@1: case AXIS_TYPE_CATEGORY://added by lrh 2005-07-11 franta-hg@1: return new CategoryAxis(label); franta-hg@1: default: franta-hg@1: throw new RuntimeException("unsupported axis type constant " + type); franta-hg@1: } franta-hg@1: } franta-hg@1: franta-hg@1: }