Package java.awt.event

Examples of java.awt.event.MouseWheelListener


        public void stateChanged(ChangeEvent e)
        {
          palastPanel.calculateBuildings();
        }
      });
      numGildMembers.addMouseWheelListener(new MouseWheelListener()
      { 
        @Override
        public void mouseWheelMoved(MouseWheelEvent e)
        {
          int val = 0;
View Full Code Here


    public static final String CLIENT_PROPERTY_MOUSE_WHEEL_LISTENER = "mouseWheelListener";
    protected static final String ACTION_NAME_INCREMENT = "increment";
    protected static final String ACTION_NAME_DECREMENT = "decrement";

    public static void installMouseWheelSupport(final JSpinner spinner) {
        MouseWheelListener l = new MouseWheelListener() {
            public void mouseWheelMoved(MouseWheelEvent e) {
                if (spinner == null || !spinner.isEnabled()) {
                    return;
                }
                int rotation = e.getWheelRotation();
View Full Code Here

        spinner.addMouseWheelListener(l);
        spinner.putClientProperty(CLIENT_PROPERTY_MOUSE_WHEEL_LISTENER, l);
    }

    public static void uninstallMouseWheelSupport(final JSpinner spinner) {
        MouseWheelListener l = (MouseWheelListener) spinner.getClientProperty(CLIENT_PROPERTY_MOUSE_WHEEL_LISTENER);
        if (l != null) {
            spinner.removeMouseWheelListener(l);
        }
    }
View Full Code Here

                is_paint_chooser = false;
            }
            public void mouseEntered(MouseEvent e) {}
            public void mouseExited(MouseEvent e) {}
        });
        this.addMouseWheelListener(new MouseWheelListener(){
            public void mouseWheelMoved(MouseWheelEvent e) {
                if (e.getWheelRotation() > 0) {
                    zoomOutDomain();
                }
                if (e.getWheelRotation() < 0) {
View Full Code Here

    gbc_spinnerCampSize.gridx = 6;
    gbc_spinnerCampSize.gridy = 4;
    mainPanel.add(spinnerCampSize, gbc_spinnerCampSize);
   
    JScrollPane scrollPaneTroopQueue = new JScrollPane();
    scrollPaneTroopQueue.addMouseWheelListener(new MouseWheelListener() {
      public void mouseWheelMoved(MouseWheelEvent e) {
        ((JScrollPane)e.getSource()).getVerticalScrollBar().setValue((int)((JScrollPane)e.getSource()).getVerticalScrollBar().getValue() + (int)(e.getPreciseWheelRotation() * 12));
      }
    });
    scrollPaneTroopQueue.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
 
View Full Code Here

        if (SwingUtilities.isLeftMouseButton(e)) {
          handleMouseRelease(e);
        }
      }
    });
    canvas.addMouseWheelListener(new MouseWheelListener() {
      @Override
      public void mouseWheelMoved(MouseWheelEvent mwe) {
        int x = mwe.getX();
        int y = mwe.getY();
        int rot = mwe.getWheelRotation();
View Full Code Here

    JPanel panelList = new JPanel(new GridLayout(1, 2, 5, 0));
    JScrollPane scrollPaneSong, scrollPaneAlbum;
    panelList.add(scrollPaneSong = new JScrollPane(songs,
        JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
        JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED));
    scrollPaneSong.addMouseWheelListener(new MouseWheelListener() {
     
      public void mouseWheelMoved(MouseWheelEvent arg0) {
        if (configure.update && !configure.lastValueSong.equals("") && updateSong == null && configure.songs.size() - 1 == songs.getLastVisibleIndex() && arg0.getUnitsToScroll() > 0){
          updateSong();
        }
      }
    });
    panelList.add(scrollPaneAlbum = new JScrollPane(albums = new JList(modelAlbums = new DefaultListModel()),
        JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
        JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED));
    scrollPaneAlbum.addMouseWheelListener(new MouseWheelListener() {
     
      public void mouseWheelMoved(MouseWheelEvent arg0) {
        if (configure.update && !configure.lastValueAlbum.equals("") && updateAlbum == null && configure.albums.size() - 1 == albums.getLastVisibleIndex() && arg0.getUnitsToScroll() > 0){
          updateAlbum();
        }
View Full Code Here

      public void mouseMoved(MouseEvent e) {
        sendMouse(MouseEvent.MOUSE_MOVED, e.getX(), e.getY(), e
            .getButton());
      }
    });
    this.addMouseWheelListener(new MouseWheelListener() {
      public void mouseWheelMoved(MouseWheelEvent e) {
        sendMouse(MouseEvent.MOUSE_WHEEL, e.getX(), e.getY(), e
            .getUnitsToScroll());
      }
    });
View Full Code Here

          int newY = (int) (viewPosition.getY() + 10);
          scrollPane.getViewport().setViewPosition(new Point((int) viewPosition.getX(), newY));
        }
      }
    });
    this.scrollPane.addMouseWheelListener(new MouseWheelListener() {
     
      private boolean gotoNextPage = false;
      private boolean gotoPreviousPage = false;

      @Override
View Full Code Here

        setForeground(new java.awt.Color(153, 153, 153));
        setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
        getVerticalScrollBar().setUnitIncrement(16);

        addMouseWheelListener(new MouseWheelListener() {
            public void mouseWheelMoved(MouseWheelEvent mouseWheelEvent) {
                trackPanel.getNamePanel().repaint();
            }
        });
View Full Code Here

TOP

Related Classes of java.awt.event.MouseWheelListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.