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

Method installStartupMacros

ij/src/main/java/ij/gui/Toolbar.java:1636–1662  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1634 }
1635
1636 private void installStartupMacros() {
1637 resetTools();
1638 String path = IJ.getDir("macros")+"StartupMacros.txt";
1639 File f = new File(path);
1640 if (!f.exists()) {
1641 path = IJ.getDir("macros")+"StartupMacros.ijm";
1642 f = new File(path);
1643 }
1644 if (!f.exists()) {
1645 path = IJ.getDir("macros")+"StartupMacros.fiji.ijm";
1646 f = new File(path);
1647 }
1648 if (!f.exists()) {
1649 IJ.error("StartupMacros not found in\n \n"+IJ.getDir("macros"));
1650 return;
1651 }
1652 if (IJ.shiftKeyDown()) {
1653 IJ.open(path);
1654 IJ.setKeyUp(KeyEvent.VK_SHIFT);
1655 } else {
1656 try {
1657 MacroInstaller mi = new MacroInstaller();
1658 mi.installFile(path);
1659 } catch
1660 (Exception ex) {}
1661 }
1662 }
1663
1664 public void actionPerformed(ActionEvent e) {
1665 MenuItem item = (MenuItem)e.getSource();

Callers 2

itemStateChangedMethod · 0.95
restoreToolsMethod · 0.95

Calls 8

resetToolsMethod · 0.95
getDirMethod · 0.95
errorMethod · 0.95
shiftKeyDownMethod · 0.95
openMethod · 0.95
setKeyUpMethod · 0.95
installFileMethod · 0.95
existsMethod · 0.45

Tested by

no test coverage detected