private Range getRange(final XYSeriesCollection seriesCol) { if (this.boundingBox == null) return seriesCol.getRangeBounds(false); else return new Range(boundingBox.minY, boundingBox.maxY); }
private Range getDomainRange(final XYSeriesCollection seriesCol) { if (this.boundingBox == null) return seriesCol.getDomainBounds(true); else return new Range(boundingBox.minX, boundingBox.maxX); }
/** * Creates a new dataset. */ public DefaultMultiValueCategoryDataset() { this.data = new KeyedObjects2D(); this.minimumRangeValue = null; this.maximumRangeValue = null; this.rangeBounds = new Range(0.0, 0.0); }
/** * Returns the x-range for the annotation. * * @return The range. * * @since 1.0.13 */ @Override public Range getXRange() { return new Range(this.x, this.x + this.w); }
/** * Returns the upper bound for the axis range. * * @return The upper bound. * * @see #setUpperBound(double) */ public double getUpperBound() { return this.range.getUpperBound(); }
/** * Updates the value of an item in the series and sends a * {@link SeriesChangeEvent} to all registered listeners. * * @param index the item (zero based index). * @param y the new value ({@code null} permitted). */ protected void updateByIndex(int index, Object y) { ComparableObjectItem item = getDataItem(index); item.setObject(y); fireSeriesChanged(); }
/** * Removes an entire column from the table. * * @param columnIndex the column index. * * @see #removeRow(int) */ public void removeColumn(int columnIndex) { Comparable columnKey = getColumnKey(columnIndex); removeColumn(columnKey); }
/** * Adds an item to the temporary storage for the series. * * @param key the key. * @param value the value. */ public void addItem(Comparable key, Number value) { this.values.addValue(key, value); }
/** * Returns the data item at the specified index. * * @param index the item index. * * @return The data item. */ @Override public ComparableObjectItem getDataItem(int index) { return super.getDataItem(index); }
/** * Adds a data item to the series and, if requested, sends a * {@link SeriesChangeEvent} to all registered listeners. * * @param item the data item ({@code null} not permitted). * @param notify notify listeners? * * @since 1.0.18 */ public void add(XIntervalDataItem item, boolean notify) { super.add(item, notify); }
/** * Returns the number of columns in the table. * * @return The column count. * * @see #getRowCount() */ @Override public int getColumnCount() { return this.data.getColumnCount(); }
/** * Returns the column keys. * * @return The keys. * * @see #getColumnKey(int) */ @Override public List getColumnKeys() { return this.data.getColumnKeys(); }
/** * Returns the number of rows in the table. * * @return The row count. * * @see #getColumnCount() */ @Override public int getRowCount() { return this.data.getRowCount(); }
/** * Creates a new dataset with the specified initial value. * * @param key the key. * @param value the value ({@code null} permitted). */ public DefaultKeyedValueDataset(Comparable key, Number value) { this(new DefaultKeyedValue(key, value)); }
/** * Returns the key for a series. * * @param series the series (zero-based index). * * @return The key for the series. */ @Override public Comparable getSeriesKey(int series) { return this.values.getColumnKey(series); }
/** * Returns the row keys. * * @return The keys. */ @Override public List getRowKeys() { return this.data.getRowKeys(); }
/** * Creates a new dataset. */ public DefaultMultiValueCategoryDataset() { this.data = new KeyedObjects2D(); this.minimumRangeValue = null; this.maximumRangeValue = null; this.rangeBounds = new Range(0.0, 0.0); }
private XYPlot createPlot(final XYSeriesCollection problem, XYSeriesCollection shipments, XYSeriesCollection solution) { XYPlot plot = new XYPlot(); plot.setBackgroundPaint(Color.LIGHT_GRAY); plot.setRangeGridlinePaint(Color.LIGHT_GRAY); plot.setDomainGridlinePaint(Color.LIGHT_GRAY); XYLineAndShapeRenderer problemRenderer = getProblemRenderer(problem); plot.setDataset(0, problem); plot.setRenderer(0, problemRenderer); XYItemRenderer shipmentsRenderer = getShipmentRenderer(shipments); plot.setDataset(1, shipments); plot.setRenderer(1, shipmentsRenderer); if (solution != null) { XYItemRenderer solutionRenderer = getRouteRenderer(solution); plot.setDataset(2, solution); plot.setRenderer(2, solutionRenderer); } NumberAxis xAxis = new NumberAxis(); NumberAxis yAxis = new NumberAxis(); if (boundingBox == null) { xAxis.setRangeWithMargins(getDomainRange(problem)); yAxis.setRangeWithMargins(getRange(problem)); } else { xAxis.setRangeWithMargins(new Range(boundingBox.minX, boundingBox.maxX)); yAxis.setRangeWithMargins(new Range(boundingBox.minY, boundingBox.maxY)); } plot.setDomainAxis(xAxis); plot.setRangeAxis(yAxis); return plot; }
/** * Updates the value of an item in the series and sends a * {@link SeriesChangeEvent} to all registered listeners. * * @param index the item (zero based index). * @param y the new value (<code>null</code> permitted). */ protected void updateByIndex(int index, Object y) { ComparableObjectItem item = getDataItem(index); item.setObject(y); fireSeriesChanged(); }
/** * Returns the data item at the specified index. * * @param index the item index. * * @return The data item. */ @Override public ComparableObjectItem getDataItem(int index) { return super.getDataItem(index); }