Ignore:
Timestamp:
07/24/19 11:23:45 (5 years ago)
Author:
bln4
Message:

Renamed Frame.getItems() to Frame.getSortedItems() to better represent its functionality.

-> org.apollo.ApolloGestureActions
-> org.apollo.ApolloSystem
-> org.expeditee.actions.Actions
-> org.expeditee.actions.Debug
-> org.expeditee.actions.ExploratorySearchActions
-> org.expeditee.actions.JfxBrowserActions
-> org.expeditee.actions.Misc
-> org.expeditee.actions.Navigation
-> org.expeditee.actions.ScriptBase
-> org.expeditee.actions.Simple
-> org.expeditee.agents.ComputeTree
-> org.expeditee.agents.CopyTree
-> org.expeditee.agents.DisplayComet
-> org.expeditee.agents.DisplayTree
-> org.expeditee.agents.DisplayTreeLeaves
-> org.expeditee.agents.GraphFramesetLinks
-> org.expeditee.agents.TreeProcessor
-> org.expeditee.gio.gesture.StandardGestureActions
-> org.expeditee.gui.DisplayController
-> org.expeditee.gui.FrameCreator
-> org.expeditee.gui.FrameIO
-> org.expeditee.io.DefaultTreeWriter
-> org.expeditee.io.JavaWriter
-> org.expeditee.io.PDF2Writer
-> org.expeditee.io.TXTWriter
-> org.expeditee.io.WebParser
-> org.expeditee.io.flowlayout.XGroupItem
-> org.expeditee.items.Dot
-> org.expeditee.items.Item
-> org.expeditee.items.ItemUtils
-> org.expeditee.network.FrameShare
-> org.expeditee.stats.TreeStats


Created ItemsList class to wrap ArrayList<Item>. Frames now use this new class to store its body list (used for display) as well as its primaryBody and surrogateBody.

-> org.expeditee.agents.Format
-> org.expeditee.agents.HFormat
-> org.expeditee.gio.gesture.StandardGestureActions
-> org.expeditee.gui.Frame
-> org.expeditee.gui.FrameUtils


Refactorted Frame.setResort(bool) to Frame.invalidateSorted() to better function how it is intended to with a more accurate name.

-> org.expeditee.agents.Sort


When writing out .exp files and getting attributes to respond to LEFT + RIGHT click, boolean items are by default true. This has always been the case. An ammendment to this is that defaults can now be established.
Also added 'EnterClick' functionality. If cursored over a item with this property and you press enter, it acts as if you have clicked on it instead.

-> org.expeditee.assets.resources-public.framesets.authentication.1.exp to 6.exp
-> org.expeditee.gio.gesture.StandardGestureActions
-> org.expeditee.gio.input.KBMInputEvent
-> org.expeditee.gio.javafx.JavaFXConversions
-> org.expeditee.gio.swing.SwingConversions
-> org.expeditee.gui.AttributeUtils
-> org.expeditee.io.Conversion
-> org.expeditee.io.DefaultFrameWriter
-> org.expeditee.items.Item


Fixed a bug caused by calling Math.abs on Integer.MIN_VALUE returning unexpected result. Due to zero being a thing, you cannot represent Math.abs(Integer.MIN_VALUE) in a Integer object. The solution is to use Integer.MIN_VALUE + 1 instead of Integer.MIN_VALUE.

-> org.expeditee.core.bounds.CombinationBounds
-> org.expeditee.io.flowlayout.DimensionExtent


Recoded the contains function in EllipticalBounds so that intersection tests containing circles work correctly.

-> org.expeditee.core.bounds.EllipticalBounds


Added toString() to PolygonBounds to allow for useful printing during debugging.

-> org.expeditee.core.bounds.PolygonBounds

Implemented Surrogate Mode!

