java.awt.Canvas.addMouseMotionListener()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(285)

本文整理了Java中java.awt.Canvas.addMouseMotionListener()方法的一些代码示例,展示了Canvas.addMouseMotionListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Canvas.addMouseMotionListener()方法的具体详情如下:
包路径:java.awt.Canvas
类名称:Canvas
方法名:addMouseMotionListener

Canvas.addMouseMotionListener介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

  1. public void setListeners (Canvas canvas) {
  2. if (this.canvas != null) {
  3. canvas.removeMouseListener(this);
  4. canvas.removeMouseMotionListener(this);
  5. canvas.removeMouseWheelListener(this);
  6. canvas.removeKeyListener(this);
  7. }
  8. canvas.addMouseListener(this);
  9. canvas.addMouseMotionListener(this);
  10. canvas.addMouseWheelListener(this);
  11. canvas.addKeyListener(this);
  12. canvas.setFocusTraversalKeysEnabled(false);
  13. this.canvas = canvas;
  14. }

代码示例来源:origin: libgdx/libgdx

  1. public void setListeners (Canvas canvas) {
  2. if (this.canvas != null) {
  3. canvas.removeMouseListener(this);
  4. canvas.removeMouseMotionListener(this);
  5. canvas.removeMouseWheelListener(this);
  6. canvas.removeKeyListener(this);
  7. }
  8. canvas.addMouseListener(this);
  9. canvas.addMouseMotionListener(this);
  10. canvas.addMouseWheelListener(this);
  11. canvas.addKeyListener(this);
  12. canvas.setFocusTraversalKeysEnabled(false);
  13. this.canvas = canvas;
  14. }

代码示例来源:origin: kendzi/kendzi3d

  1. /**
  2. * Register listener for mouse selection.
  3. *
  4. * @param pCanvas
  5. * canvas for listener
  6. */
  7. private void addSelectionListener(Canvas canvas, ObjectSelectionListener objectSelectionListener) {
  8. canvas.addMouseListener(objectSelectionListener);
  9. canvas.addMouseMotionListener(objectSelectionListener);
  10. }
  11. }

代码示例来源:origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

  1. canvas_.addMouseListener(mc);
  2. canvas_.addMouseWheelListener(mc);
  3. canvas_.addMouseMotionListener(mc);

代码示例来源:origin: caprica/vlcj-player

  1. this.mouseEventHandler = new MouseEventHandler();
  2. this.mediaPlayerComponent.getVideoSurface().addMouseListener(mouseEventHandler);
  3. this.mediaPlayerComponent.getVideoSurface().addMouseMotionListener(mouseEventHandler);
  4. this.mediaPlayerComponent.getVideoSurface().addMouseWheelListener(mouseEventHandler);

代码示例来源:origin: google/sagetv

  1. c.addMouseMotionListener(this);

代码示例来源:origin: mpicbg/mpicbg_

  1. /**
  2. * Add new event handlers.
  3. */
  4. final void takeOverGui()
  5. {
  6. canvas.addKeyListener( Stack_Rotate.this );
  7. window.addKeyListener( Stack_Rotate.this );
  8. canvas.addMouseMotionListener( Stack_Rotate.this );
  9. canvas.addMouseListener( Stack_Rotate.this );
  10. ij.addKeyListener( Stack_Rotate.this );
  11. window.addMouseWheelListener( Stack_Rotate.this );
  12. scrollBar.addAdjustmentListener( Stack_Rotate.this );
  13. updateScrollBar();
  14. }

代码示例来源:origin: axtimwalde/mpicbg

  1. /**
  2. * Add new event handlers.
  3. */
  4. final void takeOverGui()
  5. {
  6. canvas.addKeyListener( Stack_Rotate.this );
  7. window.addKeyListener( Stack_Rotate.this );
  8. canvas.addMouseMotionListener( Stack_Rotate.this );
  9. canvas.addMouseListener( Stack_Rotate.this );
  10. ij.addKeyListener( Stack_Rotate.this );
  11. window.addMouseWheelListener( Stack_Rotate.this );
  12. scrollBar.addAdjustmentListener( Stack_Rotate.this );
  13. updateScrollBar();
  14. }

