Changeset 1532


Ignore:
Timestamp:
08/31/20 16:26:59 (4 years ago)
Author:
bnemhaus
Message:

New feature: when creating a frameset, if the item being used is linked and you hold shift, it will use the items on the linked frame to populate the zero frame of the new frameset

Location:
trunk/src/org
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/apollo/ApolloKBMGestureTranslator.java

    r1133 r1532  
    142142                               
    143143                                // Return the gesture
    144                                 return apolloSingle(ApolloGestureType.CREATE_LINKED_TRACKS, new ItemSpecificGestureData());
     144                                boolean isShiftDown = StandardInputEventListeners.kbmStateListener.isKeyDown(Key.SHIFT);
     145                                return apolloSingle(ApolloGestureType.CREATE_LINKED_TRACKS, new ItemSpecificGestureData(isShiftDown));
    145146                        }
    146147                });
  • trunk/src/org/apollo/gio/gesture/data/TrackAdjustmentGestureData.java

    r1097 r1532  
    99        public TrackAdjustmentGestureData(long adjustment)
    1010        {
     11                super(false);
    1112                _adjustment = adjustment;
    1213        }
  • trunk/src/org/expeditee/actions/ScriptBase.java

    r1415 r1532  
    213213            errorFrame = FrameIO.CreateFrame(ERROR_FRAMESET, title, null);
    214214        } else {
    215             errorFrame = FrameIO.CreateFrameset(ERROR_FRAMESET, FrameIO.FRAME_PATH);
     215            errorFrame = FrameIO.CreateFrameset(ERROR_FRAMESET, FrameIO.FRAME_PATH, null);
    216216            errorFrame.setTitle(title);
    217217        }
  • trunk/src/org/expeditee/actions/Simple.java

    r1415 r1532  
    21872187                                try {
    21882188                                        FrameIO.CreateFrameset(freshCopy.getFramesetName(),
    2189                                                         frameToCopy.getPath());
     2189                                                        frameToCopy.getPath(), null);
    21902190                                        nextNumber = 1;
    21912191                                } catch (Exception e) {
  • trunk/src/org/expeditee/agents/CopyTree.java

    r1415 r1532  
    5656                        // get the last used frame in the destination frameset
    5757                        _lastNumber = FrameIO.getLastNumber(_nameTo);
    58                         Frame one = FrameIO.CreateFrameset(_nameTo, init.getPath());
     58                        Frame one = FrameIO.CreateFrameset(_nameTo, init.getPath(), null);
    5959
    6060                        _framePath = one.getPath();
  • trunk/src/org/expeditee/agents/GraphFramesetLinks.java

    r1415 r1532  
    8282                try {
    8383                        // Creating frameset that is used to hold any generated link graphs
    84                         FrameIO.CreateNewFrameset(resultsFramesetName);
     84                        FrameIO.CreateNewFrameset(resultsFramesetName, null);
    8585                } catch (Exception e2) {
    8686                        // frameset already exists
  • trunk/src/org/expeditee/gio/gesture/ExpediteeKBMGestureTranslator.java

    r1502 r1532  
    573573                                }
    574574                               
    575                                 // Return the gesture
    576                                 return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.TOGGLE_ANNOTATION), new ItemSpecificGestureData());
     575                                boolean isShiftDown = kbmTranslator.isKeyDown(Key.SHIFT);
     576                               
     577                                // Return the gesture
     578                                return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.TOGGLE_ANNOTATION), new ItemSpecificGestureData(isShiftDown));
    577579                        }
    578580                });
     
    594596                                }
    595597                               
    596                                 // Return the gesture
    597                                 return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.INSERT_DATE), new ItemSpecificGestureData());
     598                                boolean isShiftDown = kbmTranslator.isKeyDown(Key.SHIFT);
     599                               
     600                                // Return the gesture
     601                                return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.INSERT_DATE), new ItemSpecificGestureData(isShiftDown));
    598602                        }
    599603                });
     
    615619                                }
    616620                               
    617                                 // Return the gesture
    618                                 return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.NEW_FRAMESET), new ItemSpecificGestureData());
     621                                boolean isShiftDown = kbmTranslator.isKeyDown(Key.SHIFT);
     622                               
     623                                // Return the gesture
     624                                return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.NEW_FRAMESET), new ItemSpecificGestureData(isShiftDown));
    619625                        }
    620626                });
     
    636642                                }
    637643                               
    638                                 // Return the gesture
    639                                 return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.ROTATE_FONT_STYLE), new ItemSpecificGestureData());
     644                                boolean isShiftDown = kbmTranslator.isKeyDown(Key.SHIFT);
     645                               
     646                                // Return the gesture
     647                                return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.ROTATE_FONT_STYLE), new ItemSpecificGestureData(isShiftDown));
    640648                        }
    641649                });
     
    657665                                }
    658666                               
    659                                 // Return the gesture
    660                                 return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.ROTATE_FONT_FAMILY), new ItemSpecificGestureData());
     667                                boolean isShiftDown = kbmTranslator.isKeyDown(Key.SHIFT);
     668                               
     669                                // Return the gesture
     670                                return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.ROTATE_FONT_FAMILY), new ItemSpecificGestureData(isShiftDown));
    661671                        }
    662672                });
     
    816826                                }
    817827                               
    818                                 // Return the gesture
    819                                 return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.CALCULATE), new ItemSpecificGestureData());
     828                                boolean isShiftDown = kbmTranslator.isKeyDown(Key.SHIFT);
     829                               
     830                                // Return the gesture
     831                                return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.CALCULATE), new ItemSpecificGestureData(isShiftDown));
    820832                        }
    821833                });
     
    843855                               
    844856                                // Return the gesture
    845                                 return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.CALCULATE), new ItemSpecificGestureData());
     857                                return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.CALCULATE), new ItemSpecificGestureData(false));
    846858                        }
    847859                });
     
    920932                                }
    921933                               
    922                                 // Return the gesture
    923                                 return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.ACTION), new ItemSpecificGestureData());
     934                                boolean isShiftDown = kbmTranslator.isKeyDown(Key.SHIFT);
     935                               
     936                                // Return the gesture
     937                                return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.ACTION), new ItemSpecificGestureData(isShiftDown));
    924938                        }
    925939                });
     
    946960                                }
    947961                               
    948                                 // Return the gesture
    949                                 return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.TOGGLE_BOLD), new ItemSpecificGestureData());
     962                                boolean isShiftDown = kbmTranslator.isKeyDown(Key.SHIFT);
     963                               
     964                                // Return the gesture
     965                                return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.TOGGLE_BOLD), new ItemSpecificGestureData(isShiftDown));
    950966                        }
    951967                });
     
    973989                               
    974990                                // Return the gesture
    975                                 return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.TOGGLE_ITALICS), new ItemSpecificGestureData());
     991                                return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.TOGGLE_ITALICS), new ItemSpecificGestureData(false));
    976992                        }
    977993                });
     
    10251041                               
    10261042                                // Return the gesture
    1027                                 return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.COPY), new ItemSpecificGestureData());
     1043                                return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.COPY), new ItemSpecificGestureData(false));
    10281044                        }
    10291045                });
     
    10561072                               
    10571073                                // Return the gesture
    1058                                 return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.MAKE_CIRCLE), new ItemSpecificGestureData());
     1074                                return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.MAKE_CIRCLE), new ItemSpecificGestureData(false));
    10591075                        }
    10601076                });
     
    11081124                               
    11091125                                // Return the gesture
    1110                                 return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.TOGGLE_ITEMS_MARK), new ItemSpecificGestureData());
     1126                                return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.TOGGLE_ITEMS_MARK), new ItemSpecificGestureData(false));
    11111127                        }
    11121128                });
     
    13721388                               
    13731389                                // Return the gesture
    1374                                 return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.SPLIT_TEXT), new ItemSpecificGestureData());
     1390                                return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.SPLIT_TEXT), new ItemSpecificGestureData(false));
    13751391                        }
    13761392                });
     
    20672083                                        }
    20682084                                       
    2069                                         return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.TOGGLE_ARROWHEAD), new ItemSpecificGestureData(line));
     2085                                        return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.TOGGLE_ARROWHEAD), new ItemSpecificGestureData(line, false));
    20702086                                }
    20712087                               
     
    21512167                               
    21522168                                // Return the gesture
    2153                                 return standardSingle(StandardGestureType.EXTRACT_ATTRIBUTES, new ItemSpecificGestureData());
     2169                                return standardSingle(StandardGestureType.EXTRACT_ATTRIBUTES, new ItemSpecificGestureData(false));
    21542170                        }
    21552171                });
  • trunk/src/org/expeditee/gio/gesture/StandardGestureActions.java

    r1513 r1532  
    669669                                ItemSpecificGestureData data = (ItemSpecificGestureData) gesture.getData();
    670670                                if (data.getCurrentItem() != null) {
    671                                         CreateFrameset(data.getCurrentItem());
     671                                        CreateFrameset(data.getCurrentItem(), data.isShiftDown());
    672672                                }
    673673                        }
     
    29472947        /**
    29482948         * Creates a new Frameset with the name given by the Item
    2949          *
    2950          * @param name
     2949         * @param useLinkForZeroFrame if true, will try to use the content from
     2950         * the frame specified by the link as the zero frame for new frameset
    29512951         */
    2952         private static void CreateFrameset(Item item) {
     2952        private static void CreateFrameset(Item item, boolean useLinkForZeroFrame) {
    29532953                if (item == null) {
    29542954                        MessageBay.displayMessage("There is no selected item to use for the frameset name");
     
    29612961                }
    29622962
     2963                // Collect Items to place on new zero frame.
     2964                Collection<Item> zeroLinkItems = null;
    29632965                // Don't create frameset if the item is linked
    2964                 if (item.getLink() != null) {
    2965                         MessageBay.displayMessage("A frameset can not be created from a linked item");
     2966                if (item.getLink() != null && !useLinkForZeroFrame) {
     2967                        MessageBay.displayMessage("A frameset can not be created from a linked item without holding shift.  Hold shift while pressing F6 to use items on linked frame to populate zero frame.");
    29662968                        return;
     2969                } else if (item.getLink() != null && useLinkForZeroFrame) {
     2970                        Frame frameToUseForZeroFrameCreation = FrameIO.LoadFrame(item.getLink());
     2971                        if (frameToUseForZeroFrameCreation != null) {
     2972                                zeroLinkItems = frameToUseForZeroFrameCreation.getBody(true).cloneList();
     2973                        }
    29672974                }
    29682975
     
    29802987                                String groupName = name.substring(7);
    29812988                                // create the new group
    2982                                 linkTo = FrameIO.CreateNewGroup(groupName);
     2989                                linkTo = FrameIO.CreateNewGroup(groupName, zeroLinkItems);
    29832990                        } else {
    29842991                                // create the new frameset
    2985                                 linkTo = FrameIO.CreateNewFrameset(name);
     2992                                linkTo = FrameIO.CreateNewFrameset(name, zeroLinkItems);
    29862993                        }
    29872994                        DisplayController.setCursor(Item.DEFAULT_CURSOR);
  • trunk/src/org/expeditee/gio/gesture/data/ChangeColourGestureData.java

    r1097 r1532  
    88        public ChangeColourGestureData(boolean setTransparent, boolean setSecondaryColour)
    99        {
    10                 super();
     10                super(false);
    1111                _setTransparent = setTransparent;
    1212                _setSecondaryColour = setSecondaryColour;
  • trunk/src/org/expeditee/gio/gesture/data/ClickGestureData.java

    r1097 r1532  
    77        public ClickGestureData(boolean longClick)
    88        {
    9                 super();
     9                super(false);
    1010                _longClick = longClick;
    1111        }
  • trunk/src/org/expeditee/gio/gesture/data/CreateItemGestureData.java

    r1097 r1532  
    1212        public CreateItemGestureData(ItemType itemType)
    1313        {
    14                 super();
     14                super(false);
    1515                _itemType = itemType;
    1616        }
  • trunk/src/org/expeditee/gio/gesture/data/DeleteGestureData.java

    r1097 r1532  
    77        public DeleteGestureData(boolean alternateMode)
    88        {
    9                 super();
     9                super(false);
    1010                _alternateMode = alternateMode;
    1111        }
  • trunk/src/org/expeditee/gio/gesture/data/InsertStringGestureData.java

    r1097 r1532  
    44       
    55        private String _string;
    6         private boolean _shiftDown; // Required for Shift+Tab
    7        
    86        public InsertStringGestureData(String string, boolean shiftDown)
    97        {
    10                 super();
     8                super(false);
    119                _string = string;
    1210                _shiftDown = shiftDown;
     
    1513        public InsertStringGestureData(char c, boolean shiftDown)
    1614        {
    17                 super();
     15                super(false);
    1816                _string = new String("" + c);
    1917                _shiftDown = shiftDown;
     
    3230        }
    3331       
    34         public boolean isShiftDown()
    35         {
    36                 return _shiftDown;
    37         }
    38        
    3932        @Override
    4033        public GestureData clone()
  • trunk/src/org/expeditee/gio/gesture/data/ItemSpecificGestureData.java

    r1097 r1532  
    1414        protected Collection<Item> _currentItems;
    1515        protected Collection<Item> _enclosure;
     16        protected boolean _shiftDown;
    1617       
    17         public ItemSpecificGestureData(Item item)
     18        public ItemSpecificGestureData(Item item, boolean isShiftDown)
    1819        {
    1920                super();
    2021                _currentItem = item;
     22                _shiftDown = isShiftDown;
    2123        }
    2224       
    23         public ItemSpecificGestureData()
     25        public ItemSpecificGestureData(boolean isShiftDown)
    2426        {
    2527                super();
    2628                init();
     29                _shiftDown = isShiftDown;
    2730        }
    2831       
     
    8386                return new ItemSpecificGestureData(this);
    8487        }
     88
     89        public boolean isShiftDown() {
     90                return _shiftDown;
     91        }
    8592}
  • trunk/src/org/expeditee/gio/gesture/data/JustifyGestureData.java

    r1097 r1532  
    1111        public JustifyGestureData(boolean resetWidth)
    1212        {
    13                 super();
     13                super(false);
    1414                _frame = DisplayController.getCurrentFrame();
    1515                _resetWidth = resetWidth;
     
    1818        public JustifyGestureData(Frame frame, boolean resetWidth)
    1919        {
    20                 super();
     20                super(false);
    2121                _frame = frame;
    2222                _resetWidth = resetWidth;
  • trunk/src/org/expeditee/gio/gesture/data/LinkGestureData.java

    r1097 r1532  
    77        public LinkGestureData(boolean follow)
    88        {
    9                 super();
     9                super(false);
    1010                _follow = follow;
    1111        }
  • trunk/src/org/expeditee/gio/gesture/data/NavigateTextGestureData.java

    r1097 r1532  
    2323        public NavigateTextGestureData(NavigateTo navigateTo, boolean selecting)
    2424        {
    25                 super();
     25                super(false);
    2626                _navigateTo = navigateTo;
    2727                _selecting = selecting;
  • trunk/src/org/expeditee/gio/gesture/data/ScaleGestureData.java

    r1097 r1532  
    1414        public ScaleGestureData(int scaleFactor)
    1515        {
    16                 super();
     16                super(false);
    1717                _scaleFactor = scaleFactor;             
    1818        }
  • trunk/src/org/expeditee/gio/gesture/data/SelectAreaGestureData.java

    r1097 r1532  
    2727        public SelectAreaGestureData()
    2828        {
    29                 super();
     29                super(false);
    3030                _draggedFrom = null;
    3131                _finishedDragging = true;
  • trunk/src/org/expeditee/gui/FrameCreator.java

    r1505 r1532  
    169169                                toUse = FrameIO.CreateFrame(framesetName, frameTitle, null);
    170170                        } else {
    171                                 toUse = FrameIO.CreateFrameset(framesetName, path.toAbsolutePath().toString() + File.separator, true);
     171                                toUse = FrameIO.CreateFrameset(framesetName, path.toAbsolutePath().toString() + File.separator, true, null);
    172172                        }
    173173                       
  • trunk/src/org/expeditee/gui/FrameIO.java

    r1505 r1532  
    816816                        // create the new frameset
    817817                        Frame one = FrameIO.CreateFrameset(DELETED_FRAMES, toDelete
    818                                         .getPath());
     818                                        .getPath(), null);
    819819                        framePath = one.getPath();
    820820                        lastNumber = 0;
     
    10151015         * @param frameset
    10161016         *            The name of the Frameset to create
     1017         * @param zeroFrameItems TODO
    10171018         * @return The first Frame of the new Frameset (Frame.1)
    10181019         */
    1019         public static Frame CreateFrameset(String frameset, String path)
     1020        public static Frame CreateFrameset(String frameset, String path, Collection<Item> zeroFrameItems)
    10201021                        throws Exception {
    1021                 return CreateFrameset(frameset, path, false);
     1022                return CreateFrameset(frameset, path, false, zeroFrameItems);
    10221023        }
    10231024
     
    12571258                                } catch (RuntimeException e) {
    12581259                                        try {
    1259                                                 CreateFrameset(oldFramesetName, toSave.getPath());
     1260                                                CreateFrameset(oldFramesetName, toSave.getPath(), null);
    12601261                                                nextnum = 1;
    12611262                                        } catch (Exception e1) {
     
    15841585         * @param name
    15851586         *            The Frameset name to use
     1587         * @param zeroFrameItems TODO
    15861588         * @return The name of the first Frame in the newly created Frameset (the .1
    15871589         *         frame)
    15881590         */
    1589         public static Frame CreateNewFrameset(String name) throws Exception {
     1591        public static Frame CreateNewFrameset(String name, Collection<Item> zeroFrameItems) throws Exception {
    15901592                String path = DisplayController.getCurrentFrame().getPath();
    15911593
     
    15951597                }
    15961598
    1597                 Frame newFrame = FrameIO.CreateFrameset(name, path);
     1599                Frame newFrame = FrameIO.CreateFrameset(name, path, zeroFrameItems);
    15981600
    15991601                if (newFrame == null) {
    16001602                        // Cant create directories if the path is readonly or there is no
    16011603                        // space available
    1602                         newFrame = FrameIO.CreateFrameset(name, FrameIO.FRAME_PATH);
     1604                        newFrame = FrameIO.CreateFrameset(name, FrameIO.FRAME_PATH, zeroFrameItems);
    16031605                }
    16041606
     
    16101612        }
    16111613       
    1612         public static Frame CreateNewGroup(String name) {
     1614        public static Frame CreateNewGroup(String name, Collection<Item> zeroFrameItems) {
    16131615                try {
    1614                         Frame oneFrame = FrameIO.CreateFrameset(name, FrameIO.GROUP_PATH);
     1616                        Frame oneFrame = FrameIO.CreateFrameset(name, FrameIO.GROUP_PATH, zeroFrameItems);
    16151617                        oneFrame.setPermission(new PermissionTriple(UserAppliedPermission.full, UserAppliedPermission.none, UserAppliedPermission.none));
    16161618                       
     
    16941696        }
    16951697
    1696         public static Frame CreateFrameset(String frameset, String path, boolean recreate) throws InvalidFramesetNameException, ExistingFramesetException {
     1698        public static Frame CreateFrameset(String frameset, String path, boolean recreate, Collection<Item> zeroFrameItems) throws InvalidFramesetNameException, ExistingFramesetException {
    16971699                String conversion = frameset + " --> ";
    16981700
     
    17721774                base.setPath(path);
    17731775                base.change();
     1776                if (zeroFrameItems != null) {
     1777                        base.addAllItems(zeroFrameItems);
     1778                }
    17741779                SaveFrame(base, false);
    17751780
  • trunk/src/org/expeditee/gui/management/ProfileManager.java

    r1465 r1532  
    3939               
    4040                try {
    41                         Frame profile = FrameIO.CreateFrameset(profileFor, FrameIO.PROFILE_PATH, true);
     41                        Frame profile = FrameIO.CreateFrameset(profileFor, FrameIO.PROFILE_PATH, true, null);
    4242                        profileOne = profile;
    4343                        profile.setTitle(profileFor + "'s Profile");
     
    148148        private static void createDefaultProfile() {
    149149                try {
    150                         Frame profile = FrameIO.CreateFrameset(DEFAULT, FrameIO.PROFILE_PATH, true);
     150                        Frame profile = FrameIO.CreateFrameset(DEFAULT, FrameIO.PROFILE_PATH, true, null);
    151151                       
    152152                        // Give the first frame in the new profile an appropriate title.
  • trunk/src/org/expeditee/importer/pdfImporter.java

    r1441 r1532  
    7272                try
    7373                {
    74                         frameset = FrameIO.CreateNewFrameset(name);
     74                        frameset = FrameIO.CreateNewFrameset(name, null);
    7575                }
    7676                catch(Exception e)
  • trunk/src/org/expeditee/io/WebParser.java

    r1415 r1532  
    335335                        final Progress progressBar = MessageBay.displayProgress("Converting web page");
    336336
    337                         final Frame frameset = FrameIO.CreateNewFrameset(FrameIO.ConvertToValidFramesetName((new SimpleDateFormat("yy-MM-dd-HH-mm-ss").format(new Date())) + pageTitle));
     337                        final Frame frameset = FrameIO.CreateNewFrameset(FrameIO.ConvertToValidFramesetName((new SimpleDateFormat("yy-MM-dd-HH-mm-ss").format(new Date())) + pageTitle), null);
    338338
    339339                        frameset.setTitle(pageTitle);
  • trunk/src/org/expeditee/simple/Context.java

    r919 r1532  
    275275                        // Get the values to be set
    276276                        framesetName = primitives_.getStringValue(framesetNameVar);
    277                         Frame firstFrame = FrameIO.CreateNewFrameset(framesetName);
     277                        Frame firstFrame = FrameIO.CreateNewFrameset(framesetName, null);
    278278                        success = firstFrame != null;
    279279                } catch (Exception e) {
  • trunk/src/org/expeditee/stats/StatsLogger.java

    r1274 r1532  
    7979                                Frame statsFrame = null;
    8080                                if (FrameIO.LoadFrame(statsFrameset + "0") == null) {
    81                                         statsFrame = FrameIO.CreateNewFrameset(statsFrameset);
     81                                        statsFrame = FrameIO.CreateNewFrameset(statsFrameset, null);
    8282                                        statsFrame.setTitle(Formatter.getDateTime());
    8383                                } else {
Note: See TracChangeset for help on using the changeset viewer.