I want to be able to hit a key (after identifying the dataset/series/item) from which the key
will make invisible/visible the dataset/series/item (dependent upon the key).
I found some code that extends the ChartComposite class but I'm having trouble with the SWT
package (version 14) that should at least indicate which key has been pressed but I'm having issues
with the package. First the code below
Code: Select all
import java.awt.event.KeyListener;
import org.jfree.chart.JFreeChart;
import org.jfree.experimental.chart.swt.ChartComposite;
public class MyChartComposite extends ChartComposite implements KeyListener
{
public MyChartComposite(Composite comp, int style, JFreeChart chart,
boolean useBuffer){
super(comp, style, chart, useBuffer);
addSWTListener(this);
}
@Override
public void keyPressed(org.eclipse.swt.events.KeyEvent e) {
System.out.print("Key released: " + e.character);
}
@Override
public void keyReleased(org.eclipse.swt.events.KeyEvent e) {
System.out.print("Key pressed: " + e.character);
}
The type org.eclipse.swt.events.PaintListener cannot be resolved. It is indirectly referenced from required .class files.
I have the jfreechart-1.0.14-swt.jar included on the Java Build Path (Eclipse Luna).