Search in sources :

Example 36 with MouseListener

use of java.awt.event.MouseListener in project LauncherV3 by TechnicPack.

the class InstallerFrame method addGlassPane.

private void addGlassPane() {
    glassPane = new JPanel() {

        @Override
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            g.setColor(LauncherFrame.COLOR_CENTRAL_BACK);
            g.fillRect(0, 0, getWidth(), getHeight());
        }
    };
    glassPane.addMouseListener(new MouseListener() {

        @Override
        public void mouseClicked(MouseEvent e) {
            e.consume();
        }

        @Override
        public void mousePressed(MouseEvent e) {
            e.consume();
        }

        @Override
        public void mouseReleased(MouseEvent e) {
            e.consume();
        }

        @Override
        public void mouseEntered(MouseEvent e) {
            e.consume();
        }

        @Override
        public void mouseExited(MouseEvent e) {
            e.consume();
        }
    });
    glassPane.setOpaque(false);
    glassPane.setLayout(new GridBagLayout());
    JLabel spinner = new JLabel(resources.getIcon("loader.gif"));
    glassPane.add(spinner);
    setGlassPane(glassPane);
}
Also used : MouseListener(java.awt.event.MouseListener) MouseEvent(java.awt.event.MouseEvent)

Example 37 with MouseListener

use of java.awt.event.MouseListener in project com.revolsys.open by revolsys.

the class MouseOverlay method mouseEntered.

@Override
public void mouseEntered(final MouseEvent e) {
    updateEventPoint(e);
    requestFocusInWindow();
    for (final Component overlay : getOverlays()) {
        if (overlay instanceof MouseListener) {
            final MouseListener listener = (MouseListener) overlay;
            listener.mouseEntered(e);
            if (e.isConsumed()) {
                return;
            }
        }
    }
}
Also used : MouseListener(java.awt.event.MouseListener) JComponent(javax.swing.JComponent) Component(java.awt.Component)

Example 38 with MouseListener

use of java.awt.event.MouseListener in project com.revolsys.open by revolsys.

the class MouseOverlay method mouseClicked.

@Override
public void mouseClicked(final MouseEvent e) {
    updateEventPoint(e);
    requestFocusInWindow();
    for (final Component overlay : getOverlays()) {
        if (overlay instanceof MouseListener) {
            final MouseListener listener = (MouseListener) overlay;
            listener.mouseClicked(e);
            if (e.isConsumed()) {
                return;
            }
        }
    }
}
Also used : MouseListener(java.awt.event.MouseListener) JComponent(javax.swing.JComponent) Component(java.awt.Component)

Example 39 with MouseListener

use of java.awt.event.MouseListener in project com.revolsys.open by revolsys.

the class MouseOverlay method mouseReleased.

@Override
public void mouseReleased(final MouseEvent e) {
    updateEventPoint(e);
    requestFocusInWindow();
    for (final Component overlay : getOverlays()) {
        if (overlay instanceof MouseListener) {
            final MouseListener listener = (MouseListener) overlay;
            listener.mouseReleased(e);
            if (e.isConsumed()) {
                return;
            }
        }
    }
}
Also used : MouseListener(java.awt.event.MouseListener) JComponent(javax.swing.JComponent) Component(java.awt.Component)

Example 40 with MouseListener

use of java.awt.event.MouseListener in project com.revolsys.open by revolsys.

the class MouseOverlay method mouseExited.

@Override
public void mouseExited(final MouseEvent event) {
    MouseOverlay.x = -1;
    MouseOverlay.y = -1;
    MouseOverlay.point = GeometryFactory.DEFAULT_3D.point();
    this.mapPanel.mouseExitedCloseSelected(event);
    for (final Component overlay : getOverlays()) {
        if (overlay instanceof MouseListener) {
            final MouseListener listener = (MouseListener) overlay;
            listener.mouseExited(event);
            if (event.isConsumed()) {
                return;
            }
        }
    }
}
Also used : MouseListener(java.awt.event.MouseListener) JComponent(javax.swing.JComponent) Component(java.awt.Component)

Aggregations

MouseListener (java.awt.event.MouseListener)104 MouseEvent (java.awt.event.MouseEvent)67 Dimension (java.awt.Dimension)21 JLabel (javax.swing.JLabel)20 MouseAdapter (java.awt.event.MouseAdapter)19 JPanel (javax.swing.JPanel)16 Component (java.awt.Component)14 JComponent (javax.swing.JComponent)14 ActionEvent (java.awt.event.ActionEvent)13 ActionListener (java.awt.event.ActionListener)11 MouseMotionListener (java.awt.event.MouseMotionListener)11 JButton (javax.swing.JButton)11 JScrollPane (javax.swing.JScrollPane)11 Insets (java.awt.Insets)8 BorderLayout (java.awt.BorderLayout)7 Color (java.awt.Color)7 Point (java.awt.Point)7 File (java.io.File)7 ImageIcon (javax.swing.ImageIcon)6 JCheckBox (javax.swing.JCheckBox)6