setBounds method is overridden to force the note to stay on the screen @param x x @param y y @param width width @param height height
(int x, int y, int width, int height)
| 589 | * @param height height |
| 590 | */ |
| 591 | @Override |
| 592 | public void setBounds(int x, int y, int width, int height) { |
| 593 | if (preferredLocation == null) { //for some odd fucking reason, this can happen on some versions of java |
| 594 | preferredLocation = new Point(0, 0); |
| 595 | } |
| 596 | preferredLocation.x = x; |
| 597 | preferredLocation.y = y; |
| 598 | Dimension s = Main.getExtendedScreenResolution(); |
| 599 | if (x + 60 * Main.SCALE > s.width) { |
| 600 | x = (int) (s.width - 60 * Main.SCALE); |
| 601 | } |
| 602 | if (y + 60 * Main.SCALE > s.height) { |
| 603 | y = (int) (s.height - 60 * Main.SCALE); |
| 604 | } |
| 605 | super.setBounds(x, y, width, height); |
| 606 | } |
| 607 | |
| 608 | /** |
| 609 | * setBounds method is overridden to force the note to stay on the screen |
no test coverage detected