Changeset 1406


Ignore:
Timestamp:
06/05/19 13:03:58 (5 years ago)
Author:
bln4
Message:

You can now create groups. Make a text item of the format "Group: <group name>", with cursor over, hit F6. Instead of creating a normal frameset this will create a group.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gio/gesture/StandardGestureActions.java

    r1397 r1406  
    28882888                Text text = (Text) item;
    28892889                try {
    2890                         // create the new frameset
    2891                         Frame linkTo = FrameIO.CreateNewFrameset(text.getFirstLine());
     2890                        String name = text.getFirstLine();
     2891                        Frame linkTo = null;
     2892                        if (name.toLowerCase().startsWith("group: ")) {
     2893                                String groupName = name.substring(7);
     2894                                // create the new group
     2895                                linkTo = FrameIO.CreateNewGroup(groupName);
     2896                        } else {
     2897                                // create the new frameset
     2898                                linkTo = FrameIO.CreateNewFrameset(name);
     2899                        }
    28922900                        DisplayController.setCursor(Item.DEFAULT_CURSOR);
    28932901                        text.setLink(linkTo.getName());
  • trunk/src/org/expeditee/gui/Frame.java

    r1405 r1406  
    28002800                        return this._groupFrame;
    28012801                } else {
    2802                         this._groupFrame = FrameIO.LoadFrame(this._groupFrameName, FrameIO.GROUP_PATH);
     2802                        this._groupFrame = FrameIO.LoadFrame(this._groupFrameName + 1, FrameIO.GROUP_PATH);
    28032803                        return this._groupFrame;
    28042804                }
  • trunk/src/org/expeditee/gui/FrameIO.java

    r1403 r1406  
    16691669                return newFrame;
    16701670        }
     1671       
     1672        public static Frame CreateNewGroup(String name) {
     1673                try {
     1674                        Frame oneFrame = FrameIO.CreateFrameset(name, FrameIO.GROUP_PATH);
     1675                        oneFrame.setPermission(new PermissionTriple(UserAppliedPermission.full, UserAppliedPermission.none, UserAppliedPermission.none));
     1676                       
     1677                        Text ownerAnnotation = oneFrame.createNewText("@Owner: " + UserSettings.UserName.get());
     1678                        ownerAnnotation.setPosition(100, 100);
     1679                        ownerAnnotation.setPermission(new PermissionTriple(UserAppliedPermission.full, UserAppliedPermission.none, UserAppliedPermission.none));
     1680                        Text membersAnnotation = oneFrame.createNewText("@Members: ");
     1681                        membersAnnotation.setPosition(100, 200);
     1682                       
     1683                        FrameIO.SaveFrame(oneFrame);
     1684                       
     1685                        FrameIO.LoadFrame(name + 0, FrameIO.GROUP_PATH).setPermission(new PermissionTriple(UserAppliedPermission.full, UserAppliedPermission.none, UserAppliedPermission.none));
     1686                       
     1687                        return oneFrame;
     1688                } catch (Exception e) {
     1689                        MessageBay.displayMessage("Unable to create group with name: " + name + ".  See console for more details.");
     1690                        e.printStackTrace();
     1691                        return null;
     1692                }               
     1693        }
    16711694
    16721695        /**
  • trunk/src/org/expeditee/gui/FrameUtils.java

    r1405 r1406  
    493493                // Check if group specified that it exists.
    494494                String group = toDisplay.getGroup();
     495                Frame groupFrame = null;
    495496                if (group != null && group.length() > 0) {
    496                         Frame groupFrame = toDisplay.getGroupFrame();
     497                        groupFrame = toDisplay.getGroupFrame();
    497498                        if (groupFrame == null) {
    498499                                MessageBay.displayMessage("WARNING: There is no corrosponding " + group + "1 for the specified group " + group + ".  Group permissions will not apply.");
Note: See TracChangeset for help on using the changeset viewer.