(MouseEvent e)
| 357 | |
| 358 | |
| 359 | private void handleMouse(MouseEvent e) { |
| 360 | int x = e.getX(); |
| 361 | int y = e.getY(); |
| 362 | |
| 363 | if (currentRollover != -1) { |
| 364 | if ((x > x1[currentRollover]) && (y > y1) && |
| 365 | (x < x2[currentRollover]) && (y < y2)) { |
| 366 | return; |
| 367 | |
| 368 | } else { |
| 369 | setState(currentRollover, INACTIVE, true); |
| 370 | currentRollover = -1; |
| 371 | } |
| 372 | } |
| 373 | int sel = findSelection(x, y); |
| 374 | if (sel == -1) return; |
| 375 | |
| 376 | if (state[sel] != ACTIVE) { |
| 377 | setState(sel, ROLLOVER, true); |
| 378 | currentRollover = sel; |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | |
| 383 | private int findSelection(int x, int y) { |
no test coverage detected