Changeset 667


Ignore:
Timestamp:
01/08/14 13:58:12 (10 years ago)
Author:
jts21
Message:

Allow specifying a frame to start at as a commandline option when starting Expeditee. If a frameset name is specified without a frame number, frame 1 is assumed. If an invalid frame is specified, the profile frame will be loaded as usual.

File:
1 edited

Legend:

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

    r655 r667  
    7979
    8080        private static boolean _initComplete = false;
     81       
     82        private static String _startFrame = null;
    8183
    8284        /**
     
    8688         */
    8789        public static void main(String[] args) {
     90               
     91                if(args.length > 0) {
     92                        _startFrame = args[0];
     93                        if(! Character.isDigit(_startFrame.charAt(_startFrame.length() - 1)))
     94                                _startFrame = _startFrame + "1";
     95                }
     96
     97
    8898
    8999                // Prepare all expeditee and swing data on the AWT event thread.
     
    279289                        // Turn off XRay mode and load the first frame
    280290                        FrameGraphics.setMode(FrameGraphics.MODE_NORMAL, false);
    281                         FrameUtils.loadFirstFrame(profile);
     291                       
     292                        // Go to the start frame if specified, otherwise go to the profile frame
     293                        Frame start = null;
     294                if((start = FrameIO.LoadFrame(_startFrame)) != null) {
     295                        // Make sure HomeFrame gets set
     296                        if (UserSettings.HomeFrame.get() == null)
     297                                UserSettings.HomeFrame.set(profile.getName());
     298                        // Make sure the user can get back to the profile frame easily
     299                        DisplayIO.addToBack(profile);
     300                        // Go to the start frame
     301                        DisplayIO.setCurrentFrame(start, true);
     302                } else {
     303                        // If an invalid start frame was specified, show a warning
     304                        if(_startFrame != null) {
     305                                warningMessages.add("Unknown frame: " + _startFrame);
     306                        }
     307                        // Go to the profile frame
     308                        FrameUtils.loadFirstFrame(profile);
     309                }
    282310                        DisplayIO.UpdateTitle();
    283311
     
    290318                                MessageBay.warningMessage(message);
    291319
    292                         this.getContentPane().addKeyListener(
    293                                         FrameKeyboardActions.getInstance());
     320                        this.getContentPane().addKeyListener(FrameKeyboardActions.getInstance());
    294321                        this.addKeyListener(FrameKeyboardActions.getInstance());
    295322
    296                         _mouseEventRouter.addExpediteeMouseListener(FrameMouseActions
    297                                         .getInstance());
    298                         _mouseEventRouter.addExpediteeMouseMotionListener(FrameMouseActions
    299                                         .getInstance());
    300                         _mouseEventRouter.addExpediteeMouseWheelListener(FrameMouseActions
    301                                         .getInstance());
     323                        _mouseEventRouter.addExpediteeMouseListener(FrameMouseActions.getInstance());
     324                        _mouseEventRouter.addExpediteeMouseMotionListener(FrameMouseActions.getInstance());
     325                        _mouseEventRouter.addExpediteeMouseWheelListener(FrameMouseActions.getInstance());
    302326
    303327                        // Dont refresh for the profile frame otherwise error messages are shown twice
Note: See TracChangeset for help on using the changeset viewer.