Updates the control panel. @param comp component to be updated @param show true if component is visible @param layout component layout
(final JComponent comp, final boolean show, final String layout)
| 578 | * @param layout component layout |
| 579 | */ |
| 580 | void updateControl(final JComponent comp, final boolean show, final String layout) { |
| 581 | if(comp == status) { |
| 582 | if(show) top.add(comp, layout); |
| 583 | else top.remove(comp); |
| 584 | } else if(comp == menu) { |
| 585 | if(!show) menuHeight = menu.getHeight(); |
| 586 | final int s = show ? menuHeight : 0; |
| 587 | comp.setPreferredSize(new Dimension(comp.getPreferredSize().width, s)); |
| 588 | menu.setSize(menu.getWidth(), s); |
| 589 | } else if(show) { |
| 590 | control.add(comp, layout); |
| 591 | } else { |
| 592 | control.remove(comp); |
| 593 | } |
| 594 | setContentBorder(); |
| 595 | final Component frame = fullscr == null ? getRootPane() : fullscr; |
| 596 | frame.validate(); |
| 597 | refreshControls(false); |
| 598 | } |
| 599 | |
| 600 | /** |
| 601 | * Updates the view layout. |
no test coverage detected