Java 类org.eclipse.swt.events.MouseMoveListener 实例源码

项目:neoscada    文件:ChartAreaRenderer.java   
@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 );
}
项目:swttiles    文件:Tiles.java   
/**
 * Returns the mouse motion listener
 * @return
 */
   private MouseMoveListener getMouseMoveListener() {
    return new MouseMoveListener(){
        @Override
        public void mouseMove(MouseEvent arg0) {

            // Check
            Tile<T> tile = getTileAt(arg0.x, arg0.y);
            T item = tile == null ? null : tile.item;

            // Break
            if (item == activeItem)return;

            // Set
            activeItem = item;
            redraw();
            String tooltip = activeItem != null ? tooltipDecorator.decorate(activeItem) : null;
            Tiles.this.setToolTipText(tooltip);
        }
       };
}
项目:Rel    文件:Model.java   
/** 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();
        }
    });
}
项目:NK-VirtualGlobe    文件:SWTDeviceFactory.java   
/**
 * Return the array of DeviceManagers that are available per the
 * constructor parameters. The InputDevices instantiated will be
 * initialized with SWT UI toolkit event listeners.
 *
 * @return the array of DeviceManagers. If no DeviceManagers are
 * available, an empty (size 0) array is returned.
 */
public DeviceManager[] getDeviceManagers( ) {
    List managerList = createDevices( );
    DeviceManager[] manager =
        (DeviceManager[])managerList.toArray( new DeviceManager[managerList.size( )] );
    Control control = (Control)canvas;
    for ( int i = 0; i < manager.length; i++ ) {
        InputDevice[] device = manager[i].getDevices( );
        for ( int j = 0; j < device.length; j++ ) {
            InputDevice dev = device[j];
            if ( dev instanceof MouseListener ) {
                control.addMouseListener( (MouseListener)dev );
            }
            if ( dev instanceof MouseMoveListener ) {
                control.addMouseMoveListener( (MouseMoveListener)dev );
            }
            if ( dev instanceof Listener ) {
                control.addListener( SWT.MouseWheel, (Listener)dev );
            }
            if ( dev instanceof KeyListener ) {
                control.addKeyListener( (KeyListener)dev );
            }
        }
    }
    return( manager );
}
项目:neoscada    文件:ChartAreaRenderer.java   
@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 );
        }
    }
}
项目:Hydrograph    文件:Utils.java   
private MouseMoveListener getMouseListner(final Text extSchemaPathText){
    final MouseMoveListener listner = new MouseMoveListener() {

        @Override
        public void mouseMove(MouseEvent e) {
            String paramValue = Utils.INSTANCE.getParamValue(extSchemaPathText.getText());
            finalParamPath = Utils.INSTANCE.getParamFilePath(extSchemaPathText.getText(), paramValue, extSchemaPathText);
            while(ParameterUtil.containsParameter(finalParamPath, '/')){
                paramValue = Utils.INSTANCE.getParamValue(extSchemaPathText.getToolTipText());
                finalParamPath = Utils.INSTANCE.getParamFilePath(extSchemaPathText.getToolTipText(), paramValue, extSchemaPathText);
                }
            }
        };
    return listner;
}
项目:Hydrograph    文件:Utils.java   
private MouseMoveListener getMouseListner(final StyledText extSchemaPathText) {
    final MouseMoveListener listner = new MouseMoveListener() {

        @Override
        public void mouseMove(MouseEvent e) {
            String paramValue = Utils.INSTANCE.getParamValueForRunSql(extSchemaPathText.getText());
            finalParamPath = Utils.INSTANCE.getParamFilePath(paramValue, extSchemaPathText);
        }
    };
    return listner;
}
项目:ARXPlugin    文件:SWTUtil.java   
/**
 * Creates a generic tooltip for the table
 * @param table
 */
public static void createGenericTooltip(final Table table) {
    table.addMouseMoveListener(new MouseMoveListener() {
        private TableItem current = null;


        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());
            }
        }
    });
}
项目:Black    文件:writingView.java   
public void init(){
    b.setVisible(false);
    //windowLocation.reMoveWindow(this);
    addMouseMoveListener(new MouseMoveListener() {

        @Override
        public void mouseMove(MouseEvent e) {
            // TODO Auto-generated method stub
            if(slider != null && !slider.isDisposed()){
                if(e.x >= getClientArea().width-slider.getSize().x-30){
                    slider.setVisible(true);
                }else slider.setVisible(false);
            }
        }
    });

    setImage(b.getImage());
    setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
    setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
    setStyledTextWidth(Integer.valueOf(b.appProperties.getProperty("WritingView_TextX", String.valueOf(windowLocation.returnScreenWidth()-
            windowLocation.returnScreenWidth()/4))));
    createContents();
    //setMaximized(true);
    if(b.tv != null){
        b.tv.getTextWidget().setParent(this);

        //b.tv.getTextWidget().setMargins(130, 10, 110, 0);
        b.blackTextArea.writingView();
        setStyledTextLayout(x);
    }
    addSlider();

}
项目:ldparteditor    文件:KeyStateManager.java   
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$
        }
    });
}
项目:ldparteditor    文件:KeyStateManager.java   
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$
        }
    });
}
项目:OpenSPIFe    文件:GroupScaleTimelineMarkerTooltip.java   
protected GroupScaleTimelineMarkerTooltip(Display display, int style,
        ScaleTimelineMarkerEditPart scaleTimelineMarkerEditPart) {
    super(display, style, scaleTimelineMarkerEditPart, null);
    // passing in null as the violationTracker

    // add a mouse move listener, to clear out a child violation when applicable
    mouseMoveListener = new MouseMoveListener() {
        @Override
        public void mouseMove(MouseEvent e) {
            if (solitaryScaleTimelineMarkerTooltip != null
                    && !solitaryScaleTimelineMarkerTooltip.shell.isDisposed()) {
                Composite localComposite = GroupScaleTimelineMarkerTooltip.this.getMainComposite();
                Point displayPoint = localComposite.toDisplay(e.x, e.y);
                displayPoint = solitaryScaleTimelineMarkerTooltip.shell.toControl(displayPoint);
                if (!solitaryScaleTimelineMarkerTooltip.shell.getBounds().contains(displayPoint)) {
                    // navigated off a child, onto the parent
                    solitaryScaleTimelineMarkerTooltip.shell.dispose();
                }
            }
        }
    };

    this.mainComposite.addMouseMoveListener(mouseMoveListener);
    Control[] controls = violationsComposite.getChildren();
    for(Control control : controls) {
        control.addMouseMoveListener(mouseMoveListener);
    }
}
项目:gef-gwt    文件:Widget.java   
protected void dispatchMouseMoved(MouseEvent me) {
    List<MouseMoveListener> copy = new ArrayList<MouseMoveListener>(
            mouseMoveListeners);
    for (MouseMoveListener ml : copy) {
        ml.mouseMove(me);
    }

}
项目:swtknob    文件:Knob.java   
/**
 * Handle mouse moves
 * 
 * @return
 */
