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

项目:egradle    文件:OpenGradleResourceDialog.java   
private Button createDropdownButton(final Composite parent, int id, String label, MouseListener mouseListener) {
    char textEmbedding = parent.getOrientation() == SWT.LEFT_TO_RIGHT ? '\u202a' : '\u202b';
    Button button = createButton(parent, id, textEmbedding + label + '\u202c', false);
    if (Util.isMac()) {
        // Button#setOrientation(int) is a no-op on the Mac. Use a Unicode
        // BLACK DOWN-POINTING SMALL TRIANGLE.
        button.setText(button.getText() + " \u25BE"); //$NON-NLS-1$
    } else {
        int dropDownOrientation = parent.getOrientation() == SWT.LEFT_TO_RIGHT ? SWT.RIGHT_TO_LEFT
                : SWT.LEFT_TO_RIGHT;
        button.setOrientation(dropDownOrientation);
        button.setText(button.getText() + " \u25BE"); //$NON-NLS-1$
        button.addMouseListener(mouseListener);
    }
    return button;
}
项目:TuxGuitar-1.3.1-fork    文件:TGTableViewer.java   
private void addTable(){
    MouseListener listener = mouseFocusListener();
    this.table = new TGTable(this.context, getComposite());
    this.table.getColumnNumber().getControl().addMouseListener(listener);
    this.table.getColumnSoloMute().getControl().addMouseListener(listener);
    this.table.getColumnName().getControl().addMouseListener(listener);
    this.table.getColumnInstrument().getControl().addMouseListener(listener);
    this.table.getColumnCanvas().getControl().addMouseListener(listener);
    this.table.getColumnCanvas().getControl().addMouseListener(new MouseAdapter() {
        public void mouseDoubleClick(MouseEvent e) {
            new TGActionProcessor(TuxGuitar.getInstance().getContext(), TGOpenSongInfoDialogAction.NAME).process();
        }
    });
    this.fireUpdate(true);
    this.loadProperties();
}
项目:OpenSPIFe    文件:ServerStatusWidget.java   
private void addServer(Composite parent, final IServerMonitor server) {
    final Composite composite = new Composite(parent, SWT.NONE);
    RowLayout layout = new RowLayout();
    layout.marginTop = 0;
    layout.marginBottom = 0;
    layout.marginLeft = 2;
    layout.marginRight = 2;
    composite.setLayout(layout);
    final Label icon = new Label(composite, SWT.CENTER);
    final Label text = new Label(composite, SWT.CENTER);
    text.setText(server.getShortName());
    updateStatusIconAndTooltip(server, composite, icon, text);
    composite.addMouseTrackListener(new CompositeMouseTrackListener(text, icon, server, composite));
    composite.addMouseListener(new CompositeMouseListener(text, icon, server, composite));
    server.addListener(new CompositeServerMonitorListener(text, icon, server, composite));

    final String host = server.getHost();
    final int port = server.getPort();
    final Option<IServerStatusWidgetListenerProvider> provider = widgetListenerProviders._1().find(matches(host, port));
    if (provider.isSome()) {
        final MouseListener mouseListener = provider.some().getMouseListener();
        composite.addMouseListener(mouseListener);
        icon.addMouseListener(mouseListener);
        text.addMouseListener(mouseListener);
    }
}
项目: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 removeMouseListener ( final ChartMouseListener listener )
{
    final MouseListener proxyListener = this.mouseListenerMap.remove ( listener );
    if ( proxyListener != null )
    {
        this.control.removeMouseListener ( proxyListener );
    }
}
项目:BiglyBT    文件:TwistieLabel.java   
/**
 * Add a mouse listener to the control and also the <code>titleLabel</code>
 */
@Override
public void addMouseListener(MouseListener listener) {
    if (null != titleLabel) {
        titleLabel.addMouseListener(listener);
    }
    super.addMouseListener(listener);
}
项目:BiglyBT    文件:TwistieLabel.java   
/**
 * Remove the mouse listener from the control and also the <code>titleLabel</code>
 */
