Search in sources :

Example 1 with TmfAbstractToolTipHandler

use of org.eclipse.tracecompass.tmf.ui.viewers.TmfAbstractToolTipHandler in project tracecompass by tracecompass.

the class TmfBaseProvider method register.

/**
 * Method to register the provider to chart viewer.
 */
protected void register() {
    IPlotArea plotArea = getChart().getPlotArea();
    Control control = plotArea.getControl();
    if (this instanceof MouseListener) {
        control.addMouseListener((MouseListener) this);
    }
    if (this instanceof MouseMoveListener) {
        control.addMouseMoveListener((MouseMoveListener) this);
    }
    if (this instanceof MouseWheelListener) {
        control.addMouseWheelListener((MouseWheelListener) this);
    }
    if (this instanceof MouseTrackListener) {
        control.addMouseTrackListener((MouseTrackListener) this);
    }
    if (this instanceof ICustomPaintListener) {
        plotArea.addCustomPaintListener((ICustomPaintListener) this);
    } else if (this instanceof PaintListener) {
        control.addPaintListener((PaintListener) this);
    }
    TmfAbstractToolTipHandler tooltipHandler = getTooltipHandler();
    if (tooltipHandler != null) {
        tooltipHandler.activateHoverHelp(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)

Example 2 with TmfAbstractToolTipHandler

use of org.eclipse.tracecompass.tmf.ui.viewers.TmfAbstractToolTipHandler in project tracecompass by tracecompass.

the class BaseMouseProvider method register.

/**
 * Method to register the provider to chart viewer.
 */
protected void register() {
    IPlotArea plotArea = getChart().getPlotArea();
    Control control = plotArea.getControl();
    if (this instanceof MouseListener) {
        control.addMouseListener((MouseListener) this);
    }
    if (this instanceof MouseMoveListener) {
        control.addMouseMoveListener((MouseMoveListener) this);
    }
    if (this instanceof MouseWheelListener) {
        control.addMouseWheelListener((MouseWheelListener) this);
    }
    if (this instanceof MouseTrackListener) {
        control.addMouseTrackListener((MouseTrackListener) this);
    }
    if (this instanceof ICustomPaintListener) {
        plotArea.addCustomPaintListener((ICustomPaintListener) this);
    } else if (this instanceof PaintListener) {
        control.addPaintListener((PaintListener) this);
    }
    TmfAbstractToolTipHandler tooltipHandler = getTooltipHandler();
    if (tooltipHandler != null) {
        tooltipHandler.activateHoverHelp(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)

Example 3 with TmfAbstractToolTipHandler

use of org.eclipse.tracecompass.tmf.ui.viewers.TmfAbstractToolTipHandler in project tracecompass by tracecompass.

the class BaseMouseProvider 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)

Example 4 with TmfAbstractToolTipHandler

use of org.eclipse.tracecompass.tmf.ui.viewers.TmfAbstractToolTipHandler 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

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 ICustomPaintListener (org.eclipse.swtchart.ICustomPaintListener)4 IPlotArea (org.eclipse.swtchart.IPlotArea)4 TmfAbstractToolTipHandler (org.eclipse.tracecompass.tmf.ui.viewers.TmfAbstractToolTipHandler)4