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; series
* 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
* 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
* 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
* 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 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
* 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