代码示例来源:origin: org.processing/core

  1. canvas.addMouseMotionListener(new MouseMotionListener() {

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl

  1. public void setListeners (Canvas canvas) {
  2. if (this.canvas != null) {
  3. canvas.removeMouseListener(this);
  4. canvas.removeMouseMotionListener(this);
  5. canvas.removeMouseWheelListener(this);
  6. canvas.removeKeyListener(this);
  7. }
  8. canvas.addMouseListener(this);
  9. canvas.addMouseMotionListener(this);
  10. canvas.addMouseWheelListener(this);
  11. canvas.addKeyListener(this);
  12. canvas.setFocusTraversalKeysEnabled(false);
  13. this.canvas = canvas;
  14. }

代码示例来源:origin: mpicbg/mpicbg_

  1. /**
  2. * Restore the previously active Event handlers.
  3. */
  4. final void restoreGui()
  5. {
  6. clearGui();
  7. for ( final KeyListener l : canvasKeyListeners )
  8. canvas.addKeyListener( l );
  9. for ( final KeyListener l : windowKeyListeners )
  10. window.addKeyListener( l );
  11. for ( final KeyListener l : ijKeyListeners )
  12. ij.addKeyListener( l );
  13. for ( final MouseListener l : canvasMouseListeners )
  14. canvas.addMouseListener( l );
  15. for ( final MouseMotionListener l : canvasMouseMotionListeners )
  16. canvas.addMouseMotionListener( l );
  17. for ( final MouseWheelListener l : windowMouseWheelListeners )
  18. window.addMouseWheelListener( l );
  19. for ( final AdjustmentListener l : scrollBarAdjustmentListeners )
  20. scrollBar.addAdjustmentListener( l );
  21. scrollBar.setValues( scrollBarValue, scrollBarVisible, scrollBarMin, scrollBarMax );
  22. }

代码示例来源:origin: axtimwalde/mpicbg

  1. /**
  2. * Restore the previously active Event handlers.
  3. */
  4. final void restoreGui()
  5. {
  6. clearGui();
  7. for ( final KeyListener l : canvasKeyListeners )
  8. canvas.addKeyListener( l );
  9. for ( final KeyListener l : windowKeyListeners )
  10. window.addKeyListener( l );
  11. for ( final KeyListener l : ijKeyListeners )
  12. ij.addKeyListener( l );
  13. for ( final MouseListener l : canvasMouseListeners )
  14. canvas.addMouseListener( l );
  15. for ( final MouseMotionListener l : canvasMouseMotionListeners )
  16. canvas.addMouseMotionListener( l );
  17. for ( final MouseWheelListener l : windowMouseWheelListeners )
  18. window.addMouseWheelListener( l );
  19. for ( final AdjustmentListener l : scrollBarAdjustmentListeners )
  20. scrollBar.addAdjustmentListener( l );
  21. scrollBar.setValues( scrollBarValue, scrollBarVisible, scrollBarMin, scrollBarMax );
  22. }

代码示例来源:origin: uk.co.caprica/vlcj

  1. canvas.addMouseMotionListener(mouseAdapter);

代码示例来源:origin: mpicbg/mpicbg

  1. @Override
  2. public void run( String arg )
  3. {
  4. ij = IJ.getInstance();
  5. imp = IJ.getImage();
  6. window = imp.getWindow();
  7. canvas = imp.getCanvas();
  8. canvas.addKeyListener( this );
  9. window.addKeyListener( this );
  10. canvas.addMouseMotionListener( this );
  11. canvas.addMouseListener( this );
  12. ij.addKeyListener( this );
  13. init();
  14. imp.getProcessor().snapshot();
  15. Toolbar.getInstance().setTool( Toolbar.RECTANGLE );
  16. painter = new PaintThread();
  17. painter.start();
  18. }

代码示例来源:origin: axtimwalde/mpicbg

  1. @Override
  2. public void run( final String arg )
  3. {
  4. ij = IJ.getInstance();
  5. imp = IJ.getImage();
  6. window = imp.getWindow();
  7. canvas = imp.getCanvas();
  8. canvas.addKeyListener( this );
  9. window.addKeyListener( this );
  10. canvas.addMouseMotionListener( this );
  11. canvas.addMouseListener( this );
  12. ij.addKeyListener( this );
  13. init();
  14. imp.getProcessor().snapshot();
  15. Toolbar.getInstance().setTool( Toolbar.LINE );
  16. painter = new PaintThread();
  17. painter.start();
  18. }

代码示例来源:origin: mpicbg/mpicbg

  1. @Override
  2. public void run( final String arg )
  3. {
  4. ij = IJ.getInstance();
  5. imp = IJ.getImage();
  6. window = imp.getWindow();
  7. canvas = imp.getCanvas();
  8. canvas.addKeyListener( this );
  9. window.addKeyListener( this );
  10. canvas.addMouseMotionListener( this );
  11. canvas.addMouseListener( this );
  12. ij.addKeyListener( this );
  13. init();
  14. imp.getProcessor().snapshot();
  15. Toolbar.getInstance().setTool( Toolbar.LINE );
  16. painter = new PaintThread();
  17. painter.start();
  18. }

代码示例来源:origin: axtimwalde/mpicbg

  1. @Override
  2. public void run( String arg )
  3. {
  4. ij = IJ.getInstance();
  5. imp = IJ.getImage();
  6. window = imp.getWindow();
  7. canvas = imp.getCanvas();
  8. canvas.addKeyListener( this );
  9. window.addKeyListener( this );
  10. canvas.addMouseMotionListener( this );
  11. canvas.addMouseListener( this );
  12. ij.addKeyListener( this );
  13. init();
  14. imp.getProcessor().snapshot();
  15. Toolbar.getInstance().setTool( Toolbar.RECTANGLE );
  16. painter = new PaintThread();
  17. painter.start();
  18. }

代码示例来源:origin: axtimwalde/mpicbg

  1. @Override
  2. public void run( String arg )
  3. {
  4. ij = IJ.getInstance();
  5. imp = IJ.getImage();
  6. if ( imp.getStackSize() < 2 )
  7. {
  8. IJ.error( "This plugin only works on stacks with at least two slices." );
  9. return;
  10. }
  11. window = imp.getWindow();
  12. canvas = imp.getCanvas();
  13. canvas.addKeyListener( this );
  14. window.addKeyListener( this );
  15. canvas.addMouseMotionListener( this );
  16. canvas.addMouseListener( this );
  17. ij.addKeyListener( this );
  18. init();
  19. imp.getProcessor().snapshot();
  20. Toolbar.getInstance().setTool( Toolbar.RECTANGLE );
  21. painter = new PaintThread();
  22. painter.start();
  23. }

代码示例来源:origin: mpicbg/mpicbg

  1. @Override
  2. public void run( String arg )
  3. {
  4. ij = IJ.getInstance();
  5. imp = IJ.getImage();
  6. if ( imp.getStackSize() < 2 )
  7. {
  8. IJ.error( "This plugin only works on stacks with at least two slices." );
  9. return;
  10. }
  11. window = imp.getWindow();
  12. canvas = imp.getCanvas();
  13. canvas.addKeyListener( this );
  14. window.addKeyListener( this );
  15. canvas.addMouseMotionListener( this );
  16. canvas.addMouseListener( this );
  17. ij.addKeyListener( this );
  18. init();
  19. imp.getProcessor().snapshot();
  20. Toolbar.getInstance().setTool( Toolbar.RECTANGLE );
  21. painter = new PaintThread();
  22. painter.start();
  23. }

代码示例来源:origin: com.projectdarkstar.example.projectsnowman/snowman-world-editor

  1. canvas.addMouseMotionListener(mouseListener);
  2. canvas.addMouseListener(mouseListener);
  3. canvas.addMouseWheelListener(mouseListener);

相关文章