| 44 | | if (dlg.getWidth() > 600) |
| 45 | | dlg.setSize(600, dlg.getHeight()); |
| 46 | | if (dlg.getHeight() > 600) |
| 47 | | dlg.setSize(dlg.getWidth(),600); |
| | 46 | // if (dlg.getWidth() > 600) |
| | 47 | // dlg.setSize(600, dlg.getHeight()); |
| | 48 | // if (dlg.getHeight() > 600) |
| | 49 | // dlg.setSize(dlg.getWidth(),600); |
| | 51 | int JOSMWidth = Main.parent.getWidth(); |
| | 52 | int JOSMHeight = Main.parent.getHeight(); |
| | 53 | |
| | 54 | if (JOSMWidth > 2000 && JOSMWidth > JOSMHeight * 2) |
| | 55 | // don't center on horizontal span monitor configurations (yes, can be selfish sometimes) |
| | 56 | JOSMWidth /= 2; |
| | 57 | |
| | 58 | int targetWidth = JOSMWidth / 2; |
| | 59 | if (targetWidth < 600) targetWidth = 600; |
| | 60 | if (targetWidth > 1200) targetWidth = 1200; |
| | 61 | int targetHeight = (JOSMHeight * 3) / 4; |
| | 62 | if (targetHeight < 600) targetHeight = 600; |
| | 63 | if (targetHeight > 1200) targetHeight = 1200; |
| | 64 | |
| | 65 | int targetX = Main.parent.getX() + JOSMWidth / 2 - targetWidth / 2; |
| | 66 | int targetY = Main.parent.getY() + JOSMHeight / 2 - targetHeight / 2; |
| | 67 | |
| | 68 | dlg.setBounds(targetX, targetY, targetWidth, targetHeight); |
| | 69 | |