Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1096 hidden annotations with a SlidingGanttCategoryDataset

open
nobody
None
5
2012-11-27
2012-08-30
David DIDIER
No

considering a SlidingGanttCategoryDataset displaying Td tasks from a total of Tt tasks (Td < Tt)
When I add a CategoryTextAnnotation to a task T which is not displayed (T > Td)
Then I got an IllegalArgumentException

indeed in CategoryTextAnnotation.draw, there is:
int catIndex = dataset.getColumnIndex(this.category);
which is delegated to the SlidingGanttCategoryDataset and lastCategoryIndex() returns Td so getColumnIndex returns -1:
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
}
and catIndex = -1

Discussion