/** * Returns the end value for the interval for a given series and category. * * @param series the series (zero-based index). * @param category the category (zero-based index). * * @return The end value (possibly <code>null</code>). */ public Number getEndValue(int series, int category) { return this.underlying.getEndValue(series, category + this.firstCategoryIndex); }
/** * Returns the percent complete for a given item. * * @param series the row index (zero-based). * @param category the column index (zero-based). * * @return The percent complete. */ public Number getPercentComplete(int series, int category) { return this.underlying.getPercentComplete(series, category + this.firstCategoryIndex); }
/** * Returns the start value of a sub-interval for a given item. * * @param row the row index (zero-based). * @param column the column index (zero-based). * @param subinterval the sub-interval index (zero-based). * * @return The start value (possibly <code>null</code>). * * @see #getEndValue(int, int, int) */ public Number getStartValue(int row, int column, int subinterval) { return this.underlying.getStartValue(row, column + this.firstCategoryIndex, subinterval); }
int column) { int count = dataset.getSubIntervalCount(row, column); if (count == 0) { drawTask(g2, state, dataArea, plot, domainAxis, rangeAxis, Number value0 = dataset.getStartValue(row, column, subinterval); if (value0 == null) { return; Number value1 = dataset.getEndValue(row, column, subinterval); if (value1 == null) { return; Number percent = dataset.getPercentComplete(row, column, subinterval); double start = getStartPercent(); Comparable columnKey = dataset.getColumnKey(column); Comparable rowKey = dataset.getRowKey(row); double xx = domainAxis.getCategorySeriesMiddle(columnKey, rowKey, dataset, getItemMargin(), dataArea, plot.getDomainAxisEdge()); updateCrosshairValues(state.getCrosshairState(), dataset.getRowKey(row), dataset.getColumnKey(column), value1.doubleValue(), datasetIndex, xx, translatedValue1, orientation);
/** * decode CategoryItemEntity into key-value pair of Area's componentScope. * @param area the Area where the final attribute is set * @param info the CategoryItemEntity to be decoded. */ private void decodeCategoryInfo(Area area, CategoryItemEntity info) { if (info == null) { return; } CategoryDataset dataset = info.getDataset(); Comparable category = info.getColumnKey(); Comparable series = info.getRowKey(); area.setAttribute("series", series); area.setAttribute("category", category); if (dataset instanceof GanttCategoryDataset) { final GanttCategoryDataset gd = (GanttCategoryDataset) dataset; area.setAttribute("start", gd.getStartValue(series, category)); area.setAttribute("end", gd.getEndValue(series, category)); area.setAttribute("percent", gd.getPercentComplete(series, category)); } else { area.setAttribute("value", dataset.getValue(series, category)); } }
/** * Returns the index of the last column for this dataset, or -1. * * @return The index. */ private int lastCategoryIndex() { if (this.maximumCategoryCount == 0) { return -1; } return Math.min(this.firstCategoryIndex + this.maximumCategoryCount, this.underlying.getColumnCount()) - 1; }
/** * Returns the column key for a given index. * * @param column the column index (zero-based). * * @return The column key. * * @throws IndexOutOfBoundsException if {@code row} is out of bounds. */ @Override public Comparable getColumnKey(int column) { return this.underlying.getColumnKey(column + this.firstCategoryIndex); }
/** * Returns the row keys. * * @return The keys. */ @Override public List getRowKeys() { return this.underlying.getRowKeys(); }
/** * Returns the row index for a given key. * * @param key the row key. * * @return The row index, or {@code -1} if the key is unrecognised. */ @Override public int getRowIndex(Comparable key) { return this.underlying.getRowIndex(key); }
/** * Returns the number of rows in the table. * * @return The row count. */ @Override public int getRowCount() { return this.underlying.getRowCount(); }
/** * Returns the row key for a given index. * * @param row the row index (zero-based). * * @return The row key. * * @throws IndexOutOfBoundsException if <code>row</code> is out of bounds. */ public Comparable getRowKey(int row) { return this.underlying.getRowKey(row); }
/** * Returns the index for the specified column key. * * @param key the key. * * @return The column index, or -1 if the key is not recognised. */ public int getColumnIndex(Comparable key) { int index = this.underlying.getColumnIndex(key); if (index >= this.firstCategoryIndex && index <= lastCategoryIndex()) { return index - this.firstCategoryIndex; } return -1; // we didn't find the key }
int column) { int count = dataset.getSubIntervalCount(row, column); if (count == 0) { drawTask(g2, state, dataArea, plot, domainAxis, rangeAxis, Number value0 = dataset.getStartValue(row, column, subinterval); if (value0 == null) { return; Number value1 = dataset.getEndValue(row, column, subinterval); if (value1 == null) { return; Number percent = dataset.getPercentComplete(row, column, subinterval); double start = getStartPercent(); Comparable columnKey = dataset.getColumnKey(column); Comparable rowKey = dataset.getRowKey(row); double xx = domainAxis.getCategorySeriesMiddle(columnKey, rowKey, dataset, getItemMargin(), dataArea, plot.getDomainAxisEdge()); updateCrosshairValues(state.getCrosshairState(), dataset.getRowKey(row), dataset.getColumnKey(column), value1.doubleValue(), datasetIndex, xx, translatedValue1, orientation);
/** * Returns the index of the last column for this dataset, or -1. * * @return The index. */ private int lastCategoryIndex() { if (this.maximumCategoryCount == 0) { return -1; } return Math.min(this.firstCategoryIndex + this.maximumCategoryCount, this.underlying.getColumnCount()) - 1; }
/** * Returns the column key for a given index. * * @param column the column index (zero-based). * * @return The column key. * * @throws IndexOutOfBoundsException if <code>row</code> is out of bounds. */ public Comparable getColumnKey(int column) { return this.underlying.getColumnKey(column + this.firstCategoryIndex); }
/** * Returns the row keys. * * @return The keys. */ public List getRowKeys() { return this.underlying.getRowKeys(); }
/** * Returns the row index for a given key. * * @param key the row key. * * @return The row index, or <code>-1</code> if the key is unrecognised. */ public int getRowIndex(Comparable key) { return this.underlying.getRowIndex(key); }
/** * Returns the number of rows in the table. * * @return The row count. */ public int getRowCount() { return this.underlying.getRowCount(); }
/** * Returns the row key for a given index. * * @param row the row index (zero-based). * * @return The row key. * * @throws IndexOutOfBoundsException if {@code row} is out of bounds. */ @Override public Comparable getRowKey(int row) { return this.underlying.getRowKey(row); }
/** * Returns the index for the specified column key. * * @param key the key. * * @return The column index, or -1 if the key is not recognised. */ @Override public int getColumnIndex(Comparable key) { int index = this.underlying.getColumnIndex(key); if (index >= this.firstCategoryIndex && index <= lastCategoryIndex()) { return index - this.firstCategoryIndex; } return -1; // we didn't find the key }