wiki:BOOK_WINDOW_R1

Version 35 (modified by sriggins, 16 years ago) (diff)

--

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=BOOK_WINDOW_R1, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block

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

  1. Remove the thick black border of the book window (see if it is reasonable)
  2. 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.
  3. Minimize button should minimize book to the Opened book tabbar. Currently a new button is created at the bottom of the work area.
  4. The default position of the page work area should be at the center of the book window.
  5. 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
  6. Make the background of the window changable by the skin (optional)
  7. 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

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

  1. 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
  1. 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.
  1. No design yet - 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.
  1. & 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.
  1. I doubt I will have time to do this task requirement
  1. There is already code to minimize the width a window can be made, which is currently the width of the PageWorkArea. This logic should be changed to either ask the PageWorkArea what size it should be, but this seems to conflict with 4. & 5. which are considering the book window.

Implementation

  1. 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