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

Method print

ij/src/main/java/ij/macro/Functions.java:3821–3851  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3819 }
3820
3821 @AstroImageJ(reason = "Move printToWindow invocation to the render thread", modified = true)
3822 void print() {
3823 interp.inPrint = true;
3824 String s = getFirstString();
3825 if (interp.nextToken()==',') {
3826 if (s.startsWith("[") && s.endsWith("]")) {
3827 String finalS = s;
3828 eventCallWait(() -> printToWindow(finalS));
3829 return;
3830 } else if (s.equals("~0~")) {
3831 if (writer==null)
3832 interp.error("File not open");
3833 String s2 = getLastString();
3834 if (s2.endsWith("\n"))
3835 writer.print(s2);
3836 else
3837 writer.println(s2);
3838 interp.inPrint = false;
3839 return;
3840 }
3841 StringBuffer sb = new StringBuffer(s);
3842 do {
3843 sb.append(" ");
3844 sb.append(getNextString());
3845 } while (interp.nextToken()==',');
3846 s = sb.toString();
3847 }
3848 interp.getRightParen();
3849 interp.log(s);
3850 interp.inPrint = false;
3851 }
3852
3853 void printToWindow(String s) {
3854 String title = s.substring(1, s.length()-1);

Callers 5

doFunctionMethod · 0.95
sendArgumentMethod · 0.45
main0Method · 0.45
writeMethod · 0.45
copyToClipboardMethod · 0.45

Calls 14

getFirstStringMethod · 0.95
eventCallWaitMethod · 0.95
printToWindowMethod · 0.95
getLastStringMethod · 0.95
getNextStringMethod · 0.95
startsWithMethod · 0.80
printlnMethod · 0.80
getRightParenMethod · 0.80
appendMethod · 0.65
nextTokenMethod · 0.45
equalsMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected