Analysis
Overview
Full screen mode shows the currently viewed document (usually it's a book) in full screen. It is useful for presentations.
There should be 2 full screens mode
- full screen - Preview that doesn't allow the user to edit the document. The application starts to act as reader in full screen. In this case application should announced the user how to exit full screen.
- full screen with tabs - Allows book editing in full screen mode, all flap and tabs and menus should present but in auto hide mode.
The full screens mode are triggered by the view menu or short keys. The short keys should be F5 for presentation full screen and F11 for edit full screen mode. These short keys should be listed after the buttons in the view menu.
User should be able to exit full screen mode with ESC key or by pressing the key that evoked the current full screen mode. Or in case of edit full screen he could use the view menu to do so.
When in edit mode and user wants to makes preview, the application goes to presentation mode.
Task requirements
- Create a prototype of these two states. Go as far as you can get with auto hide behavior of the components.
- Update the current design in this document. Don't leave it the same.
Task result
- The result should be code.
Implementation idea
- Create a View menu with 3 sub items normal, presentation and full screen. They should present the names of the modes and the short keys for them. For normal mode is ESC key
- To announce the user how to exit presentation mode use small white label on black background that stands on the top of the screen and appears for few seconds. After it disappear it could be shown again via roll in this area. If possible add close button next to the label.
Related
How to demo
- Run Sophie2
- Create a book and go to presentation mode via short key
- Go back to normal mode again with short key
- Do the same with edit full screen mode
Design
- Create enum ScreenMode for the different modes of Sophie's main window (in org.sophie2.base.layout.model).
- NORMAL
- PRESENTATION
- FULL_SCREEN
- Create a ScreenMode property screenMode() in MainWindow.
- Implement it in DefaultMainWindow with default value ScreenMode.NORMAL
- Create a View menu in main.app.menus.
- Create menu items in the View menu
- Normal mode
- Presentation mode (F5)
- Full Screen mode (F11)
- Make the main window's JFrame in full screen when the value of the screenMode() is not ScreenMode.NORMAL
- In MDMainWindow.globalContainer modify the configureFrameSettings(JFrame gcf) method
- When the value of the screenMode() is not ScreenMode.NORMAL:
- use gcf.setUndecorated(true) to remove the window title bar, border and all other decorations
- resize it to screen's dimensions
- move it to the top left corner
- Configure visibility of flaps in different modes
- Flaps are visible in NORMAL mode.
- Flaps are not visible when FULL_SCREEN mode is toggled and can auto-hide. The user can control them and made them visible.
- Flaps are not available in PRESENTATION mode. The user could not control them.
- This is implemented in a flapsInFullScreen() property which is in MDMainWindow.
- Configure visibility of the TabBar
- Check if the ScreenMode is NORMAL before adding the TabBar in the swing component of DefaultDocumentsDesktop.
- When the screenMode() property of MainWindow is ScreenMode.FULL_SCREEN the current document's window is maximized and its title bar is hidden
- Set different settings for the JInternalFrame in the setup of DefaultDocumentWindow.swingComponent()
- for ScreenMode.FULL_SCREEN mode:
- res.setMaximum(true);
- res.setMaximizable(false);
- res.setIconifiable(false);
- res.setClosable(false);
- res.setResizable(false);
- for ScreenMode.FULL_SCREEN mode:
- Set different settings for the JInternalFrame in the setup of DefaultDocumentWindow.swingComponent()
- Modify DefaultDocumentWindow.swingComponent
- Currently it is of type JInternalFrame.
- Change it to be JPanel.
- Create class MDDocumentWindow
- Create a property swingComponent of type JInternalFrame.
- MDMainWindow should display document windows' swing components in JInternalFrames (when not in Presentation mode) or in main window's JFrame (when in Presentation mode).
- When the screenMode() of MainWindow is ScreenMode.PRESENTATION
- The contents of the Global Container's Frame are cleared and only the swing component of current document window is added.
- Current book's window:
- Displays the book zoomed to fit the screen size (preserving the aspect ratio). Previous zoom level is saved so it will be restored when returning from presentation mode.
- Displays the book centered:
- offsetX = (zoom * pageSize.width - screenSize.width) / 2;, analogically offsetY.
- set wantedViewRect of workArea's sceneVisual to a rectangle (offsetX, offsetY, screen width, screen height). This also makes the whole area around the page to be gray.
- Displays the page work area's swing component instead of the scroll area, because scrollbars should be hidden.
- In order to make the main window to listen for the Esc key (to switch to normal mode):
- add all swing components in a new JPanel, then add it into the content pane of the global frame
- get the input key map for this panel for the condition WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, then add the Esc key stroke
- get the action map for the panel and add an action that fires a R3 event for switching to normal mode
- Affected classes:
- DefaultDocumentsDesktop
- DefaultDocumentWindow
- DefaultMainWindow
- BookDocumentWindow
- MDMainWindow
- DocumentsDesktop
- DocumentWindow
- MDDocumentWindow
- BookLogic
- Tests:
- See the attached patch after the text.
- Here is the main part of this patch: branches/private/mitex/sophie2-platform/modules/org.sophie2.main.layout.mydoggy/src/test/java/org/sophie2/main/layout/mydoggy/MyDoggyLayoutDemo.java
- Commited design code [2624] - pap
Implementation
Testing
Comments
- Things that are not implemented in this revision should go to next one.
Attachments
-
patch-fullscreen-test.patch
(20.7 KB) -
added by pap 16 years ago.
Patch for the design tests