@Override
public void removeMouseListener(MouseListener listener) {
    if (null != titleLabel) {
        titleLabel.removeMouseListener(listener);
    }
    super.removeMouseListener(listener);
}
项目:team-explorer-everywhere    文件:TeamExplorerTileControl.java   
@Override
public void addMouseListener(final MouseListener listener) {
    composite.addMouseListener(listener);
    iconComposite.addMouseListener(listener);
    titleArea.addMouseListener(listener);
    titleComposite.addMouseListener(listener);
    colorBar.addMouseListener(listener);
    iconArea.addMouseListener(listener);
}
项目:TuxGuitar-1.3.1-fork    文件:TGTableRow.java   
public void init(){
    MouseListener mouseListenerLabel = new MouseListenerLabel();
    MouseListener mouseListenerCanvas = new MouseListenerCanvas();

    this.row = new Composite(this.table.getRowControl(),SWT.NONE );
    this.row.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));

    this.number = new CLabel(this.row,SWT.LEFT);
    this.number.addMouseListener(mouseListenerLabel);
    this.table.addRowItem(this.table.getColumnNumber(),this.number,true);

    this.soloMute = new CLabel(this.row,SWT.LEFT);
    this.soloMute.addMouseListener(mouseListenerLabel);
    this.table.addRowItem(this.table.getColumnSoloMute(),this.soloMute,true);

    this.name = new CLabel(this.row,SWT.LEFT);
    this.name.addMouseListener(mouseListenerLabel);
    this.table.addRowItem(this.table.getColumnName(),this.name,true);

    this.instrument = new CLabel(this.row,SWT.LEFT);
    this.instrument.addMouseListener(mouseListenerLabel);
    this.table.addRowItem(this.table.getColumnInstrument(),this.instrument,true);

    this.painter = new Composite(this.row,SWT.DOUBLE_BUFFERED);
    this.painter.addMouseListener(mouseListenerCanvas);
    this.painter.addPaintListener(new TGBufferedPainterListenerLocked(this.table.getContext(), new TGTableRowPaintHandle()));
    this.table.addRowItem(this.table.getColumnCanvas(),this.painter,false);

    this.row.pack();
}
项目:TuxGuitar-1.3.1-fork    文件:TGTableViewer.java   
private MouseListener mouseFocusListener(){
    return new MouseAdapter() {
        public void mouseUp(MouseEvent e) {
            TGTable table = getTable();
            if(table != null){
                TGTableRow row = table.getRow( ( getSelectedTrack() - 1 ) );
                if( row != null ){
                    row.getPainter().setFocus();
                }
            }
        }
    };
}
项目:p2-installer    文件:InfoList.java   
/**
 * Notifies mouse listeners.
 * 
 * @param type Event type
 * @param event Mouse event
 */
protected void notifyMouseListeners(int type, MouseEvent event) {
    Object[] listeners = mouseListeners.getListeners();
    for (Object listener : listeners) {
        if (type == 1) {
            ((MouseListener)listener).mouseDown(event);
        }
        else if (type == 2) {
            ((MouseListener)listener).mouseUp(event);
        }
        else if (type == 3) {
            ((MouseListener)listener).mouseDoubleClick(event);
        }
    }
}
项目:swttiles    文件:Tiles.java   
/**
 * Returns the mouse listener
 * @return
 */
   private MouseListener getMouseListener() {
    return new MouseAdapter(){
        @Override
        public void mouseDown(MouseEvent arg0) {
            Tile<T> tile = getTileAt(arg0.x, arg0.y);
            if (tile != null && tile.item != selectedItem) {
                selectedItem = tile.item;
                redraw();
                fireSelectionEvent(tile);
            } 
        }
       };
}
项目:AcademicTorrents-Downloader    文件:TwistieLabel.java   
/**
 * Add a mouse listener to the control and also the <code>titleLabel</code>
 */
public void addMouseListener(MouseListener listener) {
    if (null != titleLabel) {
        titleLabel.addMouseListener(listener);
    }
    super.addMouseListener(listener);
}
项目:AcademicTorrents-Downloader    文件:TwistieLabel.java   
/**
 * Remove the mouse listener from the control and also the <code>titleLabel</code>
 */
