Example usage for java.awt AWTEvent MOUSE_EVENT_MASK

List of usage examples for java.awt AWTEvent MOUSE_EVENT_MASK

Introduction

In this page you can find the example usage for java.awt AWTEvent MOUSE_EVENT_MASK.

Prototype

long MOUSE_EVENT_MASK

To view the source code for java.awt AWTEvent MOUSE_EVENT_MASK.

Click Source Link

Document

The event mask for selecting mouse events.

Usage

From source file:javazoom.jlgui.player.amp.Player.java

/**
 * Instantiate Exit Panel with ActiveComponent.
 * Add them to window and ActionListener.
 *///from   ww w.  j a  v a2 s .c  o m
protected void setExitPanel() {
    int l = 0;
    acExit = new ActiveComponent(releasedExitIm[0], pressedExitIm[0], AWTEvent.MOUSE_EVENT_MASK);
    acExit.setLocation(exitLocation[l++], exitLocation[l++]);
    add(acExit);
    acExit.setActionCommand("Exit");
    acExit.addActionListener(this);
}

From source file:javazoom.jlgui.player.amp.Player.java

/**
 * Instantiate Minimize Panel with ActiveComponent.
 * Add them to window and ActionListener.
 *//*from ww w. j  a v  a 2s  .  c  o  m*/
protected void setMinimizePanel() {
    int l = 0;
    acMinimize = new ActiveComponent(releasedMinimizeIm[0], pressedMinimizeIm[0], AWTEvent.MOUSE_EVENT_MASK);
    acMinimize.setLocation(minimizeLocation[l++], minimizeLocation[l++]);
    add(acMinimize);
    acMinimize.setActionCommand("Minimize");
    acMinimize.addActionListener(this);
}

From source file:javazoom.jlgui.player.amp.Player.java

/**
 * Instantiate Volume/Balance Panel with ActiveComponent.
 * Add them to window and ActionListener.
 *//*w  w w  .jav  a 2s  .  c  om*/
protected void setVolumeBalancePanel(int vheight, int bheight) {
    // Volume.
    int l = 0;
    if (vheight > 0)
        acVolume = new ActiveComponent(releasedVolumeImage[0], pressedVolumeImage[0],
                AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK);
    else
        acVolume = new InvisibleActiveComponent(releasedVolumeImage[0], pressedVolumeImage[0],
                AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK);
    acVolume.setLocation(volumeLocation[l++], volumeLocation[l++]);
    add((Component) acVolume);
    acVolume.setActionCommand("Volume");
    acVolume.addActionListener(this);
    for (int k = 0; k < volumeImage.length; k++) {
        volumeImage[k] = (new Taftb(fakeIndex, imVolume, 68, 13, 2, "" + fakeIndex.charAt(k))).getBanner();
    }
    offScreenGraphics.drawImage(
            volumeImage[(int) Math.round(((double) gainValue / (double) maxGain) * (volumeImage.length - 1))],
            volumeBarLocation[0], volumeBarLocation[1], this);

    // Balance
    Image cropBalance = createImage(37, 418);
    Graphics g = cropBalance.getGraphics();
    g.drawImage(imBalance, 0, 0, 37, 418, 9, 0, 9 + 37, 0 + 418, null);

    l = 0;
    if (bheight > 0)
        acBalance = new ActiveComponent(releasedBalanceImage[0], pressedBalanceImage[0],
                AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK);
    else
        acBalance = new InvisibleActiveComponent(releasedBalanceImage[0], pressedBalanceImage[0],
                AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK);
    acBalance.setLocation(balanceLocation[l++], balanceLocation[l++]);
    add((Component) acBalance);
    acBalance.setActionCommand("Balance");
    acBalance.addActionListener(this);
    for (int k = 0; k < balanceImage.length; k++) {
        balanceImage[k] = (new Taftb(fakeIndex, cropBalance, 37, 13, 2, "" + fakeIndex.charAt(k))).getBanner();
    }
    offScreenGraphics.drawImage(
            balanceImage[(int) Math
                    .round(((double) Math.abs(balanceValue) / (double) 1) * (balanceImage.length - 1))],
            balanceBarLocation[0], balanceBarLocation[1], this);
}

From source file:javazoom.jlgui.player.amp.PlayerApplet.java

/**
 * Instantiate Title Panel with ActiveComponent.
 * Add them to window and ActionListener.
 *//*from w  w  w . j  av a 2s .com*/
protected void setTitleBarPanel() {
    int l = 0;
    acTitleBar = new ActiveComponent(releasedTitleIm[0], pressedTitleIm[0],
            AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK);
    // TODO - Title bar disabled.
    acTitleBar.setEnabled(false);
    acTitleBar.setLocation(titleBarLocation[l++], titleBarLocation[l++]);
    add(acTitleBar);
    acTitleBar.setActionCommand("TitleBar");
    acTitleBar.addActionListener(this);
}

From source file:javazoom.jlgui.player.amp.PlayerApplet.java

/**
 * Instantiate Exit Panel with ActiveComponent.
 * Add them to window and ActionListener.
 *//*from   w  ww .j  av  a2s .co  m*/
protected void setExitPanel() {
    int l = 0;
    acExit = new ActiveComponent(releasedExitIm[0], pressedExitIm[0], AWTEvent.MOUSE_EVENT_MASK);
    // TODO - Exit disabled
    acExit.setEnabled(false);
    acExit.setLocation(exitLocation[l++], exitLocation[l++]);
    add(acExit);
    acExit.setActionCommand("Exit");
    acExit.addActionListener(this);
}

