protected void add(CategoryTableXYDataset ds, Double start, Double end, int value, String seriesName) { ds.add(start,value,seriesName); }
/** * Returns the number of items in the specified series. * Returns the same as {@link CategoryTableXYDataset#getItemCount()}. * * @param series the series index (zero-based). * * @return The item count. */ @Override public int getItemCount(int series) { return getItemCount(); // all series have the same number of items in // this dataset }
/** * Returns the ending Y value for the specified series and item. * * @param series the series index (zero-based). * @param item the item index (zero-based). * * @return The ending Y value. */ public Number getEndY(int series, int item) { return getY(series, item); }
/** * Returns an independent copy of this dataset. * * @return A clone. * * @throws CloneNotSupportedException if there is some reason that cloning * cannot be performed. */ @Override public Object clone() throws CloneNotSupportedException { CategoryTableXYDataset clone = (CategoryTableXYDataset) super.clone(); clone.values = (DefaultKeyedValues2D) this.values.clone(); clone.intervalDelegate = new IntervalXYDelegate(clone); // need to configure the intervalDelegate to match the original clone.intervalDelegate.setFixedIntervalWidth(getIntervalWidth()); clone.intervalDelegate.setAutoWidth(isAutoWidth()); clone.intervalDelegate.setIntervalPositionFactor( getIntervalPositionFactor()); return clone; }
/** * Sets the interval position factor. Must be between 0.0 and 1.0 inclusive. * If the factor is 0.5, the gap is in the middle of the x values. If it * is lesser than 0.5, the gap is farther to the left and if greater than * 0.5 it gets farther to the right. * * @param d the new interval position factor. */ public void setIntervalPositionFactor(double d) { this.intervalDelegate.setIntervalPositionFactor(d); fireDatasetChanged(); }
/** * Removes a value from the dataset. * * @param x the x-value. * @param seriesName the series name. */ public void remove(double x, String seriesName) { remove(new Double(x), seriesName, true); }
/** * Creates a new empty CategoryTableXYDataset. */ public CategoryTableXYDataset() { this.values = new DefaultKeyedValues2D(true); this.intervalDelegate = new IntervalXYDelegate(this); addChangeListener(this.intervalDelegate); }
/** * Returns an independent copy of this dataset. * * @return A clone. * * @throws CloneNotSupportedException if there is some reason that cloning * cannot be performed. */ public Object clone() throws CloneNotSupportedException { CategoryTableXYDataset clone = (CategoryTableXYDataset) super.clone(); clone.values = (DefaultKeyedValues2D) this.values.clone(); clone.intervalDelegate = new IntervalXYDelegate(clone); // need to configure the intervalDelegate to match the original clone.intervalDelegate.setFixedIntervalWidth(getIntervalWidth()); clone.intervalDelegate.setAutoWidth(isAutoWidth()); clone.intervalDelegate.setIntervalPositionFactor( getIntervalPositionFactor()); return clone; }
/** * Sets the interval width to a fixed value, and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @param d the new interval width (must be > 0). */ public void setIntervalWidth(double d) { this.intervalDelegate.setFixedIntervalWidth(d); fireDatasetChanged(); }
/** * Removes a value from the dataset. * * @param x the x-value. * @param seriesName the series name. */ public void remove(double x, String seriesName) { remove(new Double(x), seriesName, true); }
/** * Creates a new empty CategoryTableXYDataset. */ public CategoryTableXYDataset() { this.values = new DefaultKeyedValues2D(true); this.intervalDelegate = new IntervalXYDelegate(this); addChangeListener(this.intervalDelegate); }
/** * Sets the interval position factor. Must be between 0.0 and 1.0 inclusive. * If the factor is 0.5, the gap is in the middle of the x values. If it * is lesser than 0.5, the gap is farther to the left and if greater than * 0.5 it gets farther to the right. * * @param d the new interval position factor. */ public void setIntervalPositionFactor(double d) { this.intervalDelegate.setIntervalPositionFactor(d); fireDatasetChanged(); }
/** * Adds a data item to this dataset and sends a {@link DatasetChangeEvent} * to all registered listeners. * * @param x the x value. * @param y the y value. * @param seriesName the name of the series to add the data item. */ public void add(double x, double y, String seriesName) { add(new Double(x), new Double(y), seriesName, true); }
/** * Returns the starting Y value for the specified series and item. * * @param series the series index (zero-based). * @param item the item index (zero-based). * * @return The starting Y value. */ public Number getStartY(int series, int item) { return getY(series, item); }
/** * Returns the number of items in the specified series. * Returns the same as {@link CategoryTableXYDataset#getItemCount()}. * * @param series the series index (zero-based). * * @return The item count. */ public int getItemCount(int series) { return getItemCount(); // all series have the same number of items in // this dataset }
/** * Clears all data from the dataset and sends a {@link DatasetChangeEvent} * to all registered listeners. * * @since 1.0.14 */ public void clear() { this.values.clear(); fireDatasetChanged(); }
/** * Adds a data item to this dataset and sends a {@link DatasetChangeEvent} * to all registered listeners. * * @param x the x value. * @param y the y value. * @param seriesName the name of the series to add the data item. */ public void add(double x, double y, String seriesName) { add(new Double(x), new Double(y), seriesName, true); }
/** * Returns the starting Y value for the specified series and item. * * @param series the series index (zero-based). * @param item the item index (zero-based). * * @return The starting Y value. */ @Override public Number getStartY(int series, int item) { return getY(series, item); }
/** * Sets the interval width to a fixed value, and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @param d the new interval width (must be > 0). */ public void setIntervalWidth(double d) { this.intervalDelegate.setFixedIntervalWidth(d); fireDatasetChanged(); }
/** * Returns the ending Y value for the specified series and item. * * @param series the series index (zero-based). * @param item the item index (zero-based). * * @return The ending Y value. */ @Override public Number getEndY(int series, int item) { return getY(series, item); }