Sets the image name.
(String title)
| 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() { |
no test coverage detected