public void removeMouseListener(MouseListener listener) {
    if (null != titleLabel) {
        titleLabel.removeMouseListener(listener);
    }
    super.removeMouseListener(listener);
}
项目:gef-gwt    文件:Widget.java   
protected void dispatchMouseReleased(MouseEvent me) {
    List<MouseListener> copy = new ArrayList<MouseListener>(mouseListeners);
    for (MouseListener ml : copy) {
        ml.mouseUp(me);
    }

}
项目:Mailster    文件:PshelfPanel.java   
private static void addPopupListener(Composite c, MouseListener ml)
{
    for (Control ctrl : c.getChildren())
    {
        if (ctrl instanceof Composite)
            addPopupListener((Composite) ctrl, ml);
        else
            ctrl.addMouseListener(ml);
    }
    c.addMouseListener(ml);
}
项目:Mailster    文件:PshelfPanel.java   
private static void removePopupListener(Composite c, MouseListener ml)
{
    for (Control ctrl : c.getChildren())
    {
        if (ctrl instanceof Composite)
            removePopupListener((Composite) ctrl, ml);
        else
            ctrl.removeMouseListener(ml);
    }
    c.removeMouseListener(ml);
}
项目:totallicks-tuxguitar    文件:TGTableRow.java   
public void init(){
    MouseListener mouseListenerLabel = new MouseListenerLabel();
    MouseListener mouseListenerCanvas = new MouseListenerCanvas();
    PaintListener paintListenerCanvas = new PaintListenerCanvas();

    this.row = new Composite(this.table.getRowControl(),SWT.NONE );
    this.row.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));

    this.number = new CLabel(this.row,SWT.LEFT);
    this.number.addMouseListener(mouseListenerLabel);
    this.table.addRowItem(this.table.getColumnNumber(),this.number,true);

    this.name = new CLabel(this.row,SWT.LEFT);
    this.name.addMouseListener(mouseListenerLabel);
    this.table.addRowItem(this.table.getColumnName(),this.name,true);

    this.instrument = new CLabel(this.row,SWT.LEFT);
    this.instrument.addMouseListener(mouseListenerLabel);
    this.table.addRowItem(this.table.getColumnInstrument(),this.instrument,true);

    this.painter = new Composite(this.row,SWT.DOUBLE_BUFFERED);
    this.painter.addMouseListener(mouseListenerCanvas);
    this.painter.addPaintListener(paintListenerCanvas);
    this.table.addRowItem(this.table.getColumnCanvas(),this.painter,false);

    this.row.pack();
}
项目:totallicks-tuxguitar    文件:TGTableViewer.java   
private void addTable(){
    MouseListener listener = mouseFocusListener();
    this.table = new TGTable(getComposite());
    this.table.getColumnNumber().getControl().addMouseListener(listener);
    this.table.getColumnName().getControl().addMouseListener(listener);
    this.table.getColumnInstrument().getControl().addMouseListener(listener);
    this.table.getColumnCanvas().getControl().addMouseListener(listener);
    this.table.getColumnCanvas().getControl().addMouseListener(new MouseAdapter() {
        public void mouseDoubleClick(MouseEvent e) {
            TuxGuitar.instance().getAction(ChangeInfoAction.NAME).process(e);
        }
    });
    this.fireUpdate(true);
    this.loadProperties();
}
项目:totallicks-tuxguitar    文件:TGTableViewer.java   
private MouseListener mouseFocusListener(){
    return new MouseAdapter() {
        public void mouseUp(MouseEvent e) {
            TGTable table = getTable();
            if(table != null){
                TGTableRow row = table.getRow( ( getSelectedTrack() - 1 ) );
                if(row != null){
                    row.getPainter().setFocus();
                }
            }
        }
    };
}
项目:cogtool    文件:SEDemoUIModel.java   
public SEDemoUIModel(Script modelScript,
                     Project scriptProject,
                     MouseListener listener,
                     AlertHandler deviceChgHandler,
                     boolean editable)
{
    super(scriptProject, listener, deviceChgHandler, editable);

    if (modelScript == null) {
        throw new IllegalArgumentException
            ("Cannot create a SEDemoUIModel with a null Script");
    }

    // Store model for reference
    script = modelScript;
    Demonstration demo = script.getDemonstration();
    TaskApplication taskApp = demo.getTaskApplication();

    task = taskApp.getTask();
    design = taskApp.getDesign();

    scriptUIModel = new ScriptUIModel(modelScript, scriptProject);

    setCurrentFrame(demo.getStartFrame());

    design.addHandler(this,
                           Design.FrameChange.class,
                           deleteHandler);

    AlertHandler handleStepDeletion = new StepDeletionHandler(demo);

    demo.addHandler(this, Demonstration.ScriptStepChange.class, handleStepDeletion);
}
项目:cogtool    文件:DefaultSEUIModel.java   
public DefaultSEUIModel(Project proj,
                        MouseListener listener,
                        AlertHandler deviceChgHandler,
                        boolean edit)
{
    super(proj);

    frameNameListener = listener;
    inputDeviceChangeHandler = deviceChgHandler;

    editable = edit;
}
项目:Hydrograph    文件:ELTDefaultLable.java   
public void addMouseUpListener(MouseListener listener) {
    defaultELTLable.addMouseListener(listener);
}
项目:BiglyBT    文件:BufferedLabel.java   
public void addMouseListener(MouseListener listener) {
  label.addMouseListener(listener);
}
项目:BiglyBT    文件:BufferedTruncatedLabel.java   
public void addMouseListener(MouseListener listener) {
  label.addMouseListener(listener);
}
项目: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 addMouseListener(final MouseListener listener) {
    addListener(SWT.MouseDown, new TypedListener(listener));
    addListener(SWT.MouseUp, new TypedListener(listener));
    addListener(SWT.MouseDoubleClick, new TypedListener(listener));
}
项目:team-explorer-everywhere    文件:DatepickerDate.java   
@Override
public void removeMouseListener(final MouseListener listener) {
    removeListener(SWT.MouseDown, listener);
    removeListener(SWT.MouseUp, listener);
    removeListener(SWT.MouseDoubleClick, new TypedListener(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);
        }
    }
