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

Method getShortTitle

ij/src/main/java/ij/ImagePlus.java:1285–1298  ·  view source on GitHub ↗

If the image title is a file name, returns the name without the extension and with spaces removed, otherwise returns the title shortened to the first space.

()

Source from the content-addressed store, hash-verified

1283 otherwise returns the title shortened to the first space.
1284 */
1285 public String getShortTitle() {
1286 String title = getTitle().trim();
1287 int index = title.lastIndexOf('.');
1288 boolean fileName = index>0;
1289 if (fileName) {
1290 title = title.substring(0, index);
1291 title = title.replaceAll(" ","");
1292 } else {
1293 index = title.indexOf(' ');
1294 if (index>-1 && !fileName)
1295 title = title.substring(0, index);
1296 }
1297 return title;
1298 }
1299
1300 /** Sets the image name. */
1301 public void setTitle(String title) {

Callers 15

addImageMethod · 0.95
runMethod · 0.95
saveAllMethod · 0.95
runMethod · 0.45
runMethod · 0.45
showDialogMethod · 0.45
doDialogMethod · 0.45
runMethod · 0.45
rebinImageMethod · 0.45
replaceImageMethod · 0.45
rebinGrayscaleImageMethod · 0.45
rebinColorImageMethod · 0.45

Calls 5

getTitleMethod · 0.95
substringMethod · 0.80
replaceAllMethod · 0.80
trimMethod · 0.45
indexOfMethod · 0.45

Tested by

no test coverage detected