org.eclipse.swt.events.MouseMoveListener Java Examples

The following examples show how to use org.eclipse.swt.events.MouseMoveListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Model.java    From Rel with Apache License 2.0 6 votes vote down vote up
/** Ctor */
public Model(Rev rev, String modelName, Composite parent) {
	super(parent, SWT.NONE);

	this.rev = rev;
	this.modelName = modelName;

	addMouseMoveListener(new MouseMoveListener() {
		@Override
		public void mouseMove(MouseEvent e) {
			lastMouseX = e.x;
			lastMouseY = e.y;
			enablePopupMenu();
		}
	});
}
 
Example #2
Source File: GeoMap.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Adds listener to appropriate listener lists depending on the listener
 * interfaces that are implemented.
 * 
 * @param listener
 *            the listener
 */
public void addMouseHandler(EventListener listener) {
	if (listener instanceof MouseListener) {
		addMouseListener((MouseListener) listener);
	}
	if (listener instanceof MouseMoveListener) {
		addMouseMoveListener((MouseMoveListener) listener);
	}
	if (listener instanceof MouseTrackListener) {
		addMouseTrackListener((MouseTrackListener) listener);
	}
	if (listener instanceof MouseWheelListener) {
		addMouseWheelListener((MouseWheelListener) listener);
	}
	if (listener instanceof PaintListener) {
		addPaintListener((PaintListener) listener);
	}
}
 
Example #3
Source File: GeoMap.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Removes listener from appropriate listener lists depending on the listener
 * interfaces that are implemented.
 * 
 * @param listener
 *            the listener
 */
public void removeMouseHandler(EventListener listener) {
	if (listener instanceof MouseListener) {
		removeMouseListener((MouseListener) listener);
	}
	if (listener instanceof MouseMoveListener) {
		removeMouseMoveListener((MouseMoveListener) listener);
	}
	if (listener instanceof MouseTrackListener) {
		removeMouseTrackListener((MouseTrackListener) listener);
	}
	if (listener instanceof MouseWheelListener) {
		removeMouseWheelListener((MouseWheelListener) listener);
	}
	if (listener instanceof PaintListener) {
		removePaintListener((PaintListener) listener);
	}
}
 
Example #4
Source File: BaseMouseProvider.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * 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);
    }
}
 
Example #5
Source File: ChartAreaRenderer.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void addMouseMoveListener ( final ChartMouseMoveListener listener )
{
    removeMouseMoveListener ( listener );
    final MouseMoveListener proxyListener = new MouseMoveListener () {

        @Override
        public void mouseMove ( final MouseEvent e )
        {
            listener.onMouseMove ( convertState ( e ) );
        }

    };
    final MouseMoveListener oldListener = this.mouseMoveListenerMap.put ( listener, proxyListener );
    if ( oldListener != null )
    {
        this.control.removeMouseMoveListener ( oldListener );
    }
    this.control.addMouseMoveListener ( proxyListener );
}
 
Example #6
Source File: KeyStateManager.java    From ldparteditor with MIT License 5 votes vote down vote up
public static void addTooltipText(final NButton btn, final String text, final Task t) {
    btn.addMouseMoveListener(new MouseMoveListener() {
        @Override
        public void mouseMove(MouseEvent e) {
            btn.setToolTipText(text + " (" + taskKeyMap.get(t) +")"); //$NON-NLS-1$ //$NON-NLS-2$
        }
    });
}
 
Example #7
Source File: TmfBaseProvider.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * 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);
    }


}
 
Example #8
Source File: ScrollView.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Remove the local Listener and add the new listener.
 *
 * @param nlistener the new listener
 */
public void replaceMouseMoveListener(MouseMoveListener nlistener) {
    if (fLocalMouseMoveListener != null) {
        removeMouseMoveListener(fLocalMouseMoveListener);
        fLocalMouseMoveListener = null;
    }
    fViewControl.addMouseMoveListener(nlistener);
}
 
Example #9
Source File: TmfBaseProvider.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * 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);
        }
    }
}
 
Example #10
Source File: BaseMouseProvider.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * 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);
        }
    }
}
 
Example #11
Source File: KeyStateManager.java    From ldparteditor with MIT License 5 votes vote down vote up
public static void addTooltipText(final NButton btn, final String text, final TextTask t) {
    btn.addMouseMoveListener(new MouseMoveListener() {
        @Override
        public void mouseMove(MouseEvent e) {
            btn.setToolTipText(text + " (" + textTaskKeyMap.get(t) +")"); //$NON-NLS-1$ //$NON-NLS-2$
        }
    });
}
 
Example #12
Source File: ChartAreaRenderer.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void removeMouseMoveListener ( final ChartMouseMoveListener listener )
{
    final MouseMoveListener proxyListener = this.mouseMoveListenerMap.remove ( listener );
    if ( proxyListener != null )
    {
        if ( !this.control.isDisposed () )
        {
            this.control.removeMouseMoveListener ( proxyListener );
        }
    }
}
 
