Ignore:
Timestamp:
11/28/18 16:16:29 (6 years ago)
Author:
bln4
Message:

org.expeditee.auth.gio.EncryptedExpReader ->
org.expeditee.auth.gio.EncryptedExpWriter ->
org.expeditee.io.DefaultFrameReader ->
org.expeditee.io.DefaultFrameWriter ->
org.expeditee.io.ExpReader ->
org.expeditee.io.ExpWriter ->

The beginnings of a authentication system for Expeditee. Frame files (.exp) can now be encrypted with a password. A login system is being developed to accompany this.


org.expeditee.gui.AttributeUtils ->
org.expeditee.gui.Frame ->
org.expeditee.gui.FrameUtils ->
org.expeditee.items.Item ->
org.expeditee.items.PermissionPair ->
org.expeditee.items.Text ->

As part of the development the login screen. Modifications to Text Items have been made. New properties are 'Mask' and 'MinWidth'. Mask allows you to set a character to use as...a mask...for example, a password field using '*'. MinWidth allows you to specify a minimum width for text boxes. A text box with a minimum width never shrinks below this width; even when it has no content.

Location:
trunk/src/org/expeditee/gui
Files:
4 edited

Legend:

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

    r1188 r1200  
    283283                        _Attrib.put("Width",                Item.class.getMethod("getWidthToSave"),
    284284                                                            Item.class.getMethod("setWidth", pIntO));
     285                        _Attrib.put("MinWidth",                         Item.class.getMethod("getMinWidthToSave"),
     286                                                                                                Item.class.getMethod("setMinWidth", pIntO));
    285287                        _Attrib.put("X",                    null,
    286288                                                            Item.class.getMethod("setX", pFloat));
     
    307309                        _Attrib.put("LetterSpacing",            Text.class.getMethod("getLetterSpacing"),
    308310                                                                                                Text.class.getMethod("setLetterSpacing", pFloat));
     311                        _Attrib.put("Mask",                             Text.class.getMethod("getMask"),
     312                                                                                                Text.class.getMethod("setMask", pIntO));
    309313                       
    310314                        // Aliases for attribute setting
     
    340344                        _Attrib.alias("j",                  "justification");
    341345                        _Attrib.alias("w",                  "width");
     346                        _Attrib.alias("mw",                             "minwidth");   
    342347                        _Attrib.alias("as",                 "autostamp");
    343                        
    344 
    345348                } catch (SecurityException e) {
    346349                        // TODO Auto-generated catch block
  • trunk/src/org/expeditee/gui/Frame.java

    r1193 r1200  
    126126        private Stack<History> _redo = new Stack<History>();
    127127
    128         // basically just a list of smaller objects?
    129         // maybe a hashtable (id -> item?)
    130         // Note: Needs to be able to be iterated through (for painting)
    131128        private List<Item> _body = new ArrayList<Item>();
     129        private List<Item> _bodyHiddenDueToPermissions = new ArrayList<Item>();
    132130
    133131        // for drawing purposes
     
    964962        }
    965963
    966         public void removeItem(Item item)
    967         {
     964        public void removeItem(Item item) {
    968965                removeItem(item, true);
    969966        }
     
    26072604                return _observers != null && _observers.size() > 0;
    26082605        }
     2606       
     2607        public List<Item> getBodyItemsWithInsufficientPermissions() {
     2608                return _bodyHiddenDueToPermissions;
     2609        }
     2610       
     2611        public void moveItemToBodyHiddenDueToPermission(final Item i) {
     2612                _body.remove(i);
     2613                _bodyHiddenDueToPermissions.add(i);
     2614        }
    26092615
    26102616        public Collection<? extends Item> getInteractableItems()
  • trunk/src/org/expeditee/gui/FrameIO.java

    r1188 r1200  
    4040import org.expeditee.actions.Actions;
    4141import org.expeditee.agents.ExistingFramesetException;
     42import org.expeditee.auth.io.EncryptedExpReader;
     43import org.expeditee.auth.io.EncryptedExpWriter;
    4244import org.expeditee.io.Conversion;
    4345import org.expeditee.io.ExpReader;
     
    465467
    466468                        if (fullPath.endsWith(ExpReader.EXTENTION)) {
    467                                 reader = new ExpReader(frameName);
     469                                if (EncryptedExpReader.isEncryptedExpediteeFile(fullPath)) {
     470                                        reader = new EncryptedExpReader(frameName);
     471                                } else {
     472                                        reader = new ExpReader(frameName);
     473                                }
    468474                        } else {
    469475                                reader = new KMSReader();
     
    952958                /* Dont save the frame if it has the noSave tag */
    953959                if (toSave.hasAnnotation("nosave")) {
    954                         Actions.PerformActionCatchErrors(toSave, null, "Restore");
     960                        Actions.LegacyPerformActionCatchErrors(toSave, null, "Restore");
    955961                        return "";
    956962                }
     
    964970                /* Format the frame if it has the autoFormat tag */
    965971                if (toSave.hasAnnotation("autoformat")) {
    966                         Actions.PerformActionCatchErrors(toSave, null, "Format");
     972                        Actions.LegacyPerformActionCatchErrors(toSave, null, "Format");
    967973                }
    968974
     
    988994                        // if its a new frame or an existing Exp frame...
    989995                        if (fullPath == null || fullPath.endsWith(ExpReader.EXTENTION)) {
    990                                 writer = new ExpWriter();
     996                                //writer = new ExpWriter();
     997                                writer = new ExpWriter();//new EncryptedExpWriter();
    991998                                savedVersion = ExpReader.getVersion(fullPath);
    992999                        } else {
     
    11981205        public static Frame LoadProfile(String userName)
    11991206        {
    1200                 return LoadFrame(userName + "1");
     1207                final String profilesLoc = System.getProperty("profiles.loc");
     1208                if (profilesLoc != null) {
     1209                        return LoadFrame(userName + "1", profilesLoc);
     1210                } else {
     1211                        return LoadFrame(userName + "1");
     1212                }
    12011213        }
    12021214
  • trunk/src/org/expeditee/gui/FrameUtils.java

    r1193 r1200  
    12881288                                                }
    12891289                                        }
     1290                                       
     1291                                        if (i.getData() != null && !i.getData().isEmpty() && i.getText().isEmpty()) {
     1292                                                System.err.println();
     1293                                        }
    12901294
    12911295                                        if (i.contains(new Point(x, y))){
     
    18671871                                }
    18681872                        }
    1869                         if (lastEdited != LastEdited && LastEdited.getText().length() == 0) {
     1873                        if (lastEdited != LastEdited && LastEdited.getText().length() == 0 && LastEdited.getMinWidth() == null) {
    18701874                                parent.removeItem(LastEdited);
    18711875                        }
Note: See TracChangeset for help on using the changeset viewer.