Example usage for org.jfree.chart ContextAwareChartPanel setReshowDelay

List of usage examples for org.jfree.chart ContextAwareChartPanel setReshowDelay

Introduction

In this page you can find the example usage for org.jfree.chart ContextAwareChartPanel setReshowDelay.

Prototype

public void setReshowDelay(int delay) 

Source Link

Document

Specifies the amount of time before the user has to wait initialDelay milliseconds before a tooltip will be shown.

Usage

From source file:net.sf.maltcms.chromaui.chromatogram1Dviewer.ui.panel.Chromatogram1DViewPanel.java

/**
 * Creates new form Chromatogram1DViewPanel
 *///from ww w.j a v  a  2 s  .  co m
public Chromatogram1DViewPanel(InstanceContent topComponentInstanceContent, Lookup tcLookup,
        ADataset1D<IChromatogram1D, IScan> ds) {
    initComponents();
    this.content = topComponentInstanceContent;
    this.lookup = tcLookup;
    chart = new JFreeChart(new XYPlot());
    ContextAwareChartPanel chartPanel = new ContextAwareChartPanel(chart, true, true, true, true, true);
    Cursor crosshairCursor = new Cursor(Cursor.CROSSHAIR_CURSOR);
    chartPanel.setCursor(crosshairCursor);
    chartPanel.setInitialDelay(100);
    chartPanel.setDismissDelay(30000);
    chartPanel.setReshowDelay(0);
    chartPanel.setFocusable(true);
    chartPanel.setMouseWheelEnabled(true);
    chartPanel.setPopupMenuActionProvider(new ActionProvider());
    addKeyListener(this);
    this.chartPanel = chartPanel;
    add(chartPanel, BorderLayout.CENTER);
    content.add(chartPanel);
}

From source file:net.sf.maltcms.chromaui.chromatogram2Dviewer.ui.Chromatogram2DViewTopComponent.java

private Chromatogram2DViewerPanel createPanel(IChromatogramDescriptor chromatogram,
        ADataset2D<IChromatogram2D, IScan2D> ds, List<ChartOverlay> overlays) {
    IPaintScaleProvider ips = Lookup.getDefault().lookup(IPaintScaleProvider.class);
    ips.setMin(ds.getMinZ());//  w ww  .  j a  va2  s . c o  m
    ips.setMax(ds.getMaxZ());
    PaintScale ps = ips.getPaintScales().get(0);
    XYPlot p = createPlot(chromatogram, ds, ps);
    p.setDomainGridlinesVisible(false);
    p.setRangeGridlinesVisible(false);
    JFreeChart jfc = new JFreeChart(p);
    final ContextAwareChartPanel cp = new ContextAwareChartPanel(jfc, true);
    cp.setZoomFillPaint(new Color(192, 192, 192, 96));
    cp.setZoomOutlinePaint(new Color(220, 220, 220, 192));
    cp.setFillZoomRectangle(false);
    cp.getChart().getLegend().setVisible(true);
    Chromatogram2DViewerPanel panel = new Chromatogram2DViewerPanel(content, getLookup(), ds, ps);
    if (panel.getBackgroundColor() == null) {
        panel.setBackgroundColor((Color) ps.getPaint(ps.getLowerBound()));
    }
    cp.addKeyListener(panel);
    cp.setFocusable(true);
    cp.setDisplayToolTips(true);
    cp.setDismissDelay(3000);
    cp.setInitialDelay(0);
    cp.setReshowDelay(0);
    cp.setVisible(true);
    cp.setRefreshBuffer(true);
    cp.setMouseWheelEnabled(true);
    if (project != null) {
        for (Peak1DContainer peaks : project.getPeaks(chromatogram)) {
            Peak2DOverlay overlay = new Peak2DOverlay(chromatogram, peaks.getName(), peaks.getDisplayName(),
                    peaks.getShortDescription(), true, peaks);
            cp.addOverlay(overlay);
            content.add(overlay);
            overlays.add(overlay);
        }
    }

    panel.setChartPanel(cp);
    panel.setPlot(p);
    return panel;
}