| 1518 | |
| 1519 | |
| 1520 | @Override |
| 1521 | public void hideCursor() { |
| 1522 | // Because the OS may have shown the cursor on its own, |
| 1523 | // don't return if 'cursorVisible' is set to true. [rev 0216] |
| 1524 | |
| 1525 | if (invisibleCursor == null) { |
| 1526 | BufferedImage cursorImg = |
| 1527 | new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB); |
| 1528 | // this is a temporary workaround for the CHIP, will be removed |
| 1529 | Dimension cursorSize = Toolkit.getDefaultToolkit().getBestCursorSize(16, 16); |
| 1530 | if (cursorSize.width == 0 || cursorSize.height == 0) { |
| 1531 | invisibleCursor = Cursor.getDefaultCursor(); |
| 1532 | } else { |
| 1533 | invisibleCursor = |
| 1534 | canvas.getToolkit().createCustomCursor(cursorImg, new Point(8, 8), "blank"); |
| 1535 | } |
| 1536 | } |
| 1537 | canvas.setCursor(invisibleCursor); |
| 1538 | cursorVisible = false; |
| 1539 | } |
| 1540 | |
| 1541 | |
| 1542 | @Override |