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

Method addLuts

ij/src/main/java/ij/Menus.java:529–552  ·  view source on GitHub ↗
(Menu submenu)

Source from the content-addressed store, hash-verified

527 }
528
529 static void addLuts(Menu submenu) {
530 String path = IJ.getDirectory("luts");
531 if (path==null) return;
532 File f = new File(path);
533 String[] list = null;
534 if (applet==null && f.exists() && f.isDirectory())
535 list = f.list();
536 if (list==null) return;
537 if (IJ.isLinux() || IJ.isMacOSX())
538 Arrays.sort(list);
539 submenu.addSeparator();
540 for (int i=0; i<list.length; i++) {
541 String name = list[i];
542 if (name.endsWith(".lut")) {
543 name = name.substring(0,name.length()-4);
544 if (name.contains("_") && !name.contains(" "))
545 name = name.replace("_", " ");
546 MenuItem item = new MenuItem(name);
547 submenu.add(item);
548 item.addActionListener(ij);
549 nPlugins++;
550 }
551 }
552 }
553
554 static void addPluginItem(Menu submenu, String s) {
555 if (s.startsWith("\"-\"")) {

Callers 1

addSubMenuMethod · 0.95

Calls 13

getDirectoryMethod · 0.95
isLinuxMethod · 0.95
isMacOSXMethod · 0.95
substringMethod · 0.80
addActionListenerMethod · 0.80
lengthMethod · 0.65
addMethod · 0.65
existsMethod · 0.45
listMethod · 0.45
sortMethod · 0.45
addSeparatorMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected