()
| 363 | |
| 364 | |
| 365 | private void setButtonBounds() { |
| 366 | int top = (sizeH - Preferences.BUTTON_HEIGHT) / 2; |
| 367 | int eachButton = Preferences.GUI_SMALL + Preferences.BUTTON_WIDTH; |
| 368 | |
| 369 | int cancelLeft = sizeW - eachButton; |
| 370 | int noLeft = cancelLeft - eachButton; |
| 371 | int yesLeft = noLeft - eachButton; |
| 372 | |
| 373 | cancelButton.setLocation(cancelLeft, top); |
| 374 | okButton.setLocation(noLeft, top); |
| 375 | progressBar.setLocation(noLeft, top); |
| 376 | |
| 377 | cancelButton.setSize(Preferences.BUTTON_WIDTH, Preferences.BUTTON_HEIGHT); |
| 378 | okButton.setSize(Preferences.BUTTON_WIDTH, Preferences.BUTTON_HEIGHT); |
| 379 | progressBar.setSize(2 * Preferences.BUTTON_WIDTH, Preferences.BUTTON_HEIGHT); |
| 380 | |
| 381 | // edit field height is awkward, and very different between mac and pc, |
| 382 | // so use at least the preferred height for now. |
| 383 | int editWidth = 2 * Preferences.BUTTON_WIDTH; |
| 384 | int editHeight = editField.getPreferredSize().height; |
| 385 | int editTop = (1 + sizeH - editHeight) / 2; // add 1 for ceil |
| 386 | editField.setBounds(yesLeft - Preferences.BUTTON_WIDTH, editTop, editWidth, editHeight); |
| 387 | progressBar.setBounds(noLeft, editTop, editWidth, editHeight); |
| 388 | |
| 389 | Dimension copyErrorButtonSize = copyErrorButton.getPreferredSize(); |
| 390 | copyErrorButton.setLocation(sizeW - copyErrorButtonSize.width - 5, top); |
| 391 | copyErrorButton.setSize(copyErrorButtonSize.width, Preferences.BUTTON_HEIGHT); |
| 392 | } |
| 393 | |
| 394 | public Dimension getPreferredSize() { |
| 395 | return getMinimumSize(); |
no test coverage detected