3232, HighLow, HighLow, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HighLow.java, 79, 80 11 /** * Constructs a high-low item, with default values for the open/close and colors. * @param x * @param high * @param low */ 4 public HighLow(double x, double high, double low) { this(x, high, low, high, low, new BasicStroke(), Color.blue); ### 3233, setValue, HighLow, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HighLow.java, 154, 158 9 /** * Sets either OPEN or Close value depending on the valueType. * @param valueType * @param newValue */ 10 public void setValue(int valueType, double newValue) { if (valueType == OPEN) open = newValue; else close = newValue; ### 3234, getCloseTickLine, HighLow, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HighLow.java, 171, 172 5 /** * Returns the line. for close tick */ 4 public Line2D getCloseTickLine() { return getTickLine(getLine().getX1(), getValue(CLOSE), getTickSize()); ### 3235, getOpenTickLine, HighLow, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HighLow.java, 164, 165 5 /** * Returns the line for open tick. */ 4 public Line2D getOpenTickLine() { return getTickLine(getLine().getX1(), getValue(OPEN), (-1) * getTickSize()); ### 3236, getValue, HighLow, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HighLow.java, 142, 146 7 /** * Returns either OPEN or Close value depending on the valueType. * @param valueType */ 10 public double getValue(int valueType) { if (valueType == OPEN) return open; else return close; ### 3237, setTickSize, HighLow, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HighLow.java, 120, 121 7 /** * Sets the width of the open/close tick. * @param newSize */ 4 public void setTickSize(double newSize) { tickSize = newSize; ### 3238, HighLow, HighLow, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HighLow.java, 91, 92 15 /** * Constructs a high-low item, with default values for the colors. * @param x * @param high * @param low * @param open * @param close */ 4 public HighLow(double x, double high, double low, double open, double close) { this(x, high, low, open, close, new BasicStroke(), Color.blue); ### 3239, getLine, HighLow, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HighLow.java, 134, 135 5 /** * Returns the line. */ 4 public Line2D getLine() { return line; ### 3240, getStroke, HighLow, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HighLow.java, 185, 186 5 /** * Returns the Stroke object used to draw the line. */ 4 public Stroke getStroke() { return stroke; ### 3242, getTickSize, HighLow, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HighLow.java, 127, 128 5 /** * Returns the width of the open/close tick. */ 4 public double getTickSize() { return tickSize; ### 3243, HighLow, HighLow, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HighLow.java, 105, 112 19 /** * Constructs a high-low item. * @param x * @param high * @param low * @param open * @param close * @param stroke * @param paint */ 14 public HighLow(double x, double high, double low, double open, double close, Stroke stroke, Paint paint) { this.line = new Line2D.Double(x, high, x, low); this.open = open; this.close = close; this.stroke = stroke; this.paint = paint; ### 3244, isValidHorizontalAlignment, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 375, 381 5 /** * Utility method for checking a horizontal alignment code. */ 12 protected static boolean isValidHorizontalAlignment(int code) { switch(code) { case AbstractTitle.LEFT: return true; case AbstractTitle.MIDDLE: return true; case AbstractTitle.RIGHT: return true; default: return false; ### 3245, getVerticalAlignment, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 281, 282 9 /** * Returns the vertical alignment of the title. The constants TOP, MIDDLE and BOTTOM (defined * in this class) are used. * @return The vertical alignment of the title (TOP, MIDDLE or BOTTOM); */ 4 public int getVerticalAlignment() { return this.verticalAlignment; ### 3247, setHorizontalAlignment, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 269, 272 11 /** * Sets the horizontal alignment for the title, and notifies any registered listeners of the * change. The constants LEFT, CENTER and RIGHT (defined in this class) can be used to specify * the alignment. * @param alignment The new horizontal alignment (LEFT, CENTER or RIGHT). */ 8 public void setHorizontalAlignment(int alignment) { if (this.horizontalAlignment!=alignment) { this.horizontalAlignment = alignment; notifyListeners(new TitleChangeEvent(this)); ### 3248, setVerticalAlignment, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 292, 295 13 /** * Sets the vertical alignment for the title, and notifies any registered listeners of the * change. * The constants TOP, MIDDLE and BOTTOM (defined in this class) can be used to specify the * alignment. * @param alignment The new vertical alignment (TOP, MIDDLE or BOTTOM); */ 8 public void setVerticalAlignment(int alignment) { if (this.verticalAlignment!=alignment) { this.verticalAlignment = alignment; notifyListeners(new TitleChangeEvent(this)); ### 3249, AbstractTitle, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 180, 184 7 /** * Default constructor - builds an AbstractTitle positioned at the top of the page, centered * horizontally and vertically within its space. */ 8 protected AbstractTitle() { this(AbstractTitle.DEFAULT_POSITION, AbstractTitle.DEFAULT_HORIZONTAL_ALIGNMENT, AbstractTitle.DEFAULT_VERTICAL_ALIGNMENT); ### 3250, AbstractTitle, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 134, 156 21 /** * Constructs a title. *

* This class defines constants for the valid position and alignment values---an * IllegalArgumentException will be thrown if invalid values are passed to this constructor. * @param position The relative position of the title (TOP, BOTTOM, RIGHT and LEFT---or NORTH, * SOUTH, EAST and WEST if you prefer). * @param horizontalAlignment The horizontal alignment of the title (LEFT, CENTER or RIGHT). * @param verticalAlignment The vertical alignment of the title (TOP, MIDDLE or BOTTOM). * @exception IllegalArgumentException If an invalid location or alignment value is passed. */ 38 protected AbstractTitle(int position, int horizontalAlignment, int verticalAlignment, Insets insets) { // check arguments... if (!this.isValidPosition(position)) { throw new IllegalArgumentException("AbstractTitle(): Invalid position."); } if (!AbstractTitle.isValidHorizontalAlignment(horizontalAlignment)) { throw new IllegalArgumentException("AbstractTitle(): Invalid horizontal alignment."); } if (!AbstractTitle.isValidVerticalAlignment(verticalAlignment)) { throw new IllegalArgumentException("AbstractTitle(): Invalid vertical alignment."); } // initialise... this.position = position; this.horizontalAlignment = horizontalAlignment; this.verticalAlignment = verticalAlignment; this.insets = insets; this.listeners = new java.util.ArrayList(); this.notify = true; ### 3251, HorizontalBarPlot, HorizontalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HorizontalBarPlot.java, 75, 86 9 /** * Constructs a horizontal bar plot. * @param horizontalAxis The horizontal axis. * @param verticalAxis The vertical axis. */ 20 public HorizontalBarPlot(Axis horizontalAxis, Axis verticalAxis) { this(horizontalAxis, verticalAxis, Plot.DEFAULT_INSETS, BarPlot.DEFAULT_INTRO_GAP_PERCENT, BarPlot.DEFAULT_TRAIL_GAP_PERCENT, BarPlot.DEFAULT_CATEGORY_GAPS_PERCENT, BarPlot.DEFAULT_ITEM_GAPS_PERCENT, null); this.renderer = new HorizontalBarRenderer(); ### 3252, getMaximumHorizontalDataValue, HorizontalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HorizontalBarPlot.java, 408, 414 7 /** * Returns the maximum value in the range, since this is plotted against the horizontal axis for * a HorizontalBarPlot. */ 12 public Number getMaximumHorizontalDataValue() { Dataset data = this.getChart().getDataset(); if (data!=null) { return Datasets.getMaximumRangeValue(data); } else return null; ### 3253, setInsets, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 310, 313 7 /** * Sets the insets for the title, and notifies registered listeners of the change. * @param insets The new insets value; */ 8 public void setInsets(Insets insets) { if (!this.insets.equals(insets)) { this.insets = insets; notifyListeners(new TitleChangeEvent(this)); ### 3254, getCategories, HorizontalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HorizontalBarPlot.java, 169, 170 5 /** * A convenience method that returns a list of the categories in the data source. */ 4 public java.util.List getCategories() { return getDataset().getCategories(); ### 3255, getInsets, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 302, 303 5 /** * Returns the insets (the blank space around the edges) for this title. */ 4 public Insets getInsets() { return this.insets; ### 3256, setNotify, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 227, 228 9 /** * Sets the flag that indicates whether or not the notification mechanism is enabled. There are * certain situations (such as cloning) where you want to turn notification off temporarily. * @param flag A boolean that indicates whether or not the notification mechanism is enabled; */ 4 public void setNotify(boolean flag) { this.notify = flag; ### 3257, calculateBarWidth, HorizontalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HorizontalBarPlot.java, 362, 380 7 /** * Returns the width of each bar in the chart. * @param plotArea The area within which the plot will be drawn. */ 28 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 height (bars are horizontal) less whitespace double usable = plotArea.getHeight() * (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; ### 3258, removeChangeListener, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 354, 355 7 /** * Unregisters an object for notification of changes to the chart title. * @param listener The object that is being unregistered; */ 4 public void removeChangeListener(TitleChangeListener listener) { listeners.remove(listener); ### 3259, getDataset, HorizontalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HorizontalBarPlot.java, 127, 128 5 /** * A convenience method that returns the dataset for the plot, cast as a CategoryDataset. */ 4 public CategoryDataset getDataset() { return (CategoryDataset)chart.getDataset(); ### 3260, AbstractTitle, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 168, 172 15 /** * Constructs a title. * @param position The relative position of the title (TOP, BOTTOM, RIGHT and LEFT---or NORTH, * SOUTH, EAST and WEST if you prefer); * @param horizontalAlignment The horizontal alignment of the title (LEFT, CENTER or RIGHT); * @param verticalAlignment The vertical alignment of the title (TOP, MIDDLE or BOTTOM); * @exception IllegalArgumentException If an invalid location or alignment value is passed; */ 8 protected AbstractTitle(int position, int horizontalAlignment, int verticalAlignment) { this(position, horizontalAlignment, verticalAlignment, AbstractTitle.DEFAULT_INSETS); ### 3261, HorizontalBarPlot, HorizontalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HorizontalBarPlot.java, 100, 111 19 /** * Constructs a horizontal bar plot. * @param horizontalAxis The horizontal axis. * @param verticalAxis The vertical axis. * @param introGapPercent The gap before the first bar in the plot. * @param trailGapPercent The gap after the last bar in the plot. * @param categoryGapPercent The gap between the last bar in one category and the first bar in * the next category. * @param itemGapPercent The gap between bars within the same category. */ 20 public HorizontalBarPlot(Axis horizontalAxis, Axis verticalAxis, Insets insets, double introGapPercent, double trailGapPercent, double categoryGapPercent, double itemGapPercent, CategoryToolTipGenerator toolTipGenerator) { super(horizontalAxis, verticalAxis, insets, introGapPercent, trailGapPercent, categoryGapPercent, itemGapPercent, toolTipGenerator); this.renderer = new HorizontalBarRenderer(); ### 3263, getPlotType, HorizontalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HorizontalBarPlot.java, 386, 387 5 /** * Returns a short string describing the type of plot. */ 4 public String getPlotType() { return "Horizontal Bar Plot"; ### 3264, addChangeListener, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 346, 347 7 /** * Registers an object for notification of changes to the title. * @param listener The object that is being registered; */ 4 public void addChangeListener(TitleChangeListener listener) { listeners.add(listener); ### 3265, getCategoryAxis, HorizontalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HorizontalBarPlot.java, 152, 153 7 /** * A convenience method that returns a reference to the horizontal axis cast as a * CategoryAxis. */ 4 public CategoryAxis getCategoryAxis() { return (CategoryAxis)verticalAxis; ### 3266, getNotify, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 218, 219 7 /** * Returns the flag that indicates whether or not the notification mechanism is enabled. * @return A boolean that indicates whether or not the notification mechanism is enabled; */ 4 public boolean getNotify() { return this.notify; ### 3267, isCompatibleHorizontalAxis, HorizontalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HorizontalBarPlot.java, 210, 214 9 /** * Checks the compatibility of a horizontal axis, returning true if the axis is compatible with * the plot, and false otherwise. * @param axis The horizontal axis; */ 10 public boolean isCompatibleHorizontalAxis(Axis axis) { if (axis instanceof HorizontalNumberAxis) { return true; } else return false; ### 3268, setPosition, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 246, 250 9 /** * Sets the position for the title. * @param position The relative position of the title (use one of the constants TOP, BOTTOM, * RIGHT and LEFT, or the equivalent NORTH, SOUTH, EAST and WEST); */ 10 public void setPosition(int position) { if (this.position!=position) { // check that the position is valid this.position = position; notifyListeners(new TitleChangeEvent(this)); ### 3269, setHorizontalAxis, HorizontalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HorizontalBarPlot.java, 161, 163 9 /** * 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; */ 6 public void setHorizontalAxis(Axis axis) throws AxisNotCompatibleException { // check that the axis implements the required interface (if not raise an exception); super.setHorizontalAxis(axis); ### 3271, getPosition, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 237, 238 11 /** * Returns the relative position of the title---represented by one of four integer constants * defined in this class: TOP, BOTTOM, RIGHT or LEFT (or the equivalent NORTH, SOUTH, EAST and * WEST). * @return The title position; */ 4 public int getPosition() { return this.position; ### 3272, setVerticalAxis, HorizontalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HorizontalBarPlot.java, 143, 145 9 /** * Sets the vertical axis for the plot. This method should throw an exception if the axis * doesn't implement the required interfaces. * @param vAxis The new vertical axis; */ 6 public void setVerticalAxis(Axis vAxis) throws AxisNotCompatibleException { // check that the axis implements the required interface (if not raise an exception); super.setVerticalAxis(vAxis); ### 3273, notifyListeners, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 362, 367 7 /** * Notifies all registered listeners that the chart title has changed in some way. * @param event An object that contains information about the change to the title; */ 12 protected void notifyListeners(TitleChangeEvent event) { if (this.notify) { java.util.Iterator iterator = listeners.iterator(); while (iterator.hasNext()) { TitleChangeListener listener = (TitleChangeListener)iterator.next(); listener.titleChanged(event); ### 3274, clone, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 196, 210 15 /** * Returns a clone of the title. *

* One situation when this is useful is when editing the title properties - you can edit a * clone, and then it is easier to cancel the changes if necessary. * @return A clone of the title. * */ 26 public Object clone() { AbstractTitle duplicate = null; try { duplicate = (AbstractTitle)(super.clone()); } catch (CloneNotSupportedException e) { // this should never happen because Cloneable is implemented throw new RuntimeException("AbstractTitle.clone()"); } duplicate.setNotify(false); duplicate.setInsets((Insets)this.getInsets().clone()); duplicate.setNotify(true); return duplicate; ### 3276, getHorizontalAlignment, AbstractTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/AbstractTitle.java, 259, 260 9 /** * Returns the horizontal alignment of the title. The constants LEFT, CENTER and RIGHT (defined * in this class) are used. * @return The horizontal alignment of the title (LEFT, CENTER or RIGHT); */ 4 public int getHorizontalAlignment() { return this.horizontalAlignment; ### 3277, draw, HorizontalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HorizontalBarPlot.java, 239, 353 19 /** * Draws the plot on a Java 2D graphics device (such as the screen or a printer). *

* At your option, you may supply an instance of DrawInfo. If you do, it will be populated * with information about the drawing, including various plot dimensions and tooltip info. * @param g2 The graphics device. * @param plotArea The area within which the plot should be drawn. * @param info A structure for passing back information about the chart drawing (ignored if * null). */ 196 public void draw(Graphics2D g2, Rectangle2D plotArea, DrawInfo info) { // set up collection of drawing info... ToolTipsCollection tooltips = null; if (info!=null) { info.setPlotArea(plotArea); tooltips = info.getToolTipsCollection(); } // adjust the drawing area for the plot insets (if any)... if (insets!=null) { plotArea.setRect(plotArea.getX()+insets.left, plotArea.getY()+insets.top, plotArea.getWidth()-insets.left-insets.right, plotArea.getHeight()-insets.top-insets.bottom); } // estimate the area required for drawing the axes... VerticalAxis vAxis = getVerticalAxis(); HorizontalAxis hAxis = getHorizontalAxis(); double vAxisAreaWidth = vAxis.reserveWidth(g2, this, plotArea); Rectangle2D hAxisArea = hAxis.reserveAxisArea(g2, this, plotArea, vAxisAreaWidth); // and this the area available for plotting data... Rectangle2D dataArea = new Rectangle2D.Double(plotArea.getX()+vAxisAreaWidth, plotArea.getY(), plotArea.getWidth()-vAxisAreaWidth, plotArea.getHeight()-hAxisArea.getHeight()); if (info!=null) { info.setDataArea(dataArea); } // draw the background and axes... drawOutlineAndBackground(g2, dataArea); getCategoryAxis().draw(g2, plotArea, dataArea); getRangeAxis().draw(g2, plotArea, dataArea); // now get the data and plot the bars... CategoryDataset data = this.getDataset(); if (data!=null) { Shape savedClip = g2.getClip(); g2.clip(dataArea); // draw a line at zero... double translatedZero = getRangeAxis().translateValueToJava2D(0.0, dataArea); Line2D baseline = new Line2D.Double(translatedZero, dataArea.getY(), translatedZero, dataArea.getMaxY()); g2.setStroke(new BasicStroke()); g2.draw(baseline); int seriesCount = data.getSeriesCount(); int categoryCount = data.getCategoryCount(); int barCount = renderer.barWidthsPerCategory(data); // work out the span dimensions for the categories... double categorySpan = 0.0; double categoryGapSpan = 0.0; if (categoryCount>1) { categorySpan = dataArea.getHeight()* (1-introGapPercent-trailGapPercent-categoryGapsPercent); categoryGapSpan = dataArea.getHeight()*categoryGapsPercent; } else { categorySpan = dataArea.getHeight()*(1-introGapPercent-trailGapPercent); } // work out the item span... double itemSpan = categorySpan; double itemGapSpan = 0.0; if (seriesCount>1) { if (renderer.hasItemGaps()) { itemGapSpan = plotArea.getHeight()*itemGapsPercent; itemSpan = itemSpan - itemGapSpan; } } double itemWidth = itemSpan/(categoryCount*renderer.barWidthsPerCategory(data)); int categoryIndex = 0; Iterator iterator = data.getCategories().iterator(); while (iterator.hasNext()) { Object category = iterator.next(); for (int series=0; seriesyyOpen) && (yyLow>yyClose)) { g2.draw(new Line2D.Double(xx, yyLow, xx, Math.max(yyOpen, yyClose))); } // draw the body Shape body = null; if (yyOpen1) { double categorySpan = area.getHeight() *(1-introGapPercent-trailGapPercent-categoryGapsPercent); double categoryGapSpan = area.getHeight()*categoryGapsPercent; result = result + (category+0.5)*(categorySpan/categoryCount) + (category)*(categoryGapSpan/(categoryCount-1)); } else { result = result + (category+0.5)*area.getHeight()*(1-introGapPercent-trailGapPercent); } return result; ### 3284, getRangeAxis, HorizontalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HorizontalBarPlot.java, 134, 135 5 /** * Returns the range axis for the plot. */ 4 public ValueAxis getRangeAxis() { return (ValueAxis)horizontalAxis; ### 3285, getMinimumHorizontalDataValue, HorizontalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/HorizontalBarPlot.java, 394, 400 7 /** * Returns the minimum value in the range, since this is plotted against the horizontal axis for * a HorizontalBarPlot. */ 12 public Number getMinimumHorizontalDataValue() { Dataset data = this.getChart().getDataset(); if (data!=null) { return Datasets.getMinimumRangeValue(data); } else return null; ### 3286, saveChartAsPNG, ChartUtilities, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartUtilities.java, 76, 82 13 /** * Saves the chart as a PNG format image file. * @param chart The chart. * @param width The image width. * @param height The image height. * @param file The file. */ 12 public static void saveChartAsPNG(File file, JFreeChart chart, int width, int height) throws IOException { DataOutputStream out = new DataOutputStream( new BufferedOutputStream(new FileOutputStream(file))); writeChartAsPNG(out, chart, width, height); out.close(); ### 3287, writeChartAsJPEG, ChartUtilities, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartUtilities.java, 93, 100 13 /** * Writes the chart to the output stream in JPEG format. * @param out The output stream. * @param chart The chart. * @param width The image width. * @param height The image height. */ 14 public static void writeChartAsJPEG(OutputStream out, JFreeChart chart, int width, int height) throws IOException { BufferedImage image = chart.createBufferedImage(width, height); JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out); JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(image); param.setQuality(1.0f, true); encoder.encode(image, param); ### 3288, writeChartAsPNG, ChartUtilities, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartUtilities.java, 59, 65 13 /** * Writes the chart to the output stream in PNG format. * @param out The output stream. * @param chart The chart. * @param width The image width. * @param height The image height. */ 12 public static void writeChartAsPNG(OutputStream out, JFreeChart chart, int width, int height) throws IOException { BufferedImage chartImage = chart.createBufferedImage(width, height); PngEncoder encoder = new PngEncoder(chartImage, false, 0, 9); byte[] pngData = encoder.pngEncode(); out.write(pngData); ### 3289, getCount, DateUnit, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateUnit.java, 74, 75 5 /** * Returns the number of units. */ 4 public int getCount() { return this.count; ### 3290, createVerticalBarChart3D, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 94, 107 19 /** * 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. */ 24 public static JFreeChart createVerticalBarChart3D(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset data, boolean legend) { CategoryAxis categoryAxis = new HorizontalCategoryAxis(categoryAxisLabel); ValueAxis 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()); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3291, getField, DateUnit, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateUnit.java, 67, 68 5 /** * Returns the field used for this DateUnit. */ 4 public int getField() { return this.field; ### 3292, DateUnit, DateUnit, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateUnit.java, 59, 61 5 /** * Builds a DateUnit. */ 6 public DateUnit(int field, int count) { this.field = field; this.count = count; ### 3293, createStackedVerticalBarChart3D, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 144, 156 21 /** * 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. */ 24 public static JFreeChart createStackedVerticalBarChart3D(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset data, boolean legend) { CategoryAxis categoryAxis = new HorizontalCategoryAxis(categoryAxisLabel); ValueAxis 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()); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3294, createLineChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 210, 218 15 /** * 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. */ 16 public static JFreeChart createLineChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset data, boolean legend) { Axis categoryAxis = new HorizontalCategoryAxis(categoryAxisLabel); Axis valueAxis = new VerticalNumberAxis(valueAxisLabel); Plot plot = new LinePlot(categoryAxis, valueAxis); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3295, createTimeSeriesChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 289, 301 23 /** * 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) { ValueAxis timeAxis = new HorizontalDateAxis(timeAxisLabel); //timeAxis.setCrosshairLockedOnData(false); NumberAxis valueAxis = new VerticalNumberAxis(valueAxisLabel); valueAxis.setAutoRangeIncludesZero(false); // override default //valueAxis.setCrosshairLockedOnData(false); XYPlot plot = new XYPlot(timeAxis, valueAxis); plot.setXYItemRenderer(new StandardXYItemRenderer(StandardXYItemRenderer.LINES)); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3296, createSignalChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 389, 398 19 /** * Creates and returns a default instance of a signal chart based on the specified dataset. *

* Added 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. */ 18 public static JFreeChart createSignalChart(String title, String timeAxisLabel, String valueAxisLabel, SignalsDataset data, boolean legend) { ValueAxis timeAxis = new HorizontalDateAxis(timeAxisLabel); NumberAxis valueAxis = new VerticalNumberAxis(valueAxisLabel); XYPlot plot = new XYPlot(timeAxis, valueAxis); plot.setXYItemRenderer(new SignalRenderer()); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3297, createHighLowChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 341, 351 21 /** * 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. */ 20 public static JFreeChart createHighLowChart(String title, String timeAxisLabel, String valueAxisLabel, HighLowDataset data, boolean legend) { ValueAxis timeAxis = new HorizontalDateAxis(timeAxisLabel); NumberAxis valueAxis = new VerticalNumberAxis(valueAxisLabel); //HighLowPlot plot = new HighLowPlot(timeAxis, valueAxis); XYPlot plot = new XYPlot(timeAxis, valueAxis); plot.setXYItemRenderer(new HighLowRenderer()); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3298, createVerticalBarChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 71, 80 15 /** * 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. */ 16 public static JFreeChart createVerticalBarChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset data, boolean legend) { CategoryAxis categoryAxis = new HorizontalCategoryAxis(categoryAxisLabel); ValueAxis valueAxis = new VerticalNumberAxis(valueAxisLabel); Plot plot = new VerticalBarPlot(categoryAxis, valueAxis); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3299, createHorizontalBarChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 168, 176 15 /** * 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. */ 16 public static JFreeChart createHorizontalBarChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset data, boolean legend) { Axis categoryAxis = new VerticalCategoryAxis(categoryAxisLabel); Axis valueAxis = new HorizontalNumberAxis(valueAxisLabel); Plot plot = new HorizontalBarPlot(valueAxis, categoryAxis); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3300, createStackedVerticalBarChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 120, 129 17 /** * 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. */ 18 public static JFreeChart createStackedVerticalBarChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset data, boolean legend) { CategoryAxis categoryAxis = new HorizontalCategoryAxis(categoryAxisLabel); ValueAxis valueAxis = new VerticalNumberAxis(valueAxisLabel); VerticalBarPlot plot = new VerticalBarPlot(categoryAxis, valueAxis); plot.setRenderer(new StackedVerticalBarRenderer()); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3301, createStackedHorizontalBarChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 189, 198 17 /** * 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. */ 18 public static JFreeChart createStackedHorizontalBarChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset data, boolean legend) { Axis categoryAxis = new VerticalCategoryAxis(categoryAxisLabel); Axis valueAxis = new HorizontalNumberAxis(valueAxisLabel); HorizontalBarPlot plot = new HorizontalBarPlot(valueAxis, categoryAxis); plot.setRenderer(new StackedHorizontalBarRenderer()); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3302, createScatterPlot, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 265, 273 15 /** * 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. */ 16 public static JFreeChart createScatterPlot(String title, String xAxisLabel, String yAxisLabel, XYDataset data, boolean legend) { ValueAxis xAxis = new HorizontalNumberAxis(xAxisLabel); ValueAxis yAxis = new VerticalNumberAxis(yAxisLabel); XYPlot plot = new XYPlot(xAxis, yAxis); plot.setXYItemRenderer(new StandardXYItemRenderer(StandardXYItemRenderer.SHAPES)); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3303, createVerticalXYBarChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 314, 326 17 /** * 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. */ 24 public static JFreeChart createVerticalXYBarChart(String title, String xAxisLabel, String yAxisLabel, IntervalXYDataset data, boolean legend) { HorizontalDateAxis timeAxis = new HorizontalDateAxis(xAxisLabel); ValueAxis valueAxis = new VerticalNumberAxis(yAxisLabel); //Plot plot = new VerticalXYBarPlot(timeAxis, valueAxis, new Insets(0,0,0,0), Color.white, // new BasicStroke(), Color.gray); XYPlot plot = new XYPlot(timeAxis, valueAxis, new Insets(0,0,0,0), Color.white, new BasicStroke(), Color.gray); plot.setXYItemRenderer(new VerticalXYBarRenderer()); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3304, setMinimumDate, DateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateAxis.java, 173, 177 7 /** * Sets the minimum date visible on the axis. * @param minimumDate The new minimum date. */ 8 public void setMinimumDate(Date minimumDate) { this.minimumDate = minimumDate; double millis = (double)minimumDate.getTime(); this.setMinimumAxisValue(millis); ### 3305, createCombinableTimeSeriesChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 431, 435 20 /** * Creates and returns a combinable 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. *

* @author Bill Kelemen. * @param horizontal The horizontal axis * @param vertical The vertical axis * @param data The dataset for the chart. */ 10 public static CombinedChart createCombinableTimeSeriesChart(ValueAxis horizontal, ValueAxis vertical, Dataset data) { XYPlot plot = new XYPlot(horizontal, vertical); plot.setXYItemRenderer(new StandardXYItemRenderer(StandardXYItemRenderer.LINES)); return createCombinableChart(data, plot); ### 3306, calculateHighestVisibleTickValue, DateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateAxis.java, 307, 308 7 /** * Calculates the value of the highest visible tick on the axis. * @return The value of the highest visible tick on the axis. */ 4 public Date calculateHighestVisibleTickValue(DateUnit unit) { return this.previousStandardDate(maximumDate, unit.getField(), unit.getCount()); ### 3307, createXYChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 244, 253 15 /** * 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. */ 18 public static JFreeChart createXYChart(String title, String xAxisLabel, String yAxisLabel, XYDataset data, boolean legend) { NumberAxis xAxis = new HorizontalNumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); NumberAxis yAxis = new VerticalNumberAxis(yAxisLabel); XYPlot plot = new XYPlot(xAxis, yAxis); plot.setXYItemRenderer(new StandardXYItemRenderer(StandardXYItemRenderer.LINES)); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3308, DateAxis, DateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateAxis.java, 127, 157 45 /** * Constructs a date 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 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). * @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 autoTickUnitSelection A flag indicating whether or not the tick unit is automatically * selected. * @param tickUnit The tick unit. * @param gridLinesVisible Flag indicating whether or not grid lines are visible. * @param gridStroke The Stroke used to display grid lines (if visible). * @param gridPaint The Paint used to display grid lines (if visible). */ 56 protected DateAxis(String label, Font labelFont, Paint labelPaint, Insets labelInsets, boolean tickLabelsVisible, Font tickLabelFont, Paint tickLabelPaint, Insets tickLabelInsets, boolean tickMarksVisible, Stroke tickMarkStroke, boolean autoRange, Date minimumDate, Date maximumDate, boolean autoTickUnitSelection, DateUnit tickUnit, SimpleDateFormat tickLabelFormatter, boolean gridLinesVisible, Stroke gridStroke, Paint gridPaint, Date crosshairDate, Stroke crosshairStroke, Paint crosshairPaint) { super(label, labelFont, labelPaint, labelInsets, tickLabelsVisible, tickLabelFont, tickLabelPaint, tickLabelInsets, tickMarksVisible, tickMarkStroke, autoRange, autoTickUnitSelection, gridLinesVisible, gridStroke, gridPaint, 0.0, crosshairStroke, crosshairPaint); this.minimumDate = minimumDate; if (minimumDate!=null) { this.minimumAxisValue = (double)minimumDate.getTime(); } this.maximumDate = maximumDate; if (maximumDate!=null) { this.maximumAxisValue = (double)maximumDate.getTime(); } this.crosshairDate = crosshairDate; this.tickUnit = tickUnit; this.tickLabelFormatter = tickLabelFormatter; this.anchorValue = (double)this.anchorDate.getTime(); ### 3309, createCombinableXYChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 413, 417 13 /** * Creates a combinable XY (line) plot with default settings. * @author Bill Kelemen. * @param horizontal The horizontal axis * @param vertical The vertical axis * @param data The dataset for the chart. */ 10 public static CombinedChart createCombinableXYChart(ValueAxis horizontal, ValueAxis vertical, Dataset data) { XYPlot plot = new XYPlot(horizontal, vertical); plot.setXYItemRenderer(new StandardXYItemRenderer(StandardXYItemRenderer.LINES)); return createCombinableChart(data, plot); ### 3310, createCandlestickChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 366, 375 21 /** * Creates and returns a default instance of a candlesticks chart based on the specified * dataset. *

* Added 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. */ 18 public static JFreeChart createCandlestickChart(String title, String timeAxisLabel, String valueAxisLabel, HighLowDataset data, boolean legend) { ValueAxis timeAxis = new HorizontalDateAxis(timeAxisLabel); NumberAxis valueAxis = new VerticalNumberAxis(valueAxisLabel); XYPlot plot = new XYPlot(timeAxis, valueAxis); plot.setXYItemRenderer(new CandlestickRenderer(4.0)); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3311, createCombinableVerticalXYBarChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 468, 472 17 /** * Creates and returns a default instance of a VerticalXYBar combinable chart based on the * specified dataset. *

* @author Bill Kelemen. * @param horizontal The horizontal axis * @param vertical The vertical axis * @param data The dataset for the chart. */ 8 public static CombinedChart createCombinableVerticalXYBarChart(Axis horizontal, Axis vertical, Dataset data) { VerticalXYBarPlot plot = new VerticalXYBarPlot(horizontal, vertical); return createCombinableChart(data, plot); ### 3312, createCombinableHighLowChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 448, 454 18 /** * Creates and returns a default instance of a high-low-open-close combinable chart based on * the specified dataset. *

* @author Bill Kelemen. * @param horizontal The horizontal axis * @param vertical The vertical axis * @param data The dataset for the chart. */ 12 public static CombinedChart createCombinableHighLowChart(ValueAxis horizontal, ValueAxis vertical, Dataset data) { XYPlot plot = new XYPlot(horizontal, vertical); plot.setXYItemRenderer(new HighLowRenderer()); return createCombinableChart(data, plot); ### 3313, previousStandardDate, DateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateAxis.java, 314, 390 5 /** * Returns the previous "standard" date (based on the specified field and units). */ 138 protected Date previousStandardDate(Date date, int field, int units) { int milliseconds; int seconds; int minutes; int hours; int days; int months; int years; Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int current = calendar.get(field); int value = units*(current/units); switch (field) { case(Calendar.MILLISECOND) : { years = calendar.get(Calendar.YEAR); months = calendar.get(Calendar.MONTH); days = calendar.get(Calendar.DATE); hours = calendar.get(Calendar.HOUR_OF_DAY); minutes = calendar.get(Calendar.MINUTE); seconds = calendar.get(Calendar.SECOND); calendar.set(years, months, days, hours, minutes, seconds); calendar.set(Calendar.MILLISECOND, value); return calendar.getTime(); } case(Calendar.SECOND) : { years = calendar.get(Calendar.YEAR); months = calendar.get(Calendar.MONTH); days = calendar.get(Calendar.DATE); hours = calendar.get(Calendar.HOUR_OF_DAY); minutes = calendar.get(Calendar.MINUTE); calendar.clear(Calendar.MILLISECOND); calendar.set(years, months, days, hours, minutes, value); return calendar.getTime(); } case(Calendar.MINUTE) : { years = calendar.get(Calendar.YEAR); months = calendar.get(Calendar.MONTH); days = calendar.get(Calendar.DATE); hours = calendar.get(Calendar.HOUR_OF_DAY); calendar.clear(Calendar.MILLISECOND); calendar.set(years, months, days, hours, value, 0); return calendar.getTime(); } case(Calendar.HOUR_OF_DAY) : { years = calendar.get(Calendar.YEAR); months = calendar.get(Calendar.MONTH); days = calendar.get(Calendar.DATE); calendar.clear(Calendar.MILLISECOND); calendar.set(years, months, days, value, 0, 0); return calendar.getTime(); } case(Calendar.DATE) : { years = calendar.get(Calendar.YEAR); months = calendar.get(Calendar.MONTH); calendar.clear(Calendar.MILLISECOND); calendar.set(years, months, value, 0, 0, 0); return calendar.getTime(); } case(Calendar.MONTH) : { years = calendar.get(Calendar.YEAR); calendar.clear(Calendar.MILLISECOND); calendar.set(years, value, 1, 0, 0, 0); return calendar.getTime(); } case(Calendar.YEAR) : { calendar.clear(Calendar.MILLISECOND); calendar.set(value, 0, 1, 0, 0, 0); return calendar.getTime(); } default: return null; ### 3314, createPieChart, ChartFactory, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ChartFactory.java, 228, 232 11 /** * 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. */ 8 public static JFreeChart createPieChart(String title, PieDataset data, boolean legend) { Plot plot = new PiePlot(); JFreeChart chart = new JFreeChart(data, plot, title, JFreeChart.DEFAULT_TITLE_FONT, legend); return chart; ### 3315, setMaximumDate, DateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateAxis.java, 193, 197 7 /** * Sets the maximum date visible on the axis. * @param maximumDate The new maximum date. */ 8 public void setMaximumDate(Date maximumDate) { this.maximumDate = maximumDate; double millis = (double)maximumDate.getTime(); this.setMaximumAxisValue(millis); ### 3316, getMinimumDate, DateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateAxis.java, 165, 166 7 /** * Returns the earliest date visible on the axis. * @return The earliest date visible on the axis. */ 4 public Date getMinimumDate() { return this.minimumDate; ### 3317, setCrosshairDate, DateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateAxis.java, 240, 244 7 /** * Sets the crosshair date for the axis. * @param maximumDate The new crosshair date (null permitted). */ 8 public void setCrosshairDate(Date crosshairDate) { this.crosshairDate = crosshairDate; double millis = (double)crosshairDate.getTime(); this.setCrosshairValue(millis); ### 3318, calculateLowestVisibleTickValue, DateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateAxis.java, 299, 300 7 /** * Calculates the value of the lowest visible tick on the axis. * @return The value of the lowest visible tick on the axis. */ 4 public Date calculateLowestVisibleTickValue(DateUnit unit) { return this.nextStandardDate(minimumDate, unit.getField(), unit.getCount()); ### 3319, DateAxis, DateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateAxis.java, 77, 100 7 /** * Constructs a date axis, using default values where necessary. * @param label The axis label. */ 46 public DateAxis(String label) { this(label, Axis.DEFAULT_AXIS_LABEL_FONT, Axis.DEFAULT_AXIS_LABEL_PAINT, Axis.DEFAULT_AXIS_LABEL_INSETS, true, // tick labels visible Axis.DEFAULT_TICK_LABEL_FONT, Axis.DEFAULT_TICK_LABEL_PAINT, Axis.DEFAULT_TICK_LABEL_INSETS, true, // tick marks visible Axis.DEFAULT_TICK_STROKE, true, // auto range null, // minimum date null, // maximum date true, // auto tick unit selection new DateUnit(Calendar.DATE, 1), new SimpleDateFormat(), true, // grid lines visible ValueAxis.DEFAULT_GRID_LINE_STROKE, ValueAxis.DEFAULT_GRID_LINE_PAINT, DEFAULT_CROSSHAIR_DATE, ValueAxis.DEFAULT_CROSSHAIR_STROKE, ValueAxis.DEFAULT_CROSSHAIR_PAINT); ### 3320, getFillPaint, Bar, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Bar.java, 120, 121 7 /** * Returns the Paint object used to fill the bar. * @return The Paint used to fill the bar. */ 4 public Paint getFillPaint() { return fillPaint; ### 3321, setTickUnit, DateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateAxis.java, 280, 283 7 /** * Sets the tick unit for the axis. * @param unit The new date unit. */ 6 public void setTickUnit(DateUnit unit) { this.tickUnit = unit; this.notifyListeners(new AxisChangeEvent(this)); ### 3322, Bar, Bar, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Bar.java, 72, 78 19 /** * 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. */ 14 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; ### 3323, getAnchorDate, DateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateAxis.java, 252, 253 7 /** * Returns the anchor date for the axis. * @return The anchor date for the axis (possibly null). */ 4 public Date getAnchorDate() { return this.anchorDate; ### 3324, Bar, Bar, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Bar.java, 88, 89 13 /** * 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; */ 4 public Bar(double x, double y, double width, double height) { this(x, y, width, height, new BasicStroke(), Color.gray, Color.green); ### 3325, nextStandardDate, DateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateAxis.java, 398, 403 5 /** * Returns the first "standard" date (based on the specified field and units). */ 12 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(); ### 3326, getOutlinePaint, Bar, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Bar.java, 112, 113 7 /** * Returns the Paint object used to draw the outline of the bar. * @return The Paint used to draw the outline of the bar. */ 4 public Paint getOutlinePaint() { return outlinePaint; ### 3327, getOutlineStroke, Bar, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Bar.java, 104, 105 7 /** * Returns the Stroke object used to draw the outline of the bar. * @return The Stroke used to draw the outline of the bar. */ 4 public Stroke getOutlineStroke() { return outlineStroke; ### 3328, findAxisMagnitudeIndex, DateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateAxis.java, 409, 417 5 /** * Returns the index of the largest tick unit that will fit within the axis range. */ 16 protected int findAxisMagnitudeIndex() { long axisMagnitude = this.maximumDate.getTime()-this.minimumDate.getTime(); int index = 0; while(index * The color will be black in 12 point, plain Helvetica font (maps to Arial on Win32 systems * without Helvetica). */ 4 public DateTitle() { this(DateFormat.LONG); ### 3340, DateTitle, DateTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateTitle.java, 70, 74 23 /** * Constructs 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. */ 8 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); ### 3341, DateTitle, DateTitle, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/DateTitle.java, 88, 92 19 /** * Constructs 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; */ 8 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)); ### 3342, setTickLabelFont, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 352, 362 11 /** * 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. */ 18 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)); ### 3343, Axis, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 128, 139 7 /** * Constructs an axis, using default values where necessary. * @param label The axis label (null permitted). */ 22 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); ### 3344, getLabelInsets, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 299, 300 7 /** * Returns the insets for the label (that is, the amount of blank space that should be left * around the label). */ 4 public Insets getLabelInsets() { return this.labelInsets; ### 3345, notifyListeners, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 533, 537 9 /** * 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. */ 10 protected void notifyListeners(AxisChangeEvent event) { java.util.Iterator iterator = listeners.iterator(); while (iterator.hasNext()) { AxisChangeListener listener = (AxisChangeListener)iterator.next(); listener.axisChanged(event); ### 3346, getLabelPaint, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 270, 271 7 /** * Returns the color/shade used to draw the axis label. * @return The color/shade used to draw the axis label. */ 4 public Paint getLabelPaint() { return this.labelPaint; ### 3347, setLabel, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 219, 231 11 /** * 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). */ 24 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)); ### 3348, getTickLabelFont, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 342, 343 7 /** * Returns the font used for the tick labels (if showing). * @return The font used for the tick labels. */ 4 public Font getTickLabelFont() { return tickLabelFont; ### 3349, setTickMarksVisible, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 437, 441 11 /** * 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. */ 8 public void setTickMarksVisible(boolean flag) { if (flag!=tickMarksVisible) { tickMarksVisible = flag; notifyListeners(new AxisChangeEvent(this)); ### 3350, setTickLabelPaint, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 381, 391 11 /** * 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. */ 18 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)); ### 3351, setLabelFont, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 251, 261 11 /** * Sets the font for the axis label. *

* Registered listeners are notified of a general change to the axis. * @param font The new label font. */ 18 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)); ### 3352, isTickLabelsVisible, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 319, 320 7 /** * Returns a flag indicating whether or not the tick labels are visible. * @return A flag indicating whether or not the tick labels are visible. */ 4 public boolean isTickLabelsVisible() { return tickLabelsVisible; ### 3353, isTickMarksVisible, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 427, 428 7 /** * 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. */ 4 public boolean isTickMarksVisible() { return tickMarksVisible; ### 3354, getTickLabelInsets, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 400, 401 7 /** * Returns the insets for the tick labels. * @return The insets for the tick labels. */ 4 public Insets getTickLabelInsets() { return this.tickLabelInsets; ### 3355, Axis, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 156, 174 25 /** * 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). */ 34 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(); ### 3356, addChangeListener, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 545, 546 7 /** * Registers an object for notification of changes to the axis. * @param listener The object that is being registered. */ 4 public void addChangeListener(AxisChangeListener listener) { listeners.add(listener); ### 3357, drawVerticalString, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 564, 573 13 /** * 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. */ 14 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); ### 3359, setTickMarkStroke, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 460, 470 11 /** * 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). */ 18 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)); ### 3360, setLabelInsets, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 308, 311 9 /** * Sets the insets for the axis label, and notifies registered listeners that the axis has been * modified. * @param insets The new label insets; */ 8 public void setLabelInsets(Insets insets) { if (!insets.equals(this.labelInsets)) { this.labelInsets = insets; notifyListeners(new AxisChangeEvent(this)); ### 3361, setLabelPaint, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 280, 290 11 /** * 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. */ 18 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)); ### 3362, setTickLabelsVisible, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 329, 333 11 /** * 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. */ 8 public void setTickLabelsVisible(boolean flag) { if (flag!=tickLabelsVisible) { tickLabelsVisible = flag; notifyListeners(new AxisChangeEvent(this)); ### 3364, setPlot, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 195, 201 13 /** * 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. */ 12 public void setPlot(Plot plot) throws PlotNotCompatibleException { if (this.isCompatiblePlot(plot) || plot == null) { this.plot = plot; } else throw new PlotNotCompatibleException("Axis.setPlot(...): " +"plot not compatible with axis."); ### 3365, getLabel, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 209, 210 7 /** * Returns the label for the axis. * @return The label for the axis (null possible). */ 4 public String getLabel() { return label; ### 3366, getMaxTickLabelWidth, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 503, 517 11 /** * 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. */ 26 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; ### 3367, removeChangeListener, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 553, 554 7 /** * Deregisters an object for notification of changes to the axis. * @param listener The object to deregister. */ 4 public void removeChangeListener(AxisChangeListener listener) { listeners.remove(listener); ### 3369, getPlot, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 184, 185 11 /** * 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. */ 4 public Plot getPlot() { return plot; ### 3370, getTickMarkStroke, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 450, 451 7 /** * Returns the pen/brush used to draw tick marks (if they are showing). * @return The pen/brush used to draw tick marks. */ 4 public Stroke getTickMarkStroke() { return tickMarkStroke; ### 3372, setTickLabelInsets, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 409, 419 9 /** * Sets the insets for the tick labels, and notifies registered listeners that the axis has * been modified. * @param insets The new tick label insets. */ 18 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)); ### 3373, getLabelFont, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 241, 242 7 /** * Returns the font for the axis label. * @return The font for the axis label. */ 4 public Font getLabelFont() { return labelFont; ### 3374, getTickLabelPaint, Axis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Axis.java, 371, 372 7 /** * Returns the color/shade used for the tick labels. * @return The color/shade used for the tick labels. */ 4 public Paint getTickLabelPaint() { return this.tickLabelPaint; ### 3375, getItemGapsPercent, BarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/BarPlot.java, 270, 271 7 /** * Returns the percentage of the drawing space that is allocated to providing gaps between the * items in a category. */ 4 public double getItemGapsPercent() { return itemGapsPercent; ### 3376, setHorizontalAxis, BarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/BarPlot.java, 173, 174 7 /** * Sets the horizontal axis for the plot. * @param axis The new axis. */ 4 public void setHorizontalAxis(Axis axis) { super.setHorizontalAxis(axis); ### 3377, BarPlot, BarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/BarPlot.java, 136, 149 25 /** * Constructs a bar plot. * @param horizontalAxis The horizontal axis. * @param verticalAxis 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. * @param toolTipGenerator The tool tip generator. */ 24 protected BarPlot(Axis horizontalAxis, Axis verticalAxis, Insets insets, double introGapPercent, double trailGapPercent, double categoryGapsPercent, double itemGapsPercent, CategoryToolTipGenerator toolTipGenerator) { super(horizontalAxis, verticalAxis); this.insets = insets; this.introGapPercent = introGapPercent; this.trailGapPercent = trailGapPercent; this.categoryGapsPercent = categoryGapsPercent; this.itemGapsPercent = itemGapsPercent; this.toolTipGenerator = toolTipGenerator; ### 3378, setCategoryGapsPercent, BarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/BarPlot.java, 250, 261 11 /** * 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 percent The new gap value, expressed as a percentage of the width of the plot area * (0.05 = 5 percent). */ 20 public void setCategoryGapsPercent(double percent) { // check argument... if ((percent<0.0) || (percent>MAX_CATEGORY_GAPS_PERCENT)) { throw new IllegalArgumentException("BarPlot.setCategoryGapsPercent(double): argument " +"outside valid range."); } // make the change... if (this.categoryGapsPercent!=percent) { this.categoryGapsPercent=percent; notifyListeners(new PlotChangeEvent(this)); ### 3379, setVerticalAxis, BarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/BarPlot.java, 165, 166 7 /** * Sets the vertical axis for the plot. * @param axis The new axis. */ 4 public void setVerticalAxis(Axis axis) { super.setVerticalAxis(axis); ### 3380, getDataset, BarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/BarPlot.java, 157, 158 7 /** * A convenience method that returns the dataset for the plot, cast as a * CategoryDataset. */ 4 public CategoryDataset getDataset() { return (CategoryDataset)chart.getDataset(); ### 3381, setTrailGapPercent, BarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/BarPlot.java, 220, 231 11 /** * 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, expressed as a percentage of the width of the plot area * (0.05 = 5 percent). */ 20 public void setTrailGapPercent(double percent) { // check argument... if ((percent<0.0) || (percent>MAX_TRAIL_GAP_PERCENT)) { throw new IllegalArgumentException("BarPlot.setTrailGapPercent(double): argument " +"outside valid range."); } // make the change... if (this.trailGapPercent!=percent) { trailGapPercent = percent; notifyListeners(new PlotChangeEvent(this)); ### 3382, getTrailGapPercent, BarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/BarPlot.java, 210, 211 7 /** * Returns the gap following the last bar on the chart, as a percentage of the available * drawing space. */ 4 public double getTrailGapPercent() { return trailGapPercent; ### 3383, getIntroGapPercent, BarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/BarPlot.java, 181, 182 7 /** * Returns the gap before the first bar on the chart, as a percentage of the available drawing * space (0.05 = 5 percent). */ 4 public double getIntroGapPercent() { return introGapPercent; ### 3384, setIntroGapPercent, BarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/BarPlot.java, 191, 202 11 /** * 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, expressed as a percentage of the width of the plot area * (0.05 = 5 percent). */ 20 public void setIntroGapPercent(double percent) { // check argument... if ((percent<0.0) || (percent>MAX_INTRO_GAP_PERCENT)) { throw new IllegalArgumentException("BarPlot.setIntroGapPercent(double): argument " +"outside valid range."); } // make the change... if (this.introGapPercent!=percent) { this.introGapPercent = percent; notifyListeners(new PlotChangeEvent(this)); ### 3385, setItemGapsPercent, BarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/BarPlot.java, 280, 291 11 /** * Sets the gap between one bar and the next within the same category, and notifies registered * listeners that the plot has been modified. * @param percent The new gap value, expressed as a percentage of the width of the plot area * (0.05 = 5 percent). */ 20 public void setItemGapsPercent(double percent) { // check argument... if ((percent<0.0) || (percent>MAX_ITEM_GAPS_PERCENT)) { throw new IllegalArgumentException("BarPlot.setItemGapsPercent(double): argument " +"outside valid range."); } // make the change... if (percent!=this.itemGapsPercent) { this.itemGapsPercent = percent; notifyListeners(new PlotChangeEvent(this)); ### 3386, BarPlot, BarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/BarPlot.java, 111, 119 9 /** * Constructs a bar plot, using default values where necessary. * @param horizontalAxis The horizontal axis. * @param verticalAxis The vertical axis. */ 16 protected BarPlot(Axis horizontalAxis, Axis verticalAxis) { this(horizontalAxis, verticalAxis, Plot.DEFAULT_INSETS, DEFAULT_INTRO_GAP_PERCENT, DEFAULT_TRAIL_GAP_PERCENT, DEFAULT_CATEGORY_GAPS_PERCENT, DEFAULT_ITEM_GAPS_PERCENT, null); // tool tip generator ### 3387, getCategoryGapsPercent, BarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/BarPlot.java, 240, 241 7 /** * Returns the percentage of the drawing space that is allocated to providing gaps between the * categories. */ 4 public double getCategoryGapsPercent() { return categoryGapsPercent; ### 3390, PeriodMarkerPlot, PeriodMarkerPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PeriodMarkerPlot.java, 55, 58 1 /** Creates new SignalsPlot */ 6 public PeriodMarkerPlot(Axis horizontal, Axis vertical) throws AxisNotCompatibleException, PlotNotCompatibleException { super(horizontal, vertical); ### 3391, isCompatibleVerticalAxis, PeriodMarkerPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PeriodMarkerPlot.java, 100, 105 11 /** * Checks the compatibility of a vertical axis, returning true if the axis is compatible with * the plot, and false otherwise. The vertical axis for this plot must be an instance of * VerticalNumberAxis. * @param axis The vertical axis. */ 12 public boolean isCompatibleVerticalAxis(Axis axis) { if (axis instanceof VerticalNumberAxis) return true; else return false; ### 3392, draw, PeriodMarkerPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PeriodMarkerPlot.java, 195, 234 9 /** * 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; */ 62 public void draw(Graphics2D g2, Rectangle2D drawArea, DrawInfo info){ 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); } // we can cast the axes because HiLowPlot enforces support of these interfaces HorizontalAxis ha = getHorizontalAxis(); VerticalAxis va = getVerticalAxis(); double h = ha.reserveHeight(g2, this, drawArea); Rectangle2D vAxisArea = va.reserveAxisArea(g2, this, drawArea, h); // compute the plot area Rectangle2D plotArea = new Rectangle2D.Double(drawArea.getX()+vAxisArea.getWidth(), drawArea.getY(), drawArea.getWidth()-vAxisArea.getWidth(), drawArea.getHeight()-h); drawOutlineAndBackground(g2, plotArea); // draw the axes this.horizontalAxis.draw(g2, drawArea, plotArea); this.verticalAxis.draw(g2, drawArea, plotArea); Shape originalClip = g2.getClip(); g2.clip(plotArea); //SignalsDataset data = getDataset(); XYDataset data = getTempXYDataset(); if( data!= null ){ int seriesCount = data.getSeriesCount(); for(int serie=0; serie=count)) { throw new IllegalArgumentException("LinePlot.getCategoryCoordinate(...): " +"category outside valid range."); } if (area==null) { throw new IllegalArgumentException("LinePlot.getCategoryCoordinate(...): " +"null area not permitted."); } // calculate result... double result = area.getX() + area.getWidth()/2; if (count>1) { double available = area.getWidth() * (1-introGapPercent-trailGapPercent); result = area.getX()+(introGapPercent*area.getWidth()) +(category*1.0/(count-1.0))*available; } return result; ### 3406, getMinimumVerticalDataValue, LinePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/LinePlot.java, 315, 321 7 /** * Returns the minimum value in the range, since this is plotted against the vertical axis for * LinePlot. */ 12 public Number getMinimumVerticalDataValue() { Dataset data = this.getChart().getDataset(); if (data!=null) { return Datasets.getMinimumRangeValue(data); } else return null; ### 3407, setIntroGapPercent, LinePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/LinePlot.java, 114, 125 7 /** * Sets the intro gap. * @param The gap as a percentage of the total width. */ 20 public void setIntroGapPercent(double percent) { // check arguments... if ((percent<=0.0) || (percent>MAX_INTRO_GAP)) { throw new IllegalArgumentException("LinePlot.setIntroGapPercent(double): " +"gap percent outside valid range."); } // make the change... if (introGapPercent!=percent) { introGapPercent = percent; notifyListeners(new PlotChangeEvent(this)); ### 3408, getDataset, LinePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/LinePlot.java, 161, 162 5 /** * A convenience method that returns the dataset for the plot, cast as a CategoryDataset. */ 4 public CategoryDataset getDataset() { return (CategoryDataset)chart.getDataset(); ### 3409, setTrailGapPercent, LinePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/LinePlot.java, 142, 153 7 /** * Sets the trail gap. * @param The gap as a percentage of the total width. */ 20 public void setTrailGapPercent(double percent) { // check arguments... if ((percent<=0.0) || (percent>MAX_TRAIL_GAP)) { throw new IllegalArgumentException("LinePlot.setTrailGapPercent(double): " +"gap percent outside valid range."); } // make the change... if (trailGapPercent!=percent) { trailGapPercent = percent; notifyListeners(new PlotChangeEvent(this)); ### 3410, getValueAxis, LinePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/LinePlot.java, 177, 178 7 /** * A convenience method that returns a reference to the vertical axis cast as a * VerticalNumberAxis. */ 4 public VerticalNumberAxis getValueAxis() { return (VerticalNumberAxis)verticalAxis; ### 3411, getTrailGapPercent, LinePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/LinePlot.java, 134, 135 7 /** * Returns the trail gap. * @return The trail gap as a percentage of the available width. */ 4 public double getTrailGapPercent() { return this.introGapPercent; ### 3412, isCompatibleHorizontalAxis, LinePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/LinePlot.java, 223, 227 9 /** * Checks the compatibility of a horizontal axis, returning true if the axis is compatible with * the plot, and false otherwise. * @param axis The horizontal axis. */ 10 public boolean isCompatibleHorizontalAxis(Axis axis) { if (axis instanceof CategoryAxis) { return true; } else return false; ### 3413, isCompatibleVerticalAxis, LinePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/LinePlot.java, 235, 239 9 /** * 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; */ 10 public boolean isCompatibleVerticalAxis(Axis axis) { if (axis instanceof VerticalNumberAxis) { return true; } else return false; ### 3414, getCategories, LinePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/LinePlot.java, 184, 185 5 /** * A convenience method that returns a list of the categories in the data source. */ 4 public java.util.List getCategories() { return getDataset().getCategories(); ### 3415, getPlotType, LinePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/LinePlot.java, 307, 308 5 /** * Returns a short string describing the plot type; */ 4 public String getPlotType() { return "Line Plot"; ### 3416, draw, LinePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/LinePlot.java, 248, 299 11 /** * 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. * @param info Collects info about the drawing. */ 84 public void draw(Graphics2D g2, Rectangle2D drawArea, DrawInfo info) { // adjust the drawing area for the 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 thus the area available for plotting... 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); getCategoryAxis().draw(g2, drawArea, plotArea); getValueAxis().draw(g2, drawArea, plotArea); // now get the data and plot the lines (or shapes, or lines and shapes)... CategoryDataset data = this.getDataset(); if (data!=null) { Shape originalClip=g2.getClip(); g2.clip(plotArea); int seriesCount = data.getSeriesCount(); int categoryCount = data.getCategoryCount(); int categoryIndex = 0; Object previousCategory = null; Iterator iterator = data.getCategories().iterator(); while (iterator.hasNext()) { Object category = iterator.next(); for (int series=0; series * If autoTickUnitSelection is on, the tick unit for the axis will be automatically selected * from this collection. */ 4 public TickUnits getStandardTickUnits() { return this.standardTickUnits; ### 3421, setLowerMargin, NumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberAxis.java, 321, 323 7 /** * Sets the lower margin. * @param margin The new margin; */ 6 public void setLowerMargin(double margin) { this.lowerMargin = margin; notifyListeners(new AxisChangeEvent(this)); ### 3422, calculateLowestVisibleTickValue, NumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberAxis.java, 381, 386 7 /** * Calculates the value of the lowest visible tick on the axis. * @return The value of the lowest visible tick on the axis. */ 10 public double calculateLowestVisibleTickValue() { //double min = minimumAxisValue.doubleValue(); double unit = getTickUnit().getValue().doubleValue(); double index = Math.ceil(minimumAxisValue/unit); return index*unit; ### 3423, getUpperMargin, NumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberAxis.java, 296, 297 7 /** * Returns the margin (as a percentage of the range) by which the maximum axis value exceeds * the maximum data value. */ 4 public double getUpperMargin() { return this.upperMargin; ### 3424, setStandardTickUnits, NumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberAxis.java, 340, 342 7 /** * Sets the standard tick units for the axis. * @param units The tick units. */ 6 public void setStandardTickUnits(TickUnits units) { this.standardTickUnits = units; notifyListeners(new AxisChangeEvent(this)); ### 3425, setUpperMargin, NumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberAxis.java, 304, 306 7 /** * Sets the upper margin. * @param margin The new margin; */ 6 public void setUpperMargin(double margin) { this.upperMargin = margin; notifyListeners(new AxisChangeEvent(this)); ### 3426, autoRangeIncludesZero, NumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberAxis.java, 248, 249 7 /** * Returns the flag that indicates whether or not the automatic axis range (if indeed it is * determined automatically) is forced to include zero. */ 4 public boolean autoRangeIncludesZero() { return this.autoRangeIncludesZero; ### 3427, setTickUnit, NumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberAxis.java, 360, 363 13 /** * Sets the tick unit for the axis. *

* Registered listeners are notified that the axis has been changed. This method also sets the * AutoTickUnit property to false. * @param unit The new tick unit. */ 6 public void setTickUnit(NumberTickUnit unit) { this.autoTickUnitSelection = false; this.tickUnit = unit; ### 3428, NumberAxis, NumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberAxis.java, 109, 134 7 /** * Constructs a number axis, using default values where necessary. * @param label The axis label. */ 50 protected NumberAxis(String label) { this(label, Axis.DEFAULT_AXIS_LABEL_FONT, Axis.DEFAULT_AXIS_LABEL_PAINT, Axis.DEFAULT_AXIS_LABEL_INSETS, true, // tick labels visible Axis.DEFAULT_TICK_LABEL_FONT, Axis.DEFAULT_TICK_LABEL_PAINT, Axis.DEFAULT_TICK_LABEL_INSETS, true, // tick marks visible Axis.DEFAULT_TICK_STROKE, true, // auto range true, // auto range includes zero NumberAxis.DEFAULT_MINIMUM_AUTO_RANGE, ValueAxis.DEFAULT_MINIMUM_AXIS_VALUE, ValueAxis.DEFAULT_MAXIMUM_AXIS_VALUE, false, // inverted true, // auto tick unit NumberAxis.DEFAULT_TICK_UNIT, true, // grid lines visible ValueAxis.DEFAULT_GRID_LINE_STROKE, ValueAxis.DEFAULT_GRID_LINE_PAINT, 0.0, // crosshair value ValueAxis.DEFAULT_CROSSHAIR_STROKE, ValueAxis.DEFAULT_CROSSHAIR_PAINT); ### 3429, NumberAxis, NumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberAxis.java, 167, 227 57 /** * Constructs a number axis. * @param label The axis label. * @param labelFont The font for displaying the axis label. * @param labelPaint The paint used to display the axis label. * @param labelInsets The amount of blank space around the axis label. * @param tickLabelsVisible Flag indicating whether or not the tick labels are visible. * @param tickLabelFont The font used to display the tick labels. * @param tickLabelPaint The paint used to draw the tick labels. * @param tickLabelInsets The amount of blank space around the tick labels. * @param tickMarksVisible Flag indicating whether or not tick marks are visible; * @param tickMarkStroke The stroke used to draw the tick marks (if visible); * @param autoRange Flag indicating whether or not the axis range is automatically determined. * @param autoRangeIncludesZero A flag indicating whether the auto range must include zero. * @param autoRangeMinimumSize The minimum size for the auto range. * @param minimumAxisValue The lowest value shown on the axis. * @param maximumAxisValue The highest value shown on the axis. * @param inverted A flag indicating whether the axis is normal or inverted (inverted means * running from positive to negative). * @param autoTickUnitSelection A flag indicating whether or not the tick value is automatically * selected. * @param tickUnit The tick unit for the axis. * @param gridLinesVisible Flag indicating whether or not grid lines are visible. * @param gridStroke The pen/brush used to display grid lines (if visible). * @param gridPaint The color used to display grid lines (if visible). * @param crosshairValue The value at which to draw the crosshair line (null permitted). * @param crosshairStroke The pen/brush used to draw the data line. * @param crosshairPaint The color used to draw the data line. */ 100 protected NumberAxis(String label, Font labelFont, Paint labelPaint, Insets labelInsets, boolean tickLabelsVisible, Font tickLabelFont, Paint tickLabelPaint, Insets tickLabelInsets, boolean tickMarksVisible, Stroke tickMarkStroke, boolean autoRange, boolean autoRangeIncludesZero, Number autoRangeMinimumSize, double minimumAxisValue, double maximumAxisValue, boolean inverted, boolean autoTickUnitSelection, NumberTickUnit tickUnit, boolean gridLinesVisible, Stroke gridStroke, Paint gridPaint, double crosshairValue, Stroke crosshairStroke, Paint crosshairPaint) { super(label, labelFont, labelPaint, labelInsets, tickLabelsVisible, tickLabelFont, tickLabelPaint, tickLabelInsets, tickMarksVisible, tickMarkStroke, autoRange, autoTickUnitSelection, gridLinesVisible, gridStroke, gridPaint, crosshairValue, crosshairStroke, crosshairPaint); // check arguments... if (minimumAxisValue>=maximumAxisValue) { throw new IllegalArgumentException("NumberAxis(...): minimum axis value must be less " +"than maximum axis value."); } if (!autoRange) { // if (minimumAxisValue == null) { // throw new IllegalArgumentException("NumberAxis(...): minimum axis value must be " // +"specified if auto range calculation is off."); // // } // if (maximumAxisValue == null) { // throw new IllegalArgumentException("NumberAxis(...): maximum axis value must be " // +"specified if auto range calculation is off."); // } } if (autoRangeMinimumSize==null) { throw new IllegalArgumentException("NumberAxis(...): autoRangeMinimum cannot be null."); } // do the initialisation... this.autoRangeIncludesZero = autoRangeIncludesZero; this.autoRangeMinimumSize = autoRangeMinimumSize; this.minimumAxisValue = minimumAxisValue; this.maximumAxisValue = maximumAxisValue; this.anchorValue = 0.0; this.inverted = inverted; this.tickUnit = tickUnit; this.upperMargin = DEFAULT_UPPER_MARGIN; this.lowerMargin = DEFAULT_LOWER_MARGIN; this.standardTickUnits = createStandardTickUnits(); ### 3430, calculateVisibleTickCount, NumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberAxis.java, 407, 412 7 /** * Calculates the number of visible ticks. * @return The number of visible ticks on the axis. */ 10 public int calculateVisibleTickCount() { //double low = minimumAxisValue.doubleValue(); //double high = maximumAxisValue.doubleValue(); double unit = getTickUnit().getValue().doubleValue(); return (int)(Math.floor(maximumAxisValue/unit)-Math.ceil(minimumAxisValue/unit)+1); ### 3431, getLowerMargin, NumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberAxis.java, 313, 314 7 /** * Returns the margin (as a percentage of the range) by which the minimum axis value is less * than the minimum data value. */ 4 public double getLowerMargin() { return this.lowerMargin; ### 3432, setAutoRangeMinimumSize, NumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberAxis.java, 276, 287 7 /** * Sets the minimum size of the automatic axis range. * @param minimum The new minimum. */ 20 public void setAutoRangeMinimumSize(Number size) { // check argument... if (size==null) { throw new IllegalArgumentException("NumberAxis.setAutoRangeMinimumSize(Number): " +"null not permitted."); } // make the change... if (autoRangeMinimumSize.doubleValue()!=size.doubleValue()) { this.autoRangeMinimumSize = size; notifyListeners(new AxisChangeEvent(this)); ### 3433, getAutoRangeMinimumSize, NumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberAxis.java, 268, 269 7 /** * Returns the minimum size of the automatic axis range (if indeed it is determined * automatically). */ 4 public Number getAutoRangeMinimumSize() { return this.autoRangeMinimumSize; ### 3434, calculateHighestVisibleTickValue, NumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberAxis.java, 394, 399 7 /** * Calculates the value of the highest visible tick on the axis. * @return The value of the highest visible tick on the axis. */ 10 public double calculateHighestVisibleTickValue() { //double max = maximumAxisValue.doubleValue(); double unit = getTickUnit().getValue().doubleValue(); double index = Math.floor(maximumAxisValue/unit); return index*unit; ### 3435, NumberTickUnit, NumberTickUnit, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/NumberTickUnit.java, 55, 57 9 /** * Creates a new number tick unit. * @param value The size of the tick unit. * @param formatter A number formatter for the tick unit. */ 6 public NumberTickUnit(Number value, NumberFormat formatter) { super(value); this.formatter = formatter; ### 3436, Line, Line, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Line.java, 55, 56 5 /** * Standard constructor, with default values for the colors. */ 4 public Line(double x1, double y1, double x2, double y2) { this(x1, y1, x2, y2, new BasicStroke(), Color.blue); ### 3437, Line, Line, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Line.java, 62, 65 5 /** * Standard constructor. */ 8 public Line(double x1, double y1, double x2, double y2, Stroke stroke, Paint paint) { this.line = new Line2D.Double(x1, y1, x2, y2); this.stroke = stroke; this.paint = paint; ### 3438, getStroke, Line, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Line.java, 78, 79 5 /** * Returns the Stroke object used to draw the line. */ 4 public Stroke getStroke() { return stroke; ### 3439, getLine, Line, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Line.java, 71, 72 5 /** * Returns the line. */ 4 public Line2D getLine() { return line; ### 3440, LineAndShapeRenderer, LineAndShapeRenderer, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/LineAndShapeRenderer.java, 81, 86 7 /** * Constructs a renderer of the specified type. * @param The type of renderer. Use one of the constants SHAPES, LINES or SHAPES_AND_LINES. */ 12 public LineAndShapeRenderer(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; ### 3441, LineAndShapeRenderer, LineAndShapeRenderer, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/LineAndShapeRenderer.java, 73, 74 5 /** * Constructs a renderer that draws shapes only. */ 4 public LineAndShapeRenderer() { this(SHAPES_AND_LINES); ### 3442, drawCategoryItem, LineAndShapeRenderer, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/LineAndShapeRenderer.java, 103, 138 25 /** * Draw a single data item. * @param g2 The graphics device. * @param plotArea The data plot area. * @param plot The plot. * @param axis The range axis. * @param data The data. * @param series The series number (zero-based index). * @param category The category. * @param categoryIndex The category number (zero-based index). * @param previousCategory The previous category (will be null when the first category is * drawn). */ 58 public void drawCategoryItem(Graphics2D g2, Rectangle2D dataArea, CategoryPlot plot, ValueAxis axis, CategoryDataset data, int series, Object category, int categoryIndex, Object previousCategory) { // first check the number we are plotting... Number value = data.getValue(series, category); if (value!=null) { // Current X double x1 = plot.getCategoryCoordinate(categoryIndex, dataArea); // Current Y double y1 = axis.translateValueToJava2D(value.doubleValue(), dataArea); g2.setPaint(((Plot)plot).getSeriesPaint(series)); g2.setStroke(((Plot)plot).getSeriesStroke(series)); if (this.plotShapes) { Shape shape = ((Plot)plot).getShape(series, category, x1, y1, shapeScale); g2.fill(shape); //g2.draw(shape); } if (this.plotLines) { if (previousCategory!=null) { Number previousValue = data.getValue(series, previousCategory); if (previousValue!=null) { // get the previous data point... double x0 = plot.getCategoryCoordinate(categoryIndex-1, dataArea); double y0 = axis.translateValueToJava2D(previousValue.doubleValue(), dataArea); g2.setPaint(((Plot)plot).getSeriesPaint(series)); g2.setStroke(((Plot)plot).getSeriesStroke(series)); Line2D line = new Line2D.Double(x0, y0, x1, y1); g2.draw(line); ### 3443, PiePlot, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 146, 157 5 /** * Constructs a new pie plot. */ 22 public PiePlot() { this(DEFAULT_INTERIOR_GAP, true, // circular DEFAULT_RADIUS, NAME_LABELS, DEFAULT_SECTION_LABEL_FONT, DEFAULT_SECTION_LABEL_PAINT, DEFAULT_SECTION_LABEL_GAP, "0.0", new Insets(2, 2, 2, 2), null); ### 3444, setRadiusPercent, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 257, 268 7 /** * Sets the radius percentage. * @param percent The new value. */ 20 public void setRadiusPercent(double percent) { // check arguments... if ((percent<=0.0) || (percent>MAX_RADIUS)) { throw new IllegalArgumentException("PiePlot.setRadiusPercent(double): " +"percentage outside valid range."); } // make the change (if necessary)... if (this.radiusPercent!=percent) { this.radiusPercent = percent; this.notifyListeners(new PlotChangeEvent(this)); ### 3445, getSectionLabelFont, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 311, 312 7 /** * Returns the section label font. * @return The section label font. */ 4 public Font getSectionLabelFont() { return this.sectionLabelFont; ### 3446, setInteriorGapPercent, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 205, 216 5 /** * Sets the interior gap percent. */ 20 public void setInteriorGapPercent(double percent) { // check arguments... if ((percent<0.0) || (percent>MAX_INTERIOR_GAP)) { throw new IllegalArgumentException("PiePlot.setInteriorGapPercent(double): " +"percentage outside valid range."); } // make the change... if (this.interiorGapPercent!=percent) { this.interiorGapPercent = percent; notifyListeners(new PlotChangeEvent(this)); ### 3447, drawLabel, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 629, 655 19 /** * Draws the label for one pie section. * @param g2 The graphics device. * @param pieArea The area for the unexploded pie sections. * @param explodedPieArea The area for the exploded pie section. * @param data The data for the plot. * @param section The section (zero-based index). * @param startAngle The starting angle. * @param extent The extent of the arc. */ 50 protected void drawLabel(Graphics2D g2, Rectangle2D pieArea, Rectangle2D explodedPieArea, PieDataset data, int section, double startAngle, double extent) { // handle label drawing... FontRenderContext frc = g2.getFontRenderContext(); String[] legendItemLabels = chart.getLegendItemLabels(); String label = ""; if (this.sectionLabelType==NAME_LABELS) { label = legendItemLabels[section]; } else if (this.sectionLabelType==PERCENT_LABELS) { label = percentFormatter.format(extent/3.60)+"%"; } else if (this.sectionLabelType==NAME_AND_PERCENT_LABELS) { label = legendItemLabels[section]+" ("+percentFormatter.format(extent/3.60)+"%)"; } Rectangle2D labelBounds = this.sectionLabelFont.getStringBounds(label, frc); LineMetrics lm = this.sectionLabelFont.getLineMetrics(label, frc); double ascent = lm.getAscent(); Point2D labelLocation = this.calculateLabelLocation(labelBounds, ascent, pieArea, explodedPieArea, startAngle, extent, this.getExplodePercent(section)); g2.setPaint(this.sectionLabelPaint); g2.setFont(this.sectionLabelFont); g2.drawString(label, (float)labelLocation.getX(), (float)labelLocation.getY()); ### 3448, getRadiusPercent, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 249, 250 7 /** * Returns the radius percentage. * @return The radius percentage. */ 4 public double getRadiusPercent() { return this.radiusPercent; ### 3449, setPercentFormatString, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 397, 398 5 /** * Sets the format string for the percent labels. */ 4 public void setPercentFormatString(String format) { this.percentFormatter = new DecimalFormat(format); ### 3450, setSectionLabelFont, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 321, 332 11 /** * Sets the section label font. *

* Notifies registered listeners that the plot has been changed. * @param font The new section label font. */ 20 public void setSectionLabelFont(Font font) { // check arguments... if (font==null) { throw new IllegalArgumentException("PiePlot.setSectionLabelFont(...): " +"null font not allowed."); } // make the change... if (!this.sectionLabelFont.equals(font)) { this.sectionLabelFont = font; notifyListeners(new PlotChangeEvent(this)); ### 3451, getArcBounds, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 695, 709 17 /** * Returns a rectangle that can be used to create a pie section (taking into account the * amount by which the pie section is 'exploded'). * @param unexploded The area inside which the unexploded pie sections are drawn. * @param exploded The area inside which the exploded pie sections are drawn. * @param startAngle The start angle. * @param extent The extent of the arc. * @param explodePercent The amount by which the pie section is exploded. */ 28 protected Rectangle2D getArcBounds(Rectangle2D unexploded, Rectangle2D exploded, double startAngle, double extent, double explodePercent) { if (explodePercent==0.0) { return unexploded; } else { Arc2D arc1 = new Arc2D.Double(unexploded, startAngle, extent/2, Arc2D.OPEN); Point2D point1 = arc1.getEndPoint(); Arc2D.Double arc2 = new Arc2D.Double(exploded, startAngle, extent/2, Arc2D.OPEN); Point2D point2 = arc2.getEndPoint(); double deltaX = (point1.getX()-point2.getX())*explodePercent; double deltaY = (point1.getY()-point2.getY())*explodePercent; return new Rectangle2D.Double(unexploded.getX()-deltaX, unexploded.getY()-deltaY, unexploded.getWidth(), unexploded.getHeight()); ### 3452, getDataset, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 464, 465 11 /** * Returns the dataset for the plot, cast as a PieDataset. *

* Provided for convenience. * @return The dataset for the plot, cast as a PieDataset. */ 4 public PieDataset getDataset() { return (PieDataset)chart.getDataset(); ### 3453, getExplodePercent, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 405, 422 7 /** * Returns the amount that a section should be 'exploded'. *

*/ 28 public double getExplodePercent(int section) { // check argument... if (section<0) { throw new IllegalArgumentException("PiePlot.getExplodePercent(int): " +"section outside valid range."); } // fetch the result... double result = 0.0; if (this.explodePercentages!=null) { if (section=this.getDataset().getCategories().size())) { throw new IllegalArgumentException("PiePlot.setExplodePercent(int, double): " +"section outside valid range."); } // store the value in an appropriate data structure... if (this.explodePercentages!=null) { if (section0) { totalValue = totalValue + v; } } } // For each positive value in the dataseries, compute and draw the corresponding arc. double sumTotal = 0; int section = 0; iterator = ss.iterator(); while (iterator.hasNext()) { Object current = iterator.next(); Number dataValue = data.getValue(current); if (dataValue!=null) { double value = dataValue.doubleValue(); if (value>0) { // draw the pie section... double startAngle = sumTotal * 360 / totalValue; double extent = (sumTotal+value) * 360 / totalValue - startAngle; Rectangle2D arcBounds = getArcBounds(pieArea, explodedPieArea, startAngle, extent, this.getExplodePercent(section)); Arc2D.Double arc = new Arc2D.Double(arcBounds, startAngle, extent, Arc2D.PIE); sumTotal += value; Paint paint = this.getSeriesPaint(section); Paint outlinePaint = this.getSeriesOutlinePaint(section); g2.setPaint(paint); g2.fill(arc); g2.setStroke(new BasicStroke()); g2.setPaint(outlinePaint); g2.draw(arc); // add a tooltip for the bar... if (tooltips!=null) { if (this.toolTipGenerator==null) { toolTipGenerator = new StandardPieToolTipGenerator(); } String tip = this.toolTipGenerator.generateToolTip(data, current); if (arc!=null) { tooltips.addToolTip(tip, arc); } } // then draw the label... if (this.sectionLabelType!=NO_LABELS) { this.drawLabel(g2, pieArea, explodedPieArea, data, section, startAngle, extent); } } } section = section + 1; ### 3463, PiePlot, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 173, 190 23 /** * Constructs a pie plot. * @param interiorGapPercent The interior gap (space for labels) as a percentage of the * available space. * @param circular Flag indicating whether the pie chart is circular or elliptical. * @param radiusPercent The radius of the pie chart, as a percentage of the available space * (after accounting for interior gap). * @param sectionLabelFont The font for the section labels. * @param sectionLabelPaint The color for the section labels. * @param sectionLabelGapPercent The space between the pie sections and the labels. * @param insets The gaps between the plot area and the border of the chart. */ 34 public PiePlot(double interiorGapPercent, boolean circular, double radiusPercent, int sectionLabelType, Font sectionLabelFont, Paint sectionLabelPaint, double sectionLabelGapPercent, String percentFormatString, Insets insets, PieToolTipGenerator tooltipGenerator) { super(null, null); this.interiorGapPercent = interiorGapPercent; this.circular = circular; this.radiusPercent = radiusPercent; this.sectionLabelType = sectionLabelType; this.sectionLabelFont = sectionLabelFont; this.sectionLabelPaint = sectionLabelPaint; this.sectionLabelGapPercent = sectionLabelGapPercent; this.percentFormatter = new DecimalFormat(percentFormatString); this.explodePercentages = null; this.toolTipGenerator = tooltipGenerator; setInsets(insets); ### 3464, isCompatibleHorizontalAxis, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 671, 673 9 /** * Returns true if the axis is compatible with the pie plot, and false otherwise. Since a pie * plot requires no axes, only a null axis is compatible. * @param axis The axis. */ 6 public boolean isCompatibleHorizontalAxis(Axis axis) { if (axis==null) return true; else return false; ### 3465, setSectionLabelPaint, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 351, 362 11 /** * Sets the section label paint. *

* Notifies registered listeners that the plot has been changed. * @param paint The new section label paint. */ 20 public void setSectionLabelPaint(Paint paint) { // check arguments... if (paint==null) { throw new IllegalArgumentException("PiePlot.setSectionLabelPaint(...): " +"null paint not allowed."); } // make the change... if (!this.sectionLabelPaint.equals(paint)) { this.sectionLabelPaint = paint; notifyListeners(new PlotChangeEvent(this)); ### 3466, setSectionLabelType, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 288, 302 11 /** * Sets the section label type. *

* Valid types are defined by the following constants: NO_LABELS, NAME_LABELS, PERCENT_LABELS, * NAME_AND_PERCENT_LABELS. */ 22 public void setSectionLabelType(int type) { // check the argument... if ((type!=NO_LABELS) && (type!=NAME_LABELS) && (type!=PERCENT_LABELS) && (type!=NAME_AND_PERCENT_LABELS)) { throw new IllegalArgumentException("PiePlot.setSectionLabelType(int): " +"unrecognised type."); } // make the change... if (sectionLabelType!=type) { this.sectionLabelType = type; notifyListeners(new PlotChangeEvent(this)); ### 3467, setSectionLabelGapPercent, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 378, 389 5 /** * Sets the section label gap percent. */ 20 public void setSectionLabelGapPercent(double percent) { // check arguments... if ((percent<0.0) || (percent>MAX_SECTION_LABEL_GAP)) { throw new IllegalArgumentException("PiePlot.setSectionLabelGapPercent(double): " +"percentage outside valid range."); } // make the change... if (this.sectionLabelGapPercent!=percent) { this.sectionLabelGapPercent = percent; notifyListeners(new PlotChangeEvent(this)); ### 3468, getPlotType, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 662, 663 5 /** * Returns a short string describing the type of plot. */ 4 public String getPlotType() { return "Pie Plot"; ### 3469, getInteriorGapPercent, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 198, 199 7 /** * Returns the interior gap, measures as a percentage of the available drawing space. * @return The interior gap, measured as a percentage of the available drawing space. */ 4 public double getInteriorGapPercent() { return this.interiorGapPercent; ### 3470, getSectionLabelGapPercent, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 371, 372 7 /** * Returns the section label gap, measures as a percentage of the radius. * @return The section label gap, measures as a percentage of the radius. */ 4 public double getSectionLabelGapPercent() { return this.sectionLabelGapPercent; ### 3471, getSectionLabelType, PiePlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/PiePlot.java, 278, 279 9 /** * Returns the section label type. Defined by the constants: NO_LABELS, NAME_LABELS, * PERCENT_LABELS and NAME_AND_PERCENT_LABELS. * @return The section label type. */ 4 public int getSectionLabelType() { return this.sectionLabelType; ### 3472, getVerticalAxis, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 230, 231 9 /** * Returns a reference to the vertical axis. * @return A reference to the vertical axis. * @see Plot#getAxis */ 4 public VerticalAxis getVerticalAxis() { return (VerticalAxis)verticalAxis; ### 3473, setChart, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 327, 338 9 /** * Sets a reference back to the chart that this plot belongs to. Reconfigures the axes * according to the chart's data source. * @param chart The chart that the plot belongs to. */ 18 public void setChart(JFreeChart chart) { // if replacing an existing chart, the plot may be a registered listener... if (this.chart!=null) { chart.removeChangeListener(this); } this.chart = chart; // new chart means new data source, so reconfigure axes... if (verticalAxis!=null) verticalAxis.configure(); if (horizontalAxis!=null) horizontalAxis.configure(); ### 3474, getMaximumHorizontalDataValue, VerticalXYBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalXYBarPlot.java, 234, 240 7 /** * Returns the maximum value in either the domain or the range, whichever is displayed against * the horizontal axis for the particular type of plot implementing this interface. */ 12 public Number getMaximumHorizontalDataValue() { Dataset data = this.getChart().getDataset(); if (data!=null) { return Datasets.getMaximumDomainValue(data); } else return null; ### 3475, handleClick, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 585, 598 13 /** * Handles a 'click' on the plot. Since the plot does not maintain any information about where * it has been drawn, the plot area is supplied as an argument. * @param x The x coordinate. * @param y The y coordinate. * @param plotArea The area in which the plot is assumed to be drawn. */ 24 public void handleClick(int x, int y, DrawInfo info) { // translate x into a data value // if the axis is a value axis, set the crosshair value if (horizontalAxis instanceof ValueAxis) { ValueAxis hva = (ValueAxis)horizontalAxis; double xx = hva.translateJava2DtoValue(x, info.getDataArea()); } // translate the y into a data value // if the axis is a value axis, set the crosshair value if (verticalAxis instanceof ValueAxis) { ValueAxis vva = (ValueAxis)verticalAxis; double yy = vva.translateJava2DtoValue(y, info.getDataArea()); ### 3476, VerticalXYBarPlot, VerticalXYBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalXYBarPlot.java, 84, 88 17 /** * Constructs a new vertical XY bar plot. * @param horizontalAxis The horizontal axis. * @param verticalAxis The vertical axis. * @param insets Amount of blank space around the plot area. * @param background The Paint used to fill the plot background. * @param outlineStroke The Stroke used to draw an outline around the plot. * @param outlinePaint The color used to draw the plot outline. */ 8 public VerticalXYBarPlot(Axis horizontalAxis, Axis verticalAxis, Insets insets, Paint background, Stroke outlineStroke, Paint outlinePaint) { super(horizontalAxis, verticalAxis, insets, background, outlineStroke, outlinePaint); ### 3477, drawOutlineAndBackground, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 563, 573 9 /** * Draw the plot outline and background. * @param g2 The graphics device. * @param area The area within which the plot should be drawn. */ 18 public void drawOutlineAndBackground(Graphics2D g2, Rectangle2D area) { if (backgroundPaint!=null) { g2.setPaint(backgroundPaint); g2.fill(area); } if ((outlineStroke!=null) && (outlinePaint!=null)) { g2.setStroke(outlineStroke); g2.setPaint(outlinePaint); g2.draw(area); ### 3478, isCompatibleVerticalAxis, VerticalXYBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalXYBarPlot.java, 127, 129 13 /** * Returns true if the specified axis is compatible with the plot with regard to operating as * the vertical axis. *

* This plot requires the vertical axis to be a subclass of VerticalNumberAxis. * @param axis The axis. */ 6 public boolean isCompatibleVerticalAxis(Axis axis) { if (axis instanceof VerticalNumberAxis) return true; else return false; ### 3480, getMinimumVerticalDataValue, VerticalXYBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalXYBarPlot.java, 248, 254 9 /** * Returns the minimum Y value from the datasource. *

* This method can return null if the data source is null. */ 12 public Number getMinimumVerticalDataValue() { Dataset data = this.getChart().getDataset(); if (data!=null) { return Datasets.getMinimumRangeValue(data); } else return null; ### 3481, axisChanged, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 610, 611 7 /** * Receives notification of a change to one of the plot's axes. * @param event Information about the event (not used here). */ 4 public void axisChanged(AxisChangeEvent event) { notifyListeners(new PlotChangeEvent(this)); ### 3482, getChart, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 195, 196 7 /** * Returns a reference to the chart that this plot belongs to. * @return A reference to the chart that this plot belongs to (null possible). */ 4 public JFreeChart getChart() { return chart; ### 3483, VerticalXYBarPlot, VerticalXYBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalXYBarPlot.java, 64, 71 9 /** * Constructs a new vertical XY bar plot. * @param horizontalAxis The horizontal axis. * @param verticalAxis The vertical axis. */ 14 public VerticalXYBarPlot(Axis horizontalAxis, Axis verticalAxis) { this(horizontalAxis, verticalAxis, Plot.DEFAULT_INSETS, Plot.DEFAULT_BACKGROUND_COLOR, Plot.DEFAULT_OUTLINE_STROKE, Plot.DEFAULT_OUTLINE_COLOR); ### 3484, getSeriesPaint, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 414, 415 7 /** * Returns the Paint used to color any shapes for the specified series. * @param index The index of the series of interest (zero-based); */ 4 public Paint getSeriesPaint(int index) { return seriesPaint[index % seriesPaint.length]; ### 3485, getDomainAxis, VerticalXYBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalXYBarPlot.java, 95, 96 5 /** * A convenience method that returns the horizontal axis cast as a ValueAxis. */ 4 public ValueAxis getDomainAxis() { return (ValueAxis)horizontalAxis; ### 3486, setSeriesOutlinePaint, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 459, 461 9 /** * Sets the paint used to outline any shapes representing series, and notifies registered * listeners that the chart has been modified. * @param paint An array of Paint objects for drawing the outline of series shapes; */ 6 public void setSeriesOutlinePaint(Paint[] paint) { this.seriesOutlinePaint = paint; notifyListeners(new PlotChangeEvent(this)); ### 3487, setOutlinePaint, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 313, 317 9 /** * Sets the color of the outline of the plot area, and notifies registered listeners that the * Plot has been modified. * @param paint The new outline paint. */ 8 public void setOutlinePaint(Paint paint) { if (!this.outlinePaint.equals(paint)) { this.outlinePaint = paint; notifyListeners(new PlotChangeEvent(this)); ### 3488, setSeriesOutlineStroke, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 477, 479 9 /** * Sets the stroke used to draw any shapes representing series, and notifies registered * listeners that the chart has been modified. * @param stroke An array of Stroke objects; */ 6 public void setSeriesOutlineStroke(Stroke[] stroke) { this.seriesOutlineStroke = stroke; notifyListeners(new PlotChangeEvent(this)); ### 3489, drawBar, VerticalXYBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalXYBarPlot.java, 185, 211 5 /** * Draws one bar. */ 44 protected void drawBar(Graphics2D g2, Rectangle2D plotArea, IntervalXYDataset data, int series, int item, ValueAxis horizontalAxis, ValueAxis verticalAxis, double translatedRangeZero) { Paint seriesPaint = this.getSeriesPaint(series); Paint seriesOutlinePaint = this.getSeriesOutlinePaint(series); Number valueNumber = data.getYValue(series, item); double translatedValue = verticalAxis.translateValueToJava2D(valueNumber.doubleValue(), plotArea); Number startXNumber = data.getStartXValue(series, item); double translatedStartX = horizontalAxis.translateValueToJava2D(startXNumber.doubleValue(), plotArea); Number endXNumber = data.getEndXValue(series, item); double translatedEndX = horizontalAxis.translateValueToJava2D(endXNumber.doubleValue(), plotArea); double translatedWidth = Math.max(1, translatedEndX-translatedStartX); double translatedHeight = Math.abs(translatedValue-translatedRangeZero); Rectangle2D bar = new Rectangle2D.Double(translatedStartX, Math.min(translatedRangeZero, translatedValue), translatedWidth, translatedHeight); g2.setPaint(seriesPaint); g2.fill(bar); if ((translatedEndX-translatedStartX)>3) { g2.setStroke(this.getSeriesOutlineStroke(series)); g2.setPaint(seriesOutlinePaint); g2.draw(bar); ### 3490, addChangeListener, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 518, 519 7 /** * Registers an object for notification of changes to the plot. * @param listener The object to be registered. */ 4 public void addChangeListener(PlotChangeListener listener) { listeners.add(listener); ### 3491, setVerticalAxis, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 348, 372 11 /** * Sets the vertical axis for the plot. *

* An exception is thrown if the new axis and the plot are not mutually compatible. * @param axis The new axis (null permitted). */ 40 public void setVerticalAxis(Axis axis) throws AxisNotCompatibleException { if (isCompatibleVerticalAxis(axis)) { if (axis!=null) { try { axis.setPlot(this); } catch (PlotNotCompatibleException e) { throw new AxisNotCompatibleException("Plot.setVerticalAxis(...): " +"plot not compatible with axis."); } axis.addChangeListener(this); } // plot is likely registered as a listener with the existing axis... if (this.verticalAxis!=null) { this.verticalAxis.removeChangeListener(this); } this.verticalAxis = axis; } else throw new AxisNotCompatibleException("Plot.setVerticalAxis(...): " +"axis not compatible with plot."); ### 3492, draw, VerticalXYBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalXYBarPlot.java, 138, 177 11 /** * 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. * @param info Collects drawing info. */ 72 public void draw(Graphics2D g2, Rectangle2D drawArea, DrawInfo info) { // 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().translateValueToJava2D(0.0, plotArea); int seriesCount = data.getSeriesCount(); for (int series = 0; series * This method can return null if the data source is null. */ 12 public Number getMaximumVerticalDataValue() { Dataset data = this.getChart().getDataset(); if (data!=null) { return Datasets.getMaximumRangeValue(data); } else return null; ### 3496, Plot, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 156, 187 17 /** * Constructs a new plot. * @param horizontalAxis The horizontal axis. * @param verticalAxis The vertical axis. * @param insets Amount of blank space around the plot area. * @param background The Paint used to fill the plot background. * @param outlineStroke The Stroke used to draw an outline around the plot. * @param outlinePaint The color used to draw an outline around the plot. */ 50 protected Plot(Axis horizontalAxis, Axis verticalAxis, Insets insets, Paint background, Stroke outlineStroke, Paint outlinePaint) { this.chart = null; this.horizontalAxis=horizontalAxis; if (horizontalAxis!=null) { horizontalAxis.setPlot(this); horizontalAxis.addChangeListener(this); } this.verticalAxis=verticalAxis; if (verticalAxis!=null) { verticalAxis.setPlot(this); verticalAxis.addChangeListener(this); } this.insets = insets; this.backgroundPaint = background; this.outlineStroke = outlineStroke; this.outlinePaint = outlinePaint; this.seriesPaint = new Paint[] {Color.red, Color.blue, Color.green, Color.yellow, Color.cyan, Color.magenta, Color.orange, Color.pink, Color.lightGray}; this.seriesStroke = new Stroke[] { new BasicStroke(1) }; this.seriesOutlinePaint = new Paint[] { Color.gray }; this.seriesOutlineStroke = new Stroke[] { new BasicStroke(0.5f) }; this.listeners = new java.util.ArrayList(); ### 3497, isCompatibleHorizontalAxis, VerticalXYBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalXYBarPlot.java, 114, 117 15 /** * 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. */ 8 public boolean isCompatibleHorizontalAxis(Axis axis) { if (axis instanceof HorizontalNumberAxis) return true; else if (axis instanceof HorizontalDateAxis) return true; else return false; ### 3498, setOutlineStroke, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 291, 295 9 /** * Sets the pen/brush used to outline the plot area, and notifies registered listeners that the * plot has been modified. * @param stroke The new outline pen/brush. */ 8 public void setOutlineStroke(Stroke stroke) { if (!this.outlineStroke.equals(stroke)) { this.outlineStroke = stroke; notifyListeners(new PlotChangeEvent(this)); ### 3499, getMinimumHorizontalDataValue, VerticalXYBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalXYBarPlot.java, 220, 226 7 /** * Returns the minimum value in either the domain or the range, whichever is displayed against * the horizontal axis for the particular type of plot implementing this interface. */ 12 public Number getMinimumHorizontalDataValue() { Dataset data = this.getChart().getDataset(); if (data!=null) { return Datasets.getMinimumDomainValue(data); } else return null; ### 3500, Plot, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 137, 143 9 /** * Constructs a new plot with the specified axes. * @param horizontalAxis The horizontal axis. * @param verticalAxis The vertical axis. */ 12 protected Plot(Axis horizontalAxis, Axis verticalAxis) { this(horizontalAxis, verticalAxis, DEFAULT_INSETS, DEFAULT_BACKGROUND_COLOR, DEFAULT_OUTLINE_STROKE, DEFAULT_OUTLINE_COLOR); ### 3501, getBackgroundPaint, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 260, 261 7 /** * Returns the background color of the plot area. * @return The background color of the plot area. */ 4 public Paint getBackgroundPaint() { return this.backgroundPaint; ### 3502, getSeriesOutlinePaint, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 450, 451 7 /** * Returns the Paint used to outline any shapes for the specified series. * @param index The index of the series of interest (zero-based); */ 4 public Paint getSeriesOutlinePaint(int index) { return seriesOutlinePaint[index % seriesOutlinePaint.length]; ### 3503, getSeriesOutlineStroke, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 468, 469 7 /** * Returns the Stroke used to outline any shapes for the specified series. * @param index The index of the series of interest (zero-based); */ 4 public Stroke getSeriesOutlineStroke(int index) { return seriesOutlineStroke[index % seriesOutlinePaint.length]; ### 3504, getOutlineStroke, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 282, 283 7 /** * Returns the pen/brush used to outline the plot area. * @return The pen/brush used to outline the plot area. */ 4 public Stroke getOutlineStroke() { return this.outlineStroke; ### 3505, setInsets, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 247, 251 9 /** * Sets the insets for the plot and notifies registered listeners that the plot has been * modified. * @param insets The new insets. */ 8 public void setInsets(Insets insets) { if (!this.insets.equals(insets)) { this.insets = insets; notifyListeners(new PlotChangeEvent(this)); ### 3506, getAxis, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 206, 211 13 /** * Returns the specified axis. * @param select Determines the axis returned (use the constants HORIZONTAL_AXIS and * VERTICAL_AXIS). * @see Plot#getHorizontalAxis * @see Plot#getVerticalAxis */ 10 public Axis getAxis(int select) { switch (select) { case HORIZONTAL_AXIS : return horizontalAxis; case VERTICAL_AXIS : return verticalAxis; default: return null; ### 3507, setSeriesPaint, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 423, 425 9 /** * Sets the paint used to color any shapes representing series, and notifies registered * listeners that the plot has been modified. * @param paint An array of Paint objects used to color series; */ 6 public void setSeriesPaint(Paint[] paint) { this.seriesPaint = paint; notifyListeners(new PlotChangeEvent(this)); ### 3508, getShape, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 486, 489 7 /** * Returns a Shape that can be used in plotting data. Should allow a plugin object to * determine the shape (optionally)... */ 6 public Shape getShape(int series, int item, double x, double y, double scale) { // return new Rectangle2D.Double(x-0.5*scale, y-0.5*scale, scale, scale); return new Ellipse2D.Double(x-0.5*scale, y-0.5*scale, scale, scale); ### 3509, removeChangeListener, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 526, 527 7 /** * Unregisters an object for notification of changes to the plot. * @param listener The object to be unregistered. */ 4 public void removeChangeListener(PlotChangeListener listener) { listeners.remove(listener); ### 3511, chartChanged, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 620, 636 11 /** * Receives notification of a change to a (the) chart. *

* Reacts to dataset changes by reconfiguring the axes. * @param event Information about the chart change event. */ 30 public void chartChanged(ChartChangeEvent event) { if (event.getType()==ChartChangeEvent.NEW_DATASET) { if (verticalAxis!=null) { verticalAxis.configure(); } if (horizontalAxis!=null) { horizontalAxis.configure(); } } if (event.getType()==ChartChangeEvent.UPDATED_DATASET) { if (verticalAxis!=null) { verticalAxis.configure(); } if (horizontalAxis!=null) { horizontalAxis.configure(); ### 3512, setSeriesStroke, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 441, 443 9 /** * Sets the stroke used to draw any shapes representing series, and notifies registered * listeners that the chart has been modified. * @param stroke An array of Stroke objects used to draw series; */ 6 public void setSeriesStroke(Stroke[] stroke) { this.seriesStroke = stroke; notifyListeners(new PlotChangeEvent(this)); ### 3513, setBackgroundPaint, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 269, 273 9 /** * Sets the background color of the plot area, and notifies registered listeners that the * plot has been modified. * @param paint The new background Paint. */ 8 public void setBackgroundPaint(Paint paint) { if (!this.backgroundPaint.equals(paint)) { this.backgroundPaint = paint; notifyListeners(new PlotChangeEvent(this)); ### 3514, getInsets, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 238, 239 7 /** * Returns the insets for the plot area. * @return The insets for the plot area. */ 4 public Insets getInsets() { return this.insets; ### 3515, getShape, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 496, 499 7 /** * Returns a Shape that can be used in plotting data. Should allow a plug-in object to * determine the shape... */ 6 public Shape getShape(int series, Object category, double x, double y, double scale) { // return new Rectangle2D.Double(x-0.5*scale, y-0.5*scale, scale, scale); return new Ellipse2D.Double(x-0.5*scale, y-0.5*scale, scale, scale); ### 3516, getHorizontalAxis, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 221, 222 9 /** * Returns a reference to the horizontal axis. * @return A reference to the horizontal axis. * @see Plot#getAxis */ 4 public HorizontalAxis getHorizontalAxis() { return (HorizontalAxis)horizontalAxis; ### 3517, getOutlinePaint, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 304, 305 7 /** * Returns the color used to draw the outline of the plot area. * @return The color used to draw the outline of the plot area. */ 4 public Paint getOutlinePaint() { return this.outlinePaint; ### 3518, notifyListeners, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 506, 510 7 /** * Notifies all registered listeners that the plot has been modified. * @param event Information about the change event. */ 10 public void notifyListeners(PlotChangeEvent event) { java.util.Iterator iterator = listeners.iterator(); while (iterator.hasNext()) { PlotChangeListener listener = (PlotChangeListener)iterator.next(); listener.plotChanged(event); ### 3519, setHorizontalAxis, Plot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Plot.java, 381, 406 9 /** * Sets the horizontal axis for the plot (this must be compatible with the plot type or an * exception is thrown). * @param axis The new axis; */ 40 public void setHorizontalAxis(Axis axis) throws AxisNotCompatibleException { if (isCompatibleHorizontalAxis(axis)) { if (axis!=null) { try { axis.setPlot(this); } catch (PlotNotCompatibleException e) { throw new AxisNotCompatibleException("Plot.setHorizontalAxis(...): " +"plot not compatible with axis."); } axis.addChangeListener(this); } // plot is likely registered as a listener with the existing axis... if (this.horizontalAxis!=null) { this.horizontalAxis.removeChangeListener(this); } this.horizontalAxis = axis; } else throw new AxisNotCompatibleException("Plot.setHorizontalAxis(...): " +"axis not compatible with plot."); ### 3521, drawHorizontalLines, XYPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/XYPlot.java, 411, 420 5 /** * Support method for the draw(...) method. */ 18 private void drawHorizontalLines(Graphics2D g2, Rectangle2D dataArea) { // Draw any horizontal lines if (horizontalLines != null) { for (int i=0; i * 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. * @param info Collects chart drawing information (null permitted). */ 164 public void draw(Graphics2D g2, Rectangle2D plotArea, DrawInfo info) { // set up info collection... ToolTipsCollection tooltips = null; if (info!=null) { info.setPlotArea(plotArea); tooltips = info.getToolTipsCollection(); } // adjust the drawing area for plot insets (if any)... if (insets!=null) { plotArea.setRect(plotArea.getX()+insets.left, plotArea.getY()+insets.top, plotArea.getWidth()-insets.left-insets.right, plotArea.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, plotArea); Rectangle2D vAxisArea = vAxis.reserveAxisArea(g2, this, plotArea, hAxisAreaHeight); // ...and therefore what is left for the plot itself... Rectangle2D dataArea = new Rectangle2D.Double(plotArea.getX()+vAxisArea.getWidth(), plotArea.getY(), plotArea.getWidth()-vAxisArea.getWidth(), plotArea.getHeight()-hAxisAreaHeight); if (info!=null) { info.setDataArea(dataArea); } CrosshairInfo crosshairInfo = new CrosshairInfo(); crosshairInfo.setCrosshairDistance(Double.POSITIVE_INFINITY); crosshairInfo.setAnchorX(this.getDomainAxis().getAnchorValue()); crosshairInfo.setAnchorY(this.getRangeAxis().getAnchorValue()); // draw the plot background and axes... drawOutlineAndBackground(g2, dataArea); this.horizontalAxis.draw(g2, plotArea, dataArea); this.verticalAxis.draw(g2, plotArea, dataArea); // 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(dataArea); drawVerticalLines(g2, dataArea); drawHorizontalLines(g2, dataArea); double transRangeZero = this.getRangeAxis().translateValueToJava2D(0.0, dataArea); int seriesCount = data.getSeriesCount(); for (int series=0; series in size... double minRange = this.autoRangeMinimumSize.doubleValue(); if (range1) { double categorySpan = area.getWidth() * (1-introGapPercent-trailGapPercent-categoryGapsPercent); double categoryGapSpan = area.getWidth()*categoryGapsPercent; result = result + (category+0.5)*(categorySpan/categoryCount) + (category)*(categoryGapSpan/(categoryCount-1)); } else { result = result + (category+0.5)*area.getWidth()*(1-introGapPercent-trailGapPercent); } return result; ### 3588, getRangeAxis, VerticalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot.java, 140, 141 5 /** * Returns the range axis. */ 4 public ValueAxis getRangeAxis() { return (ValueAxis)verticalAxis; ### 3589, calculateBarWidth, VerticalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot.java, 415, 433 7 /** * Returns the width of each bar in the chart. * @param area The area within which the plot will be drawn. */ 28 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; ### 3590, getPlotType, VerticalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot.java, 439, 440 5 /** * Returns a short string describing the type of plot. */ 4 public String getPlotType() { return "Bar Plot"; ### 3591, VerticalBarPlot, VerticalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot.java, 106, 117 23 /** * Constructs a new vertical bar plot. * @param horizontalAxis The horizontal axis. * @param verticalAxis 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 categoryGapPercent 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 itemGapPercent The gap between bars within the same category. */ 20 public VerticalBarPlot(CategoryAxis horizontalAxis, ValueAxis verticalAxis, Insets insets, double introGapPercent, double trailGapPercent, double categoryGapPercent, double itemGapPercent, CategoryToolTipGenerator toolTipGenerator) { super(horizontalAxis, verticalAxis, insets, introGapPercent, trailGapPercent, categoryGapPercent, itemGapPercent, toolTipGenerator); this.renderer = new VerticalBarRenderer(); ### 3592, draw, VerticalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot.java, 239, 288 11 /** * Draws the plot on a Java 2D graphics device (such as the screen or a printer). * @param g2 The graphics device. * @param plotArea The area within which the plot should be drawn. * @param info Collects info as the chart is drawn. */ 82 public void draw(Graphics2D g2, Rectangle2D plotArea, DrawInfo info) { // set up the drawing info... ToolTipsCollection tooltips = null; if (info!=null) { info.setPlotArea(plotArea); tooltips = info.getToolTipsCollection(); } // adjust the drawing area for the plot insets (if any)... if (insets!=null) { plotArea.setRect(plotArea.getX()+insets.left, plotArea.getY()+insets.top, plotArea.getWidth()-insets.left-insets.right, plotArea.getHeight()-insets.top-insets.bottom); } if ((plotArea.getWidth()>=MINIMUM_WIDTH_TO_DRAW) && (plotArea.getHeight()>=MINIMUM_HEIGHT_TO_DRAW)) { // estimate the area required for drawing the axes... HorizontalAxis hAxis = getHorizontalAxis(); VerticalAxis vAxis = getVerticalAxis(); double hAxisAreaHeight = hAxis.reserveHeight(g2, this, plotArea); Rectangle2D vAxisArea = vAxis.reserveAxisArea(g2, this, plotArea, hAxisAreaHeight); // and thus the area available for plotting... Rectangle2D dataArea = new Rectangle2D.Double(plotArea.getX()+vAxisArea.getWidth(), plotArea.getY(), plotArea.getWidth()-vAxisArea.getWidth(), plotArea.getHeight()-hAxisAreaHeight); if (info!=null) { info.setDataArea(dataArea); } Shape backgroundPlotArea = calculateBackgroundPlotArea(dataArea); // draw the background and axes... drawOutlineAndBackground(g2, backgroundPlotArea); getCategoryAxis().draw(g2, plotArea, dataArea); getRangeAxis().draw(g2, plotArea, dataArea); drawBars(g2, backgroundPlotArea, dataArea, info); // draw horizontal crosshair if required... ValueAxis vva = this.getRangeAxis(); if (vva.isCrosshairVisible()) { this.drawHorizontalLine(g2, dataArea, vva.getCrosshairValue(), vva.getCrosshairStroke(), vva.getCrosshairPaint()); ### 3593, setRenderer, VerticalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot.java, 125, 127 7 /** * Sets the renderer for the bar plot. * @param renderer The renderer. */ 6 public void setRenderer(VerticalBarRenderer renderer) { this.renderer = renderer; this.notifyListeners(new PlotChangeEvent(this)); ### 3594, calculateBackgroundPlotArea, VerticalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot.java, 298, 299 5 /** * Returns chart's background area. */ 4 protected Shape calculateBackgroundPlotArea(Rectangle2D plotArea) { return plotArea; ### 3595, getMaximumVerticalDataValue, VerticalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot.java, 461, 467 7 /** * Returns the maximum value in either the domain or the range, whichever is displayed against * the vertical axis for the particular type of plot implementing this interface. */ 12 public Number getMaximumVerticalDataValue() { Dataset data = this.getChart().getDataset(); if (data!=null) { return Datasets.getMaximumRangeValue(data); } else return null; ### 3596, getCategories, VerticalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot.java, 175, 176 5 /** * A convenience method that returns a list of the categories in the dataset. */ 4 public java.util.List getCategories() { return getDataset().getCategories(); ### 3597, VerticalBarPlot, VerticalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot.java, 81, 89 9 /** * Constructs a new vertical bar plot. * @param horizontalAxis The horizontal axis. * @param verticalAxis The vertical axis. */ 16 public VerticalBarPlot(CategoryAxis horizontalAxis, ValueAxis verticalAxis) { this(horizontalAxis, verticalAxis, Plot.DEFAULT_INSETS, BarPlot.DEFAULT_INTRO_GAP_PERCENT, BarPlot.DEFAULT_TRAIL_GAP_PERCENT, BarPlot.DEFAULT_CATEGORY_GAPS_PERCENT, BarPlot.DEFAULT_ITEM_GAPS_PERCENT, null ### 3598, getDataset, VerticalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot.java, 133, 134 5 /** * A convenience method that returns the dataset for the plot, cast as a CategoryDataset. */ 4 public CategoryDataset getDataset() { return (CategoryDataset)chart.getDataset(); ### 3599, isCompatibleVerticalAxis, VerticalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot.java, 226, 230 9 /** * 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; */ 10 public boolean isCompatibleVerticalAxis(Axis axis) { if (axis instanceof VerticalNumberAxis) { return true; } else return false; ### 3600, setHorizontalAxis, VerticalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot.java, 167, 169 9 /** * 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. */ 6 public void setHorizontalAxis(Axis axis) throws AxisNotCompatibleException { // check that the axis implements the required interface (if not raise an exception); super.setHorizontalAxis(axis); ### 3601, drawBars, VerticalBarPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot.java, 308, 387 11 /** * Draws charts bars * @param g2 The graphics device; * @param backgroundPlotArea The area within which will be clipped * @param plotArea The area within which the plot should be drawn. */ 138 protected void drawBars(Graphics2D g2, Shape backgroundPlotArea, Rectangle2D dataArea, DrawInfo info) { // now get the data and plot the bars... CategoryDataset data = this.getDataset(); if (data!=null) { Shape savedClip = g2.getClip(); g2.clip(backgroundPlotArea); int seriesCount = data.getSeriesCount(); int categoryCount = data.getCategoryCount(); int barCount = renderer.barWidthsPerCategory(data); double translatedZero = getRangeAxis().translateValueToJava2D(0.0, dataArea); // work out the span dimensions for the categories... double categorySpan = 0.0; double categoryGapSpan = 0.0; if (categoryCount>1) { categorySpan = dataArea.getWidth() * (1-introGapPercent-trailGapPercent-categoryGapsPercent); categoryGapSpan = dataArea.getWidth()*categoryGapsPercent; } else { categorySpan = dataArea.getWidth()*(1-introGapPercent-trailGapPercent); } // work out the item span... double itemSpan = categorySpan; double itemGapSpan = 0.0; if (seriesCount>1) { if (renderer.hasItemGaps()) { itemGapSpan = dataArea.getWidth()*itemGapsPercent; itemSpan = itemSpan - itemGapSpan; } } double itemWidth = itemSpan/(categoryCount*renderer.barWidthsPerCategory(data)); int categoryIndex = 0; Iterator iterator = data.getCategories().iterator(); while (iterator.hasNext()) { Object category = iterator.next(); for (int series=0; series * Registered listeners are notified of a change to the axis. * @param flag The new value of the flag. */ 8 public void setAutoTickUnitSelection(boolean flag) { if (this.autoTickUnitSelection!=flag) { this.autoTickUnitSelection = flag; notifyListeners(new AxisChangeEvent(this)); ### 3605, setCrosshairVisible, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 405, 409 7 /** * Sets the flag indicating whether or not a crosshair is visible for this axis. * @param flag The new value of the flag. */ 8 public void setCrosshairVisible(boolean flag) { if (this.crosshairVisible!=flag) { this.crosshairVisible=flag; notifyListeners(new AxisChangeEvent(this)); ### 3606, isGridLinesVisible, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 313, 314 7 /** * Returns true if the grid lines are showing, and false otherwise. * @return True if the grid lines are showing, and false otherwise. */ 4 public boolean isGridLinesVisible() { return gridLinesVisible; ### 3607, getGridPaint, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 360, 361 7 /** * Returns the grid line color. * @return The grid line color. */ 4 public Paint getGridPaint() { return gridPaint; ### 3608, setGridLinesVisible, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 322, 326 9 /** * Sets the visibility of the grid lines and notifies registered listeners that the axis has * been modified. * @param flag The new setting. */ 8 public void setGridLinesVisible(boolean flag) { if (gridLinesVisible!=flag) { gridLinesVisible = flag; notifyListeners(new AxisChangeEvent(this)); ### 3609, setCrosshairValue, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 448, 451 11 /** * Sets the crosshair value for the axis. *

* Registered listeners are notified that the axis has been modified. * @param value The new value (null permitted). */ 6 public void setCrosshairValue(double value) { this.crosshairValue = value; notifyListeners(new AxisChangeEvent(this)); ### 3610, setMaximumAxisValue, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 260, 265 11 /** * Sets the maximum value for the axis. *

* Registered listeners are notified that the axis has been modified. * @param value The new maximum. */ 10 public void setMaximumAxisValue(double value) { if (this.maximumAxisValue!=value) { this.maximumAxisValue = value; this.autoRange = false; notifyListeners(new AxisChangeEvent(this)); ### 3611, getMinimumAxisValue, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 227, 228 7 /** * Returns the minimum value for the axis. * @return The minimum value for the axis. */ 4 public double getMinimumAxisValue() { return minimumAxisValue; ### 3612, setAnchorValue, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 389, 391 5 /** * Sets the anchor value for this axis. */ 6 public void setAnchorValue(double value) { this.anchorValue = value; notifyListeners(new AxisChangeEvent(this)); ### 3613, setCrosshairStroke, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 467, 469 9 /** * Sets the Stroke used to draw the grid lines (if visible) and notifies registered listeners * that the axis has been modified. * @param stroke The new grid line stroke. */ 6 public void setCrosshairStroke(Stroke stroke) { crosshairStroke = stroke; notifyListeners(new AxisChangeEvent(this)); ### 3614, getCrosshairPaint, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 476, 477 7 /** * Returns the grid line color. * @return The grid line color. */ 4 public Paint getCrosshairPaint() { return crosshairPaint; ### 3615, getCrosshairStroke, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 458, 459 5 /** * Returns the Stroke used to draw the crosshair (if visible). */ 4 public Stroke getCrosshairStroke() { return crosshairStroke; ### 3616, ValueAxis, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 127, 146 7 /** * Constructs a value axis, using default values where necessary. * @param label The axis label. */ 38 public ValueAxis(String label) { this(label, Axis.DEFAULT_AXIS_LABEL_FONT, Axis.DEFAULT_AXIS_LABEL_PAINT, Axis.DEFAULT_AXIS_LABEL_INSETS, true, // tick labels visible Axis.DEFAULT_TICK_LABEL_FONT, Axis.DEFAULT_TICK_LABEL_PAINT, Axis.DEFAULT_TICK_LABEL_INSETS, true, // tick marks visible Axis.DEFAULT_TICK_STROKE, true, // auto range true, // auto tick unit true, // show grid lines ValueAxis.DEFAULT_GRID_LINE_STROKE, ValueAxis.DEFAULT_GRID_LINE_PAINT, 0.0, // crosshair ValueAxis.DEFAULT_CROSSHAIR_STROKE, ValueAxis.DEFAULT_CROSSHAIR_PAINT); ### 3617, getCrosshairValue, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 438, 439 5 /** * Returns the crosshair value. */ 4 public double getCrosshairValue() { return this.crosshairValue; ### 3618, getMaximumAxisValue, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 250, 251 5 /** * Returns the maximum value for the axis. */ 4 public double getMaximumAxisValue() { return maximumAxisValue; ### 3619, setAxisRange, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 275, 280 9 /** * Sets the axis range. * @param lower The lower axis limit. * @param upper The upper axis limit. */ 10 public void setAxisRange(double lower, double upper) { this.autoRange = false; this.minimumAxisValue = lower; this.maximumAxisValue = upper; notifyListeners(new AxisChangeEvent(this)); ### 3620, isCrosshairVisible, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 397, 398 5 /** * Returns a flag indicating whether or not a crosshair is visible for this axis. */ 4 public boolean isCrosshairVisible() { return this.crosshairVisible; ### 3621, setGridPaint, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 369, 376 9 /** * Sets the Paint used to color the grid lines (if visible) and notifies registered listeners * that the axis has been modified. * @param paint The new grid paint. */ 14 public void setGridPaint(Paint paint) { // check arguments... if (paint==null) { throw new IllegalArgumentException("ValueAxis.setGridPaint(...): null not permitted"); } gridPaint = paint; notifyListeners(new AxisChangeEvent(this)); ### 3622, isAutoTickUnitSelection, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 289, 290 9 /** * 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. */ 4 public boolean isAutoTickUnitSelection() { return autoTickUnitSelection; ### 3623, setGridStroke, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 343, 352 9 /** * Sets the Stroke used to draw the grid lines (if visible) and notifies registered listeners * that the axis has been modified. * @param stroke The new grid line stroke. */ 16 public void setGridStroke(Stroke stroke) { // check arguments... if (stroke==null) { throw new IllegalArgumentException("ValueAxis.setGridStroke(...): null not permitted"); } // make the change... gridStroke = stroke; notifyListeners(new AxisChangeEvent(this)); ### 3625, getGridStroke, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 334, 335 5 /** * Returns the Stroke used to draw the grid lines (if visible). */ 4 public Stroke getGridStroke() { return gridStroke; ### 3626, setMinimumAxisValue, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 237, 242 11 /** * Sets the minimum value for the axis. *

* Registered listeners are notified that the axis has been modified. * @param value The new minimum. */ 10 public void setMinimumAxisValue(double value) { if (this.minimumAxisValue!=value) { this.minimumAxisValue = value; this.autoRange = false; notifyListeners(new AxisChangeEvent(this)); ### 3627, setAutoRange, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 213, 218 9 /** * 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. */ 10 public void setAutoRange(boolean auto) { if (this.autoRange!=auto) { this.autoRange=auto; if (autoRange) autoAdjustRange(); notifyListeners(new AxisChangeEvent(this)); ### 3628, setCrosshairLockedOnData, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 426, 430 7 /** * Sets the flag indicating whether or not the crosshair should "lock-on" to actual data * values. */ 8 public void setCrosshairLockedOnData(boolean flag) { if (this.crosshairLockedOnData!=flag) { this.crosshairLockedOnData=flag; notifyListeners(new AxisChangeEvent(this)); ### 3629, setCrosshairPaint, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 485, 487 9 /** * Sets the Paint used to color the grid lines (if visible) and notifies registered listeners * that the axis has been modified. * @param paint The new grid paint. */ 6 public void setCrosshairPaint(Paint paint) { crosshairPaint = paint; notifyListeners(new AxisChangeEvent(this)); ### 3630, ValueAxis, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 173, 196 45 /** * Constructs a value 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 the 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 autoTickUnitSelection A flag indicating whether or not the tick unit is automatically * selected. * @param gridLinesVisible Flag indicating whether or not grid lines are visible. * @param gridStroke The Stroke used to display grid lines (if visible). * @param gridPaint The Paint used to display grid lines (if visible). * @param crosshairValue The value at which to draw an optional crosshair (null permitted). * @param crosshairStroke The pen/brush used to draw the crosshair. * @param crosshairPaint The color used to draw the crosshair. */ 44 protected ValueAxis(String label, Font labelFont, Paint labelPaint, Insets labelInsets, boolean tickLabelsVisible, Font tickLabelFont, Paint tickLabelPaint, Insets tickLabelInsets, boolean tickMarksVisible, Stroke tickMarkStroke, boolean autoRange, boolean autoTickUnitSelection, boolean gridLinesVisible, Stroke gridStroke, Paint gridPaint, double crosshairValue, Stroke crosshairStroke, Paint crosshairPaint) { super(label, labelFont, labelPaint, labelInsets, tickLabelsVisible, tickLabelFont, tickLabelPaint, tickLabelInsets, tickMarksVisible, tickMarkStroke); this.autoRange = autoRange; this.autoTickUnitSelection = autoTickUnitSelection; this.gridLinesVisible = gridLinesVisible; this.gridStroke = gridStroke; this.gridPaint = gridPaint; this.crosshairValue = crosshairValue; this.crosshairStroke = crosshairStroke; this.crosshairPaint = crosshairPaint; ### 3631, isAutoRange, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 204, 205 7 /** * Returns true if the axis range is automatically adjusted to fit the data, and false * otherwise. */ 4 public boolean isAutoRange() { return autoRange; ### 3632, isCrosshairLockedOnData, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 418, 419 7 /** * Returns a flag indicating whether or not the crosshair should "lock-on" to actual data * values. */ 4 public boolean isCrosshairLockedOnData() { return this.crosshairLockedOnData; ### 3633, getAnchorValue, ValueAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ValueAxis.java, 382, 383 5 /** * Returns the anchor value for this axis. */ 4 public double getAnchorValue() { return anchorValue; ### 3635, getNearestTickUnit, TickUnits, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/TickUnits.java, 74, 82 9 /** * Returns the tick unit in the collection that is closest in size to the specified unit. * @param unit The unit. * @returns The unit in the collection that is closest in size to the specified unit. */ 16 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())); ### 3636, TickUnits, TickUnits, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/TickUnits.java, 53, 54 5 /** * Constructs a new collection of tick units. */ 4 public TickUnits() { this.units = new ArrayList(); ### 3637, add, TickUnits, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/TickUnits.java, 62, 65 9 /** * Adds a tick unit to the collection. *

* The tick units are maintained in ascending order. */ 6 public void add(TickUnit unit) { units.add(unit); Collections.sort(units); ### 3638, drawBar, VerticalBarRenderer3D, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarRenderer3D.java, 78, 177 7 /** * Renders an individual bar...there are bug-fixes that have been applied to VerticalBarRenderer * that need to be applied here too. */ 174 public Shape drawBar(Graphics2D g2, Rectangle2D dataArea, BarPlot plot, ValueAxis valueAxis, CategoryDataset data, int series, Object category, int categoryIndex, double translatedZero, double itemWidth, double categorySpan, double categoryGapSpan, double itemSpan, double itemGapSpan) { Shape result = null; // check the value we are plotting... Number value = data.getValue(series, category); if (value!=null) { // BAR X double rectX = dataArea.getX()+dataArea.getWidth()*plot.getIntroGapPercent(); int categories = data.getCategoryCount(); int seriesCount = data.getSeriesCount(); if (categories>1) { rectX = rectX // 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) { rectX = rectX + (series*itemGapSpan/(categories*(seriesCount-1))); } } else { rectX = rectX // bars+gaps completed in current category + (series*itemSpan/(categories*seriesCount)); if (seriesCount>1) { rectX = rectX + (series*itemGapSpan/(categories*(seriesCount-1))); } } // BAR Y double translatedValue = valueAxis.translateValueToJava2D(value.doubleValue(), dataArea); double rectY = Math.min(translatedZero, translatedValue); // BAR WIDTH double rectWidth = itemWidth; // BAR HEIGHT double rectHeight = Math.abs(translatedValue-translatedZero); Rectangle2D bar = new Rectangle2D.Double(rectX, rectY, rectWidth, rectHeight); Paint seriesPaint = plot.getSeriesPaint(series); g2.setPaint(seriesPaint); g2.fill(bar); result = bar; GeneralPath bar3dRight = null; GeneralPath bar3dTop = null; double effect3d = 0.00; VerticalAxis vAxis = plot.getVerticalAxis(); if (rectHeight != 0 && vAxis instanceof VerticalNumberAxis3D) { effect3d = ((VerticalNumberAxis3D) vAxis).getEffect3d(); bar3dRight = new GeneralPath(); bar3dRight.moveTo((float)(rectX+rectWidth), (float)rectY); bar3dRight.lineTo((float)(rectX+rectWidth), (float)(rectY+rectHeight)); bar3dRight.lineTo((float)(rectX+rectWidth+effect3d), (float)(rectY+rectHeight-effect3d)); bar3dRight.lineTo((float)(rectX+rectWidth+effect3d), (float)(rectY-effect3d)); if (seriesPaint instanceof Color) { g2.setPaint( ((Color) seriesPaint).darker()); } g2.fill(bar3dRight); bar3dTop = new GeneralPath(); bar3dTop.moveTo( (float) rectX, (float) rectY); bar3dTop.lineTo((float) (rectX+effect3d), (float) (rectY-effect3d)); bar3dTop.lineTo((float) (rectX+rectWidth+effect3d), (float) (rectY-effect3d)); bar3dTop.lineTo((float) (rectX+rectWidth), (float) (rectY) ); if (seriesPaint instanceof Color) { g2.setPaint( ((Color) seriesPaint)); //.brighter()); } g2.fill(bar3dTop); } if (itemWidth>3) { g2.setStroke(plot.getSeriesOutlineStroke(series)); //g2.setStroke(new BasicStroke(0.25f)); g2.setPaint(plot.getSeriesOutlinePaint(series)); g2.draw(bar); if (bar3dRight != null) { g2.draw(bar3dRight); } if (bar3dTop != null) { g2.draw(bar3dTop); } } } return result; ### 3639, hasItemGaps, VerticalBarRenderer3D, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarRenderer3D.java, 62, 63 5 /** * Returns true, since there are (potentially) gaps between bars in this representation. */ 4 public boolean hasItemGaps() { return true; ### 3641, barWidthsPerCategory, VerticalBarRenderer3D, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarRenderer3D.java, 70, 71 7 /** * This will be a method in the renderer that tells whether there is one bar width per category * or onebarwidth per series per category. */ 4 public int barWidthsPerCategory(CategoryDataset data) { return data.getSeriesCount(); ### 3642, drawBar, VerticalBarRenderer, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarRenderer.java, 92, 154 37 /** * Handles the rendering of a single bar. * @param g2 * @param dataArea * @param plot * @param valueAxis * @param data * @param series * @param category * @param categoryIndex * @param translatedZero * @param itemWidth * @param categorySpan * @param categoryGapSpan * @param itemSpan * @param itemGapSpan * @return A shape representing the area in which the bar is drawn (one use for this is * supporting tooltips). */ 108 public Shape drawBar(Graphics2D g2, Rectangle2D dataArea, BarPlot plot, ValueAxis valueAxis, CategoryDataset data, int series, Object category, int categoryIndex, double translatedZero, double itemWidth, double categorySpan, double categoryGapSpan, double itemSpan, double itemGapSpan) { Shape result = null; // first check the value we are plotting... Number value = data.getValue(series, category); if (value!=null) { // BAR X double rectX = dataArea.getX()+dataArea.getWidth()*plot.getIntroGapPercent(); int categories = data.getCategoryCount(); int seriesCount = data.getSeriesCount(); if (categories>1) { rectX = rectX // 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) { rectX = rectX + (series*itemGapSpan/(categories*(seriesCount-1))); } } else { rectX = rectX // bars+gaps completed in current category + (series*itemSpan/(categories*seriesCount)); if (seriesCount>1) { rectX = rectX + (series*itemGapSpan/(categories*(seriesCount-1))); } } // BAR Y double translatedValue = valueAxis.translateValueToJava2D(value.doubleValue(), dataArea); double rectY = Math.min(translatedZero, translatedValue); // BAR WIDTH double rectWidth = itemWidth; // BAR HEIGHT double rectHeight = Math.abs(translatedValue-translatedZero); Rectangle2D bar = new Rectangle2D.Double(rectX, rectY, rectWidth, rectHeight); Paint seriesPaint = plot.getSeriesPaint(series); g2.setPaint(seriesPaint); g2.fill(bar); if (itemWidth>3) { g2.setStroke(plot.getSeriesStroke(series)); g2.setPaint(plot.getSeriesOutlinePaint(series)); g2.draw(bar); } result = bar; } return result; ### 3643, hasItemGaps, VerticalBarRenderer, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarRenderer.java, 61, 62 5 /** * Returns true, since for this renderer there are gaps between the items in one category. */ 4 public boolean hasItemGaps() { return true; ### 3644, barWidthsPerCategory, VerticalBarRenderer, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarRenderer.java, 69, 70 7 /** * Returns the number of bar-widths displayed in each category. For this renderer, there is one * bar per series, so we return the number of series. */ 4 public int barWidthsPerCategory(CategoryDataset data) { return data.getSeriesCount(); ### 3645, draw, VerticalCategoryAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalCategoryAxis.java, 118, 151 11 /** * 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. */ 64 public void draw(Graphics2D g2, Rectangle2D drawArea, Rectangle2D plotArea) { // draw the axis label if (label!=null) { 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()); ### 3646, isCompatiblePlot, VerticalCategoryAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalCategoryAxis.java, 263, 265 7 /** * Returns true if the specified plot is compatible with the axis, and false otherwise. * @param plot The plot; */ 6 protected boolean isCompatiblePlot(Plot plot) { if (plot instanceof CategoryPlot) return true; else return false; ### 3647, refreshTicks, VerticalCategoryAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalCategoryAxis.java, 163, 185 11 /** * 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. */ 42 public void refreshTicks(Graphics2D g2, Rectangle2D drawArea, Rectangle2D plotArea) { this.ticks.clear(); CategoryPlot categoryPlot = (CategoryPlot)plot; Dataset data = categoryPlot.getDataset(); if (data!=null) { Font font = this.getTickLabelFont(); g2.setFont(font); FontRenderContext frc = g2.getFontRenderContext(); int categoryIndex = 0; 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); float xx = (float)(plotArea.getX()-tickLabelInsets.right-labelBounds.getWidth()); float yy = (float)(categoryPlot.getCategoryCoordinate(categoryIndex, plotArea) -metrics.getStrikethroughOffset()+0.5f); Tick tick = new Tick(category, label, xx, yy); ticks.add(tick); categoryIndex = categoryIndex+1; ### 3648, VerticalCategoryAxis, VerticalCategoryAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalCategoryAxis.java, 96, 108 27 /** * 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 categoryLabelsVisible Flag indicating whether or not category labels are visible. * @param categoryLabelFont The font used to display category labels. * @param categoryLabelPaint The paint used to draw category labels. * @param tickMarksVisible Flag indicating whether or not tick marks are visible. * @param tickMarkStroke The stroke used to draw tick marks (if visible). */ 22 public VerticalCategoryAxis(String label, Font labelFont, Paint labelPaint, Insets labelInsets, boolean verticalLabel, boolean categoryLabelsVisible, Font categoryLabelFont, Paint categoryLabelPaint, Insets categoryLabelInsets, boolean tickMarksVisible, Stroke tickMarkStroke) { super(label, labelFont, labelPaint, labelInsets, categoryLabelsVisible, categoryLabelFont, categoryLabelPaint, categoryLabelInsets, tickMarksVisible, tickMarkStroke); this.verticalLabel = verticalLabel; ### 3649, VerticalCategoryAxis, VerticalCategoryAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalCategoryAxis.java, 66, 78 7 /** * Constructs a VerticalCategoryAxis, using default attributes where necessary. * @param label The axis label. */ 24 public VerticalCategoryAxis(String label) { this(label, Axis.DEFAULT_AXIS_LABEL_FONT, Axis.DEFAULT_AXIS_LABEL_PAINT, Axis.DEFAULT_TICK_LABEL_INSETS, true, // vertical label true, // category labels visible Axis.DEFAULT_TICK_LABEL_FONT, Axis.DEFAULT_TICK_LABEL_PAINT, Axis.DEFAULT_TICK_LABEL_INSETS, false, // tick marks visible Axis.DEFAULT_TICK_STROKE); ### 3650, reserveWidth, VerticalCategoryAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalCategoryAxis.java, 199, 221 17 /** * Estimates the height required for the axis, given a specific drawing area, without any * information about the width of the vertical axis. *

* 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. */ 42 public double reserveWidth(Graphics2D g2, Plot plot, Rectangle2D drawArea) { // calculate the width of the axis label... double labelWidth = 0.0; if (label!=null) { Rectangle2D labelBounds = labelFont.getStringBounds(label, g2.getFontRenderContext()); labelWidth = this.labelInsets.left+labelInsets.right; if (this.verticalLabel) { // assume width == height before rotation labelWidth = labelWidth + labelBounds.getHeight(); } 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; ### 3651, reserveAxisArea, VerticalCategoryAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalCategoryAxis.java, 231, 256 11 /** * 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. */ 46 public Rectangle2D reserveAxisArea(Graphics2D g2, Plot plot, Rectangle2D drawArea, double reservedHeight) { // calculate the width of the axis label... double labelWidth = 0.0; if (label!=null) { Rectangle2D labelBounds = labelFont.getStringBounds(label, g2.getFontRenderContext()); labelWidth = this.labelInsets.left+labelInsets.right; if (this.verticalLabel) { // assume width == height before rotation labelWidth = labelWidth + labelBounds.getHeight(); } 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); ### 3652, isCompatibleVerticalAxis, VerticalBarPlot3D, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot3D.java, 102, 106 9 /** * 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; */ 10 public boolean isCompatibleVerticalAxis(Axis axis) { if (axis instanceof VerticalNumberAxis3D) { return true; } else return false; ### 3653, VerticalBarPlot3D, VerticalBarPlot3D, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot3D.java, 65, 70 9 /** * Constructs a vertical bar plot with 3D effect. * @param horizontalAxis The horizontal axis. * @param verticalAxis The vertical axis. */ 10 public VerticalBarPlot3D(CategoryAxis horizontalAxis, ValueAxis verticalAxis) { this(horizontalAxis, verticalAxis, Plot.DEFAULT_INSETS, 0.1, 0.1, 0.2, 0.0, null); ### 3654, calculateBackgroundPlotArea, VerticalBarPlot3D, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot3D.java, 112, 132 5 /** * Returns the shape of the background for the 3D-effect bar plot. */ 36 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; ### 3655, VerticalBarPlot3D, VerticalBarPlot3D, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot3D.java, 84, 93 19 /** * Constructs a vertical bar plot with 3D effect. * @param horizontalAxis The horizontal axis. * @param verticalAxis 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. */ 18 public VerticalBarPlot3D(CategoryAxis horizontalAxis, ValueAxis verticalAxis, Insets insets, double introGap, double trailGap, double categoryGap, double seriesGap, CategoryToolTipGenerator toolTipGenerator) { super(horizontalAxis, verticalAxis, insets, introGap, trailGap, categoryGap, seriesGap, toolTipGenerator); ### 3656, drawBars, VerticalBarPlot3D, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/VerticalBarPlot3D.java, 139, 157 5 /** * Draws the bars... */ 36 protected void drawBars(Graphics2D g2, Shape backgroundPlotArea, Rectangle2D plotArea, DrawInfo info) { 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, info); ### 3657, getTitle, Title, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Title.java, 77, 78 5 /** * Returns the title text. */ 4 public String getTitle() { return this.title; ### 3658, addChangeListener, Title, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Title.java, 95, 96 7 /** * Registers an object for notification of changes to the title. * @param listener The object that is being registered. */ 4 public void addChangeListener(TitleChangeListener listener) { listeners.add(listener); ### 3659, Title, Title, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Title.java, 69, 71 5 /** * Standard constructor - builds a Title object. */ 6 protected Title(String title) { this.title = title; this.listeners = new java.util.ArrayList(); ### 3661, removeChangeListener, Title, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Title.java, 103, 104 7 /** * Unregisters an object for notification of changes to the chart title. * @param listener The object that is being unregistered. */ 4 public void removeChangeListener(TitleChangeListener listener) { listeners.remove(listener); ### 3662, setTitle, Title, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Title.java, 86, 87 9 /** * Sets the title to the specified text and notifies registered listeners that the title has * been modified. * @param text The new chart title; */ 4 public void setTitle(String text) { this.title = text; ### 3663, createInstance, Title, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/Title.java, 62, 63 9 /** * Static factory method that returns a concrete subclass of Title. * @param title The chart title; * @param font The font for displaying the chart title; */ 4 public static Title createInstance(String title, Font font) { return new StandardTitle(title, font); ### 3664, setChart, ChartChangeEvent, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/event/ChartChangeEvent.java, 111, 112 7 /** * Sets the chart that generated the change event. * @param chart The chart that generated the event. */ 4 public void setChart(JFreeChart chart) { this.chart = chart; ### 3665, ChartChangeEvent, ChartChangeEvent, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/event/ChartChangeEvent.java, 87, 88 9 /** * 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; */ 4 public ChartChangeEvent(Object source, JFreeChart chart) { this(source, chart, GENERAL); ### 3666, ChartChangeEvent, ChartChangeEvent, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/event/ChartChangeEvent.java, 94, 97 5 /** * Full constructor: returns a new ChartChangeEvent object with the specified type. */ 8 public ChartChangeEvent(Object source, JFreeChart chart, int type) { super(source); this.chart = chart; this.type = type; ### 3667, ChartChangeEvent, ChartChangeEvent, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/event/ChartChangeEvent.java, 78, 79 7 /** * 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.) */ 4 public ChartChangeEvent(Object source) { this(source, null, GENERAL); ### 3668, getType, ChartChangeEvent, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/event/ChartChangeEvent.java, 118, 119 5 /** * Returns the event type. */ 4 public int getType() { return this.type; ### 3669, getChart, ChartChangeEvent, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/event/ChartChangeEvent.java, 103, 104 5 /** * Returns a reference to the chart that generated the change event. */ 4 public JFreeChart getChart() { return chart; ### 3670, AxisChangeEvent, AxisChangeEvent, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/event/AxisChangeEvent.java, 55, 57 7 /** * Default constructor: returns a new AxisChangeEvent. * @param axis The axis that generated the event. */ 6 public AxisChangeEvent(Axis axis) { super(axis); this.axis = axis; ### 3671, setRange, CombinedHorizontalDateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalDateAxis.java, 214, 223 12 /** * Sets our AxisRange (min/max). This is done after a CombinedPlot has * has calculated the overall range of all CombinedAxis that share the same * Axis for all Plots. This makes all plots display the complete range of * their Datasets. */ 18 public void setRange(AxisRange range) { setAutoRange(false); setMinimumDate((Date)range.getMin()); setMaximumDate((Date)range.getMax()); if (visible) { HorizontalDateAxis axis = (HorizontalDateAxis)getParentAxis(); axis.setAutoRange(false); axis.setMinimumDate((Date)range.getMin()); axis.setMaximumDate((Date)range.getMax()); ### 3672, setVisible, CombinedHorizontalDateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalDateAxis.java, 233, 234 18 /** * Sets the visible flag on or off for this combined axis. A visible axis will * display the axis title, ticks and legend depending on the parent's * attributes. An invisible axis will not display anything. If the invisible * axis isContainer(), then it occupies space on the graphic device. */ -------------- ////////////////////////////////////////////////////////////////////////////// -------------- 4 public void setVisible(boolean flag) { visible = flag; ### 3673, draw, CombinedHorizontalDateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalDateAxis.java, 118, 133 15 /** * If axis is not visible, just draws grid lines if needed, but no horizonatal * date axis labels. * @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). */ 30 public void draw(Graphics2D g2, Rectangle2D drawArea, Rectangle2D plotArea) { if (visible) { axis.draw(g2, drawArea, plotArea); } else if (gridLinesVisible) { refreshTicks(g2, drawArea, plotArea); g2.setStroke(gridStroke); g2.setPaint(gridPaint); Iterator iterator = ticks.iterator(); while (iterator.hasNext()) { Tick tick = (Tick)iterator.next(); float xx = (float)translateValueToJava2D(tick.getNumericalValue(), plotArea); Line2D gridline = new Line2D.Float(xx, (float)plotArea.getMaxY(), xx, (float)plotArea.getMinY()); g2.draw(gridline); ### 3674, isVisible, CombinedHorizontalDateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalDateAxis.java, 240, 241 5 /** * Is this axis visible? Is is drawn? */ 4 public boolean isVisible() { return visible; ### 3675, CombinedHorizontalDateAxis, CombinedHorizontalDateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalDateAxis.java, 77, 103 9 /** * Constructs a combined horizontal date axis. * @param axis Parent HorizontalDateAxis to take as reference. * @param visible Indicates if the axis is visible. */ 52 public CombinedHorizontalDateAxis(HorizontalDateAxis axis, boolean visible) { super(axis.getLabel(), axis.getLabelFont(), axis.getLabelPaint(), axis.getLabelInsets(), axis.isTickLabelsVisible(), axis.getTickLabelFont(), axis.getTickLabelPaint(), axis.getTickLabelInsets(), axis.getVerticalTickLabels(), axis.isTickMarksVisible(), axis.getTickMarkStroke(), axis.isAutoRange(), axis.getMinimumDate(), axis.getMaximumDate(), axis.isAutoTickUnitSelection(), axis.getTickUnit(), axis.getTickLabelFormatter(), axis.isGridLinesVisible(), axis.getGridStroke(), axis.getGridPaint(), axis.getCrosshairDate(), axis.getCrosshairStroke(), axis.getCrosshairPaint()); this.axis = axis; this.visible = visible; ### 3676, reserveHeight, CombinedHorizontalDateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalDateAxis.java, 149, 158 13 /** * Returns the height required to draw the axis in the specified draw area. If * the axis is not visible, returns zero. * @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; */ 18 public double reserveHeight(Graphics2D g2, Plot plot, Rectangle2D drawArea) { if (!visible) { return 0; } else if (reserveHeight > 0) { return reserveHeight; } else { return axis.reserveHeight(g2, plot, drawArea); ### 3677, getParentAxis, CombinedHorizontalDateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalDateAxis.java, 187, 188 5 /** * Returns our parent axis. */ 4 public Axis getParentAxis() { return axis; ### 3678, getRange, CombinedHorizontalDateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalDateAxis.java, 194, 205 5 /** * Returns the AxisRange (min/max) of our Axis */ 22 public AxisRange getRange() { DateAxisRange range; if (visible) { axis.autoAdjustRange(); range = new DateAxisRange(axis.getMinimumDate(), axis.getMaximumDate()); } else { autoAdjustRange(); range = new DateAxisRange(getMinimumDate(), getMaximumDate()); } return (range); ### 3679, reserveAxisArea, CombinedHorizontalDateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalDateAxis.java, 170, 176 16 /** * Returns area in which the axis will be displayed. If the axis is not visible * returns a zero size rectangle. * @param g2 The graphics device; * @param plot A reference to the plot; * @param drawArea The area within which the plot and axes should be drawn; * @param reservedWidth The space already reserved for the vertical axis; */ 14 public Rectangle2D reserveAxisArea(Graphics2D g2, Plot plot, Rectangle2D drawArea, double reservedWidth) { if (visible) { return axis.reserveAxisArea(g2, plot, drawArea, reservedWidth); } else { return new Rectangle2D.Double(); ### 3680, reserveHeight, OverlaidHorizontalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/OverlaidHorizontalNumberAxis.java, 110, 119 14 /** * Returns the height required to draw the axis in the specified draw area. The * list of our axes is checked and the first non zero height is returned. * @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; */ 20 public double reserveHeight(Graphics2D g2, Plot plot, Rectangle2D drawArea) { Iterator iter = axes.iterator(); while (iter.hasNext()) { HorizontalAxis axis = (HorizontalAxis)iter.next(); double height = axis.reserveHeight(g2, plot, drawArea); if (height != 0) { return height; } } return 0; ### 3681, reserveAxisArea, OverlaidHorizontalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/OverlaidHorizontalNumberAxis.java, 130, 141 15 /** * Returns area in which the axis will be displayed. The list is our axes is * checked and the first non zero area is returned. * @param g2 The graphics device; * @param plot A reference to the plot; * @param drawArea The area within which the plot and axes should be drawn; * @param reservedWidth The space already reserved for the vertical axis; */ 24 public Rectangle2D reserveAxisArea(Graphics2D g2, Plot plot, Rectangle2D drawArea, double reservedWidth) { Rectangle2D empty = new Rectangle2D.Double(); Iterator iter = axes.iterator(); while (iter.hasNext()) { HorizontalAxis axis = (HorizontalAxis)iter.next(); Rectangle2D area = axis.reserveAxisArea(g2, plot, drawArea, reservedWidth); if (!area.equals(empty)) { return area; } } return empty; ### 3682, OverlaidHorizontalNumberAxis, OverlaidHorizontalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/OverlaidHorizontalNumberAxis.java, 62, 81 9 /** * Constructor. * @param plot CombinedPlot where this OverlaidHorizontalNumberAxis will be * contained. */ 38 public OverlaidHorizontalNumberAxis(CombinedPlot plot) { super((HorizontalNumberAxis)plot.getHorizontalAxis(), false); this.plot = plot; this.axes = plot.getHorizontalAxes(); // validate type of axes and tell each axis that it is overlaid boolean oneVisible = false; Iterator iter = axes.iterator(); while (iter.hasNext()) { Object axis = iter.next(); if ((axis instanceof CombinedHorizontalNumberAxis)) { CombinedHorizontalNumberAxis combAxis = (CombinedHorizontalNumberAxis)axis; oneVisible |= combAxis.isVisible(); if (iter.hasNext() || oneVisible) { combAxis.setGridLinesVisible(false); //combAxis.setOverlaid(true); } } else { throw new IllegalArgumentException("Can not combine " + axis.getClass() + " into " + this.getClass() ); ### 3684, getRange, OverlaidHorizontalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/OverlaidHorizontalNumberAxis.java, 151, 152 5 /** * Returns the AxisRange (min/max) of our Axis */ 4 public AxisRange getRange() { return plot.getRange(axes); ### 3685, setVisible, CombinedVerticalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedVerticalNumberAxis.java, 238, 239 11 /** * Sets the visible flag on or off for this combined axis. A visible axis will * display the axis title, ticks and legend depending on the parent's * attributes. An invisible axis will not display anything. If the invisible * axis isContainer(), then it occupies space on the graphic device. */ 4 public void setVisible(boolean flag) { visible = flag; ### 3686, draw, CombinedVerticalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedVerticalNumberAxis.java, 126, 140 11 /** * 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). */ 28 public void draw(Graphics2D g2, Rectangle2D drawArea, Rectangle2D plotArea) { if (visible) { axis.draw(g2, drawArea, plotArea); } else if (gridLinesVisible) { refreshTicks(g2, drawArea, plotArea); g2.setStroke(gridStroke); g2.setPaint(gridPaint); double xx = plotArea.getX(); Iterator iterator = ticks.iterator(); while (iterator.hasNext()) { Tick tick = (Tick)iterator.next(); float yy = (float)this.translateValueToJava2D(tick.getNumericalValue(), plotArea); Line2D gridline = new Line2D.Double(xx, yy, plotArea.getMaxX(), yy); g2.draw(gridline); ### 3687, getRange, CombinedVerticalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedVerticalNumberAxis.java, 206, 209 5 /** * Returns the AxisRange (min/max) of our Axis */ 8 public AxisRange getRange() { autoAdjustRange(); return (new NumberAxisRange(new Double(getMinimumAxisValue()), new Double(getMaximumAxisValue()))); ### 3688, setReserveDimension, CombinedVerticalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedVerticalNumberAxis.java, 152, 153 13 /** * The CombinedPlot will calculate the maximim of all reserveWidth or reserveHeight * depending on the type of CombinedPlot and inform all CombinedXXXXXAxis to store * this value. * @param dimension If the axis is vertical, this is width. If axis is * horizontal, then this is height */ 4 public void setReserveDimension(double dimension) { this.reserveWidth = dimension; ### 3689, CombinedVerticalNumberAxis, CombinedVerticalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedVerticalNumberAxis.java, 83, 112 9 /** * Constructs a combined vertical number axis. * @param axis Parent VerticalNumberAxis to take as reference. * @param visible Is this axis visible? */ 56 public CombinedVerticalNumberAxis(VerticalNumberAxis axis, boolean visible) { super(axis.getLabel(), axis.getLabelFont(), axis.getLabelPaint(), axis.getLabelInsets(), axis.isLabelDrawnVertical(), axis.isTickLabelsVisible(), axis.getTickLabelFont(), axis.getTickLabelPaint(), axis.getTickLabelInsets(), axis.isTickMarksVisible(), axis.getTickMarkStroke(), axis.isAutoRange(), axis.autoRangeIncludesZero(), axis.getAutoRangeMinimumSize(), axis.getMinimumAxisValue(), axis.getMaximumAxisValue(), axis.isInverted(), axis.isAutoTickUnitSelection(), axis.getTickUnit(), axis.isGridLinesVisible(), axis.getGridStroke(), axis.getGridPaint(), axis.getCrosshairValue(), axis.getCrosshairStroke(), axis.getCrosshairPaint()); this.axis = axis; this.visible = visible; ### 3690, reserveAxisArea, CombinedVerticalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedVerticalNumberAxis.java, 183, 189 13 /** * Returns area in which the axis will be displayed. * @param g2 The graphics device; * @param plot A reference to the plot; * @param drawArea The area in which the plot and axes should be drawn; * @param reservedHeight The height reserved for the horizontal axis; */ 12 public Rectangle2D reserveAxisArea(Graphics2D g2, Plot plot, Rectangle2D drawArea, double reservedHeight) { return new Rectangle2D.Double(drawArea.getX(), drawArea.getY(), reserveWidth(g2, plot, drawArea), drawArea.getHeight()-reservedHeight); ### 3691, getParentAxis, CombinedVerticalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedVerticalNumberAxis.java, 199, 200 5 /** * Returns our parent axis. */ 4 public Axis getParentAxis() { return axis; ### 3692, CombinedVerticalNumberAxis, CombinedVerticalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedVerticalNumberAxis.java, 74, 75 7 /** * Constructs a visible combined vertical number axis. * @param axis Parent VerticalNumberAxis to take as reference. */ 4 public CombinedVerticalNumberAxis(VerticalNumberAxis axis) { this(axis, true); ### 3693, setRange, CombinedVerticalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedVerticalNumberAxis.java, 218, 228 12 /** * Sets our AxisRange (min/max). This is done after a CombinedPlot has * has calculated the overall range of all CombinedAxis that share the same * Axis for all Plots. This makes all plots display the complete range of * their Datasets. */ 22 public void setRange(AxisRange range) { setAutoRange(false); Number min = (Number)range.getMin(); Number max = (Number)range.getMax(); setMinimumAxisValue(min.doubleValue()); setMaximumAxisValue(max.doubleValue()); if (visible) { VerticalNumberAxis axis = (VerticalNumberAxis)getParentAxis(); axis.setAutoRange(false); axis.setMinimumAxisValue(min.doubleValue()); axis.setMaximumAxisValue(max.doubleValue()); ### 3694, reserveWidth, CombinedVerticalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedVerticalNumberAxis.java, 165, 172 17 /** * Returns the width required to draw the biggest axis of all the combined * vertical axis in the specified draw area. If the width was set via * setReserveWidth, then this value is returned instead of a calculation. * * @param g2 The graphics device; * @param plot A reference to the plot; * @param drawArea The area within which the plot should be drawn. */ 14 public double reserveWidth(Graphics2D g2, Plot plot, Rectangle2D drawArea) { if (!visible) { return 0; } else if (reserveWidth > 0) { return reserveWidth; } else { return axis.reserveWidth(g2, plot, drawArea); ### 3695, getPrimitive, Performance2, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/Performance2.java, 40, 41 5 /** * Just use double value - should be fast. */ 4 public double getPrimitive() { return primitive; ### 3696, getPrimitiveAsObject, Performance2, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/Performance2.java, 47, 48 5 /** * Creates a Number object every time the primitive is accessed - should be really slow. */ 4 public Number getPrimitiveAsObject() { return new Double(primitive); ### 3697, getObjectAsPrimitive, Performance2, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/Performance2.java, 62, 63 7 /** * Returns a double value generated from the Object - should be similar to previous method, * but is not! */ 4 public double getObjectAsPrimitive() { return object.doubleValue(); ### 3698, getObject, Performance2, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/Performance2.java, 54, 55 5 /** * Returns the object - caller has to use doubleValue() method. */ 4 public Number getObject() { return object; ### 3699, adjustForInsets, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 370, 378 5 /** * Utility method to adjust a Rectangle2D for Insets */ 16 protected Rectangle2D adjustForInsets(Rectangle2D drawArea, Insets insets) { if (insets != null) { return new Rectangle2D.Double(drawArea.getX()+insets.left, drawArea.getY()+insets.top, drawArea.getWidth()-insets.left-insets.right, drawArea.getHeight()-insets.top-insets.bottom); } else { return drawArea; ### 3700, getXValue, SampleXYDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleXYDataset.java, 79, 80 11 /** * 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. */ 4 public Number getXValue(int series, int item) { return new Double(-10.0+translate+(item*0.2)); ### 3701, getPlotArea, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 613, 614 7 /** * Returns the last plotArea calculated. * // TODO: is this useful? */ 4 public Rectangle2D getPlotArea() { return plotArea; ### 3702, getSeriesName, SampleXYDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleXYDataset.java, 109, 116 9 /** * Returns the name of the series. * @param series The index (zero-based) of the series; * @return The name of the series. */ 16 public String getSeriesName(int series) { if (series==0) { return "y = cosine(x)"; } else if (series==1) { return "y = 2*sine(x)"; } else return "Error"; ### 3703, CombinedPlot, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 128, 135 15 /** * Creates a HORIZONTAL or VERTICAL CombinedPlot. If type is HORIZONTAL, then * axis should contain the shared vertical axis. If type if VERTICAL, then * axis should contain the shared horizontal axis. * * @param axis Shared axis to use for all sub-plots. * @param type Type of CombinedPlot (HORIZONTAL or VERTICAL). */ 14 public CombinedPlot(Axis axis, int type) { super((type == VERTICAL ? axis : null), (type == HORIZONTAL ? axis : null)); if (type != HORIZONTAL && type != VERTICAL) { throw new IllegalArgumentException("Invalid type (" + type + ")"); } this.type = type; setInsets(new Insets(0, 0, 0, 0)); ### 3704, getYValue, SampleXYDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleXYDataset.java, 89, 93 11 /** * 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. */ 10 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)))); ### 3705, adjustPlotsMinMax, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 781, 782 5 /** * Adjusts both of our axes ranges. */ 4 protected void adjustPlotsMinMax() { adjustPlotsMinMax((type != HORIZONTAL), (type != VERTICAL)); ### 3706, getSeriesCount, SampleXYDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleXYDataset.java, 100, 101 7 /** * Returns the number of series in the data source. * @return The number of series in the data source. */ 4 public int getSeriesCount() { return 2; ### 3707, CombinedPlot, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 145, 149 11 /** * Creates an OVERLAID CombinedPlot. * * @param horizontal Shared horizontal axis to use for all sub-plots. * @param vertical Shared vertical axis to use for all sub-plots. */ 8 public CombinedPlot(Axis horizontal, Axis vertical) { super(horizontal, vertical); type = OVERLAID; setInsets(new Insets(0, 0, 0, 0)); ### 3708, SampleXYDataset, SampleXYDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleXYDataset.java, 60, 61 5 /** * Default constructor. */ 4 public SampleXYDataset() { this.translate = 0.0; ### 3709, add, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 179, 213 23 /** * Adds a CombinedChart to the CombinedPlot. Verifies that the shared axes are * the same. * * @param chart The chart to add * @param weight Weight of this chart relative to the rest. Must be greater than one. * For an OVERLAID CombinedPlot, weight must be one. * @exception AxisNotCompatibleException If common axis is not the same as * previous charts, or if the other axes is not compatible. * @exception IllegalArgumentException if weight is <= 0 for HORIZONTAL or * VERTICAL plots, or weight != 0 for OVERLAID plots. */ 60 public void add(CombinedChart chart, int weight) throws AxisNotCompatibleException, IllegalArgumentException { // verify valid horizontal and vertical axis Plot p = chart.getPlot(); if (getHorizontalAxis() != p.getHorizontalAxis() && type != HORIZONTAL) { throw new AxisNotCompatibleException("Can't combine with different horizontal axis"); } else if (getVerticalAxis() != p.getVerticalAxis() && type != VERTICAL) { throw new AxisNotCompatibleException("Can't combine with different vertical axis"); } else if (!isCompatibleHorizontalAxis((Axis)p.getHorizontalAxis())) { throw new AxisNotCompatibleException("Incompatible horizontal axis"); } else if (!isCompatibleVerticalAxis((Axis)p.getVerticalAxis())) { throw new AxisNotCompatibleException("Incompatible vertical axis"); } // verify valid weight if (weight <= 0 && type != OVERLAID) { throw new IllegalArgumentException("weight must be positive"); } else if (weight != 1 && type == OVERLAID) { throw new IllegalArgumentException("weight must 1"); } // only first chart of overlaid chart will draw background and outline if (charts.size() > 0 && type == OVERLAID) { p.setBackgroundPaint(null); p.setOutlineStroke(null); p.setOutlinePaint(null); } // store the chartot and its weight ChartInfo chartInfo = new ChartInfo(chart, weight); charts.add(chartInfo); // keep track of total weights weights += weight; ### 3710, adjustPlots, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 513, 521 9 /** * Adjusts the charts to combine changing their axis and rescaling them to * take into account combined plots. Should be called after adding all * sub-charts to the CombinedPlot. */ 14 public void adjustPlots() { // adjust plot axes: wrap with CombinedXXXXXAxis/OverlaidXXXXAxis objects adjustPlotsAxis(); // adjust plot axis min and max values to display all plots adjustPlotsMinMax(); // adjust all paints and strokes for each plot adjustSeriesPaintAndStroke(); ### 3711, setRange, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 601, 605 9 /** * Sets the AxisRange (min/max) for all the axes in the List. * @param range Range to set. * @parem axes List of axes to set. */ 10 public void setRange(AxisRange range, java.util.List axes) { Iterator iter = axes.iterator(); while (iter.hasNext()) { CombinableAxis axis = (CombinableAxis)iter.next(); axis.setRange(range); ### 3712, getMaximumHorizontalDataValue, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 447, 461 16 /** * Returns the maximum value in the domain of all the charts, since this is plotted * against the horizontal axis for a combined plot. * @return The maximum value to be plotted against the horizontal axis. */ -------------- // From HorizontalValuePlot and VerticalValuePlot -------------- 30 public Number getMaximumHorizontalDataValue() { if (charts.size() == 0) { return null; } Number max = new Double(Double.MIN_VALUE); Iterator iter = charts.iterator(); while (iter.hasNext()) { ChartInfo chartInfo = (ChartInfo)iter.next(); HorizontalValuePlot plot = (HorizontalValuePlot)chartInfo.plot; Number x = plot.getMaximumHorizontalDataValue(); if (x.doubleValue() > max.doubleValue()) { max = x; } } return max; ### 3713, isCompatibleVerticalAxis, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 232, 233 11 /** * Checks the compatibility of a vertical axis, returning true if the axis is compatible with * the plot, and false otherwise. The vertical axis for this plot must be an instance of * VerticalNumberAxis. * @param axis The vertical axis. */ 4 public boolean isCompatibleVerticalAxis(Axis axis) { return (axis instanceof VerticalNumberAxis); ### 3714, isCompatibleHorizontalAxis, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 221, 223 9 /** * Checks the compatibility of a horizontal axis, returning true if the axis is * compatible with the plot, and false otherwise. * @param axis The horizontal axis. */ 6 public boolean isCompatibleHorizontalAxis(Axis axis) { return ((axis instanceof HorizontalNumberAxis) || (axis instanceof HorizontalDateAxis)); ### 3715, getMinimumHorizontalDataValue, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 425, 439 10 /** * Returns the minimum value in the domain of all the charts, since this is plotted * against the horizontal axis for a combined plot. * @return The minimum value to be plotted against the horizontal axis. */ 30 public Number getMinimumHorizontalDataValue() { if (charts.size() == 0) { return null; } Number min = new Double(Double.MAX_VALUE); Iterator iter = charts.iterator(); while (iter.hasNext()) { ChartInfo chartInfo = (ChartInfo)iter.next(); HorizontalValuePlot plot = (HorizontalValuePlot)chartInfo.plot; Number x = plot.getMinimumHorizontalDataValue(); if (x.doubleValue() < min.doubleValue()) { min = x; } } return min; ### 3716, add, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 163, 164 19 /** * Adds a CombinedChart to the CombinedPlot. Verifies that the shared axes are * the same and assigns a weight of 1 to this chart. * * @param chart The chart to add * @exception AxisNotCompatibleException If horizontal axis is not the same as * previous charts, or if vertical axis is not compatible. * @exception IllegalArgumentException if weight is <= 0 for HORIZONTAL or * VERTICAL plots, or weight != 0 for OVERLAID plots. */ 4 public void add(CombinedChart chart) throws AxisNotCompatibleException { add(chart, 1); ### 3717, adjustPlotsAxis, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 691, 693 11 /** * Adjusts the internal charts to allow automatic rendering of their conponents. * This includes setting all HorizontalAxis to a CombinedHorizontalXXXXAxis or * OverlaidHorizontalXXXXAxis, and setting all VerticalAxis to a CombinedVerticalXXXXAxis or * OverlaidVerticalXXXXAxis. */ 6 protected void adjustPlotsAxis() { if (!isAdjusted) { adjustPlotsAxis(true, true); ### 3718, adjustPlotsMinMax, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 791, 807 11 /** * Adjusts our axes ranges. * * @param adjustHorizontal Adjust the range of our horizontal axes? * @param adjustVertical Adjust the range of our vertical axes? */ 28 protected void adjustPlotsMinMax(boolean adjustHorizontal, boolean adjustVertical) { java.util.List axes; AxisRange range; if (adjustHorizontal && !axisRangeSet[HORIZONTAL]) { axes = getHorizontalAxes(true); range = getRange(axes); setRange(range, axes); setAxisRangeSet(HORIZONTAL, true); } if (adjustVertical && !axisRangeSet[VERTICAL]) { axes = getVerticalAxes(true); range = getRange(axes); setRange(range, axes); setAxisRangeSet(VERTICAL, true); ### 3719, getHorizontalAxes, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 536, 548 7 /** * Returns a List of all our Horizontal Axes. * @param recursive true indicates to traverse all included sub-plots recursivelly. */ 26 public java.util.List getHorizontalAxes(boolean recursive) { ArrayList axes = new ArrayList(); Iterator iter = charts.iterator(); while (iter.hasNext()) { ChartInfo chartInfo = (ChartInfo)iter.next(); axes.add(chartInfo.plot.getHorizontalAxis()); if (recursive && chartInfo.plot instanceof CombinedPlot) { CombinedPlot subPlot = (CombinedPlot)chartInfo.plot; java.util.List moreAxes = subPlot.getHorizontalAxes(true); axes.addAll(moreAxes); } } return axes; ### 3720, readjustPlotsMinMax, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 648, 677 27 /** * Readjust the plot axes min and max as needed. After readjusting the plot axes, * it will readjust recursively contained combined plots that were missed. * * @param doHorizontalAxis Hint that we need to adjust the horizontal axis. * In order to adjust the axis, in addition to the hint being true, the * axisRangeSet[HORIZONTAL] flag for this plot must be true indicating that the * plot does indeed adjust it's horizontal axis. * @param doVerticalAxis Hint that we need to adjust the vertical axis. * In order to adjust the axis, in addition to the hint being true, the * axisRangeSet[VERTICAL] flag for this plot must be true indicating that the * plot does indeed adjust it's vertical axis. * */ 50 private void readjustPlotsMinMax(boolean doHorizontalAxis, boolean doVerticalAxis) { if (inReadjustPlotsMinMax) return; doHorizontalAxis &= axisRangeSet[HORIZONTAL]; doVerticalAxis &= axisRangeSet[VERTICAL]; // adjust plot axis min and max values to display all plots if needed if (doHorizontalAxis || doVerticalAxis) { if (doHorizontalAxis) { setAxisRangeSet(HORIZONTAL, false); } if (doVerticalAxis) { setAxisRangeSet(VERTICAL, false); } adjustPlotsMinMax(doHorizontalAxis, doVerticalAxis); } // recursively readjust any internal CombinedPlots we missed. inReadjustPlotsMinMax = true; // prevents StackOverflow Iterator iter = charts.iterator(); while(iter.hasNext()) { ChartInfo chartInfo = (ChartInfo)iter.next(); Plot plot = chartInfo.plot; if (plot instanceof CombinedPlot) { ((CombinedPlot)plot).readjustPlotsMinMax(!doHorizontalAxis, !doVerticalAxis); } } inReadjustPlotsMinMax = false; ### 3721, draw, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 258, 362 15 /** * Draws the CombinedPlot on a Java 2D graphics device (such as the screen or a printer). * Will perform all the placement calculations for each sub-plots and then tell these * to draw themselves. *

* @param g2 The graphics device; * @param drawArea The area within which the plot (including axis labels) should be drawn; */ 184 public void draw(Graphics2D g2, Rectangle2D drawArea, DrawInfo info) { int n = charts.size(); int verticalGap = 0; int horizontalGap = 0; // adjust plot axis if needed adjustPlots(); // adjust the drawing area for plot insets. insets are added as a border // and between sub-charts. For in-between space between sub-charts, the // max of insets.top and insets.bottom is used for VERTICAL plots and the // max of insets.right and insets.left for HORIZONTAL plots. drawArea = adjustForInsets(drawArea, insets); if (insets != null && type != OVERLAID) { verticalGap = Math.max(insets.top, insets.bottom); horizontalGap = Math.max(insets.right, insets.left); } // calculate shared axis height and width double hAxisAreaHeight = 0; double vAxisAreaWidth = 0; if (type != HORIZONTAL) { // all plots share the same horizontal axis, reserve the height hAxisAreaHeight = getHorizontalAxis().reserveHeight(g2, this, drawArea); } if (type != VERTICAL) { // all plots share the same vertical axis, reserve the width vAxisAreaWidth = getVerticalAxis().reserveWidth(g2, this, drawArea); } // make plotArea without shared axis areas Rectangle2D plotArea = new Rectangle2D.Double(drawArea.getX(), drawArea.getY(), drawArea.getWidth()-vAxisAreaWidth, drawArea.getHeight()-hAxisAreaHeight); // calculate plotAreas of all sub-plots, maximum vertical/horizontal axis width/height Rectangle2D[] subPlotArea = new Rectangle2D[n]; double x = plotArea.getX(); double y = plotArea.getY(); double usableWidth = plotArea.getWidth()-horizontalGap*(charts.size()-1); double usableHeight = plotArea.getHeight()-verticalGap*(charts.size()-1); double maxAxisWidth = Double.MIN_VALUE; double maxAxisHeight = Double.MIN_VALUE; for (int i=0; i max.doubleValue()) { max = x; } } return max; ### 3727, adjustSeriesPaintAndStroke, CombinedPlot, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedPlot.java, 848, 872 15 /** * Adjusts the Stroke and Paint objects associated with each Plot's Series * that use the CombinedDataset so that each series is always drawn using the same * rendering objects, no matter on what plot it appears. * @param masterPlot Outermost plot that defines all the Stroke and Paint object * to use * @param masterData Dataset */ 46 private void adjustSeriesPaintAndStroke(Plot masterPlot, Dataset masterData) { Iterator iter = charts.iterator(); while (iter.hasNext()) { ChartInfo chartInfo = (ChartInfo)iter.next(); Plot plot = chartInfo.plot; Dataset data = chartInfo.chart.getDataset(); if (data instanceof CombinationDataset) { CombinationDataset childData = (CombinationDataset)data; if (childData.getParent() == masterData) { int[] map = childData.getMap(); Stroke[] childStroke = new Stroke[map.length]; Paint[] childPaint = new Paint[map.length]; for (int j=0; j * Reacts to dataset changes by reconfiguring the axes. * @param event Information about the chart change event. */ 4 public void chartChanged(ChartChangeEvent event) { readjustPlotsMinMax(axisRangeSet[HORIZONTAL], axisRangeSet[VERTICAL]); ### 3739, NumberAxisRange, NumberAxisRange, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/NumberAxisRange.java, 56, 57 11 /** * Creates an NumberAxisRange object. * * @param min Minimum Number value * @param max Maximum Number value */ 4 public NumberAxisRange(Number min, Number max) { super(min, max); ### 3740, DateAxisRange, DateAxisRange, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/DateAxisRange.java, 58, 59 11 /** * Creates an DateAxisRange object. * * @param min Minimum date value * @param max Maximum date value */ 4 public DateAxisRange(Date min, Date max) { super(min, max); ### 3741, reserveAxisArea, CombinedHorizontalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalNumberAxis.java, 172, 179 16 /** * Returns area in which the axis will be displayed. If the axis is not visible * returns a zero size rectangle. * @param g2 The graphics device; * @param plot A reference to the plot; * @param drawArea The area within which the plot and axes should be drawn; * @param reservedWidth The space already reserved for the vertical axis; */ 14 public Rectangle2D reserveAxisArea(Graphics2D g2, Plot plot, Rectangle2D drawArea, double reservedWidth) { if (visible) { return axis.reserveAxisArea(g2, plot, drawArea, reservedWidth); } else { return new Rectangle2D.Double(); ### 3742, isVisible, CombinedHorizontalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalNumberAxis.java, 238, 239 5 /** * Is this axis visible? Is is drawn? */ 4 public boolean isVisible() { return visible; ### 3743, initialiseData, SampleHighLowDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleHighLowDataset.java, 184, 472 5 /** * Sets up the data for the sample data source. */ 482 private void initialiseData() { dates = new Date[47]; highs = new Double[47]; lows = new Double[47]; opens = new Double[47]; closes = new Double[47]; dates[0] = createDate(2001, Calendar.JANUARY,4); highs[0] = new Double(47.0); lows[0] = new Double(33.0); opens[0] = new Double(35.0); closes[0] = new Double(33.0); dates[1] = createDate(2001, Calendar.JANUARY,5); highs[1] = new Double(47.0); lows[1] = new Double(32.0); opens[1] = new Double(41.0); closes[1] = new Double(37.0); dates[2] = createDate(2001, Calendar.JANUARY,6); highs[2] = new Double(49.0); lows[2] = new Double(43.0); opens[2] = new Double(46.0); closes[2] = new Double(48.0); dates[3] = createDate(2001, Calendar.JANUARY,7); highs[3] = new Double(51.0); lows[3] = new Double(39.0); opens[3] = new Double(40.0); closes[3] = new Double(47.0); dates[4] = createDate(2001, Calendar.JANUARY,8); highs[4] = new Double(60.0); lows[4] = new Double(40.0); opens[4] = new Double(46.0); closes[4] = new Double(53.0); dates[5] = createDate(2001, Calendar.JANUARY,9); highs[5] = new Double(62.0); lows[5] = new Double(55.0); opens[5] = new Double(57.0); closes[5] = new Double(61.0); dates[6] = createDate(2001, Calendar.JANUARY,10); highs[6] = new Double(65.0); lows[6] = new Double(56.0); opens[6] = new Double(62.0); closes[6] = new Double(59.0); dates[7] = createDate(2001, Calendar.JANUARY,11); highs[7] = new Double(55.0); lows[7] = new Double(43.0); opens[7] = new Double(45.0); closes[7] = new Double(47.0); dates[8] = createDate(2001, Calendar.JANUARY,12); highs[8] = new Double(54.0); lows[8] = new Double(33.0); opens[8] = new Double(40.0); closes[8] = new Double(51.0); dates[9] = createDate(2001, Calendar.JANUARY,13); highs[9] = new Double(47.0); lows[9] = new Double(33.0); opens[9] = new Double(35.0); closes[9] = new Double(33.0); dates[10] = createDate(2001, Calendar.JANUARY,14); highs[10] = new Double(54.0); lows[10] = new Double(38.0); opens[10] = new Double(43.0); closes[10] = new Double(52.0); dates[11] = createDate(2001, Calendar.JANUARY,15); highs[11] = new Double(48.0); lows[11] = new Double(41.0); opens[11] = new Double(44.0); closes[11] = new Double(41.0); dates[12] = createDate(2001, Calendar.JANUARY,17); highs[12] = new Double(60.0); lows[12] = new Double(30.0); opens[12] = new Double(34.0); closes[12] = new Double(44.0); dates[13] = createDate(2001, Calendar.JANUARY,18); highs[13] = new Double(58.0); lows[13] = new Double(44.0); opens[13] = new Double(54.0); closes[13] = new Double(56.0); dates[14] = createDate(2001, Calendar.JANUARY,19); highs[14] = new Double(54.0); lows[14] = new Double(32.0); opens[14] = new Double(42.0); closes[14] = new Double(53.0); dates[15] = createDate(2001, Calendar.JANUARY,20); highs[15] = new Double(53.0); lows[15] = new Double(39.0); opens[15] = new Double(50.0); closes[15] = new Double(49.0); dates[16] = createDate(2001, Calendar.JANUARY,21); highs[16] = new Double(47.0); lows[16] = new Double(33.0); opens[16] = new Double(41.0); closes[16] = new Double(40.0); dates[17] = createDate(2001, Calendar.JANUARY,22); highs[17] = new Double(55.0); lows[17] = new Double(37.0); opens[17] = new Double(43.0); closes[17] = new Double(45.0); dates[18] = createDate(2001, Calendar.JANUARY,23); highs[18] = new Double(54.0); lows[18] = new Double(42.0); opens[18] = new Double(50.0); closes[18] = new Double(42.0); dates[19] = createDate(2001, Calendar.JANUARY,24); highs[19] = new Double(48.0); lows[19] = new Double(37.0); opens[19] = new Double(37.0); closes[19] = new Double(47.0); dates[20] = createDate(2001, Calendar.JANUARY,25); highs[20] = new Double(58.0); lows[20] = new Double(33.0); opens[20] = new Double(39.0); closes[20] = new Double(41.0); dates[21] = createDate(2001, Calendar.JANUARY,26); highs[21] = new Double(47.0); lows[21] = new Double(31.0); opens[21] = new Double(36.0); closes[21] = new Double(41.0); dates[22] = createDate(2001, Calendar.JANUARY,27); highs[22] = new Double(58.0); lows[22] = new Double(44.0); opens[22] = new Double(49.0); closes[22] = new Double(44.0); dates[23] = createDate(2001, Calendar.JANUARY,28); highs[23] = new Double(46.0); lows[23] = new Double(41.0); opens[23] = new Double(43.0); closes[23] = new Double(44.0); dates[24] = createDate(2001, Calendar.JANUARY,29); highs[24] = new Double(56.0); lows[24] = new Double(39.0); opens[24] = new Double(39.0); closes[24] = new Double(51.0); dates[25] = createDate(2001, Calendar.JANUARY,30); highs[25] = new Double(56.0); lows[25] = new Double(39.0); opens[25] = new Double(47.0); closes[25] = new Double(49.0); dates[26] = createDate(2001, Calendar.JANUARY,31); highs[26] = new Double(53.0); lows[26] = new Double(39.0); opens[26] = new Double(52.0); closes[26] = new Double(47.0); dates[27] = createDate(2001, Calendar.FEBRUARY,1); highs[27] = new Double(51.0); lows[27] = new Double(30.0); opens[27] = new Double(45.0); closes[27] = new Double(47.0); dates[28] = createDate(2001, Calendar.FEBRUARY,2); highs[28] = new Double(47.0); lows[28] = new Double(30.0); opens[28] = new Double(34.0); closes[28] = new Double(46.0); dates[29] = createDate(2001, Calendar.FEBRUARY,3); highs[29] = new Double(57.0); lows[29] = new Double(37.0); opens[29] = new Double(44.0); closes[29] = new Double(56.0); dates[30] = createDate(2001, Calendar.FEBRUARY,4); highs[30] = new Double(49.0); lows[30] = new Double(40.0); opens[30] = new Double(47.0); closes[30] = new Double(44.0); dates[31] = createDate(2001, Calendar.FEBRUARY,5); highs[31] = new Double(46.0); lows[31] = new Double(38.0); opens[31] = new Double(43.0); closes[31] = new Double(40.0); dates[32] = createDate(2001, Calendar.FEBRUARY,6); highs[32] = new Double(55.0); lows[32] = new Double(38.0); opens[32] = new Double(39.0); closes[32] = new Double(53.0); dates[33] = createDate(2001, Calendar.FEBRUARY,7); highs[33] = new Double(50.0); lows[33] = new Double(33.0); opens[33] = new Double(37.0); closes[33] = new Double(37.0); dates[34] = createDate(2001, Calendar.FEBRUARY,8); highs[34] = new Double(59.0); lows[34] = new Double(34.0); opens[34] = new Double(57.0); closes[34] = new Double(43.0); dates[35] = createDate(2001, Calendar.FEBRUARY,9); highs[35] = new Double(48.0); lows[35] = new Double(39.0); opens[35] = new Double(46.0); closes[35] = new Double(47.0); dates[36] = createDate(2001, Calendar.FEBRUARY,10); highs[36] = new Double(55.0); lows[36] = new Double(30.0); opens[36] = new Double(37.0); closes[36] = new Double(30.0); dates[37] = createDate(2001, Calendar.FEBRUARY,11); highs[37] = new Double(60.0); lows[37] = new Double(32.0); opens[37] = new Double(56.0); closes[37] = new Double(36.0); dates[38] = createDate(2001, Calendar.FEBRUARY,12); highs[38] = new Double(56.0); lows[38] = new Double(42.0); opens[38] = new Double(53.0); closes[38] = new Double(54.0); dates[39] = createDate(2001, Calendar.FEBRUARY,13); highs[39] = new Double(49.0); lows[39] = new Double(42.0); opens[39] = new Double(45.0); closes[39] = new Double(42.0); dates[40] = createDate(2001, Calendar.FEBRUARY,14); highs[40] = new Double(55.0); lows[40] = new Double(42.0); opens[40] = new Double(47.0); closes[40] = new Double(54.0); dates[41] = createDate(2001, Calendar.FEBRUARY,15); highs[41] = new Double(49.0); lows[41] = new Double(35.0); opens[41] = new Double(38.0); closes[41] = new Double(35.0); dates[42] = createDate(2001, Calendar.FEBRUARY,16); highs[42] = new Double(47.0); lows[42] = new Double(38.0); opens[42] = new Double(43.0); closes[42] = new Double(42.0); dates[43] = createDate(2001, Calendar.FEBRUARY,17); highs[43] = new Double(53.0); lows[43] = new Double(42.0); opens[43] = new Double(47.0); closes[43] = new Double(48.0); dates[44] = createDate(2001, Calendar.FEBRUARY,18); highs[44] = new Double(47.0); lows[44] = new Double(44.0); opens[44] = new Double(46.0); closes[44] = new Double(44.0); dates[45] = createDate(2001, Calendar.FEBRUARY,19); highs[45] = new Double(46.0); lows[45] = new Double(40.0); opens[45] = new Double(43.0); closes[45] = new Double(44.0); dates[46] = createDate(2001, Calendar.FEBRUARY,20); highs[46] = new Double(48.0); lows[46] = new Double(41.0); opens[46] = new Double(46.0); closes[46] = new Double(41.0); ### 3744, setRange, CombinedHorizontalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalNumberAxis.java, 210, 221 12 /** * Sets our AxisRange (min/max). This is done after a CombinedPlot has * has calculated the overall range of all CombinedAxis that share the same * Axis for all Plots. This makes all plots display the complete range of * their Datasets. */ 22 public void setRange(AxisRange range) { setAutoRange(false); Number min = (Number)range.getMin(); Number max = (Number)range.getMax(); setMinimumAxisValue(min.doubleValue()); setMaximumAxisValue(max.doubleValue()); if (visible) { HorizontalNumberAxis axis = (HorizontalNumberAxis)getParentAxis(); axis.setAutoRange(false); axis.setMinimumAxisValue(min.doubleValue()); axis.setMaximumAxisValue(max.doubleValue()); ### 3745, reserveHeight, CombinedHorizontalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalNumberAxis.java, 152, 160 14 /** * Returns the height required to draw the axis in the specified draw area. If * the axis is not visible, returns zero. * @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; */ 18 public double reserveHeight(Graphics2D g2, Plot plot, Rectangle2D drawArea) { if (!visible) { return 0; } else if (reserveHeight > 0) { return reserveHeight; } else { return axis.reserveHeight(g2, plot, drawArea); ### 3746, setVisible, CombinedHorizontalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalNumberAxis.java, 231, 232 18 /** * Sets the visible flag on or off for this combined axis. A visible axis will * display the axis title, ticks and legend depending on the parent's * attributes. An invisible axis will not display anything. If the invisible * axis isContainer(), then it occupies space on the graphic device. */ -------------- ////////////////////////////////////////////////////////////////////////////// -------------- 4 public void setVisible(boolean flag) { visible = flag; ### 3747, getRange, CombinedHorizontalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalNumberAxis.java, 198, 201 5 /** * Returns the AxisRange (min/max) of our Axis */ 8 public AxisRange getRange() { autoAdjustRange(); return (new NumberAxisRange(new Double(getMinimumAxisValue()), new Double(getMaximumAxisValue()))); ### 3748, getLowValue, SampleHighLowDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleHighLowDataset.java, 119, 123 11 /** * Returns the low-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 low-value for the specified series and item. */ 10 public Number getLowValue(int series, int item) { if (series==0) { return lows[item]; } else return null; ### 3749, getOpenValue, SampleHighLowDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleHighLowDataset.java, 132, 136 11 /** * Returns the open-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 open-value for the specified series and item. */ 10 public Number getOpenValue(int series, int item) { if (series==0) { return opens[item]; } else return null; ### 3750, getHighValue, SampleHighLowDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleHighLowDataset.java, 106, 110 11 /** * Returns the high-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 high-value for the specified series and item. */ 10 public Number getHighValue(int series, int item) { if (series==0) { return highs[item]; } else return null; ### 3751, CombinedHorizontalNumberAxis, CombinedHorizontalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalNumberAxis.java, 75, 104 9 /** * Constructs a blank horizontal number axis. * @param axis Parent HorizontalNumberAxis to take as reference. * @param display Indicates if the axis is visible */ 56 public CombinedHorizontalNumberAxis(HorizontalNumberAxis axis, boolean visible) { super(axis.getLabel(), axis.getLabelFont(), axis.getLabelPaint(), axis.getLabelInsets(), axis.isTickLabelsVisible(), axis.getTickLabelFont(), axis.getTickLabelPaint(), axis.getTickLabelInsets(), axis.getVerticalTickLabels(), axis.isTickMarksVisible(), axis.getTickMarkStroke(), axis.isAutoRange(), axis.autoRangeIncludesZero(), axis.getAutoRangeMinimumSize(), axis.getMinimumAxisValue(), axis.getMaximumAxisValue(), axis.isInverted(), axis.isAutoTickUnitSelection(), axis.getTickUnit(), axis.isGridLinesVisible(), axis.getGridStroke(), axis.getGridPaint(), axis.getCrosshairValue(), axis.getCrosshairStroke(), axis.getCrosshairPaint()); this.axis = axis; this.visible = visible; ### 3752, getYValue, SampleHighLowDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleHighLowDataset.java, 93, 97 11 /** * 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. */ 10 public Number getYValue(int series, int item) { if (series==0) { return closes[item]; } else return null; ### 3753, getParentAxis, CombinedHorizontalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalNumberAxis.java, 191, 192 5 /** * Returns our parent axis. */ 4 public Axis getParentAxis() { return axis; ### 3754, getItemCount, SampleHighLowDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleHighLowDataset.java, 177, 178 9 /** * Returns the number of items in the specified series. * @param series The index (zero-based) of the series; * @return The number of items in the specified series. */ 4 public int getItemCount(int series) { return 47; // one series with 47 items in this sample ### 3755, SampleHighLowDataset, SampleHighLowDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleHighLowDataset.java, 65, 66 5 /** * Default constructor. */ 4 public SampleHighLowDataset() { this.initialiseData(); ### 3756, getSeriesCount, SampleHighLowDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleHighLowDataset.java, 156, 157 7 /** * Returns the number of series in the data source, ONE in this sample. * @return The number of series in the data source. */ 4 public int getSeriesCount() { return 1; ### 3757, draw, CombinedHorizontalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/CombinedHorizontalNumberAxis.java, 119, 135 15 /** * If the axis is not visible, just draws grid lines if needed, but no * horizontal axis labels. * @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); */ 32 public void draw(Graphics2D g2, Rectangle2D drawArea, Rectangle2D plotArea) { if (visible) { axis.draw(g2, drawArea, plotArea); } else { if (gridLinesVisible) { refreshTicks(g2, drawArea, plotArea); Iterator iterator = ticks.iterator(); while (iterator.hasNext()) { Tick tick = (Tick)iterator.next(); float xx = (float)translateValueToJava2D(tick.getNumericalValue(), plotArea); g2.setStroke(gridStroke); g2.setPaint(gridPaint); Line2D gridline = new Line2D.Float(xx, (float)plotArea.getMaxY(), xx, (float)plotArea.getMinY()); g2.draw(gridline); ### 3758, getCloseValue, SampleHighLowDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleHighLowDataset.java, 145, 149 11 /** * Returns the close-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 close-value for the specified series and item. */ 10 public Number getCloseValue(int series, int item) { if (series==0) { return closes[item]; } else return null; ### 3759, getXValue, SampleHighLowDataset, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleHighLowDataset.java, 75, 76 11 /** * 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. */ 4 public Number getXValue(int series, int item) { return new Long(dates[item].getTime()); ### 3760, reserveAxisArea, OverlaidVerticalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/OverlaidVerticalNumberAxis.java, 132, 144 15 /** * Returns area in which the axis will be displayed. The list is our axes is * checked and the first non zero area is returned. * @param g2 The graphics device; * @param plot A reference to the plot; * @param drawArea The area within which the plot and axes should be drawn; * @param reservedWidth The space already reserved for the vertical axis; */ 24 public Rectangle2D reserveAxisArea(Graphics2D g2, Plot plot, Rectangle2D drawArea, double reservedWidth) { Rectangle2D empty = new Rectangle2D.Double(); Iterator iter = axes.iterator(); while (iter.hasNext()) { VerticalAxis axis = (VerticalAxis)iter.next(); Rectangle2D area = axis.reserveAxisArea(g2, plot, drawArea, reservedWidth); if (!area.equals(empty)) { return area; } } return empty; ### 3762, reserveWidth, OverlaidVerticalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/OverlaidVerticalNumberAxis.java, 111, 121 13 /** * Returns the width required to draw the axis in the specified draw area. The * list of our axes is checked and the first non zero width is returned. * @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; */ 20 public double reserveWidth(Graphics2D g2, Plot plot, Rectangle2D drawArea) { Iterator iter = axes.iterator(); while (iter.hasNext()) { VerticalAxis axis = (VerticalAxis)iter.next(); double width = axis.reserveWidth(g2, plot, drawArea); if (width != 0) { return width; } } return 0; ### 3763, OverlaidVerticalNumberAxis, OverlaidVerticalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/OverlaidVerticalNumberAxis.java, 62, 82 9 /** * Constructor. * @param plot CombinedPlot where this OverlaidVerticalNumberAxis will be * contained. */ 36 public OverlaidVerticalNumberAxis(CombinedPlot plot) { super((VerticalNumberAxis)plot.getVerticalAxis(), false); this.plot = plot; this.axes = plot.getVerticalAxes(); // validate type of axes and tell each axis that they are overlaid boolean oneVisible = false; Iterator iter = axes.iterator(); while (iter.hasNext()) { Object axis = iter.next(); if ((axis instanceof CombinedVerticalNumberAxis)) { CombinedVerticalNumberAxis combAxis = (CombinedVerticalNumberAxis)axis; oneVisible |= combAxis.isVisible(); if (iter.hasNext() || oneVisible) { combAxis.setGridLinesVisible(false); } } else { throw new IllegalArgumentException("Can not combine " + axis.getClass() + " into " + this.getClass() ); ### 3764, getRange, OverlaidVerticalNumberAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/OverlaidVerticalNumberAxis.java, 155, 156 5 /** * Returns the AxisRange (min/max) of our Axis */ 4 public AxisRange getRange() { return plot.getRange(axes); ### 3765, OverlaidHorizontalDateAxis, OverlaidHorizontalDateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/OverlaidHorizontalDateAxis.java, 65, 83 9 /** * Constructor. * @param plot CombinedPlot where this OverlaidHorizontalDateAxis will be * contained. */ 36 public OverlaidHorizontalDateAxis(CombinedPlot plot) { super((HorizontalDateAxis)plot.getHorizontalAxis(), false); this.plot = plot; this.axes = plot.getHorizontalAxes(); // validate type of axes and tell each axis that it's overlaid boolean oneVisible = false; Iterator iter = axes.iterator(); while (iter.hasNext()) { Object axis = iter.next(); if ((axis instanceof CombinedHorizontalDateAxis)) { CombinedHorizontalDateAxis combAxis = (CombinedHorizontalDateAxis)axis; oneVisible |= combAxis.isVisible(); if (iter.hasNext() || oneVisible) { combAxis.setGridLinesVisible(false); } } else { throw new IllegalArgumentException("Can not combine " + axis.getClass() + " into " + this.getClass() ); ### 3766, reserveAxisArea, OverlaidHorizontalDateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/OverlaidHorizontalDateAxis.java, 132, 143 15 /** * Returns area in which the axis will be displayed. The list is our axes is * checked and the first non zero area is returned. * @param g2 The graphics device; * @param plot A reference to the plot; * @param drawArea The area within which the plot and axes should be drawn; * @param reservedWidth The space already reserved for the vertical axis; */ 24 public Rectangle2D reserveAxisArea(Graphics2D g2, Plot plot, Rectangle2D drawArea, double reservedWidth) { Rectangle2D empty = new Rectangle2D.Double(); Iterator iter = axes.iterator(); while (iter.hasNext()) { HorizontalAxis axis = (HorizontalAxis)iter.next(); Rectangle2D area = axis.reserveAxisArea(g2, plot, drawArea, reservedWidth); if (!area.equals(empty)) { return area; } } return empty; ### 3767, getRange, OverlaidHorizontalDateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/OverlaidHorizontalDateAxis.java, 153, 154 5 /** * Returns the AxisRange (min/max) of our Axis */ 4 public AxisRange getRange() { return plot.getRange(axes); ### 3768, reserveHeight, OverlaidHorizontalDateAxis, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/combination/OverlaidHorizontalDateAxis.java, 112, 121 13 /** * Returns the height required to draw the axis in the specified draw area. The * list of our axes is checked and the first non zero height is returned. * @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; */ 20 public double reserveHeight(Graphics2D g2, Plot plot, Rectangle2D drawArea) { Iterator iter = axes.iterator(); while (iter.hasNext()) { HorizontalAxis axis = (HorizontalAxis)iter.next(); double height = axis.reserveHeight(g2, plot, drawArea); if (height != 0) { return height; } } return 0; ### 3770, createHighLowDataset, JFreeChartServletDemo, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/JFreeChartServletDemo.java, 150, 389 5 /** * Creates and returns a sample high-low dataset for the demo. Added by Andrzej Porebski. */ 384 public HighLowDataset 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 null; // broken, needs fixing... ### 3771, getColor, JFreeChartServletDemo, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/JFreeChartServletDemo.java, 70, 84 7 /** * Utility method to return a color. Corresponds to the color selection in the * HTML form. */ 28 protected Color getColor(int color) { switch (color % 11) { case 0: return Color.white; case 1: return Color.black; case 2: return Color.blue; case 3: return Color.green; case 4: return Color.red; case 5: return Color.yellow; case 6: return Color.gray; case 7 : return Color.orange; case 8: return Color.cyan; case 9: return Color.magenta; case 10: return Color.pink; default: return Color.white; ### 3772, createCategoryDataset, JFreeChartServletDemo, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/JFreeChartServletDemo.java, 92, 107 5 /** * Creates and returns a category dataset for the demo charts. */ 26 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), new Integer(8), 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); ### 3773, createDateTime, JFreeChartServletDemo, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/JFreeChartServletDemo.java, 122, 124 5 /** * Returns a java.util.Date for the specified year, month, day, hour and minute. */ 6 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(); ### 3774, doGet, JFreeChartServletDemo, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/JFreeChartServletDemo.java, 570, 609 9 /** * Basic servlet method, answers requests fromt the browser. * @param request HTTPServletRequest * @param response HTTPServletResponse */ 70 public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("image/jpeg"); int type = 1; try { type = Integer.parseInt( request.getParameter( "type" ) ); } catch (Exception e) { } int initGradColor= 0; int finalGradColor= 0; try { initGradColor = Integer.parseInt( request.getParameter( "initGradColor" ) ); finalGradColor = Integer.parseInt( request.getParameter( "finalGradColor" ) ); } catch (Exception e) { } JFreeChart chart = createChart( type, initGradColor, finalGradColor ); int width = 400; int height = 300; try { width = Integer.parseInt( request.getParameter( "width" ) ); height = Integer.parseInt( request.getParameter( "height" ) ); } catch (Exception e) { } //BufferedImage img = draw( chart, width, height ); OutputStream out = response.getOutputStream(); // BufferedImage image = chart.createBufferedImage(width, height); // JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out); // JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(image); // param.setQuality(1.0f, true); // encoder.encode(image, param); ChartUtilities.writeChartAsJPEG(out, chart, width, height); out.close(); ### 3775, createTestXYDataset, JFreeChartServletDemo, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/JFreeChartServletDemo.java, 130, 143 5 /** * Creates and returns a XYDataset for the demo charts. */ 24 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); ### 3776, init, JFreeChartServletDemo, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/JFreeChartServletDemo.java, 558, 562 5 /** * Override init() to set up data used by invocations of this servlet. */ 8 public void init(ServletConfig config) throws ServletException { super.init(config); // save servlet context context = config.getServletContext(); ### 3778, createDate, JFreeChartServletDemo, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/JFreeChartServletDemo.java, 114, 116 5 /** * Returns a java.util.Date for the specified year, month and day. */ 6 private Date createDate(int year, int month, int day) { GregorianCalendar calendar = new GregorianCalendar(year, month, day); return calendar.getTime(); ### 3779, SampleXYDataset2, SampleXYDataset2, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/demo/SampleXYDataset2.java, 62, 68 5 /** * Default constructor. */ 12 public SampleXYDataset2() { for (int series=0; series * In designing the panel, we need to be aware that subclasses of Plot will need to implement * subclasses of PlotPropertyEditPanel - so we need to leave one or two 'slots' where the * subclasses can extend the user interface. */ 128 public PlotPropertyEditPanel(Plot plot) { _insets = plot.getInsets(); backgroundPaintSample = new PaintSample(plot.getBackgroundPaint()); outlineStrokeSample = new StrokeSample(plot.getOutlineStroke()); outlinePaintSample = new PaintSample(plot.getOutlinePaint()); setLayout(new BorderLayout()); availableStrokeSamples = new StrokeSample[3]; availableStrokeSamples[0] = new StrokeSample(new BasicStroke(1.0f)); availableStrokeSamples[1] = new StrokeSample(new BasicStroke(2.0f)); availableStrokeSamples[2] = new StrokeSample(new BasicStroke(3.0f)); // create a panel for the settings... JPanel panel = new JPanel(new BorderLayout()); panel.setBorder(BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), plot.getPlotType()+":")); JPanel general = new JPanel(new BorderLayout()); general.setBorder(BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "General:")); JPanel interior = new JPanel(new LCBLayout(4)); interior.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); interior.add(new JLabel("Insets:")); JButton button = new JButton("Edit..."); button.setActionCommand("Insets"); button.addActionListener(this); insetsTextField = new InsetsTextField(_insets); insetsTextField.setEnabled(false); interior.add(insetsTextField); interior.add(button); interior.add(new JLabel("Outline stroke:")); button = new JButton("Select..."); button.setActionCommand("OutlineStroke"); button.addActionListener(this); interior.add(outlineStrokeSample); interior.add(button); interior.add(new JLabel("Outline paint:")); button = new JButton("Select..."); button.setActionCommand("OutlinePaint"); button.addActionListener(this); interior.add(outlinePaintSample); interior.add(button); interior.add(new JLabel("Background paint:")); button = new JButton("Select..."); button.setActionCommand("BackgroundPaint"); button.addActionListener(this); interior.add(backgroundPaintSample); interior.add(button); general.add(interior, BorderLayout.NORTH); JPanel appearance = new JPanel(new BorderLayout()); appearance.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); appearance.add(general, BorderLayout.NORTH); JTabbedPane tabs = new JTabbedPane(); tabs.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); verticalAxisPropertyPanel = AxisPropertyEditPanel.getInstance(plot.getAxis(Plot.VERTICAL_AXIS)); if (verticalAxisPropertyPanel!=null) { verticalAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2,2,2,2)); tabs.add("Vertical Axis", verticalAxisPropertyPanel); } horizontalAxisPropertyPanel = AxisPropertyEditPanel.getInstance(plot.getAxis(Plot.HORIZONTAL_AXIS)); if (horizontalAxisPropertyPanel!=null) { horizontalAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2,2,2,2)); tabs.add("Horizontal Axis", horizontalAxisPropertyPanel); } tabs.add("Appearance", appearance); panel.add(tabs); add(panel); ### 3819, getOutlinePaint, PlotPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/PlotPropertyEditPanel.java, 188, 189 5 /** * Returns the current outline paint. */ 4 public Paint getOutlinePaint() { return outlinePaintSample.getPaint(); ### 3820, getOutlineStroke, PlotPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/PlotPropertyEditPanel.java, 181, 182 5 /** * Returns the current outline stroke. */ 4 public Stroke getOutlineStroke() { return outlineStrokeSample.getStroke(); ### 3821, attemptOutlinePaintSelection, PlotPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/PlotPropertyEditPanel.java, 254, 258 7 /** * Allow the user to change the outline paint. We use JColorChooser, so the user can only * choose colors (a subset of all possible paints). */ 10 private void attemptOutlinePaintSelection() { Color c; c = JColorChooser.showDialog(this, "Outline Color", Color.blue); if (c!=null) { outlinePaintSample.setPaint(c); ### 3822, getPlotInsets, PlotPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/PlotPropertyEditPanel.java, 165, 168 5 /** * Returns the current plot insets. */ 8 public Insets getPlotInsets() { if (_insets == null) _insets = new Insets(0,0,0,0); return _insets; ### 3823, getBackgroundPaint, PlotPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/PlotPropertyEditPanel.java, 174, 175 5 /** * Returns the current background paint. */ 4 public Paint getBackgroundPaint() { return backgroundPaintSample.getPaint(); ### 3824, getVerticalAxisPropertyEditPanel, PlotPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/PlotPropertyEditPanel.java, 195, 196 5 /** * Returns a reference to the panel for editing the properties of the vertical axis. */ 4 public AxisPropertyEditPanel getVerticalAxisPropertyEditPanel() { return verticalAxisPropertyPanel; ### 3825, attemptOutlineStrokeSelection, PlotPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/PlotPropertyEditPanel.java, 240, 246 5 /** * Allow the user to change the outline stroke. */ 12 private void attemptOutlineStrokeSelection() { StrokeChooserPanel panel = new StrokeChooserPanel(null, availableStrokeSamples); int result = JOptionPane.showConfirmDialog(this, panel, "Stroke Selection", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result==JOptionPane.OK_OPTION) { outlineStrokeSample.setStroke(panel.getSelectedStroke()); ### 3826, attemptBackgroundPaintSelection, PlotPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/PlotPropertyEditPanel.java, 229, 233 5 /** * Allow the user to change the background paint. */ 10 private void attemptBackgroundPaintSelection() { Color c; c = JColorChooser.showDialog(this, "Background Color", Color.blue); if (c!=null) { backgroundPaintSample.setPaint(c); ### 3827, getHorizontalAxisPropertyEditPanel, PlotPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/PlotPropertyEditPanel.java, 202, 203 5 /** * Returns a reference to the panel for editing the properties of the horizontal axis. */ 4 public AxisPropertyEditPanel getHorizontalAxisPropertyEditPanel() { return horizontalAxisPropertyPanel; ### 3828, editInsets, PlotPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/PlotPropertyEditPanel.java, 265, 273 5 /** * Allow the user to edit the individual insets' values. */ 16 private void editInsets() { InsetsChooserPanel panel = new InsetsChooserPanel(_insets); int result = JOptionPane.showConfirmDialog(this, panel, "Edit Insets", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result==JOptionPane.OK_OPTION) { _insets = panel.getInsets(); insetsTextField.setInsets(_insets); ### 3829, updatePlotProperties, PlotPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/PlotPropertyEditPanel.java, 282, 296 7 /** * Updates the plot properties to match the properties defined on the panel. * @param plot The plot. */ 24 public void updatePlotProperties(Plot plot) { // set the plot properties... plot.setOutlinePaint(this.getOutlinePaint()); plot.setOutlineStroke(this.getOutlineStroke()); plot.setBackgroundPaint(this.getBackgroundPaint()); plot.setInsets(this.getPlotInsets()); // then the axis properties... if (this.horizontalAxisPropertyPanel!=null) { this.horizontalAxisPropertyPanel.setAxisProperties(plot.getAxis(Plot.HORIZONTAL_AXIS)); } if (this.verticalAxisPropertyPanel!=null) { this.verticalAxisPropertyPanel.setAxisProperties(plot.getAxis(Plot.VERTICAL_AXIS)); ### 3830, actionPerformed, PlotPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/PlotPropertyEditPanel.java, 209, 221 5 /** * Handles user actions generated within the panel. */ 26 public void actionPerformed(ActionEvent event) { String command = event.getActionCommand(); if (command.equals("BackgroundPaint")) { attemptBackgroundPaintSelection(); } else if (command.equals("OutlineStroke")) { attemptOutlineStrokeSelection(); } else if (command.equals("OutlinePaint")) { attemptOutlinePaintSelection(); } else if (command.equals("Insets")) { editInsets(); ### 3831, attemptGridStrokeSelection, NumberAxisPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/NumberAxisPropertyEditPanel.java, 210, 216 5 /** * Handle a grid stroke selection. */ 12 private void attemptGridStrokeSelection() { StrokeChooserPanel panel = new StrokeChooserPanel(null, availableStrokeSamples); int result = JOptionPane.showConfirmDialog(this, panel, "Stroke Selection", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result==JOptionPane.OK_OPTION) { gridStrokeSample.setStroke(panel.getSelectedStroke()); ### 3832, actionPerformed, NumberAxisPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/NumberAxisPropertyEditPanel.java, 187, 204 5 /** * Handles actions from within the property panel. */ 36 public void actionPerformed(ActionEvent event) { String command = event.getActionCommand(); if (command.equals("GridStroke")) { attemptGridStrokeSelection(); } else if (command.equals("GridPaint")) { attemptGridPaintSelection(); } else if (command.equals("AutoRangeOnOff")) { toggleAutoRange(); } else if (command.equals("MinimumRange")) { validateMinimum(); } else if (command.equals("MaximumRange")) { validateMaximum(); } else super.actionPerformed(event); // pass to the super-class for handling ### 3834, getMaximumValue, NumberAxisPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/NumberAxisPropertyEditPanel.java, 180, 181 5 /** * Returns the current setting of the maximum value in the axis range. */ 4 public double getMaximumValue() { return maximumValue; ### 3835, NumberAxisPropertyEditPanel, NumberAxisPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/NumberAxisPropertyEditPanel.java, 89, 159 5 /** * Standard constructor: builds a property panel for the specified axis. */ 112 public NumberAxisPropertyEditPanel(NumberAxis axis) { super(axis); autoRange = axis.isAutoRange(); minimumValue = axis.getMinimumAxisValue(); maximumValue = axis.getMaximumAxisValue(); gridPaintSample = new PaintSample(axis.getGridPaint()); gridStrokeSample = new StrokeSample(axis.getGridStroke()); availableStrokeSamples = new StrokeSample[3]; availableStrokeSamples[0] = new StrokeSample(new BasicStroke(1.0f)); availableStrokeSamples[1] = new StrokeSample(new BasicStroke(2.0f)); availableStrokeSamples[2] = new StrokeSample(new BasicStroke(3.0f)); JTabbedPane other = getOtherTabs(); JPanel range = new JPanel(new LCBLayout(3)); range.setBorder(BorderFactory.createEmptyBorder(4,4,4,4)); range.add(new JPanel()); autoRangeCheckBox = new JCheckBox("Auto-adjust range:", autoRange); autoRangeCheckBox.setActionCommand("AutoRangeOnOff"); autoRangeCheckBox.addActionListener(this); range.add(autoRangeCheckBox); range.add(new JPanel()); range.add(new JLabel("Minimum range value:")); minimumRangeValue = new JTextField(Double.toString(minimumValue)); minimumRangeValue.setEnabled(!autoRange); minimumRangeValue.setActionCommand("MinimumRange"); minimumRangeValue.addActionListener(this); minimumRangeValue.addFocusListener(this); range.add(minimumRangeValue); range.add(new JPanel()); range.add(new JLabel("Maximum range value:")); maximumRangeValue = new JTextField(Double.toString(maximumValue)); maximumRangeValue.setEnabled(!autoRange); maximumRangeValue.setActionCommand("MaximumRange"); maximumRangeValue.addActionListener(this); maximumRangeValue.addFocusListener(this); range.add(maximumRangeValue); range.add(new JPanel()); other.add("Range", range); JPanel grid = new JPanel(new LCBLayout(3)); grid.setBorder(BorderFactory.createEmptyBorder(4,4,4,4)); grid.add(new JPanel()); showGridLinesCheckBox = new JCheckBox("Show grid lines", axis.isGridLinesVisible()); grid.add(showGridLinesCheckBox); grid.add(new JPanel()); grid.add(new JLabel("Grid stroke:")); JButton button = new JButton("Set stroke..."); button.setActionCommand("GridStroke"); button.addActionListener(this); grid.add(gridStrokeSample); grid.add(button); grid.add(new JLabel("Grid paint:")); button = new JButton("Set paint..."); button.setActionCommand("GridPaint"); button.addActionListener(this); grid.add(gridPaintSample); grid.add(button); other.add("Grid", grid); ### 3837, getMinimumValue, NumberAxisPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/NumberAxisPropertyEditPanel.java, 173, 174 5 /** * Returns the current setting of the minimum value in the axis range. */ 4 public double getMinimumValue() { return minimumValue; ### 3839, attemptGridPaintSelection, NumberAxisPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/NumberAxisPropertyEditPanel.java, 223, 227 5 /** * Handle a grid paint selection. */ 10 private void attemptGridPaintSelection() { Color c; c = JColorChooser.showDialog(this, "Grid Color", Color.blue); if (c!=null) { gridPaintSample.setPaint(c); ### 3840, isAutoRange, NumberAxisPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/NumberAxisPropertyEditPanel.java, 166, 167 5 /** * Returns the current setting of the auto-range property. */ 4 public boolean isAutoRange() { return autoRange; ### 3843, actionPerformed, LegendPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/LegendPropertyEditPanel.java, 173, 188 5 /** * Handles user interactions with the panel. */ 32 public void actionPerformed(ActionEvent event) { String command = event.getActionCommand(); if (command.equals("OutlineStroke")) { attemptModifyOutlineStroke(); } else if (command.equals("OutlinePaint")) { attemptModifyOutlinePaint(); } else if (command.equals("BackgroundPaint")) { attemptModifyBackgroundPaint(); } else if (command.equals("SeriesFont")) { attemptModifySeriesFont(); } else if (command.equals("SeriesPaint")) { attemptModifySeriesPaint(); ### 3844, attemptModifySeriesPaint, LegendPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/LegendPropertyEditPanel.java, 246, 250 5 /** * Allows the user the opportunity to change the series label paint. */ 10 private void attemptModifySeriesPaint() { Color c; c = JColorChooser.showDialog(this, "Series Label Color", Color.blue); if (c!=null) { seriesPaint.setPaint(c); ### 3845, attemptModifySeriesFont, LegendPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/LegendPropertyEditPanel.java, 230, 237 5 /** * Allows the user the opportunity to change the series label font. */ 12 public void attemptModifySeriesFont() { FontChooserPanel panel = new FontChooserPanel(seriesFont); int result = JOptionPane.showConfirmDialog(this, panel, "Font Selection", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result==JOptionPane.OK_OPTION) { seriesFont = panel.getSelectedFont(); ### 3846, attemptModifyBackgroundPaint, LegendPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/LegendPropertyEditPanel.java, 219, 223 5 /** * Allows the user the opportunity to change the background paint. */ 10 private void attemptModifyBackgroundPaint() { Color c; c = JColorChooser.showDialog(this, "Background Color", Color.blue); if (c!=null) { backgroundPaint.setPaint(c); ### 3847, getSeriesPaint, LegendPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/LegendPropertyEditPanel.java, 166, 167 5 /** * Returns the current series label paint. */ 4 public Paint getSeriesPaint() { return seriesPaint.getPaint(); ### 3848, getOutlinePaint, LegendPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/LegendPropertyEditPanel.java, 145, 146 5 /** * Returns the current outline paint. */ 4 public Paint getOutlinePaint() { return outlinePaint.getPaint(); ### 3849, LegendPropertyEditPanel, LegendPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/LegendPropertyEditPanel.java, 71, 132 5 /** * Standard constructor: builds a panel based on the specified legend. */ 102 public LegendPropertyEditPanel(Legend legend) { StandardLegend l = (StandardLegend)legend; outlineStroke = new StrokeSample(l.getOutlineStroke()); outlinePaint = new PaintSample(l.getOutlinePaint()); backgroundPaint = new PaintSample(l.getBackgroundPaint()); seriesFont = l.getSeriesFont(); seriesPaint = new PaintSample(l.getSeriesPaint()); availableStrokeSamples = new StrokeSample[4]; availableStrokeSamples[0] = new StrokeSample(new BasicStroke(1.0f)); availableStrokeSamples[1] = new StrokeSample(new BasicStroke(2.0f)); availableStrokeSamples[2] = new StrokeSample(new BasicStroke(3.0f)); availableStrokeSamples[3] = new StrokeSample(new BasicStroke(4.0f)); setLayout(new BorderLayout()); JPanel general = new JPanel(new BorderLayout()); general.setBorder(BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "General:")); JPanel interior = new JPanel(new LCBLayout(5)); interior.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); JLabel titleLabel = new JLabel("Text:"); interior.add(new JLabel("Outline:")); interior.add(outlineStroke); JButton button = new JButton("Select..."); button.setActionCommand("OutlineStroke"); button.addActionListener(this); interior.add(button); interior.add(new JLabel("Outline Paint:")); button = new JButton("Select..."); button.setActionCommand("OutlinePaint"); button.addActionListener(this); interior.add(outlinePaint); interior.add(button); interior.add(new JLabel("Background:")); button = new JButton("Select..."); button.setActionCommand("BackgroundPaint"); button.addActionListener(this); interior.add(backgroundPaint); interior.add(button); interior.add(new JLabel("Series label font:")); button = new JButton("Select..."); button.setActionCommand("SeriesFont"); button.addActionListener(this); interior.add(new FontDisplayField(seriesFont)); interior.add(button); interior.add(new JLabel("Series label paint:")) ; button = new JButton("Select..."); button.setActionCommand("SeriesPaint"); button.addActionListener(this); interior.add(seriesPaint) ; interior.add(button) ; general.add(interior); add(general, BorderLayout.NORTH); ### 3850, attemptModifyOutlinePaint, LegendPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/LegendPropertyEditPanel.java, 208, 212 5 /** * Allows the user the opportunity to change the outline paint. */ 10 private void attemptModifyOutlinePaint() { Color c; c = JColorChooser.showDialog(this, "Outline Color", Color.blue); if (c!=null) { outlinePaint.setPaint(c); ### 3851, getBackgroundPaint, LegendPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/LegendPropertyEditPanel.java, 152, 153 5 /** * Returns the current background paint. */ 4 public Paint getBackgroundPaint() { return backgroundPaint.getPaint(); ### 3852, getOutlineStroke, LegendPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/LegendPropertyEditPanel.java, 138, 139 5 /** * Returns the current outline stroke. */ 4 public Stroke getOutlineStroke() { return outlineStroke.getStroke(); ### 3853, getSeriesFont, LegendPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/LegendPropertyEditPanel.java, 159, 160 5 /** * Returns the current series label font. */ 4 public Font getSeriesFont() { return seriesFont; ### 3854, setLegendProperties, LegendPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/LegendPropertyEditPanel.java, 257, 264 5 /** * Sets the properties of the specified legend to match the properties defined on this panel. */ 16 public void setLegendProperties(Legend legend) { if (legend instanceof StandardLegend) { // only supports StandardLegend at present StandardLegend standard = (StandardLegend)legend; standard.setOutlineStroke(this.getOutlineStroke()); standard.setOutlinePaint(this.getOutlinePaint()); standard.setBackgroundPaint(this.getBackgroundPaint()); standard.setSeriesFont(this.getSeriesFont()); standard.setSeriesPaint(this.getSeriesPaint()); ### 3855, attemptModifyOutlineStroke, LegendPropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/LegendPropertyEditPanel.java, 195, 201 5 /** * Allows the user the opportunity to change the outline stroke. */ 12 private void attemptModifyOutlineStroke() { StrokeChooserPanel panel = new StrokeChooserPanel(outlineStroke, availableStrokeSamples); int result = JOptionPane.showConfirmDialog(this, panel, "Pen/Stroke Selection", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result==JOptionPane.OK_OPTION) { outlineStroke.setStroke(panel.getSelectedStroke()); ### 3856, setTitleProperties, TitlePropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/TitlePropertyEditPanel.java, 176, 181 5 /** * Sets the properties of the specified title to match the properties defined on this panel. */ 12 public void setTitleProperties(Title title) { if (title instanceof StandardTitle) { // only supports StandardTitle at present StandardTitle standard = (StandardTitle)title; standard.setTitle(this.getTitle()); standard.setTitleFont(this.getTitleFont()); standard.setTitlePaint(this.getTitlePaint()); ### 3857, attemptPaintSelection, TitlePropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/TitlePropertyEditPanel.java, 166, 169 9 /** * Allow the user the opportunity to select a Paint object. For now, we just use the * standard color chooser - all colors are Paint objects, but not all Paint objects are * colors (later we can implement a more general Paint chooser). */ 8 public void attemptPaintSelection() { Color c = JColorChooser.showDialog(this, "Title Color", Color.blue); if (c!=null) { titlePaint.setPaint(c); ### 3858, attemptFontSelection, TitlePropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/TitlePropertyEditPanel.java, 148, 156 5 /** * Presents a font selection dialog to the user. */ 14 public void attemptFontSelection() { FontChooserPanel panel = new FontChooserPanel(titleFont); int result = JOptionPane.showConfirmDialog(this, panel, "Font Selection", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result==JOptionPane.OK_OPTION) { titleFont = panel.getSelectedFont(); fontfield.setText(titleFont.getFontName()+" "+titleFont.getSize()); ### 3859, TitlePropertyEditPanel, TitlePropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/TitlePropertyEditPanel.java, 66, 105 7 /** * Standard constructor: builds a panel for displaying/editing the properties of the specified * title. */ 62 public TitlePropertyEditPanel(StandardTitle title) { // initialise local selections titleFont = title.getTitleFont(); titlePaint = new PaintSample(title.getTitlePaint()); setLayout(new BorderLayout()); JPanel general = new JPanel(new BorderLayout()); general.setBorder(BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "General:")); JPanel interior = new JPanel(new LCBLayout(3)); interior.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); JLabel titleLabel = new JLabel("Text:"); titleField = new JTextField(title.getTitle()); interior.add(titleLabel); interior.add(titleField); interior.add(new JPanel()); interior.add(new JLabel("Font:")); fontfield = new FontDisplayField(titleFont); JButton b = new JButton("Select..."); b.setActionCommand("SelectFont"); b.addActionListener(this); interior.add(fontfield); interior.add(b); interior.add(new JLabel("Color:")); titlePaint = new PaintSample(title.getTitlePaint()); b = new JButton("Select..."); b.setActionCommand("SelectPaint"); b.addActionListener(this); interior.add(titlePaint); interior.add(b); general.add(interior); add(general, BorderLayout.NORTH); ### 3860, getTitle, TitlePropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/TitlePropertyEditPanel.java, 111, 112 5 /** * Returns the title entered in the panel. */ 4 public String getTitle() { return titleField.getText(); ### 3861, getTitleFont, TitlePropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/TitlePropertyEditPanel.java, 118, 119 5 /** * Returns the font selected in the panel. */ 4 public Font getTitleFont() { return titleFont; ### 3862, getTitlePaint, TitlePropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/TitlePropertyEditPanel.java, 125, 126 5 /** * Returns the paint selected in the panel. */ 4 public Paint getTitlePaint() { return titlePaint.getPaint(); ### 3863, actionPerformed, TitlePropertyEditPanel, JFreeChart071 jfreechart-0.7.1/source/com/jrefinery/chart/ui/TitlePropertyEditPanel.java, 132, 140 5 /** * Handles button clicks by passing control to an appropriate handler method. */ 14 public void actionPerformed(ActionEvent event) { String command = event.getActionCommand(); if (command.equals("SelectFont")) { attemptFontSelection(); } else if (command.equals("SelectPaint")) { attemptPaintSelection(); ###