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/items/Item.java

    r1414 r1415  
    4848import org.expeditee.core.bounds.PolygonBounds;
    4949import org.expeditee.encryption.items.surrogates.EncryptionDetail;
     50import org.expeditee.encryption.items.surrogates.EncryptionDetail.Type;
     51import org.expeditee.encryption.items.surrogates.Label;
     52import org.expeditee.encryption.items.surrogates.Label.LabelResult;
    5053//import org.expeditee.encryption.items.surrogates.Surrogate;
    5154import org.expeditee.gio.EcosystemManager;
     
    156159
    157160        public static final Cursor.CursorType CROP_CURSOR = Cursor.CursorType.CROSSHAIR;
    158 
     161       
    159162        /** The default value for integer attributes */
    160163        public static final int DEFAULT_INTEGER = -1;
    161 
     164       
    162165        private static final int BRIGHTNESS = 185;
    163 
     166       
    164167        /** Contains all dots (including this one) that form an enclosure if this dot is part of an enclosing shape. */
    165168        private Collection<Item> _enclosure = null;
     
    317320       
    318321        private Data _data = new Data();
     322       
     323        // Used via reflection by AttributeUtils to determine if the boolean value is different from default.
     324        public static final boolean acceptsKeyboardEnterDefault = false;
     325        private boolean _acceptsKeyboardEnter = acceptsKeyboardEnterDefault;
    319326
    320327        private Item surrogateFor = null;
     
    326333       
    327334        {
     335                EncryptionDetail unencryptedOnSave = new EncryptionDetail(EncryptionDetail.Type.UnencryptedOnSave);
    328336                for(Character tag: DefaultFrameWriter.getItemTags().keySet()) {
    329337                        if (tag == 'T' || tag == 'S') {
     
    332340                                surrogatePropertyInheritanceDefault.put(tag + "", true);
    333341                        }
    334                         primaryPropertyEncryptionDefault.put(tag + "", EncryptionDetail.UnencryptedOnSave);
     342                        primaryPropertyEncryptionDefault.put(tag + "", unencryptedOnSave);
    335343                }
    336344               
    337345                for(String tag: DefaultFrameWriter.getItemTagsExt().keySet()) {
    338346                        surrogatePropertyInheritanceDefault.put(tag, true);
    339                         primaryPropertyEncryptionDefault.put(tag, EncryptionDetail.UnencryptedOnSave);
     347                        primaryPropertyEncryptionDefault.put(tag, unencryptedOnSave);
    340348                }
    341349        }
     
    383391                dest.setLinkTemplate(this.getLinkTemplate());
    384392
    385                 // dest.setMaxWidth(this.getMaxWidth());
     393                // dest.setWidth(this.getWidth());
    386394
    387395                dest.setOffset(this.getOffset());
     
    424432                }
    425433               
    426                 final String currentUser = UserSettings.UserName.get();
    427                 if (parent != null && (parent.getOwner() == null || currentUser.compareTo(parent.getOwner()) != 0)) {
    428                         dest.setOwner(currentUser);
    429                 }
     434                String currentUser = UserSettings.UserName.get();
     435//              if (parent != null && !currentUser.equals(parent.getOwner())) {
     436//                      //dest.setOwner(currentUser);
     437//              } else {
     438//                      System.err.println("I have duplicated a item and made it owned by "
     439//                                      + "current user, whereas the old code would not have "
     440//                                      + "changed ownership at this time.");
     441//                      System.err.println("Item: " + dest + ", Class: " + dest.getClass());
     442//                      System.err.println("Current owner: " + dest.getOwner());
     443//                      System.err.println("Current user: " + currentUser);
     444//              }
     445                dest.setOwner(currentUser);
    430446        }
    431447       
     
    438454                        Item primary = getPrimary();
    439455                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.DOT_TYPE_STR)) {
    440                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.DOT_TYPE_STR, EncryptionDetail.InheritanceCheckOnSave);
     456                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     457                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.DOT_TYPE_STR, inheritanceCheckOnSave);
    441458                        }
    442459                }
     
    461478                        Item primary = getPrimary();
    462479                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.DOT_TYPE_STR)) {
    463                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.FILLED_STR, EncryptionDetail.InheritanceCheckOnSave);
     480                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     481                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.FILLED_STR, inheritanceCheckOnSave);
    464482                        }
    465483                }
     
    494512                        Item primary = getPrimary();
    495513                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.DOT_TYPE_STR)) {
    496                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.GRADIENT_ANGLE_STR, EncryptionDetail.InheritanceCheckOnSave);
     514                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     515                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.GRADIENT_ANGLE_STR, inheritanceCheckOnSave);
    497516                        }
    498517                }
     
    567586                        Item primary = getPrimary();
    568587                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.DOT_TYPE_STR)) {
    569                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.PERMISSION_STR, EncryptionDetail.InheritanceCheckOnSave);
     588                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     589                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.PERMISSION_STR, inheritanceCheckOnSave);
    570590                        }
    571591                }
     
    11141134                        Item primary = getPrimary();
    11151135                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.FORMULA_STR)) {
    1116                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.FORMULA_STR, EncryptionDetail.InheritanceCheckOnSave);
     1136                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     1137                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.FORMULA_STR, inheritanceCheckOnSave);
    11171138                        }
    11181139                }
     
    13891410                if (otherBounds.equals(thisBounds)) return true;
    13901411
    1391                 return otherBounds.intersects(thisBounds);
     1412                boolean intersects = otherBounds.intersects(thisBounds);
     1413               
     1414                /*if (intersects) {
     1415                        System.err.println("Found intersection between this item (" + this + ") with bounds: " + thisBounds + "...and...");
     1416                        System.err.println("item with bounds: " + otherBounds.toString());
     1417                }*/
     1418                return intersects;
    13921419
    13931420                // Need to check the second equality so that we dont pick up circles
     
    15231550                        Item primary = getPrimary();
    15241551                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.TOOLTIP_STR)) {
    1525                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.TOOLTIP_STR, EncryptionDetail.InheritanceCheckOnSave);
     1552                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     1553                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.TOOLTIP_STR, inheritanceCheckOnSave);
    15261554                        }
    15271555                }
     
    18271855                        Item primary = getPrimary();
    18281856                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ACTION_STR)) {
    1829                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_STR, EncryptionDetail.InheritanceCheckOnSave);
     1857                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     1858                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_STR, inheritanceCheckOnSave);
    18301859                        }
    18311860                }
     
    18471876                        Item primary = getPrimary();
    18481877                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.DATA_STR)) {
    1849                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.DATA_STR, EncryptionDetail.InheritanceCheckOnSave);
     1878                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     1879                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.DATA_STR, inheritanceCheckOnSave);
    18501880                        }
    18511881                }
     
    18631893                        Item primary = getPrimary();
    18641894                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ACTION_CURSOR_ENTER_STR)) {
    1865                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_CURSOR_ENTER_STR, EncryptionDetail.InheritanceCheckOnSave);
     1895                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     1896                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_CURSOR_ENTER_STR, inheritanceCheckOnSave);
    18661897                        }
    18671898                }
     
    18751906                        Item primary = getPrimary();
    18761907                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ACTION_CURSOR_LEAVE_STR)) {
    1877                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_CURSOR_LEAVE_STR, EncryptionDetail.InheritanceCheckOnSave);
     1908                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     1909                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_CURSOR_LEAVE_STR, inheritanceCheckOnSave);
    18781910                        }
    18791911                }
     
    18871919                        Item primary = getPrimary();
    18881920                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ACTION_ENTER_FRAME_STR)) {
    1889                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_ENTER_FRAME_STR, EncryptionDetail.InheritanceCheckOnSave);
     1921                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     1922                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_ENTER_FRAME_STR, inheritanceCheckOnSave);
    18901923                        }
    18911924                }
     
    18991932                        Item primary = getPrimary();
    19001933                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ACTION_LEAVE_FRAME_STR)) {
    1901                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_LEAVE_FRAME_STR, EncryptionDetail.InheritanceCheckOnSave);
     1934                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     1935                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_LEAVE_FRAME_STR, inheritanceCheckOnSave);
    19021936                        }
    19031937                }
     
    19141948                        Item primary = getPrimary();
    19151949                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ACTION_MARK_STR)) {
    1916                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_MARK_STR, EncryptionDetail.InheritanceCheckOnSave);
     1950                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     1951                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_MARK_STR, inheritanceCheckOnSave);
    19171952                        }
    19181953                }
     
    19471982                        Item primary = getPrimary();
    19481983                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ARROW_STR)) {
    1949                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.ARROW_STR, EncryptionDetail.InheritanceCheckOnSave);
     1984                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     1985                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ARROW_STR, inheritanceCheckOnSave);
    19501986                        }
    19511987                }
     
    19852021                        Item primary = getPrimary();
    19862022                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.BACKGROUND_COLOR_STR)) {
    1987                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.BACKGROUND_COLOR_STR, EncryptionDetail.InheritanceCheckOnSave);
     2023                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2024                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.BACKGROUND_COLOR_STR, inheritanceCheckOnSave);
    19882025                        }
    19892026                }
     
    20002037                        Item primary = getPrimary();
    20012038                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.BORDER_COLOR_STR)) {
    2002                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.BORDER_COLOR_STR, EncryptionDetail.InheritanceCheckOnSave);
     2039                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2040                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.BORDER_COLOR_STR, inheritanceCheckOnSave);
    20032041                        }
    20042042                }
     
    20392077                        Item primary = getPrimary();
    20402078                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.CONSTRAINT_IDS_STR)) {
    2041                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.CONSTRAINT_IDS_STR, EncryptionDetail.InheritanceCheckOnSave);
     2079                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2080                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.CONSTRAINT_IDS_STR, inheritanceCheckOnSave);
    20422081                        }
    20432082                }
     
    20682107                        Item primary = getPrimary();
    20692108                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.DATE_CREATED_STR)) {
    2070                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.DATE_CREATED_STR, EncryptionDetail.InheritanceCheckOnSave);
     2109                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2110                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.DATE_CREATED_STR, inheritanceCheckOnSave);
    20712111                        }
    20722112                }
     
    20912131                        Item primary = getPrimary();
    20922132                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.FILL_COLOR_STR)) {
    2093                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.FILL_COLOR_STR, EncryptionDetail.InheritanceCheckOnSave);
     2133                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2134                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.FILL_COLOR_STR, inheritanceCheckOnSave);
    20942135                        }
    20952136                }
     
    21122153                        Item primary = getPrimary();
    21132154                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.GRADIENT_COLOR_STR)) {
    2114                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.GRADIENT_COLOR_STR, EncryptionDetail.InheritanceCheckOnSave);
     2155                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2156                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.GRADIENT_COLOR_STR, inheritanceCheckOnSave);
    21152157                        }
    21162158                }
     
    21342176                        Item primary = getPrimary();
    21352177                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.FILL_PATTERN_STR)) {
    2136                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.FILL_PATTERN_STR, EncryptionDetail.InheritanceCheckOnSave);
     2178                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2179                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.FILL_PATTERN_STR, inheritanceCheckOnSave);
    21372180                        }
    21382181                }
     
    21562199                        Item primary = getPrimary();
    21572200                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.HIGHLIGHT_STR)) {
    2158                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.HIGHLIGHT_STR, EncryptionDetail.InheritanceCheckOnSave);
     2201                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2202                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.HIGHLIGHT_STR, inheritanceCheckOnSave);
    21592203                        }
    21602204                }
     
    21752219                        Item primary = getPrimary();
    21762220                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.TYPE_AND_ID_STR)) {
    2177                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.TYPE_AND_ID_STR, EncryptionDetail.InheritanceCheckOnSave);
     2221                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2222                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.TYPE_AND_ID_STR, inheritanceCheckOnSave);
    21782223                        }
    21792224                }
     
    21912236                        Item primary = getPrimary();
    21922237                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LINE_IDS_STR)) {
    2193                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINE_IDS_STR, EncryptionDetail.InheritanceCheckOnSave);
     2238                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2239                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINE_IDS_STR, inheritanceCheckOnSave);
    21942240                        }
    21952241                }
     
    22062252                        Item primary = getPrimary();
    22072253                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LINE_PATTERN_STR)) {
    2208                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINE_PATTERN_STR, EncryptionDetail.InheritanceCheckOnSave);
     2254                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2255                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINE_PATTERN_STR, inheritanceCheckOnSave);
    22092256                        }
    22102257                }
     
    22462293                        Item primary = getPrimary();
    22472294                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LINK_STR)) {
    2248                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_STR, EncryptionDetail.InheritanceCheckOnSave);
     2295                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2296                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_STR, inheritanceCheckOnSave);
    22492297                        }
    22502298                }
     
    22582306                        Item primary = getPrimary();
    22592307                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LINK_HISTORY_STR)) {
    2260                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_HISTORY_STR, EncryptionDetail.InheritanceCheckOnSave);
     2308                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2309                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_HISTORY_STR, inheritanceCheckOnSave);
    22612310                        }
    22622311                }
     
    22842333                        Item primary = getPrimary();
    22852334                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LINK_FRAMESET_STR)) {
    2286                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_FRAMESET_STR, EncryptionDetail.InheritanceCheckOnSave);
     2335                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2336                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_FRAMESET_STR, inheritanceCheckOnSave);
    22872337                        }
    22882338                }
     
    22992349                        Item primary = getPrimary();
    23002350                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LINK_MARK_STR)) {
    2301                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_MARK_STR, EncryptionDetail.InheritanceCheckOnSave);
     2351                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2352                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_MARK_STR, inheritanceCheckOnSave);
    23022353                        }
    23032354                }
     
    23162367                        Item primary = getPrimary();
    23172368                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LINK_TEMPLATE_STR)) {
    2318                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_TEMPLATE_STR, EncryptionDetail.InheritanceCheckOnSave);
     2369                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2370                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_TEMPLATE_STR, inheritanceCheckOnSave);
    23192371                        }
    23202372                }
     
    23502402                        Item primary = getPrimary();
    23512403                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.OWNER_STR)) {
    2352                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.OWNER_STR, EncryptionDetail.InheritanceCheckOnSave);
     2404                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2405                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.OWNER_STR, inheritanceCheckOnSave);
    23532406                        }
    23542407                }
     
    25412594                        Item primary = getPrimary();
    25422595                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.POSITION_STR)) {
    2543                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.POSITION_STR, EncryptionDetail.InheritanceCheckOnSave);
     2596                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2597                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.POSITION_STR, inheritanceCheckOnSave);
    25442598                        }
    25452599                }
     
    25852639                        Item primary = getPrimary();
    25862640                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.THICKNESS_STR)) {
    2587                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.THICKNESS_STR, EncryptionDetail.InheritanceCheckOnSave);
     2641                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2642                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.THICKNESS_STR, inheritanceCheckOnSave);
    25882643                        }
    25892644                }
     
    26972752                        Item primary = getPrimary();
    26982753                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.POSITION_STR)) {
    2699                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.POSITION_STR, EncryptionDetail.InheritanceCheckOnSave);
     2754                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2755                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.POSITION_STR, inheritanceCheckOnSave);
    27002756                        }
    27012757                }
     
    27152771                        Item primary = getPrimary();
    27162772                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.POSITION_STR)) {
    2717                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.POSITION_STR, EncryptionDetail.InheritanceCheckOnSave);
     2773                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     2774                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.POSITION_STR, inheritanceCheckOnSave);
    27182775                        }
    27192776                }
     
    28272884
    28282885                current.addItem(this, false);
    2829                 current.setResort(true);
     2886                current.invalidateSorted();
    28302887                setRelativeLink();
    28312888                setFloating(false);
     
    35273584                        Item primary = getPrimary();
    35283585                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_LEFT_STR)) {
    3529                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_LEFT_STR, EncryptionDetail.InheritanceCheckOnSave);
     3586                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     3587                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_LEFT_STR, inheritanceCheckOnSave);
    35303588                        }
    35313589                }
     
    35433601                        Item primary = getPrimary();
    35443602                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_RIGHT_STR)) {
    3545                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_RIGHT_STR, EncryptionDetail.InheritanceCheckOnSave);
     3603                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     3604                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_RIGHT_STR, inheritanceCheckOnSave);
    35463605                        }
    35473606                }
     
    35593618                        Item primary = getPrimary();
    35603619                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_TOP_STR)) {
    3561                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_TOP_STR, EncryptionDetail.InheritanceCheckOnSave);
     3620                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     3621                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_TOP_STR, inheritanceCheckOnSave);
    35623622                        }
    35633623                }
     
    35763636                        Item primary = getPrimary();
    35773637                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_BOTTOM_STR)) {
    3578                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_BOTTOM_STR, EncryptionDetail.InheritanceCheckOnSave);
     3638                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     3639                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_BOTTOM_STR, inheritanceCheckOnSave);
    35793640                        }
    35803641                }
     
    38863947                        Item primary = getPrimary();
    38873948                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.MAGNETIZED_ITEM_LEFT_STR)) {
    3888                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_LEFT_STR, EncryptionDetail.InheritanceCheckOnSave);
     3949                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     3950                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_LEFT_STR, inheritanceCheckOnSave);
    38893951                        }
    38903952                }
     
    39113973                        Item primary = getPrimary();
    39123974                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.MAGNETIZED_ITEM_RIGHT_STR)) {
    3913                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_RIGHT_STR, EncryptionDetail.InheritanceCheckOnSave);
     3975                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     3976                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_RIGHT_STR, inheritanceCheckOnSave);
    39143977                        }
    39153978                }
     
    39363999                        Item primary = getPrimary();
    39374000                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.MAGNETIZED_ITEM_TOP_STR)) {
    3938                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_TOP_STR, EncryptionDetail.InheritanceCheckOnSave);
     4001                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     4002                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_TOP_STR, inheritanceCheckOnSave);
    39394003                        }
    39404004                }
     
    39614025                        Item primary = getPrimary();
    39624026                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.MAGNETIZED_ITEM_BOTTOM_STR)) {
    3963                                 primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_BOTTOM_STR, EncryptionDetail.InheritanceCheckOnSave);
     4027                                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
     4028                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_BOTTOM_STR, inheritanceCheckOnSave);
    39644029                        }
    39654030                }
     
    39754040       
    39764041        public void setEncryptionLabel(String label) {
     4042                if (this.getParent().getEncryptionLabel() == null) {
     4043                        MessageBay.displayMessage("Items can only be entrypted if the frame they are on is.");
     4044                        return;
     4045                }
     4046                LabelResult labelResult = Label.getLabel(label);
     4047                if (labelResult != LabelResult.SuccessResolveLabelToKey) {
     4048                        MessageBay.displayMessage(labelResult.toString());
     4049                        return;
     4050                }
     4051               
    39774052                this._encryptionLabel = label;
    39784053                this.getSurrogates().clear();
     
    39804055                if (copy instanceof Text) {     copy.setText("Encrypted"); }
    39814056                this.addToSurrogates(copy);
     4057        }
     4058       
     4059        public void setEncryptionLabelOnLoad(String label) {
     4060                this._encryptionLabel = label;
    39824061        }
    39834062
     
    40064085                Frame current = dot.getParentOrCurrentFrame();
    40074086                current.removeItem(dot);
    4008                 ItemUtils.EnclosedCheck(current.getItems());
     4087                ItemUtils.EnclosedCheck(current.getSortedItems());
    40094088                return text;
    40104089                // TODO: Should this add the newly-created Text item to the frame? cts16
     
    40294108                current.addItem(dot);
    40304109                DisplayController.setCursor(Item.DEFAULT_CURSOR);
    4031                 ItemUtils.EnclosedCheck(current.getItems());
     4110                ItemUtils.EnclosedCheck(current.getSortedItems());
    40324111                return dot;
    40334112        }
     
    40444123                this.surrogateItems.add(surrogate);
    40454124                surrogate.setAsSurrogateFor(this);
     4125                this.getParent().addItem(surrogate);
     4126               
     4127                EncryptionDetail reencryptOnSave = new EncryptionDetail(EncryptionDetail.Type.ReencryptOnSave);
     4128                EncryptionDetail unencryptedOnSave = new EncryptionDetail(EncryptionDetail.Type.UnencryptedOnSave);
     4129                EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
    40464130               
    40474131                for (Character tag: DefaultFrameWriter.getItemTags().keySet()) {
    40484132                        if (tag == 'T') {
    4049                                 primaryPropertyEncryption.put(tag + "", EncryptionDetail.ReencryptOnSave);
     4133                                primaryPropertyEncryption.put(tag + "", reencryptOnSave.clone());
    40504134                        } else {
    4051                                 primaryPropertyEncryption.put(tag + "", EncryptionDetail.UnencryptedOnSave);
     4135                                primaryPropertyEncryption.put(tag + "", unencryptedOnSave.clone());
    40524136                        }
    40534137                                       
     
    40604144               
    40614145                for (String tag: DefaultFrameWriter.getItemTagsExt().keySet()) {
    4062                         primaryPropertyEncryption.put(tag, EncryptionDetail.UnencryptedOnSave);
     4146                        primaryPropertyEncryption.put(tag, inheritanceCheckOnSave.clone());
    40634147                        surrogate.surrogatePropertyInheritance.put(tag + "", true);
    40644148                }
     
    40774161               
    40784162                if (encryptionDetail == null) {
    4079                         return EncryptionDetail.UnencryptedOnSave;
     4163                        EncryptionDetail unencryptedOnSave = new EncryptionDetail(EncryptionDetail.Type.UnencryptedOnSave);
     4164                        return unencryptedOnSave;
    40804165                } else {
    40814166                        return encryptionDetail;
     
    40914176        }
    40924177       
    4093 
    4094         /**
    4095          * If when setting a property, we find that the primary has a undeciphered value, when we must containue using that undeciphered value
     4178        public void setTagNotInherited(String tag) {
     4179                surrogatePropertyInheritance.put(tag, false);
     4180        }
     4181       
     4182        public boolean hasAccessToItemAsPrimary() {
     4183                String label = this.getEncryptionLabel();
     4184                if (this.isSurrogate() || label == null || label.length() == 0) {
     4185                        return true;
     4186                }
     4187               
     4188                return Label.getLabel(label) == LabelResult.SuccessResolveLabelToKey;
     4189        }
     4190       
     4191
     4192        /**
     4193         * If when setting a property, we find that the primary has a undeciphered value, when we must continue using that undeciphered value
    40964194         * when eventually saving.
    40974195         * @return
    40984196         */
    40994197        protected boolean subjectToInheritanceCheckOnSave(String tag) {
    4100                 if (getPrimary() == null) return false;
    4101                 return getPrimary().primaryPropertyEncryption.get(tag) != EncryptionDetail.UseUndecipheredValueOnSave;
     4198                Item primary = getPrimary();
     4199                if (primary == null) return false;
     4200                EncryptionDetail primaryItemTagEncryptionDetail = primary.primaryPropertyEncryption.get(tag);
     4201                Type primaryItemTagEncryptionDetailType = primaryItemTagEncryptionDetail.getEncryptionDetailType();
     4202                return primaryItemTagEncryptionDetailType != EncryptionDetail.Type.UseUndecipheredValueOnSave;
     4203        }
     4204
     4205        public boolean acceptsKeyboardEnter() {
     4206                return _acceptsKeyboardEnter;
     4207        }
     4208               
     4209        public void setAcceptsEnter(boolean value) {
     4210                if (this.getText() != null && this.getText().equals("Beep")) {
     4211                        System.err.println();
     4212                }
     4213                _acceptsKeyboardEnter = value;
    41024214        }
    41034215}
Note: See TracChangeset for help on using the changeset viewer.