(int duration)
| 1189 | } |
| 1190 | |
| 1191 | private void hide(int duration) { |
| 1192 | final Container cnt = CN.getCurrentForm().getFormLayeredPane(Sheet.class, true); |
| 1193 | setX(getHiddenX(cnt)); |
| 1194 | setY(getHiddenY(cnt)); |
| 1195 | cnt.animateUnlayout(duration, 255, new Runnable() { |
| 1196 | @Override |
| 1197 | public void run() { |
| 1198 | Container parent = cnt.getParent(); |
| 1199 | |
| 1200 | if (parent != null && parent.getComponentForm() != null) { |
| 1201 | cnt.remove(); |
| 1202 | Form parentForm = parent.getComponentForm(); |
| 1203 | parentForm.revalidateLater(); |
| 1204 | // revalidateLater() only schedules work for the next |
| 1205 | // paint cycle, but cnt.remove() does not by itself wake |
| 1206 | // the EDT, so without an explicit repaint here the |
| 1207 | // form's dim overlay remains on screen until the next |
| 1208 | // user input. See issue #4899. |
| 1209 | parentForm.repaint(); |
| 1210 | fireCloseEvent(true); |
| 1211 | stopTrackingBounds(); |
| 1212 | |
| 1213 | |
| 1214 | } |
| 1215 | |
| 1216 | } |
| 1217 | }); |
| 1218 | |
| 1219 | } |
| 1220 | |
| 1221 | /// Animates the sheet from its current (mid-drag) position to the off-screen |
| 1222 | /// hidden position and then disposes it. Unlike `#hide(int)` this does not |
no test coverage detected