test/java/awt/TrayIcon/TrayIconMouseTest/TrayIconMouseTest.java

Print this page




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.awt.*;
  25 import java.awt.event.*;
  26 import java.awt.image.BufferedImage;
  27 
  28 /*
  29  * @test
  30  * @summary Check if ActionEvent is triggered by a TrayIcon only when
  31  *          it is double clicked using mouse button 1 (or single clicked
  32  *          with button 3 (on Mac OS X))
  33  * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)

  34  * @library ../../../../lib/testlibrary ../
  35  * @compile/module=java.desktop java/awt/Helper.java
  36  * @build ExtendedRobot SystemTrayIconHelper
  37  * @run main TrayIconMouseTest
  38  */
  39 
  40 public class TrayIconMouseTest {
  41 
  42     TrayIcon icon;
  43     ExtendedRobot robot;
  44 
  45     boolean actionPerformed = false;
  46     Object actionLock = new Object();
  47     static boolean isMacOS = false;
  48 
  49     String caption = "Sample Icon";
  50 
  51     int[] buttonTypes = {
  52         InputEvent.BUTTON1_MASK,
  53         InputEvent.BUTTON2_MASK,
  54         InputEvent.BUTTON3_MASK
  55     };




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.awt.*;
  25 import java.awt.event.*;
  26 import java.awt.image.BufferedImage;
  27 
  28 /*
  29  * @test
  30  * @summary Check if ActionEvent is triggered by a TrayIcon only when
  31  *          it is double clicked using mouse button 1 (or single clicked
  32  *          with button 3 (on Mac OS X))
  33  * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
  34  * @library /java/awt/patchlib
  35  * @library ../../../../lib/testlibrary ../
  36  * @build java.desktop/java.awt.Helper
  37  * @build ExtendedRobot SystemTrayIconHelper
  38  * @run main TrayIconMouseTest
  39  */
  40 
  41 public class TrayIconMouseTest {
  42 
  43     TrayIcon icon;
  44     ExtendedRobot robot;
  45 
  46     boolean actionPerformed = false;
  47     Object actionLock = new Object();
  48     static boolean isMacOS = false;
  49 
  50     String caption = "Sample Icon";
  51 
  52     int[] buttonTypes = {
  53         InputEvent.BUTTON1_MASK,
  54         InputEvent.BUTTON2_MASK,
  55         InputEvent.BUTTON3_MASK
  56     };