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

Method rename

ij/src/main/java/ij/text/TextPanel.java:686–729  ·  view source on GitHub ↗
(String title2)

Source from the content-addressed store, hash-verified

684 }
685
686 @AstroImageJ(reason = "Add check for AIJ windows", modified = true)
687 void rename(String title2) {
688 ResultsTable rt2 = getOrCreateResultsTable();
689 if (rt2==null)
690 return;
691 if (title2!=null && title2.equals(""))
692 title2 = null;
693 TextWindow tw = getTextWindow();
694 if (tw==null)
695 return;
696 if (title2==null) {
697 GenericDialog gd = new GenericDialog("Rename", tw);
698 gd.addStringField("Title:", tw.getTitle().contains("Measure") ? tw.getTitle()+"_2" : "Results2", 40);
699 gd.showDialog();
700 if (gd.wasCanceled())
701 return;
702 title2 = gd.getNextString();
703 }
704 String title1 = title;
705 if (title!=null && title.equals("Results")) {
706 IJ.setTextPanel(null);
707 Analyzer.setUnsavedMeasurements(false);
708 Analyzer.setResultsTable(null);
709 Analyzer.resetCounter();
710 }
711 if (title2.equals("Results")) {
712 //tw.setVisible(false);
713 tw.dispose();
714 WindowManager.removeWindow(tw);
715 flush();
716 rt2.show("Results");
717 } else {
718 tw.setTitle(title2);
719 title = title2;
720 rt2.show(title);
721 }
722 Menus.updateWindowMenuItem(title1, title2);
723 if (IJ.recording()) {
724 if (Recorder.scriptMode())
725 Recorder.recordString("IJ.renameResults(\""+title1+"\", \""+title2+"\");\n");
726 else
727 Recorder.record("Table.rename", title1, title2);
728 }
729 }
730
731 @AstroImageJ(reason = "Add check for AIJ windows", modified = true)
732 void duplicate() {

Callers 1

doCommandMethod · 0.95

Calls 15

getTextWindowMethod · 0.95
addStringFieldMethod · 0.95
showDialogMethod · 0.95
wasCanceledMethod · 0.95
getNextStringMethod · 0.95
setTextPanelMethod · 0.95
setResultsTableMethod · 0.95
resetCounterMethod · 0.95
removeWindowMethod · 0.95
flushMethod · 0.95

Tested by

no test coverage detected