-> org.expeditee.encryption.io.EncryptedExpReader
-> org.expeditee.encryption.io.EncryptedExpWriter
-> org.expeditee.encryption.items.surrogates.EncryptionDetail
-> org.expeditee.encryption.items.surrogates.Label
-> org.expeditee.gui.FrameUtils
-> org.expeditee.gui.ItemsList
-> org.expeditee.items.Item
-> org.expeditee.items.Text


???? Use Integer.MAX_VALUE cast to a float instead of Float.MAX_VALUE. This fixed some bug which I cannot remember.

-> org.expeditee.gio.TextLayoutManager
-> org.expeditee.gio.swing.SwingTextLayoutManager


Improved solution for dealing with the F10 key taking focus away from Expeditee due to it being a assessibility key.

-> org.expeditee.gio.swing.SwingInputManager


Renamed variable visibleItems in FrameGraphics.paintFrame to itemsToPaintCanditates to better represent functional intent.

-> org.expeditee.gui.FrameGraphics


Improved checking for if personal resources exist before recreating them

-> org.expeditee.gui.FrameIO


Repeated messages to message bay now have a visual feedback instead of just a beep. This visual feedback is in the form of a count of the amount of times it has repeated.

-> org.expeditee.gui.MessageBay


Updated comment on the Vector class to explain what vectors are.

-> org.expeditee.gui.Vector


Added constants to represent all of the property keys in DefaultFrameReader and DefaultFrameWriter.

-> org.expeditee.io.DefaultFrameReader
-> org.expeditee.io.DefaultFrameWriter


Updated the KeyList setting to be more heirarcial with how users will store their Secrets.

-> org.expeditee.settings.identity.secrets.KeyList

File:
1 edited

