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.
()
| 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) { |
no test coverage detected