/** * Hook an SWT listener on the canvas where the chart is drawn. * The purpose of this method is to allow some degree of customization. * * @param listener The SWT listener to attach to the canvas. */ public void addSWTListener(EventListener listener) { if (listener instanceof ControlListener) { this.canvas.addControlListener((ControlListener) listener); } else if (listener instanceof DisposeListener) { this.canvas.addDisposeListener((DisposeListener) listener); // } // else if (listener instanceof DragDetectListener) { // this.canvas.addDragDetectListener((DragDetectListener) listener); } else if (listener instanceof FocusListener) { this.canvas.addFocusListener((FocusListener) listener); } else if (listener instanceof HelpListener) { this.canvas.addHelpListener((HelpListener) listener); } else if (listener instanceof KeyListener) { this.canvas.addKeyListener((KeyListener) listener); // } // else if (listener instanceof MenuDetectListener) { // this.canvas.addMenuDetectListener((MenuDetectListener) listener); } else if (listener instanceof MouseListener) { this.canvas.addMouseListener((MouseListener) listener); } else if (listener instanceof MouseMoveListener) { this.canvas.addMouseMoveListener((MouseMoveListener) listener); } else if (listener instanceof MouseTrackListener) { this.canvas.addMouseTrackListener((MouseTrackListener) listener); // } else if (listener instanceof MouseWheelListener) { // this.canvas.addMouseWheelListener((MouseWheelListener) listener); } else if (listener instanceof PaintListener) { this.canvas.addPaintListener((PaintListener) listener); } else if (listener instanceof TraverseListener) { this.canvas.addTraverseListener((TraverseListener) listener); } }
/** * Hook an SWT listener on the canvas where the chart is drawn. * The purpose of this method is to allow some degree of customization. * * @param listener The SWT listener to attach to the canvas. */ public void addSWTListener(EventListener listener) { if (listener instanceof ControlListener) { this.canvas.addControlListener((ControlListener) listener); } else if (listener instanceof DisposeListener) { this.canvas.addDisposeListener((DisposeListener) listener); } else if (listener instanceof DragDetectListener) { this.canvas.addDragDetectListener((DragDetectListener) listener); } else if (listener instanceof FocusListener) { this.canvas.addFocusListener((FocusListener) listener); } else if (listener instanceof HelpListener) { this.canvas.addHelpListener((HelpListener) listener); } else if (listener instanceof KeyListener) { this.canvas.addKeyListener((KeyListener) listener); } else if (listener instanceof MenuDetectListener) { this.canvas.addMenuDetectListener((MenuDetectListener) listener); } else if (listener instanceof MouseListener) { this.canvas.addMouseListener((MouseListener) listener); } else if (listener instanceof MouseMoveListener) { this.canvas.addMouseMoveListener((MouseMoveListener) listener); } else if (listener instanceof MouseTrackListener) { this.canvas.addMouseTrackListener((MouseTrackListener) listener); } else if (listener instanceof MouseWheelListener) { this.canvas.addMouseWheelListener((MouseWheelListener) listener); } else if (listener instanceof PaintListener) { this.canvas.addPaintListener((PaintListener) listener); } else if (listener instanceof TraverseListener) { this.canvas.addTraverseListener((TraverseListener) listener); } }
public void addMouseTrackListener(MouseTrackListener listener){ this.text.addMouseTrackListener(listener); }
public void removeMouseTrackListener(MouseTrackListener listener){ this.text.removeMouseTrackListener(listener); }
/** * Adds the listener to the collection of listeners who will be notified * when the mouse passes or hovers over controls, by sending it one of the * messages defined in the <code>MouseTrackListener</code> interface. * * @param listener * the listener which should be notified * * @exception IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been * disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> * * @see MouseTrackListener * @see #removeMouseTrackListener */ public void addMouseTrackListener(MouseTrackListener listener) { checkWidget(); if (listener == null) error(SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener(listener); addListener(SWT.MouseEnter, typedListener); addListener(SWT.MouseExit, typedListener); addListener(SWT.MouseHover, typedListener); }
/** * Removes the listener from the collection of listeners who will be * notified when the mouse passes or hovers over controls. * * @param listener * the listener which should no longer be notified * * @exception IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been * disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> * * @see MouseTrackListener * @see #addMouseTrackListener */ public void removeMouseTrackListener(MouseTrackListener listener) { checkWidget(); if (listener == null) error(SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook(SWT.MouseEnter, listener); eventTable.unhook(SWT.MouseExit, listener); eventTable.unhook(SWT.MouseHover, listener); }
public void addMouseTrackListener(MouseTrackListener listener) { tree.addMouseTrackListener(listener); }
public void removeMouseTrackListener(MouseTrackListener listener) { tree.removeMouseTrackListener(listener); }