I did this by changing MinMaxCategoryRenderer as follows:
Code: Select all
class DFBetaCategoryRenderer extends MinMaxCategoryRenderer
{
@Override
public void drawItem( Graphics2D g2, CategoryItemRendererState state,
Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
ValueAxis rangeAxis, CategoryDataset dataset, int row, int column,
int pass )
{
//
// See if the value is positive or negative for the row that contains the
// values
Double value = (Double) dataset.getValue( row, column );
String name = (String) dataset.getRowKey( row );
if ( value != null && "First".equals( name ) )
{
System.out.println( "VALUE: " + value );
System.out.println( "NAME: " + name );
if ( value < 0.0 )
{
setMinIcon( defaultMinIcon );
setMaxIcon( emptyIcon );
}
else if ( value > 0.0 )
{
setMinIcon( emptyIcon );
setMaxIcon( defaultMaxIcon );
}
}
super.drawItem( g2, state, dataArea, plot, domainAxis, rangeAxis,
dataset, row, column, pass );
}
}
I would just
Code: Select all
minIcon = defaultMinIcon;
maxIcon = emptyIcon
I suppose I can copy the entire renderer class to make the one change- the drawItem method is full of private variables (this.objectIcon, this.lastCategory, this.min, this.max, this.groupPaint, this.groupStroke, this.plotLines) which has confounded my naive attempt to Override the drawItem() method by copying pretty much the whole method. If I could have done that, I would have simply checked the dataset value and called paintIcon only when appropriate.
Does anyone have a idea how to work around either the fireChangeEvent() or all the private variables?