Ignore:
Timestamp:
03/15/19 16:48:00 (5 years ago)
Author:
bln4
Message:

Support for new regime in the form of new fields and conditional setting of all paths fields.

Settings are now able to generate their own representation. This allows for the user to explicitly inspect the default values.

When profiles are created, an optional parameter may now be provided. If not null, the new map parameter can contain default values for settings to apply to this profile. This allows for the creation of profiles to that have (for example), their username set to an explicit value. Multiuser mode uses this functionality for usernames and key values among other things.

Frames can now be asked were they are located on the file system. Furthermore, frame indirection is now a thing. Rather than containing data to display, an exp file can contain a line in the format of "REDIRECT:<path>" to go looking for that data. Frames are able to return both their logical (their exp file) and real (the file actually containing the data) paths.

Frames can now store data.

Further fixes to how edits from other users are loaded in.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/io/ExpReader.java

    r1232 r1242  
    2929import org.expeditee.core.Point;
    3030import org.expeditee.gui.Frame;
     31import org.expeditee.gui.FrameIO;
    3132import org.expeditee.items.Constraint;
    3233import org.expeditee.items.Dot;
     
    213214                //newFrame.refreshItemPermissions();
    214215                _reader.close();
     216                FrameIO.setSavedProperties(newFrame);
    215217                newFrame.setChanged(false);
    216218
     
    344346                return -1;
    345347        }
     348       
     349        public static String redirectTo(String fullPath) {
     350                try {
     351                        BufferedReader reader = new BufferedReader(new FileReader(fullPath));
     352                        String next = "";
     353                        while (reader.ready() && !(next = reader.readLine()).equals("Z")) {
     354                                if (next.startsWith("REDIRECT:")) {
     355                                        String redirectTo = next.replace("REDIRECT:", "");
     356                                        reader.close();
     357                                        return redirectTo;
     358                                }
     359                        }
     360                        reader.close();
     361                } catch (Exception e) {
     362                }
     363                return null;
     364        }
    346365}
Note: See TracChangeset for help on using the changeset viewer.