Changeset 23


Ignore:
Timestamp:
05/13/08 11:48:32 (16 years ago)
Author:
ra33
Message:

Fixed bug in session stats that caused an exception when there were no stats... this was preventing profile frame from being created correctly!

Location:
trunk/src/org/expeditee
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/agents/CopyTree.java

    r8 r23  
    55
    66import org.expeditee.gui.Frame;
     7import org.expeditee.gui.FrameGraphics;
    78import org.expeditee.gui.FrameIO;
    89import org.expeditee.gui.FrameUtils;
     
    4849                        processFrame(zero);
    4950                } catch (ExistingFramesetException efe) {
    50                         // get the frame path
    51                         Frame zero = FrameIO.LoadFrame(_nameTo + "0");
    52                         _framePath = zero.path;
    53                         _firstNumber = _lastNumber + 1;
     51                        FrameGraphics.ErrorMessage("A frameset called " + _nameTo
     52                                        + " already exists.");
     53                        return false;
    5454                } catch (Exception e) {
    5555                        return false;
     
    8080                for (Item i : fresh.getItems())
    8181                        if (i.getLink() != null && !i.isAnnotation() && i.isLinkValid()) {
    82                                 String link = i.getLink();
    83                                 link = link.toLowerCase();
    84                                 // link = link.replace(_nameFrom, _nameTo);
     82                                String link = i.getLink().toLowerCase();
     83                                //convert to absolute link with the old framesetName
     84                                if (FrameIO.isPositiveInteger(link)){
     85                                        link = _nameFrom + link;
     86                                }
     87                                //check if we already have this in our map
    8588                                if (_nameMap.containsKey(link))
    8689                                        link = _nameMap.get(link);
     90                                //otherwise add it to our map
    8791                                else if (link.startsWith(_nameFrom)) {
    8892                                        _nameMap.put(link, _nameTo + (++_lastNumber));
    89                                         link = _nameTo + _lastNumber;
     93                                        link = "" + _lastNumber;
    9094                                }
    9195                                i.setLink(link);
     
    9397                                        && i.isLinkValid()) {
    9498                                // annotation links need to be parsed at the end
    95                                 if (i.getLink().toLowerCase().startsWith(_nameFrom)) {
     99                                if (i.getAbsoluteLink().toLowerCase().startsWith(_nameFrom)) {
    96100                                        _toReparse.add(fresh.getFrameName());
    97101                                        added = true;
     
    101105
    102106                fresh.path = _framePath;
    103                 FrameIO.SaveFrame(fresh);
     107                FrameIO.ForceSaveFrame(fresh);
    104108                FrameIO.ResumeCache();
    105109        }
  • trunk/src/org/expeditee/gui/Browser.java

    r22 r23  
    8484                        } catch (Exception e) {
    8585                                //TODO tell the user that there was a problem creating the profile frame and close nicely
     86                                e.printStackTrace();
    8687                                assert(false);
    8788                        }
  • trunk/src/org/expeditee/gui/DisplayIO.java

    r22 r23  
    5959         * The title to display in the Title bar.
    6060         */
    61         public static final String TITLE = "Exp08May2008D";
     61        public static final String TITLE = "Exp09May2008A";
    6262
    6363        private DisplayIO() {
  • trunk/src/org/expeditee/gui/FrameIO.java

    r22 r23  
    727727
    728728        public static Frame CreateNewProfile(String username) throws Exception {
    729                 Frame profile = CreateFrameset(username, PROFILE_PATH);
     729                Frame profile = CreateFrameset(username, PROFILE_PATH, true);
    730730                FrameUtils.CreateDefaultProfile(profile);
    731731                return profile;
  • trunk/src/org/expeditee/stats/SessionStats.java

    r22 r23  
    259259                for (String s : _FrameEvents)
    260260                        eventList.append(s + '\n');
    261                 eventList.deleteCharAt(eventList.length() - 1);
     261                if (eventList.length() > 0)
     262                        eventList.deleteCharAt(eventList.length() - 1);
    262263                return eventList.toString();
    263264        }
Note: See TracChangeset for help on using the changeset viewer.