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.

File:
1 edited

Legend:

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

    r1189 r1200  
    6868         */
    6969        protected static boolean isValidLine(String s) {
    70                 return s.length() >= 2 && s.charAt(1) == ' '
    71                                 && (Character.isLetter(s.charAt(0)) || s.charAt(0) == '[' || s.charAt(0) == ']' || s.charAt(0) == '^' || s.charAt(0) == '_');
     70                // Previously lines in a .exp file had to start with a letter (A-Z, a-z).  This allowed for an efficient check for valid lines.
     71                // As we started to run out of spare letters to use for properties, we wished to use the full range of characters.  But we did not
     72                // wish to loose the efficiency of the Character.isLetter check.  In order to maintain as much of this efficiency as possible, but
     73                // allow for all characters, we take advantage of how || is evaluated:
     74                //              if the check for Character.isLetter passes, then the more complex map lookup operation does not take place.
     75                return s.length() >= 2 && (Character.isLetter(s.charAt(0)) || _ItemTags.keySet().contains(s.charAt(0)));
    7276        }
    7377
     
    117121                                                        break;
    118122                                                }
    119                                                 _linePoints.put(currentItem.getID(), currentItem);
     123                                                _linePoints.put(currentItem.getID(), currentItem);                                             
    120124                                                newFrame.addItem(currentItem);
    121125                                        } else if (currentItem != null && actionShouldBeDelayed(getTag(next))) {
     
    123127                                        } else if (currentItem != null) {
    124128                                                processBodyLine(currentItem, next);
     129//                                              final boolean hasSpecifiedPermission = currentItem.getPermission() != null;
     130//                                              final boolean hasSpecifiedOwner = currentItem.getOwner() != null;
     131//                                              if (hasSpecifiedPermission && hasSpecifiedOwner && currentItem.getPermission().getPermission(currentItem.getOwner()) == UserAppliedPermission.denied) {
     132//                                                      newFrame.removeItem(currentItem);
     133//                                                      newFrame.addItemHidden(currentItem);
     134//                                                      continue;
     135//                                              }
    125136                                        } else {
    126137                                                System.err.println("Error while reading in frame (ExpReader): Found body line but no current item to apply it to.");
     
    236247                Character tag = getTag(line);
    237248                String value = getValue(line);
    238 
     249               
    239250                Method toRun = _ItemTags.get(tag);
     251                               
    240252                if (toRun == null) {
    241253                        System.out.println("Error accessing tag method: " + tag);
    242254                }
     255                               
    243256                Object[] vals = Conversion.Convert(toRun, value);
    244 
    245257                try {
    246258                        if (vals != null) {
     
    322334                                        String value = getValue(next);
    323335                                        if (tag.equals('V')) {
     336                                                reader.close();
    324337                                                return Integer.parseInt(value);
    325338                                        }
    326339                                }
    327340                        }
     341                        reader.close();
    328342                } catch (Exception e) {
    329343                }
Note: See TracChangeset for help on using the changeset viewer.