Changeset 1039 for trunk/src


Ignore:
Timestamp:
04/27/16 14:15:47 (8 years ago)
Author:
davidb
Message:

Main Addition: full-screen audience mode. Also some whitespace and comment tidy-up.

Location:
trunk/src/org/expeditee/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/Browser.java

    r1032 r1039  
    117117                    _startFrame = "home1";
    118118                }
    119                
     119
    120120                // Prepare all expeditee and swing data on the AWT event thread.
    121121                SwingUtilities.invokeLater(new Runnable() {
     
    267267                 */
    268268                setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    269 
     269               
    270270                // Expeditee handles its own repainting of AWT/Swing components
    271271                RepaintManager.setCurrentManager(ExpediteeRepaintManager.getInstance());
     
    435435         */
    436436        public void componentShown(ComponentEvent e) {
     437                DisplayIO.fullScreenTransitionPending=false;
    437438        }
    438439
     
    447448
    448449        public void windowClosed(WindowEvent e) {
    449                 exit();
     450                if (!DisplayIO.fullScreenTransitionPending) {
     451                        exit();
     452                }
    450453        }
    451454
  • trunk/src/org/expeditee/gui/DisplayIO.java

    r977 r1039  
    2323import java.awt.Cursor;
    2424import java.awt.Dimension;
     25import java.awt.GraphicsDevice;
     26import java.awt.GraphicsEnvironment;
    2527import java.awt.Image;
    2628import java.awt.Point;
     
    9092        private static HashSet<DisplayIOObserver> _displayIOObservers = new HashSet<DisplayIOObserver>();
    9193
     94        private static GraphicsDevice screen = null;
     95   
    9296        /**
    9397         * The title to display in the Title bar.
    9498         */
    95         public static String TITLE = "ExpDev";
     99        public static String TITLE = "Expedite";
    96100
    97101        private DisplayIO() {
     
    116120                _BackedUpFrames[0] = new Stack<String>();
    117121                _BackedUpFrames[1] = new Stack<String>();
    118         }
    119 
     122
     123                GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
     124                screen = ge.getDefaultScreenDevice();
     125                if (!screen.isFullScreenSupported()) {
     126                        // Can this be printed to the MessageBuffer
     127                        MessageBay.errorMessage("Full-screen mode not supported");
     128                        screen =null;
     129                }
     130        }
     131
     132        public static boolean fullScreenTransitionPending = false;
     133        public static int beforeFullScreenWidth  = 0;
     134        public static int beforeFullScreenHeight = 0;
     135        public static boolean fullScreenCapable()
     136        {
     137                return (screen!=null);
     138        }
     139       
     140        public static void enterFullScreenMode()
     141        {
     142                if (screen!=null) {
     143                        // Move all these routines to Browser?
     144                        beforeFullScreenWidth  = _Browser.getWidth();
     145                        beforeFullScreenHeight = _Browser.getHeight();
     146                       
     147                        fullScreenTransitionPending=true;
     148                        _Browser.dispose();
     149                        _Browser.setUndecorated(true);
     150                        _Browser.pack();
     151                        _Browser.setVisible(true);
     152                       
     153                        screen.setFullScreenWindow(_Browser);
     154               
     155                }
     156                else {
     157                        System.err.println("Warning: DisplayIO::enterFullScreenMode() called when not available -- ignoring");
     158                }
     159        }
     160       
     161        public static void leaveFullScreenMode()
     162        {
     163                fullScreenTransitionPending=true;
     164                _Browser.dispose();
     165                _Browser.setUndecorated(false);
     166                _Browser.setSizes(new Dimension(beforeFullScreenWidth, beforeFullScreenHeight));
     167               
     168                screen.setFullScreenWindow(null);
     169                _Browser.pack();
     170                _Browser.setVisible(true);
     171        }
     172       
     173       
    120174        /**
    121175         * Notifies observers that the frame has changed.
  • trunk/src/org/expeditee/gui/FrameGraphics.java

    r997 r1039  
    2424import java.awt.Graphics;
    2525import java.awt.Graphics2D;
     26import java.awt.GraphicsDevice;
    2627import java.awt.GraphicsEnvironment;
    2728import java.awt.Image;
     
    6970
    7071        public static final int MODE_XRAY = 2;
    71 
    72         // Start in XRay mode so that errors aren't thrown when parsing the profile
    73         // frame if it has images on it
     72       
     73        public static final int MODE_AUDIENCE_FULLSCREEN = 4;
     74       
     75
     76        // The following used to be true in the past:
     77        //   Start in XRay mode so that errors aren't thrown when parsing the profile
     78        //   frame if it has images on it
     79        // More recently, so Exploratory Search starts up correctly with images
     80        // rendered (rather than their @i form) the following assignment was changed
     81        // to MODE_AUDIENCE.  No issue of parse errors has not been seen
    7482        private static int _Mode = MODE_AUDIENCE;
    7583
     
    8795                        ToggleXRayMode();
    8896                }
    89 
    90                 if (_Mode == MODE_AUDIENCE) {
     97       
     98
     99                if (_Mode == MODE_AUDIENCE_FULLSCREEN) {
    91100                        _Mode = MODE_NORMAL;
    92                 } else {
     101                        DisplayIO.leaveFullScreenMode();
     102                }
     103                else if (_Mode == MODE_AUDIENCE) {
     104                        if (DisplayIO.fullScreenCapable()) {
     105                                // Don't need to worry about UpdateConnectedToAnnotations, as this
     106                                // will have already been taken care of going to the 'first stage' of
     107                                // audience mode (MODE_AUDIENCE)
     108                                _Mode = MODE_AUDIENCE_FULLSCREEN;
     109                                DisplayIO.enterFullScreenMode();
     110                        }
     111                        else {
     112                                // return to normal mode
     113                                _Mode = MODE_NORMAL;
     114                        }
     115                }
     116                else { // must currently be in regular mode => move to audience mode
    93117                        _Mode = MODE_AUDIENCE;
    94118                        ItemUtils.UpdateConnectedToAnnotations(current.getItems());
     
    143167         */
    144168        public static boolean isAudienceMode() {
    145                 return _Mode == MODE_AUDIENCE;
     169                return (_Mode == MODE_AUDIENCE) || (_Mode == MODE_AUDIENCE_FULLSCREEN);
    146170        }
    147171
Note: See TracChangeset for help on using the changeset viewer.