Ignore:
Timestamp:
11/21/08 10:46:54 (16 years ago)
Author:
ra33
Message:

Refactored DateTime format code... so all formats are determined in a single spot.

Fixed bug preventing users from clicking a frame title of a protected frame to move to the next and previous frame.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/actions/Navigation.java

    r410 r419  
    3333                DisplayIO.Back();
    3434        }
    35        
     35
    3636        public static void Forward() {
    3737                DisplayIO.Forward();
     
    4444                FrameUtils.DisplayFrame(UserSettings.HomeFrame);
    4545        }
    46        
     46
    4747        public static void GotoZero() {
    48                 FrameUtils.DisplayFrame(DisplayIO.getCurrentFrame().getFramesetName() + 0);
     48                FrameUtils
     49                                .DisplayFrame(DisplayIO.getCurrentFrame().getFramesetName() + 0);
    4950        }
    5051
     
    6465         */
    6566        public static void Goto(Integer value) {
    66                 FrameUtils.DisplayFrame(DisplayIO.getCurrentFrame().getFramesetName() + value);
    67         }
    68        
     67                FrameUtils.DisplayFrame(DisplayIO.getCurrentFrame().getFramesetName()
     68                                + value);
     69        }
     70
    6971        /**
    7072         * Loads the Frame with the given FrameName and displays it
     
    104106                NextFrame(true);
    105107        }
    106        
     108
    107109        public static void NextFrame(boolean addToBack) {
    108110                addToBack = adjustAddToBack(addToBack);
     
    110112                FrameUtils.DisplayFrame(next, addToBack, true);
    111113        }
    112        
     114
    113115        /**
    114116         * Navigates to the last frame in the frameset.
    115          *
     117         * 
    116118         */
    117119        public static void LastFrame() {
     
    119121                FrameUtils.DisplayFrame(last, true, true);
    120122        }
    121        
     123
    122124        public static void ZeroFrame() {
    123125                Frame zeroFrame = FrameIO.LoadZero();
    124126                FrameUtils.DisplayFrame(zeroFrame, true, true);
    125127        }
    126        
    127128
    128129        public static void Next() {
    129130                NextFrame();
    130131        }
    131        
     132
    132133        public static void Previous() {
    133134                PreviousFrame();
    134135        }
    135        
     136
    136137        public static void PreviousFrame(boolean addToBack) {
    137138                addToBack = adjustAddToBack(addToBack);
     
    139140                FrameUtils.DisplayFrame(prev, addToBack, true);
    140141        }
    141        
     142
    142143        public static void PreviousFrame() {
    143144                PreviousFrame(true);
     
    160161                }
    161162
    162                 //Ensure the parent variable has been initialised
     163                // Ensure the parent variable has been initialised
    163164                if (_Parent == null || !back.equals(_Parent)) { // ByRob: what the heck
    164165                        // is the code doing?
     
    190191                while (parentItemLinkedToSource < items.size()
    191192                                && (items.get(parentItemLinkedToSource).getAbsoluteLink() == null || !items
    192                                                 .get(parentItemLinkedToSource).getAbsoluteLink().toLowerCase()
    193                                                 .equals(sourceName))) {
     193                                                .get(parentItemLinkedToSource).getAbsoluteLink()
     194                                                .toLowerCase().equals(sourceName))) {
    194195                        parentItemLinkedToSource++; // ByRob: this increments to the next
    195196                        // item
     
    203204                                                        source.getName())) {
    204205                                _LastItemUsed = items.get(i);
    205                                 FrameUtils.DisplayFrame(_LastItemUsed.getAbsoluteLink(), false, true);
     206                                FrameUtils.DisplayFrame(_LastItemUsed.getAbsoluteLink(), false,
     207                                                true);
    206208                                return;
    207209                        } // ByRob: end of if
     
    222224                        DisplayIO.ToggleTwinFrames();
    223225        }
    224        
    225         // When display frame is called with addToBack set to false multiple
    226         // times...
    227         // The first time we add to back but after that we dont
    228         // This flag stores the state for the addToBack parameter the last time this
    229         // method was called
     226
     227        /*
     228         * When display frame is called with addToBack set to false multiple
     229         * times... Only the first frame is added to the backup stack. This flag
     230         * stores the state for the addToBack parameter the last time this method
     231         * was called.
     232         */
    230233        private static boolean _lastAddToBack = true;
    231234
     
    233236                _lastAddToBack = true;
    234237        }
    235        
     238
    236239        private static boolean adjustAddToBack(boolean addToBack) {
    237240                boolean originalAddToBack = addToBack;
    238                
    239                 if (!addToBack && _lastAddToBack){
    240                         //This adds the first frame to the backup stack when the user
    241                         //navigates through a bunch of frames with the keyboard!
     241
     242                if (!addToBack && _lastAddToBack) {
     243                        // This adds the first frame to the backup stack when the user
     244                        // navigates through a bunch of frames with the keyboard!
    242245                        addToBack = true;
    243246                }
    244                
     247
    245248                _lastAddToBack = originalAddToBack;
    246                
     249
    247250                return addToBack;
    248251        }
Note: See TracChangeset for help on using the changeset viewer.