Changeset 1405


Ignore:
Timestamp:
06/05/19 11:28:51 (5 years ago)
Author:
bln4
Message:

Added Group attribute to frames.

Some early logic on using the group attribute to determine group members. At this point just detects if the specified group doesn't actually exist. Will do more soon.

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

Legend:

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

    r1402 r1405  
    203203                        _FrameAttrib.put("EncPermission",       Frame.class.getMethod("getEncryptionPermission"),
    204204                                                                                                Frame.class.getMethod("setEncryptionPermission", pEncPermission));
     205                        _FrameAttrib.put("Group",                       Frame.class.getMethod("getGroup"),
     206                                                                                                Frame.class.getMethod("setGroup", pString));
    205207                       
    206208                       
  • trunk/src/org/expeditee/gui/Frame.java

    r1402 r1405  
    178178
    179179        private String _encryptionLabel;
     180       
     181        private String _groupFrameName;
     182        private Frame _groupFrame = null;
    180183
    181184        /** Default constructor, nothing is set. */
     
    27842787        }
    27852788
     2789        public String getGroup() {
     2790                return _groupFrameName;
     2791        }
     2792
     2793        public void setGroup(String _groupFrame) {
     2794                this._groupFrameName = _groupFrame;
     2795                this._groupFrame = null;
     2796        }
     2797       
     2798        public Frame getGroupFrame() {
     2799                if (this._groupFrame != null) {
     2800                        return this._groupFrame;
     2801                } else {
     2802                        this._groupFrame = FrameIO.LoadFrame(this._groupFrameName, FrameIO.GROUP_PATH);
     2803                        return this._groupFrame;
     2804                }
     2805        }
     2806       
     2807        public void setGroupFrame(Frame frame) {
     2808                this._groupFrame = frame;
     2809        }
     2810
    27862811        private static final class History {
    27872812               
  • trunk/src/org/expeditee/gui/FrameUtils.java

    r1403 r1405  
    489489                if (toDisplay == null) {
    490490                        return;
     491                }
     492               
     493                // Check if group specified that it exists.
     494                String group = toDisplay.getGroup();
     495                if (group != null && group.length() > 0) {
     496                        Frame groupFrame = toDisplay.getGroupFrame();
     497                        if (groupFrame == null) {
     498                                MessageBay.displayMessage("WARNING: There is no corrosponding " + group + "1 for the specified group " + group + ".  Group permissions will not apply.");
     499                        }
    491500                }
    492501
  • trunk/src/org/expeditee/io/DefaultFrameReader.java

    r1402 r1405  
    9696                        _FrameTags.put('T', Frame.class.getMethod("addToData", pString));
    9797                        _FrameTags.put('E', Frame.class.getMethod("setEncryptionPermission", pEncPermission));
     98                        _FrameTags.put('G', Frame.class.getMethod("setGroup", pString));
    9899
    99100                        // Note: As of 26/11/18 there are no unused letter item tags.  Use other characters.
  • trunk/src/org/expeditee/io/DefaultFrameWriter.java

    r1398 r1405  
    8383                        _FrameTags.put('T', Frame.class.getMethod("getData"));
    8484                        _FrameTags.put('E', Frame.class.getMethod("getEncryptionPermission"));
     85                        _FrameTags.put('G', Frame.class.getMethod("getGroup"));
    8586                       
    8687                        // Note: As of 26/11/18 there are no unused letter item tags.  Use other characters.
Note: See TracChangeset for help on using the changeset viewer.