private static ChartPanel createChartPanel(XIntervalSeries percentileSeries, String xAxisLabel, String yAxisLabel, Color color) { XIntervalSeriesCollection percentileDataset = new XIntervalSeriesCollection(); percentileDataset.addSeries(percentileSeries); return getHistogramPlotPanel(percentileDataset, xAxisLabel, yAxisLabel, color); }
/** * Removes a series from the collection and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @param series the series index (zero-based). * * @since 1.0.10 */ public void removeSeries(int series) { if ((series < 0) || (series >= getSeriesCount())) { throw new IllegalArgumentException("Series index out of bounds."); } XIntervalSeries ts = (XIntervalSeries) this.data.get(series); ts.removeChangeListener(this); this.data.remove(series); fireDatasetChanged(); }
/** * Returns the end y-value for an item within a series. This method * maps directly to {@link #getY(int, int)}. * * @param series the series index. * @param item the item index. * * @return The end y-value. */ public Number getEndY(int series, int item) { return getY(series, item); }
/** * Adds a series to the collection and sends a {@link DatasetChangeEvent} * to all registered listeners. * * @param series the series (<code>null</code> not permitted). */ public void addSeries(XIntervalSeries series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } this.data.add(series); series.addChangeListener(this); fireDatasetChanged(); }
/** * Returns the key for a series. * * @param series the series index (in the range {@code 0} to * {@code getSeriesCount() - 1}). * * @return The key for a series. * * @throws IllegalArgumentException if {@code series} is not in the * specified range. */ @Override public Comparable getSeriesKey(int series) { // defer argument checking return getSeries(series).getKey(); }
/** * Returns a series from the collection. * * @param series the series index (zero-based). * * @return The series. * * @throws IllegalArgumentException if {@code series} is not in the * range {@code 0} to {@code getSeriesCount() - 1}. */ public XIntervalSeries getSeries(int series) { if ((series < 0) || (series >= getSeriesCount())) { throw new IllegalArgumentException("Series index out of bounds"); } return (XIntervalSeries) this.data.get(series); }
private void createUI() { dataset = new XIntervalSeriesCollection(); chart = ChartFactory.createHistogram( CHART_TITLE,
/** * Removes all the series from the collection and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @since 1.0.10 */ public void removeAllSeries() { // Unregister the collection as a change listener to each series in // the collection. for (int i = 0; i < this.data.size(); i++) { XIntervalSeries series = (XIntervalSeries) this.data.get(i); series.removeChangeListener(this); } this.data.clear(); fireDatasetChanged(); }
/** * Returns the number of items in the specified series. * * @param series the series (zero-based index). * * @return The item count. * * @throws IllegalArgumentException if <code>series</code> is not in the * range <code>0</code> to <code>getSeriesCount() - 1</code>. */ public int getItemCount(int series) { // defer argument checking return getSeries(series).getItemCount(); }
/** * Returns a series from the collection. * * @param series the series index (zero-based). * * @return The series. * * @throws IllegalArgumentException if <code>series</code> is not in the * range <code>0</code> to <code>getSeriesCount() - 1</code>. */ public XIntervalSeries getSeries(int series) { if ((series < 0) || (series >= getSeriesCount())) { throw new IllegalArgumentException("Series index out of bounds"); } return (XIntervalSeries) this.data.get(series); }
private void createUI() { dataset = new XIntervalSeriesCollection(); chart = ChartFactory.createHistogram( CHART_TITLE,
private static ChartPanel createChartPanel(XIntervalSeries percentileSeries, String xAxisLabel, String yAxisLabel, Color color) { XIntervalSeriesCollection percentileDataset = new XIntervalSeriesCollection(); percentileDataset.addSeries(percentileSeries); return getHistogramPlotPanel(percentileDataset, xAxisLabel, yAxisLabel, color); }
/** * Removes a series from the collection and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @param series the series index (zero-based). * * @since 1.0.10 */ public void removeSeries(int series) { if ((series < 0) || (series >= getSeriesCount())) { throw new IllegalArgumentException("Series index out of bounds."); } XIntervalSeries ts = (XIntervalSeries) this.data.get(series); ts.removeChangeListener(this); this.data.remove(series); fireDatasetChanged(); }
/** * Removes all the series from the collection and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @since 1.0.10 */ public void removeAllSeries() { // Unregister the collection as a change listener to each series in // the collection. for (int i = 0; i < this.data.size(); i++) { XIntervalSeries series = (XIntervalSeries) this.data.get(i); series.removeChangeListener(this); } this.data.clear(); fireDatasetChanged(); }
/** * Returns the end y-value for an item within a series. This method * maps directly to {@link #getY(int, int)}. * * @param series the series index. * @param item the item index. * * @return The end y-value. */ @Override public Number getEndY(int series, int item) { return getY(series, item); }
/** * Returns the number of items in the specified series. * * @param series the series (zero-based index). * * @return The item count. * * @throws IllegalArgumentException if {@code series} is not in the * range {@code 0} to {@code getSeriesCount() - 1}. */ @Override public int getItemCount(int series) { // defer argument checking return getSeries(series).getItemCount(); }
private void setStx(Stx stx) { if (stx != null) { HistogramPanelModel.HistogramConfig config = createHistogramConfig(); if (config == null) { return; } if (!model.hasStx(config)) { model.setStx(config, stx); } dataset = new XIntervalSeriesCollection(); final int[] binCounts = stx.getHistogramBins(); final RasterDataNode raster = getRaster(); final XIntervalSeries series = new XIntervalSeries(raster.getName()); final Histogram histogram = stx.getHistogram(); for (int i = 0; i < binCounts.length; i++) { final double xMin = histogram.getBinLowValue(0, i); final double xMax = i < binCounts.length - 1 ? histogram.getBinLowValue(0, i + 1) : histogram.getHighValue(0); series.add(xMin, xMin, xMax, binCounts[i]); } dataset.addSeries(series); } handleStxChange(); }
/** * Removes a series from the collection and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @param series the series (<code>null</code> not permitted). * * @since 1.0.10 */ public void removeSeries(XIntervalSeries series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } if (this.data.contains(series)) { series.removeChangeListener(this); this.data.remove(series); fireDatasetChanged(); } }
/** * Returns the start y-value for an item within a series. This method * maps directly to {@link #getY(int, int)}. * * @param series the series index. * @param item the item index. * * @return The start y-value. */ public Number getStartY(int series, int item) { return getY(series, item); }
/** * Returns the key for a series. * * @param series the series index (in the range <code>0</code> to * <code>getSeriesCount() - 1</code>). * * @return The key for a series. * * @throws IllegalArgumentException if <code>series</code> is not in the * specified range. */ public Comparable getSeriesKey(int series) { // defer argument checking return getSeries(series).getKey(); }