Inserts one item (a non-image window) into the Window menu.
(Window win)
| 1437 | |
| 1438 | /** Inserts one item (a non-image window) into the Window menu. */ |
| 1439 | static synchronized void insertWindowMenuItem(Window win) { |
| 1440 | if (ij==null || win==null) |
| 1441 | return; |
| 1442 | String title = win instanceof Frame?((Frame)win).getTitle():((Dialog)win).getTitle(); |
| 1443 | CheckboxMenuItem item = new CheckboxMenuItem(title); |
| 1444 | item.addItemListener(ij); |
| 1445 | int index = WINDOW_MENU_ITEMS+windowMenuItems2; |
| 1446 | if (windowMenuItems2>=2) |
| 1447 | index--; |
| 1448 | window.insert(item, index); |
| 1449 | windowMenuItems2++; |
| 1450 | if (windowMenuItems2==1) { |
| 1451 | window.insertSeparator(WINDOW_MENU_ITEMS+windowMenuItems2); |
| 1452 | windowMenuItems2++; |
| 1453 | } |
| 1454 | } |
| 1455 | |
| 1456 | /** Adds one image to the end of the Window menu. */ |
| 1457 | static synchronized void addWindowMenuItem(ImagePlus imp) { |