From source file:javazoom.jlgui.player.amp.PlayerApplet.java

/**
 * Instantiate Minimize Panel with ActiveComponent.
 * Add them to window and ActionListener.
 *///from w  w  w .java  2s .  com
protected void setMinimizePanel() {
    int l = 0;
    acMinimize = new ActiveComponent(releasedMinimizeIm[0], pressedMinimizeIm[0], AWTEvent.MOUSE_EVENT_MASK);
    //   TODO - Minimize disabled
    acMinimize.setEnabled(false);
    acMinimize.setLocation(minimizeLocation[l++], minimizeLocation[l++]);
    add(acMinimize);
    acMinimize.setActionCommand("Minimize");
    acMinimize.addActionListener(this);
}

From source file:javazoom.jlgui.player.amp.Player.java

/**
 * Instantiate PosBar Panel with ActiveComponent.
 * Add them to window and ActionListener.
 */// ww  w.j  a v a2s .  c  o m
protected void setPosBarPanel() {
    int l = 0;
    acPosBar = new ActiveComponent(releasedPosIm[0], pressedPosIm[0],
            AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK);
    acPosBar.setLocation(posBarLocation[l++], posBarLocation[l++]);
    add(acPosBar);
    acPosBar.setActionCommand("Seek");
    acPosBar.addActionListener(this);
    remove(acPosBar);
}

From source file:javazoom.jlgui.player.amp.Player.java

/**
 * Instantiate EPSR Buttons Panel with ActiveComponent.
 * Add them to window and ActionListener.
 *///w  w w . j  a  v  a 2s . c om
protected void setEPSRButtonsPanel() {
    int l = 0;
    setLayout(null);
    acEqualizer = new ActiveComponent(releasedEPSRImage[0], pressedEPSRImage[0], AWTEvent.MOUSE_EVENT_MASK,
            true, config.isEqualizerEnabled());
    acEqualizer.setLocation(panelEPSRLocation[l++], panelEPSRLocation[l++]);
    add(acEqualizer);
    acEqualizer.setActionCommand("Equalizer");
    acEqualizer.addActionListener(this);

    acPlaylist = new ActiveComponent(releasedEPSRImage[1], pressedEPSRImage[1], AWTEvent.MOUSE_EVENT_MASK, true,
            config.isPlaylistEnabled());
    acPlaylist.setLocation(panelEPSRLocation[l++], panelEPSRLocation[l++]);
    add(acPlaylist);
    acPlaylist.setActionCommand("Playlist");
    acPlaylist.addActionListener(this);

    acShuffle = new ActiveComponent(releasedEPSRImage[2], pressedEPSRImage[2], AWTEvent.MOUSE_EVENT_MASK, true,
            config.isShuffleEnabled());
    acShuffle.setLocation(panelEPSRLocation[l++], panelEPSRLocation[l++]);
    add(acShuffle);
    acShuffle.setActionCommand("Shuffle");
    acShuffle.addActionListener(this);

    acRepeat = new ActiveComponent(releasedEPSRImage[3], pressedEPSRImage[3], AWTEvent.MOUSE_EVENT_MASK, true,
            config.isRepeatEnabled());
    acRepeat.setLocation(panelEPSRLocation[l++], panelEPSRLocation[l++]);
    add(acRepeat);
    acRepeat.setActionCommand("Repeat");
    acRepeat.addActionListener(this);
}

From source file:net.sourceforge.squirrel_sql.fw.gui.debug.DebugEventListener.java

public void setEnabled(boolean enable) {
    Toolkit kit = Toolkit.getDefaultToolkit();
    if (enable) {
        /* register as a listener for mouse events */
        kit.addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);

        /* show all tooltips for ten seconds before hiding */
        ToolTipManager.sharedInstance().setDismissDelay(10000);
    } else {/*from www  .ja va  2s .  com*/
        kit.removeAWTEventListener(this);
    }
}

From source file:org.eclipse.jubula.rc.javafx.driver.RobotJavaFXImpl.java

/**
 * Clicks at the current mouse position.
 *
 * @param graphicsComp//from   w w  w .  j  a v  a  2 s . c  om
 *            The component used for confirming the click.
 * @param clickOp
 *            Configuration for the click.
 */
private void clickImpl(Object graphicsComp, ClickOptions clickOp) {

    int buttonMask = getButtonMask(clickOp.getMouseButton());
    int clickCount = clickOp.getClickCount();
    int[] modifierMask = getModifierMask(clickOp.getClickModifier());
    if (clickCount > 0) {
        IRobotEventConfirmer confirmer = null;
        if (clickOp.isConfirmClick()) {
            InterceptorOptions options = new InterceptorOptions(new long[] { AWTEvent.MOUSE_EVENT_MASK });
            confirmer = m_interceptor.intercept(options);
        }
        try {
            pressModifier(modifierMask);
            RobotTiming.sleepPreClickDelay();

            for (int i = 0; i < clickCount; i++) {
                m_robot.mousePress(buttonMask);
                RobotTiming.sleepPostMouseDownDelay();

                m_robot.mouseRelease(buttonMask);
                RobotTiming.sleepPostMouseUpDelay();
            }
            if (confirmer != null) {
                confirmer.waitToConfirm(null, new ClickJavaFXEventMatcher(clickOp));
            }
        } finally {
            releaseModifier(modifierMask);
        }
    }
}