Ignore:
Timestamp:
05/19/08 12:03:18 (16 years ago)
Author:
ra33
Message:

Fixed a bunch of problems with rectangles and resizing the window, as well as adding some more unit tests etc.

File:
1 edited

Legend:

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

    r65 r67  
    117117       
    118118        public static void NextFrame(boolean addToBack) {
     119                addToBack = adjustAddToBack(addToBack);
    119120                Frame next = FrameIO.LoadNext();
    120                 FrameUtils.DisplayFrame(next, true);
     121                FrameUtils.DisplayFrame(next, addToBack);
    121122        }
    122123       
     
    145146       
    146147        public static void PreviousFrame(boolean addToBack) {
     148                addToBack = adjustAddToBack(addToBack);
    147149                Frame prev = FrameIO.LoadPrevious();
    148150                FrameUtils.DisplayFrame(prev, addToBack);
     
    213215                // ByMike: Find the first occurence of a ParentItem linked to the source
    214216                while (parentItemLinkedToSource < items.size()
    215                                 && (items.get(parentItemLinkedToSource).getLink() == null || !items
    216                                                 .get(parentItemLinkedToSource).getLink().toLowerCase()
     217                                && (items.get(parentItemLinkedToSource).getAbsoluteLink() == null || !items
     218                                                .get(parentItemLinkedToSource).getAbsoluteLink().toLowerCase()
    217219                                                .equals(sourceName))) {
    218220                        parentItemLinkedToSource++; // ByRob: this increments to the next
     
    224226                        if (items.get(i).isLinkValid()
    225227                                        && !items.get(i).isAnnotation()
    226                                         && !items.get(i).getLink().toLowerCase().equals(
     228                                        && !items.get(i).getAbsoluteLink().toLowerCase().equals(
    227229                                                        source.getFrameName().toLowerCase())) {
    228230                                _LastItemUsed = items.get(i);
     
    250252                        DisplayIO.ToggleTwinFrames();
    251253        }
     254       
     255        // When display frame is called with addToBack set to false multiple
     256        // times...
     257        // The first time we add to back but after that we dont
     258        // This flag stores the state for the addToBack parameter the last time this
     259        // method was called
     260        private static boolean _lastAddToBack = true;
     261
     262        public static void ResetLastAddToBack() {
     263                _lastAddToBack = true;
     264        }
     265       
     266        private static boolean adjustAddToBack(boolean addToBack) {
     267                boolean originalAddToBack = addToBack;
     268               
     269                if (!addToBack && _lastAddToBack){
     270                        //This adds the first frame to the backup stack when the user
     271                        //navigates through a bunch of frames with the keyboard!
     272                        addToBack = true;
     273                }
     274               
     275                _lastAddToBack = originalAddToBack;
     276               
     277                return addToBack;
     278        }
    252279}
Note: See TracChangeset for help on using the changeset viewer.