104 if (System.getProperty("os.name").indexOf("Sun") != -1 && 105 System.getProperty("os.arch").indexOf("sparc") != -1) { 106 keyTypes = new int[]{ 107 KeyEvent.VK_SHIFT, 108 KeyEvent.VK_CONTROL, 109 KeyEvent.VK_META 110 }; 111 112 keyNames = new String[]{ 113 "SHIFT", 114 "CONTROL", 115 "META" 116 }; 117 keyMasks = new int[]{ 118 KeyEvent.SHIFT_DOWN_MASK, 119 KeyEvent.CTRL_DOWN_MASK, 120 KeyEvent.META_DOWN_MASK 121 }; 122 } 123 124 new TrayIconEventModifiersTest().doTest(); 125 } 126 } 127 128 public TrayIconEventModifiersTest() throws Exception { 129 robot = new ExtendedRobot(); 130 EventQueue.invokeAndWait(this::initializeGUI); 131 } 132 133 private void initializeGUI() { 134 135 SystemTray tray = SystemTray.getSystemTray(); 136 icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), caption); 137 icon.addMouseListener(new MouseAdapter() { 138 public void mousePressed(MouseEvent event) { 139 if (!icon.equals(event.getSource())) 140 throw new RuntimeException("FAIL: mousePressed: MouseEvent.getSource " + 141 "did not return TrayIcon object"); 142 143 mousePressed = true; | 104 if (System.getProperty("os.name").indexOf("Sun") != -1 && 105 System.getProperty("os.arch").indexOf("sparc") != -1) { 106 keyTypes = new int[]{ 107 KeyEvent.VK_SHIFT, 108 KeyEvent.VK_CONTROL, 109 KeyEvent.VK_META 110 }; 111 112 keyNames = new String[]{ 113 "SHIFT", 114 "CONTROL", 115 "META" 116 }; 117 keyMasks = new int[]{ 118 KeyEvent.SHIFT_DOWN_MASK, 119 KeyEvent.CTRL_DOWN_MASK, 120 KeyEvent.META_DOWN_MASK 121 }; 122 } 123 124 if (SystemTrayIconHelper.isOel7()) { 125 System.out.println("OEL 7 doesn't support click modifiers in " + 126 "systray. Skipped"); 127 return; 128 } 129 130 new TrayIconEventModifiersTest().doTest(); 131 } 132 } 133 134 public TrayIconEventModifiersTest() throws Exception { 135 robot = new ExtendedRobot(); 136 EventQueue.invokeAndWait(this::initializeGUI); 137 } 138 139 private void initializeGUI() { 140 141 SystemTray tray = SystemTray.getSystemTray(); 142 icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), caption); 143 icon.addMouseListener(new MouseAdapter() { 144 public void mousePressed(MouseEvent event) { 145 if (!icon.equals(event.getSource())) 146 throw new RuntimeException("FAIL: mousePressed: MouseEvent.getSource " + 147 "did not return TrayIcon object"); 148 149 mousePressed = true; |