Version 36 (modified by sriggins, 16 years ago) (diff) |
---|
Analysis
Overview
Book window is responsible for displaying the book. Book window is present in Author app and not in Reader.
Book window has
- Title bar - title bar contains the name of the book and buttons for minimize, restore and close.
- Bottom bar - has zoom, page selector and other controls
Task requirements
- Remove the thick black border of the book window (see if it is reasonable)
- Currently, when part of the book window is behind the right flap ot the bottom of the workspace, it disappears on maximize. See what causes that issue and fix it.
- Minimize button should minimize book to the Opened book tabbar. Currently a new button is created at the bottom of the work area.
- The default position of the page work area should be at the center of the book window.
- If the page work area can be displayed in the book window, it should be at the center of it. Recomputing should be done on mouse drop (if possible). When scrollbars appear, the position should not be recomputed anymore. On book open the page work are should be centered in the book window.
- On change of the size of the book
- On change of the size of the window
- Make the background of the window changable by the skin (optional)
- Define minimum size of the book window, so that scroll bars for the controls (bottom book panel) do not appear.
Task result
Code.
Implementation idea
- JInternalFrame supports the drawing of a title bar in a new java project, but it is not displaying in Sophie.
- computeTitle on BookDocumentWindow
- The border with is currently hard-coded, with a comment from mitex to add this to the skin definition "later" Consider doing this now
- Minimum size of the book should be calculated based on the size of the bottom book panel, so that if the panel is changed, the window reacts properly
- It appears that resizing the book window does not resize the background, and thus the page does not re-center
- Ask if we want a Sophie looking title or the host OS title bar for these windows
- Regarding the centering of the page, the PageWorkArea is a set size based on the size of the page and the JScrollArea on the BookDocument window scrolls that. The page is centered on the PageWorkArea. The PageWorkArea is aligned topLeft. So maybe the PageWorkArea needs to be resized as the window is resized, maximize=infinity, minimize=page size
Related
How to demo
- Demo the position of the page within the window as the window is resized on the desktop
- Demo the book restricting re-sizing the book window to the minimal size
Design
- Border: Remove the call to setBorder on the JInternalFrame in the setup() method of BookDocumentWindow.swingFrameSync(). This not only will remove the border, it brings back the title bar and window shadows on the Macintosh
- The bottom of the window is not moving, so while the top left changes to fit the window, the bottom right does not, and the bottom stays off the screen.
- Removing the iconified book from the desktop - ie, handing iconification better
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>)
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.
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.
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.
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.
3.5 - Consider adding select to show() as well, so newly selected books also have selected windows
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.
- Center the page on the current page work area
4.1 Not done yet
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.
- Change the page work area to consider the size of the book window as well as the page
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.
5.2 - Change the PageWorkArea logic to not only resize itself to the page size, but also it's parent window. See 5.1
- I doubt I will have time to do this task requirement
- Make sure that the logic to determine the book window is bounded by the book bottom panel. In other words, when asked what the minimal book window size can be, the logic will not
Implementation
- Removed the call to setBorder from the setup() method of BookDocumentWindow.swingFrameSync(). This change should be checked on Windows and Linux. It removed the border as requested (and fixed a Mac issue with no title bar)
Testing
Comments
The page should be at the center of the book window. (when bigger than it, in other cases scrollbars are responsible for positioning of the page.)
2009-05-11
- "Remove the thick black border of the book window (see if it is reasonable)" There is a comment in the code that should be defined in the skin, however, if I make the border any smaller now, the window is not draggable at all. So until we add some sort of title bar, I think this has to remain for now
2009-05-12
- The default position of the page should be at the center of the book window. -Isn't it already at the center of the book window? It doesn't re-center as you resize the window, but I think it is centered by default at least on my system.
- I need to know if you want the page work area to expand to the size of the window, and then have the page stay centered on the page work area? That would mean a large change to how things work now, which is ok, I just need to know that this is what you want.
Attachments
- BOOK_WINDOW_R1_DEMO.mov (1.8 MB) - added by sriggins 16 years ago.