Example #13
Source File: SWTUtil.java    From arx with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a generic tooltip for the table
 * @param table
 */
public static void createGenericTooltip(final Table table) {
    table.addMouseMoveListener(new MouseMoveListener() {
        private TableItem current = null;

        @Override
        public void mouseMove(MouseEvent arg0) {
            TableItem item = table.getItem(new Point(arg0.x, arg0.y));
            if (item != null && item != current) {
                current = item;
                StringBuilder builder = new StringBuilder();
                builder.append("("); //$NON-NLS-1$
                int columns = item.getParent().getColumnCount();
                for (int i = 0; i < columns; i++) {
                    String value = item.getText(i);
                    if (value != null && !value.equals("")) { //$NON-NLS-1$
                        builder.append(value);
                        if (i < columns - 1) {
                            builder.append(", "); //$NON-NLS-1$
                        }
                    } else if (item.getData(String.valueOf(i)) != null && 
                               item.getData(String.valueOf(i)) instanceof Double) {
                        builder.append(getPrettyString(((Double) item.getData(String.valueOf(i))).doubleValue() * 100d) + "%"); //$NON-NLS-1$
                        if (i < columns - 1) {
                            builder.append(", "); //$NON-NLS-1$
                        }
                    }
                }
                builder.append(")"); //$NON-NLS-1$
                table.setToolTipText(builder.toString());
            }
        }
    });
}
 
Example #14
Source File: TagCloud.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void removeMouseMoveListener(MouseMoveListener listener) {
	checkWidget();
	mouseMoveListeners.remove(listener);
}
 
Example #15
Source File: ChartComposite.java    From ECG-Viewer with GNU General Public License v2.0 4 votes vote down vote up
/**
     * 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);
        }
    }
 
Example #16
Source File: ChartComposite.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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);
    }
}
 
Example #17
Source File: ChartComposite.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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(SWTEventListener 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);
    } 
}
 
Example #18
Source File: ChartComposite.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
     * 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);
        }
    }
 
Example #19
Source File: ChartComposite.java    From SIMVA-SoS with Apache License 2.0 4 votes vote down vote up
/**
     * 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);
        }
    }
 
Example #20
Source File: ChartComposite.java    From openstock with GNU General Public License v3.0 4 votes vote down vote up
/**
     * 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);
        }
    }
 
Example #21
Source File: TagCloud.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void addMouseMoveListener(MouseMoveListener listener) {
	checkWidget();
	Assert.isLegal(listener != null);
	mouseMoveListeners.add(listener);
}
 
Example #22
Source File: ChartComposite.java    From ccu-historian with GNU General Public License v3.0 4 votes vote down vote up
/**
     * 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);
        }
    }
 
Example #23
Source File: CalendarCombo.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
public void removeMouseMoveListener(MouseMoveListener listener) {
    mComboControl.removeMouseMoveListener(listener);
}
 
Example #24
Source File: CalendarCombo.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
public void addMouseMoveListener(MouseMoveListener listener) {
    mComboControl.addMouseMoveListener(listener);
}
 
Example #25
Source File: CompositeTable.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
void fireMouseMove(MouseEvent e) {
    for (Iterator i = mouseMoveListeners.iterator(); i.hasNext();) {
        MouseMoveListener l = (MouseMoveListener) i.next();
        l.mouseMove(e);
    }
}
 
Example #26
Source File: CompositeTable.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
public void removeMouseMoveListener(MouseMoveListener listener) {
    mouseMoveListeners.remove(listener);
}
 
Example #27
Source File: CompositeTable.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
public void addMouseMoveListener(MouseMoveListener listener) {
    mouseMoveListeners.add(listener);
}
 
Example #28
Source File: PasswordRevealer.java    From nebula with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * Removes the listener from the collection of listeners who will
 * be notified when the mouse moves.
 *
 * @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 MouseMoveListener
 * @see #addMouseMoveListener
 */
@Override
public void removeMouseMoveListener(final MouseMoveListener listener) {
	super.removeMouseMoveListener(listener);
	comp.removeMouseMoveListener(listener);
	passwordField.removeMouseMoveListener(listener);
}
 
Example #29
Source File: PasswordRevealer.java    From nebula with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * Adds the listener to the collection of listeners who will
 * be notified when the mouse moves, by sending it one of the
 * messages defined in the <code>MouseMoveListener</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 MouseMoveListener
 * @see #removeMouseMoveListener
 */
@Override
public void addMouseMoveListener(final MouseMoveListener listener) {
	super.addMouseMoveListener(listener);
	comp.addMouseMoveListener(listener);
	passwordField.addMouseMoveListener(listener);
}