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

Method printToWindow

ij/src/main/java/ij/macro/Functions.java:3853–3880  ·  view source on GitHub ↗
(String s)

Source from the content-addressed store, hash-verified

3851 }
3852
3853 void printToWindow(String s) {
3854 String title = s.substring(1, s.length()-1);
3855 String s2 = getLastString();
3856 boolean isCommand = s2.startsWith("\\");
3857 Frame frame = WindowManager.getFrame(title);
3858 if (frame==null)
3859 interp.error("Window not found");
3860 boolean isEditor = frame instanceof Editor;
3861 if (!(isEditor || frame instanceof TextWindow))
3862 interp.error("Window is not text window");
3863 if (isEditor) {
3864 Editor ed = (Editor)frame;
3865 ed.setIsMacroWindow(true);
3866 if (isCommand)
3867 handleEditorCommand(ed, s2);
3868 else
3869 ed.append(s2);
3870 } else {
3871 TextWindow tw = (TextWindow)frame;
3872 if (isCommand)
3873 handleTextWindowCommand(tw, s2);
3874 else {
3875 tw.append(s2);
3876 TextPanel tp = tw.getTextPanel();
3877 if (tp!=null) tp.setResultsTable(null);
3878 }
3879 }
3880 }
3881
3882 void handleEditorCommand(Editor ed, String s) {
3883 if (s.startsWith("\\Update:")) {

Callers 1

printMethod · 0.95

Calls 13

getLastStringMethod · 0.95
getFrameMethod · 0.95
setIsMacroWindowMethod · 0.95
handleEditorCommandMethod · 0.95
appendMethod · 0.95
appendMethod · 0.95
getTextPanelMethod · 0.95
setResultsTableMethod · 0.95
substringMethod · 0.80
startsWithMethod · 0.80
lengthMethod · 0.65

Tested by

no test coverage detected