MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / insertWindowMenuItem

Method insertWindowMenuItem

ij/src/main/java/ij/Menus.java:1439–1454  ·  view source on GitHub ↗

Inserts one item (a non-image window) into the Window menu.

(Window win)

Source from the content-addressed store, hash-verified

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) {

Callers 1

addWindowMethod · 0.95

Calls 2

getTitleMethod · 0.65
insertMethod · 0.45

Tested by

no test coverage detected