| 328 | } |
| 329 | |
| 330 | private static String center(String text, int total) { |
| 331 | int skip = (total - text.length()) / 2; |
| 332 | int rem = total - skip - text.length(); |
| 333 | if (rem > 0 && skip > 0) { |
| 334 | return String.format("%" + skip + "s%s%" + rem + "s", "", text, ""); |
| 335 | } else if (rem > 0) { |
| 336 | return String.format("%s%" + rem + "s", text, ""); |
| 337 | } else if (skip > 0) { |
| 338 | return String.format("%" + skip + "s%s", "", text); |
| 339 | } |
| 340 | return text; |
| 341 | } |
| 342 | |
| 343 | /** |
| 344 | * Shutdown this FSM. Does not take lock; clears all records states, |