Legend:

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

    r1414 r1415  
    7777 *
    7878 */
    79 public class Frame /*implements Cloneable*/ {
     79public class Frame {
    8080       
    8181        /** The frame number to indicate this is a virtual frame. */
     
    126126
    127127        private boolean _isLocal = true;
    128 
    129         private boolean _sorted = true;
    130128       
    131129        /** Whether the frame has changed and therefore needs saving. */
     
    139137        private Stack<History> _redo = new Stack<History>();
    140138
    141         private List<Item> _body = new ArrayList<Item>();
    142         private List<Item> _bodyHiddenDueToPermissions = new ArrayList<Item>();
    143         private List<Item> _surrogates = new ArrayList<Item>();
     139        private ItemsList _body = new ItemsList();
     140        private ItemsList _bodyHiddenDueToPermissions = new ItemsList();
     141        private ItemsList _primaryItemsBody = new ItemsList();
     142        private ItemsList _surrogateItemsBody = new ItemsList();
     143       
     144        //private List<Item> _body = new ArrayList<Item>();
     145        //private List<Item> _bodyHiddenDueToPermissions = new ArrayList<Item>();
     146        //private List<Item> _primaryItemsBody = new ArrayList<Item>();
     147        //private List<Item> _surrogateItemsBody = new ArrayList<Item>();
    144148
    145149        // for drawing purposes
     
    184188        private String _groupFrameName;
    185189        private Frame _groupFrame = null;
     190       
     191        public enum BodyType {
     192                BodyDisplay, PrimaryBody, SurrogateBody;
     193        }
    186194
    187195        /** Default constructor, nothing is set. */
    188196        public Frame() {
    189197        }
    190        
    191 //      public Frame clone() {
    192 //              Frame clone = new Frame();
    193 //              for (Item i: this._body) {
    194 //                      Item copy = i.copy();
    195 //                      copy.setID(i.getID()); 
    196 //                      clone._body.add(copy);
    197 //              }
    198 //              for(Item i: this._bodyHiddenDueToPermissions) {
    199 //                      Item copy = i.copy();
    200 //                      copy.setID(i.getID());
    201 //                      clone._bodyHiddenDueToPermissions.add(i);
    202 //              }
    203 //              if (this._frameName != null) {
    204 //                      clone._frameName = this._frameName.copy();
    205 //              }
    206 //              for(Overlay key: this._overlays.keySet()) {
    207 //                      clone._overlays.put(key, this._overlays.get(key));
    208 //              }
    209 //              for(Vector v: this._vectors) {
    210 //                      clone._vectors.add(v);
    211 //              }
    212 //              for (Item i: this._interactableItems) {
    213 //                      clone._interactableItems.add(i.copy());
    214 //              }
    215 //              for (Item i: this._overlayItems) {
    216 //                      clone._overlayItems.add(i.copy());
    217 //              }
    218 //              for (Item i: this._vectorItems) {
    219 //                      clone._vectorItems.add(i.copy());
    220 //              }
    221 //              clone._frameData = this._frameData;
    222 //              clone._frameset = this._frameset;
    223 //              clone._number = this._number;
    224 //              clone._version = this._version;
    225 //              clone._permissionTriple = this._permissionTriple;
    226 //              clone._owner = this._owner;
    227 //              clone._creationDate = this._creationDate;
    228 //              clone._modifiedUser = this._modifiedUser;
    229 //              clone._modifiedDate = this._modifiedDate;
    230 //              clone._modifiedDatePrecise = this._modifiedDatePrecise;
    231 //              clone._frozenDate = this._frozenDate;
    232 //              clone._background = this._background;
    233 //              clone._foreground = this._foreground;
    234 //              clone.path = this.path;
    235 //              clone._isLocal = this._isLocal;
    236 //              clone._sorted = this._sorted;
    237 //              clone._change = this._change;
    238 //              clone._saved = this._saved;
    239 //              clone._lineCount = this._lineCount;
    240 //              clone._itemCount = this._itemCount;
    241 //              clone._buffer = this._buffer;
    242 //              clone._validBuffer = this._validBuffer;
    243 //              clone._activeTime = (Time) this._activeTime.clone();
    244 //              clone._darkTime = (Time) this._darkTime.clone();
    245 //              clone._dotTemplate = this._dotTemplate.copy();
    246 //             
    247 //              return clone;
    248 //      }
    249 
    250         public boolean isReadOnly()
    251         {
     198
     199        public boolean isReadOnly() {
    252200                return !_frameName.hasPermission(UserAppliedPermission.full) && !_protectionChanged;
    253201        }
    254202
    255         public void reset()
    256         {
     203        public void reset()     {
    257204                refreshItemPermissions(UserAppliedPermission.full);
    258205                resetDot();
     
    403350         * @return The list of Item objects that are on this Frame.
    404351         */
    405         public List<Item> getItems(boolean visible)
    406         {
    407                 if (!_sorted) {
    408                         for(int i = 0; i < _body.size();) {
    409                                 if(_body.get(i) == null) {
    410                                         _body.remove(i);
    411                                 } else {
    412                                         i++;
    413                                 }
    414                         }
    415                         Collections.sort(_body);
    416                         _sorted = true;
    417                 }
    418 
     352        public List<Item> getSortedItems(boolean requireVisible) {
     353                ItemsList listToLoopOver = _body;
     354                listToLoopOver.sort();
     355                return getItems(requireVisible, listToLoopOver);
     356        }
     357       
     358        public List<Item> getItems(boolean requireVisible, ItemsList listToLoopOver) {
    419359                List<Item> items = new ArrayList<Item>();
    420360
    421                 for (Item i : _body) {
     361                for (Item i: listToLoopOver) {
    422362                        if (i == null) {
    423363                                continue;
    424364                        }
    425365                       
    426                         if (i.isVisible() || (!visible && !i.isDeleted())) {
     366                        if (meetsVisibilityRequirements(requireVisible, i)) {
    427367                                items.add(i);
    428368                        }
     
    431371                return items;
    432372        }
    433 
     373       
    434374        /** TODO: Comment. cts16 */
    435         public List<Item> getItems()
    436         {
    437                 return getItems(false);
     375        public List<Item> getSortedItems()
     376        {
     377                return getSortedItems(false);
    438378        }
    439379
     
    443383         * @return True if this frame contains i.
    444384         */
    445         public boolean containsItem(Item i)
    446         {
     385        public boolean containsItem(Item i) {
    447386                if (i == null) {
    448387                        throw new NullPointerException("i");
    449                 }
    450                
     388                }       
    451389                return _body.contains(i);
    452390        }
     
    468406                List<Text> bodyTextItems = new ArrayList<Text>();
    469407               
    470                 for (Item i : getItems(true)) {
     408                for (Item i : getSortedItems(true)) {
    471409                        // only add up normal body text items
    472410                        if ((i instanceof Text) && ((includeAnnotations && !((Text) i).isSpecialAnnotation()) || !i.isAnnotation()) && !i.isLineEnd()) {
     
    483421        {
    484422                Collection<Item> items = new ArrayList<Item>();
    485                 for (Item i : getItems(true)) {
     423                for (Item i : getSortedItems(true)) {
    486424                        // only add up normal body text items
    487425                        if (!i.isAnnotation()) {
     
    505443        public Item getLastNonAnnotationTextItem()
    506444        {
    507                 List<Item> items = getItems();
     445                List<Item> items = getSortedItems();
    508446
    509447                // find the last non-annotation text item
     
    910848         *            The date to set as the last frozen date.
    911849         */
    912         public void setFrozenDate(String date)  {
     850        public void setFrozenDate(String date) {
    913851                _frozenDate = date;
    914852        }
    915853
    916         public void setResort(boolean value)
    917         {
    918                 _sorted = !value;
     854        public void invalidateSorted() {
     855                _body.invalidateSorted();
    919856        }
    920857
     
    925862         *            The Item to add to this Frame.
    926863         */
    927         public void addItem(Item item)
    928         {
     864        public void addItem(Item item) {
    929865                addItem(item, true);
    930866        }
    931867
    932         public void addItem(Item item, boolean recalculate)
    933         {
    934                 if (item == null || item.equals(_frameName) || _body.contains(item)) {
     868        public void addItem(Item item, boolean recalculate)     {
     869                if (item == null) { return; }
     870               
     871                addItem(item, recalculate, _body);
     872                if (item.isSurrogate()) {
     873                        addItem(item, recalculate, _surrogateItemsBody);
     874                } else {
     875                        addItem(item, recalculate, _primaryItemsBody);
     876                }
     877        }
     878       
     879        protected void addItem(Item item, boolean recalculate, ItemsList list) {
     880                if (item == null || item.equals(_frameName) || list.contains(item)) {
    935881                        return;
    936882                }
     
    948894                _itemCount = Math.max(_itemCount, item.getID());
    949895
    950                 _body.add(item);
     896                list.add(item);
    951897                item.setParent(this);
    952898                item.setFloating(false); // esnure that it is anchored
     
    959905                        item.setPosition(item.getPosition());
    960906                }
    961 
    962                 _sorted = false;
     907               
     908                list.invalidateSorted();
    963909
    964910                // item.setMaxWidth(FrameGraphics.getMaxFrameSize().width);
     
    983929        }
    984930       
    985         public void addToSurrogates(Item surrogate) {
    986                 this._surrogates.add(surrogate);
     931        public void addToSurrogatesOnLoad(Item surrogate, Item parent) {
     932                parent.addToSurrogates(surrogate);
    987933        }
    988934
     
    991937                boolean bReparse = false;
    992938               
    993                 for (Item i : getItems()) {
     939                for (Item i : getSortedItems()) {
    994940                        Integer anchorLeft   = i.getAnchorLeft();
    995941                        Integer anchorRight  = i.getAnchorRight();
     
    1039985        }
    1040986
    1041         public void addAllItems(Collection<Item> toAdd)
    1042         {
     987        public void addAllItems(Collection<Item> toAdd) {
     988                addAllItems(toAdd, _body);
     989                addAllItems(toAdd, _primaryItemsBody);
     990        }
     991       
     992        protected void addAllItems(Collection<Item> toAdd, ItemsList list) {
    1043993                for (Item i : toAdd) {
    1044994                        // If an annotation is being deleted clear the annotation list
     
    1047997                        }
    1048998                        // TODO Improve efficiency when addAll is called
    1049                         addItem(i);
    1050                 }
    1051         }
    1052 
    1053         public void removeAllItems(Collection<Item> toRemove)
    1054         {
     999                        addItem(i, true, list);
     1000                }
     1001        }
     1002
     1003        public void removeAllItems(Collection<Item> toRemove) {
    10551004                for (Item i : toRemove) {
    10561005                        // If an annotation is being deleted clear the annotation list
     
    10661015        }
    10671016
    1068         public void removeItem(Item item, boolean recalculate)
    1069         {
     1017        public void removeItem(Item item, boolean recalculate) {
     1018                removeItem(item, recalculate, _body);
     1019                if (item.isSurrogate()) {
     1020                        removeItem(item, recalculate, _surrogateItemsBody);
     1021                } else {
     1022                        removeItem(item, recalculate, _primaryItemsBody);
     1023                }
     1024        }
     1025       
     1026        protected void removeItem(Item item, boolean recalculate, ItemsList toRemoveFrom) {
    10701027                // If an annotation is being deleted clear the annotation list
    10711028                if (item.isAnnotation()) {
     
    10731030                }
    10741031
    1075                 if (_body.remove(item)) {
     1032                if (toRemoveFrom.remove(item)) {
    10761033                        change();
    10771034                        // Remove widgets from the widget list
     
    10981055         * @param type  The type of event that occurred
    10991056         */
    1100         private void addToUndo(Collection<Item> items, History.Type type)
    1101         {
     1057        private void addToUndo(ItemsList items, History.Type type) {
    11021058                if (items.size() < 1) {
    11031059                        return;
     
    11071063        }
    11081064       
    1109         public void addToUndoDelete(Collection<Item> items)
    1110         {
     1065        public void addToUndoDelete(ItemsList items) {
    11111066                addToUndo(items, History.Type.deletion);
    11121067        }
    11131068       
    1114         public void addToUndoMove(Collection<Item> items)
    1115         {
     1069        public void addToUndoMove(ItemsList items) {
    11161070                addToUndo(items, History.Type.movement);
    11171071        }
     
    11471101                break;
    11481102                case movement:
    1149                         List<Item> changed = new LinkedList<Item>(_body);
    1150                         changed.retainAll(undo.items);
     1103                        ItemsList changed = new ItemsList(_body);
     1104                        changed.retainHistory(undo.items);
    11511105                        _redo.push(new History(changed, History.Type.movement));
    11521106                        for(Item i : undo.items) {
     
    12071161                break;
    12081162                case movement:
    1209                         List<Item> changed = new LinkedList<Item>(_body);
    1210                         changed.retainAll(redo.items);
     1163                        ItemsList changed = new ItemsList(_body);
     1164                        changed.retainHistory(redo.items);
    12111165                        _undo.push(new History(changed, History.Type.movement));
    12121166                        for(Item i : redo.items) {
     
    16771631        {
    16781632                for (Overlay o : _overlays.keySet()) {
    1679                         for (Item i : o.Frame.getItems()) {
     1633                        for (Item i : o.Frame.getSortedItems()) {
    16801634                                i.onParentStateChanged(new ItemParentStateChangedEvent(
    16811635                                                                this,
     
    16951649                                _overlays.remove(o);
    16961650                               
    1697                                 for (Item i : f.getItems()) {
     1651                                for (Item i : f.getSortedItems()) {
    16981652                                        _overlayItems.remove(i);
    16991653                                        i.onParentStateChanged(new ItemParentStateChangedEvent(
     
    17881742                }
    17891743
    1790                 List<Item> copies = ItemUtils.CopyItems(toMergeWith.getItems());
     1744                List<Item> copies = ItemUtils.CopyItems(toMergeWith.getSortedItems());
    17911745                copies.remove(toMergeWith.getNameItem());
    17921746
     
    18341788        public void clear(boolean keepAnnotations)
    18351789        {
    1836                 List<Item> newBody = new ArrayList<Item>(0);
     1790                ItemsList newBody = new ItemsList();
    18371791               
    18381792                Item title = getTitleItem();
     
    20101964                // reset attributes
    20111965                dot.setParent(this);
     1966                dot.setOwner(template.getOwner());
    20121967                return dot;
    20131968        }
     
    20181973
    20191974                // check for an updated template...
    2020                 for (Item i : this.getItems()) {
     1975                for (Item i : this.getSortedItems()) {
    20211976                        if (ItemUtils.startsWithTag(i, templateTag)) {
    20221977                                t = (Text) i;
     
    20321987                        t = defaultTemplate;
    20331988                }
    2034 
     1989               
    20351990                // If the item is linked apply any attribute pairs on the child frame
    20361991                String link = t.getAbsoluteLink();
     
    20381993                // need to get link first because copy doesnt copy the link
    20391994                t = t.copy();
     1995                // If the template does not have a owner then it should be set to the current user.
     1996                if (t.getOwner() == null) {
     1997                        t.setOwner(UserSettings.UserName.get());
     1998                }
    20401999                t.setTooltip(null);
    20412000                if (link != null) {
     
    22022161        public boolean moveMouseToTextItem(int index)
    22032162        {
    2204                 List<Item> items = getItems();
     2163                List<Item> items = getSortedItems();
    22052164                int itemsFound = 0;
    22062165                for (int i = 0; i < items.size(); i++) {
     
    22282187        public boolean moveMouseToDefaultLocation()
    22292188        {
    2230                 List<Item> items = getItems();
     2189                List<Item> items = getSortedItems();
    22312190
    22322191                for (Item it : items) {
     
    25272486        public List<Item> getVisibleItems()
    25282487        {
    2529                 return getItems(true);
     2488                return getSortedItems(true);
    25302489        }
    25312490
     
    25592518         * @return the list of items to be saved to a text file
    25602519         */
    2561         public List<Item> getItemsToSave() {
     2520        /*public List<Item> getItemsToSave() {
    25622521                if (!_sorted) {
    25632522                        Collections.sort(_body);
     
    25992558
    26002559                return toSave;
    2601         }
    2602        
    2603         public List<Item> getSurrogateItemsToSave() {
    2604                 List<Item> surrogates = new ArrayList<Item>();
    2605                 _body.forEach(item -> surrogates.addAll(item.getSurrogates()));
    2606                 return surrogates;
     2560        }*/
     2561       
     2562        public List<Item> getItemsToSave() {
     2563                return getItemsToSave(BodyType.PrimaryBody);
     2564        }
     2565       
     2566        public List<Item> getItemsToSave(BodyType type) {
     2567                assert(!type.equals(BodyType.BodyDisplay));
     2568                switch (type) {
     2569                case SurrogateBody:
     2570                        return getItemsToSave(_surrogateItemsBody);
     2571                case BodyDisplay:
     2572                        return getItemsToSave(_body);
     2573                case PrimaryBody:
     2574                default:
     2575                        return getItemsToSave(_primaryItemsBody);
     2576                }
     2577        }
     2578       
     2579        private List<Item> getItemsToSave(ItemsList body) {
     2580                body.sort();
     2581                List<Widget> seenWidgets = new ArrayList<Widget>();
     2582               
     2583                List<Item> toSave = new ArrayList<Item>();
     2584               
     2585                body.removeIf(item -> item.dontSave());
     2586                for (Item item: body) {
     2587                        if (item instanceof WidgetCorner) {
     2588                                // Save the widget source. 
     2589                                // Each widget has multiple WidgetCorner's..ignore them if we already have the source.
     2590                                Widget iw = ((WidgetCorner) item).getWidgetSource();
     2591                                if (seenWidgets.contains(iw)) { continue; }
     2592                                seenWidgets.add(iw);
     2593                                toSave.add(iw.getSource());
     2594                        } else if (item instanceof XRayable) {
     2595                                // XRayable Items have their sources saved.
     2596                                XRayable x = (XRayable) item;
     2597                                toSave.addAll(x.getItemsToSave());
     2598                        } else if (item.hasEnclosures()) {
     2599                                // Deals with Circle objects only?
     2600                                continue;
     2601                        } else {
     2602                                toSave.add(item);
     2603                        }
     2604                }
     2605               
     2606                return toSave;
    26072607        }
    26082608
     
    26232623        }
    26242624
    2625         public Collection<Item> getAllItems()
    2626         {
    2627                 Collection<Item> allItems = new LinkedHashSet<Item>(_body);
     2625        public Collection<Item> getAllItems() {
     2626                ItemsList allItems = new ItemsList(_body);
    26282627               
    26292628                allItems.addAll(_overlayItems);
    26302629                allItems.addAll(_vectorItems);
    2631                 return allItems;
     2630                return allItems.underlying();
    26322631        }
    26332632
     
    26482647                Collection<Text> textItems = new ArrayList<Text>();
    26492648               
    2650                 for (Item i : getItems(true)) {
     2649                for (Item i : getSortedItems(true)) {
    26512650                        // only add up normal body text items
    26522651                        if ((i instanceof Text)) {
     
    26692668        public void recalculate()
    26702669        {
    2671                 for (Item i : getItems()) {
     2670                for (Item i : getSortedItems()) {
    26722671                        if (i.hasFormula() && !i.isAnnotation()) {
    26732672                                i.calculate(i.getFormula());
     
    27002699                Collection<Text> items = new LinkedHashSet<Text>();
    27012700               
    2702                 for (Item i : getItems(true)) {
     2701                for (Item i : getSortedItems(true)) {
    27032702                        // only add up normal body text items
    27042703                        if (i instanceof Text && !i.isAnnotation()) {
     
    27882787        }
    27892788       
    2790         public List<Item> getBodyItemsWithInsufficientPermissions() {
    2791                 return _bodyHiddenDueToPermissions;
     2789        public Collection<Item> getBodyItemsWithInsufficientPermissions() {
     2790                return _bodyHiddenDueToPermissions.underlying();
    27922791        }
    27932792       
     
    28982897                return members;
    28992898        }
     2899       
     2900        public boolean hasSurrogates() {
     2901                return !_surrogateItemsBody.isEmpty();
     2902        }
     2903
     2904        private boolean meetsVisibilityRequirements(boolean requireVisible, Item i) {
     2905                return i.isVisible() || (!requireVisible && !i.isDeleted());
     2906        }
    29002907
    29012908        private static final class History {
     
    29062913                }
    29072914               
    2908                 public final List<Item> items;
     2915                public final ItemsList items;
    29092916               
    29102917                public final Type type;
    29112918               
    2912                 public History(Collection<Item> items, Type type)
     2919                public History(ItemsList changed, Type type)
    29132920                {
    2914                         this.items = new LinkedList<Item>(items);
     2921                        this.items = new ItemsList(changed);
    29152922                        this.type = type;
    29162923                }
     
    29222929                }
    29232930        }
     2931
     2932        protected boolean hasAnnotations() {
     2933                return _annotations != null && _annotations.size() > 0;
     2934        }
     2935
     2936        protected ItemsList getBody() {
     2937                return _body;
     2938        }
     2939        protected ItemsList getPrimaryBody() {
     2940                return _primaryItemsBody;
     2941        }
     2942        protected ItemsList getSurrogateBody() {
     2943                return _surrogateItemsBody;
     2944        }
    29242945}
Note: See TracChangeset for help on using the changeset viewer.