项目:http4e    文件:ImportDialog.java   
public void setOkListener( MouseListener okListener){
   this.okListener = okListener;
}
项目:http4e    文件:ParameterizeDialog.java   
public void setOkListener( MouseListener okListener){
   this.okListener = okListener;
}
项目:TuxGuitar-1.3.1-fork    文件:TGTableRow.java   
public MouseListener getMouseListenerLabel() {
    return this.mouseListenerLabel;
}
项目:TuxGuitar-1.3.1-fork    文件:TGTableRow.java   
public void setMouseListenerLabel(MouseListener mouseListenerLabel) {
    this.mouseListenerLabel = mouseListenerLabel;
}
项目:TuxGuitar-1.3.1-fork    文件:TGTableRow.java   
public MouseListener getMouseListenerCanvas() {
    return this.mouseListenerCanvas;
}
项目:TuxGuitar-1.3.1-fork    文件:TGTableRow.java   
public void setMouseListenerCanvas(MouseListener mouseListenerCanvas) {
    this.mouseListenerCanvas = mouseListenerCanvas;
}
项目:TranskribusSwtGui    文件:ATranscriptionWidget.java   
public void addUserTextMouseListener(MouseListener l) {
    mouseListener.add(l);
    text.addMouseListener(l);
}
项目:raptor-chess-interface    文件:RaptorLabel.java   
@Override
public void addMouseListener(MouseListener listener) {
    label.addMouseListener(listener);
}
项目:raptor-chess-interface    文件:RaptorLabel.java   
@Override
public void removeMouseListener(MouseListener listener) {
    label.removeMouseListener(listener);
}
项目:SPELL    文件:CustomStyledText.java   
/**************************************************************************
 * Override the listener mechanism
 *************************************************************************/
public void addMouseListener(MouseListener lst)
{
    m_view.addMouseListener(lst);
}
项目:p2-installer    文件:InfoList.java   
/**
 * Removes a listener from mouse events.
 * 
 * @Param listener Listener to remove
 */
public void removeMouseListener(MouseListener listener) {
    if (mouseListeners != null) {
        mouseListeners.remove(listener);
    }
}