2741, DateTitle, DateTitle, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/DateTitle.java, 98, 99 7 /** * Default constructor - builds a new DateTitle that displays the current date in the default * (LONG) format for the locale, positioned to the bottom right of the chart. *
* The color will be black in 12 point, plain Helvetica font (maps to Arial on Win32 systems * without Helvetica). */ 2 public DateTitle() { this(DateFormat.LONG); ### 2742, DateTitle, DateTitle, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/DateTitle.java, 82, 84 10 /** * Standard constructor - builds a new DateTitle object with the specified attributes and the * following defaults: location = BOTTOM, alignment = RIGHT, insets = new Insets(2, 2, 2, 2). * @param dateStyle the Date style to use (SHORT, MEDIUM, LONG, or FULL constants from * java.util.DateFormat); * @param locale the locale to use to format this date (if you are unsure what to use here, use * Locale.getDefault() for your default locale); * @param font the font used to display the date; * @param paint the paint used to display the date; */ 3 public DateTitle(int dateStyle, Locale locale, Font font, Paint paint) { this(dateStyle, locale, font, paint, AbstractTitle.BOTTOM, AbstractTitle.RIGHT, AbstractTitle.MIDDLE, new Insets(2, 2, 2, 2)); ### 2743, DateTitle, DateTitle, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/DateTitle.java, 65, 69 12 /** * Full constructor - builds a new DateTitle with the specified attributes. * @param location the relative location of this title (use constants in AbstractTitle); * @param alignment the text alignment of this title (use constants in AbstractTitle); * @param dateStyle the Date style to use (SHORT, MEDIUM, LONG, or FULL constants from * java.text.DateFormat); * @param locale the locale to use to format this date (if you are unsure what to use here, use * Locale.getDefault() for your default locale); * @param font the font used to display the date; * @param paint the paint used to display the date; * @param insets the blank space around the outside of the title; */ 5 public DateTitle(int dateStyle, Locale locale, Font font, Paint paint, int position, int horizontalAlignment, int verticalAlignment, Insets insets) { super(DateFormat.getDateInstance(dateStyle, locale).format(new Date()), font, paint, position, horizontalAlignment, verticalAlignment, insets); ### 2744, createXYChart, ChartFactory, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/ChartFactory.java, 339, 361 8 /** * Creates an XY (line) plot with default settings. * @param title The chart title. * @param xAxisLabel A label for the X-axis. * @param yAxisLabel A label for the Y-axis. * @param data The dataset for the chart. * @param legend A flag specifying whether or not a legend is required. */ 23 public static JFreeChart createXYChart(String title, String xAxisLabel, String yAxisLabel, XYDataset data, boolean legend) { JFreeChart chart = null; try { NumberAxis xAxis = new HorizontalNumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); Axis yAxis = new VerticalNumberAxis(yAxisLabel); XYPlot plot = new XYPlot(xAxis, yAxis); plot.setXYItemRenderer(new StandardXYItemRenderer(StandardXYItemRenderer.LINES)); chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); } catch (AxisNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createXYChart(...) : axis not compatible."); } catch (PlotNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createXYChart(...) : plot not compatible."); } return chart; ### 2745, createLineChart, ChartFactory, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/ChartFactory.java, 279, 300 8 /** * Creates a line chart with default settings. * @param title The chart title. * @param categoryAxisLabel The label for the category axis. * @param valueAxisLabel The label for the value axis. * @param data The dataset for the chart. * @param legend A flag specifying whether or not a legend is required. */ 22 public static JFreeChart createLineChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset data, boolean legend) { JFreeChart chart = null; try { Axis categoryAxis = new HorizontalCategoryAxis(categoryAxisLabel); Axis valueAxis = new VerticalNumberAxis(valueAxisLabel); Plot plot = new LinePlot(categoryAxis, valueAxis); chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); } catch (AxisNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createLineChart(...) : axis not compatible."); } catch (PlotNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createLineChart(...) : plot not compatible."); } return chart; ### 2746, createHighLowChart, ChartFactory, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/ChartFactory.java, 483, 504 11 /** * Creates and returns a default instance of a high-low-open-close chart based on the specified * dataset. *
* Added by Andrzej Porebski. Amended by David Gilbert. * @param title The chart title. * @param timeAxisLabel A label for the time axis. * @param valueAxisLabel A label for the value axis. * @param data The dataset for the chart. * @param legend A flag specifying whether or not a legend is required. */ 22 public static JFreeChart createHighLowChart(String title, String timeAxisLabel, String valueAxisLabel, HighLowDataset data, boolean legend) { JFreeChart chart = null; try { Axis timeAxis = new HorizontalDateAxis(timeAxisLabel); NumberAxis valueAxis = new VerticalNumberAxis(valueAxisLabel); HighLowPlot plot = new HighLowPlot(timeAxis, valueAxis); chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); } catch (AxisNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createHighLowChart(...) : axis not compatible."); } catch (PlotNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createHighLowChart(...) : plot not compatible."); } return chart; ### 2747, createVerticalBarChart, ChartFactory, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/ChartFactory.java, 58, 79 8 /** * Creates a vertical bar chart with default settings. * @param title The chart title. * @param categoryAxisLabel The label for the category axis. * @param valueAxisLabel The label for the value axis. * @param data The dataset for the chart. * @param legend A flag specifying whether or not a legend is required. */ 22 public static JFreeChart createVerticalBarChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset data, boolean legend) { JFreeChart chart = null; try { Axis categoryAxis = new HorizontalCategoryAxis(categoryAxisLabel); Axis valueAxis = new VerticalNumberAxis(valueAxisLabel); Plot plot = new VerticalBarPlot(categoryAxis, valueAxis); chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); } catch (AxisNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createVerticalBarChart(...) : axis not compatible."); } catch (PlotNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createVerticalBarChart(...) : plot not compatible."); } return chart; ### 2748, createStackedHorizontalBarChart, ChartFactory, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/ChartFactory.java, 243, 267 9 /** * Creates a stacked horizontal bar chart with default settings. This is still experimental at * this point! * @param title The chart title. * @param categoryAxisLabel The label for the category axis. * @param valueAxisLabel The label for the value axis. * @param data The dataset for the chart. * @param legend A flag specifying whether or not a legend is required. */ 25 public static JFreeChart createStackedHorizontalBarChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset data, boolean legend) { JFreeChart chart = null; try { Axis categoryAxis = new VerticalCategoryAxis(categoryAxisLabel); Axis valueAxis = new HorizontalNumberAxis(valueAxisLabel); HorizontalBarPlot plot = new HorizontalBarPlot(valueAxis, categoryAxis); plot.setRenderer(new StackedHorizontalBarRenderer()); chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); } catch (AxisNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println( "ChartFactory.createStackedHorizontalBarChart(...) : axis not compatible."); } catch (PlotNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println( "ChartFactory.createStackedHorizontalBarChart(...) : plot not compatible."); } return chart; ### 2749, createVerticalXYBarChart, ChartFactory, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/ChartFactory.java, 446, 468 9 /** * Creates and returns a default instance of a VerticalXYBarChart based on the specified * dataset. * @param title The chart title. * @param xAxisLabel A label for the X-axis. * @param yAxisLabel A label for the Y-axis. * @param data The dataset for the chart. * @param legend A flag specifying whether or not a legend is required. */ 23 public static JFreeChart createVerticalXYBarChart(String title, String xAxisLabel, String yAxisLabel, IntervalXYDataset data, boolean legend) { JFreeChart chart = null; try { HorizontalDateAxis timeAxis = new HorizontalDateAxis(xAxisLabel); Axis valueAxis = new VerticalNumberAxis(yAxisLabel); Plot plot = new VerticalXYBarPlot(timeAxis, valueAxis, new Insets(0,0,0,0), Color.white, new BasicStroke(), Color.gray); chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); } catch (AxisNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createVerticalXYBarChart(...) : axis not compatible."); } catch (PlotNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createVerticalXYBarChart(...) : plot not compatible."); } return chart; ### 2750, createPieChart, ChartFactory, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/ChartFactory.java, 310, 327 6 /** * Creates a pie chart with default settings. * @param title The chart title. * @param data The dataset for the chart. * @param legend A flag specifying whether or not a legend is required. */ 18 public static JFreeChart createPieChart(String title, PieDataset data, boolean legend) { JFreeChart chart = null; try { Plot plot = new PiePlot(); chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); } catch (AxisNotCompatibleException e) { // can't see how this could happen for a pie chart System.err.println("ChartFactory.createPieChart(...) : axis not compatible."); } catch (PlotNotCompatibleException e) { // can't see how this could happen for a pie chart System.err.println("ChartFactory.createPieChart(...) : plot not compatible."); } return chart; ### 2751, createVerticalBarChart3D, ChartFactory, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/ChartFactory.java, 93, 118 10 /** * Creates a vertical 3D-effect bar chart with default settings. *
* Added by Serge V. Grachov. * @param title The chart title. * @param categoryAxisLabel The label for the category axis. * @param valueAxisLabel The label for the value axis. * @param data The dataset for the chart. * @param legend A flag specifying whether or not a legend is required. */ 26 public static JFreeChart createVerticalBarChart3D(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset data, boolean legend) { JFreeChart chart = null; try { Axis categoryAxis = new HorizontalCategoryAxis(categoryAxisLabel); Axis valueAxis = new VerticalNumberAxis3D(valueAxisLabel); VerticalBarPlot plot = new VerticalBarPlot3D(categoryAxis, valueAxis); // the insets here are a workaround for the fact that the plot area is no longer a // rectangle, so it is overlapping the title. To be fixed... plot.setInsets(new Insets(20, 2, 2, 2)); plot.setRenderer(new VerticalBarRenderer3D()); chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); } catch (AxisNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createVerticalBarChart3D(...) : axis not compatible."); } catch (PlotNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createVerticalBarChart3D(...) : plot not compatible."); } return chart; ### 2752, createStackedVerticalBarChart3D, ChartFactory, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/ChartFactory.java, 170, 197 11 /** * Creates a stacked vertical bar chart with default settings. This is still experimental at * this point! *
* Added by Serge V. Grachov. * @param title The chart title. * @param categoryAxisLabel The label for the category axis. * @param valueAxisLabel The label for the value axis. * @param data The dataset for the chart. * @param legend A flag specifying whether or not a legend is required. */ 28 public static JFreeChart createStackedVerticalBarChart3D(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset data, boolean legend) { JFreeChart chart = null; try { Axis categoryAxis = new HorizontalCategoryAxis(categoryAxisLabel); Axis valueAxis = new VerticalNumberAxis3D(valueAxisLabel); VerticalBarPlot plot = new VerticalBarPlot3D(categoryAxis, valueAxis); // the insets here are a workaround for the fact that the plot area is no longer a // rectangle, so it is overlapping the title. To be fixed... plot.setInsets(new Insets(20, 2, 2, 2)); plot.setRenderer(new StackedVerticalBarRenderer3D()); chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); } catch (AxisNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println( "ChartFactory.createStackedVerticalBarChart3D(...) : axis not compatible."); } catch (PlotNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println( "ChartFactory.createStackedVerticalBarChart3D(...) : plot not compatible."); } return chart; ### 2753, createTimeSeriesChart, ChartFactory, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/ChartFactory.java, 410, 433 12 /** * Creates and returns a time series chart. A time series chart is an XYPlot with a date * axis (horizontal) and a number axis (vertical), and each data item is connected with a line. *
* Note that you can supply a TimeSeriesDataset to this method as it is a subclass of * XYDataset. * @param title The chart title. * @param timeAxisLabel A label for the time axis. * @param valueAxisLabel A label for the value axis. * @param data The dataset for the chart. * @param legend A flag specifying whether or not a legend is required. */ 24 public static JFreeChart createTimeSeriesChart(String title, String timeAxisLabel, String valueAxisLabel, XYDataset data, boolean legend) { JFreeChart chart = null; try { Axis timeAxis = new HorizontalDateAxis(timeAxisLabel); NumberAxis valueAxis = new VerticalNumberAxis(valueAxisLabel); valueAxis.setAutoRangeIncludesZero(false); // override default XYPlot plot = new XYPlot(timeAxis, valueAxis); plot.setXYItemRenderer(new StandardXYItemRenderer(StandardXYItemRenderer.LINES)); chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); } catch (AxisNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createTimeSeriesChart(...) : axis not compatible."); } catch (PlotNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createTimeSeriesChart(...) : axis not compatible."); } return chart; ### 2754, createHorizontalBarChart, ChartFactory, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/ChartFactory.java, 209, 230 8 /** * Creates a horizontal bar chart with default settings. * @param title The chart title. * @param categoryAxisLabel The label for the category axis. * @param valueAxisLabel The label for the value axis. * @param data The dataset for the chart. * @param legend A flag specifying whether or not a legend is required. */ 22 public static JFreeChart createHorizontalBarChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset data, boolean legend) { JFreeChart chart = null; try { Axis categoryAxis = new VerticalCategoryAxis(categoryAxisLabel); Axis valueAxis = new HorizontalNumberAxis(valueAxisLabel); Plot plot = new HorizontalBarPlot(valueAxis, categoryAxis); chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); } catch (AxisNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createHorizontalBarChart(...) : axis not compatible."); } catch (PlotNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createHorizontalBarChart(...) : plot not compatible."); } return chart; ### 2755, createScatterPlot, ChartFactory, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/ChartFactory.java, 373, 394 8 /** * Creates a scatter plot with default settings. * @param title The chart title. * @param xAxisLabel A label for the X-axis. * @param yAxisLabel A label for the Y-axis. * @param data The dataset for the chart. * @param legend A flag specifying whether or not a legend is required. */ 22 public static JFreeChart createScatterPlot(String title, String xAxisLabel, String yAxisLabel, XYDataset data, boolean legend) { JFreeChart chart = null; try { Axis xAxis = new HorizontalNumberAxis(xAxisLabel); Axis yAxis = new VerticalNumberAxis(yAxisLabel); XYPlot plot = new XYPlot(xAxis, yAxis); plot.setXYItemRenderer(new StandardXYItemRenderer(StandardXYItemRenderer.SHAPES)); chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); } catch (AxisNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createScatterPlot(...) : axis not compatible."); } catch (PlotNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println("ChartFactory.createScatterPlot(...) : plot not compatible."); } return chart; ### 2756, createStackedVerticalBarChart, ChartFactory, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/ChartFactory.java, 131, 155 9 /** * Creates a stacked vertical bar chart with default settings. This is still experimental at * this point! * @param title The chart title. * @param categoryAxisLabel The label for the category axis. * @param valueAxisLabel The label for the value axis. * @param data The dataset for the chart. * @param legend A flag specifying whether or not a legend is required. */ 25 public static JFreeChart createStackedVerticalBarChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset data, boolean legend) { JFreeChart chart = null; try { Axis categoryAxis = new HorizontalCategoryAxis(categoryAxisLabel); Axis valueAxis = new VerticalNumberAxis(valueAxisLabel); VerticalBarPlot plot = new VerticalBarPlot(categoryAxis, valueAxis); plot.setRenderer(new StackedVerticalBarRenderer()); chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); } catch (AxisNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println( "ChartFactory.createStackedVerticalBarChart(...) : axis not compatible."); } catch (PlotNotCompatibleException e) { // this won't happen unless you mess with the axis constructors above System.err.println( "ChartFactory.createStackedVerticalBarChart(...) : plot not compatible."); } return chart; ### 2757, setTrailGapPercent, BarPlot, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/BarPlot.java, 202, 205 5 /** * Sets the gap after the last bar on the chart, and notifies registered listeners that the plot * has been modified. * @param percent The new gap value. */ 4 public void setTrailGapPercent(double percent) { if (this.trailGapPercent!=percent) { trailGapPercent = Math.min(percent, MAX_TRAIL_GAP_PERCENT); notifyListeners(new PlotChangeEvent(this)); ### 2758, BarPlot, BarPlot, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/BarPlot.java, 123, 131 3 /** * Constructs a bar plot with the specified axes...other attributes take default values. */ 9 public BarPlot(Axis horizontalAxis, Axis verticalAxis) throws AxisNotCompatibleException, PlotNotCompatibleException { this(horizontalAxis, verticalAxis, new Insets(2, 2, 2, 2), DEFAULT_INTRO_GAP_PERCENT, DEFAULT_TRAIL_GAP_PERCENT, DEFAULT_CATEGORY_GAPS_PERCENT, DEFAULT_ITEM_GAPS_PERCENT); ### 2759, getItemGapsPercent, BarPlot, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/BarPlot.java, 233, 234 4 /** * Returns the gap between one bar and the next within the same category, measured in Java 2D * User Space units. */ 2 public double getItemGapsPercent() { return itemGapsPercent; ### 2760, setIntroGapPercent, BarPlot, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/BarPlot.java, 182, 185 5 /** * Sets the gap before the first bar on the chart, and notifies registered listeners that the * plot has been modified. * @param percent The new gap value. */ 4 public void setIntroGapPercent(double percent) { if (this.introGapPercent!=percent) { this.introGapPercent = Math.min(percent, MAX_INTRO_GAP_PERCENT); notifyListeners(new PlotChangeEvent(this)); ### 2761, setVerticalAxis, BarPlot, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/BarPlot.java, 148, 149 6 /** * Sets the vertical axis for the plot. *
* This method should throw an exception if the axis doesn't implement the required interfaces. * @param axis The new vertical axis. */ 2 public void setVerticalAxis(Axis axis) throws AxisNotCompatibleException { super.setVerticalAxis(axis); ### 2762, setCategoryGapsPercent, BarPlot, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/BarPlot.java, 222, 225 5 /** * Sets the gap between the last bar in one category and the first bar in the * next category, and notifies registered listeners that the plot has been modified. * @param gap The new gap value. */ 4 public void setCategoryGapsPercent(double percent) { if (this.categoryGapsPercent!=percent) { this.categoryGapsPercent=Math.min(percent, MAX_CATEGORY_GAPS_PERCENT); notifyListeners(new PlotChangeEvent(this)); ### 2763, getIntroGapPercent, BarPlot, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/BarPlot.java, 173, 174 4 /** * Returns the gap before the first bar on the chart, as a percentage of the available drawing * space (0.05 = 5 percent). */ 2 public double getIntroGapPercent() { return introGapPercent; ### 2764, setHorizontalAxis, BarPlot, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/BarPlot.java, 158, 159 6 /** * Sets the horizontal axis for the plot. *
* This method should throw an exception if the axis doesn't implement the required interfaces. * @param axis The new horizontal axis. */ 2 public void setHorizontalAxis(Axis axis) throws AxisNotCompatibleException { super.setHorizontalAxis(axis); ### 2765, BarPlot, BarPlot, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/BarPlot.java, 107, 117 12 /** * Standard constructor: returns a BarPlot with attributes specified by the caller. * @param horizontal The horizontal axis; * @param vertical The vertical axis; * @param introGapPercent The gap before the first bar in the plot, as a percentage of the * available drawing space; * @param trailGapPercent The gap after the last bar in the plot, as a percentage of the * available drawing space; * @param categoryGapsPercent The percentage of drawing space allocated to the gap between the * last bar in one category and the first bar in the next category; * @param itemGapsPercent The gap between bars within the same category; */ 11 public BarPlot(Axis horizontal, Axis vertical, Insets insets, double introGapPercent, double trailGapPercent, double categoryGapsPercent, double itemGapsPercent) throws AxisNotCompatibleException, PlotNotCompatibleException { super(horizontal, vertical); this.insets = insets; this.introGapPercent = introGapPercent; this.trailGapPercent = trailGapPercent; this.categoryGapsPercent = categoryGapsPercent; this.itemGapsPercent = itemGapsPercent; ### 2766, getDataset, BarPlot, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/BarPlot.java, 138, 139 4 /** * A convenience method that returns the dataset for the plot, cast as a * CategoryDataset. */ 2 public CategoryDataset getDataset() { return (CategoryDataset)chart.getDataset(); ### 2767, getTrailGapPercent, BarPlot, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/BarPlot.java, 193, 194 4 /** * Returns the gap following the last bar on the chart, as a percentage of the available * drawing space. */ 2 public double getTrailGapPercent() { return trailGapPercent; ### 2768, getCategoryGapsPercent, BarPlot, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/BarPlot.java, 213, 214 4 /** * Returns the percentage of the drawing space that is allocated to providing gaps between the * categories. */ 2 public double getCategoryGapsPercent() { return categoryGapsPercent; ### 2769, getCategories, BarPlot, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/BarPlot.java, 165, 166 3 /** * A convenience method that returns a list of the categories in the data source. */ 2 public java.util.List getCategories() { return getDataset().getCategories(); ### 2770, setLabelFont, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 245, 255 6 /** * Sets the font for the axis label. *
* Registered listeners are notified of a general change to the axis. * @param font The new label font. */ 11 public void setLabelFont(Font font) { // check arguments... if (font==null) { throw new IllegalArgumentException("Axis.setLabelFont(...): null not permitted."); } // make the change (if necessary)... if (!this.labelFont.equals(font)) { this.labelFont = font; notifyListeners(new AxisChangeEvent(this)); ### 2771, setTickMarksVisible, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 431, 435 6 /** * Sets the flag that indicates whether or not the tick marks are showing. *
* Registered listeners are notified of a general change to the axis. * @param flag The flag. */ 5 public void setTickMarksVisible(boolean flag) { if (flag!=tickMarksVisible) { tickMarksVisible = flag; notifyListeners(new AxisChangeEvent(this)); ### 2772, getTickLabelInsets, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 394, 395 4 /** * Returns the insets for the tick labels. * @return The insets for the tick labels. */ 2 public Insets getTickLabelInsets() { return this.tickLabelInsets; ### 2775, setLabel, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 213, 225 6 /** * Sets the label for the axis. *
* Registered listeners are notified of a general change to the axis. * @param label The new label for the axis (null permitted). */ 13 public void setLabel(String label) { String existing = this.label; if (existing!=null) { if (!existing.equals(label)) { this.label = label; notifyListeners(new AxisChangeEvent(this)); } } else { if (label!=null) { this.label = label; notifyListeners(new AxisChangeEvent(this)); ### 2776, setTickLabelFont, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 346, 356 6 /** * Sets the font for the tick labels. *
* Registered listeners are notified of a general change to the axis. * @param font The new tick label font. */ 11 public void setTickLabelFont(Font font) { // check arguments... if (font==null) { throw new IllegalArgumentException("Axis.setTickLabelFont(...): null not permitted."); } // apply change if necessary... if (!this.tickLabelFont.equals(font)) { this.tickLabelFont = font; notifyListeners(new AxisChangeEvent(this)); ### 2777, setTickMarkStroke, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 454, 464 6 /** * Sets the pen/brush used to draw tick marks (if they are showing). *
* Registered listeners are notified of a general change to the axis. * @param stroke The new pen/brush (null not permitted). */ 11 public void setTickMarkStroke(Stroke stroke) { // check arguments... if (stroke==null) { throw new IllegalArgumentException("Axis.setTickMarkStroke(...): null not permitted."); } // make the change (if necessary)... if (!this.tickMarkStroke.equals(stroke)) { this.tickMarkStroke = stroke; notifyListeners(new AxisChangeEvent(this)); ### 2778, getLabel, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 203, 204 4 /** * Returns the label for the axis. * @return The label for the axis (null possible). */ 2 public String getLabel() { return label; ### 2779, isTickLabelsVisible, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 313, 314 4 /** * Returns a flag indicating whether or not the tick labels are visible. * @return A flag indicating whether or not the tick labels are visible. */ 2 public boolean isTickLabelsVisible() { return tickLabelsVisible; ### 2780, addChangeListener, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 539, 540 4 /** * Registers an object for notification of changes to the axis. * @param listener The object that is being registered. */ 2 public void addChangeListener(AxisChangeListener listener) { listeners.add(listener); ### 2781, getLabelInsets, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 293, 294 4 /** * Returns the insets for the label (that is, the amount of blank space that should be left * around the label). */ 2 public Insets getLabelInsets() { return this.labelInsets; ### 2782, getTickMarkStroke, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 444, 445 4 /** * Returns the pen/brush used to draw tick marks (if they are showing). * @return The pen/brush used to draw tick marks. */ 2 public Stroke getTickMarkStroke() { return tickMarkStroke; ### 2783, isTickMarksVisible, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 421, 422 4 /** * Returns the flag that indicates whether or not the tick marks are showing. * @return The flag that indicates whether or not the tick marks are showing. */ 2 public boolean isTickMarksVisible() { return tickMarksVisible; ### 2784, notifyListeners, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 527, 531 5 /** * Notifies all registered listeners that the axis has changed. The AxisChangeEvent provides * information about the change. * @param event Information about the change to the axis. */ 5 protected void notifyListeners(AxisChangeEvent event) { java.util.Iterator iterator = listeners.iterator(); while (iterator.hasNext()) { AxisChangeListener listener = (AxisChangeListener)iterator.next(); listener.axisChanged(event); ### 2786, drawVerticalString, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 558, 567 7 /** * A utility method for drawing text vertically. * @param text The text. * @param g2 The graphics device. * @param x The x-coordinate. * @param y The y-coordinate. */ 10 protected void drawVerticalString(String text, Graphics2D g2, float x, float y) { AffineTransform saved = g2.getTransform(); // apply a 90 degree rotation AffineTransform rotate = AffineTransform.getRotateInstance(-Math.PI/2, x, y); g2.transform(rotate); g2.drawString(text, x, y); g2.setTransform(saved); ### 2787, Axis, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 131, 149 13 /** * Constructs an axis. * @param label The axis label. * @param labelFont The font for displaying the axis label. * @param labelPaint The paint used to draw the axis label. * @param labelInsets Determines the amount of blank space around the label. * @param tickLabelsVisible Flag indicating whether or not the tick labels are visible. * @param tickLabelFont The font used to display tick labels. * @param tickLabelPaint The paint used to draw tick labels. * @param tickLabelInsets Determines the amount of blank space around tick labels. * @param tickMarksVisible Flag indicating whether or not tick marks are visible. * @param tickMarkStroke The stroke used to draw tick marks (if visible). */ 19 protected Axis(String label, Font labelFont, Paint labelPaint, Insets labelInsets, boolean tickLabelsVisible, Font tickLabelFont, Paint tickLabelPaint, Insets tickLabelInsets, boolean tickMarkVisible, Stroke tickMarkStroke) { this.label = label; this.labelFont = labelFont; this.labelPaint = labelPaint; this.labelInsets = labelInsets; this.tickLabelsVisible = tickLabelsVisible; this.tickLabelFont = tickLabelFont; this.tickLabelPaint = tickLabelPaint; this.tickLabelInsets = tickLabelInsets; this.tickMarksVisible = tickMarksVisible; this.tickMarkStroke = tickMarkStroke; this.ticks = new java.util.ArrayList(); this.listeners = new java.util.ArrayList(); ### 2788, getLabelFont, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 235, 236 4 /** * Returns the font for the axis label. * @return The font for the axis label. */ 2 public Font getLabelFont() { return labelFont; ### 2790, getMaxTickLabelWidth, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 497, 511 6 /** * Returns the maximum width of the ticks in the working list (that is set up by * refreshTicks()). * @param g2 The graphics device. * @param plotArea The area within which the plot is to be drawn. */ 15 protected double getMaxTickLabelWidth(Graphics2D g2, Rectangle2D plotArea) { double maxWidth = 0.0; Font font = getTickLabelFont(); FontRenderContext frc = g2.getFontRenderContext(); Iterator iterator = this.ticks.iterator(); while (iterator.hasNext()) { Tick tick = (Tick)iterator.next(); Rectangle2D labelBounds = font.getStringBounds(tick.getText(), frc); if (labelBounds.getWidth()>maxWidth) { maxWidth = labelBounds.getWidth(); } } return maxWidth; ### 2791, removeChangeListener, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 547, 548 4 /** * Deregisters an object for notification of changes to the axis. * @param listener The object to deregister. */ 2 public void removeChangeListener(AxisChangeListener listener) { listeners.remove(listener); ### 2792, getPlot, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 178, 179 6 /** * Returns the plot that the axis is assigned to. *
* This method will return null if the axis is not currently assigned to a plot. * @return The plot that the axis is assigned to. */ 2 public Plot getPlot() { return plot; ### 2793, getTickLabelPaint, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 365, 366 4 /** * Returns the color/shade used for the tick labels. * @return The color/shade used for the tick labels. */ 2 public Paint getTickLabelPaint() { return this.tickLabelPaint; ### 2794, setLabelPaint, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 274, 284 6 /** * Sets the color/shade used to draw the axis label. *
* Registered listeners are notified of a general change to the axis. * @param paint The new color/shade for the axis label. */ 11 public void setLabelPaint(Paint paint) { // check arguments... if (paint==null) { throw new IllegalArgumentException("Axis.setLabelPaint(...): null not permitted."); } // make the change (if necessary)... if (!this.labelPaint.equals(paint)) { this.labelPaint = paint; notifyListeners(new AxisChangeEvent(this)); ### 2795, setTickLabelInsets, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 403, 413 5 /** * Sets the insets for the tick labels, and notifies registered listeners that the axis has * been modified. * @param insets The new tick label insets. */ 11 public void setTickLabelInsets(Insets insets) { // check arguments... if (insets==null) { throw new IllegalArgumentException("Axis.setTickLabelInsets(...): null not permitted."); } // apply change if necessary... if (!this.tickLabelInsets.equals(insets)) { this.tickLabelInsets = insets; notifyListeners(new AxisChangeEvent(this)); ### 2796, getLabelPaint, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 264, 265 4 /** * Returns the color/shade used to draw the axis label. * @return The color/shade used to draw the axis label. */ 2 public Paint getLabelPaint() { return this.labelPaint; ### 2797, setLabelInsets, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 302, 305 5 /** * Sets the insets for the axis label, and notifies registered listeners that the axis has been * modified. * @param insets The new label insets; */ 4 public void setLabelInsets(Insets insets) { if (!insets.equals(this.labelInsets)) { this.labelInsets = insets; notifyListeners(new AxisChangeEvent(this)); ### 2798, Axis, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 157, 168 4 /** * Constructs an axis, using default values where necessary. * @param label The axis label (null permitted). */ 12 protected Axis(String label) { this(label, DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_AXIS_LABEL_INSETS, true, // tick labels visible DEFAULT_TICK_LABEL_FONT, DEFAULT_TICK_LABEL_PAINT, DEFAULT_TICK_LABEL_INSETS, true, // tick marks visible DEFAULT_TICK_STROKE); ### 2799, setPlot, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 189, 195 7 /** * Sets a reference to the plot that the axis is assigned to. *
* This method is called by Plot in the setHorizontalAxis() and setVerticalAxis() methods. * You shouldn't need to call the method yourself. * @param plot The plot that the axis belongs to. */ 7 public void setPlot(Plot plot) throws PlotNotCompatibleException { if (this.isCompatiblePlot(plot)) { this.plot = plot; } else throw new PlotNotCompatibleException("Axis.setPlot(...): " +"plot not compatible with axis."); ### 2800, setTickLabelsVisible, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 323, 327 6 /** * Sets the flag that determines whether or not the tick labels are visible. *
* Registered listeners are notified of a general change to the axis. * @param flag The flag. */ 5 public void setTickLabelsVisible(boolean flag) { if (flag!=tickLabelsVisible) { tickLabelsVisible = flag; notifyListeners(new AxisChangeEvent(this)); ### 2801, getTickLabelFont, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 336, 337 4 /** * Returns the font used for the tick labels (if showing). * @return The font used for the tick labels. */ 2 public Font getTickLabelFont() { return tickLabelFont; ### 2802, setTickLabelPaint, Axis, JFreeChart060 jfreechart-0.6.0/source/com/jrefinery/chart/Axis.java, 375, 385 6 /** * Sets the color/shade used to draw tick labels (if they are showing). *
* Registered listeners are notified of a general change to the axis.
* @param paint The new color/shade.
*/
11
public void setTickLabelPaint(Paint paint) {
// check arguments...
if (paint==null) {
throw new IllegalArgumentException("Axis.setTickLabelPaint(...): null not permitted.");
}
// make the change (if necessary)...
if (!this.tickLabelPaint.equals(paint)) {
this.tickLabelPaint = paint;
notifyListeners(new AxisChangeEvent(this));
###
2803, getFillPaint, Bar, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Bar.java, 116, 117
4
/**
* Returns the Paint object used to fill the bar.
* @return The Paint used to fill the bar.
*/
2
public Paint getFillPaint() {
return fillPaint;
###
2804, Bar, Bar, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Bar.java, 84, 85
7
/**
* Standard constructor: returns a new Bar object, with some default attributes.
* @param x The x-coordinate of the bar;
* @param y The y-coordinate of the bar;
* @param width The width of the bar;
* @param height The height of the bar;
*/
2
public Bar(double x, double y, double width, double height) {
this(x, y, width, height, new BasicStroke(), Color.gray, Color.green);
###
2805, getArea, Bar, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Bar.java, 92, 93
4
/**
* Returns the rectangle that is the outline of the bar.
* @return The outline of the bar;
*/
2
public Rectangle2D getArea() {
return area;
###
2806, getOutlinePaint, Bar, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Bar.java, 108, 109
4
/**
* Returns the Paint object used to draw the outline of the bar.
* @return The Paint used to draw the outline of the bar.
*/
2
public Paint getOutlinePaint() {
return outlinePaint;
###
2807, Bar, Bar, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Bar.java, 68, 74
10
/**
* Full constructor: returns a new Bar object with attributes as defined by the caller.
* @param x The x-coordinate of the bar;
* @param y The y-coordinate of the bar;
* @param width The width of the bar;
* @param height The height of the bar;
* @param outlineStroke The Stroke used to draw the outline of the bar;
* @param outlinePaint The Paint used to draw the outline of the bar;
* @param fillPaint The Paint used to draw the interior of the bar.
*/
7
public Bar(double x, double y, double width, double height,
Stroke outlineStroke, Paint outlinePaint, Paint fillPaint)
{
this.area = new Rectangle2D.Double(x, y, width, height);
this.outlineStroke = outlineStroke;
this.outlinePaint = outlinePaint;
this.fillPaint = fillPaint;
###
2808, getOutlineStroke, Bar, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Bar.java, 100, 101
4
/**
* Returns the Stroke object used to draw the outline of the bar.
* @return The Stroke used to draw the outline of the bar.
*/
2
public Stroke getOutlineStroke() {
return outlineStroke;
###
2811, CategoryAxis, CategoryAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/CategoryAxis.java, 63, 69
13
/**
* Standard constructor: returns a new CategoryAxis with attributes as specified by the
* caller.
* @param label The axis label;
* @param labelFont The font for displaying the axis label;
* @param labelPaint The paint used to draw the axis label;
* @param labelInsets Determines the amount of blank space around the label;
* @param showCategoryLabels Flag indicating whether or not category (tick) labels are visible;
* @param categoryLabelFont The font used to display category (tick) labels;
* @param categoryLabelPaint The paint used to draw category (tick) labels;
* @param showTickMarks Flag indicating whether or not tick marks are visible;
* @param tickMarkStroke The stroke used to draw tick marks (if visible).
*/
7
public CategoryAxis(String label, Font labelFont, Paint labelPaint, Insets labelInsets,
boolean showCategoryLabels, Font categoryLabelFont, Paint categoryLabelPaint,
Insets categoryLabelInsets, boolean showTickMarks, Stroke tickMarkStroke) {
super(label, labelFont, labelPaint, labelInsets,
showCategoryLabels, categoryLabelFont, categoryLabelPaint, categoryLabelInsets,
showTickMarks, tickMarkStroke);
###
2812, getMinimumDate, DateAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/DateAxis.java, 121, 122
4
/**
* Returns the earliest date visible on the axis.
* @return The earliest date visible on the axis.
*/
2
public Date getMinimumDate() {
return this.minimumDate;
###
2813, getMaximumDate, DateAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/DateAxis.java, 138, 139
4
/**
* Returns the latest date visible on the axis.
* @return The latest date visible on the axis.
*/
2
public Date getMaximumDate() {
return this.maximumDate;
###
2814, nextStandardDate, DateAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/DateAxis.java, 268, 273
3
/**
* Returns the first "standard" date (based on the specified field and units).
*/
6
protected Date nextStandardDate(Date date, int field, int units) {
Date previous = previousStandardDate(date, field, units);
Calendar calendar = Calendar.getInstance();
calendar.setTime(previous);
calendar.add(field, units);
return calendar.getTime();
###
2815, setTickUnit, DateAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/DateAxis.java, 162, 164
3
/**
* Sets the tick unit for the axis.
*/
3
public void setTickUnit(DateUnit unit) {
this.tickUnit = unit;
this.notifyListeners(new AxisChangeEvent(this));
###
2816, DateAxis, DateAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/DateAxis.java, 87, 102
24
/**
* Full constructor - initialises the attributes for a ValueAxis. This is an abstract class,
* subclasses include HorizontalValueAxis and VerticalValueAxis.
* @param label The axis label;
* @param labelFont The font for displaying the axis label;
* @param labelPaint The paint used to draw the axis label;
* @param labelInsets Determines the amount of blank space around the label;
* @param showTickLabels Flag indicating whether or not tick labels are visible;
* @param tickLabelFont The font used to display tick labels;
* @param tickLabelPaint The paint used to draw tick labels;
* @param tickLabelInsets Determines the amount of blank space around tick labels;
* @param showTickMarks Flag indicating whether or not tick marks are visible;
* @param tickMarkStroke The stroke used to draw tick marks (if visible);
* @param autoRange Flag indicating whether or not the axis range is automatically adjusted to
* fit the data;
* @param minimumDate The earliest date showing on the axis;
* @param maximumDate The latest date showing on the axis;
* @param autoTickUnit A flag indicating whether or not the tick unit is automatically
* calculated;
* @param tickUnit The tick unit;
* @param showGridLines Flag indicating whether or not grid lines are visible for this axis;
* @param gridStroke The Stroke used to display grid lines (if visible);
* @param gridPaint The Paint used to display grid lines (if visible).
*/
16
public DateAxis(String label, Font labelFont, Paint labelPaint, Insets labelInsets,
boolean showTickLabels, Font tickLabelFont, Paint tickLabelPaint, Insets tickLabelInsets,
boolean showTickMarks, Stroke tickMarkStroke,
boolean autoRange, Date minimumDate, Date maximumDate,
boolean autoTickUnit, DateUnit tickUnit, SimpleDateFormat tickLabelFormatter,
boolean showGridLines, Stroke gridStroke, Paint gridPaint) {
super(label, labelFont, labelPaint, labelInsets,
showTickLabels, tickLabelFont, tickLabelPaint, tickLabelInsets,
showTickMarks, tickMarkStroke, autoRange,
autoTickUnit, showGridLines, gridStroke, gridPaint);
this.minimumDate = minimumDate;
this.maximumDate = maximumDate;
this.tickUnit = tickUnit;
this.tickLabelFormatter = tickLabelFormatter;
###
2817, setMaximumDate, DateAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/DateAxis.java, 146, 148
4
/**
* Sets the maximum date visible on the axis.
* @param maximumDate The new maximum date;
*/
3
public void setMaximumDate(Date maximumDate) {
this.maximumDate = maximumDate;
this.notifyListeners(new AxisChangeEvent(this));
###
2818, setMinimumDate, DateAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/DateAxis.java, 129, 131
4
/**
* Sets the minimum date visible on the axis.
* @param minimumDate The new minimum date;
*/
3
public void setMinimumDate(Date minimumDate) {
this.minimumDate = minimumDate;
this.notifyListeners(new AxisChangeEvent(this));
###
2819, DateAxis, DateAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/DateAxis.java, 109, 114
3
/**
* Standard constructor: builds a DateAxis with mostly default attributes.
*/
6
public DateAxis(String label) {
super(label);
this.minimumDate = new Date();
this.maximumDate = new Date();
this.tickUnit = new DateUnit(Calendar.DATE, 1);
this.tickLabelFormatter = new SimpleDateFormat();
###
2820, findAxisMagnitudeIndex, DateAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/DateAxis.java, 279, 286
3
/**
* Returns the index of the largest tick unit that will fit within the axis range.
*/
8
protected int findAxisMagnitudeIndex() {
long axisMagnitude = this.maximumDate.getTime()-this.minimumDate.getTime();
int index = 0;
while(index
* This method can return null if the data source is null.
*/
6
public Number getMaximumVerticalDataValue() {
Dataset data = this.getChart().getDataset();
if (data!=null) {
return Datasets.getMaximumRangeValue(data);
}
else return null;
###
2866, VerticalXYBarPlot, VerticalXYBarPlot, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalXYBarPlot.java, 68, 72
5
/**
* Standard constructor.
* @param horizontalAxis The horizontal axis for the plot;
* @param verticalAxis The vertical axis for the plot;
*/
4
public VerticalXYBarPlot(Axis horizontalAxis, Axis verticalAxis)
throws AxisNotCompatibleException, PlotNotCompatibleException
{
super(horizontalAxis, verticalAxis);
###
2867, isCompatibleHorizontalAxis, VerticalXYBarPlot, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalXYBarPlot.java, 98, 101
8
/**
* Returns true if the specified axis is compatible with the plot with regard to operating as
* the horizontal axis.
*
* This plot requires the horizontal axis to be a subclass of HorizontalNumberAxis or
* HorizontalDateAxis.
* @param axis The axis.
*/
4
public boolean isCompatibleHorizontalAxis(Axis axis) {
if (axis instanceof HorizontalNumberAxis) return true;
else if (axis instanceof HorizontalDateAxis) return true;
else return false;
###
2868, draw, VerticalXYBarPlot, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalXYBarPlot.java, 121, 160
5
/**
* Draws the plot on a Java 2D graphics device (such as the screen or a printer).
* @param g2 The graphics device;
* @param drawArea The area within which the plot should be drawn;
*/
36
public void draw(Graphics2D g2, Rectangle2D drawArea) {
// adjust the drawing area for plot insets (if any)...
if (insets!=null) {
drawArea = new Rectangle2D.Double(drawArea.getX()+insets.left,
drawArea.getY()+insets.top,
drawArea.getWidth()-insets.left-insets.right,
drawArea.getHeight()-insets.top-insets.bottom);
}
// estimate the area required for drawing the axes...
HorizontalAxis ha = getHorizontalAxis();
VerticalAxis va = getVerticalAxis();
double hAxisAreaHeight = ha.reserveHeight(g2, this, drawArea);
Rectangle2D vAxisArea = va.reserveAxisArea(g2, this, drawArea, hAxisAreaHeight);
Rectangle2D plotArea = new Rectangle2D.Double(drawArea.getX()+vAxisArea.getWidth(),
drawArea.getY(),
drawArea.getWidth()-vAxisArea.getWidth(),
drawArea.getHeight()-hAxisAreaHeight);
// draw the background and axes...
drawOutlineAndBackground(g2, plotArea);
getDomainAxis().draw(g2, drawArea, plotArea);
getRangeAxis().draw(g2, drawArea, plotArea);
// now get the data and plot the bars...
IntervalXYDataset data = (IntervalXYDataset)chart.getDataset();
if (data!=null) {
Shape savedClip = g2.getClip();
g2.clip(plotArea);
double translatedVerticalZero = getRangeAxis().translatedValue(Plot.ZERO, plotArea);
int seriesCount = data.getSeriesCount();
for (int series = 0; series
* Supports the HorizontalAxisLead interface.
* @param g2 The graphics device (used to obtain font information);
* @param drawArea The area within which the axis should be drawn;
* @param plot The plot that the axis belongs to.
*/
17
public double reserveWidth(Graphics2D g2, Plot plot, Rectangle2D drawArea) {
// calculate the width of the axis label...
Rectangle2D labelBounds = labelFont.getStringBounds(label, g2.getFontRenderContext());
double labelWidth = this.labelInsets.left+labelInsets.right;
if (this.verticalLabel) {
labelWidth = labelWidth + labelBounds.getHeight(); // assume width == height before rotation
}
else {
labelWidth = labelWidth + labelBounds.getWidth();
}
// calculate the width required for the tick labels (if visible);
double tickLabelWidth = tickLabelInsets.left+tickLabelInsets.right;
if (tickLabelsVisible) {
this.refreshTicks(g2, drawArea, drawArea);
tickLabelWidth = tickLabelWidth+getMaxTickLabelWidth(g2, drawArea);
}
return labelWidth+tickLabelWidth;
###
2882, VerticalCategoryAxis, VerticalCategoryAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalCategoryAxis.java, 70, 80
14
/**
* Full constructor: returns a new VerticalCategoryAxis with attributes as specified by the
* caller.
* @param label The axis label;
* @param labelFont The font for displaying the axis label;
* @param labelPaint The paint used to draw the axis label;
* @param labelInsets Determines the amount of blank space around the label;
* @param verticalLabel Flag indicating whether or not the axis label is drawn vertically;
* @param showCategoryLabels Flag indicating whether or not category (tick) labels are visible;
* @param categoryLabelFont The font used to display category (tick) labels;
* @param categoryLabelPaint The paint used to draw category (tick) labels;
* @param showTickMarks Flag indicating whether or not tick marks are visible;
* @param tickMarkStroke The stroke used to draw tick marks (if visible).
*/
9
public VerticalCategoryAxis(String label, Font labelFont,
Paint labelPaint, Insets labelInsets,
boolean verticalLabel,
boolean showTickLabels, Font tickLabelFont, Paint tickLabelPaint, Insets tickLabelInsets,
boolean showTickMarks, Stroke tickMarkStroke) {
super(label, labelFont, labelPaint, labelInsets,
showTickLabels, tickLabelFont, tickLabelPaint, tickLabelInsets,
showTickMarks, tickMarkStroke);
this.verticalLabel = verticalLabel;
###
2883, isCompatibleVerticalAxis, VerticalBarPlot3D, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalBarPlot3D.java, 91, 95
5
/**
* Checks the compatibility of a vertical axis, returning true if the axis is compatible with
* the plot, and false otherwise.
* @param axis The vertical axis;
*/
5
public boolean isCompatibleVerticalAxis(Axis axis) {
if (axis instanceof VerticalNumberAxis3D) {
return true;
}
else return false;
###
2884, calculateBackgroundPlotArea, VerticalBarPlot3D, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalBarPlot3D.java, 101, 121
3
/**
* Returns the shape of the background for the 3D-effect bar plot.
*/
18
protected Shape calculateBackgroundPlotArea(Rectangle2D plotArea) {
VerticalAxis vAxis = getVerticalAxis();
double effect3d = ((VerticalNumberAxis3D) vAxis).getEffect3d();
GeneralPath backgroundPlotArea = new GeneralPath();
backgroundPlotArea.moveTo((float) plotArea.getX(), (float)plotArea.getY());
backgroundPlotArea.lineTo((float)(plotArea.getX()+effect3d),
(float)(plotArea.getY()-effect3d));
backgroundPlotArea.lineTo((float)(plotArea.getX()+plotArea.getWidth()),
(float)(plotArea.getY()-effect3d));
backgroundPlotArea.lineTo((float)(plotArea.getX()+plotArea.getWidth()),
(float)(plotArea.getY()+plotArea.getHeight()-effect3d));
backgroundPlotArea.lineTo((float)(plotArea.getX()+plotArea.getWidth()-effect3d),
(float)(plotArea.getY()+plotArea.getHeight()));
backgroundPlotArea.lineTo((float) plotArea.getX(),
(float)(plotArea.getY()+plotArea.getHeight()));
backgroundPlotArea.lineTo((float) plotArea.getX(),
(float) plotArea.getY());
return backgroundPlotArea;
###
2885, draw, VerticalCategoryAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalCategoryAxis.java, 99, 127
6
/**
* Draws the CategoryAxis on a Java 2D graphics device (such as the screen or a printer).
* @param g2 The graphics device;
* @param drawArea The area within which the axis should be drawn;
* @param plotArea The area within which the plot is being drawn.
*/
27
public void draw(Graphics2D g2, Rectangle2D drawArea, Rectangle2D plotArea) {
// draw the axis label
g2.setFont(labelFont);
g2.setPaint(labelPaint);
FontRenderContext frc = g2.getFontRenderContext();
LineMetrics metrics = labelFont.getLineMetrics(label, frc);
Rectangle2D labelBounds = labelFont.getStringBounds(label, frc);
if (verticalLabel) {
double xx = drawArea.getX()+labelInsets.left+metrics.getHeight()-metrics.getDescent()
-metrics.getLeading();
double yy = plotArea.getY()+plotArea.getHeight()/2+(labelBounds.getWidth()/2);
drawVerticalString(label, g2, (float)xx, (float)yy);
}
else {
double xx = drawArea.getX()+labelInsets.left;
double yy = drawArea.getY()+drawArea.getHeight()/2-labelBounds.getHeight()/2;
g2.drawString(label, (float)xx, (float)yy);
}
// draw the category labels
if (this.tickLabelsVisible) {
g2.setFont(tickLabelFont);
g2.setPaint(tickLabelPaint);
this.refreshTicks(g2, drawArea, plotArea);
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
Tick tick = (Tick)iterator.next();
g2.drawString(tick.getText(), tick.getX(), tick.getY());
###
2886, isCompatiblePlot, VerticalCategoryAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalCategoryAxis.java, 228, 230
4
/**
* Returns true if the specified plot is compatible with the axis, and false otherwise.
* @param plot The plot;
*/
3
protected boolean isCompatiblePlot(Plot plot) {
if (plot instanceof CategoryPlot) return true;
else return false;
###
2887, drawBars, VerticalBarPlot3D, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalBarPlot3D.java, 128, 145
3
/**
* Draws the bars...
*/
17
protected void drawBars(Graphics2D g2, Shape backgroundPlotArea, Rectangle2D plotArea) {
VerticalAxis vAxis = getVerticalAxis();
double effect3d = ((VerticalNumberAxis3D) vAxis).getEffect3d();
// draw far 3d axis
if ((outlineStroke!=null) && (outlinePaint!=null)) {
g2.setStroke(outlineStroke);
g2.setPaint(outlinePaint);
g2.draw(new Line2D.Double(plotArea.getX()+effect3d, plotArea.getY()-effect3d,
plotArea.getX()+effect3d, plotArea.getY()+plotArea.getHeight()-effect3d));
g2.draw(new Line2D.Double(plotArea.getX(), plotArea.getY()+plotArea.getHeight(),
plotArea.getX()+effect3d, plotArea.getY()+plotArea.getHeight()-effect3d));
g2.draw(new Line2D.Double(plotArea.getX()+effect3d,
plotArea.getY()+plotArea.getHeight()-effect3d,
plotArea.getX()+plotArea.getWidth(),
plotArea.getY()+plotArea.getHeight()-effect3d));
}
super.drawBars(g2, backgroundPlotArea, plotArea);
###
2888, reserveAxisArea, VerticalCategoryAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalCategoryAxis.java, 201, 221
6
/**
* Returns the area required to draw the axis in the specified draw area.
* @param g2 The graphics device;
* @param drawArea The area within which the plot should be drawn;
* @param reservedHeight The height reserved by the horizontal axis.
*/
19
public Rectangle2D reserveAxisArea(Graphics2D g2, Plot plot, Rectangle2D drawArea,
double reservedHeight) {
// calculate the width of the axis label...
Rectangle2D labelBounds = labelFont.getStringBounds(label, g2.getFontRenderContext());
double labelWidth = this.labelInsets.left+labelInsets.right;
if (this.verticalLabel) {
labelWidth = labelWidth + labelBounds.getHeight(); // assume width == height before rotation
}
else {
labelWidth = labelWidth + labelBounds.getWidth();
}
// calculate the width required for the tick labels (if visible);
double tickLabelWidth = tickLabelInsets.left+tickLabelInsets.right;
if (tickLabelsVisible) {
this.refreshTicks(g2, drawArea, drawArea);
tickLabelWidth = tickLabelWidth+getMaxTickLabelWidth(g2, drawArea);
}
return new Rectangle2D.Double(drawArea.getX(), drawArea.getY(), labelWidth+tickLabelWidth,
drawArea.getHeight()-reservedHeight);
###
2889, VerticalBarPlot3D, VerticalBarPlot3D, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalBarPlot3D.java, 80, 83
5
/**
* Standard constructor - builds a VerticalBarPlot with mostly default attributes.
* @param horizontalAxis The horizontal axis;
* @param verticalAxis The vertical axis;
*/
4
public VerticalBarPlot3D(Axis horizontalAxis, Axis verticalAxis)
throws AxisNotCompatibleException, PlotNotCompatibleException
{
this(horizontalAxis, verticalAxis, new Insets(2,2,2,2), 0.1, 0.1, 0.2, 0.0);
###
2890, VerticalBarPlot3D, VerticalBarPlot3D, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalBarPlot3D.java, 65, 71
10
/**
* Standard constructor: returns a BarPlot with attributes specified by the caller.
* @param horizontal The horizontal axis.
* @param vertical The vertical axis.
* @param introGap The gap before the first bar in the plot.
* @param trailGap The gap after the last bar in the plot.
* @param categoryGap The gap between the last bar in one category and the first bar in the next
* category.
* @param seriesGap The gap between bars within the same category.
*/
6
public VerticalBarPlot3D(Axis horizontal, Axis vertical, Insets insets,
double introGap, double trailGap, double categoryGap, double seriesGap)
throws AxisNotCompatibleException, PlotNotCompatibleException
{
super(horizontal, vertical, insets,
introGap, trailGap, categoryGap, seriesGap);
###
2891, isCompatibleVerticalAxis, XYPlot, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/XYPlot.java, 200, 204
6
/**
* Checks the compatibility of a vertical axis, returning true if the axis is compatible with
* the plot, and false otherwise.
* @param axis The vertical axis;
* @return True if the axis is compatible with the plot, and false otherwise.
*/
5
public boolean isCompatibleVerticalAxis(Axis axis) {
if (axis instanceof VerticalNumberAxis) {
return true;
}
else return false;
###
2892, calculateBarWidth, VerticalBarPlot, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalBarPlot.java, 357, 375
4
/**
* Returns the width of each bar in the chart.
* @param area The area within which the plot will be drawn.
*/
14
double calculateBarWidth(Rectangle2D plotArea) {
CategoryDataset data = getDataset();
// series, category and bar counts
int categoryCount = data.getCategoryCount();
int seriesCount = data.getSeriesCount();
int barCount = renderer.barWidthsPerCategory(data)*categoryCount;
// calculate the plot width (bars are vertical) less whitespace
double usable = plotArea.getWidth() *
(1.0 - introGapPercent - trailGapPercent - categoryGapsPercent);
if (renderer.barWidthsPerCategory(data)>1) {
// usable = usable - ((seriesCount-1) * categoryCount * seriesGap);
}
// and thus the width of the bars
return usable/barCount;
###
2893, addVerticalLine, XYPlot, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/XYPlot.java, 128, 135
4
/**
* Adds a vertical of the given color at location with the given color.
* @return void
*/
7
public void addVerticalLine(Number location, Paint color) {
if (verticalLines == null) {
verticalLines = new ArrayList();
verticalColors = new ArrayList();
}
verticalColors.add(color);
verticalLines.add(location);
###
2894, getHorizontalValueAxis, XYPlot, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/XYPlot.java, 165, 166
5
/**
* A convenience method that returns a reference to the horizontal axis cast as a
* ValueAxis.
* @return The horizontal axis cast as a ValueAxis.
*/
2
public ValueAxis getHorizontalValueAxis() {
return (ValueAxis)horizontalAxis;
###
2895, setHorizontalAxis, VerticalBarPlot, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalBarPlot.java, 152, 154
5
/**
* Sets the horizontal axis for the plot. This method should throw an exception if the axis
* doesn't implement the required interfaces.
* @param axis The new horizontal axis.
*/
3
public void setHorizontalAxis(Axis axis) throws AxisNotCompatibleException {
// check that the axis implements the required interface (if not raise an exception);
super.setHorizontalAxis(axis);
###
2896, draw, XYPlot, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/XYPlot.java, 215, 262
8
/**
* Draws the XY plot on a Java 2D graphics device (such as the screen or a printer).
*
* XYPlot now relies on an XYItemRenderer to draw each item in the plot. This allows the
* visual representation of the plot to be changed easily.
* @param g2 The graphics device;
* @param drawArea The area within which the plot (including axis labels) should be drawn;
*/
40
public void draw(Graphics2D g2, Rectangle2D drawArea) {
// adjust the drawing area for plot insets (if any)...
if (insets!=null) {
drawArea = new Rectangle2D.Double(drawArea.getX()+insets.left,
drawArea.getY()+insets.top,
drawArea.getWidth()-insets.left-insets.right,
drawArea.getHeight()-insets.top-insets.bottom);
}
// estimate the area required for drawing the axes...
HorizontalAxis hAxis = getHorizontalAxis();
VerticalAxis vAxis = getVerticalAxis();
double hAxisAreaHeight = hAxis.reserveHeight(g2, this, drawArea);
Rectangle2D vAxisArea = vAxis.reserveAxisArea(g2, this, drawArea, hAxisAreaHeight);
// ...and therefore what is left for the plot itself...
Rectangle2D plotArea = new Rectangle2D.Double(drawArea.getX()+vAxisArea.getWidth(),
drawArea.getY(),
drawArea.getWidth()-vAxisArea.getWidth(),
drawArea.getHeight()-hAxisAreaHeight);
// draw the plot background and axes...
drawOutlineAndBackground(g2, plotArea);
this.horizontalAxis.draw(g2, drawArea, plotArea);
this.verticalAxis.draw(g2, drawArea, plotArea);
// now get the data and plot it (the visual representation will depend on the renderer
// that has been set)...
XYDataset data = this.getDataset();
if (data!=null) {
Shape originalClip = g2.getClip();
g2.clip(plotArea);
drawVerticalLines(g2, plotArea);
drawHorizontalLines(g2, plotArea);
double transRangeZero = this.getVerticalValueAxis().translatedValue(Plot.ZERO, plotArea);
int seriesCount = data.getSeriesCount();
for (int series=0; series
* Registered listeners are notified of a change to the axis.
* @param flag The new value of the flag.
*/
4
public void setAutoTickValue(boolean flag) {
if (this.autoTickUnit!=flag) {
this.autoTickUnit = flag;
notifyListeners(new AxisChangeEvent(this));
###
2939, ValueAxis, ValueAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/ValueAxis.java, 121, 127
4
/**
* Constructs a value axis.
* @param label The axis label.
*/
7
public ValueAxis(String label) {
super(label);
this.autoRange = true;
this.autoTickUnit = true;
this.showGridLines = true;
this.gridStroke = ValueAxis.DEFAULT_GRID_LINE_STROKE;
this.gridPaint = Color.gray;
###
2940, getGridStroke, ValueAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/ValueAxis.java, 196, 197
3
/**
* Returns the Stroke used to draw the grid lines (if visible).
*/
2
public Stroke getGridStroke() {
return gridStroke;
###
2941, setAutoRange, ValueAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/ValueAxis.java, 143, 147
5
/**
* Sets a flag that determines whether or not the axis range is automatically adjusted to fit
* the data, and notifies registered listeners that the axis has been modified.
* @param auto Flag indicating whether or not the axis is automatically scaled to fit the data.
*/
5
public void setAutoRange(boolean auto) {
if (this.autoRange!=auto) {
this.autoRange=auto;
if (autoRange) autoAdjustRange();
notifyListeners(new AxisChangeEvent(this));
###
2942, isAutoTickUnit, ValueAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/ValueAxis.java, 156, 157
5
/**
* Returns A flag indicating whether or not the tick unit is automatically selected from a
* range of standard tick units.
* @return A flag indicating whether or not the tick unit is automatically selected.
*/
2
public boolean isAutoTickUnit() {
return autoTickUnit;
###
2943, VerticalNumberAxis3D, VerticalNumberAxis3D, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalNumberAxis3D.java, 114, 123
7
/**
* Standard constructor: returns a VerticalValueAxis with some default attributes.
* @param label The axis label;
* @param labelFont The font for displaying the axis label;
* @param minimumAxisValue The lowest value shown on the axis;
* @param maximumAxisValue The highest value shown on the axis;
*/
9
public VerticalNumberAxis3D(String label, Font labelFont,
Number minimumAxisValue, Number maximumAxisValue) {
this(label, labelFont, Color.black, new Insets(4, 4, 4, 4), true,
true, new Font("Arial", Font.PLAIN, 10), Color.black, new Insets(2, 1, 2, 1),
true, new BasicStroke(1), false, true, new Double(0.00001),
minimumAxisValue, maximumAxisValue,
true, NumberAxis.DEFAULT_TICK_UNIT,
/* new Double(5.0), new DecimalFormat("0"), */
false, new BasicStroke(1), Color.lightGray, DEFAULT_EFFECT_3D);
###
2944, isAutoRange, ValueAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/ValueAxis.java, 134, 135
4
/**
* Returns true if the axis range is automatically adjusted to fit the data, and false
* otherwise.
*/
2
public boolean isAutoRange() {
return autoRange;
###
2946, VerticalNumberAxis3D, VerticalNumberAxis3D, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalNumberAxis3D.java, 81, 103
27
/**
* Full constructor: returns a new VerticalValueAxis.
* @param label The axis label;
* @param labelFont The font for displaying the axis label;
* @param labelPaint The paint used to draw the axis label;
* @param labelInsets Determines the amount of blank space around the label;
* @param verticalLabel Flag indicating whether or not the label is drawn vertically;
* @param showTickLabels Flag indicating whether or not tick labels are visible;
* @param tickLabelFont The font used to display tick labels;
* @param tickLabelPaint The paint used to draw tick labels;
* @param tickLabelInsets Determines the amount of blank space around tick labels;
* @param showTickMarks Flag indicating whether or not tick marks are visible;
* @param tickMarkStroke The stroke used to draw tick marks (if visible).
* @param autoRange Flag indicating whether or not the axis is automatically scaled to fit the
* data;
* @param autoRangeIncludesZero - A flag indicating whether or not zero *must* be displayed on
* axis;
* @param autoRangeMinimum - the smallest automatic range allowed;
* @param minimumAxisValue The lowest value shown on the axis;
* @param maximumAxisValue The highest value shown on the axis;
* @param autoTickUnit A flag indicating whether or not the tick units are automatically
* selected.
* @param showGridLines Flag indicating whether or not grid lines are visible for this axis;
* @param gridStroke The Stroke used to display grid lines (if visible);
* @param gridPaint The Paint used to display grid lines (if visible).
* @param effect3d 'Z' axis deep
*/
21
public VerticalNumberAxis3D(String label, Font labelFont, Paint labelPaint, Insets labelInsets,
boolean verticalLabel,
boolean showTickLabels, Font tickLabelFont, Paint tickLabelPaint,
Insets tickLabelInsets,
boolean showTickMarks, Stroke tickMarkStroke,
boolean autoRange, boolean autoRangeIncludesZero,
Number autoRangeMinimum,
Number minimumAxisValue, Number maximumAxisValue,
boolean autoTickUnit, NumberTickUnit tickUnit,
/*Number tickValue, DecimalFormat formatter,*/
boolean showGridLines, Stroke gridStroke, Paint gridPaint,
double effect3d) {
super(label, labelFont, labelPaint, labelInsets, verticalLabel, showTickLabels,
tickLabelFont, tickLabelPaint,
tickLabelInsets, showTickMarks, tickMarkStroke,
autoRange, autoRangeIncludesZero, autoRangeMinimum,
minimumAxisValue, maximumAxisValue,
autoTickUnit, tickUnit,
/* tickValue, formatter, */
showGridLines, gridStroke, gridPaint);
this.effect3d = effect3d;
###
2947, VerticalNumberAxis3D, VerticalNumberAxis3D, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalNumberAxis3D.java, 130, 131
4
/**
* Standard constructor - builds a VerticalValueAxis with mostly default attributes.
* @param label The axis label;
*/
2
public VerticalNumberAxis3D(String label) {
super(label);
###
2948, setTitle, Title, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Title.java, 81, 82
5
/**
* Sets the title to the specified text and notifies registered listeners that the title has
* been modified.
* @param text The new chart title;
*/
2
public void setTitle(String text) {
this.title = text;
###
2949, draw, VerticalNumberAxis3D, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalNumberAxis3D.java, 154, 200
6
/**
* Draws the plot on a Java 2D graphics device (such as the screen or a printer).
* @param g2 The graphics device.
* @param drawArea The area within which the chart should be drawn.
* @param plotArea The area within which the plot should be drawn (a subset of the drawArea).
*/
44
public void draw(Graphics2D g2, Rectangle2D drawArea, Rectangle2D plotArea) {
// draw the axis label
if (this.label!=null) {
g2.setFont(labelFont);
g2.setPaint(labelPaint);
Rectangle2D labelBounds = labelFont.getStringBounds(label, g2.getFontRenderContext());
if (labelDrawnVertical) {
double xx = drawArea.getX()+labelInsets.left+labelBounds.getHeight();
double yy = plotArea.getY()+plotArea.getHeight()/2+(labelBounds.getWidth()/2);
drawVerticalString(label, g2, (float)xx, (float)yy);
}
else {
double xx = drawArea.getX()+labelInsets.left;
double yy = drawArea.getY()+drawArea.getHeight()/2-labelBounds.getHeight()/2;
g2.drawString(label, (float)xx, (float)yy);
}
}
// draw the tick labels and marks and gridlines
this.refreshTicks(g2, drawArea, plotArea);
double xx = plotArea.getX();
g2.setFont(tickLabelFont);
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
Tick tick = (Tick)iterator.next();
float yy = (float)this.translatedValue(tick.getNumericalValue(), plotArea);
if (tickLabelsVisible) {
g2.setPaint(this.tickLabelPaint);
g2.drawString(tick.getText(), tick.getX(), tick.getY());
}
if (tickMarksVisible) {
g2.setStroke(this.getTickMarkStroke());
Line2D mark = new Line2D.Double(plotArea.getX()-2, yy,
plotArea.getX(), yy);
g2.draw(mark);
}
if (showGridLines) {
g2.setStroke(gridStroke);
g2.setPaint(gridPaint);
Line2D gridline = new Line2D.Double(xx+effect3d, yy-effect3d,
plotArea.getMaxX(), yy-effect3d);
g2.draw(gridline);
Line2D grid3Dline = new Line2D.Double(xx, yy,
xx+effect3d, yy-effect3d);
g2.draw(grid3Dline);
###
2950, removeChangeListener, Title, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Title.java, 98, 99
4
/**
* Unregisters an object for notification of changes to the chart title.
* @param listener The object that is being unregistered.
*/
2
public void removeChangeListener(TitleChangeListener listener) {
listeners.remove(listener);
###
2951, Title, Title, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Title.java, 64, 66
3
/**
* Standard constructor - builds a Title object.
*/
3
protected Title(String title) {
this.title = title;
this.listeners = new java.util.ArrayList();
###
2952, VerticalNumberAxis3D, VerticalNumberAxis3D, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalNumberAxis3D.java, 137, 138
3
/**
* Default constructor.
*/
2
public VerticalNumberAxis3D() {
super(null);
###
2954, getEffect3d, VerticalNumberAxis3D, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/VerticalNumberAxis3D.java, 144, 145
3
/**
* Return axis 3d deep along 'Z' axis.
*/
2
public double getEffect3d() {
return effect3d;
###
2955, getTitle, Title, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Title.java, 72, 73
3
/**
* Returns the title text.
*/
2
public String getTitle() {
return this.title;
###
2956, addChangeListener, Title, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Title.java, 90, 91
7
/**
* Registers an object for notification of changes to the title.
* @param listener The object that is being registered.
*/
--------------
//notifyListeners(new TitleChangeEvent(this));
--------------
2
public void addChangeListener(TitleChangeListener listener) {
listeners.add(listener);
###
2957, createInstance, Title, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Title.java, 57, 58
5
/**
* Static factory method that returns a concrete subclass of Title.
* @param title The chart title;
* @param font The font for displaying the chart title;
*/
2
public static Title createInstance(String title, Font font) {
return new StandardTitle(title, font);
###
2958, getText, Tick, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Tick.java, 98, 99
4
/**
* Returns the text version of the tick value.
* @return The formatted version of the tick value;
*/
2
public String getText() {
return text;
###
2959, Tick, Tick, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Tick.java, 76, 77
6
/**
* Standard constructor: creates a Tick with the specified properties.
* @param formattedValue The formatted version of the tick value;
* @param x The x-coordinate of the tick;
* @param y The y-coordinate of the tick;
*/
2
public Tick(String text, float x, float y) {
this(text, text, x, y);
###
2960, Tick, Tick, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Tick.java, 63, 67
7
/**
* Standard constructor: creates a Tick with the specified properties.
* @param value The tick value;
* @param formattedValue The formatted version of the tick value;
* @param x The x-coordinate of the tick;
* @param y The y-coordinate of the tick;
*/
5
public Tick(Object value, String text, float x, float y) {
this.value = value;
this.text = text;
this.x=x;
this.y=y;
###
2961, getX, Tick, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Tick.java, 106, 107
4
/**
* Returns the x-coordinate of the tick.
* @return The x-coordinate of the tick.
*/
2
public float getX() {
return x;
###
2962, getNumericalValue, Tick, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/Tick.java, 84, 91
4
/**
* Returns the numerical value of the tick, or null if the value is not a Number.
* @return The tick value;
*/
8
public Number getNumericalValue() {
if (value instanceof Number) {
return (Number)value;
}
else if (value instanceof Date) {
return new Long(((Date)value).getTime());
}
else return null;
###
2963, draw, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 191, 195
6
/**
* Draws the title on a Java 2D graphics device (such as the screen or a printer).
* @param g2 The graphics device;
* @param chartArea The area within which the title (and plot) should be drawn;
* @return The area used by the title;
*/
5
public void draw(Graphics2D g2, Rectangle2D titleArea) {
if (this.position == TOP || this.position == BOTTOM) {
drawHorizontal(g2, titleArea);
}
else throw new RuntimeException("TextTitle.draw(...) - invalid title position.");
###
2964, getPaint, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 118, 119
4
/**
* Returns the paint used to display the title.
* @return An object that implements the Paint interface used to paint this title;
*/
2
public Paint getPaint() {
return this.paint;
###
2965, getFont, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 98, 99
4
/**
* Returns the current title font.
* @return A Font object of the font used to render this title;
*/
2
public Font getFont() {
return this.font;
###
2966, getPreferredWidth, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 166, 171
3
/**
* Returns the preferred width of the title.
*/
6
public double getPreferredWidth(Graphics2D g2) {
g2.setFont(font);
FontRenderContext frc = g2.getFontRenderContext();
Rectangle2D titleBounds = font.getStringBounds(text, frc);
double titleWidth = insets.left+titleBounds.getWidth()+insets.right;
return titleWidth;
###
2967, setPaint, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 127, 130
5
/**
* Sets the Paint used to display the title and notifies registered listeners that the title has
* been modified.
* @param paint The new paint for displaying the chart title;
*/
4
public void setPaint(Paint paint) {
if (!this.paint.equals(paint)) {
this.paint = paint;
notifyListeners(new TitleChangeEvent(this));
###
2968, TextTitle, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 90, 91
3
/**
* Default constructor - builds a TextTitle with some default attributes.
*/
2
public TextTitle(String text) {
this(text, new Font("Dialog", Font.PLAIN, 12));
###
2969, setText, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 147, 150
5
/**
* Sets the title to the specified text. This method notifies registered listeners that the
* title has been modified.
* @param text A String of the new chart title;
*/
4
public void setText(String text) {
if (!this.text.equals(text)) {
this.text = text;
notifyListeners(new TitleChangeEvent(this));
###
2970, isValidPosition, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 158, 160
4
/**
* Returns true for the positions that are valid for TextTitle (TOP and BOTTOM for now) and
* false for all other positions.
*/
3
public boolean isValidPosition(int position) {
if ((position==AbstractTitle.TOP) || (position==AbstractTitle.BOTTOM)) return true;
else return false;
###
2971, TextTitle, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 61, 66
1
/** Full constructor - builds a TextTitle with the specified properties. */
6
public TextTitle(String text, Font font, Paint paint, int position, int horizontalAlignment,
int verticalAlignment, Insets insets) {
super(position, horizontalAlignment, verticalAlignment, insets);
this.text = text;
this.font = font;
this.paint = paint;
###
2972, TextTitle, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 79, 80
3
/**
* Default constructor - builds a TextTitle with some default attributes.
*/
2
public TextTitle(String text, Font font) {
this(text, font, Color.black);
###
2973, setFont, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 107, 110
5
/**
* Sets the title font to the specified font and notifies registered listeners that the title
* has been modified.
* @param font A Font object of the new font;
*/
4
public void setFont(Font font) {
if (!this.font.equals(font)) {
this.font = font;
notifyListeners(new TitleChangeEvent(this));
###
2974, drawHorizontal, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 203, 241
5
/**
* Draws the title on a Java 2D graphics device (such as the screen or a printer).
* @param g2 The graphics device;
* @param chartArea The area within which the title (and plot) should be drawn;
*/
32
protected void drawHorizontal(Graphics2D g2, Rectangle2D titleArea) {
g2.setFont(this.font);
g2.setPaint(this.paint);
FontRenderContext frc = g2.getFontRenderContext();
Rectangle2D titleBounds = font.getStringBounds(text, frc);
LineMetrics lineMetrics = font.getLineMetrics(text, frc);
double titleWidth = titleBounds.getWidth();
double titleHeight = lineMetrics.getHeight();
double titleY = titleArea.getY()+insets.top;
// work out the vertical alignment...
if (this.verticalAlignment==TOP) {
titleY = titleY+titleHeight-lineMetrics.getLeading()-lineMetrics.getDescent();
}
else if (this.verticalAlignment==MIDDLE) {
double space = (titleArea.getHeight()-insets.top-insets.bottom-titleHeight);
titleY = titleY+(space/2)+titleHeight-lineMetrics.getLeading()-lineMetrics.getDescent();
}
else if (this.verticalAlignment==BOTTOM) {
titleY = titleArea.getMaxY()-insets.bottom-lineMetrics.getLeading()-lineMetrics.getDescent();
}
// work out the horizontal alignment...
double titleX = titleArea.getX()+insets.left;
if (this.horizontalAlignment==CENTER) {
titleX = titleX+((titleArea.getWidth()-insets.left-insets.right)/2)-(titleWidth/2);
}
else if (this.horizontalAlignment==LEFT) {
titleX = titleArea.getX()+insets.left;
}
else if (this.horizontalAlignment == RIGHT) {
titleX = titleArea.getMaxX()-insets.right-titleWidth;
}
g2.drawString(text, (float)(titleX), (float)(titleY));
###
2975, TextTitle, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 72, 73
3
/**
* Default constructor - builds a TextTitle with some default attributes.
*/
2
public TextTitle(String text, Font font, Paint paint) {
this(text, font, paint, TOP, CENTER, MIDDLE, new Insets(2, 2, 2, 2));
###
2976, getPreferredHeight, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 177, 182
3
/**
* Returns the preferred height of the title.
*/
6
public double getPreferredHeight(Graphics2D g2) {
g2.setFont(font);
FontRenderContext frc = g2.getFontRenderContext();
LineMetrics lineMetrics = font.getLineMetrics(text, frc);
double titleHeight = insets.top+lineMetrics.getHeight()+insets.bottom;
return titleHeight;
###
2977, getText, TextTitle, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TextTitle.java, 138, 139
4
/**
* Returns the title text.
* @return A String of the title text;
*/
2
public String getText() {
return text;
###
2978, getChart, ChartChangeEvent, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/event/ChartChangeEvent.java, 99, 100
3
/**
* Returns a reference to the chart that generated the change event.
*/
2
public JFreeChart getChart() {
return chart;
###
2979, setChart, ChartChangeEvent, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/event/ChartChangeEvent.java, 107, 108
4
/**
* Sets the chart that generated the change event.
* @param chart The chart that generated the event.
*/
2
public void setChart(JFreeChart chart) {
this.chart = chart;
###
2980, getType, ChartChangeEvent, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/event/ChartChangeEvent.java, 114, 115
3
/**
* Returns the event type.
*/
2
public int getType() {
return this.type;
###
2982, ChartChangeEvent, ChartChangeEvent, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/event/ChartChangeEvent.java, 90, 93
3
/**
* Full constructor: returns a new ChartChangeEvent object with the specified type.
*/
4
public ChartChangeEvent(Object source, JFreeChart chart, int type) {
super(source);
this.chart = chart;
this.type = type;
###
2983, ChartChangeEvent, ChartChangeEvent, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/event/ChartChangeEvent.java, 74, 75
4
/**
* Standard constructor: returns a new ChartChangeEvent object, type GENERAL.
* @param source The source of the event (could be the chart, a title, an axis etc.)
*/
2
public ChartChangeEvent(Object source) {
this(source, null, GENERAL);
###
2984, ChartChangeEvent, ChartChangeEvent, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/event/ChartChangeEvent.java, 83, 84
5
/**
* Standard constructor: returns a new ChartChangeEvent object, type GENERAL.
* @param source The source of the event (could be the chart, a title, an axis etc.);
* @param chart The chart that generated the event;
*/
2
public ChartChangeEvent(Object source, JFreeChart chart) {
this(source, chart, GENERAL);
###
2985, getPlotShapes, StandardXYItemRenderer, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/StandardXYItemRenderer.java, 89, 90
3
/**
* Returns true if shapes are being plotted by the renderer.
*/
2
public boolean getPlotShapes() {
return this.plotShapes;
###
2986, StandardXYItemRenderer, StandardXYItemRenderer, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/StandardXYItemRenderer.java, 77, 82
4
/**
* Standard constructor.
* @param The type of renderer. Use one of the constants SHAPES, LINES or SHAPES_AND_LINES.
*/
6
public StandardXYItemRenderer(int type) {
if (type==SHAPES) this.plotShapes=true;
if (type==LINES) this.plotLines=true;
if (type==SHAPES_AND_LINES) {
this.plotShapes = true;
this.plotLines = true;
###
2987, StandardXYItemRenderer, StandardXYItemRenderer, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/StandardXYItemRenderer.java, 68, 70
3
/**
* Default constructor.
*/
3
public StandardXYItemRenderer() {
this.plotShapes = true;
this.plotLines = false;
###
2988, drawItem, StandardXYItemRenderer, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/StandardXYItemRenderer.java, 113, 144
13
/**
* Draws the visual representation of a single data item.
* @param g2 The graphics device.
* @param plotArea The area within which the plot is being drawn.
* @param plot The plot (can be used to obtain standard color information etc).
* @param horizontalAxis The horizontal axis.
* @param verticalAxis The vertical axis.
* @param data The dataset.
* @param series The series index.
* @param item The item index.
* @param translatedRangeZero Zero on the range axis (supplied so that, if it is required, it
* doesn't have to be calculated repeatedly).
*/
26
public void drawItem(Graphics2D g2, Rectangle2D plotArea,
Plot plot, ValueAxis horizontalAxis, ValueAxis verticalAxis,
XYDataset data, int series, int item,
double translatedRangeZero) {
Paint seriesPaint = plot.getSeriesPaint(series);
Stroke seriesStroke = plot.getSeriesStroke(series);
g2.setPaint(seriesPaint);
g2.setStroke(seriesStroke);
// get the data point...
Number x1 = data.getXValue(series, item);
Number y1 = data.getYValue(series, item);
double transX1 = horizontalAxis.translatedValue(x1, plotArea);
double transY1 = verticalAxis.translatedValue(y1, plotArea);
if (this.plotShapes) {
Shape shape = plot.getShape(series, item, transX1, transY1, shapeScale);
g2.draw(shape);
}
if (this.plotLines) {
if (item>0) {
// get the previous data point...
Number x0 = data.getXValue(series, item-1);
Number y0 = data.getYValue(series, item-1);
double transX0 = horizontalAxis.translatedValue(x0, plotArea);
double transY0 = verticalAxis.translatedValue(y0, plotArea);
Line2D line = new Line2D.Double(transX0, transY0, transX1, transY1);
g2.draw(line);
###
2989, AxisChangeEvent, AxisChangeEvent, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/event/AxisChangeEvent.java, 51, 53
4
/**
* Default constructor: returns a new AxisChangeEvent.
* @param axis The axis that generated the event.
*/
3
public AxisChangeEvent(Axis axis) {
super(axis);
this.axis = axis;
###
2990, getPlotLines, StandardXYItemRenderer, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/StandardXYItemRenderer.java, 96, 97
3
/**
* Returns true if lines are being plotted by the renderer.
*/
2
public boolean getPlotLines() {
return this.plotLines;
###
2991, getNearestTickUnit, TickUnits, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/TickUnits.java, 57, 64
3
/**
* Returns the tick unit in the collection that is closest in size to the specified unit.
*/
8
public TickUnit getNearestTickUnit(TickUnit unit) {
int index = Collections.binarySearch(units, unit);
if (index>=0) {
return (TickUnit)units.get(index);
}
else {
index = -(index + 1);
return (TickUnit)units.get(Math.min(index, units.size()));
###
2992, barWidthsPerCategory, HorizontalBarRenderer, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/HorizontalBarRenderer.java, 65, 66
5
/**
* This renderer shows each series within a category as a separate bar (as opposed to a
* stacked bar renderer).
* @param data The data being plotted.
*/
2
public int barWidthsPerCategory(CategoryDataset data) {
return data.getSeriesCount();
###
2993, hasItemGaps, HorizontalBarRenderer, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/HorizontalBarRenderer.java, 56, 57
3
/**
* Returns true, since for this renderer there are gaps between the items in one category.
*/
2
public boolean hasItemGaps() {
return true;
###
2994, drawBar, HorizontalBarRenderer, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/HorizontalBarRenderer.java, 86, 142
17
/**
* Draws the bar for a single (series, category) data item.
* @param g2
* @param plotArea
* @param plot
* @param valueAxis
* @param data
* @param series
* @param category
* @param categoryIndex
* @param translatedZero
* @param itemWidth
* @param categorySpan
* @param categoryGapSpan
* @param itemSpan
* @param itemGapSpan
*/
57
public void drawBar(Graphics2D g2, Rectangle2D plotArea, BarPlot plot, ValueAxis valueAxis,
CategoryDataset data, int series, Object category, int categoryIndex,
double translatedZero, double itemWidth,
double categorySpan, double categoryGapSpan,
double itemSpan, double itemGapSpan) {
// first check the value we are plotting...
Number value = data.getValue(series, category);
if (value!=null) {
// X
double translatedValue = valueAxis.translatedValue(value, plotArea);
double rectX = Math.min(translatedZero, translatedValue);
// Y
double rectY = plotArea.getY() + plotArea.getHeight()*plot.getIntroGapPercent();
int categories = data.getCategoryCount();
int seriesCount = data.getSeriesCount();
if (categories>1) {
rectY = rectY
// bars in completed categories
+ (categoryIndex*categorySpan/categories)
// gaps between completed categories
+ (categoryIndex*categoryGapSpan/(categories-1))
// bars+gaps completed in current category
+ (series*itemSpan/(categories*seriesCount));
if (seriesCount>1) {
rectY = rectY
+ (series*itemGapSpan/(categories*(seriesCount-1)));
}
}
else {
rectY = rectY
// bars+gaps completed in current category;
+ (series*itemSpan/(categories*seriesCount));
if (seriesCount>1) {
rectY = rectY
+ (series*itemGapSpan/(categories*(seriesCount-1)));
}
}
// WIDTH
double rectWidth = Math.abs(translatedValue-translatedZero);
// HEIGHT
double rectHeight = itemWidth;
// DRAW THE BAR...
Rectangle2D bar = new Rectangle2D.Double(rectX, rectY, rectWidth, rectHeight);
Paint seriesPaint = plot.getSeriesPaint(series);
g2.setPaint(seriesPaint);
g2.fill(bar);
if (itemWidth>BAR_OUTLINE_WIDTH_THRESHOLD) {
g2.setStroke(plot.getSeriesStroke(series));
g2.setPaint(plot.getSeriesOutlinePaint(series));
g2.draw(bar);
###
2995, getSeriesName, SampleXYDataset, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/SampleXYDataset.java, 105, 112
5
/**
* Returns the name of the series.
* @param series The index (zero-based) of the series;
* @return The name of the series.
*/
8
public String getSeriesName(int series) {
if (series==0) {
return "y = cosine(x)";
}
else if (series==1) {
return "y = 2*sine(x)";
}
else return "Error";
###
2996, getXValue, SampleXYDataset, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/SampleXYDataset.java, 75, 76
6
/**
* Returns the x-value for the specified series and item. Series are numbered 0, 1, ...
* @param series The index (zero-based) of the series;
* @param item The index (zero-based) of the required item;
* @return The x-value for the specified series and item.
*/
2
public Number getXValue(int series, int item) {
return new Double(-10.0+translate+(item*0.2));
###
2997, SampleXYDataset, SampleXYDataset, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/SampleXYDataset.java, 56, 57
3
/**
* Default constructor.
*/
2
public SampleXYDataset() {
this.translate = 0.0;
###
2998, getMaxTickLabelHeight, HorizontalDateAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/HorizontalDateAxis.java, 426, 445
3
/**
* A utility method for determining the height of the tallest tick label.
*/
20
private double getMaxTickLabelHeight(Graphics2D g2, Rectangle2D drawArea, boolean vertical) {
Font font = getTickLabelFont();
g2.setFont(font);
FontRenderContext frc = g2.getFontRenderContext();
double maxHeight = 0.0;
if (vertical) {
Iterator iterator = this.ticks.iterator();
while (iterator.hasNext()) {
Tick tick = (Tick)iterator.next();
Rectangle2D labelBounds = font.getStringBounds(tick.getText(), frc);
if (labelBounds.getWidth()>maxHeight) {
maxHeight = labelBounds.getWidth();
}
}
}
else {
LineMetrics metrics = font.getLineMetrics("Sample", frc);
maxHeight = metrics.getHeight();
}
return maxHeight;
###
2999, getSeriesCount, SampleXYDataset, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/SampleXYDataset.java, 96, 97
4
/**
* Returns the number of series in the data source.
* @return The number of series in the data source.
*/
2
public int getSeriesCount() {
return 2;
###
3000, getYValue, SampleXYDataset, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/SampleXYDataset.java, 85, 89
6
/**
* Returns the y-value for the specified series and item. Series are numbered 0, 1, ...
* @param series The index (zero-based) of the series;
* @param item The index (zero-based) of the required item;
* @return The y-value for the specified series and item.
*/
5
public Number getYValue(int series, int item) {
if (series==0) {
return new Double(Math.cos(-10.0+translate+(item/10.0)));
}
else return new Double(2*(Math.sin(-10.0+translate+(item/10.0))));
###
3001, tickLabelsFit, HorizontalDateAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/HorizontalDateAxis.java, 391, 419
6
/**
* Determines whether or not the tick labels fit given the available space.
*/
--------------
// there are two special cases to handle
--------------
29
private boolean tickLabelsFit(int index,
Graphics2D g2, Rectangle2D drawArea, Rectangle2D plotArea) {
// generate one label at a time until all are done OR there is an overlap (so fit==FALSE)
SimpleDateFormat dateFormatter = new SimpleDateFormat(standardTickFormats[index]);
DateUnit units = new DateUnit(this.standardTickUnits[index][0], this.standardTickUnits[index][1]);
double lastLabelExtent = Double.NEGATIVE_INFINITY;
double labelExtent;
boolean labelsFit = true;
Date tickDate = this.calculateLowestVisibleTickValue(units);
while (tickDate.before(this.maximumDate) && labelsFit) {
double xx = this.translatedValue(tickDate, plotArea);
String tickLabel = dateFormatter.format(tickDate);
Rectangle2D tickLabelBounds = tickLabelFont.getStringBounds(tickLabel,
g2.getFontRenderContext());
if (this.verticalTickLabels) {
labelExtent = xx-(tickLabelBounds.getHeight()/2);
if (labelExtent
* Supports the HorizontalAxis interface.
* @param g2 The graphics device (used to obtain font information);
* @param plot The plot that the axis belongs to;
* @param drawArea The area within which the axis should be drawn;
*/
15
public double reserveHeight(Graphics2D g2, Plot plot, Rectangle2D drawArea) {
// calculate the height of the axis label...
Rectangle2D labelBounds = labelFont.getStringBounds(label, g2.getFontRenderContext());
double labelHeight = this.labelInsets.top+labelInsets.bottom+labelBounds.getHeight();
// calculate the height required for the tick labels (if visible);
double tickLabelHeight = 0.0;
if (tickLabelsVisible) {
g2.setFont(tickLabelFont);
this.refreshTicks(g2, drawArea, drawArea);
tickLabelHeight = tickLabelInsets.top+tickLabelInsets.bottom+
getMaxTickLabelHeight(g2, drawArea, this.verticalCategoryLabels);
}
return labelHeight+tickLabelHeight;
###
3078, refreshTicks, HorizontalCategoryAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/HorizontalCategoryAxis.java, 158, 188
6
/**
* Creates a temporary list of ticks that can be used when drawing the axis.
* @param g2 The graphics device (used to get font measurements);
* @param drawArea The area where the plot and axes will be drawn;
* @param plotArea The area inside the axes;
*/
31
public void refreshTicks(Graphics2D g2, Rectangle2D drawArea, Rectangle2D plotArea) {
this.ticks.clear();
CategoryPlot categoryPlot = (CategoryPlot)plot;
Dataset data = categoryPlot.getDataset();
if (data!=null) {
FontRenderContext frc = g2.getFontRenderContext();
Font font = this.getTickLabelFont();
g2.setFont(font);
int categoryIndex = 0;
float xx = 0.0f;
float yy = 0.0f;
Iterator iterator = categoryPlot.getDataset().getCategories().iterator();
while (iterator.hasNext()) {
Object category = iterator.next();
String label = category.toString();
Rectangle2D labelBounds = font.getStringBounds(label, frc);
LineMetrics metrics = font.getLineMetrics(label, frc);
if (this.verticalCategoryLabels) {
xx = (float)(categoryPlot.getCategoryCoordinate(categoryIndex, plotArea)+
labelBounds.getHeight()/2);
yy = (float)(plotArea.getMaxY()+tickLabelInsets.top+labelBounds.getWidth());
}
else {
xx = (float)(categoryPlot.getCategoryCoordinate(categoryIndex, plotArea)-
labelBounds.getWidth()/2);
yy = (float)(plotArea.getMaxY()+tickLabelInsets.top+metrics.getHeight()
-metrics.getDescent());
}
Tick tick = new Tick(category, label, xx, yy);
ticks.add(tick);
categoryIndex = categoryIndex+1;
###
3079, draw, HorizontalCategoryAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/HorizontalCategoryAxis.java, 120, 145
7
/**
* Draws the HorizontalCategoryAxis on a Java 2D graphics device (such as the screen or a
* printer).
* @param g2 The graphics device;
* @param drawArea The area within which the axis should be drawn;
* @param plotArea The area within which the plot is being drawn.
*/
26
public void draw(Graphics2D g2, Rectangle2D drawArea, Rectangle2D plotArea) {
// draw the axis label
g2.setFont(labelFont);
g2.setPaint(labelPaint);
FontRenderContext frc = g2.getFontRenderContext();
Rectangle2D labelBounds = labelFont.getStringBounds(label, frc);
LineMetrics lm = labelFont.getLineMetrics(label, frc);
float labelx = (float)(plotArea.getX()+plotArea.getWidth()/2-labelBounds.getWidth()/2);
float labely = (float)(drawArea.getMaxY()-labelInsets.bottom
-lm.getDescent()-lm.getLeading());
g2.drawString(label, labelx, labely);
// draw the category labels
if (this.tickLabelsVisible) {
g2.setFont(tickLabelFont);
g2.setPaint(tickLabelPaint);
this.refreshTicks(g2, drawArea, plotArea);
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
Tick tick = (Tick)iterator.next();
if (this.verticalCategoryLabels) {
this.drawVerticalString(tick.getText(), g2, tick.getX(), tick.getY());
}
else {
g2.drawString(tick.getText(), tick.getX(), tick.getY());
###
3080, HorizontalCategoryAxis, HorizontalCategoryAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/HorizontalCategoryAxis.java, 92, 94
4
/**
* Standard constructor - builds a HorizontalCategoryAxis with defaults for most attributes.
* @param label The axis label;
*/
3
public HorizontalCategoryAxis(String label) {
super(label);
this.verticalCategoryLabels = false;
###
3081, getVerticalCategoryLabels, HorizontalCategoryAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/HorizontalCategoryAxis.java, 100, 101
3
/**
* Returns a flag indicating whether the category labels are drawn 'vertically'.
*/
2
public boolean getVerticalCategoryLabels() {
return this.verticalCategoryLabels;
###
3082, reserveAxisArea, HorizontalCategoryAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/HorizontalCategoryAxis.java, 226, 244
7
/**
* Returns the area required to draw the axis in the specified draw area.
* @param g2 The graphics device;
* @param plot The plot that the axis belongs to;
* @param drawArea The area within which the plot should be drawn;
* @param reservedWidth The width reserved by the vertical axis;
*/
19
public Rectangle2D reserveAxisArea(Graphics2D g2, Plot plot, Rectangle2D drawArea,
double reservedWidth) {
// calculate the height of the axis label...
Rectangle2D labelBounds = labelFont.getStringBounds(label, g2.getFontRenderContext());
double labelHeight = this.labelInsets.top+labelInsets.bottom+labelBounds.getHeight();
// calculate the height required for the tick labels (if visible);
double tickLabelHeight = 0.0;
if (tickLabelsVisible) {
g2.setFont(tickLabelFont);
this.refreshTicks(g2, drawArea, drawArea);
tickLabelHeight = tickLabelInsets.top+tickLabelInsets.bottom+
getMaxTickLabelHeight(g2, drawArea, this.verticalCategoryLabels);
}
return new Rectangle2D.Double(drawArea.getX(),
drawArea.getMaxY()-labelHeight-tickLabelHeight,
drawArea.getWidth()-reservedWidth,
labelHeight+tickLabelHeight);
###
3083, getMaxTickLabelHeight, HorizontalCategoryAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/HorizontalCategoryAxis.java, 250, 269
3
/**
* A utility method for determining the height of the tallest tick label.
*/
20
private double getMaxTickLabelHeight(Graphics2D g2, Rectangle2D drawArea, boolean vertical) {
Font font = getTickLabelFont();
g2.setFont(font);
FontRenderContext frc = g2.getFontRenderContext();
double maxHeight = 0.0;
if (vertical) {
Iterator iterator = this.ticks.iterator();
while (iterator.hasNext()) {
Tick tick = (Tick)iterator.next();
Rectangle2D labelBounds = font.getStringBounds(tick.getText(), frc);
if (labelBounds.getWidth()>maxHeight) {
maxHeight = labelBounds.getWidth();
}
}
}
else {
LineMetrics metrics = font.getLineMetrics("Sample", frc);
maxHeight = metrics.getHeight();
}
return maxHeight;
###
3084, HorizontalCategoryAxis, HorizontalCategoryAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/HorizontalCategoryAxis.java, 73, 84
16
/**
* Full constructor: returns a new HorizontalCategoryAxis with attributes as specified by the
* caller.
* @param label The axis label.
* @param labelFont The font for displaying the axis label.
* @param labelPaint The paint used to draw the axis label.
* @param labelInsets Determines the amount of blank space around the label.
* @param showCategoryLabels Flag indicating whether or not category (tick) labels are visible.
* @param verticalCategoryLabels Flag indicating whether or not the category labels are drawn
* vertically.
* @param categoryLabelFont The font used to display category (tick) labels.
* @param categoryLabelPaint The paint used to draw category (tick) labels.
* @param categoryLabelInsets Determines the blank space around each category (tick) label.
* @param showTickMarks Flag indicating whether or not tick marks are visible.
* @param tickMarkStroke The stroke used to draw tick marks (if visible).
*/
12
public HorizontalCategoryAxis(String label, Font labelFont, Paint labelPaint,
Insets labelInsets,
boolean showCategoryLabels, boolean verticalCategoryLabels,
Font categoryLabelFont, Paint categoryLabelPaint,
Insets categoryLabelInsets,
boolean showTickMarks, Stroke tickMarkStroke) {
super(label, labelFont, labelPaint, labelInsets,
showCategoryLabels, categoryLabelFont, categoryLabelPaint, categoryLabelInsets,
showTickMarks, tickMarkStroke);
this.verticalCategoryLabels = verticalCategoryLabels;
###
3085, setVerticalCategoryLabels, HorizontalCategoryAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/HorizontalCategoryAxis.java, 108, 110
4
/**
* Sets the flag that determines whether the category labels are drawn 'vertically'.
* @param flag The new value of the flag;
*/
3
public void setVerticalCategoryLabels(boolean flag) {
this.verticalCategoryLabels = flag;
this.notifyListeners(new com.jrefinery.chart.event.AxisChangeEvent(this));
###
3086, isCompatiblePlot, HorizontalCategoryAxis, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/HorizontalCategoryAxis.java, 276, 278
4
/**
* Returns true if the specified plot is compatible with the axis, and false otherwise.
* @param plot The plot;
*/
3
protected boolean isCompatiblePlot(Plot plot) {
if (plot instanceof CategoryPlot) return true;
else return false;
###
3087, createDateTime, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 1193, 1195
3
/**
* Returns a java.util.Date for the specified year, month, day, hour and minute.
*/
3
private Date createDateTime(int year, int month, int day, int hour, int minute) {
GregorianCalendar calendar = new GregorianCalendar(year, month, day, hour, minute);
return calendar.getTime();
###
3088, displayXYPlotZeroData, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 863, 886
3
/**
* Displays an XYPlot in its own frame.
*/
24
private void displayXYPlotZeroData() {
if (xyPlotZeroDataFrame==null) {
// create a default chart based on some sample data...
String title = "XY Plot (zero series)";
String xAxisLabel = "X Axis";
String yAxisLabel = "Y Axis";
XYDataset data = new EmptyXYDataset();
JFreeChart chart = ChartFactory.createXYChart(title, xAxisLabel, yAxisLabel, data, true);
// then customise it a little...
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white, 1000, 0, Color.red));
// and present it in a frame...
xyPlotZeroDataFrame = new JFreeChartFrame("XYPlot", chart);
xyPlotZeroDataFrame.pack();
SwingRefinery.positionFrameRandomly(xyPlotZeroDataFrame);
xyPlotZeroDataFrame.show();
}
else {
xyPlotZeroDataFrame.show();
xyPlotZeroDataFrame.requestFocus();
###
3089, createDate, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 1185, 1187
3
/**
* Returns a java.util.Date for the specified year, month and day.
*/
3
private Date createDate(int year, int month, int day) {
GregorianCalendar calendar = new GregorianCalendar(year, month, day);
return calendar.getTime();
###
3090, displayPieChartTwo, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 798, 823
3
/**
* Displays pie chart two in its own frame.
*/
26
private void displayPieChartTwo() {
if (pieChartTwoFrame==null) {
// create a default chart based on some sample data...
String title = "Pie Chart";
CategoryDataset data = createCategoryDataset();
PieDataset extracted = Datasets.createPieDataset(data, "Category 2");
JFreeChart chart = ChartFactory.createPieChart(title, extracted, true);
// then customise it a little...
chart.setLegend(null);
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white, 0, 1000, Color.orange));
PiePlot pie = (PiePlot)chart.getPlot();
pie.setSectionLabelType(PiePlot.NAME_AND_PERCENT_LABELS);
// and present it in a frame...
pieChartTwoFrame = new JFreeChartFrame("Pie Chart 2", chart);
pieChartTwoFrame.pack();
SwingRefinery.positionFrameRandomly(pieChartTwoFrame);
pieChartTwoFrame.show();
}
else {
pieChartTwoFrame.show();
pieChartTwoFrame.requestFocus();
###
3091, displayLineChart, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 731, 755
3
/**
* Displays a line chart in its own frame.
*/
25
private void displayLineChart() {
if (lineChartFrame==null) {
// create a default chart based on some sample data...
String title = "Line Chart";
String categoryAxisLabel = "Categories";
String valueAxisLabel = "Values";
CategoryDataset data = createCategoryDataset();
JFreeChart chart = ChartFactory.createLineChart(title, categoryAxisLabel, valueAxisLabel,
data, true);
// then customise it a little...
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white,0, 1000, Color.yellow));
// and present it in a frame...
lineChartFrame = new JFreeChartFrame("Line Chart", chart);
lineChartFrame.pack();
SwingRefinery.positionFrameRandomly(lineChartFrame);
lineChartFrame.show();
}
else {
lineChartFrame.show();
lineChartFrame.requestFocus();
###
3092, main, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 1120, 1127
3
/**
* The starting point for the demonstration application.
*/
8
public static void main(String[] args) {
JFreeChartDemo f = new JFreeChartDemo();
f.pack();
SwingRefinery.centerFrameOnScreen(f);
// and show it...
f.show();
###
3093, createSingleSeriesCategoryDataset, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 1173, 1178
3
/**
* Creates and returns a category dataset for the demo charts.
*/
6
public CategoryDataset createSingleSeriesCategoryDataset() {
Number[][] data = new Integer[][]
{ { new Integer(10), new Integer(-4), new Integer(15), new Integer(14) } };
return new DefaultCategoryDataset(data);
###
3095, displayVerticalBarChart, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 492, 515
3
/**
* Displays a vertical bar chart in its own frame.
*/
24
private void displayVerticalBarChart() {
if (verticalBarChartFrame==null) {
CategoryDataset categoryData = createCategoryDataset();
JFreeChart chart = ChartFactory.createVerticalBarChart("Vertical Bar Chart",
"Categories", "Values", categoryData, true);
// then customise it a little...
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white, 1000, 0, Color.red));
Plot plot = chart.getPlot();
HorizontalCategoryAxis hAxis = (HorizontalCategoryAxis)plot.getAxis(Plot.HORIZONTAL_AXIS);
hAxis.setVerticalCategoryLabels(true);
// and present it in a panel...
verticalBarChartFrame = new JFreeChartFrame("Vertical Bar Chart", chart);
verticalBarChartFrame.pack();
SwingRefinery.positionFrameRandomly(verticalBarChartFrame);
verticalBarChartFrame.show();
}
else {
verticalBarChartFrame.show();
verticalBarChartFrame.requestFocus();
###
3096, displayScatterPlot, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 894, 918
3
/**
* Displays a scatter plot in its own frame.
*/
25
private void displayScatterPlot() {
if (scatterPlotFrame==null) {
// create a default chart based on some sample data...
String title = "Scatter Plot";
String xAxisLabel = "X Axis";
String yAxisLabel = "Y Axis";
XYDataset scatterData = new SampleXYDataset2();
JFreeChart chart = ChartFactory.createScatterPlot(title, xAxisLabel,
yAxisLabel, scatterData, true);
// then customise it a little...
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white, 1000, 0, Color.green));
// and present it in a frame...
scatterPlotFrame = new JFreeChartFrame("XYPlot", chart);
scatterPlotFrame.pack();
SwingRefinery.positionFrameRandomly(scatterPlotFrame);
scatterPlotFrame.show();
}
else {
scatterPlotFrame.show();
scatterPlotFrame.requestFocus();
###
3097, displayVerticalStacked3DBarChart, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 559, 588
3
/**
* Displays a vertical bar chart in its own frame.
*/
30
private void displayVerticalStacked3DBarChart() {
if (verticalStacked3DBarChartFrame==null) {
// create a default chart based on some sample data...
String title = "Vertical Stacked 3D Bar Chart";
String categoryAxisLabel = "Categories";
String valueAxisLabel = "Values";
CategoryDataset categoryData = createCategoryDataset();
JFreeChart chart = ChartFactory.createStackedVerticalBarChart3D(title, categoryAxisLabel,
valueAxisLabel, categoryData, true);
// then customise it a little...
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white, 1000, 0, Color.red));
Plot plot = chart.getPlot();
VerticalNumberAxis valueAxis = (VerticalNumberAxis)plot.getAxis(Plot.VERTICAL_AXIS);
//valueAxis.setAutoRange(false);
valueAxis.setMinimumAxisValue(new Double(-32.0));
valueAxis.setMaximumAxisValue(new Double(85.0));
// and present it in a panel...
verticalStacked3DBarChartFrame = new JFreeChartFrame("Vertical Stacked 3D Bar Chart", chart);
verticalStacked3DBarChartFrame.pack();
SwingRefinery.positionFrameRandomly(verticalStacked3DBarChartFrame);
verticalStacked3DBarChartFrame.show();
}
else {
verticalStacked3DBarChartFrame.show();
verticalStacked3DBarChartFrame.requestFocus();
###
3098, createTabbedPane, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 174, 343
3
/**
* Creates a tabbed pane containing descriptions of the demo charts.
*/
170
private JTabbedPane createTabbedPane() {
JTabbedPane tabs = new JTabbedPane();
Font font = new Font("Dialog", Font.PLAIN, 12);
JPanel barPanel = new JPanel(new LCBLayout(20));
barPanel.setPreferredSize(new Dimension(360, 20));
barPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
JPanel piePanel = new JPanel(new LCBLayout(20));
piePanel.setPreferredSize(new Dimension(360, 20));
piePanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
JPanel xyPanel = new JPanel(new LCBLayout(20));
xyPanel.setPreferredSize(new Dimension(360, 20));
xyPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
JPanel timeSeriesPanel = new JPanel(new LCBLayout(20));
timeSeriesPanel.setPreferredSize(new Dimension(360, 20));
timeSeriesPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
JPanel otherPanel = new JPanel(new LCBLayout(20));
otherPanel.setPreferredSize(new Dimension(360, 20));
otherPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
JPanel testPanel = new JPanel(new LCBLayout(20));
testPanel.setPreferredSize(new Dimension(360, 20));
testPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
barPanel.add(SwingRefinery.createJLabel("Horizontal Bar Chart: ", font));
barPanel.add(new DescriptionPanel(new JTextArea("Displays horizontal bars, representing data from a CategoryDataset.")));
JButton b1 = SwingRefinery.createJButton("Display", font);
b1.setActionCommand("HORIZONTAL_BAR_CHART");
b1.addActionListener(this);
barPanel.add(b1);
barPanel.add(SwingRefinery.createJLabel("Horizontal Stacked Bar Chart: ", font));
barPanel.add(new DescriptionPanel(new JTextArea("Displays stacked horizontal bars, representing data from a CategoryDataset.")));
JButton b2 = SwingRefinery.createJButton("Display", font);
b2.setActionCommand("HORIZONTAL_STACKED_BAR_CHART");
b2.addActionListener(this);
barPanel.add(b2);
barPanel.add(SwingRefinery.createJLabel("Vertical Bar Chart: ", font));
barPanel.add(new DescriptionPanel(new JTextArea("Displays vertical bars, representing data from a CategoryDataset.")));
JButton b3 = SwingRefinery.createJButton("Display", font);
b3.setActionCommand("VERTICAL_BAR_CHART");
b3.addActionListener(this);
barPanel.add(b3);
barPanel.add(SwingRefinery.createJLabel("Vertical 3D Bar Chart: ", font));
barPanel.add(new DescriptionPanel(new JTextArea("Displays stacked vertical bars with a 3D effect, representing data from a CategoryDataset.")));
JButton b6 = SwingRefinery.createJButton("Display", font);
b6.setActionCommand("VERTICAL_3D_BAR_CHART");
b6.addActionListener(this);
barPanel.add(b6);
barPanel.add(SwingRefinery.createJLabel("Vertical Stacked Bar Chart: ", font));
barPanel.add(new DescriptionPanel(new JTextArea("Displays stacked vertical bars, representing data from a CategoryDataset.")));
JButton b4 = SwingRefinery.createJButton("Display", font);
b4.setActionCommand("VERTICAL_STACKED_BAR_CHART");
b4.addActionListener(this);
barPanel.add(b4);
barPanel.add(SwingRefinery.createJLabel("Vertical Stacked 3D Bar Chart: ", font));
barPanel.add(new DescriptionPanel(new JTextArea("Displays stacked vertical bars with a 3D effect, representing data from a CategoryDataset.")));
JButton b5 = SwingRefinery.createJButton("Display", font);
b5.setActionCommand("VERTICAL_STACKED_3D_BAR_CHART");
b5.addActionListener(this);
barPanel.add(b5);
otherPanel.add(SwingRefinery.createJLabel("Line Chart: ", font));
otherPanel.add(new DescriptionPanel(new JTextArea("A chart displaying lines and or shapes, representing data in a CategoryDataset.")));
JButton b8 = SwingRefinery.createJButton("Display", font);
b8.setActionCommand("LINE_CHART");
b8.addActionListener(this);
otherPanel.add(b8);
piePanel.add(SwingRefinery.createJLabel("Pie Chart: ", font));
piePanel.add(new DescriptionPanel(new JTextArea("A pie chart showing one section exploded.")));
JButton b9 = SwingRefinery.createJButton("Display", font);
b9.setActionCommand("PIE_CHART_1");
b9.addActionListener(this);
piePanel.add(b9);
piePanel.add(SwingRefinery.createJLabel("Pie Chart 2: ", font));
piePanel.add(new DescriptionPanel(new JTextArea("A pie chart showing percentage labels.")));
JButton b10 = SwingRefinery.createJButton("Display", font);
b10.setActionCommand("PIE_CHART_2");
b10.addActionListener(this);
piePanel.add(b10);
otherPanel.add(SwingRefinery.createJLabel("Scatter Plot: ", font));
otherPanel.add(new DescriptionPanel(new JTextArea("A scatter plot, based on data from an XYDataset.")));
JButton b11 = SwingRefinery.createJButton("Display", font);
b11.setActionCommand("SCATTER_PLOT");
b11.addActionListener(this);
otherPanel.add(b11);
xyPanel.add(SwingRefinery.createJLabel("XY Plot: ", font));
xyPanel.add(new DescriptionPanel(new JTextArea("A line chart, based on data from an XYDataset.")));
JButton b12 = SwingRefinery.createJButton("Display", font);
b12.setActionCommand("XY_PLOT");
b12.addActionListener(this);
xyPanel.add(b12);
testPanel.add(SwingRefinery.createJLabel("Null Data: ", font));
testPanel.add(new DescriptionPanel(new JTextArea("A chart with a null dataset.")));
JButton b13 = SwingRefinery.createJButton("Display", font);
b13.setActionCommand("XY_PLOT_NULL");
b13.addActionListener(this);
testPanel.add(b13);
testPanel.add(SwingRefinery.createJLabel("Zero Data: ", font));
testPanel.add(new DescriptionPanel(new JTextArea("A chart with a dataset containing zero series..")));
JButton b14 = SwingRefinery.createJButton("Display", font);
b14.setActionCommand("XY_PLOT_ZERO");
b14.addActionListener(this);
testPanel.add(b14);
timeSeriesPanel.add(SwingRefinery.createJLabel("Time Series Chart: ", font));
timeSeriesPanel.add(new DescriptionPanel(new JTextArea("A time series chart, based on data from an XYDataset.")));
JButton b15 = SwingRefinery.createJButton("Display", font);
b15.setActionCommand("TIME_SERIES_CHART");
b15.addActionListener(this);
timeSeriesPanel.add(b15);
timeSeriesPanel.add(SwingRefinery.createJLabel("Time Series 2: ", font));
timeSeriesPanel.add(new DescriptionPanel(new JTextArea("A time series chart with a moving average, based on data from an XYDataset.")));
JButton b16 = SwingRefinery.createJButton("Display", font);
b16.setActionCommand("TIME_SERIES_WITH_MA_CHART");
b16.addActionListener(this);
timeSeriesPanel.add(b16);
testPanel.add(SwingRefinery.createJLabel("Chart in JScrollPane: ", font));
testPanel.add(new DescriptionPanel(new JTextArea("A chart embedded in a JScrollPane.")));
JButton b18 = SwingRefinery.createJButton("Display", font);
b18.setActionCommand("TIME_SERIES_CHART_SCROLL");
b18.addActionListener(this);
testPanel.add(b18);
timeSeriesPanel.add(SwingRefinery.createJLabel("High/Low/Open/Close Chart: ", font));
timeSeriesPanel.add(new DescriptionPanel(new JTextArea("A high/low/open/close chart based on data in HighLowDataset.")));
JButton b19 = SwingRefinery.createJButton("Display", font);
b19.setActionCommand("HIGH_LOW_CHART");
b19.addActionListener(this);
timeSeriesPanel.add(b19);
otherPanel.add(SwingRefinery.createJLabel("Vertical XY Bar Chart: ", font));
otherPanel.add(new DescriptionPanel(new JTextArea("A chart showing vertical bars, based on data in an IntervalXYDataset.")));
JButton b7 = SwingRefinery.createJButton("Display", font);
b7.setActionCommand("VERTICAL_XY_BAR_CHART");
b7.addActionListener(this);
otherPanel.add(b7);
testPanel.add(SwingRefinery.createJLabel("Dynamic Chart: ", font));
testPanel.add(new DescriptionPanel(new JTextArea("A dynamic chart, to test the event notification mechanism.")));
JButton b20 = SwingRefinery.createJButton("Display", font);
b20.setActionCommand("DYNAMIC_CHART");
b20.addActionListener(this);
testPanel.add(b20);
tabs.add("Bar Charts", new JScrollPane(barPanel));
tabs.add("Pie Charts", new JScrollPane(piePanel));
tabs.add("XY Charts", new JScrollPane(xyPanel));
tabs.add("Time Series Charts", new JScrollPane(timeSeriesPanel));
tabs.add("Other Charts", new JScrollPane(otherPanel));
tabs.add("Test Charts", new JScrollPane(testPanel));
return tabs;
###
3099, displayNullXYPlot, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 926, 949
3
/**
* Displays a vertical bar chart in its own frame.
*/
24
private void displayNullXYPlot() {
if (this.xyPlotNullDataFrame==null) {
// create a default chart based on some sample data...
String title = "XY Plot (null data)";
String xAxisLabel = "X Axis";
String yAxisLabel = "Y Axis";
XYDataset data = null;
JFreeChart chart = ChartFactory.createXYChart(title, xAxisLabel, yAxisLabel, data, true);
// then customise it a little...
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white, 1000, 0, Color.red));
// and present it in a panel...
xyPlotNullDataFrame = new JFreeChartFrame("XY Plot with NULL data", chart);
xyPlotNullDataFrame.pack();
SwingRefinery.positionFrameRandomly(xyPlotNullDataFrame);
xyPlotNullDataFrame.show();
}
else {
xyPlotNullDataFrame.show();
xyPlotNullDataFrame.requestFocus();
###
3100, displayTimeSeriesChart, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 957, 984
3
/**
* Displays a vertical bar chart in its own frame.
*/
28
private void displayTimeSeriesChart() {
if (this.timeSeriesChartFrame==null) {
// create a default chart based on some sample data...
String title = "Time Series Chart";
String xAxisLabel = "Date";
String yAxisLabel = "USD per GBP";
XYDataset data = createXYDataset();
JFreeChart chart = ChartFactory.createTimeSeriesChart(title, xAxisLabel, yAxisLabel, data,
true);
// then customise it a little...
TextTitle subtitle = new TextTitle("Value of GBP", new Font("Arial", Font.BOLD, 12));
chart.addTitle(subtitle);
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white,0, 1000, Color.blue));
Plot plot = chart.getPlot();
// and present it in a frame...
timeSeriesChartFrame = new JFreeChartFrame("Time Series Chart", chart);
timeSeriesChartFrame.pack();
SwingRefinery.positionFrameRandomly(timeSeriesChartFrame);
timeSeriesChartFrame.show();
}
else {
timeSeriesChartFrame.show();
timeSeriesChartFrame.requestFocus();
###
3101, createCategoryDataset, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 1133, 1146
3
/**
* Creates and returns a category dataset for the demo charts.
*/
14
public CategoryDataset createCategoryDataset() {
Number[][] data = new Integer[][]
{ { new Integer(10), new Integer(4), new Integer(15), new Integer(14) },
{ new Integer(-5), new Integer(-7), new Integer(14), new Integer(-3) },
{ new Integer(6), new Integer(17), new Integer(-12), new Integer(7) },
{ new Integer(7), new Integer(15), new Integer(11), new Integer(0) },
{ new Integer(-8), new Integer(-6), new Integer(10), new Integer(-9) },
{ new Integer(9), new Integer(8), null, new Integer(6) },
{ new Integer(-10), new Integer(9), new Integer(7), new Integer(7) },
{ new Integer(11), new Integer(13), new Integer(9), new Integer(9) },
{ new Integer(-3), new Integer(7), new Integer(11), new Integer(-10) } };
return new DefaultCategoryDataset(data);
###
3103, displayDynamicXYChart, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 472, 484
4
/**
* Displays an XY chart that is periodically updated by a background thread. This is to
* demonstrate the event notification system that automatically updates charts as required.
*/
13
private void displayDynamicXYChart() {
if (dynamicXYChartFrame==null) {
SampleXYDataset data = new SampleXYDataset();
JFreeChart chart = ChartFactory.createXYChart("Dynamic XY Chart", "X", "Y", data, true);
SampleXYDatasetThread update = new SampleXYDatasetThread(data);
dynamicXYChartFrame = new JFreeChartFrame("Dynamic Chart", chart);
dynamicXYChartFrame.pack();
SwingRefinery.positionFrameRandomly(dynamicXYChartFrame);
dynamicXYChartFrame.show();
Thread thread = new Thread(update);
thread.start();
###
3104, createHighLowDataset, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 1563, 1802
3
/**
* Creates and returns a sample high-low dataset for the demo. Added by Andrzej Porebski.
*/
240
public XYDataset createHighLowDataset() {
Object[][][] data = new Object[][][] { {
{ createDate(1999, Calendar.JANUARY,4), new Double(47) },
{ createDate(1999, Calendar.JANUARY,4), new Double(33) },
{ createDate(1999, Calendar.JANUARY,4), new Double(35) },
{ createDate(1999, Calendar.JANUARY,4), new Double(33) },
{ createDate(1999, Calendar.JANUARY,5), new Double(47) },
{ createDate(1999, Calendar.JANUARY,5), new Double(32) },
{ createDate(1999, Calendar.JANUARY,5), new Double(41) },
{ createDate(1999, Calendar.JANUARY,5), new Double(37) },
{ createDate(1999, Calendar.JANUARY,6), new Double(49) },
{ createDate(1999, Calendar.JANUARY,6), new Double(43) },
{ createDate(1999, Calendar.JANUARY,6), new Double(46) },
{ createDate(1999, Calendar.JANUARY,6), new Double(48) },
{ createDate(1999, Calendar.JANUARY,7), new Double(51) },
{ createDate(1999, Calendar.JANUARY,7), new Double(39) },
{ createDate(1999, Calendar.JANUARY,7), new Double(40) },
{ createDate(1999, Calendar.JANUARY,7), new Double(47) },
{ createDate(1999, Calendar.JANUARY,8), new Double(60) },
{ createDate(1999, Calendar.JANUARY,8), new Double(40) },
{ createDate(1999, Calendar.JANUARY,8), new Double(46) },
{ createDate(1999, Calendar.JANUARY,8), new Double(53) },
{ createDate(1999, Calendar.JANUARY,9), new Double(62) },
{ createDate(1999, Calendar.JANUARY,9), new Double(55) },
{ createDate(1999, Calendar.JANUARY,9), new Double(57) },
{ createDate(1999, Calendar.JANUARY,9), new Double(61) },
{ createDate(1999, Calendar.JANUARY,10), new Double(65) },
{ createDate(1999, Calendar.JANUARY,10), new Double(56) },
{ createDate(1999, Calendar.JANUARY,10), new Double(62) },
{ createDate(1999, Calendar.JANUARY,10), new Double(59) },
{ createDate(1999, Calendar.JANUARY,11), new Double(55) },
{ createDate(1999, Calendar.JANUARY,11), new Double(43) },
{ createDate(1999, Calendar.JANUARY,11), new Double(45) },
{ createDate(1999, Calendar.JANUARY,11), new Double(47) },
{ createDate(1999, Calendar.JANUARY,12), new Double(54) },
{ createDate(1999, Calendar.JANUARY,12), new Double(33) },
{ createDate(1999, Calendar.JANUARY,12), new Double(40) },
{ createDate(1999, Calendar.JANUARY,12), new Double(51) },
{ createDate(1999, Calendar.JANUARY,13), new Double(58) },
{ createDate(1999, Calendar.JANUARY,13), new Double(42) },
{ createDate(1999, Calendar.JANUARY,13), new Double(44) },
{ createDate(1999, Calendar.JANUARY,13), new Double(57) },
{ createDate(1999, Calendar.JANUARY,14), new Double(54) },
{ createDate(1999, Calendar.JANUARY,14), new Double(38) },
{ createDate(1999, Calendar.JANUARY,14), new Double(43) },
{ createDate(1999, Calendar.JANUARY,14), new Double(52) },
{ createDate(1999, Calendar.JANUARY,15), new Double(48) },
{ createDate(1999, Calendar.JANUARY,15), new Double(41) },
{ createDate(1999, Calendar.JANUARY,15), new Double(44) },
{ createDate(1999, Calendar.JANUARY,15), new Double(41) },
{ createDate(1999, Calendar.JANUARY,17), new Double(60) },
{ createDate(1999, Calendar.JANUARY,17), new Double(30) },
{ createDate(1999, Calendar.JANUARY,17), new Double(34) },
{ createDate(1999, Calendar.JANUARY,17), new Double(44) },
{ createDate(1999, Calendar.JANUARY,18), new Double(58) },
{ createDate(1999, Calendar.JANUARY,18), new Double(44) },
{ createDate(1999, Calendar.JANUARY,18), new Double(54) },
{ createDate(1999, Calendar.JANUARY,18), new Double(56) },
{ createDate(1999, Calendar.JANUARY,19), new Double(54) },
{ createDate(1999, Calendar.JANUARY,19), new Double(32) },
{ createDate(1999, Calendar.JANUARY,19), new Double(42) },
{ createDate(1999, Calendar.JANUARY,19), new Double(53) },
{ createDate(1999, Calendar.JANUARY,20), new Double(53) },
{ createDate(1999, Calendar.JANUARY,20), new Double(39) },
{ createDate(1999, Calendar.JANUARY,20), new Double(50) },
{ createDate(1999, Calendar.JANUARY,20), new Double(49) },
{ createDate(1999, Calendar.JANUARY,21), new Double(47) },
{ createDate(1999, Calendar.JANUARY,21), new Double(38) },
{ createDate(1999, Calendar.JANUARY,21), new Double(41) },
{ createDate(1999, Calendar.JANUARY,21), new Double(40) },
{ createDate(1999, Calendar.JANUARY,22), new Double(55) },
{ createDate(1999, Calendar.JANUARY,22), new Double(37) },
{ createDate(1999, Calendar.JANUARY,22), new Double(43) },
{ createDate(1999, Calendar.JANUARY,22), new Double(45) },
{ createDate(1999, Calendar.JANUARY,23), new Double(54) },
{ createDate(1999, Calendar.JANUARY,23), new Double(42) },
{ createDate(1999, Calendar.JANUARY,23), new Double(50) },
{ createDate(1999, Calendar.JANUARY,23), new Double(42) },
{ createDate(1999, Calendar.JANUARY,24), new Double(48) },
{ createDate(1999, Calendar.JANUARY,24), new Double(37) },
{ createDate(1999, Calendar.JANUARY,24), new Double(37) },
{ createDate(1999, Calendar.JANUARY,24), new Double(47) },
{ createDate(1999, Calendar.JANUARY,25), new Double(58) },
{ createDate(1999, Calendar.JANUARY,25), new Double(33) },
{ createDate(1999, Calendar.JANUARY,25), new Double(39) },
{ createDate(1999, Calendar.JANUARY,25), new Double(41) },
{ createDate(1999, Calendar.JANUARY,26), new Double(47) },
{ createDate(1999, Calendar.JANUARY,26), new Double(31) },
{ createDate(1999, Calendar.JANUARY,26), new Double(36) },
{ createDate(1999, Calendar.JANUARY,26), new Double(41) },
{ createDate(1999, Calendar.JANUARY,27), new Double(58) },
{ createDate(1999, Calendar.JANUARY,27), new Double(44) },
{ createDate(1999, Calendar.JANUARY,27), new Double(49) },
{ createDate(1999, Calendar.JANUARY,27), new Double(44) },
{ createDate(1999, Calendar.JANUARY,28), new Double(46) },
{ createDate(1999, Calendar.JANUARY,28), new Double(41) },
{ createDate(1999, Calendar.JANUARY,28), new Double(43) },
{ createDate(1999, Calendar.JANUARY,28), new Double(44) },
{ createDate(1999, Calendar.JANUARY,29), new Double(56) },
{ createDate(1999, Calendar.JANUARY,29), new Double(39) },
{ createDate(1999, Calendar.JANUARY,29), new Double(39) },
{ createDate(1999, Calendar.JANUARY,29), new Double(51) },
{ createDate(1999, Calendar.JANUARY,30), new Double(56) },
{ createDate(1999, Calendar.JANUARY,30), new Double(39) },
{ createDate(1999, Calendar.JANUARY,30), new Double(47) },
{ createDate(1999, Calendar.JANUARY,30), new Double(49) },
{ createDate(1999, Calendar.JANUARY,31), new Double(53) },
{ createDate(1999, Calendar.JANUARY,31), new Double(39) },
{ createDate(1999, Calendar.JANUARY,31), new Double(52) },
{ createDate(1999, Calendar.JANUARY,31), new Double(47) },
{ createDate(1999, Calendar.FEBRUARY,1), new Double(51) },
{ createDate(1999, Calendar.FEBRUARY,1), new Double(30) },
{ createDate(1999, Calendar.FEBRUARY,1), new Double(45) },
{ createDate(1999, Calendar.FEBRUARY,1), new Double(47) },
{ createDate(1999, Calendar.FEBRUARY,2), new Double(47) },
{ createDate(1999, Calendar.FEBRUARY,2), new Double(30) },
{ createDate(1999, Calendar.FEBRUARY,2), new Double(34) },
{ createDate(1999, Calendar.FEBRUARY,2), new Double(46) },
{ createDate(1999, Calendar.FEBRUARY,3), new Double(57) },
{ createDate(1999, Calendar.FEBRUARY,3), new Double(37) },
{ createDate(1999, Calendar.FEBRUARY,3), new Double(44) },
{ createDate(1999, Calendar.FEBRUARY,3), new Double(56) },
{ createDate(1999, Calendar.FEBRUARY,4), new Double(49) },
{ createDate(1999, Calendar.FEBRUARY,4), new Double(40) },
{ createDate(1999, Calendar.FEBRUARY,4), new Double(47) },
{ createDate(1999, Calendar.FEBRUARY,4), new Double(44) },
{ createDate(1999, Calendar.FEBRUARY,5), new Double(46) },
{ createDate(1999, Calendar.FEBRUARY,5), new Double(38) },
{ createDate(1999, Calendar.FEBRUARY,5), new Double(43) },
{ createDate(1999, Calendar.FEBRUARY,5), new Double(40) },
{ createDate(1999, Calendar.FEBRUARY,6), new Double(55) },
{ createDate(1999, Calendar.FEBRUARY,6), new Double(38) },
{ createDate(1999, Calendar.FEBRUARY,6), new Double(39) },
{ createDate(1999, Calendar.FEBRUARY,6), new Double(53) },
{ createDate(1999, Calendar.FEBRUARY,7), new Double(50) },
{ createDate(1999, Calendar.FEBRUARY,7), new Double(33) },
{ createDate(1999, Calendar.FEBRUARY,7), new Double(37) },
{ createDate(1999, Calendar.FEBRUARY,7), new Double(37) },
{ createDate(1999, Calendar.FEBRUARY,8), new Double(59) },
{ createDate(1999, Calendar.FEBRUARY,8), new Double(34) },
{ createDate(1999, Calendar.FEBRUARY,8), new Double(57) },
{ createDate(1999, Calendar.FEBRUARY,8), new Double(43) },
{ createDate(1999, Calendar.FEBRUARY,9), new Double(48) },
{ createDate(1999, Calendar.FEBRUARY,9), new Double(39) },
{ createDate(1999, Calendar.FEBRUARY,9), new Double(46) },
{ createDate(1999, Calendar.FEBRUARY,9), new Double(47) },
{ createDate(1999, Calendar.FEBRUARY,10), new Double(55) },
{ createDate(1999, Calendar.FEBRUARY,10), new Double(30) },
{ createDate(1999, Calendar.FEBRUARY,10), new Double(37) },
{ createDate(1999, Calendar.FEBRUARY,10), new Double(30) },
{ createDate(1999, Calendar.FEBRUARY,11), new Double(60) },
{ createDate(1999, Calendar.FEBRUARY,11), new Double(32) },
{ createDate(1999, Calendar.FEBRUARY,11), new Double(56) },
{ createDate(1999, Calendar.FEBRUARY,11), new Double(36) },
{ createDate(1999, Calendar.FEBRUARY,12), new Double(56) },
{ createDate(1999, Calendar.FEBRUARY,12), new Double(42) },
{ createDate(1999, Calendar.FEBRUARY,12), new Double(53) },
{ createDate(1999, Calendar.FEBRUARY,12), new Double(54) },
{ createDate(1999, Calendar.FEBRUARY,13), new Double(49) },
{ createDate(1999, Calendar.FEBRUARY,13), new Double(42) },
{ createDate(1999, Calendar.FEBRUARY,13), new Double(45) },
{ createDate(1999, Calendar.FEBRUARY,13), new Double(42) },
{ createDate(1999, Calendar.FEBRUARY,14), new Double(55) },
{ createDate(1999, Calendar.FEBRUARY,14), new Double(42) },
{ createDate(1999, Calendar.FEBRUARY,14), new Double(47) },
{ createDate(1999, Calendar.FEBRUARY,14), new Double(54) },
{ createDate(1999, Calendar.FEBRUARY,15), new Double(49) },
{ createDate(1999, Calendar.FEBRUARY,15), new Double(35) },
{ createDate(1999, Calendar.FEBRUARY,15), new Double(38) },
{ createDate(1999, Calendar.FEBRUARY,15), new Double(35) },
{ createDate(1999, Calendar.FEBRUARY,16), new Double(47) },
{ createDate(1999, Calendar.FEBRUARY,16), new Double(38) },
{ createDate(1999, Calendar.FEBRUARY,16), new Double(43) },
{ createDate(1999, Calendar.FEBRUARY,16), new Double(42) },
{ createDate(1999, Calendar.FEBRUARY,17), new Double(53) },
{ createDate(1999, Calendar.FEBRUARY,17), new Double(42) },
{ createDate(1999, Calendar.FEBRUARY,17), new Double(47) },
{ createDate(1999, Calendar.FEBRUARY,17), new Double(48) },
{ createDate(1999, Calendar.FEBRUARY,18), new Double(47) },
{ createDate(1999, Calendar.FEBRUARY,18), new Double(44) },
{ createDate(1999, Calendar.FEBRUARY,18), new Double(46) },
{ createDate(1999, Calendar.FEBRUARY,18), new Double(44) },
{ createDate(1999, Calendar.FEBRUARY,19), new Double(46) },
{ createDate(1999, Calendar.FEBRUARY,19), new Double(40) },
{ createDate(1999, Calendar.FEBRUARY,19), new Double(43) },
{ createDate(1999, Calendar.FEBRUARY,19), new Double(44) },
{ createDate(1999, Calendar.FEBRUARY,20), new Double(48) },
{ createDate(1999, Calendar.FEBRUARY,20), new Double(41) },
{ createDate(1999, Calendar.FEBRUARY,20), new Double(46) },
{ createDate(1999, Calendar.FEBRUARY,20), new Double(41) } }
};
return new DefaultXYDataset(new String[] { "IBM" }, data);
###
3105, displayHighLowChart, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 1031, 1058
3
/**
* Displays a vertical bar chart in its own frame.
*/
28
private void displayHighLowChart() {
if (this.highLowChartFrame==null) {
// create a default chart based on some sample data...
String title = "High-Low/Open-Close Chart";
String timeAxisLabel = "Date";
String valueAxisLabel = "Price ($ per share)";
HighLowDataset data = new SampleHighLowDataset();
JFreeChart chart = ChartFactory.createHighLowChart(title, timeAxisLabel, valueAxisLabel,
data, true);
// then customise it a little...
TextTitle subtitle = new TextTitle("IBM Stock Price", new Font("Arial", Font.BOLD, 12));
chart.addTitle(subtitle);
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white, 0, 1000, Color.magenta));
// and present it in a frame...
highLowChartFrame = new JFreeChartFrame("High/Low/Open/Close Chart", chart);
highLowChartFrame.pack();
SwingRefinery.positionFrameRandomly(highLowChartFrame);
highLowChartFrame.show();
}
else {
highLowChartFrame.show();
highLowChartFrame.requestFocus();
###
3106, displayVerticalXYBarChart, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 596, 621
3
/**
* Displays a vertical bar chart in its own frame.
*/
26
private void displayVerticalXYBarChart() {
if (verticalXYBarChartFrame==null) {
// create a default chart based on some sample data...
String title = "Time Series Bar Chart";
String xAxisLabel = "X Axis";
String yAxisLabel = "Y Axis";
TimeSeriesCollection data = createTestTimeSeriesCollection1();
JFreeChart chart = ChartFactory.createVerticalXYBarChart(title, xAxisLabel, yAxisLabel,
data, true);
// then customise it a little...
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white, 1000, 0, Color.blue));
// and present it in a panel...
verticalXYBarChartFrame = new JFreeChartFrame("Vertical XY Bar Chart", chart);
verticalXYBarChartFrame.pack();
SwingRefinery.positionFrameRandomly(verticalXYBarChartFrame);
verticalXYBarChartFrame.show();
}
else {
verticalXYBarChartFrame.show();
verticalXYBarChartFrame.requestFocus();
###
3107, attemptExit, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 458, 464
3
/**
* Exits the application, but only if the user agrees.
*/
7
private void attemptExit() {
int result = JOptionPane.showConfirmDialog(this,
"Are you sure you want to exit?", "Confirmation...",
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (result==JOptionPane.YES_OPTION) {
dispose();
System.exit(0);
###
3108, displayVerticalStackedBarChart, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 523, 551
3
/**
* Displays a vertical bar chart in its own frame.
*/
29
private void displayVerticalStackedBarChart() {
if (verticalStackedBarChartFrame==null) {
// create a default chart based on some sample data...
String title = "Vertical Stacked Bar Chart";
String categoryAxisLabel = "Categories";
String valueAxisLabel = "Values";
CategoryDataset categoryData = createCategoryDataset();
JFreeChart chart = ChartFactory.createStackedVerticalBarChart(title, categoryAxisLabel,
valueAxisLabel, categoryData, true);
// then customise it a little...
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white, 1000, 0, Color.red));
Plot plot = chart.getPlot();
VerticalNumberAxis valueAxis = (VerticalNumberAxis)plot.getAxis(Plot.VERTICAL_AXIS);
valueAxis.setMinimumAxisValue(new Double(-32.0));
valueAxis.setMaximumAxisValue(new Double(85.0));
// and present it in a panel...
verticalStackedBarChartFrame = new JFreeChartFrame("Vertical Stacked Bar Chart", chart);
verticalStackedBarChartFrame.pack();
SwingRefinery.positionFrameRandomly(verticalStackedBarChartFrame);
verticalStackedBarChartFrame.show();
}
else {
verticalStackedBarChartFrame.show();
verticalStackedBarChartFrame.requestFocus();
###
3109, actionPerformed, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 352, 415
3
/**
* Handles menu selections by passing control to an appropriate method.
*/
64
public void actionPerformed(ActionEvent event) {
String command = event.getActionCommand();
if (command.equals("exitItem")) {
attemptExit();
}
else if (command.equals("DYNAMIC_CHART")) {
displayDynamicXYChart();
}
else if (command.equals("aboutItem")) {
about();
}
else if (command.equals("VERTICAL_BAR_CHART")) {
displayVerticalBarChart();
}
else if (command.equals("VERTICAL_STACKED_BAR_CHART")) {
displayVerticalStackedBarChart();
}
else if (command.equals("VERTICAL_XY_BAR_CHART")) {
displayVerticalXYBarChart();
}
else if (command.equals("VERTICAL_3D_BAR_CHART")) {
displayVertical3DBarChart();
}
else if (command.equals("VERTICAL_STACKED_3D_BAR_CHART")) {
displayVerticalStacked3DBarChart();
}
else if (command.equals("HORIZONTAL_BAR_CHART")) {
displayHorizontalBarChart();
}
else if (command.equals("HORIZONTAL_STACKED_BAR_CHART")) {
displayHorizontalStackedBarChart();
}
else if (command.equals("LINE_CHART")) {
displayLineChart();
}
else if (command.equals("PIE_CHART_1")) {
displayPieChartOne();
}
else if (command.equals("PIE_CHART_2")) {
displayPieChartTwo();
}
else if (command.equals("XY_PLOT")) {
displayXYPlot();
}
else if (command.equals("SCATTER_PLOT")) {
displayScatterPlot();
}
else if (command.equals("TIME_SERIES_CHART")) {
displayTimeSeriesChart();
}
else if (command.equals("TIME_SERIES_WITH_MA_CHART")) {
displayTimeSeriesWithMAChart();
}
else if (command.equals("TIME_SERIES_CHART_SCROLL")) {
displayTimeSeriesChartInScrollPane();
}
else if (command.equals("HIGH_LOW_CHART")) {
displayHighLowChart();
}
else if (command.equals("XY_PLOT_NULL")) {
displayNullXYPlot();
}
else if (command.equals("XY_PLOT_ZERO")) {
displayXYPlotZeroData();
###
3112, createXYDataset, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 1201, 1512
3
/**
* Creates and returns a XYDataset for the demo charts.
*/
312
public XYDataset createXYDataset() {
GregorianCalendar calendar = new GregorianCalendar(1999, Calendar.JANUARY, 4);
Object[][][] data = new Object[][][] { {
{ createDate(1999, Calendar.JANUARY,4), new Double(1.6581) },
{ createDate(1999, Calendar.JANUARY,5), new Double(1.6566) },
{ createDate(1999, Calendar.JANUARY,6), new Double(1.6547) },
{ createDate(1999, Calendar.JANUARY,7), new Double(1.6495) },
{ createDate(1999, Calendar.JANUARY,8), new Double(1.6405) },
{ createDate(1999, Calendar.JANUARY,11), new Double(1.6375) },
{ createDate(1999, Calendar.JANUARY,12), new Double(1.6308) },
{ createDate(1999, Calendar.JANUARY,13), new Double(1.6493) },
{ createDate(1999, Calendar.JANUARY,14), new Double(1.6530) },
{ createDate(1999, Calendar.JANUARY,15), new Double(1.6500) },
{ createDate(1999, Calendar.JANUARY,19), new Double(1.6550) },
{ createDate(1999, Calendar.JANUARY,20), new Double(1.6467) },
{ createDate(1999, Calendar.JANUARY,21), new Double(1.6516) },
{ createDate(1999, Calendar.JANUARY,22), new Double(1.6560) },
{ createDate(1999, Calendar.JANUARY,25), new Double(1.6563) },
{ createDate(1999, Calendar.JANUARY,26), new Double(1.6585) },
{ createDate(1999, Calendar.JANUARY,27), new Double(1.6485) },
{ createDate(1999, Calendar.JANUARY,28), new Double(1.6470) },
{ createDate(1999, Calendar.JANUARY,29), new Double(1.6457) },
{ createDate(1999, Calendar.FEBRUARY,1), new Double(1.6410) },
{ createDate(1999, Calendar.FEBRUARY,2), new Double(1.6430) },
{ createDate(1999, Calendar.FEBRUARY,3), new Double(1.6375) },
{ createDate(1999, Calendar.FEBRUARY,4), new Double(1.6395) },
{ createDate(1999, Calendar.FEBRUARY,5), new Double(1.6370) },
{ createDate(1999, Calendar.FEBRUARY,8), new Double(1.6380) },
{ createDate(1999, Calendar.FEBRUARY,9), new Double(1.6355) },
{ createDate(1999, Calendar.FEBRUARY,10), new Double(1.6290) },
{ createDate(1999, Calendar.FEBRUARY,11), new Double(1.6244) },
{ createDate(1999, Calendar.FEBRUARY,12), new Double(1.6311) },
{ createDate(1999, Calendar.FEBRUARY,16), new Double(1.6317) },
{ createDate(1999, Calendar.FEBRUARY,17), new Double(1.6338) },
{ createDate(1999, Calendar.FEBRUARY,18), new Double(1.6338) },
{ createDate(1999, Calendar.FEBRUARY,19), new Double(1.6255) },
{ createDate(1999, Calendar.FEBRUARY,22), new Double(1.6238) },
{ createDate(1999, Calendar.FEBRUARY,23), new Double(1.6138) },
{ createDate(1999, Calendar.FEBRUARY,24), new Double(1.5980) },
{ createDate(1999, Calendar.FEBRUARY,25), new Double(1.6060) },
{ createDate(1999, Calendar.FEBRUARY,26), new Double(1.6027) },
{ createDate(1999, Calendar.MARCH,1), new Double(1.6058) },
{ createDate(1999, Calendar.MARCH,2), new Double(1.6135) },
{ createDate(1999, Calendar.MARCH,3), new Double(1.6134) },
{ createDate(1999, Calendar.MARCH,4), new Double(1.6065) },
{ createDate(1999, Calendar.MARCH,5), new Double(1.6073) },
{ createDate(1999, Calendar.MARCH,8), new Double(1.6085) },
{ createDate(1999, Calendar.MARCH,9), new Double(1.6148) },
{ createDate(1999, Calendar.MARCH,10), new Double(1.6267) },
{ createDate(1999, Calendar.MARCH,11), new Double(1.6270) },
{ createDate(1999, Calendar.MARCH,12), new Double(1.6335) },
{ createDate(1999, Calendar.MARCH,15), new Double(1.6223) },
{ createDate(1999, Calendar.MARCH,16), new Double(1.6240) },
{ createDate(1999, Calendar.MARCH,17), new Double(1.6302) },
{ createDate(1999, Calendar.MARCH,18), new Double(1.6290) },
{ createDate(1999, Calendar.MARCH,19), new Double(1.6303) },
{ createDate(1999, Calendar.MARCH,22), new Double(1.6280) },
{ createDate(1999, Calendar.MARCH,23), new Double(1.6372) },
{ createDate(1999, Calendar.MARCH,24), new Double(1.6410) },
{ createDate(1999, Calendar.MARCH,25), new Double(1.6314) },
{ createDate(1999, Calendar.MARCH,26), new Double(1.6205) },
{ createDate(1999, Calendar.MARCH,29), new Double(1.6140) },
{ createDate(1999, Calendar.MARCH,30), new Double(1.6115) },
{ createDate(1999, Calendar.MARCH,31), new Double(1.6140) },
{ createDate(1999, Calendar.APRIL,1), new Double(1.6063) },
{ createDate(1999, Calendar.APRIL,2), new Double(1.6023) },
{ createDate(1999, Calendar.APRIL,5), new Double(1.6015) },
{ createDate(1999, Calendar.APRIL,6), new Double(1.5920) },
{ createDate(1999, Calendar.APRIL,7), new Double(1.5975) },
{ createDate(1999, Calendar.APRIL,8), new Double(1.6083) },
{ createDate(1999, Calendar.APRIL,9), new Double(1.6068) },
{ createDate(1999, Calendar.APRIL,12), new Double(1.6127) },
{ createDate(1999, Calendar.APRIL,13), new Double(1.6135) },
{ createDate(1999, Calendar.APRIL,14), new Double(1.6124) },
{ createDate(1999, Calendar.APRIL,15), new Double(1.6103) },
{ createDate(1999, Calendar.APRIL,16), new Double(1.6112) },
{ createDate(1999, Calendar.APRIL,19), new Double(1.6075) },
{ createDate(1999, Calendar.APRIL,20), new Double(1.6135) },
{ createDate(1999, Calendar.APRIL,21), new Double(1.6074) },
{ createDate(1999, Calendar.APRIL,22), new Double(1.6117) },
{ createDate(1999, Calendar.APRIL,23), new Double(1.6170) },
{ createDate(1999, Calendar.APRIL,26), new Double(1.6113) },
{ createDate(1999, Calendar.APRIL,27), new Double(1.6177) },
{ createDate(1999, Calendar.APRIL,28), new Double(1.6148) },
{ createDate(1999, Calendar.APRIL,29), new Double(1.6105) },
{ createDate(1999, Calendar.APRIL,30), new Double(1.6085) },
{ createDate(1999, Calendar.MAY,3), new Double(1.6083) },
{ createDate(1999, Calendar.MAY,4), new Double(1.6210) },
{ createDate(1999, Calendar.MAY,5), new Double(1.6337) },
{ createDate(1999, Calendar.MAY,6), new Double(1.6377) },
{ createDate(1999, Calendar.MAY,7), new Double(1.6350) },
{ createDate(1999, Calendar.MAY,10), new Double(1.6300) },
{ createDate(1999, Calendar.MAY,11), new Double(1.6215) },
{ createDate(1999, Calendar.MAY,12), new Double(1.6193) },
{ createDate(1999, Calendar.MAY,13), new Double(1.6190) },
{ createDate(1999, Calendar.MAY,14), new Double(1.6175) },
{ createDate(1999, Calendar.MAY,17), new Double(1.6193) },
{ createDate(1999, Calendar.MAY,18), new Double(1.6203) },
{ createDate(1999, Calendar.MAY,19), new Double(1.6175) },
{ createDate(1999, Calendar.MAY,20), new Double(1.6122) },
{ createDate(1999, Calendar.MAY,21), new Double(1.6020) },
{ createDate(1999, Calendar.MAY,24), new Double(1.5978) },
{ createDate(1999, Calendar.MAY,25), new Double(1.6021) },
{ createDate(1999, Calendar.MAY,26), new Double(1.5963) },
{ createDate(1999, Calendar.MAY,27), new Double(1.5957) },
{ createDate(1999, Calendar.MAY,28), new Double(1.6020) },
{ createDate(1999, Calendar.JUNE,1), new Double(1.6150) },
{ createDate(1999, Calendar.JUNE,2), new Double(1.6075) },
{ createDate(1999, Calendar.JUNE,3), new Double(1.6055) },
{ createDate(1999, Calendar.JUNE,4), new Double(1.6074) },
{ createDate(1999, Calendar.JUNE,7), new Double(1.6010) },
{ createDate(1999, Calendar.JUNE,8), new Double(1.6050) },
{ createDate(1999, Calendar.JUNE,9), new Double(1.6001) },
{ createDate(1999, Calendar.JUNE,10), new Double(1.6002) },
{ createDate(1999, Calendar.JUNE,11), new Double(1.6085) },
{ createDate(1999, Calendar.JUNE,14), new Double(1.6075) },
{ createDate(1999, Calendar.JUNE,15), new Double(1.5950) },
{ createDate(1999, Calendar.JUNE,16), new Double(1.5862) },
{ createDate(1999, Calendar.JUNE,17), new Double(1.5925) },
{ createDate(1999, Calendar.JUNE,18), new Double(1.5924) },
{ createDate(1999, Calendar.JUNE,21), new Double(1.5890) },
{ createDate(1999, Calendar.JUNE,22), new Double(1.5895) },
{ createDate(1999, Calendar.JUNE,23), new Double(1.5787) },
{ createDate(1999, Calendar.JUNE,24), new Double(1.5833) },
{ createDate(1999, Calendar.JUNE,25), new Double(1.5893) },
{ createDate(1999, Calendar.JUNE,28), new Double(1.5822) },
{ createDate(1999, Calendar.JUNE,29), new Double(1.5781) },
{ createDate(1999, Calendar.JUNE,30), new Double(1.5765) },
{ createDate(1999, Calendar.JULY,1), new Double(1.5765) },
{ createDate(1999, Calendar.JULY,2), new Double(1.5792) },
{ createDate(1999, Calendar.JULY,6), new Double(1.5688) },
{ createDate(1999, Calendar.JULY,7), new Double(1.5602) },
{ createDate(1999, Calendar.JULY,8), new Double(1.5577) },
{ createDate(1999, Calendar.JULY,9), new Double(1.5515) },
{ createDate(1999, Calendar.JULY,12), new Double(1.5558) },
{ createDate(1999, Calendar.JULY,13), new Double(1.5566) },
{ createDate(1999, Calendar.JULY,14), new Double(1.5635) },
{ createDate(1999, Calendar.JULY,15), new Double(1.5665) },
{ createDate(1999, Calendar.JULY,16), new Double(1.5622) },
{ createDate(1999, Calendar.JULY,19), new Double(1.5630) },
{ createDate(1999, Calendar.JULY,20), new Double(1.5700) },
{ createDate(1999, Calendar.JULY,21), new Double(1.5766) },
{ createDate(1999, Calendar.JULY,22), new Double(1.5835) },
{ createDate(1999, Calendar.JULY,23), new Double(1.5780) },
{ createDate(1999, Calendar.JULY,26), new Double(1.5905) },
{ createDate(1999, Calendar.JULY,27), new Double(1.5895) },
{ createDate(1999, Calendar.JULY,28), new Double(1.5935) },
{ createDate(1999, Calendar.JULY,29), new Double(1.6130) },
{ createDate(1999, Calendar.JULY,30), new Double(1.6207) },
{ createDate(1999, Calendar.AUGUST,2), new Double(1.6145) },
{ createDate(1999, Calendar.AUGUST,3), new Double(1.6185) },
{ createDate(1999, Calendar.AUGUST,4), new Double(1.6200) },
{ createDate(1999, Calendar.AUGUST,5), new Double(1.6198) },
{ createDate(1999, Calendar.AUGUST,6), new Double(1.6147) },
{ createDate(1999, Calendar.AUGUST,9), new Double(1.6000) },
{ createDate(1999, Calendar.AUGUST,10), new Double(1.6180) },
{ createDate(1999, Calendar.AUGUST,11), new Double(1.6107) },
{ createDate(1999, Calendar.AUGUST,12), new Double(1.6090) },
{ createDate(1999, Calendar.AUGUST,13), new Double(1.6057) },
{ createDate(1999, Calendar.AUGUST,16), new Double(1.6011) },
{ createDate(1999, Calendar.AUGUST,17), new Double(1.6036) },
{ createDate(1999, Calendar.AUGUST,18), new Double(1.6004) },
{ createDate(1999, Calendar.AUGUST,19), new Double(1.6180) },
{ createDate(1999, Calendar.AUGUST,20), new Double(1.6133) },
{ createDate(1999, Calendar.AUGUST,23), new Double(1.6076) },
{ createDate(1999, Calendar.AUGUST,24), new Double(1.5946) },
{ createDate(1999, Calendar.AUGUST,25), new Double(1.5865) },
{ createDate(1999, Calendar.AUGUST,26), new Double(1.5876) },
{ createDate(1999, Calendar.AUGUST,27), new Double(1.5885) },
{ createDate(1999, Calendar.AUGUST,30), new Double(1.5875) },
{ createDate(1999, Calendar.AUGUST,31), new Double(1.6086) },
{ createDate(1999, Calendar.SEPTEMBER,1), new Double(1.6023) },
{ createDate(1999, Calendar.SEPTEMBER,2), new Double(1.6091) },
{ createDate(1999, Calendar.SEPTEMBER,3), new Double(1.6028) },
{ createDate(1999, Calendar.SEPTEMBER,7), new Double(1.6057) },
{ createDate(1999, Calendar.SEPTEMBER,8), new Double(1.6185) },
{ createDate(1999, Calendar.SEPTEMBER,9), new Double(1.6332) },
{ createDate(1999, Calendar.SEPTEMBER,10), new Double(1.6183) },
{ createDate(1999, Calendar.SEPTEMBER,13), new Double(1.6090) },
{ createDate(1999, Calendar.SEPTEMBER,14), new Double(1.6085) },
{ createDate(1999, Calendar.SEPTEMBER,15), new Double(1.6110) },
{ createDate(1999, Calendar.SEPTEMBER,16), new Double(1.6250) },
{ createDate(1999, Calendar.SEPTEMBER,17), new Double(1.6222) },
{ createDate(1999, Calendar.SEPTEMBER,20), new Double(1.6230) },
{ createDate(1999, Calendar.SEPTEMBER,21), new Double(1.6310) },
{ createDate(1999, Calendar.SEPTEMBER,22), new Double(1.6363) },
{ createDate(1999, Calendar.SEPTEMBER,23), new Double(1.6375) },
{ createDate(1999, Calendar.SEPTEMBER,24), new Double(1.6428) },
{ createDate(1999, Calendar.SEPTEMBER,27), new Double(1.6455) },
{ createDate(1999, Calendar.SEPTEMBER,28), new Double(1.6485) },
{ createDate(1999, Calendar.SEPTEMBER,29), new Double(1.6425) },
{ createDate(1999, Calendar.SEPTEMBER,30), new Double(1.6457) },
{ createDate(1999, Calendar.OCTOBER,1), new Double(1.6550) },
{ createDate(1999, Calendar.OCTOBER,4), new Double(1.6555) },
{ createDate(1999, Calendar.OCTOBER,5), new Double(1.6525) },
{ createDate(1999, Calendar.OCTOBER,6), new Double(1.6560) },
{ createDate(1999, Calendar.OCTOBER,7), new Double(1.6520) },
{ createDate(1999, Calendar.OCTOBER,8), new Double(1.6520) },
{ createDate(1999, Calendar.OCTOBER,12), new Double(1.6535) },
{ createDate(1999, Calendar.OCTOBER,13), new Double(1.6532) },
{ createDate(1999, Calendar.OCTOBER,14), new Double(1.6575) },
{ createDate(1999, Calendar.OCTOBER,15), new Double(1.6684) },
{ createDate(1999, Calendar.OCTOBER,18), new Double(1.6720) },
{ createDate(1999, Calendar.OCTOBER,19), new Double(1.6708) },
{ createDate(1999, Calendar.OCTOBER,20), new Double(1.6643) },
{ createDate(1999, Calendar.OCTOBER,21), new Double(1.6765) },
{ createDate(1999, Calendar.OCTOBER,22), new Double(1.6584) },
{ createDate(1999, Calendar.OCTOBER,25), new Double(1.6631) },
{ createDate(1999, Calendar.OCTOBER,26), new Double(1.6525) },
{ createDate(1999, Calendar.OCTOBER,27), new Double(1.6477) },
{ createDate(1999, Calendar.OCTOBER,28), new Double(1.6400) },
{ createDate(1999, Calendar.OCTOBER,29), new Double(1.6425) },
{ createDate(1999, Calendar.NOVEMBER,1), new Double(1.6404) },
{ createDate(1999, Calendar.NOVEMBER,2), new Double(1.6445) },
{ createDate(1999, Calendar.NOVEMBER,3), new Double(1.6440) },
{ createDate(1999, Calendar.NOVEMBER,4), new Double(1.6375) },
{ createDate(1999, Calendar.NOVEMBER,5), new Double(1.6205) },
{ createDate(1999, Calendar.NOVEMBER,8), new Double(1.6150) },
{ createDate(1999, Calendar.NOVEMBER,9), new Double(1.6210) },
{ createDate(1999, Calendar.NOVEMBER,10), new Double(1.6250) },
{ createDate(1999, Calendar.NOVEMBER,12), new Double(1.6131) },
{ createDate(1999, Calendar.NOVEMBER,15), new Double(1.6230) },
{ createDate(1999, Calendar.NOVEMBER,16), new Double(1.6164) },
{ createDate(1999, Calendar.NOVEMBER,17), new Double(1.6231) },
{ createDate(1999, Calendar.NOVEMBER,18), new Double(1.6150) },
{ createDate(1999, Calendar.NOVEMBER,19), new Double(1.6160) },
{ createDate(1999, Calendar.NOVEMBER,22), new Double(1.6205) },
{ createDate(1999, Calendar.NOVEMBER,23), new Double(1.6236) },
{ createDate(1999, Calendar.NOVEMBER,24), new Double(1.6090) },
{ createDate(1999, Calendar.NOVEMBER,26), new Double(1.6062) },
{ createDate(1999, Calendar.NOVEMBER,29), new Double(1.6024) },
{ createDate(1999, Calendar.NOVEMBER,30), new Double(1.5935) },
{ createDate(1999, Calendar.DECEMBER,1), new Double(1.5960) },
{ createDate(1999, Calendar.DECEMBER,2), new Double(1.5972) },
{ createDate(1999, Calendar.DECEMBER,3), new Double(1.6015) },
{ createDate(1999, Calendar.DECEMBER,6), new Double(1.6230) },
{ createDate(1999, Calendar.DECEMBER,7), new Double(1.6233) },
{ createDate(1999, Calendar.DECEMBER,8), new Double(1.6255) },
{ createDate(1999, Calendar.DECEMBER,9), new Double(1.6230) },
{ createDate(1999, Calendar.DECEMBER,10), new Double(1.6225) },
{ createDate(1999, Calendar.DECEMBER,13), new Double(1.6232) },
{ createDate(1999, Calendar.DECEMBER,14), new Double(1.6110) },
{ createDate(1999, Calendar.DECEMBER,15), new Double(1.6085) },
{ createDate(1999, Calendar.DECEMBER,16), new Double(1.6123) },
{ createDate(1999, Calendar.DECEMBER,17), new Double(1.6070) },
{ createDate(1999, Calendar.DECEMBER,20), new Double(1.6035) },
{ createDate(1999, Calendar.DECEMBER,21), new Double(1.6103) },
{ createDate(1999, Calendar.DECEMBER,22), new Double(1.6060) },
{ createDate(1999, Calendar.DECEMBER,23), new Double(1.6161) },
{ createDate(1999, Calendar.DECEMBER,24), new Double(1.6154) },
{ createDate(1999, Calendar.DECEMBER,27), new Double(1.6173) },
{ createDate(1999, Calendar.DECEMBER,28), new Double(1.6165) },
{ createDate(1999, Calendar.DECEMBER,29), new Double(1.6168) },
{ createDate(1999, Calendar.DECEMBER,30), new Double(1.6130) },
{ createDate(1999, Calendar.DECEMBER,31), new Double(1.6150) },
{ createDate(2000, Calendar.JANUARY,3), new Double(1.6270) },
{ createDate(2000, Calendar.JANUARY,4), new Double(1.6370) },
{ createDate(2000, Calendar.JANUARY,5), new Double(1.6415) },
{ createDate(2000, Calendar.JANUARY,6), new Double(1.6475) },
{ createDate(2000, Calendar.JANUARY,7), new Double(1.6384) },
{ createDate(2000, Calendar.JANUARY,10), new Double(1.6374) },
{ createDate(2000, Calendar.JANUARY,11), new Double(1.6480) },
{ createDate(2000, Calendar.JANUARY,12), new Double(1.6465) },
{ createDate(2000, Calendar.JANUARY,13), new Double(1.6482) },
{ createDate(2000, Calendar.JANUARY,14), new Double(1.6353) },
{ createDate(2000, Calendar.JANUARY,18), new Double(1.6380) },
{ createDate(2000, Calendar.JANUARY,19), new Double(1.6438) },
{ createDate(2000, Calendar.JANUARY,20), new Double(1.6538) },
{ createDate(2000, Calendar.JANUARY,21), new Double(1.6504) },
{ createDate(2000, Calendar.JANUARY,24), new Double(1.6520) },
{ createDate(2000, Calendar.JANUARY,25), new Double(1.6482) },
{ createDate(2000, Calendar.JANUARY,26), new Double(1.6395) },
{ createDate(2000, Calendar.JANUARY,27), new Double(1.6363) },
{ createDate(2000, Calendar.JANUARY,28), new Double(1.6210) },
{ createDate(2000, Calendar.JANUARY,31), new Double(1.6182) },
{ createDate(2000, Calendar.FEBRUARY,1), new Double(1.6150) },
{ createDate(2000, Calendar.FEBRUARY,2), new Double(1.6060) },
{ createDate(2000, Calendar.FEBRUARY,3), new Double(1.6025) },
{ createDate(2000, Calendar.FEBRUARY,4), new Double(1.5915) },
{ createDate(2000, Calendar.FEBRUARY,7), new Double(1.5917) },
{ createDate(2000, Calendar.FEBRUARY,8), new Double(1.6105) },
{ createDate(2000, Calendar.FEBRUARY,9), new Double(1.6115) },
{ createDate(2000, Calendar.FEBRUARY,10), new Double(1.6057) },
{ createDate(2000, Calendar.FEBRUARY,11), new Double(1.5923) },
{ createDate(2000, Calendar.FEBRUARY,14), new Double(1.5890) },
{ createDate(2000, Calendar.FEBRUARY,15), new Double(1.5950) },
{ createDate(2000, Calendar.FEBRUARY,16), new Double(1.6040) },
{ createDate(2000, Calendar.FEBRUARY,17), new Double(1.6050) },
{ createDate(2000, Calendar.FEBRUARY,18), new Double(1.5984) },
{ createDate(2000, Calendar.FEBRUARY,22), new Double(1.6165) },
{ createDate(2000, Calendar.FEBRUARY,23), new Double(1.6047) },
{ createDate(2000, Calendar.FEBRUARY,24), new Double(1.5981) },
{ createDate(2000, Calendar.FEBRUARY,25), new Double(1.5908) },
{ createDate(2000, Calendar.FEBRUARY,28), new Double(1.5935) },
{ createDate(2000, Calendar.FEBRUARY,29), new Double(1.5780) },
{ createDate(2000, Calendar.MARCH,1), new Double(1.5849) },
{ createDate(2000, Calendar.MARCH,2), new Double(1.5765) },
{ createDate(2000, Calendar.MARCH,3), new Double(1.5810) },
{ createDate(2000, Calendar.MARCH,6), new Double(1.5732) },
{ createDate(2000, Calendar.MARCH,7), new Double(1.5772) },
{ createDate(2000, Calendar.MARCH,8), new Double(1.5855) },
{ createDate(2000, Calendar.MARCH,9), new Double(1.5815) },
{ createDate(2000, Calendar.MARCH,10), new Double(1.5793) },
{ createDate(2000, Calendar.MARCH,13), new Double(1.5782) },
{ createDate(2000, Calendar.MARCH,14), new Double(1.5725) },
{ createDate(2000, Calendar.MARCH,15), new Double(1.5730) },
{ createDate(2000, Calendar.MARCH,16), new Double(1.5747) },
{ createDate(2000, Calendar.MARCH,17), new Double(1.5705) } } };
return new DefaultXYDataset(new String[] { "USD" }, data);
###
3113, JFreeChartDemo, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 142, 159
3
/**
* Constructs a demonstration application for the JFreeChart Class Library.
*/
18
public JFreeChartDemo() {
super("JFreeChart "+JFreeChart.VERSION+" Demo");
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
dispose();
System.exit(0);
}
});
// set up the menu
JMenuBar menuBar = createMenuBar();
setJMenuBar(menuBar);
JPanel content = new JPanel(new BorderLayout());
content.add(createTabbedPane());
setContentPane(content);
###
3114, displayPieChartOne, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 763, 790
3
/**
* Displays pie chart one in its own frame.
*/
28
private void displayPieChartOne() {
if (pieChartOneFrame==null) {
// create a default chart based on some sample data...
String title = "Pie Chart";
CategoryDataset data = createCategoryDataset();
PieDataset extracted = Datasets.createPieDataset(data, 0);
JFreeChart chart = ChartFactory.createPieChart(title, extracted, true);
// then customise it a little...
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white, 0, 1000, Color.orange));
PiePlot plot = (PiePlot)chart.getPlot();
plot.setCircular(false);
// make section 1 explode by 100%...
plot.setRadiusPercent(0.60);
plot.setExplodePercent(1, 1.00);
// and present it in a frame...
pieChartOneFrame = new JFreeChartFrame("Pie Chart 1", chart);
pieChartOneFrame.pack();
SwingRefinery.positionFrameRandomly(pieChartOneFrame);
pieChartOneFrame.show();
}
else {
pieChartOneFrame.show();
pieChartOneFrame.requestFocus();
###
3115, createSingleCategoryDataset, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 1153, 1166
3
/**
* Creates and returns a category dataset with JUST ONE CATEGORY for the demo charts.
*/
14
public CategoryDataset createSingleCategoryDataset() {
Number[][] data = new Integer[][]
{ { new Integer(10) },
{ new Integer(-5) },
{ new Integer(6) },
{ new Integer(7) },
{ new Integer(-8) },
{ new Integer(9) },
{ new Integer(-10) },
{ new Integer(11) },
{ new Integer(-3) } };
return new DefaultCategoryDataset(data);
###
3116, displayXYPlot, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 832, 855
3
/**
* Displays an XYPlot in its own frame.
*/
24
private void displayXYPlot() {
if (xyPlotFrame==null) {
// create a default chart based on some sample data...
String title = "XY Plot";
String xAxisLabel = "X Axis";
String yAxisLabel = "Y Axis";
XYDataset data = new SampleXYDataset();
JFreeChart chart = ChartFactory.createXYChart(title, xAxisLabel, yAxisLabel, data, true);
// then customise it a little...
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white,0, 1000, Color.green));
// and present it in a frame...
xyPlotFrame = new JFreeChartFrame("XYPlot", chart);
xyPlotFrame.pack();
SwingRefinery.positionFrameRandomly(xyPlotFrame);
xyPlotFrame.show();
}
else {
xyPlotFrame.show();
xyPlotFrame.requestFocus();
###
3117, windowClosed, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 1814, 1821
3
/**
* Clears the reference to the print preview frames when they are closed.
*/
8
public void windowClosed(WindowEvent e) {
//if (e.getWindow()==this.infoFrame) {
// infoFrame=null;
//}
//else
if (e.getWindow()==this.aboutFrame) {
aboutFrame=null;
###
3118, createMenuBar, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 423, 451
3
/**
* Creates a menubar.
*/
29
private JMenuBar createMenuBar() {
// create the menus
JMenuBar menuBar = new JMenuBar();
// first the file menu
JMenu fileMenu = new JMenu("File", true);
fileMenu.setMnemonic('F');
JMenuItem exitItem = new JMenuItem("Exit", 'x');
exitItem.setActionCommand("exitItem");
exitItem.addActionListener(this);
fileMenu.add(exitItem);
// then the help menu
JMenu helpMenu = new JMenu("Help");
helpMenu.setMnemonic('H');
JMenuItem aboutItem = new JMenuItem("About...", 'A');
aboutItem.setActionCommand("aboutItem");
aboutItem.addActionListener(this);
helpMenu.add(aboutItem);
// finally, glue together the menu and return it
menuBar.add(fileMenu);
menuBar.add(helpMenu);
return menuBar;
###
3119, displayVertical3DBarChart, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 629, 654
3
/**
* Displays a vertical 3D bar chart in its own frame.
*/
26
private void displayVertical3DBarChart() {
if (vertical3DBarChartFrame==null) {
// create a default chart based on some sample data...
String title = "Vertical Bar Chart (3D Effect)";
String categoryAxisLabel = "Categories";
String valueAxisLabel = "Values";
CategoryDataset categoryData = createCategoryDataset();
JFreeChart chart = ChartFactory.createVerticalBarChart3D(title, categoryAxisLabel,
valueAxisLabel, categoryData, true);
// then customise it a little...
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white, 1000, 0, Color.blue));
Plot plot = chart.getPlot();
// and present it in a panel...
vertical3DBarChartFrame = new JFreeChartFrame("Vertical 3D Bar Chart", chart);
vertical3DBarChartFrame.pack();
SwingRefinery.positionFrameRandomly(vertical3DBarChartFrame);
vertical3DBarChartFrame.show();
}
else {
vertical3DBarChartFrame.show();
vertical3DBarChartFrame.requestFocus();
###
3120, displayTimeSeriesWithMAChart, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 992, 1023
3
/**
* Displays a vertical bar chart in its own frame.
*/
32
private void displayTimeSeriesWithMAChart() {
if (this.timeSeriesWithMAChartFrame==null) {
// create a default chart based on some sample data...
String title = "Moving Average";
String timeAxisLabel = "Date";
String valueAxisLabel = "USD per GBP";
XYDataset data = createXYDataset();
MovingAveragePlotFitAlgorithm mavg = new MovingAveragePlotFitAlgorithm();
mavg.setPeriod(30);
PlotFit pf = new PlotFit(data, mavg);
data = pf.getFit();
JFreeChart chart = ChartFactory.createTimeSeriesChart(title, timeAxisLabel, valueAxisLabel,
data, true);
// then customise it a little...
TextTitle subtitle = new TextTitle("30 day moving average of GBP", new Font("Arial", Font.BOLD, 12));
chart.addTitle(subtitle);
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white,0, 1000, Color.blue));
// and present it in a frame...
timeSeriesWithMAChartFrame = new JFreeChartFrame("Time Series Chart", chart);
timeSeriesWithMAChartFrame.pack();
SwingRefinery.positionFrameRandomly(timeSeriesWithMAChartFrame);
timeSeriesWithMAChartFrame.show();
}
else {
timeSeriesWithMAChartFrame.show();
timeSeriesWithMAChartFrame.requestFocus();
###
3121, displayHorizontalBarChart, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 662, 687
3
/**
* Displays a horizontal bar chart in its own frame.
*/
26
private void displayHorizontalBarChart() {
if (horizontalBarChartFrame==null) {
// create a default chart based on some sample data...
String title = "Horizontal Bar Chart";
String categoryAxisLabel = "Categories";
String valueAxisLabel = "Values";
CategoryDataset categoryData = createCategoryDataset();
JFreeChart chart = ChartFactory.createHorizontalBarChart(title, categoryAxisLabel,
valueAxisLabel, categoryData,
true);
// then customise it a little...
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white,0, 1000, Color.orange));
// and present it in a frame...
horizontalBarChartFrame = new JFreeChartFrame("Horizontal Bar Chart", chart);
horizontalBarChartFrame.pack();
SwingRefinery.positionFrameRandomly(horizontalBarChartFrame);
horizontalBarChartFrame.show();
}
else {
horizontalBarChartFrame.show();
horizontalBarChartFrame.requestFocus();
###
3122, about, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 1101, 1113
3
/**
* Displays information about the application.
*/
13
private void about() {
if (aboutFrame==null) {
aboutFrame = new AboutFrame("About...",
"JFreeChart",
"Version "+JFreeChart.VERSION,
"http://www.jrefinery.com/jfreechart",
Licences.LGPL);
aboutFrame.pack();
SwingRefinery.centerFrameOnScreen(aboutFrame);
}
aboutFrame.show();
aboutFrame.requestFocus();
###
3123, displayTimeSeriesChartInScrollPane, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 1066, 1093
3
/**
* Displays a vertical bar chart in its own frame.
*/
28
private void displayTimeSeriesChartInScrollPane() {
if (this.timeSeriesChartScrollFrame==null) {
// create a default chart based on some sample data...
String title = "Time Series Chart";
String xAxisLabel = "Date";
String yAxisLabel = "USD per GBP";
XYDataset data = createXYDataset();
JFreeChart chart = ChartFactory.createTimeSeriesChart(title, xAxisLabel, yAxisLabel, data,
true);
// then customise it a little...
TextTitle subtitle = new TextTitle("Value of GBP", new Font("Arial", Font.BOLD, 12));
chart.addTitle(subtitle);
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white,0, 1000, Color.gray));
Plot plot = chart.getPlot();
// and present it in a frame...
timeSeriesChartScrollFrame = new JFreeChartFrame("Time Series Chart", chart, true);
timeSeriesChartScrollFrame.pack();
SwingRefinery.positionFrameRandomly(timeSeriesChartScrollFrame);
timeSeriesChartScrollFrame.show();
}
else {
timeSeriesChartScrollFrame.show();
timeSeriesChartScrollFrame.requestFocus();
###
3124, getPreferredSize, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 167, 168
4
/**
* Returns the preferred size for the frame.
* @return The preferred size for the frame.
*/
2
public Dimension getPreferredSize() {
return PREFERRED_SIZE;
###
3125, createTestXYDataset, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 1518, 1531
3
/**
* Creates and returns a XYDataset for the demo charts.
*/
14
public XYDataset createTestXYDataset() {
Object[][][] data = new Object[][][] { {
{ createDateTime(2000, Calendar.OCTOBER, 18, 9, 5), new Double(10921.0) },
{ createDateTime(2000, Calendar.OCTOBER, 18, 10, 6), new Double(10886.7) },
{ createDateTime(2000, Calendar.OCTOBER, 18, 11, 6), new Double(10846.6) },
{ createDateTime(2000, Calendar.OCTOBER, 18, 12, 6), new Double(10843.7) },
{ createDateTime(2000, Calendar.OCTOBER, 18, 13, 6), new Double(10841.2) },
{ createDateTime(2000, Calendar.OCTOBER, 18, 14, 6), new Double(10830.7) },
{ createDateTime(2000, Calendar.OCTOBER, 18, 15, 6), new Double(10795.8) },
{ createDateTime(2000, Calendar.OCTOBER, 18, 16, 7), new Double(10733.8) }
} };
return new DefaultXYDataset(data);
###
3127, displayHorizontalStackedBarChart, JFreeChartDemo, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/JFreeChartDemo.java, 695, 723
3
/**
* Displays a horizontal bar chart in its own frame.
*/
29
private void displayHorizontalStackedBarChart() {
if (horizontalStackedBarChartFrame==null) {
// create a default chart based on some sample data...
String title = "Horizontal Stacked Bar Chart";
String categoryAxisLabel = "Categories";
String valueAxisLabel = "Values";
CategoryDataset categoryData = createCategoryDataset();
JFreeChart chart = ChartFactory.createStackedHorizontalBarChart(title, categoryAxisLabel,
valueAxisLabel, categoryData, true);
// then customise it a little...
chart.setChartBackgroundPaint(new GradientPaint(0, 0, Color.white, 1000, 0, Color.blue));
Plot plot = chart.getPlot();
HorizontalNumberAxis valueAxis = (HorizontalNumberAxis)plot.getAxis(Plot.HORIZONTAL_AXIS);
valueAxis.setMinimumAxisValue(new Double(-32.0));
valueAxis.setMaximumAxisValue(new Double(85.0));
// and present it in a frame...
horizontalStackedBarChartFrame = new JFreeChartFrame("Horizontal Bar Chart", chart);
horizontalStackedBarChartFrame.pack();
SwingRefinery.positionFrameRandomly(horizontalStackedBarChartFrame);
horizontalStackedBarChartFrame.show();
}
else {
horizontalStackedBarChartFrame.show();
horizontalStackedBarChartFrame.requestFocus();
###
3130, getResults, PlotFit, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/data/PlotFit.java, 83, 124
5
/**
* Returns a three-dimensional array based on algorithm calculations. Used to create a new
* dataset.
* Matthew Wright: implements what I'm doing in code now... not the best way to do this?
*/
42
public Object[][][] getResults() {
/* set up our algorithm */
alg.setXYDataset(dataset);
/* make a data container big enough to hold it all */
int arraysize = 0;
int seriescount = dataset.getSeriesCount();
for(int i = 0; i < seriescount; i++) {
if(dataset.getItemCount(i) > arraysize) {
arraysize = dataset.getItemCount(i);
}
}
// we'll apply the plot fit to all of the series for now
Object[][][] newdata = new Object[seriescount * 2][arraysize][2];
/* copy in the series to the first half */
for(int i = 0; i < seriescount; i++) {
for(int j = 0; j < dataset.getItemCount(i); j++) {
Number x = dataset.getXValue(i,j);
newdata[i][j][0] = x;
newdata[i][j][1] = dataset.getYValue(i,j);
Number y = alg.getY(i, x);
/*
* only want to set data for non-null algorithm fits.
* This allows things like moving average plots, or partial
* plots to return null and not get NPEs when the chart is
* created
*/
//System.out.println("At [" + i + "," + j + "] the values = [" + x + "," + y + "]");
if(y != null) {
newdata[i + seriescount][j][0] = x;
newdata[i + seriescount][j][1] = y;
}
else {
newdata[i + seriescount][j][0] = null;
newdata[i + seriescount][j][1] = null;
}
}
}
return newdata;
###
3131, setPlotFitAlgorithm, PlotFit, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/data/PlotFit.java, 74, 75
4
/**
* Sets the algorithm used to generate the new dataset.
* @param alg The algorithm.
*/
2
public void setPlotFitAlgorithm(PlotFitAlgorithm alg) {
this.alg = alg;
###
3132, PlotFit, PlotFit, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/data/PlotFit.java, 57, 59
5
/**
* Standard constructor.
* @param data The underlying dataset.
* @param alg The algorithm.
*/
3
public PlotFit(XYDataset data, PlotFitAlgorithm alg) {
this.dataset = data;
this.alg = alg;
###
3133, setXYDataset, PlotFit, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/data/PlotFit.java, 66, 67
4
/**
* Sets the underlying dataset.
* @param data The underlying dataset.
*/
2
public void setXYDataset(XYDataset data) {
this.dataset = data;
###
3134, getXValue, EmptyXYDataset, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/EmptyXYDataset.java, 55, 56
6
/**
* Returns the x-value for the specified series and item. Series are numbered 0, 1, ...
* @param series The index (zero-based) of the series;
* @param item The index (zero-based) of the required item;
* @return The x-value for the specified series and item.
*/
2
public Number getXValue(int series, int item) {
return null;
###
3135, getYValue, EmptyXYDataset, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/EmptyXYDataset.java, 65, 66
6
/**
* Returns the y-value for the specified series and item. Series are numbered 0, 1, ...
* @param series The index (zero-based) of the series;
* @param item The index (zero-based) of the required item;
* @return The y-value for the specified series and item.
*/
2
public Number getYValue(int series, int item) {
return null;
###
3136, getSeriesCount, EmptyXYDataset, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/EmptyXYDataset.java, 73, 74
4
/**
* Returns the number of series in the data source.
* @return The number of series in the data source.
*/
2
public int getSeriesCount() {
return 0;
###
3137, getSeriesName, EmptyXYDataset, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/EmptyXYDataset.java, 82, 83
5
/**
* Returns the name of the series.
* @param series The index (zero-based) of the series;
* @return The name of the series.
*/
2
public String getSeriesName(int series) {
return null;
###
3139, getYValue, SampleXYDataset2, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/SampleXYDataset2.java, 86, 87
6
/**
* Returns the y-value for the specified series and item. Series are numbered 0, 1, ...
* @param series The index (zero-based) of the series;
* @param item The index (zero-based) of the required item;
* @return The y-value for the specified series and item.
*/
2
public Number getYValue(int series, int item) {
return yValues[series][item];
###
3140, getSeriesName, SampleXYDataset2, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/SampleXYDataset2.java, 103, 104
5
/**
* Returns the name of the series.
* @param series The index (zero-based) of the series;
* @return The name of the series.
*/
2
public String getSeriesName(int series) {
return "Sample "+series;
###
3141, getSeriesCount, SampleXYDataset2, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/SampleXYDataset2.java, 94, 95
4
/**
* Returns the number of series in the data source.
* @return The number of series in the data source.
*/
2
public int getSeriesCount() {
return SERIES_COUNT;
###
3142, SampleXYDataset2, SampleXYDataset2, JFreeChart060
jfreechart-0.6.0/source/com/jrefinery/chart/demo/SampleXYDataset2.java, 58, 64
3
/**
* Default constructor.
*/
7
public SampleXYDataset2() {
for (int series=0; series