Create a fresh editor state object from the default screen device and set its placement relative to the last opened window. @param editors List of active editor objects
(List<Editor> editors)
| 76 | * @param editors List of active editor objects |
| 77 | */ |
| 78 | static public EditorState nextEditor(List<Editor> editors) { |
| 79 | Editor lastEditor = null; |
| 80 | int editorCount = editors.size(); |
| 81 | if (editorCount > 0) { |
| 82 | lastEditor = editors.get(editorCount-1); |
| 83 | } |
| 84 | |
| 85 | // update lastConfig so it can be set for this Editor and |
| 86 | // for the next Editor created if the last window is closed. |
| 87 | if (lastEditor != null) { |
| 88 | lastConfig = lastEditor.getGraphicsConfiguration(); |
| 89 | } |
| 90 | if (lastConfig == null) { |
| 91 | lastConfig = getDefaultConfig(); |
| 92 | } |
| 93 | |
| 94 | EditorState outgoing = new EditorState(); |
| 95 | outgoing.initLocation(lastConfig, lastEditor); |
| 96 | return outgoing; |
| 97 | } |
| 98 | |
| 99 | |
| 100 | public String toString() { |
no test coverage detected