61 | | 4. & 5. are similar in that they are both related to the PageWorkArea. After discussions with Bo Yan, we decided to, as a first pass, simply center the PageWorkArea in the window, as the PageWorkArea grows to encompass the page and all frames. However, this won't work because the PageWorkArea has a later for the page and its frames, and other layers for halos and such. So, we can offset all layers, or think of a better approach. One such approach is to consider making modifying the PageWorkArea sizing logic to expand to its parent, if the parent is larger of course. |
| 61 | After several days of looking at this problem, and trying out milo's "last resort" idea of hiding the window, I have come up with the following design concept (I cannot give exact specifics, or the implementation would be complete <g>) |
| 63 | 3.1 - Add a method named show() to DefaultDocumentWindow that shows the document window and makes sure it is not iconified. I'd put a UML document here but I am not sure if I need to do a full UML for the class or only my changes. I could not get into the server to look at examples. |
| 64 | |
| 65 | 3.2 - When the swing frame is iconified in DefaultDocumentWindow, make sure Sophie knows it is deselected by calling userActs. This is important as the desktop panes only use swing calls to iconify/deiconify the window. Also, set the window's visible to false so it does not show on the desktop. |
| 66 | |
| 67 | 3.3 - When the swing frame is decionified in DefaultDocumentWindow, make sure Sophie knows it is selected by calling userActs. This is important as the desktop panes only use swing calls to iconify/deiconify the window. |
| 68 | |
| 69 | 3.4 - In BookLogic, when a book is selected, make sure it's window is told to show(). This ensures that anything in Sophie that selects a book (ie a click, or a menu item) makes sure that the window for the newly selected book is deiconified and showing. |
| 70 | |
| 71 | 3.5 - Consider adding select to show() as well, so newly selected books also have selected windows |
| 72 | |
| 73 | 3.6 Comments - The iconification is handled by the current look and feel, triggered by the look and feel minimize button (or in the case of the tab bar, the show desktop button, which walks all frames (windows) and calls setIcon(true). Simply hiding or showing the frame is not acceptable as it does not maintain a separate state of the window. Currently the plan is to figure out how to change the look and feel's iconify behavior. WindowListener iconify events are only called *after* the window is iconified and are intended to be used as a way for the document to release resources, etc and thus not useful for this problem. |
| 74 | |
| 75 | 4. Center the page on the current page work area |
| 76 | |
| 77 | 4.1 Not done yet |
| 78 | |
| 79 | 4.2 Comments - After discussions with Bo Yan, we decided to, as a first pass, simply center the PageWorkArea in the window, as the PageWorkArea grows to encompass the page and all frames. However, this won't work because the PageWorkArea has a later for the page and its frames, and other layers for halos and such. So, we can offset all layers, or think of a better approach. One such approach is to consider making modifying the PageWorkArea sizing logic to expand to its parent, if the parent is larger of course. |
| 80 | |
| 81 | |
| 82 | 5. Change the page work area to consider the size of the book window as well as the page |
| 83 | |
| 84 | 5.1 - Add a call getMinimalBookWindowSize() to BookDocumentWindow that returns the size of the window, but no smaller than the width of the book bottom panel. |
| 85 | |
| 86 | 5.2 - Change the PageWorkArea logic to not only resize itself to the page size, but also it's parent window. See 5.1 |
| 87 | |