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

Method setTitle

ij/src/main/java/ij/ImagePlus.java:1301–1322  ·  view source on GitHub ↗

Sets the image name.

(String title)

Source from the content-addressed store, hash-verified

1299
1300 /** Sets the image name. */
1301 public void setTitle(String title) {
1302 if (title==null)
1303 return;
1304 if (win!=null) {
1305 if (ij!=null)
1306 Menus.updateWindowMenuItem(this, this.title, title);
1307 String virtual = stack!=null && stack.isVirtual()?" (V)":"";
1308 String global = getGlobalCalibration()!=null?" (G)":"";
1309 String scale = "";
1310 double magnification = win.getCanvas().getMagnification();
1311 if (magnification!=1.0) {
1312 double percent = magnification*100.0;
1313 int digits = percent>100.0||percent==(int)percent?0:1;
1314 scale = " (" + IJ.d2s(percent,digits) + "%)";
1315 }
1316 win.setTitle(title+virtual+global+scale);
1317 }
1318 boolean titleChanged = !title.equals(this.title);
1319 this.title = title;
1320 if (titleChanged && listeners.size()>0)
1321 notifyListeners(UPDATED);
1322 }
1323
1324 /** Returns the width of this image in pixels. */
1325 public int getWidth() {

Callers 15

setImageMethod · 0.95
setProcessor2Method · 0.95
revertMethod · 0.95
cropMethod · 0.95
copyAttributesMethod · 0.95
flattenMethod · 0.95
saveMethod · 0.95
repaintImageWindowsMethod · 0.95
mergeStacksMethod · 0.95
runMethod · 0.95
renameMethod · 0.95

Calls 9

updateWindowMenuItemMethod · 0.95
getGlobalCalibrationMethod · 0.95
d2sMethod · 0.95
notifyListenersMethod · 0.95
isVirtualMethod · 0.45
getMagnificationMethod · 0.45
getCanvasMethod · 0.45
equalsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected