Search in sources :

Example 6 with ICustomPaintListener

use of org.eclipse.swtchart.ICustomPaintListener in project tracecompass by tracecompass.

the class TmfBaseProvider method deregister.

/**
 * Method to deregister the provider from chart viewer.
 */
protected void deregister() {
    IPlotArea plotArea = getChart().getPlotArea();
    if (plotArea == null) {
        return;
    }
    Control control = plotArea.getControl();
    if (!control.isDisposed()) {
        if (this instanceof MouseListener) {
            control.removeMouseListener((MouseListener) this);
        }
        if (this instanceof MouseMoveListener) {
            control.removeMouseMoveListener((MouseMoveListener) this);
        }
        if (this instanceof MouseWheelListener) {
            control.removeMouseWheelListener((MouseWheelListener) this);
        }
        if (this instanceof MouseTrackListener) {
            control.removeMouseTrackListener((MouseTrackListener) this);
        }
        if (this instanceof ICustomPaintListener) {
            plotArea.removeCustomPaintListener((ICustomPaintListener) this);
        } else if (this instanceof PaintListener) {
            control.removePaintListener((PaintListener) this);
        }
        TmfAbstractToolTipHandler tooltipHandler = getTooltipHandler();
        if (tooltipHandler != null) {
            tooltipHandler.deactivateHoverHelp(control);
        }
    }
}
Also used : MouseMoveListener(org.eclipse.swt.events.MouseMoveListener) Control(org.eclipse.swt.widgets.Control) ICustomPaintListener(org.eclipse.swtchart.ICustomPaintListener) MouseListener(org.eclipse.swt.events.MouseListener) PaintListener(org.eclipse.swt.events.PaintListener) ICustomPaintListener(org.eclipse.swtchart.ICustomPaintListener) TmfAbstractToolTipHandler(org.eclipse.tracecompass.tmf.ui.viewers.TmfAbstractToolTipHandler) MouseTrackListener(org.eclipse.swt.events.MouseTrackListener) IPlotArea(org.eclipse.swtchart.IPlotArea) MouseWheelListener(org.eclipse.swt.events.MouseWheelListener)

Aggregations

ICustomPaintListener (org.eclipse.swtchart.ICustomPaintListener)6 IPlotArea (org.eclipse.swtchart.IPlotArea)5 MouseListener (org.eclipse.swt.events.MouseListener)4 MouseMoveListener (org.eclipse.swt.events.MouseMoveListener)4 MouseTrackListener (org.eclipse.swt.events.MouseTrackListener)4 MouseWheelListener (org.eclipse.swt.events.MouseWheelListener)4 PaintListener (org.eclipse.swt.events.PaintListener)4 Control (org.eclipse.swt.widgets.Control)4 TmfAbstractToolTipHandler (org.eclipse.tracecompass.tmf.ui.viewers.TmfAbstractToolTipHandler)4 ArrayList (java.util.ArrayList)1 List (java.util.List)1 PaintEvent (org.eclipse.swt.events.PaintEvent)1 Color (org.eclipse.swt.graphics.Color)1 GC (org.eclipse.swt.graphics.GC)1 Point (org.eclipse.swt.graphics.Point)1 IAxis (org.eclipse.swtchart.IAxis)1 IBarSeries (org.eclipse.swtchart.IBarSeries)1 ILineSeries (org.eclipse.swtchart.ILineSeries)1 ISeries (org.eclipse.swtchart.ISeries)1 BarSeriesIon (org.eclipse.swtchart.extensions.internal.support.BarSeriesIon)1