private MouseMoveListener createMouseMoveHandler() {
    return new MouseMoveListener() {
        @Override
        public void mouseMove(MouseEvent me) {
            if (drag) {
                dragOffset += me.y - dragY;

                double newValue = dragValue - dragOffset / sensitivity;
                if (newValue < 0d) {
                    dragOffset = (int) (dragValue * sensitivity);
                    newValue = 0d;
                } else if (newValue > 1d) {
                    dragOffset = (int) (dragValue * sensitivity - sensitivity);
                    newValue = 1d;
                }

                if (value != newValue) {
                    value = newValue;
                    fireSelectionEvent();
                    redraw();
                }

                getDisplay().setCursorLocation(screenX, screenY);
            }
        }
    };
}
项目:arx    文件:SWTUtil.java   
/**
 * 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());
            }
        }
    });
}
项目:cogtool    文件:PERTPanel.java   
/**
 * Add a mouse handler for mouse move and click events
 *
 * @param mouseState
 */
public void addMouseHandler(MenuListener mouseState,
                            MouseMoveListener moveListener)
{
    if (mouseState != null) {
        addMouseListener(mouseState);
    }

    if (moveListener != null) {
        addMouseMoveListener(moveListener);
    }
}
项目:ccu-historian    文件:ChartComposite.java   
/**
     * 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);
        }
    }
项目:team-explorer-everywhere    文件:DatepickerDate.java   
@Override
public void addMouseMoveListener(final MouseMoveListener listener) {
    addListener(SWT.MouseMove, new TypedListener(listener));
}
项目:team-explorer-everywhere    文件:DatepickerDate.java   
@Override
public void removeMouseMoveListener(final MouseMoveListener listener) {
    removeListener(SWT.MouseMove, listener);
}
项目:aya-lang    文件:ChartComposite.java   
/**
     * 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);
        }
    }
项目:SPELL    文件:CustomStyledText.java   
/**************************************************************************
 * Override the listener mechanism
 *************************************************************************/
public void addMouseMoveListener(MouseMoveListener lst)
{
    m_view.addMouseMoveListener(lst);
}
项目:ECG-Viewer    文件:ChartComposite.java   
/**
     * 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);
        }
    }
项目:astor    文件:ChartComposite.java   
/**
 * 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);
    }
}
项目:gef-gwt    文件:Widget.java   
public void addMouseMoveListener(MouseMoveListener listener) {
    this.mouseMoveListeners.add(listener);
}
项目:group-five    文件:ChartComposite.java   
/**
     * 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);
        }
    }
项目:buffer_bci    文件:ChartComposite.java   
/**
     * 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);
        }
    }
项目:proyecto-teoria-control-utn-frro    文件:ChartComposite.java   
/**
     * 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);
        }
    }
项目:Memetic-Algorithm-for-TSP    文件:ChartComposite.java   
/**
     * 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);
        }
    }
项目:elexis-3-base    文件:AbstractBrowseText.java   
public void addMouseMoveListener(MouseMoveListener listener){
    this.text.addMouseMoveListener(listener);
}
项目:elexis-3-base    文件:AbstractBrowseText.java   
public void removeMouseMoveListener(MouseMoveListener listener){
    this.text.removeMouseMoveListener(listener);
}
项目:gef-gwt    文件:Control.java   
/**
 * 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
 */
public void addMouseMoveListener(MouseMoveListener listener) {
    super.addMouseMoveListener(listener);
    checkWidget();
    if (listener == null)
        error(SWT.ERROR_NULL_ARGUMENT);
    TypedListener typedListener = new TypedListener(listener);
    addListener(SWT.MouseMove, typedListener);
}
项目:gef-gwt    文件:Control.java   
/**
 * 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
 */
public void removeMouseMoveListener(MouseMoveListener listener) {
    checkWidget();
    if (listener == null)
        error(SWT.ERROR_NULL_ARGUMENT);
    if (eventTable == null)
        return;
    eventTable.unhook(SWT.MouseMove, listener);
}
项目:convertigo-eclipse    文件:TreeWrapper.java   
public void addMouseMoveListener(MouseMoveListener listener) {

    tree.addMouseMoveListener(listener);
}
项目:convertigo-eclipse    文件:TreeWrapper.java   
public void removeMouseMoveListener(MouseMoveListener listener) {

    tree.removeMouseMoveListener(listener);
}