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

Method handleLogCommand

ij/src/main/java/ij/IJ.java:651–686  ·  view source on GitHub ↗
(String s)

Source from the content-addressed store, hash-verified

649 }
650
651 static void handleLogCommand(String s) {
652 if (s.equals("\\Closed"))
653 logPanel = null;
654 else if (s.startsWith("\\Update:")) {
655 int n = logPanel.getLineCount();
656 String s2 = s.substring(8, s.length());
657 if (n==0)
658 logPanel.append(s2);
659 else
660 logPanel.setLine(n-1, s2);
661 } else if (s.startsWith("\\Update")) {
662 int cindex = s.indexOf(":");
663 if (cindex==-1)
664 {logPanel.append(s); return;}
665 String nstr = s.substring(7, cindex);
666 int line = (int)Tools.parseDouble(nstr, -1);
667 if (line<0 || line>25)
668 {logPanel.append(s); return;}
669 int count = logPanel.getLineCount();
670 while (line>=count) {
671 log("");
672 count++;
673 }
674 String s2 = s.substring(cindex+1, s.length());
675 logPanel.setLine(line, s2);
676 } else if (s.equals("\\Clear")) {
677 logPanel.clear();
678 } else if (s.startsWith("\\Heading:")) {
679 logPanel.updateColumnHeadings(s.substring(10));
680 } else if (s.equals("\\Close")) {
681 Frame f = WindowManager.getFrame("Log");
682 if (f!=null && (f instanceof TextWindow))
683 ((TextWindow)f).close();
684 } else
685 logPanel.append(s);
686 }
687
688 /** Returns the contents of the Log window or null if the Log window is not open. */
689 public static synchronized String getLog() {

Callers 1

logMethod · 0.95

Calls 14

parseDoubleMethod · 0.95
logMethod · 0.95
getFrameMethod · 0.95
startsWithMethod · 0.80
substringMethod · 0.80
setLineMethod · 0.80
updateColumnHeadingsMethod · 0.80
lengthMethod · 0.65
appendMethod · 0.65
closeMethod · 0.65
equalsMethod · 0.45
getLineCountMethod · 0.45

Tested by

no test coverage detected