Index: trunk/src/org/apollo/ApolloGestureActions.java
===================================================================
--- trunk/src/org/apollo/ApolloGestureActions.java	(revision 1414)
+++ trunk/src/org/apollo/ApolloGestureActions.java	(revision 1415)
@@ -180,5 +180,5 @@
 				Dimension windowSize = EcosystemManager.getGraphicsManager().getWindowSize();
 
-				for (Item i : current.getItems()) {
+				for (Item i : current.getSortedItems()) {
 					Point pos = i.getPosition();
 					pos.setX(pos.getX() % windowSize.width);
Index: trunk/src/org/apollo/ApolloSystem.java
===================================================================
--- trunk/src/org/apollo/ApolloSystem.java	(revision 1414)
+++ trunk/src/org/apollo/ApolloSystem.java	(revision 1415)
@@ -165,5 +165,5 @@
 		assert(profile != null);
 		
-		for (Item i : profile.getItems()) {
+		for (Item i : profile.getSortedItems()) {
 			if (i instanceof Text) {
 				Text textItem = (Text)i;
Index: trunk/src/org/expeditee/actions/Actions.java
===================================================================
--- trunk/src/org/expeditee/actions/Actions.java	(revision 1414)
+++ trunk/src/org/expeditee/actions/Actions.java	(revision 1415)
@@ -413,5 +413,5 @@
 
 		// Check for protection on frame.
-		if (ItemUtils.ContainsTag(source.getItems(), "@No" + actionName)) {
+		if (ItemUtils.ContainsTag(source.getSortedItems(), "@No" + actionName)) {
 			final String errorMsg = "Frame is protected by @No" + actionName
 					+ " tag.";
@@ -501,5 +501,5 @@
 
 		// Check for protection on frame.
-		if (ItemUtils.ContainsTag(source.getItems(), "@No" + actionName)) {
+		if (ItemUtils.ContainsTag(source.getSortedItems(), "@No" + actionName)) {
 			final String errorMsg = "Frame is protected by @No" + actionName
 					+ " tag.";
Index: trunk/src/org/expeditee/actions/Debug.java
===================================================================
--- trunk/src/org/expeditee/actions/Debug.java	(revision 1414)
+++ trunk/src/org/expeditee/actions/Debug.java	(revision 1415)
@@ -53,5 +53,5 @@
 	 */
 	public static void ShowConstraints() {
-		List<Item> items = DisplayController.getCurrentFrame().getItems();
+		List<Item> items = DisplayController.getCurrentFrame().getSortedItems();
 
 		for (Item i : items)
@@ -127,5 +127,5 @@
 	
 	public static void HowManyMinWidths() {
-		MessageBay.displayMessage(DisplayController.getCurrentFrame().getItems().stream().filter(t -> t.getMinWidth() != null).collect(Collectors.toList()).size() + "");
+		MessageBay.displayMessage(DisplayController.getCurrentFrame().getSortedItems().stream().filter(t -> t.getMinWidth() != null).collect(Collectors.toList()).size() + "");
 	}
 	
Index: trunk/src/org/expeditee/actions/ExploratorySearchActions.java
===================================================================
--- trunk/src/org/expeditee/actions/ExploratorySearchActions.java	(revision 1414)
+++ trunk/src/org/expeditee/actions/ExploratorySearchActions.java	(revision 1415)
@@ -72,5 +72,5 @@
 			
 			// Remove everything from new frame
-			frame.removeAllItems(frame.getItems());
+			frame.removeAllItems(frame.getSortedItems());
 			
 			// Add web browser active overlay and @old
@@ -132,5 +132,5 @@
 		
 		// Clear new frame and add active overlay and @old
-		frame.removeAllItems(frame.getItems());
+		frame.removeAllItems(frame.getSortedItems());
 		Text t = (Text) frame.addText(-150, 50, "@ao: 2", null, "overlayset3");
 		t.setAnchorLeft(-150);
@@ -182,5 +182,5 @@
 			
 			// Remove everything from new frame
-			frame.removeAllItems(frame.getItems());
+			frame.removeAllItems(frame.getSortedItems());
 			
 			// Add web browser active overlay and @old
Index: trunk/src/org/expeditee/actions/JfxBrowserActions.java
===================================================================
--- trunk/src/org/expeditee/actions/JfxBrowserActions.java	(revision 1414)
+++ trunk/src/org/expeditee/actions/JfxBrowserActions.java	(revision 1415)
@@ -112,5 +112,5 @@
 		// Create JfxBrowser widget on a new frame
 		Frame frame = FrameIO.CreateNewFrame(text);			// create new frame for browser
-		frame.removeAllItems(frame.getItems());
+		frame.removeAllItems(frame.getSortedItems());
 		text.setLink("" + frame.getNumber());				// link this text item to new frame
 		
@@ -168,5 +168,5 @@
 	public static void createFrameWithBrowser(Item link, String url) throws Exception {
 		Frame frame = FrameIO.CreateNewFrame(link);
-		frame.removeAllItems(frame.getItems());
+		frame.removeAllItems(frame.getSortedItems());
 
 		link.setLink("" + frame.getNumber());
Index: trunk/src/org/expeditee/actions/Misc.java
===================================================================
--- trunk/src/org/expeditee/actions/Misc.java	(revision 1414)
+++ trunk/src/org/expeditee/actions/Misc.java	(revision 1415)
@@ -104,5 +104,5 @@
 	{
 		Frame current = f;
-		List<Item> allItems = current.getItems();
+		List<Item> allItems = current.getSortedItems();
 		
 		for(Item i : allItems)
@@ -126,5 +126,5 @@
 		Frame current = f;
 		
-		List<Item> allItems = current.getItems();
+		List<Item> allItems = current.getSortedItems();
 		
 		
@@ -242,5 +242,5 @@
 				// deleted
 				Frame current = DisplayController.getCurrentFrame();
-				for (Item i : current.getItems())
+				for (Item i : current.getSortedItems())
 					if (i.getLink() != null
 							&& i.getAbsoluteLink().toLowerCase().equals(
@@ -507,5 +507,5 @@
 		charList.append(String.format("Unicode block 0x%x - 0x%x", start,
 				finish));
-		System.out.println();
+		System.out.println(); // Is this println needed?
 		// charList.append("Unicode block: ").append(String.format(format,
 		// args))
@@ -706,5 +706,5 @@
 	public static void MigrateImages(Frame frame) {
 		//Collect the images on frame
-		final Collection<Item> items = frame.getItems();
+		final Collection<Item> items = frame.getSortedItems();
 		final Collection<Item> imagesTextItems = new LinkedList<Item>();
 		items.forEach(i -> { if(i.getText().startsWith("@i")) imagesTextItems.add(i); });
@@ -931,5 +931,5 @@
 			body.addAll(child.getBodyTextItems(false));
 		else
-			body.addAll(child.getItems());
+			body.addAll(child.getSortedItems());
 		Item item = null;
 
@@ -970,5 +970,5 @@
 			body.addAll(child.getBodyTextItems(false));
 		else
-			body.addAll(child.getItems());
+			body.addAll(child.getSortedItems());
 
 		return body;
@@ -1332,5 +1332,5 @@
 	public static void resetHomeFrame() {
 		Frame homeFrame = FrameIO.LoadFrame(UserSettings.HomeFrame.get());
-		homeFrame.removeAllItems(homeFrame.getItems());
+		homeFrame.removeAllItems(homeFrame.getSortedItems());
 		homeFrame.addText(0, 0, "title", null);
 		FrameUtils.CreateDefaultProfile(UserSettings.UserName.get(), homeFrame, null, null);
Index: trunk/src/org/expeditee/actions/Navigation.java
===================================================================
--- trunk/src/org/expeditee/actions/Navigation.java	(revision 1414)
+++ trunk/src/org/expeditee/actions/Navigation.java	(revision 1415)
@@ -211,5 +211,5 @@
 
 		// find the next item to visit
-		List<Item> items = parent.getItems(); // getItems method gets us the
+		List<Item> items = parent.getSortedItems(); // getItems method gets us the
 		// FirstItem on the frame
 		int parentItemLinkedToSource = 0; // ByMike: Will be set to the
Index: trunk/src/org/expeditee/actions/ScriptBase.java
===================================================================
--- trunk/src/org/expeditee/actions/ScriptBase.java	(revision 1414)
+++ trunk/src/org/expeditee/actions/ScriptBase.java	(revision 1415)
@@ -135,5 +135,5 @@
 	
 	// get all items on the frame
-	List<Item> y_ordered_items = (List<Item>)frame.getItems();
+	List<Item> y_ordered_items = (List<Item>)frame.getSortedItems();
 	// remove the title item
 	y_ordered_items.remove(frame.getTitleItem());
Index: trunk/src/org/expeditee/actions/Simple.java
===================================================================
--- trunk/src/org/expeditee/actions/Simple.java	(revision 1414)
+++ trunk/src/org/expeditee/actions/Simple.java	(revision 1415)
@@ -1463,5 +1463,5 @@
 					Frame frame = (Frame) context.getPointers().getVariable(
 							frameVar).getValue();
-					Integer count = frame.getItems(true).size();
+					Integer count = frame.getSortedItems(true).size();
 					context.getPrimitives().setValue(countVar,
 							new SInteger(count));
@@ -2391,5 +2391,5 @@
 					double thisFramesPause = pause;
 					// check for change in delay for this frame only
-					Item pauseItem = ItemUtils.FindTag(frame.getItems(),
+					Item pauseItem = ItemUtils.FindTag(frame.getSortedItems(),
 							"@DisplayFramePause:");
 					if (pauseItem != null) {
@@ -2489,5 +2489,5 @@
 						frameVar).getValue();
 				frameToClear.clear(false);
-				assert (frameToClear.getItems().size() <= 1);
+				assert (frameToClear.getSortedItems().size() <= 1);
 			} catch (Exception e) {
 				success = false;
Index: trunk/src/org/expeditee/agents/ComputeTree.java
===================================================================
--- trunk/src/org/expeditee/agents/ComputeTree.java	(revision 1414)
+++ trunk/src/org/expeditee/agents/ComputeTree.java	(revision 1415)
@@ -58,5 +58,5 @@
 		
 		//TODO can speed this up by using frame.hasAnnotations
-		for (Item i : frame.getItems()) {
+		for (Item i : frame.getSortedItems()) {
 			if (_stop)
 				return null;
Index: trunk/src/org/expeditee/agents/CopyTree.java
===================================================================
--- trunk/src/org/expeditee/agents/CopyTree.java	(revision 1414)
+++ trunk/src/org/expeditee/agents/CopyTree.java	(revision 1415)
@@ -96,5 +96,5 @@
 
 		boolean added = false;
-		for (Item i : fresh.getItems())
+		for (Item i : fresh.getSortedItems())
 			if (i.getLink() != null && !i.isAnnotation() && i.isLinkValid()) {
 				String link = i.getLink().toLowerCase();
@@ -133,5 +133,5 @@
 			Frame toParse = FrameIO.LoadFrame(name);
 			boolean changed = false;
-			for (Item i : toParse.getItems()) {
+			for (Item i : toParse.getSortedItems()) {
 				if (i.getLink() != null && i.isAnnotation() && i.isLinkValid()) {
 					String link = i.getLink();
Index: trunk/src/org/expeditee/agents/DisplayComet.java
===================================================================
--- trunk/src/org/expeditee/agents/DisplayComet.java	(revision 1414)
+++ trunk/src/org/expeditee/agents/DisplayComet.java	(revision 1415)
@@ -55,5 +55,5 @@
 			seen.add(oldFrame.getName().toLowerCase());
 			_frameList.push(oldFrame);
-			old = ItemUtils.FindExactTag(oldFrame.getItems(), ItemUtils
+			old = ItemUtils.FindExactTag(oldFrame.getSortedItems(), ItemUtils
 					.GetTag(ItemUtils.TAG_BACKUP));
 			oldFrame = null;
Index: trunk/src/org/expeditee/agents/DisplayTree.java
===================================================================
--- trunk/src/org/expeditee/agents/DisplayTree.java	(revision 1414)
+++ trunk/src/org/expeditee/agents/DisplayTree.java	(revision 1415)
@@ -96,5 +96,5 @@
 	private void delay(Frame toSearch) {
 		// check for change in globaly delay time
-		Item delay = ItemUtils.FindTag(toSearch.getItems(),
+		Item delay = ItemUtils.FindTag(toSearch.getSortedItems(),
 				"@DisplayTreePause:");
 		
@@ -112,5 +112,5 @@
 
 		// check for change in delay for this frame only
-		delay = ItemUtils.FindTag(toSearch.getItems(), "@DisplayFramePause:");
+		delay = ItemUtils.FindTag(toSearch.getSortedItems(), "@DisplayFramePause:");
 		if (delay != null) {
 			try {
Index: trunk/src/org/expeditee/agents/DisplayTreeLeaves.java
===================================================================
--- trunk/src/org/expeditee/agents/DisplayTreeLeaves.java	(revision 1414)
+++ trunk/src/org/expeditee/agents/DisplayTreeLeaves.java	(revision 1415)
@@ -46,5 +46,5 @@
 		// call display trees process only if the frame doesnt have any linked
 		// items
-		for (Item item : toProcess.getItems()) {
+		for (Item item : toProcess.getSortedItems()) {
 			if (item.getLink() != null && !item.isAnnotation())
 				return;
Index: trunk/src/org/expeditee/agents/Format.java
===================================================================
--- trunk/src/org/expeditee/agents/Format.java	(revision 1414)
+++ trunk/src/org/expeditee/agents/Format.java	(revision 1415)
@@ -29,4 +29,5 @@
 import org.expeditee.gui.Frame;
 import org.expeditee.gui.FrameUtils;
+import org.expeditee.gui.ItemsList;
 import org.expeditee.items.Item;
 import org.expeditee.items.Text;
@@ -181,5 +182,5 @@
 		 */
 		start.setChanged(true);
-		start.addToUndoMove(changedItems);
+		start.addToUndoMove(new ItemsList(changedItems));
 		DisplayController.requestRefresh(true);
 		return null;
Index: trunk/src/org/expeditee/agents/GraphFramesetLinks.java
===================================================================
--- trunk/src/org/expeditee/agents/GraphFramesetLinks.java	(revision 1414)
+++ trunk/src/org/expeditee/agents/GraphFramesetLinks.java	(revision 1415)
@@ -119,5 +119,5 @@
 				}
 
-				List<Item> items = toProccess.getItems();
+				List<Item> items = toProccess.getSortedItems();
 
 				for (Item item : items) {
Index: trunk/src/org/expeditee/agents/HFormat.java
===================================================================
--- trunk/src/org/expeditee/agents/HFormat.java	(revision 1414)
+++ trunk/src/org/expeditee/agents/HFormat.java	(revision 1415)
@@ -24,4 +24,5 @@
 
 import org.expeditee.gui.Frame;
+import org.expeditee.gui.ItemsList;
 import org.expeditee.items.Item;
 import org.expeditee.items.Text;
@@ -66,5 +67,5 @@
 		
 		System.out.println(changedItems);
-		start.addToUndoMove(changedItems);
+		start.addToUndoMove(new ItemsList(changedItems));
 		return null;
 	}
Index: trunk/src/org/expeditee/agents/Sort.java
===================================================================
--- trunk/src/org/expeditee/agents/Sort.java	(revision 1414)
+++ trunk/src/org/expeditee/agents/Sort.java	(revision 1415)
@@ -67,5 +67,5 @@
 
 		// items will need to be resorted after this
-		start.setResort(true);
+		start.invalidateSorted();
 		DisplayController.requestRefresh(true);
 
Index: trunk/src/org/expeditee/agents/TreeProcessor.java
===================================================================
--- trunk/src/org/expeditee/agents/TreeProcessor.java	(revision 1414)
+++ trunk/src/org/expeditee/agents/TreeProcessor.java	(revision 1415)
@@ -79,5 +79,5 @@
 
 			// the items on the frame currently being processed.
-			List<Item> items = next.getItems();
+			List<Item> items = next.getSortedItems();
 
 			// resume from the next item in the list
Index: trunk/src/org/expeditee/assets/resources-public/framesets/authentication/1.exp
===================================================================
--- trunk/src/org/expeditee/assets/resources-public/framesets/authentication/1.exp	(revision 1414)
+++ trunk/src/org/expeditee/assets/resources-public/framesets/authentication/1.exp	(revision 1415)
@@ -1,8 +1,8 @@
-V 167
-p 40
+V 171
+p 400
 U authadmin
 D 07Jan2019[14:34]
 M nobody
-d 23May2019[15:50]
+d 04Jul2019[13:20]
 B 100 100 39 100
 Z
@@ -20,4 +20,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 23
@@ -33,4 +34,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 24
@@ -46,4 +48,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 25
@@ -59,4 +62,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 60
@@ -78,6 +82,7 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Username
+_sl F
 _ti 1
 
@@ -101,6 +106,7 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Password
+_sl F
 _ti 2
 
@@ -123,5 +129,7 @@
 M 205
 h 1.0
+_sl F
 _ti 3
+_ae true
 
 S P 78
@@ -162,4 +170,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 67
@@ -177,4 +186,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 68
@@ -192,4 +202,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 69
@@ -207,4 +218,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S P 80
@@ -260,100 +272,32 @@
 Z
 
-ActiveTime:2597632:50:00
-DarkTime:-2597632:-55:-56
-50:47:701 375 276 kSHIFT
-50:47:812 375 276 kB
-50:49:753 403 286 Ld
-50:49:873 403 286 Lu
-51:37:130 739 260 kSHIFT
-51:37:369 739 260 kT
-51:37:642 750 260 kO
-51:37:817 759 260 kG
-51:37:929 768 260 kG
-51:38:017 777 260 kL
-51:38:122 782 260 kE
-51:38:281 790 260 kSHIFT
-51:38:361 790 260 kA
-51:38:521 802 260 kU
-51:38:681 812 260 kT
-51:38:753 817 260 kH
-51:38:978 826 260 kCTRL
-51:39:137 826 260 kA
-51:40:411 794 245 Ld
-51:40:545 794 245 Lu
-51:41:506 473 279 Ld
-51:41:617 473 279 Rd
-51:41:745 473 279 Ru
-51:41:753 473 279 Lu
-51:49:018 205 254 Md
-51:49:129 205 254 Rd
-51:50:065 205 254 Mu
-51:50:073 205 254 Ru
-51:53:817 51 275 kSHIFT
-51:54:185 51 275 kP
-51:54:377 61 275 kE
-51:54:435 68 275 kR
-51:54:578 75 275 kM
-51:54:657 89 275 kI
-51:54:777 94 275 kS
-51:54:913 101 275 kS
-51:55:026 108 275 kI
-51:55:089 113 275 kO
-51:55:122 122 275 kN
-51:55:305 131 275 kSHIFT
-51:57:866 103 256 Md
-51:57:938 103 256 Mu
-51:58:557 119 248 Md
-51:58:588 119 248 Rd
-51:58:738 119 248 Ru
-51:58:761 119 248 Mu
-51:59:171 98 261 Md
-51:59:241 98 261 Mu
-52:00:458 360 271 Rd
-52:00:633 360 271 Ru
-52:01:562 369 322 Rd
-52:01:674 369 322 Ru
-52:02:433 250 348 Md
-52:02:482 250 348 Rd
-52:02:633 250 348 Ru
-52:02:641 250 348 Mu
-52:03:114 352 283 Ld
-52:03:162 352 283 Rd
-52:03:266 352 283 Lu
-52:03:289 352 283 Ru
-52:06:346 233 266 Md
-52:06:377 233 266 Rd
-52:06:553 233 266 Mu
-52:06:578 233 266 Ru
-52:07:913 119 259 kSHIFT
-52:08:073 119 259 kO
-52:08:370 132 259 kW
-52:08:434 145 259 kN
-52:09:033 154 259 kE
-52:09:057 162 259 kR
-52:09:265 168 259 kSHIFT
-52:09:569 177 259 kA
-52:09:681 185 259 kU
-52:09:817 194 259 kT
-52:09:890 199 259 kH
-52:10:033 208 259 kA
-52:10:138 216 259 kD
-52:10:338 225 259 kM
-52:10:418 239 259 kI
-52:10:505 244 259 kN
-52:12:058 144 259 Md
-52:12:130 144 259 Mu
-52:12:841 346 280 Rd
-52:12:978 346 280 Ru
-52:13:554 371 330 Rd
-52:13:674 371 330 Ru
-52:14:234 200 307 Md
-52:14:306 200 307 Rd
-52:14:433 200 307 Ru
-52:14:474 200 307 Mu
-52:15:314 769 253 Md
-52:15:369 769 253 Rd
-52:15:498 769 253 Ru
-52:15:522 769 253 Mu
-52:16:354 769 253 kCTRL
-52:16:818 769 253 kS
+ActiveTime:4333414:09:21
+DarkTime:-4333102:-15:-17
+20:36:610 124 250 kSHIFT
+20:36:873 124 250 kT
+20:37:090 135 250 kO
+20:37:217 144 250 kG
+20:37:369 153 250 kG
+20:37:490 162 250 kL
+20:37:570 167 250 kE
+20:37:745 175 250 kSHIFT
+20:37:801 175 250 kA
+20:38:001 188 250 kU
+20:38:105 196 250 kT
+20:38:209 202 250 kH
+20:38:377 211 250 kCTRL
+20:38:569 211 250 kA
+20:39:362 211 250 Ld
+20:39:489 211 250 Lu
+20:40:386 462 393 Ld
+20:40:497 462 393 Rd
+20:40:681 462 393 Ru
+20:40:690 462 393 Lu
+20:43:657 254 204 Md
+20:43:889 254 204 Rd
+20:44:537 254 204 Ru
+20:44:538 254 204 Mu
+20:45:161 174 239 Md
+20:45:201 174 239 Rd
+20:45:409 174 239 Ru
+20:45:449 174 239 Mu
Index: trunk/src/org/expeditee/assets/resources-public/framesets/authentication/2.exp
===================================================================
--- trunk/src/org/expeditee/assets/resources-public/framesets/authentication/2.exp	(revision 1414)
+++ trunk/src/org/expeditee/assets/resources-public/framesets/authentication/2.exp	(revision 1415)
@@ -1,8 +1,8 @@
-V 300
-p 40
+V 302
+p 400
 U authadmin
 D 07Dec2018[12:19]
-M authadmin
-d 27May2019[11:51]
+M nobody
+d 04Jul2019[13:20]
 B 100 100 39 100
 Z
@@ -20,5 +20,5 @@
 m 0.0
 h -1.0
-p 40
+p 400
 _sl F
 
@@ -35,5 +35,5 @@
 m 0.0
 h -1.0
-p 40
+p 400
 _sl F
 
@@ -50,5 +50,5 @@
 m 0.0
 h -1.0
-p 40
+p 400
 _sl F
 
@@ -56,5 +56,5 @@
 s 11Apr2019[10:56.20]
 d 0 0 0 100
-P 280 168
+P 280 185
 T Create an Expeditee Account
 N 150
@@ -66,5 +66,5 @@
 m 0.0
 h -1.0
-p 40
+p 400
 _sl F
 
@@ -92,5 +92,5 @@
 G 100 100 100 100
 K 0 0 0 100
-P 175 260
+P 175 287
 T 
 x F
@@ -106,6 +106,7 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Username
+_sl F
 _ti 1
 
@@ -115,5 +116,5 @@
 G 100 100 100 100
 K 0 0 0 100
-P 175 320
+P 175 347
 T 
 x F
@@ -131,7 +132,6 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Password
-_sl T
 _ti 2
 
@@ -141,5 +141,5 @@
 G 100 100 100 100
 K 0 0 0 100
-P 515 320
+P 515 347
 T 
 x F
@@ -157,7 +157,6 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Password Again
-_sl T
 _ti 3
 
@@ -167,5 +166,5 @@
 G 100 100 100 100
 K 0 0 0 100
-P 515 380
+P 515 407
 T 
 x F
@@ -182,7 +181,6 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Email Again
-_sl T
 _ti 5
 
@@ -192,5 +190,5 @@
 G 100 100 100 100
 K 0 0 0 100
-P 175 380
+P 175 407
 T 
 x F
@@ -207,7 +205,6 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Email
-_sl T
 _ti 4
 
@@ -217,5 +214,5 @@
 G 100 100 0 100
 K 0 0 0 100
-P 394 458
+P 394 469
 T Create Account
 X AuthCreateAccount
@@ -231,7 +228,8 @@
 M 205
 h 1.0
-p 41
+p 411
 _sl F
 _ti 6
+_ae true
 
 S P 773
@@ -246,5 +244,5 @@
 l 1467 1476
 c 1481 1482
-p 41
+p 411
 
 S P 774
@@ -258,5 +256,5 @@
 l 1467 1470
 c 1481 1483
-p 41
+p 411
 
 S P 769
@@ -270,5 +268,5 @@
 l 1455 1464
 c 1477 1478
-p 41
+p 411
 
 S P 772
@@ -282,5 +280,5 @@
 l 1464 1461
 c 1477 1480
-p 41
+p 411
 
 S T 764
@@ -298,5 +296,5 @@
 m 0.0
 h -1.0
-p 41
+p 411
 _sl F
 
@@ -315,5 +313,5 @@
 m 0.0
 h -1.0
-p 41
+p 411
 _sl F
 
@@ -332,5 +330,5 @@
 m 0.0
 h -1.0
-p 41
+p 411
 _sl F
 
@@ -349,5 +347,5 @@
 m 0.0
 h -1.0
-p 41
+p 411
 _sl F
 
@@ -366,5 +364,5 @@
 m 0.0
 h -1.0
-p 41
+p 411
 _sl F
 
@@ -383,5 +381,5 @@
 m 0.0
 h -1.0
-p 40
+p 400
 _sl F
 
@@ -400,5 +398,5 @@
 m 0.0
 h -1.0
-p 41
+p 411
 _sl F
 
@@ -417,5 +415,5 @@
 m 0.0
 h -1.0
-p 41
+p 411
 _sl F
 
@@ -431,5 +429,5 @@
 l 1455 1458
 c 1478 1479
-p 41
+p 411
 
 S P 771
@@ -443,5 +441,5 @@
 l 1461 1458
 c 1480 1479
-p 41
+p 411
 
 S P 775
@@ -455,5 +453,5 @@
 l 1470 1473
 c 1483 1484
-p 41
+p 411
 
 S P 776
@@ -467,5 +465,5 @@
 l 1476 1473
 c 1482 1484
-p 41
+p 411
 
 Z
@@ -523,129 +521,54 @@
 Z
 
-ActiveTime:01:25:41
+ActiveTime:01:25:44
 DarkTime:01:32:58
-49:46:377 540 328 Ld
-49:46:521 540 328 Rd
-49:46:712 540 328 Ru
-49:46:728 540 328 Lu
-49:51:681 705 241 kSHIFT
-49:52:097 705 241 kT
-49:52:316 716 241 kO
-49:52:508 725 241 kG
-49:52:652 734 241 kG
-49:52:762 743 241 kL
-49:52:873 748 241 kE
-49:53:036 756 241 kSHIFT
-49:53:132 756 241 kA
-49:53:324 769 241 kU
-49:53:442 778 241 kT
-49:53:547 783 241 kH
-49:53:741 792 241 kCTRL
-49:53:978 792 241 kA
-49:55:338 745 238 Ld
-49:55:433 745 238 Lu
-49:56:269 748 242 Md
-49:56:368 748 242 Rd
-49:56:477 748 242 Ru
-49:56:508 748 242 Mu
-49:59:950 699 238 kSHIFT
-50:00:169 699 238 kW
-50:00:346 716 238 kI
-50:00:483 721 238 kD
-50:00:623 730 238 kT
-50:00:702 735 238 kH
-50:00:795 744 238 kSHIFT
-50:01:563 748 238 kBACKSPACE
-50:01:641 744 238 kSHIFT
-50:03:755 728 235 Md
-50:03:848 728 235 Mu
-50:04:584 564 332 Rd
-50:04:741 564 332 Ru
-50:05:217 557 398 Rd
-50:05:311 556 398 Ru
-50:06:211 231 333 Rd
-50:06:305 231 333 Ru
-50:06:791 212 390 Rd
-50:06:885 212 390 Ru
-50:07:494 660 271 Md
-50:07:604 660 271 Rd
-50:07:760 660 271 Ru
-50:07:760 660 271 Mu
-50:08:298 567 391 Ld
-50:08:329 567 391 Rd
-50:08:465 567 391 Lu
-50:08:482 567 391 Ru
-50:10:777 702 257 Md
-50:10:824 702 257 Rd
-50:10:999 702 257 Ru
-50:11:015 702 257 Mu
-50:12:094 547 398 kLEFT_ARROW
-50:15:756 657 242 kSHIFT
-50:15:896 657 242 kS
-50:16:068 667 242 kI
-50:16:132 672 242 kN
-50:16:273 681 242 kG
-50:16:351 690 242 kL
-50:16:476 695 242 kE
-50:16:554 703 242 kSHIFT
-50:16:680 703 242 kL
-50:16:906 714 242 kI
-50:16:969 719 242 kN
-50:17:086 728 242 kE
-50:17:181 736 242 kSHIFT
-50:17:321 736 242 kO
-50:17:478 749 242 kN
-50:17:569 758 242 kL
-50:17:729 763 242 kY
-50:18:276 772 242 kSHIFT
-50:18:652 781 242 kT
-50:18:793 786 242 kR
-50:18:903 792 242 kU
-50:18:981 800 242 kE
-50:20:639 706 227 Md
-50:20:732 705 227 Mu
-50:23:753 587 342 Rd
-50:23:894 587 342 Ru
-50:24:803 253 345 Rd
-50:24:897 253 345 Ru
-50:25:459 219 399 Rd
-50:25:568 219 399 Ru
-50:26:109 589 393 Rd
-50:26:257 589 392 Ru
-50:28:245 660 275 Md
-50:28:292 660 275 Rd
-50:28:448 660 275 Ru
-50:28:464 660 275 Mu
-50:29:583 565 405 kLEFT_ARROW
-50:30:625 254 281 Ld
-50:30:703 254 281 Rd
-50:30:860 254 281 Lu
-50:30:860 254 281 Ru
-50:34:787 708 285 Md
-50:34:858 708 285 Rd
-50:35:039 708 285 Ru
-50:35:039 708 285 Mu
-50:35:587 544 352 Ld
-50:35:665 544 352 Rd
-50:35:790 544 352 Lu
-50:35:806 544 352 Ru
-50:37:058 715 256 Md
-50:37:095 715 256 Rd
-50:37:283 715 256 Ru
-50:37:299 715 256 Mu
-50:40:472 876 220 kCTRL
-50:40:987 876 220 kCTRL
-50:41:019 876 220 kCTRL
-50:41:050 876 220 kCTRL
-50:41:081 876 220 kCTRL
-50:41:119 876 220 kCTRL
-50:41:150 876 220 kCTRL
-50:41:182 876 220 kCTRL
-50:41:213 876 220 kCTRL
-50:41:244 876 220 kCTRL
-50:41:275 876 220 kCTRL
-50:41:306 876 220 kS
-51:24:134 583 226 kSHIFT
-51:24:400 583 226 kU
-51:24:585 596 226 kS
-51:27:824 603 226 kBACKSPACE
+20:55:434 79 398 kSHIFT
+20:55:722 79 398 kT
+20:55:898 90 398 kO
+20:56:050 99 398 kG
+20:56:194 108 398 kG
+20:56:251 117 398 kL
+20:56:338 122 398 kE
+20:56:498 130 398 kSHIFT
+20:56:593 130 398 kA
+20:56:738 143 398 kU
+20:56:890 152 398 kT
+20:56:961 156 398 kH
+20:57:194 166 398 kCTRL
+20:57:394 166 398 kA
+20:58:462 102 384 Ld
+20:58:618 102 384 Lu
+20:59:346 103 401 Md
+20:59:434 103 401 Rd
+20:59:578 103 401 Ru
+20:59:602 103 401 Mu
+21:01:922 69 473 kSHIFT
+21:02:308 69 473 kE
+21:02:899 80 473 kN
+21:03:076 89 473 kT
+21:03:193 94 473 kE
+21:03:284 102 473 kR
+21:03:436 108 473 kSHIFT
+21:03:559 108 473 kC
+21:03:724 120 473 kL
+21:03:893 125 473 kI
+21:04:009 130 473 kC
+21:04:090 138 473 kK
+21:04:201 147 473 kSHIFT
+21:05:236 156 473 kT
+21:05:922 161 473 kR
+21:06:097 167 473 kU
+21:06:162 176 473 kE
+21:07:404 183 473 Md
+21:07:514 183 473 Mu
+21:08:149 431 452 Md
+21:08:274 431 452 Mu
+21:11:572 138 467 kCTRL
+21:12:071 138 467 kCTRL
+21:12:102 138 467 kCTRL
+21:12:135 138 467 kCTRL
+21:12:169 138 467 kCTRL
+21:12:203 138 467 kCTRL
+21:12:235 138 467 kCTRL
+21:12:269 138 467 kCTRL
+21:12:275 138 467 kS
Index: trunk/src/org/expeditee/assets/resources-public/framesets/authentication/3.exp
===================================================================
--- trunk/src/org/expeditee/assets/resources-public/framesets/authentication/3.exp	(revision 1414)
+++ trunk/src/org/expeditee/assets/resources-public/framesets/authentication/3.exp	(revision 1415)
@@ -1,8 +1,8 @@
-V 100
-p 40
+V 102
+p 400
 U authadmin
 D 07Jan2019[14:34]
-M authadmin
-d 27May2019[11:48]
+M nobody
+d 04Jul2019[13:22]
 B 100 100 39 100
 Z
@@ -20,5 +20,5 @@
 m 0.0
 h -1.0
-p 40
+p 400
 _sl F
 
@@ -35,5 +35,5 @@
 m 0.0
 h -1.0
-p 40
+p 400
 _sl F
 
@@ -50,5 +50,5 @@
 m 0.0
 h -1.0
-p 40
+p 400
 _sl F
 
@@ -65,5 +65,5 @@
 m 0.0
 h -1.0
-p 40
+p 400
 _sl F
 
@@ -104,5 +104,5 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Password
 _sl F
@@ -128,6 +128,7 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph New Password
+_sl F
 _ti 2
 
@@ -151,6 +152,7 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph New Password Again
+_sl F
 _ti 3
 
@@ -174,7 +176,8 @@
 M 205
 h 1.0
-p 41
+p 411
 _sl F
 _ti 4
+_ae true
 
 S P 263
@@ -301,69 +304,46 @@
 Z
 
-ActiveTime:00:16:32
+ActiveTime:00:16:33
 DarkTime:00:20:25
-48:13:768 687 245 kSHIFT
-48:13:947 687 245 kS
-48:14:193 697 245 kI
-48:14:257 702 245 kN
-48:14:382 711 245 kG
-48:14:464 720 245 kL
-48:14:574 725 245 kE
-48:14:641 733 245 kSHIFT
-48:14:768 733 245 kL
-48:14:986 744 245 kI
-48:15:057 749 245 kN
-48:15:147 758 245 kE
-48:15:259 766 245 kSHIFT
-48:15:321 766 245 kO
-48:15:434 779 245 kN
-48:15:634 792 245 kL
-48:15:852 797 245 kY
-48:16:141 805 245 kBACKSPACE
-48:16:281 797 245 kBACKSPACE
-48:16:407 792 245 kBACKSPACE
-48:16:628 779 245 kN
-48:16:918 788 245 kL
-48:17:035 793 245 kY
-48:17:391 801 245 kSHIFT
-48:18:113 811 245 kT
-48:18:258 816 245 kR
-48:18:352 822 245 kU
-48:18:430 831 245 kE
-48:20:006 689 234 Md
-48:20:117 689 234 Mu
-48:21:588 555 338 Rd
-48:21:744 555 338 Ru
-48:22:463 195 331 Rd
-48:22:624 195 331 Ru
-48:23:324 690 271 Rd
-48:23:324 690 271 Md
-48:23:574 690 271 Ru
-48:23:590 690 271 Mu
-48:24:405 669 241 kSHIFT
-48:24:577 669 241 kW
-48:24:733 686 241 kI
-48:24:858 691 241 kD
-48:25:036 700 241 kT
-48:25:098 705 241 kH
-48:25:217 714 241 kSHIFT
-48:27:126 750 241 Md
-48:27:220 750 241 Mu
-48:27:868 591 336 Rd
-48:28:025 591 336 Ru
-48:28:690 333 345 Rd
-48:28:816 333 345 Ru
-48:29:349 678 258 Md
-48:29:443 678 258 Rd
-48:29:599 678 258 Ru
-48:29:599 678 258 Mu
-48:30:821 598 341 Ld
-48:30:884 598 341 Rd
-48:31:040 598 341 Lu
-48:31:040 598 341 Ru
-48:31:979 681 264 Md
-48:32:057 681 264 Rd
-48:32:213 681 264 Mu
-48:32:232 681 264 Ru
-48:33:919 780 241 kCTRL
-48:34:122 780 241 kS
+22:46:330 32 445 kSHIFT
+22:46:490 32 445 kT
+22:46:722 43 445 kO
+22:46:890 52 445 kG
+22:47:034 61 445 kG
+22:47:122 70 445 kL
+22:47:211 75 445 kE
+22:47:362 83 445 kSHIFT
+22:47:450 83 445 kA
+22:47:634 96 445 kU
+22:47:730 105 445 kT
+22:47:850 110 445 kH
+22:48:026 119 445 kCTRL
+22:48:267 119 445 kA
+22:49:554 97 439 Ld
+22:49:690 97 439 Lu
+22:50:922 76 541 kSHIFT
+22:51:114 76 541 kE
+22:51:266 87 541 kN
+22:51:394 96 541 kT
+22:51:498 101 541 kE
+22:51:594 109 541 kR
+22:51:730 115 541 kSHIFT
+22:51:866 115 541 kC
+22:52:090 127 541 kL
+22:52:250 132 541 kI
+22:52:370 137 541 kC
+22:52:458 145 541 kK
+22:52:594 154 541 kSHIFT
+22:53:082 163 541 kT
+22:53:242 168 541 kR
+22:53:323 174 541 kU
+22:53:426 182 541 kE
+22:54:490 191 541 Md
+22:54:610 191 541 Mu
+22:55:437 432 404 Md
+22:55:555 432 404 Mu
+22:56:540 65 444 Md
+22:56:573 65 444 Rd
+22:56:754 65 444 Ru
+22:56:794 65 444 Mu
+22:57:907 65 444 kRIGHT_ARROW
Index: trunk/src/org/expeditee/assets/resources-public/framesets/authentication/4.exp
===================================================================
--- trunk/src/org/expeditee/assets/resources-public/framesets/authentication/4.exp	(revision 1414)
+++ trunk/src/org/expeditee/assets/resources-public/framesets/authentication/4.exp	(revision 1415)
@@ -1,8 +1,8 @@
-V 228
-p 40
+V 232
+p 400
 U authadmin
 D 07Jan2019[14:34]
 M nobody
-d 30May2019[12:55]
+d 04Jul2019[13:23]
 B 100 100 39 100
 Z
@@ -20,5 +20,5 @@
 m 0.0
 h -1.0
-p 40
+p 400
 _sl F
 
@@ -35,5 +35,5 @@
 m 0.0
 h -1.0
-p 40
+p 400
 _sl F
 
@@ -50,5 +50,5 @@
 m 0.0
 h -1.0
-p 40
+p 400
 _sl F
 
@@ -65,5 +65,5 @@
 m 0.0
 h -1.0
-p 40
+p 400
 _sl F
 
@@ -85,5 +85,5 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Username
 _sl F
@@ -110,6 +110,8 @@
 M 300
 h 1.0
-p 41
+p 411
+_sl F
 _ti 2
+_ae true
 
 S P 328
@@ -148,6 +150,7 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Identity Number
+_sl F
 _ti 3
 
@@ -172,6 +175,8 @@
 M 300
 h 1.0
-p 41
+p 411
+_sl F
 _ti 4
+_ae true
 
 S P 382
@@ -217,6 +222,7 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Password Piece Two
+_sl F
 _ti 6
 
@@ -239,6 +245,7 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Password Piece One
+_sl F
 _ti 5
 
@@ -262,5 +269,5 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph New Password Again
 _sl F
@@ -286,5 +293,5 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph New Password
 _sl F
@@ -310,7 +317,8 @@
 M 205
 h 1.0
-p 41
+p 411
 _sl F
 _ti 9
+_ae true
 
 S P 618
@@ -325,5 +333,5 @@
 l 620 639
 c 1313 1314
-p 41
+p 411
 
 S P 619
@@ -337,5 +345,5 @@
 l 620 621
 c 1313 1315
-p 41
+p 411
 
 S P 622
@@ -349,5 +357,5 @@
 l 624 625
 c 1373 1374
-p 41
+p 411
 
 S P 623
@@ -361,5 +369,5 @@
 l 625 635
 c 1373 1376
-p 41
+p 411
 
 S T 626
@@ -377,5 +385,5 @@
 m 0.0
 h -1.0
-p 41
+p 411
 _sl F
 
@@ -394,5 +402,5 @@
 m 0.0
 h -1.0
-p 41
+p 411
 _sl F
 
@@ -411,5 +419,5 @@
 m 0.0
 h -1.0
-p 41
+p 411
 _sl F
 
@@ -428,5 +436,5 @@
 m 0.0
 h -1.0
-p 41
+p 411
 _sl F
 
@@ -445,5 +453,5 @@
 m 0.0
 h -1.0
-p 41
+p 411
 _sl F
 
@@ -462,5 +470,5 @@
 m 0.0
 h -1.0
-p 41
+p 411
 _sl F
 
@@ -479,5 +487,5 @@
 m 0.0
 h -1.0
-p 41
+p 411
 _sl F
 
@@ -493,5 +501,5 @@
 l 624 636
 c 1374 1375
-p 41
+p 411
 
 S P 634
@@ -505,5 +513,5 @@
 l 635 636
 c 1376 1375
-p 41
+p 411
 
 S P 637
@@ -517,5 +525,5 @@
 l 621 640
 c 1315 1320
-p 41
+p 411
 
 S P 638
@@ -529,5 +537,5 @@
 l 639 640
 c 1314 1320
-p 41
+p 411
 
 Z
@@ -591,127 +599,40 @@
 Z
 
-ActiveTime:01:37:49
+ActiveTime:01:38:25
 DarkTime:02:33:57
-55:59:214 974 141 kSHIFT
-55:59:413 974 141 kT
-55:59:669 985 141 kO
-55:59:820 994 141 kG
-55:59:955 1003 141 kG
-56:00:066 1012 141 kL
-56:00:186 1016 141 kE
-56:00:348 1025 141 kSHIFT
-56:00:436 1025 141 kA
-56:00:660 1038 141 kU
-56:00:763 1047 141 kT
-56:00:863 1052 141 kH
-56:01:085 1061 141 kCTRL
-56:01:245 1061 141 kA
-56:12:623 644 193 Ld
-56:12:691 644 193 Rd
-56:12:826 644 193 Lu
-56:12:843 644 193 Ru
-56:13:979 986 135 Ld
-56:14:115 986 135 Lu
-56:14:966 696 197 Ld
-56:15:012 696 197 Rd
-56:15:147 696 197 Lu
-56:15:187 696 197 Ru
-56:26:280 1069 243 Md
-56:26:299 1069 243 Rd
-56:26:419 1069 243 Mu
-56:26:426 1069 243 Ru
-56:27:534 1026 139 Md
-56:27:571 1026 139 Rd
-56:27:779 1026 139 Ru
-56:27:780 1026 139 Mu
-56:31:507 663 197 Ld
-56:31:581 663 197 Rd
-56:31:723 663 197 Lu
-56:31:747 663 197 Ru
-56:34:254 1038 189 Md
-56:34:314 1038 189 Rd
-56:34:523 1038 189 Mu
-56:34:538 1038 189 Ru
-56:35:068 1151 300 kSHIFT
-56:35:568 1150 300 kSHIFT
-56:35:599 1150 300 kSHIFT
-56:35:632 1150 300 kSHIFT
-56:35:666 1150 300 kSHIFT
-56:35:699 1150 300 kSHIFT
-56:35:732 1150 300 kSHIFT
-56:35:764 1150 300 kSHIFT
-56:35:798 1150 300 kSHIFT
-56:35:831 1150 300 kSHIFT
-56:35:863 1150 300 kSHIFT
-56:35:874 1150 300 kW
-56:36:380 1167 300 kI
-56:36:451 1172 300 kD
-56:36:645 1181 300 kT
-56:36:707 1186 300 kH
-56:36:810 1195 300 kSHIFT
-56:38:190 1182 295 Md
-56:38:307 1182 295 Mu
-56:38:894 625 191 Rd
-56:38:987 625 191 Ru
-56:39:764 627 249 Rd
-56:39:859 627 249 Ru
-56:41:702 1047 334 Md
-56:41:781 1047 334 Rd
-56:41:931 1047 334 Ru
-56:41:947 1047 334 Mu
-56:54:550 704 261 Ld
-56:54:765 704 261 Rd
-56:54:947 704 261 Ru
-56:54:955 704 261 Lu
-56:58:422 1052 309 Md
-56:58:451 1052 309 Rd
-56:58:627 1052 309 Ru
-56:58:627 1052 309 Mu
-57:09:933 848 208 kBACKSPACE
-57:20:206 1047 362 kSHIFT
-57:20:389 1047 362 kW
-57:20:678 1064 362 kSHIFT
-57:24:475 1085 362 Md
-57:24:619 1085 362 Mu
-57:25:366 720 212 Md
-57:25:459 720 212 Mu
-57:29:539 1023 282 kSHIFT
-57:29:997 1023 282 kW
-57:30:349 1040 282 kI
-57:30:428 1045 282 kD
-57:30:669 1054 282 kT
-57:30:748 1059 282 kH
-57:30:835 1068 282 kSHIFT
-57:33:967 1109 284 Md
-57:34:107 1109 284 Mu
-57:35:022 700 206 Rd
-57:35:131 700 206 Ru
-57:36:262 690 248 Rd
-57:36:363 690 248 Ru
-57:38:078 1136 307 Md
-57:38:203 1136 307 Mu
-57:39:158 660 256 Ld
-57:39:643 660 256 Lu
-57:42:876 881 215 kBACKSPACE
-57:43:086 874 219 kBACKSPACE
-57:43:396 865 219 kBACKSPACE
-57:45:393 600 212 kBACKSPACE
-57:45:589 590 219 kBACKSPACE
-57:45:819 582 219 kBACKSPACE
-57:49:485 1047 296 kSHIFT
-57:49:582 1047 296 kM
-57:49:806 1066 305 kI
-57:49:875 1071 305 kN
-57:51:391 1080 305 Md
-57:51:507 1080 305 Mu
-57:52:144 705 215 Rd
-57:52:195 705 215 Ru
-57:52:846 710 250 Rd
-57:52:931 710 250 Ru
-57:53:726 1142 372 Md
-57:53:788 1142 372 Rd
-57:53:923 1142 372 Ru
-57:53:947 1142 372 Mu
-58:00:035 1153 256 kCTRL
-58:00:538 1153 257 kCTRL
-58:00:554 1153 257 kS
+23:59:891 1076 133 kSHIFT
+24:00:098 1076 133 kT
+24:00:530 1087 133 kO
+24:00:739 1096 133 kG
+24:00:868 1105 133 kG
+24:00:971 1114 133 kL
+24:01:059 1119 133 kE
+24:01:203 1127 133 kSHIFT
+24:01:267 1127 133 kA
+24:01:452 1140 133 kU
+24:01:516 1149 133 kT
+24:01:661 1154 133 kH
+24:01:787 1163 133 kCTRL
+24:01:956 1163 133 kA
+24:02:797 1163 133 Ld
+24:02:891 1163 133 Lu
+24:03:467 747 207 Ld
+24:03:540 747 207 Rd
+24:03:643 747 207 Ru
+24:03:659 747 207 Lu
+24:04:533 1049 204 Md
+24:04:555 1049 204 Rd
+24:04:691 1049 204 Mu
+24:04:698 1049 204 Ru
+24:05:310 731 267 Ld
+24:05:362 731 267 Rd
+24:05:476 732 268 Lu
+24:05:477 732 268 Ru
+24:06:052 1306 239 Md
+24:06:076 1306 239 Rd
+24:06:220 1305 239 Mu
+24:06:236 1303 238 Ru
+24:06:662 1075 125 Md
+24:06:685 1075 125 Rd
+24:06:787 1075 125 Ru
+24:06:803 1075 125 Mu
Index: trunk/src/org/expeditee/assets/resources-public/framesets/authentication/5.exp
===================================================================
--- trunk/src/org/expeditee/assets/resources-public/framesets/authentication/5.exp	(revision 1414)
+++ trunk/src/org/expeditee/assets/resources-public/framesets/authentication/5.exp	(revision 1415)
@@ -1,8 +1,8 @@
-V 194
-p 40
+V 196
+p 400
 U authadmin
 D 07Jan2019[14:34]
 M authadmin
-d 23May2019[14:56]
+d 04Jul2019[13:23]
 B 100 100 39 100
 Z
@@ -20,4 +20,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 373
@@ -33,4 +34,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 374
@@ -46,4 +48,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 392
@@ -59,4 +62,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 410
@@ -77,6 +81,7 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Trusted User One
+_sl F
 _ti 1
 
@@ -103,4 +108,5 @@
 m 0.0
 h 2.0
+_sl F
 
 S T 406
@@ -121,6 +127,7 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Trusted User Two
+_sl F
 _ti 2
 
@@ -144,6 +151,8 @@
 M 300
 h 1.0
-p 41
+p 411
+_sl F
 _ti 3
+_ae true
 
 S P 428
@@ -183,4 +192,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 426
@@ -198,4 +208,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 427
@@ -213,4 +224,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S P 429
@@ -267,88 +279,26 @@
 Z
 
-ActiveTime:01:16:40
+ActiveTime:01:17:19
 DarkTime:01:04:09
-55:35:445 516 401 Ld
-55:35:533 517 401 Rd
-55:35:661 517 401 Lu
-55:35:662 517 401 Ru
-55:36:574 756 335 Md
-55:36:749 756 335 Rd
-55:39:613 756 335 Ru
-55:39:765 756 335 Mu
-56:18:735 420 343 Ld
-56:18:821 420 343 Rd
-56:18:990 420 343 Lu
-56:19:005 420 343 Ru
-56:19:990 194 308 Md
-56:20:054 194 308 Rd
-56:20:205 194 308 Ru
-56:20:206 194 308 Mu
-56:20:789 712 452 kCTRL
-56:21:150 712 452 kV
-56:22:334 660 472 Md
-56:22:445 660 472 Mu
-56:23:326 650 468 kSHIFT
-56:23:454 650 468 kA
-56:23:702 673 472 kC
-56:24:022 681 472 kT
-56:24:221 686 472 kI
-56:24:278 691 472 kO
-56:24:334 700 472 kN
-56:24:446 709 472 kSHIFT
-56:26:078 705 489 Md
-56:26:182 705 489 Mu
-56:27:014 611 401 Md
-56:27:118 611 401 Mu
-56:28:070 579 411 Ld
-56:28:126 579 410 Rd
-56:28:246 581 410 Lu
-56:28:247 581 410 Ru
-56:29:670 177 348 Md
-56:29:750 177 348 Rd
-56:29:925 177 348 Ru
-56:29:941 177 348 Mu
-56:31:326 413 392 Ld
-56:31:374 413 392 Rd
-56:31:477 413 392 Lu
-56:31:485 413 392 Ru
-56:32:455 185 308 Md
-56:32:526 185 308 Rd
-56:32:670 185 308 Ru
-56:32:685 185 308 Mu
-56:35:846 235 568 kCTRL
-56:35:926 265 589 kV
-56:36:486 278 572 Md
-56:36:581 278 572 Mu
-56:37:558 271 565 kSHIFT
-56:37:686 271 565 kA
-56:37:878 291 572 kC
-56:38:190 299 572 kT
-56:38:437 304 572 kI
-56:38:501 309 572 kO
-56:38:565 318 572 kN
-56:38:741 327 572 kSHIFT
-56:41:150 376 560 Md
-56:41:254 376 560 Mu
-56:41:998 464 400 Md
-56:42:093 464 400 Mu
-56:42:966 493 401 Ld
-56:43:102 493 401 Rd
-56:43:214 493 401 Ru
-56:43:229 493 401 Lu
-56:44:518 73 380 Md
-56:44:606 73 380 Rd
-56:44:733 73 380 Ru
-56:44:749 73 380 Mu
-56:45:622 786 366 kCTRL
-56:46:054 786 366 kS
-56:47:478 489 407 Ld
-56:47:566 489 407 Rd
-56:47:678 489 407 Ru
-56:47:694 489 407 Lu
-56:48:542 213 321 Md
-56:48:598 213 321 Rd
-56:48:733 213 321 Ru
-56:48:742 213 321 Mu
-56:50:095 441 467 Ld
-56:50:174 441 467 Lu
+23:19:762 102 718 kSHIFT
+23:19:949 102 718 kE
+23:20:099 113 718 kN
+23:20:218 122 718 kT
+23:20:331 126 718 kE
+23:20:427 135 718 kR
+23:20:605 141 718 kSHIFT
+23:20:770 141 718 kC
+23:20:948 153 718 kL
+23:21:082 158 718 kI
+23:21:220 163 718 kC
+23:21:325 171 718 kK
+23:21:396 180 718 kSHIFT
+23:21:836 189 718 kT
+23:21:996 194 718 kR
+23:22:077 200 718 kU
+23:22:180 209 718 kE
+23:23:646 205 714 Md
+23:23:738 205 714 Mu
+23:24:548 434 402 Md
+23:24:634 434 402 Mu
+23:26:428 479 628 kRIGHT_ARROW
Index: trunk/src/org/expeditee/assets/resources-public/framesets/authentication/6.exp
===================================================================
--- trunk/src/org/expeditee/assets/resources-public/framesets/authentication/6.exp	(revision 1414)
+++ trunk/src/org/expeditee/assets/resources-public/framesets/authentication/6.exp	(revision 1415)
@@ -1,8 +1,8 @@
-V 835
-p 40
+V 837
+p 400
 U authadmin
 D 23Nov2018[12:31]
 M authadmin
-d 23May2019[14:31]
+d 04Jul2019[13:23]
 B 100 100 39 100
 Z
@@ -41,4 +41,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 1684
@@ -53,4 +54,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 1685
@@ -65,4 +67,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S T 1686
@@ -77,4 +80,5 @@
 m 0.0
 h -1.0
+_sl F
 
 S P 1689
@@ -113,5 +117,6 @@
 m 0.0
 h -1.0
-p 40
+p 400
+_sl F
 
 S T 1673
@@ -128,5 +133,6 @@
 m 0.0
 h -1.0
-p 40
+p 400
+_sl F
 
 S T 1670
@@ -143,5 +149,6 @@
 m 0.0
 h -1.0
-p 40
+p 400
+_sl F
 
 S T 1637
@@ -158,5 +165,6 @@
 m 0.0
 h -1.0
-p 40
+p 400
+_sl F
 
 S T 1266
@@ -179,6 +187,7 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Username
+_sl F
 _ti 1
 
@@ -203,6 +212,7 @@
 M 300
 h 1.0
-p 44
+p 444
 _ph Password
+_sl F
 _ti 2
 
@@ -226,6 +236,8 @@
 M 205
 h 1.0
-p 41
+p 411
+_sl F
 _ti 3
+_ae true
 
 S P 1703
@@ -265,5 +277,6 @@
 m 0.0
 h -1.0
-p 41
+p 411
+_sl F
 
 S T 1696
@@ -281,5 +294,6 @@
 m 0.0
 h -1.0
-p 41
+p 411
+_sl F
 
 S T 1697
@@ -297,5 +311,6 @@
 m 0.0
 h -1.0
-p 41
+p 411
+_sl F
 
 S P 1704
@@ -359,5 +374,6 @@
 m 0.0
 h -1.0
-p 41
+p 411
+_sl F
 
 S T 1699
@@ -375,5 +391,6 @@
 m 0.0
 h -1.0
-p 41
+p 411
+_sl F
 
 S T 1700
@@ -391,5 +408,6 @@
 m 0.0
 h -1.0
-p 01
+p 011
+_sl F
 
 S T 1701
@@ -407,5 +425,6 @@
 m 0.0
 h -1.0
-p 41
+p 411
+_sl F
 
 S T 1702
@@ -423,5 +442,6 @@
 m 0.0
 h -1.0
-p 41
+p 411
+_sl F
 
 S P 1709
@@ -549,11 +569,34 @@
 Z
 
-ActiveTime:19857915:44:01
-DarkTime:-19847399:-39:-16
-32:20:162 706 445 Md
-32:20:290 706 445 Rd
-32:20:538 706 445 Ru
-32:20:594 706 445 Mu
-32:37:858 766 295 kCTRL
-32:38:635 766 295 kCTRL
-32:38:858 766 295 kS
+ActiveTime:19857915:44:18
+DarkTime:-19847087:-39:-16
+23:29:005 178 694 kSHIFT
+23:29:109 178 694 kE
+23:29:362 189 694 kN
+23:29:441 198 694 kT
+23:29:506 203 694 kE
+23:29:580 211 694 kR
+23:29:763 217 694 kSHIFT
+23:29:906 217 694 kC
+23:30:140 228 694 kL
+23:30:299 234 694 kI
+23:30:403 239 694 kC
+23:30:516 247 694 kK
+23:30:603 256 694 kSHIFT
+23:31:476 265 694 kT
+23:31:652 270 694 kR
+23:31:732 276 694 kU
+23:31:811 285 694 kE
+23:32:950 293 694 Md
+23:33:066 293 694 Mu
+23:33:738 432 403 Md
+23:33:850 432 403 Mu
+23:36:710 481 410 Ld
+23:36:773 481 410 Rd
+23:36:931 481 410 Lu
+23:36:931 481 410 Ru
+23:37:750 338 458 Md
+23:37:836 338 458 Rd
+23:38:002 338 458 Ru
+23:38:042 338 458 Mu
+23:39:396 175 714 kRIGHT_ARROW
Index: trunk/src/org/expeditee/core/bounds/CombinationBounds.java
===================================================================
--- trunk/src/org/expeditee/core/bounds/CombinationBounds.java	(revision 1414)
+++ trunk/src/org/expeditee/core/bounds/CombinationBounds.java	(revision 1415)
@@ -87,7 +87,7 @@
 
 	@Override
-	public int getMaxX() 
-	{
-		int maxX = Integer.MIN_VALUE;
+	public int getMaxX() {
+		// +1 makes it safe to do math.abs on
+		int maxX = Integer.MIN_VALUE + 1;
 		
 		for (Bounds b : _bounds) {
@@ -113,7 +113,7 @@
 
 	@Override
-	public int getMaxY()
-	{
-		int maxY = Integer.MIN_VALUE;
+	public int getMaxY() {
+		// +1 makes it safe to do math.abs on
+		int maxY = Integer.MIN_VALUE + 1;
 		
 		for (Bounds b : _bounds) {
Index: trunk/src/org/expeditee/core/bounds/EllipticalBounds.java
===================================================================
--- trunk/src/org/expeditee/core/bounds/EllipticalBounds.java	(revision 1414)
+++ trunk/src/org/expeditee/core/bounds/EllipticalBounds.java	(revision 1415)
@@ -70,17 +70,14 @@
 	
 	@Override
-	public boolean contains(int x, int y)
-	{
+	public boolean contains(int x, int y) {
 		// If the ellipse is degenerate then it can't contain anything
 		if (_diameters.getArea() == 0) return false;
-		
-		// Get the position of the given coordinates with respect to the ellipse centre 
-		Point pRel = new Point(x - _centre.getX(), y - _centre.getY());
-		
-		// x^2 / r_x^2 + y^2 / r_y^2 must be <= 1
-		// (using diameters instead of radii hence the 4.0f value)
-		float xNorm = (((float) pRel.getX()) * pRel.getX()) / (((float) _diameters.width) * _diameters.width);
-		float yNorm = (((float) pRel.getY()) * pRel.getY()) / (((float) _diameters.height) * _diameters.height);
-		return (xNorm + yNorm <= 4.0f);
+
+		double deltaXSq = Math.pow(x - _centre.getX(), 2);
+		double deltaYSq = Math.pow(y - _centre.getY(), 2);
+		double minorAxisSq = Math.pow(Math.min(_diameters.height, _diameters.width) / 2, 2);
+		double majorAxisSq = Math.pow(Math.max(_diameters.height, _diameters.width) / 2, 2);
+		double result = (deltaXSq / majorAxisSq) + (deltaYSq / minorAxisSq);
+		return result <= 1.0f;
 	}
 	
@@ -118,6 +115,5 @@
 	
 	@Override
-	public boolean equals(Bounds other)
-	{
+	public boolean equals(Bounds other) {
 		if (other instanceof EllipticalBounds) {
 			EllipticalBounds e = (EllipticalBounds) other;
@@ -128,6 +124,5 @@
 
 	@Override
-	public boolean intersects(AxisAlignedBoxBounds other)
-	{
+	public boolean intersects(AxisAlignedBoxBounds other) {
 		// Treat the box as a polygon
 		return intersects(other.getPolygon());
@@ -135,6 +130,5 @@
 
 	@Override
-	public boolean intersects(CombinationBounds other)
-	{
+	public boolean intersects(CombinationBounds other) {
 		// Defer to the CombinationBounds routine
 		return other.intersects(this);
@@ -142,6 +136,5 @@
 
 	@Override
-	public boolean intersects(EllipticalBounds other)
-	{
+	public boolean intersects(EllipticalBounds other) {
 		// TODO: Implement. cts16
 		System.err.println("Unimplemented method: EllipticalBounds.intersects(EllipticalBounds)");
Index: trunk/src/org/expeditee/core/bounds/PolygonBounds.java
===================================================================
--- trunk/src/org/expeditee/core/bounds/PolygonBounds.java	(revision 1414)
+++ trunk/src/org/expeditee/core/bounds/PolygonBounds.java	(revision 1415)
@@ -538,4 +538,13 @@
 		}
 	}
+	
+	public String toString() {
+		StringBuilder sb = new StringBuilder("PolygonBounds with: ");
+		sb.append("[MinX: " + getMinX() + "]");
+		sb.append("[MinY: " + getMinY() + "]");
+		sb.append("[MaxX: " + getMaxX() + "]");
+		sb.append("[MaxY: " + getMaxY() + "]");
+		return sb.toString();
+	}
 
 }
Index: trunk/src/org/expeditee/encryption/io/EncryptedExpReader.java
===================================================================
--- trunk/src/org/expeditee/encryption/io/EncryptedExpReader.java	(revision 1414)
+++ trunk/src/org/expeditee/encryption/io/EncryptedExpReader.java	(revision 1415)
@@ -24,4 +24,5 @@
 import javax.crypto.spec.SecretKeySpec;
 
+import org.expeditee.core.Point;
 import org.expeditee.encryption.CryptographyConstants;
 import org.expeditee.encryption.items.surrogates.EncryptionDetail;
@@ -33,4 +34,5 @@
 import org.expeditee.io.DefaultFrameWriter;
 import org.expeditee.io.ExpReader;
+import org.expeditee.items.Constraint;
 import org.expeditee.items.Item;
 import org.expeditee.items.Text;
@@ -44,9 +46,12 @@
 	private SecretKey personalKey;
 	private boolean accessDenied = false;
+	private boolean _readingSurrogates;
+	private static final Predicate<String> endOfSection = s -> s.equals(EncryptedExpWriter.TERMINATOR + "") || s.equals(EncryptedExpWriter.TERMINATOR_WITH_CONTINUATION);
 
 	public static boolean isEncryptedExpediteeFile(final String path) throws IOException {
-		final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(path), "UTF-8"));
-		final String firstLine = in.readLine();
+		BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(path), "UTF-8"));
+		String firstLine = in.readLine();
 		in.close();
+		if (firstLine == null) return false;
 		return firstLine.startsWith(ENCRYPTED_EXP_FLAG);
 	}
@@ -87,4 +92,5 @@
 		if (accessDenied) { return null; }
 		
+		_readingSurrogates = false;
 		_reader = reader;
 		String next = "";
@@ -106,4 +112,11 @@
 			next = readTheConstraints();
 			
+			if (next.equals(EncryptedExpWriter.TERMINATOR_WITH_CONTINUATION)) {
+				// Read the surrogates
+				_readingSurrogates = true;
+				next = readTheItems(newFrame, delayedActions);
+				_readingSurrogates = false;
+			}
+			
 			for(DelayedAction action: delayedActions) {
 				action.exec();
@@ -124,54 +137,37 @@
 	}
 	
-//	@Override
-//	protected String readTheItems(Frame newFrame, List<DelayedAction> delayedActions) throws IOException {
-//		String next = null;
-//		Item currentItem = null;
-//		
-//		Predicate<String> endOfSection = s -> s.equals(EncryptedExpWriter.TERMINATOR + "") || s.equals(EncryptedExpWriter.TERMINATOR_WITH_CONTINUATION);
-//		while (_reader.ready() && !endOfSection.test(next = _reader.readLine())) {
-//			if (!isValidLine(next)) {
-//				continue;
-//			}
-//			
-//			String tag = getTagEnc(next);
-//			if (next.startsWith(DefaultFrameWriter.TYPE_AND_ID_STR + " ")) {
-//				currentItem = newItem(next);
-//				_linePoints.put(currentItem.getID(), currentItem);
-//				newFrame.addItem(currentItem);
-//				currentItem.setEncryptionDetailForTag(tag + "", EncryptionDetail.UnencryptedOnSave);
-//			} else if (next.startsWith("SurrogateFor")) {
-//				int parentID = Integer.parseInt(next.split(" ")[1]);
-//				newFrame.getItemWithID(parentID).addToSurrogates(currentItem);
-//				newFrame.addToSurrogates(currentItem);
-//			} else if (currentItem != null && actionShouldBeDelayed(tag.charAt(0))) { 
-//				delayedActions.add(new DelayedAction(currentItem, next));
-//			} else if (currentItem != null) {
-//				processBodyLine(currentItem, next);
-//			} else {
-//				System.err.println("Error while reading in frame (ExpReader): Found body line but no current item to apply it to.");
-//			}
-//		}
-//				
-//		if (next.equals(EncryptedExpWriter.TERMINATOR_WITH_CONTINUATION)) {
-//			next = readTheItems(newFrame, delayedActions);
-//		}
-//		
-//		return next;
-//	}
-	
 	protected String readTheItems(Frame newFrame, List<DelayedAction> delayedActions) throws IOException {
-		// Read the primary item.
-		BiConsumer<Item, String> addToBody = (item, line) -> newFrame.addItem(item);
-		String next = readLineAfterLine(false, addToBody, delayedActions);
-		
-		// Read the surrogate items.
-		if (next.equals(EncryptedExpWriter.TERMINATOR_WITH_CONTINUATION)) {
-			BiConsumer<Item, String> addToSurrogates = (item, line) -> {
-				int parentID = Integer.parseInt(line.split(" ")[1]);
-				newFrame.getItemWithID(parentID).addToSurrogates(item);
-				newFrame.addToSurrogates(item);
-			};
-			next = readLineAfterLine(true, addToSurrogates, delayedActions);
+		BiConsumer<Item, String> primaryAdd = (item, line) -> newFrame.addItem(item);
+		BiConsumer<Item, String> surrogateAdd = (item, line) -> {
+			int parentID = Integer.parseInt(line.split(" ")[1]);
+			Item parent = newFrame.getItemWithID(parentID);
+			newFrame.addToSurrogatesOnLoad(item, parent);
+		};
+		
+		if (_readingSurrogates) {
+			return readLineAfterLine(true, surrogateAdd, delayedActions);
+		} else {
+			return readLineAfterLine(false, primaryAdd, delayedActions);
+		}
+	}
+	
+	@Override
+	protected String readTheConstraints() throws IOException, Exception {
+		String next = null;
+		while (_reader.ready() && !endOfSection.test(next = _reader.readLine())) {
+			if (isValidLine(next)) {
+				Point idtype = separateValues(next.substring(2));
+				// The next line must be the endpoints
+				if (!_reader.ready()) {
+					throw new Exception("Unexpected end of file");
+				}
+				next = _reader.readLine();
+				Point startend = separateValues(next.substring(2));
+
+				Item a = _linePoints.get(startend.getX());
+				Item b = _linePoints.get(startend.getY());
+
+				new Constraint(a, b, idtype.getX(), idtype.getY());
+			}
 		}
 		return next;
@@ -182,5 +178,4 @@
 		Item currentItem = null;
 		
-		Predicate<String> endOfSection = s -> s.equals(EncryptedExpWriter.TERMINATOR + "") || s.equals(EncryptedExpWriter.TERMINATOR_WITH_CONTINUATION);
 		while (_reader.ready() && !endOfSection.test(next = _reader.readLine())) {
 			if (!isValidLine(next)) {
@@ -195,5 +190,6 @@
 					storeResult.accept(currentItem, next);
 				}
-				currentItem.setEncryptionDetailForTag(tag + "", EncryptionDetail.UnencryptedOnSave);
+				EncryptionDetail unencryptedOnSave = new EncryptionDetail(EncryptionDetail.Type.UnencryptedOnSave);
+				currentItem.setEncryptionDetailForTag(tag + "", unencryptedOnSave);
 			} else if (next.startsWith("SurrogateFor")) {
 				if (isSurrogate) {
@@ -212,32 +208,4 @@
 	}
  	
-//	private String readLineAfterLine(Consumer<Item> storeResult, List<DelayedAction> delayedActions) throws IOException {
-//		String next = null;
-//		Item currentItem = null;
-//		
-//		Predicate<String> endOfSection = s -> {
-//			return s.equals(EncryptedExpWriter.TERMINATOR + "") || s.equals(EncryptedExpWriter.TERMINATOR_WITH_CONTINUATION);
-//		};
-//		while (_reader.ready() && !endOfSection.test(next = _reader.readLine())) {
-//			if (!isValidLine(next)) {
-//				continue;
-//			}
-//			
-//			String tag = getTagEnc(next);
-//			if (next.startsWith(DefaultFrameWriter.TYPE_AND_ID_STR + " ")) {
-//				currentItem = newItem(next);
-//				_linePoints.put(currentItem.getID(), currentItem);
-//				currentItem.setEncryptionDetailForTag(tag + "", EncryptionDetail.UnencryptedOnSave);
-//				storeResult.accept(currentItem);
-//			} else if (next.startsWith("SurrogateFor")) {
-//				int parentID = Integer.parseInt(next.split(" ")[1]);
-//				newFrame.getItemWithID(parentID).addToSurrogates(currentItem);
-//				new Delayed
-//			}
-//		}
-//		
-//		return next;
-//	}
-	
 	@Override
 	protected void processBodyLine(Item item, String line) {
@@ -245,24 +213,32 @@
 		String tag = getTagEnc(line);
 		String value = getValue(line);
-		
-		if (item.isSurrogate() && item.isTagInherited(tag)) {
+		boolean isEncryptedLine = isEncryptedLine(line);
+		
+		if (item.isSurrogate() && isEncryptedLine) {
+			// Surrogates should never have encrypted body lines.
 			return;
 		}
 		
 		// Attempt to decrypt the line if necessary.
-		if (isEncryptedLine(line)) {
-			LabelResult res = Label.resolveKey(item.getEncryptionLabel());
+		if (isEncryptedLine) {
+			LabelResult res = Label.getLabel(item.getEncryptionLabel());
 			if (res == LabelResult.SuccessResolveLabelToKey) {
-				item.setEncryptionDetailForTag(tag, EncryptionDetail.ReencryptOnSave);
+				EncryptionDetail reencryptOnSave = new EncryptionDetail(EncryptionDetail.Type.ReencryptOnSave);
+				item.setEncryptionDetailForTag(tag, reencryptOnSave);
 				SecretKey key = new SecretKeySpec(res.key, SymmetricAlgorithm);
 				byte[] decryptedBytes = DecryptSymmetric(Base64.getDecoder().decode(value), key);
 				value = new String(decryptedBytes);				
 			} else {
-				EncryptionDetail encryptionDetail = EncryptionDetail.UseUndecipheredValueOnSave.setUndecipheredValue(getValue(line));
-				item.setEncryptionDetailForTag(tag, encryptionDetail);
+				EncryptionDetail undecipheredValueOnSave = new EncryptionDetail(EncryptionDetail.Type.UseUndecipheredValueOnSave);
+				undecipheredValueOnSave.setUndecipheredValue(getValue(line));
+				item.setEncryptionDetailForTag(tag, undecipheredValueOnSave);
 				return;
 			}
 		} else {
-			item.setEncryptionDetailForTag(tag, EncryptionDetail.UnencryptedOnSave);
+			EncryptionDetail unencryptedOnSave = new EncryptionDetail(EncryptionDetail.Type.UnencryptedOnSave);
+			item.setEncryptionDetailForTag(tag, unencryptedOnSave);
+			if (item.isSurrogate()) {
+				item.setTagNotInherited(tag);
+			}
 		}
 		
@@ -394,5 +370,5 @@
 		
 		private SecretKeySpec resolveLabel(String label) {
-			LabelResult res = Label.resolveKey(label);
+			LabelResult res = Label.getLabel(label);
 			if (res == LabelResult.SuccessResolveLabelToKey) {
 				byte[] keyBytes = res.key;
Index: trunk/src/org/expeditee/encryption/io/EncryptedExpWriter.java
===================================================================
--- trunk/src/org/expeditee/encryption/io/EncryptedExpWriter.java	(revision 1414)
+++ trunk/src/org/expeditee/encryption/io/EncryptedExpWriter.java	(revision 1415)
@@ -23,7 +23,9 @@
 import org.expeditee.encryption.CryptographyConstants;
 import org.expeditee.encryption.items.surrogates.EncryptionDetail;
+import org.expeditee.encryption.items.surrogates.EncryptionDetail.Type;
 import org.expeditee.encryption.items.surrogates.Label;
 import org.expeditee.encryption.items.surrogates.Label.LabelResult;
 import org.expeditee.gui.Frame;
+import org.expeditee.gui.Frame.BodyType;
 import org.expeditee.gui.MessageBay;
 import org.expeditee.io.Conversion;
@@ -62,5 +64,5 @@
 			}
 		} else {
-			LabelResult res = Label.resolveKey(label);
+			LabelResult res = Label.getLabel(label);
 			if (res == LabelResult.SuccessResolveLabelToKey) {
 				byte[] keyBytes = res.key;
@@ -94,13 +96,20 @@
 		
 		// write item
-		writeItemData(frame);
+		writeItemData(frame, true);
 		writeTerminator();
-		
 		// write lines and constraints
 		writeLineData();
 		writeTerminator();
 		writeConstraintData();
-		writeTerminator();
-		
+		
+		// write surrogate items
+		if (frame.hasSurrogates()) {
+			writeSurrogateTerminator();
+			writeItemData(frame, false);
+			writeTerminator();
+		} else {
+			writeTerminator();
+		}
+				
 		writeLine(SessionStats.getFrameEventList(frame));
 	}
@@ -126,4 +135,10 @@
 	
 	protected void writeClass(Item toWrite) throws IOException {
+		if (toWrite instanceof Text && toWrite.getText().equals("Content for Label Two")) {
+			System.err.println("EncryptedExpWriter::writeClass::breakpoint");
+		} else if (toWrite instanceof Text && toWrite.getText().equals("Encrypted") && toWrite.getPrimary().getText().equals("Content for Label One")) {
+			System.err.println("EncryptedExpWriter::writeClass::breakpoint");
+		}
+		
 		LinkedHashMap<Character,Method> itemTags = new LinkedHashMap<Character, Method>(getItemTags());
 		LinkedHashMap<String,Method> itemTagsExt = new LinkedHashMap<String, Method>(getItemTagsExt());
@@ -149,6 +164,7 @@
 		}
 		EncryptionDetail encryptionDetail = toWrite.getEncryptionDetailForTag(tag + "");
-				
-		switch(encryptionDetail) {
+		Type encryptionDetailType = encryptionDetail.getEncryptionDetailType();
+				
+		switch(encryptionDetailType) {
 		case UnencryptedOnSave:
 			writeTagUnencryptedOnSave(toWrite, param, tags, tag);
@@ -166,7 +182,8 @@
 	}
 	
-	private void writeItemData(Frame frame) throws IOException {
+	private void writeItemData(Frame frame, boolean primaryItems) throws IOException {
 		// write each item in the frame
-		for (Item i : frame.getItemsToSave()) {
+		BodyType bodyType = primaryItems ? BodyType.PrimaryBody : BodyType.SurrogateBody;
+		for (Item i : frame.getItemsToSave(bodyType)) {
 			assert (!(i instanceof Line));
 			writeItem(i);
@@ -176,14 +193,4 @@
 			assert (!(i instanceof Line));
 			writeItem(i);
-		}
-		
-		// write out the surrogates
-		List<Item> surrogates = frame.getSurrogateItemsToSave();
-		if (!surrogates.isEmpty()) {
-			writeSurrogateTerminator();
-			for (Item i: surrogates) {
-				assert (!(i instanceof Line));
-				writeItem(i);
-			}
 		}
 	}
@@ -194,11 +201,14 @@
 		BinaryOperator<Boolean> trueExists = (a, b) -> a || b;
 		boolean surrogatesInherit = surrogateItems.stream().map(isTagInherited).collect(Collectors.reducing(trueExists)).get();
-		if (surrogatesInherit && 
-				Label.resolveKey(toWrite.getEncryptionLabel()) == LabelResult.SuccessResolveLabelToKey) {
-			toWrite.setEncryptionDetailForTag(tag + "", EncryptionDetail.UnencryptedOnSave);
+		boolean userHasKey = Label.getLabel(toWrite.getEncryptionLabel()) == LabelResult.SuccessResolveLabelToKey;
+		
+		if (!surrogatesInherit && userHasKey) {
+			EncryptionDetail reencryptOnSave = new EncryptionDetail(EncryptionDetail.Type.ReencryptOnSave);
+			toWrite.setEncryptionDetailForTag(tag + "", reencryptOnSave);
+			writeTagReencryptOnSave(toWrite, tags, tag);
+		} else {
+			EncryptionDetail unencryptedOnSave = new EncryptionDetail(EncryptionDetail.Type.UnencryptedOnSave);
+			toWrite.setEncryptionDetailForTag(tag + "", unencryptedOnSave);
 			writeTagUnencryptedOnSave(toWrite, new Object[] {}, tags, tag);
-		} else {
-			toWrite.setEncryptionDetailForTag(tag + "", EncryptionDetail.ReencryptOnSave);
-			writeTagReencryptOnSave(toWrite, tags, tag);
 		}
 	}
@@ -207,5 +217,5 @@
 		Method toRun = tags.get(tag);
 		Class<?> declarer = toRun.getDeclaringClass();
-		LabelResult res = Label.resolveKey(toWrite.getEncryptionLabel());
+		LabelResult res = Label.getLabel(toWrite.getEncryptionLabel());
 		if (declarer.isAssignableFrom(toWrite.getClass()) && res == LabelResult.SuccessResolveLabelToKey) {
 			try {
Index: trunk/src/org/expeditee/encryption/items/surrogates/EncryptionDetail.java
===================================================================
--- trunk/src/org/expeditee/encryption/items/surrogates/EncryptionDetail.java	(revision 1414)
+++ trunk/src/org/expeditee/encryption/items/surrogates/EncryptionDetail.java	(revision 1415)
@@ -1,21 +1,11 @@
 package org.expeditee.encryption.items.surrogates;
 
-public enum EncryptionDetail {
-	// If the property needs to be unencrypted due to inheritance then do not try to encrypt it.
-	UnencryptedOnSave,
-	
-	// If the property is not inherited by any surrogates then we can try to encrypt it.  
-	// If we do not have key then default to UnencryptedOnSave.
-	ReencryptOnSave,
-	
-	// If the property is no longer inherited by at least one surrogate then this value is present.  
-	// If it turns out there is no longer any surrogates who inherit the value then this value can be replaced with ReencryptOnSave.
-	// Otherwise, this value must be replaced with UnencryptedOnSave.
-	InheritanceCheckOnSave,
-	
-	// If we could not decrypt the value on load then EncryptionDetail.getUndecipheredValue() can be used to get the value for saving.
-	UseUndecipheredValueOnSave;
-	
-	private String undecipheredValue = null;
+public class EncryptionDetail {
+	private Type type;
+	private String undecipheredValue;
+
+	public EncryptionDetail(Type type) {
+		this.type = type;		
+	}
 	
 	public EncryptionDetail setUndecipheredValue(String undecipheredValue) {
@@ -25,5 +15,33 @@
 	
 	public String getUndecipheredValue() {
-		return this.undecipheredValue;
+		return undecipheredValue;
+	}
+	
+	public Type getEncryptionDetailType() {
+		return type;
+	}
+	
+	@Override
+	public EncryptionDetail clone() {
+		EncryptionDetail copy = new EncryptionDetail(this.type);
+		copy.setUndecipheredValue(this.undecipheredValue);
+		return copy;
+	}
+	
+	public enum Type {
+		// If the property needs to be unencrypted due to inheritance then do not try to encrypt it.
+		UnencryptedOnSave,
+		
+		// If the property is not inherited by any surrogates then we can try to encrypt it.  
+		// If we do not have key then default to UnencryptedOnSave.
+		ReencryptOnSave,
+		
+		// If the property is no longer inherited by at least one surrogate then this value is present.  
+		// If it turns out there is no longer any surrogates who inherit the value then this value can be replaced with ReencryptOnSave.
+		// Otherwise, this value must be replaced with UnencryptedOnSave.
+		InheritanceCheckOnSave,
+		
+		// If we could not decrypt the value on load then EncryptionDetail.getUndecipheredValue() can be used to get the value for saving.
+		UseUndecipheredValueOnSave;
 	}
 }
Index: trunk/src/org/expeditee/encryption/items/surrogates/Label.java
===================================================================
--- trunk/src/org/expeditee/encryption/items/surrogates/Label.java	(revision 1414)
+++ trunk/src/org/expeditee/encryption/items/surrogates/Label.java	(revision 1415)
@@ -2,107 +2,185 @@
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Base64;
-import java.util.Collection;
 import java.util.List;
-import java.util.Set;
+import java.util.function.Predicate;
 import java.util.stream.Collectors;
-
-import org.expeditee.auth.AuthenticatorBrowser;
-import org.expeditee.gui.DisplayController;
-import org.expeditee.gui.Frame;
-import org.expeditee.gui.FrameIO;
-import org.expeditee.gui.MessageBay;
+import java.util.stream.Stream;
+
+import org.expeditee.gui.ItemsList;
 import org.expeditee.items.Item;
 import org.expeditee.items.Text;
-import org.expeditee.settings.UserSettings;
+import org.expeditee.settings.identity.secrets.KeyList;
 
 public class Label {
 	
-	private static List<LabelResult> labelCache = new ArrayList<LabelResult>();
-	private static List<String> forbiddenLabels = new ArrayList<String>();
-	
-	public static LabelResult resolveKey(String label) {
-		
-		if (forbiddenLabels.contains(label)) {
+	private static int surrogateStep = -1;
+
+	public static LabelResult getLabel(String label) {
+		Text[] userLabels = KeyList.UserLabels.get();
+		Text labelText = null;
+		for (Text userLabel : userLabels) {
+			if (userLabel.getText().equals(label)) {
+				labelText = userLabel;
+				break;
+			}
+		}
+
+		if (labelText == null) {
+			return unableToFindLabelResult(label);
+		} else {
+			List<String> data = labelText.getData();
+			if (data == null || data.isEmpty()) { 
+				return unableToFindLabelResult(label);
+			}
+			String dataEntry = data.get(0);
+			
+			if (dataEntry.contains("{")) {
+				return partialKeyResult(label, dataEntry);
+			} else {
+				return fullKeyResult(label, dataEntry);
+			}
+		}
+	}
+	
+	public static void progressSurrogateMode() {
+		surrogateStep += 1;
+	}
+
+	public static void resetSurrogateMode() {
+		surrogateStep = -1;
+	}
+
+	public static List<String> getAccessibleLabelsNames(ItemsList itemsList) {
+		Text[] userLabels = KeyList.UserLabels.get();
+		Stream<String> accessibleUserWideLabels = Arrays.asList(userLabels).stream().map(label -> label.getText());
+		
+		Predicate<Item> isLabelWithoutEncryptionLabel = item -> item.getEncryptionLabel() == null || item.getEncryptionLabel().isEmpty();
+		itemsList.removeIf(isLabelWithoutEncryptionLabel);
+		Stream<String> accessibleFrameLocalLabels = itemsList.underlying().stream().map(item -> item.getEncryptionLabel()).distinct();
+		
+		List<String> accessibleLabelsUnion = accessibleUserWideLabels.collect(Collectors.toList());
+		accessibleLabelsUnion.retainAll(accessibleFrameLocalLabels.collect(Collectors.toList()));
+		
+		if (surrogateStep > -1 && surrogateStep < accessibleLabelsUnion.size()) {
+			String surrogateModeFilter = accessibleLabelsUnion.get(surrogateStep);
+			List<String> single = new ArrayList<String>();
+			single.add(surrogateModeFilter);
+			return single;
+		} else {
+			resetSurrogateMode();
+		}
+		
+		return accessibleLabelsUnion;
+	}
+
+	private static LabelResult partialKeyResult(String label, String dataEntry) {
+		dataEntry = dataEntry.substring(dataEntry.indexOf('}') + 1).trim();
+		LabelResult res = LabelResult.SuccessResolveLabelToPartialKey;
+		res.name = label;
+		return res;
+	}
+
+	private static LabelResult unableToFindLabelResult(String label) {
+		LabelResult res = LabelResult.ErrorUnableToFindLabel;
+		res.name = label;
+		return res;
+	}
+	
+	private static LabelResult fullKeyResult(String label, String dataEntry) {
+		try {
+			LabelResult res = LabelResult.SuccessResolveLabelToKey;
+			res.key = Base64.getDecoder().decode(dataEntry);
+			res.name = label;
+			return res;
+		} catch (IllegalArgumentException e) {
 			return LabelResult.ErrorUnableToFindLabel;
 		}
-		
-		LabelResult fromCache = getFromCache(label);
-		if (fromCache != null) {
-			return fromCache;
-		}
-
-		
-		String credentialsFrameName = UserSettings.ProfileName.get() + 
-				AuthenticatorBrowser.CREDENTIALS_FRAME;
-		Frame credentialsFrame = FrameIO.LoadFrame(credentialsFrameName);
-		Collection<Text> textItems = credentialsFrame.getTextItems();
-		textItems.removeIf(t -> !t.getText().equals("Secrets"));
-		textItems.removeIf(t -> !t.hasLink());
-		if (textItems.isEmpty()) {
-			return LabelResult.ErrorUnableToFindSecretsFrame;
-		}
-		Text linkToSecretsFrame = textItems.iterator().next();
-		if (!linkToSecretsFrame.hasLink()) {
-			return LabelResult.ErrorUnableToFindSecretsFrame;
-		}
-		Frame secretsFrame = FrameIO.LoadFrame(linkToSecretsFrame.getParent().getFramesetName() + linkToSecretsFrame.getLink());
-		Collection<Text> labels = secretsFrame.getTextItems();
-		labels.removeIf(lbl -> !lbl.getText().equals(label));
-		labels.removeIf(lbl -> lbl.getData() == null || lbl.getData().size() == 0);
-		if (labels.isEmpty()) {
-			return LabelResult.ErrorUnableToFindLabel;
-		}
-		Text labelItem = labels.iterator().next();
-		String data = labelItem.getData().get(0);
-		if (data.contains("{")) {
-			data = data.substring(data.indexOf('}') + 1).trim();
-			LabelResult res = LabelResult.SuccessResolveLabelToPartialKey;
-			res.key = Base64.getDecoder().decode(data);
-			return res;
-		} else {
-			try {
-				LabelResult res = LabelResult.SuccessResolveLabelToKey;
-				res.key = Base64.getDecoder().decode(data);
-				res.name = label;
-				labelCache.add(res);
-				return res;
-			} catch (IllegalArgumentException e) {
-				return LabelResult.ErrorUnableToFindLabel;
-			}
-		}
-	}
-	
-	public static void progressSurrogateMode() {
-		Collection<Item> allItems = DisplayController.getCurrentFrame().getAllItems();
-		allItems.removeIf(item -> item.getEncryptionLabel() == null);
-		MessageBay.displayMessage("Encryption labels found on items on current frame: ");
-		Set<String> allLabels = allItems.stream().map(i -> i.getEncryptionLabel()).collect(Collectors.toSet());
-		StringBuilder sb = new StringBuilder();
-		for (String label: allLabels) {
-			sb.append(label + ",");
-		}
-		MessageBay.displayMessage(sb.deleteCharAt(sb.length() - 1).toString());
-	}
-	
-	public static void resetSurrogateMode() {
-		// TODO Auto-generated method stub
-		
-	}
-	
-	private static LabelResult getFromCache(String label) {
-		List<LabelResult> cacheCanditates = labelCache.stream().filter(labelResult -> labelResult.name.equals(label)).collect(Collectors.toList());
-		if (!cacheCanditates.isEmpty()) {
-			return cacheCanditates.get(0);
-		} else {
-			return null;
-		}
-	}
-	
-//	private static List<List<String>> permutation(List<String> strings, List<List<String>> acc) {
-//		for (int i = 0; i < strings.size(); i++) {
-//			
+	}
+
+	//private static Map<LabelResult, LabelAccess> labelCache = new LinkedHashMap<LabelResult, LabelAccess>();
+	//private static int surrogateStep = -1;
+	//private static final Predicate<? super LabelResult> isAccessible = a -> labelCache.get(a).allowed;
+	
+//	public static LabelResult resolveKey(String label) {
+//		Stream<LabelResult> stream = labelCache.keySet().stream();
+//		stream = stream.filter(res -> res.name.equals(label));
+//		if (stream.count() == 0) {
+//			return resolveKeyWorker(label);
+//		} else {
+//			LabelResult labelResult = stream.collect(Collectors.toList()).get(0);
+//			LabelAccess accessible = labelCache.get(labelResult);
+//			if (accessible.allowed) { return labelResult; }
+//			else { return LabelResult.ErrorForbiddenLabel; }
+//		}
+//	}	
+//	private static LabelResult resolveKeyWorker(String label) {
+//		Frame secretsFrame = getSecretsFrame();
+//		if (secretsFrame == null) { 
+//			return LabelResult.ErrorUnableToFindSecretsFrame;
+//		}
+//		
+//		String data = getDataFromLabel(secretsFrame, label);
+//		if (data == null) {
+//			return LabelResult.ErrorUnableToFindLabel;
+//		}
+//		
+//		if (data.contains("{")) {
+//			data = data.substring(data.indexOf('}') + 1).trim();
+//			LabelResult res = LabelResult.SuccessResolveLabelToPartialKey;
+//			res.key = Base64.getDecoder().decode(data);
+//			return res;
+//		} else {
+//			try {
+//				LabelResult res = LabelResult.SuccessResolveLabelToKey;
+//				res.key = Base64.getDecoder().decode(data);
+//				res.name = label;
+//				labelCache.put(res, new LabelAccess(true));
+//				return res;
+//			} catch (IllegalArgumentException e) {
+//				return LabelResult.ErrorUnableToFindLabel;
+//			}
 //		}
 //	}
+//	
+//	private static String getDataFromLabel(Frame frame, String label) {
+//		Collection<Text> labels = frame.getTextItems();
+//		labels.removeIf(lbl -> !lbl.getText().equals(label));
+//		labels.removeIf(lbl -> lbl.getData() == null || lbl.getData().size() == 0);
+//		if (labels.isEmpty()) { return null; }
+//		Text labelItem = labels.iterator().next();
+//		List<String> data = labelItem.getData();
+//		if (data.isEmpty()) { return null; }
+//		return data.get(0);
+//	}
+//	
+//	private static Frame getSecretsFrame() {
+//		String credentialsFrameName = UserSettings.ProfileName.get() + 
+//				AuthenticatorBrowser.CREDENTIALS_FRAME;
+//		Frame credentialsFrame = FrameIO.LoadFrame(credentialsFrameName);
+//		Collection<Text> textItems = credentialsFrame.getTextItems();
+//		textItems.removeIf(t -> !t.getText().equals("Secrets"));
+//		textItems.removeIf(t -> !t.hasLink());
+//		if (textItems.isEmpty()) {
+//			return null;
+//		}
+//		Text linkToSecretsFrame = textItems.iterator().next();
+//		if (!linkToSecretsFrame.hasLink()) {
+//			return null;
+//		}
+//		Frame secretsFrame = FrameIO.LoadFrame(linkToSecretsFrame.getParent().getFramesetName() + linkToSecretsFrame.getLink());
+//		return secretsFrame;
+//	}
+//	
+//	private static class LabelAccess {
+//		public final boolean allowedDefault;
+//		public boolean allowed;
+//		
+//		public LabelAccess(boolean value) { 
+//			allowedDefault = value;
+//			allowed = allowedDefault;
+//		}
+//	} 
 	
 	public enum LabelResult {
@@ -110,5 +188,6 @@
 		SuccessResolveLabelToPartialKey, 
 		ErrorUnableToFindSecretsFrame, 
-		ErrorUnableToFindLabel;
+		ErrorUnableToFindLabel, 
+		ErrorForbiddenLabel;
 		
 		public byte[] key;
@@ -125,5 +204,7 @@
 				return "Unable to find your Secrets Frame.";
 			case ErrorUnableToFindLabel:
-				return "Unable to resolve label to encrypt/decrypt frame.  Label: ";
+				return "Unable to resolve label to encrypt/decrypt frame.  Label: " + name;
+			case ErrorForbiddenLabel:
+				return "Whilst you have the key for label " + name + " ; you are not allowed to use it.";
 			}
 			
Index: trunk/src/org/expeditee/gio/InputManager.java
===================================================================
--- trunk/src/org/expeditee/gio/InputManager.java	(revision 1414)
+++ trunk/src/org/expeditee/gio/InputManager.java	(revision 1415)
@@ -306,4 +306,11 @@
 	protected final void distributeInputEvent(InputEvent event)
 	{
+//		if (event instanceof KBMInputEvent) {
+//			KBMInputEvent kEvent = (KBMInputEvent) event;
+//			if (kEvent.getKeyDown() != null) {
+//				System.err.println("distributeInputEvent:::" + kEvent.toString());
+//			}
+//		}
+		
 		// Allow listeners to optionally consume input before gesture translation
 		for (InputEventListener listener : _inputEventListeners) {
Index: trunk/src/org/expeditee/gio/TextLayoutManager.java
===================================================================
--- trunk/src/org/expeditee/gio/TextLayoutManager.java	(revision 1414)
+++ trunk/src/org/expeditee/gio/TextLayoutManager.java	(revision 1415)
@@ -68,5 +68,5 @@
 	public float getLineWidth(Point p, Line[] lines)
 	{
-		float width = Float.MAX_VALUE;
+		float width = (float) Integer.MAX_VALUE;
 		for(Line l : lines) {
 			// check for lines that cross over our y
Index: trunk/src/org/expeditee/gio/gesture/ExpediteeKBMGestureTranslator.java
===================================================================
--- trunk/src/org/expeditee/gio/gesture/ExpediteeKBMGestureTranslator.java	(revision 1414)
+++ trunk/src/org/expeditee/gio/gesture/ExpediteeKBMGestureTranslator.java	(revision 1415)
@@ -7,4 +7,5 @@
 import org.expeditee.gio.EcosystemManager;
 import org.expeditee.gio.TimeoutQueue.TimeoutHandle;
+import org.expeditee.gio.gesture.Gesture.GestureType;
 import org.expeditee.gio.gesture.StandardGestureActions.StandardGestureType;
 import org.expeditee.gio.gesture.data.ChangeColourGestureData;
@@ -100,4 +101,5 @@
 					return null;
 				}
+				
 				//System.err.println("ExpediteeKBMGestureTranslator::" + details() + ": " + kbmEvent.getCharTyped());
 				// Generate a INSERT_STRING gesture
@@ -130,7 +132,7 @@
 		addTranslator(new InputEventToGestureTranslator(InputType.KBM)
 		{
-			private static final int NO_CONSTRAINT = 0;
+			//private static final int NO_CONSTRAINT = 0;
 			private SelectAreaGestureData _draggedFromData = null;
-			private int _constrainedDirection = NO_CONSTRAINT;
+			//private int _constrainedDirection = NO_CONSTRAINT;
 			
 			@Override
@@ -210,5 +212,5 @@
 					newMousePos.add(1, 1);
 				} else*/ {
-					_constrainedDirection = NO_CONSTRAINT;
+					//_constrainedDirection = NO_CONSTRAINT;
 					newMousePos = kbmEvent.getMouseMove().getSecondEnd().clone();
 				}
@@ -682,26 +684,40 @@
 		
 		// Add the F10 -> TOGGLE_XRAY_MODE gesture recogniser
-		addTranslator(new InputEventToGestureTranslator(InputType.KBM)
-		{
+		addTranslator(new InputEventToGestureTranslator(InputType.KBM) {
+			
 			@Override
 			public String details() { return "F10 -> TOGGLE_XRAY_MODE"; }
-
-			@Override
-			public List<Gesture> onInputEvent(InputEvent event) {
-				// Cast to keyboard/mouse event
-				KBMInputEvent kbmEvent = (KBMInputEvent) event;
-
+			
+			@Override
+			public List<Gesture> onInputEvent(InputEvent event) {
+				// Cast to keyboard/mouse event
+				KBMInputEvent kbmEvent = (KBMInputEvent) event;
+				
 				// Must be pressing F10 to xray mode
-				if (kbmEvent.getKeyDown() != KBMInputEvent.Key.F10) {
-					return null;
-				}
-				
-				// Return the gesture
-				if (kbmTranslator.isKeyDown(Key.SHIFT)) {
-					UndoGestureData data = new UndoGestureData(kbmTranslator.isKeyDown(Key.CTRL));
-					return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.TOGGLE_SURROGATE_MODE), data);
-				} else {
-					return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.TOGGLE_XRAY_MODE), null);
-				}
+				if (kbmEvent.getKeyDown() != KBMInputEvent.Key.F10 || kbmTranslator.isKeyDown(Key.SHIFT)) {
+					return null;
+				}
+				
+				return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.TOGGLE_XRAY_MODE), null);
+			}
+		});
+		
+		// Add the F10 -> CYCLE_SURROGATE_MODE gesture recogniser
+		addTranslator(new InputEventToGestureTranslator(InputType.KBM) { 
+			@Override
+			public String details() { return "F10 -> CYCLE_SURROGATE_MODE"; }
+			
+			@Override
+			public List<Gesture> onInputEvent(InputEvent event) {
+				// Case to keyboard/mouse event
+				KBMInputEvent kbmEvent = (KBMInputEvent) event;
+				
+				// Must be pressing F10 to surrogate mode
+				if (kbmEvent.getKeyDown() != KBMInputEvent.Key.F10 || !kbmTranslator.isKeyDown(Key.SHIFT)) {
+					return null;
+				}
+				
+				UndoGestureData data = new UndoGestureData(kbmTranslator.isKeyDown(Key.CTRL));
+				return Gesture.single(StandardGestureActions.getInstance().gestureType(StandardGestureType.CYCLE_SURROGATE_MODE), data);
 			}
 		});
@@ -2190,4 +2206,25 @@
 					return Gesture.single(vFormat);
 				}
+			}
+		});
+		
+		// Add the ENTER_CHAR_TYPED -> ACTIVATE BUTTON -> FORMAT gesture recogniser
+		addTranslator(new InputEventToGestureTranslator(InputType.KBM)
+		{
+			@Override
+			public String details() { return "ENTER_CHAR_TYPED -> ACTIVATE BUTTON"; }
+
+			@Override
+			public List<Gesture> onInputEvent(InputEvent event) {
+				// Cast to keyboard/mouse event
+				KBMInputEvent kbmEvent = (KBMInputEvent) event;
+			
+				if (kbmEvent.getKeyDown() != Key.ENTER) {
+					return null;
+				}
+				
+				GestureType gestureType = StandardGestureActions.getInstance().gestureType(StandardGestureType.ACTIVATE_BUTTON);
+				ItemSpecificGestureData data = new ClickGestureData(false);
+				return Gesture.single(gestureType, data);
 			}
 		});
Index: trunk/src/org/expeditee/gio/gesture/StandardGestureActions.java
===================================================================
--- trunk/src/org/expeditee/gio/gesture/StandardGestureActions.java	(revision 1414)
+++ trunk/src/org/expeditee/gio/gesture/StandardGestureActions.java	(revision 1415)
@@ -54,4 +54,5 @@
 import org.expeditee.gui.FreeItems;
 import org.expeditee.gui.MessageBay;
+import org.expeditee.gui.ItemsList;
 import org.expeditee.gui.Vector;
 import org.expeditee.io.ExpClipReader;
@@ -123,7 +124,8 @@
 		TOGGLE_ITEMS_MARK, // Show/hide the little circle indicating the item has a link and/or action
 		TOGGLE_XRAY_MODE, // F10
-		TOGGLE_SURROGATE_MODE, // Shift + F10
+		CYCLE_SURROGATE_MODE, // Shift + F10
 		UNDO, 
-		ZOOM
+		ZOOM, 
+		ACTIVATE_BUTTON // Enter while over Item with _acceptsKeyboardEnter set to true
 	}
 	//@formatter:on
@@ -420,5 +422,18 @@
 			public void exec(Gesture gesture) {
 				InsertStringGestureData data = (InsertStringGestureData) gesture.getData();
-				for (char c : data.getString().toCharArray()) {
+				
+				Item currentItem = data.getCurrentItem();
+				char[] charArray = data.getString().toCharArray();
+				
+				if (currentItem != null) {
+					// If we are over a item taht accepts keyboard enter and the only 
+					// character being entered is the enter key then we do not insert it.
+					boolean keyboardEnter = data.getCurrentItem().acceptsKeyboardEnter();
+					if (keyboardEnter && charArray.length == 1 && charArray[0] == (char) 10) {
+						return;
+					}
+				}
+								
+				for (char c : charArray) {
 					processChar(c, data.isShiftDown());
 				}
@@ -967,5 +982,16 @@
 		});
 		
-		setGestureAction(gestureType(StandardGestureType.TOGGLE_SURROGATE_MODE), new GestureAction() {
+		// Set the ACTIVATE BUTTON action
+		setGestureAction(gestureType(StandardGestureType.ACTIVATE_BUTTON), new GestureAction() {
+			@Override
+			public void exec(Gesture gesture) {
+				ItemSpecificGestureData data = (ItemSpecificGestureData) gesture.getData();
+				if (data.getCurrentItem().acceptsKeyboardEnter()) {
+					getGestureAction(Gesture.GestureType.get("CLICK")).exec(gesture);
+				}
+			}			
+		});
+		
+		setGestureAction(gestureType(StandardGestureType.CYCLE_SURROGATE_MODE), new GestureAction() {
 			@Override
 			public void exec(Gesture gesture) {
@@ -1745,5 +1771,5 @@
 			if (_lastHoldsHighlight) {
 				_lastHoldsHighlight = false;
-				for (Item i : DisplayController.getCurrentFrame().getItems()) {
+				for (Item i : DisplayController.getCurrentFrame().getSortedItems()) {
 					if (i.isHighlighted() && i != on) {
 						FrameGraphics.changeHighlightMode(i, Item.HighlightMode.None);
@@ -1824,5 +1850,5 @@
 
 		if (checkEnclosure) {
-			ItemUtils.EnclosedCheck(toAnchor.getParentOrCurrentFrame().getItems());
+			ItemUtils.EnclosedCheck(toAnchor.getParentOrCurrentFrame().getSortedItems());
 			DisplayController.requestRefresh(true);
 		}
@@ -1936,6 +1962,5 @@
 				}
 			} else if (!toUndo.contains(i)) {
-				if (addToUndo)
-				 {
+				if (addToUndo) {
 					toUndo.add(i); // Why was is this a copy
 				}
@@ -1951,5 +1976,5 @@
 		// the current frame as well as the overlay frame
 		Frame currentFrame = DisplayController.getCurrentFrame();
-		currentFrame.addToUndoDelete(itemList);
+		currentFrame.addToUndoDelete(new ItemsList(itemList));
 		itemList.clear();
 		if (bReparse) {
@@ -3268,5 +3293,5 @@
 			SessionStats.DeletedItems(toUndo);
 			if (parent != null) {
-				parent.addToUndoDelete(toUndo);
+				parent.addToUndoDelete(new ItemsList(toUndo));
 				parent.removeAllItems(toUndo); // toDelete.getConnected()
 			}
@@ -3610,5 +3635,5 @@
 							DisplayController.setCursorPosition(toDisconnect.getPosition(), false);
 							pickup(newPoint);
-							ItemUtils.EnclosedCheck(toDisconnect.getParentOrCurrentFrame().getItems());
+							ItemUtils.EnclosedCheck(toDisconnect.getParentOrCurrentFrame().getSortedItems());
 						}
 					}
@@ -3926,5 +3951,5 @@
 		mergee.getParent().setChanged(true);
 
-		ItemUtils.EnclosedCheck(mergee.getParent().getItems());
+		ItemUtils.EnclosedCheck(mergee.getParent().getSortedItems());
 		// Mike: Why does parse frame have to be called?!?
 		FrameUtils.Parse(mergee.getParent());
@@ -4386,5 +4411,5 @@
 			int mouseY = position.getY();
 			// System.out.println(mouseX + "," + mouseY);
-			for (Item i : DisplayController.getCurrentFrame().getItems()) {
+			for (Item i : DisplayController.getCurrentFrame().getSortedItems()) {
 				// System.out.println(i.getName().toString());
 				if (i instanceof Text) {
Index: trunk/src/org/expeditee/gio/input/InputEventToGestureTranslatorSet.java
===================================================================
--- trunk/src/org/expeditee/gio/input/InputEventToGestureTranslatorSet.java	(revision 1414)
+++ trunk/src/org/expeditee/gio/input/InputEventToGestureTranslatorSet.java	(revision 1415)
@@ -57,4 +57,11 @@
 		if (_recognisers.isEmpty())
 			return null;
+		
+//		if (event instanceof KBMInputEvent) {
+//			KBMInputEvent kEvent = (KBMInputEvent) event;
+//			if (kEvent.getKeyDown() != null) {
+//				System.err.println("onInputEvent:::" + kEvent.toString());
+//			}
+//		}
 
 		// Only interested in monitored events
Index: trunk/src/org/expeditee/gio/input/KBMInputEvent.java
===================================================================
--- trunk/src/org/expeditee/gio/input/KBMInputEvent.java	(revision 1414)
+++ trunk/src/org/expeditee/gio/input/KBMInputEvent.java	(revision 1415)
@@ -37,4 +37,5 @@
 		BACKSPACE,
 		TAB,
+		ENTER,
 		A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
 	}
Index: trunk/src/org/expeditee/gio/input/StandardInputEventListeners.java
===================================================================
--- trunk/src/org/expeditee/gio/input/StandardInputEventListeners.java	(revision 1414)
+++ trunk/src/org/expeditee/gio/input/StandardInputEventListeners.java	(revision 1415)
@@ -52,6 +52,5 @@
 		
 		@Override
-		public boolean onInputEvent(InputEvent event)
-		{
+		public boolean onInputEvent(InputEvent event) {
 			// Only interested in keyboard/mouse events
 			if (event.getInputType() != InputType.KBM) return false;
@@ -77,16 +76,13 @@
 		}
 		
-		public boolean isKeyDown(Key key)
-		{
+		public boolean isKeyDown(Key key) {
 			return (key != null) && (_keyState[key.ordinal()] == Boolean.TRUE);
 		}
 		
-		public boolean isMouseButtonDown(MouseButton button)
-		{
+		public boolean isMouseButtonDown(MouseButton button) {
 			return (button != null) && (_mouseState[button.ordinal()] == Boolean.TRUE);
 		}
 		
-		public boolean isOnlyMouseButtonDown(MouseButton button)
-		{
+		public boolean isOnlyMouseButtonDown(MouseButton button) {
 			if (button == null) return false;
 			
@@ -98,6 +94,5 @@
 		}
 		
-		public boolean isAnyMouseButtonDown()
-		{
+		public boolean isAnyMouseButtonDown() {
 			for (MouseButton button : MouseButton.values()) {
 				if (isMouseButtonDown(button)) return true;
Index: trunk/src/org/expeditee/gio/javafx/JavaFXConversions.java
===================================================================
--- trunk/src/org/expeditee/gio/javafx/JavaFXConversions.java	(revision 1414)
+++ trunk/src/org/expeditee/gio/javafx/JavaFXConversions.java	(revision 1415)
@@ -137,4 +137,5 @@
 		case Y: return org.expeditee.gio.input.KBMInputEvent.Key.Y;
 		case Z: return org.expeditee.gio.input.KBMInputEvent.Key.Z;
+		case ENTER: return org.expeditee.gio.input.KBMInputEvent.Key.ENTER;
 		default: return null;
 		}
Index: trunk/src/org/expeditee/gio/swing/SwingConversions.java
===================================================================
--- trunk/src/org/expeditee/gio/swing/SwingConversions.java	(revision 1414)
+++ trunk/src/org/expeditee/gio/swing/SwingConversions.java	(revision 1415)
@@ -350,4 +350,5 @@
 		case java.awt.event.KeyEvent.VK_Y: return org.expeditee.gio.input.KBMInputEvent.Key.Y;
 		case java.awt.event.KeyEvent.VK_Z: return org.expeditee.gio.input.KBMInputEvent.Key.Z;
+		case java.awt.event.KeyEvent.VK_ENTER: return org.expeditee.gio.input.KBMInputEvent.Key.ENTER;
 		default: return null;
 		}
Index: trunk/src/org/expeditee/gio/swing/SwingInputManager.java
===================================================================
--- trunk/src/org/expeditee/gio/swing/SwingInputManager.java	(revision 1414)
+++ trunk/src/org/expeditee/gio/swing/SwingInputManager.java	(revision 1415)
@@ -4,4 +4,6 @@
 import java.awt.Color;
 import java.awt.Dimension;
+import java.awt.KeyEventDispatcher;
+import java.awt.KeyboardFocusManager;
 import java.awt.MouseInfo;
 import java.awt.Robot;
@@ -33,4 +35,6 @@
 import org.expeditee.gio.input.InputEvent.InputType;
 import org.expeditee.gio.input.KBMInputEvent;
+import org.expeditee.gio.input.KBMInputEvent.Key;
+import org.expeditee.gio.input.StandardInputEventListeners;
 import org.expeditee.gui.Popup;
 import org.expeditee.gui.PopupManager;
@@ -38,5 +42,5 @@
 
 public class SwingInputManager extends InputManager implements ComponentListener, WindowListener, WindowStateListener,
-		KeyListener, MouseListener, MouseMotionListener, MouseWheelListener {
+		KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, KeyEventDispatcher {
 	/** Singleton instance. */
 	private static SwingInputManager _instance;
@@ -73,5 +77,5 @@
 		// Sign up to receive input as events
 		SwingGraphicsManager graphicsManager = SwingMiscManager.getIfUsingSwingGraphicsManager();
-		if (graphicsManager != null) {
+		if (graphicsManager != null) {			
 			graphicsManager.addWindowListener(swingInputManager);
 			graphicsManager.addWindowStateListener(swingInputManager);
@@ -91,6 +95,6 @@
 			graphicsManager.getGlassPane().setVisible(true);
 			graphicsManager.getContentPane().setBackground(Color.WHITE);
-			graphicsManager.getContentPane().setFocusTraversalKeysEnabled(false);
-		}
+		}
+		graphicsManager.getContentPane().setFocusTraversalKeysEnabled(false);
 
 		// Set up the robot (for controlling the mouse)
@@ -111,4 +115,16 @@
 		});
 		_timer.setRepeats(false);
+		
+//		AWTEventListener[] listeners = Toolkit.getDefaultToolkit().getAWTEventListeners();
+//		for (AWTEventListener listener: listeners) {
+//			System.err.println(listener);
+//			F10FriendlyKeyboardFocusManager keyboardManager = new F10FriendlyKeyboardFocusManager(listener);
+//			KeyboardFocusManager.setCurrentKeyboardFocusManager(keyboardManager);
+//		}
+//		
+//		F10FriendlyKeyboardFocusManager keyboardManager = new F10FriendlyKeyboardFocusManager(this);
+//		KeyboardFocusManager.setCurrentKeyboardFocusManager(keyboardManager);
+
+		KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this);
 	}
 
@@ -222,4 +238,5 @@
 	@Override
 	public void mouseWheelMoved(MouseWheelEvent e) {
+		//ensureShiftAltStateCorrect(e);
 		// Give widgets first whack at input
 		distributeNativeInput(e);
@@ -247,4 +264,6 @@
 	@Override
 	public void mouseMoved(MouseEvent e) {
+		//ensureShiftAltStateCorrect(e);
+		
 		// Update the cursor position
 		updateCursorPosition(e.getX(), e.getY());
@@ -271,4 +290,5 @@
 	@Override
 	public void mouseClicked(MouseEvent e) {
+		//ensureShiftAltStateCorrect(e);
 		// Give widgets first whack at input
 		distributeNativeInput(e);
@@ -282,4 +302,5 @@
 	@Override
 	public void mousePressed(MouseEvent e) {
+		//ensureShiftAltStateCorrect(e);
 		mouseAction(e, true);
 	}
@@ -287,4 +308,5 @@
 	@Override
 	public void mouseReleased(MouseEvent e) {
+		//ensureShiftAltStateCorrect(e);
 		mouseAction(e, false);
 	}
@@ -324,4 +346,5 @@
 		} catch (Exception exception) {
 			System.err.println("SwingInputManager::mouseAction: " + exception.getMessage());
+			exception.printStackTrace();
 		}
 	}
@@ -349,12 +372,13 @@
 	@Override
 	public void keyTyped(KeyEvent e) {
-		//System.err.println("SwingInputManager::keyTyped::KeyEvent: " + e.getKeyChar());
+		//System.err.println("SwingInputManager::keyTyped::" + KeyEvent.getKeyText(e.getKeyCode()));
+		//ensureShiftAltStateCorrect(e);
+		
 		// Give widgets first whack at input
 		distributeNativeInput(e);
 		if (e.isConsumed()) {
-			//System.err.println("SwingInputManager::keyTyped::Widget/Popup Consumed KeyEvent");
-			return;
-		}
-
+			return;
+		}
+		
 		try {
 			// Ignore escape character and control characters
@@ -376,4 +400,6 @@
 	@Override
 	public void keyPressed(KeyEvent e) {
+		//System.err.println("SwingInputManager::keyPressed::" + KeyEvent.getKeyText(e.getKeyCode()));
+		//ensureShiftAltStateCorrect(e);
 		keyAction(e, true);
 	}
@@ -381,23 +407,64 @@
 	@Override
 	public void keyReleased(KeyEvent e) {
+		//System.err.println("SwingInputManager::keyReleased::" + KeyEvent.getKeyText(e.getKeyCode()));
 		keyAction(e, false);
 	}
+
+//	private void ensureShiftAltStateCorrect(java.awt.event.InputEvent inputEvent) {
+////		Component source = (Component) e.getSource();
+////		int id = KeyEvent.KEY_RELEASED;
+////		long when = System.currentTimeMillis();
+////		int keyCode = KeyEvent.VK_UNDEFINED;
+////		char keyChar = KeyEvent.CHAR_UNDEFINED;
+//		
+////		int modifiers = (e.getModifiers() & ~KeyEvent.SHIFT_DOWN_MASK);
+////		KeyEvent event = new KeyEvent(source, id, when, modifiers, keyCode, keyChar);
+////		Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(event);
+//		
+//		boolean shiftIsDownInRecordedState = StandardInputEventListeners.kbmStateListener.isKeyDown(Key.SHIFT);
+//		boolean shiftIsDownEventState = inputEvent.isShiftDown();
+//		if (shiftIsDownInRecordedState && !shiftIsDownEventState) {
+//			try {
+//				// Create an input event
+//				InputEvent event = new KBMInputEvent(KBMInputEvent.EventType.KEY_UP, KBMInputEvent.Key.SHIFT);
+//				System.err.println("SwingInputManager::ensureShiftAltStateCorrect::Sending followup Shift Up");
+//				
+//				// Translate and perform the input
+//				distributeInputEvent(event);
+//			} catch (Exception exception) {
+//				System.err.println(exception.getMessage());
+//			}
+//		}
+		
+//		System.err.println("SwingInputManager::ensureShiftAltStateCorrect::datastructure shift down: " + shiftIsDownInRecordedState);
+//		if (shiftIsDownInRecordedState != e.isShiftDown() && !e.isShiftDown()) {
+//			System.err.println("SwingInputManager::ensureShiftAltStateCorrect::Sending shift up event.");
+//			int modifiers = (e.getModifiers() & ~KeyEvent.SHIFT_DOWN_MASK);
+//			KeyEvent event = new KeyEvent(source, id, when, modifiers, keyCode, keyChar);
+//			Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(event);
+//		}		
+		
+//		boolean altIsDown = StandardInputEventListeners.kbmStateListener.isKeyDown(Key.ALT);
+//		if (altIsDown != e.isAltDown() && !e.isAltDown()) {
+//			System.err.println("SwingInputManager::ensureShiftAltStateCorrect::Sending alt up event.");
+//			int modifiers = (e.getModifiers() & ~KeyEvent.ALT_DOWN_MASK);
+//			KeyEvent event = new KeyEvent(source, id, when, modifiers, keyCode, keyChar);
+//			Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(event);
+//		}
+//	}
 
 	/** Handles key pressed/released events. */
 	private void keyAction(KeyEvent e, boolean down) {
-		//System.err.println("SwingInputManager::keyAction::KeyEvent: " + e.getKeyChar());
 		// Give widgets first whack at input
 		distributeNativeInput(e);
 		if (e.isConsumed()) {
-			//System.err.println("SwingInputManager::keyAction::Was consumed: " + e.isConsumed());
-			return;
-		}
-		//System.err.println("SwingInputManager::keyAction::Was consumed: " + e.isConsumed());
-
+			return;
+		}
+		
 		KBMInputEvent.Key key = SwingConversions.fromSwingVirtualKey(e.getKeyCode());
 		if (key == null) {
 			return;
 		}
-
+		
 		try {
 			// Create an input event
@@ -424,14 +491,13 @@
 	/** Forwards the given input event to the listener if it is listening for it. */
 	private void forwardNativeInputToListener(Object listener, java.awt.event.InputEvent event) {
-		//System.err.println("SwingInputManager::forwardNativeInputToListener");
 		if (listener == null || event == null) {
 			return;
 		}
-		//System.err.println("SwingInputManager::forwardNativeInputToListener::Recieving input: " + event.toString());
+		
 		if (listener instanceof KeyListener && event instanceof KeyEvent) {
 
 			KeyListener keyListener = (KeyListener) listener;
 			KeyEvent ke = (KeyEvent) event;
-
+			
 			switch (event.getID()) {
 			case KeyEvent.KEY_PRESSED:
@@ -442,5 +508,4 @@
 				return;
 			case KeyEvent.KEY_TYPED:
-				//System.err.println("SwingInputManager::forwardNativeInputToListener::Recieving key typed: " + event.toString());
 				keyListener.keyTyped(ke);
 				return;
@@ -632,3 +697,21 @@
 
 	}
+
+	@Override
+	public boolean dispatchKeyEvent(KeyEvent e) {
+		if (e.getKeyCode() == KeyEvent.VK_F10) {
+			if (KeyEvent.KEY_PRESSED == e.getID()) {
+				keyPressed(e);
+			} else if (KeyEvent.KEY_RELEASED == e.getID()) {
+				keyReleased(e);
+			} else if (KeyEvent.KEY_TYPED == e.getID()) {
+				keyTyped(e);
+			} else {
+				System.err.println("SwingInputManager::dispatchKeyEvent::Found Key that is not pressed, "
+						+ "released or typed.  What is it?  " + e.getID());
+			}
+			return true;
+		}
+		return false;
+	}
 }
Index: trunk/src/org/expeditee/gio/swing/SwingTextLayoutManager.java
===================================================================
--- trunk/src/org/expeditee/gio/swing/SwingTextLayoutManager.java	(revision 1414)
+++ trunk/src/org/expeditee/gio/swing/SwingTextLayoutManager.java	(revision 1415)
@@ -262,5 +262,11 @@
 			}
 			
-			java.awt.font.TextLayout layout = lineBreaker.nextLayout(width, end, dontBreakWords);
+			java.awt.font.TextLayout layout = null;
+
+			try {
+				layout = lineBreaker.nextLayout(width, end, dontBreakWords);
+			} catch (ArrayIndexOutOfBoundsException e) {
+				e.printStackTrace();
+			}
 			
 			// If it's impossible to layout any more text without breaking a word, just do it
Index: trunk/src/org/expeditee/gui/AttributeUtils.java
===================================================================
--- trunk/src/org/expeditee/gui/AttributeUtils.java	(revision 1414)
+++ trunk/src/org/expeditee/gui/AttributeUtils.java	(revision 1415)
@@ -19,4 +19,5 @@
 package org.expeditee.gui;
 
+import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
@@ -331,4 +332,6 @@
 			_Attrib.put("TabIndex", 			Text.class.getMethod("getTabIndex"), 
 												Text.class.getMethod("setTabIndex", pInt));
+			_Attrib.put("EnterClick", 			Item.class.getMethod("acceptsKeyboardEnter"), 
+												Item.class.getMethod("setAcceptsEnter", pBool));
 			
 			// Aliases for attribute setting
@@ -566,8 +569,23 @@
 			sb.deleteCharAt(sb.length() - 1);
 			o = sb.toString();
-		} else if (o instanceof Boolean) {
-			// true is the default for boolean values
-			if (((Boolean) o).booleanValue()) {
-				return null;
+		} else if (o instanceof Boolean) {	
+			try {
+				Class<?> parentClass = item.getClass();
+				Field defaultValueField = parentClass.getField(a.getter.getName() + "Default");
+				boolean defaultValue = defaultValueField.getBoolean(null);
+				if (defaultValue == (boolean) o) {
+					return null;
+				}
+			} catch (IllegalArgumentException e) {
+				e.printStackTrace();
+			} catch (SecurityException e) {
+				e.printStackTrace();
+			} catch (NoSuchFieldException e) {
+				// true is the default for boolean values when no other default is provided
+				if ((boolean) o) {
+					return null;
+				}
+			} catch (IllegalAccessException e) {
+				e.printStackTrace();
 			}
 		}
Index: trunk/src/org/expeditee/gui/Browser.java
===================================================================
--- trunk/src/org/expeditee/gui/Browser.java	(revision 1414)
+++ trunk/src/org/expeditee/gui/Browser.java	(revision 1415)
@@ -274,5 +274,7 @@
 		if (!AuthenticatorBrowser.isAuthenticationRequired() && UserSettings.PublicAndPrivateResources) {
 			String userName = UserSettings.ProfileName.get();
-			FrameIO.setupPersonalResources(userName);
+			if (!FrameIO.personalResourcesExist(userName)) {
+				FrameIO.setupPersonalResources(userName);
+			}
 		}
 		// Listen for save status to display during and after runtime
Index: trunk/src/org/expeditee/gui/DisplayController.java
===================================================================
--- trunk/src/org/expeditee/gui/DisplayController.java	(revision 1414)
+++ trunk/src/org/expeditee/gui/DisplayController.java	(revision 1415)
@@ -583,5 +583,5 @@
 			// frames differ.
 			if (getCurrentFrame() != null && !bothSidesHaveSameFrame()) {
-				for (Item i : getCurrentFrame().getItems()) {
+				for (Item i : getCurrentFrame().getSortedItems()) {
 					i.onParentStateChanged(new ItemParentStateChangedEvent(getCurrentFrame(), ItemParentStateChangedEvent.EVENT_TYPE_HIDDEN));
 				}
@@ -590,5 +590,5 @@
 
 			// BROOK : TODO... overlays and loadable widgets
-			for (Item i : getCurrentFrame().getItems()) {
+			for (Item i : getCurrentFrame().getSortedItems()) {
 				i.onParentStateChanged(new ItemParentStateChangedEvent(getCurrentFrame(), ItemParentStateChangedEvent.EVENT_TYPE_SHOWN));
 			}
@@ -671,5 +671,5 @@
 			}
 
-			for (Item i : frame.getItems()) {
+			for (Item i : frame.getSortedItems()) {
 				i.onParentStateChanged(new ItemParentStateChangedEvent(frame,
 						ItemParentStateChangedEvent.EVENT_TYPE_SHOWN));
@@ -925,5 +925,5 @@
 		StandardGestureActions.setHighlightHold(true);
 
-		for (Item i : frame.getItems()) {
+		for (Item i : frame.getSortedItems()) {
 			if (i.getLink() != null && i.getAbsoluteLink().toLowerCase().equals(oldFrame)) {
 				if (i.getHighlightMode() != Item.HighlightMode.Normal) {
@@ -1131,10 +1131,10 @@
 		} else {
 			ToggleAudienceMode();
-			ItemUtils.UpdateConnectedToAnnotations(current.getItems());
+			ItemUtils.UpdateConnectedToAnnotations(current.getSortedItems());
 			for (Overlay o : current.getOverlays()) {
-				ItemUtils.UpdateConnectedToAnnotations(o.Frame.getItems());
+				ItemUtils.UpdateConnectedToAnnotations(o.Frame.getSortedItems());
 			}
 			for (Vector v : current.getVectorsDeep()) {
-				ItemUtils.UpdateConnectedToAnnotations(v.Frame.getItems());
+				ItemUtils.UpdateConnectedToAnnotations(v.Frame.getSortedItems());
 			}
 		}
@@ -1207,6 +1207,5 @@
 	 * This results in the Frame being re-parsed and repainted.
 	 */
-	public static void ToggleXRayMode()
-	{
+	public static void ToggleXRayMode()	{
 		// Turn off x-ray mode if it is on
 		if (_audienceMode) {
Index: trunk/src/org/expeditee/gui/Frame.java
===================================================================
--- trunk/src/org/expeditee/gui/Frame.java	(revision 1414)
+++ trunk/src/org/expeditee/gui/Frame.java	(revision 1415)
@@ -77,5 +77,5 @@
  * 
  */
-public class Frame /*implements Cloneable*/ {
+public class Frame {
 	
 	/** The frame number to indicate this is a virtual frame. */
@@ -126,6 +126,4 @@
 
 	private boolean _isLocal = true;
-
-	private boolean _sorted = true;
 	
 	/** Whether the frame has changed and therefore needs saving. */
@@ -139,7 +137,13 @@
 	private Stack<History> _redo = new Stack<History>();
 
-	private List<Item> _body = new ArrayList<Item>();
-	private List<Item> _bodyHiddenDueToPermissions = new ArrayList<Item>();
-	private List<Item> _surrogates = new ArrayList<Item>();
+	private ItemsList _body = new ItemsList();
+	private ItemsList _bodyHiddenDueToPermissions = new ItemsList();
+	private ItemsList _primaryItemsBody = new ItemsList();
+	private ItemsList _surrogateItemsBody = new ItemsList();
+	
+	//private List<Item> _body = new ArrayList<Item>();
+	//private List<Item> _bodyHiddenDueToPermissions = new ArrayList<Item>();
+	//private List<Item> _primaryItemsBody = new ArrayList<Item>();
+	//private List<Item> _surrogateItemsBody = new ArrayList<Item>();
 
 	// for drawing purposes
@@ -184,75 +188,18 @@
 	private String _groupFrameName;
 	private Frame _groupFrame = null;
+	
+	public enum BodyType {
+		BodyDisplay, PrimaryBody, SurrogateBody;
+	}
 
 	/** Default constructor, nothing is set. */
 	public Frame() {
 	}
-	
-//	public Frame clone() {
-//		Frame clone = new Frame();
-//		for (Item i: this._body) { 
-//			Item copy = i.copy();
-//			copy.setID(i.getID());	
-//			clone._body.add(copy);
-//		}
-//		for(Item i: this._bodyHiddenDueToPermissions) { 
-//			Item copy = i.copy();
-//			copy.setID(i.getID());
-//			clone._bodyHiddenDueToPermissions.add(i);
-//		}
-//		if (this._frameName != null) {
-//			clone._frameName = this._frameName.copy();
-//		}
-//		for(Overlay key: this._overlays.keySet()) {
-//			clone._overlays.put(key, this._overlays.get(key));
-//		}
-//		for(Vector v: this._vectors) {
-//			clone._vectors.add(v);
-//		}
-//		for (Item i: this._interactableItems) {
-//			clone._interactableItems.add(i.copy());
-//		}
-//		for (Item i: this._overlayItems) {
-//			clone._overlayItems.add(i.copy());
-//		}
-//		for (Item i: this._vectorItems) {
-//			clone._vectorItems.add(i.copy());
-//		}
-//		clone._frameData = this._frameData;
-//		clone._frameset = this._frameset;
-//		clone._number = this._number;
-//		clone._version = this._version;
-//		clone._permissionTriple = this._permissionTriple;
-//		clone._owner = this._owner;
-//		clone._creationDate = this._creationDate;
-//		clone._modifiedUser = this._modifiedUser;
-//		clone._modifiedDate = this._modifiedDate;
-//		clone._modifiedDatePrecise = this._modifiedDatePrecise;
-//		clone._frozenDate = this._frozenDate;
-//		clone._background = this._background;
-//		clone._foreground = this._foreground;
-//		clone.path = this.path;
-//		clone._isLocal = this._isLocal;
-//		clone._sorted = this._sorted;
-//		clone._change = this._change;
-//		clone._saved = this._saved;
-//		clone._lineCount = this._lineCount;
-//		clone._itemCount = this._itemCount;
-//		clone._buffer = this._buffer;
-//		clone._validBuffer = this._validBuffer;
-//		clone._activeTime = (Time) this._activeTime.clone();
-//		clone._darkTime = (Time) this._darkTime.clone();
-//		clone._dotTemplate = this._dotTemplate.copy();
-//		
-//		return clone;
-//	}
-
-	public boolean isReadOnly()
-	{
+
+	public boolean isReadOnly() {
 		return !_frameName.hasPermission(UserAppliedPermission.full) && !_protectionChanged;
 	}
 
-	public void reset()
-	{
+	public void reset()	{
 		refreshItemPermissions(UserAppliedPermission.full);
 		resetDot();
@@ -403,26 +350,19 @@
 	 * @return The list of Item objects that are on this Frame.
 	 */
-	public List<Item> getItems(boolean visible)
-	{
-		if (!_sorted) {
-			for(int i = 0; i < _body.size();) {
-				if(_body.get(i) == null) {
-					_body.remove(i);
-				} else {
-					i++;
-				}
-			}
-			Collections.sort(_body);
-			_sorted = true;
-		}
-
+	public List<Item> getSortedItems(boolean requireVisible) {
+		ItemsList listToLoopOver = _body;
+		listToLoopOver.sort();
+		return getItems(requireVisible, listToLoopOver);
+	}
+	
+	public List<Item> getItems(boolean requireVisible, ItemsList listToLoopOver) {
 		List<Item> items = new ArrayList<Item>();
 
-		for (Item i : _body) {
+		for (Item i: listToLoopOver) {
 			if (i == null) {
 				continue;
 			}
 			
-			if (i.isVisible() || (!visible && !i.isDeleted())) {
+			if (meetsVisibilityRequirements(requireVisible, i)) {
 				items.add(i);
 			}
@@ -431,9 +371,9 @@
 		return items;
 	}
-
+	
 	/** TODO: Comment. cts16 */
-	public List<Item> getItems()
-	{
-		return getItems(false);
+	public List<Item> getSortedItems()
+	{
+		return getSortedItems(false);
 	}
 
@@ -443,10 +383,8 @@
 	 * @return True if this frame contains i.
 	 */
-	public boolean containsItem(Item i)
-	{
+	public boolean containsItem(Item i) {
 		if (i == null) {
 			throw new NullPointerException("i");
-		}
-		
+		}	
 		return _body.contains(i);
 	}
@@ -468,5 +406,5 @@
 		List<Text> bodyTextItems = new ArrayList<Text>();
 		
-		for (Item i : getItems(true)) {
+		for (Item i : getSortedItems(true)) {
 			// only add up normal body text items
 			if ((i instanceof Text) && ((includeAnnotations && !((Text) i).isSpecialAnnotation()) || !i.isAnnotation()) && !i.isLineEnd()) {
@@ -483,5 +421,5 @@
 	{
 		Collection<Item> items = new ArrayList<Item>();
-		for (Item i : getItems(true)) {
+		for (Item i : getSortedItems(true)) {
 			// only add up normal body text items
 			if (!i.isAnnotation()) {
@@ -505,5 +443,5 @@
 	public Item getLastNonAnnotationTextItem()
 	{
-		List<Item> items = getItems();
+		List<Item> items = getSortedItems();
 
 		// find the last non-annotation text item
@@ -910,11 +848,10 @@
 	 *            The date to set as the last frozen date.
 	 */
-	public void setFrozenDate(String date)	{
+	public void setFrozenDate(String date) {
 		_frozenDate = date;
 	}
 
-	public void setResort(boolean value)
-	{
-		_sorted = !value;
+	public void invalidateSorted() {
+		_body.invalidateSorted();
 	}
 
@@ -925,12 +862,21 @@
 	 *            The Item to add to this Frame.
 	 */
-	public void addItem(Item item)
-	{
+	public void addItem(Item item) {
 		addItem(item, true);
 	}
 
-	public void addItem(Item item, boolean recalculate)
-	{
-		if (item == null || item.equals(_frameName) || _body.contains(item)) {
+	public void addItem(Item item, boolean recalculate)	{
+		if (item == null) { return; }
+		
+		addItem(item, recalculate, _body);
+		if (item.isSurrogate()) {
+			addItem(item, recalculate, _surrogateItemsBody);
+		} else {
+			addItem(item, recalculate, _primaryItemsBody);
+		}
+	}
+	
+	protected void addItem(Item item, boolean recalculate, ItemsList list) {
+		if (item == null || item.equals(_frameName) || list.contains(item)) {
 			return;
 		}
@@ -948,5 +894,5 @@
 		_itemCount = Math.max(_itemCount, item.getID());
 
-		_body.add(item);
+		list.add(item);
 		item.setParent(this);
 		item.setFloating(false); // esnure that it is anchored
@@ -959,6 +905,6 @@
 			item.setPosition(item.getPosition());
 		}
-
-		_sorted = false;
+		
+		list.invalidateSorted();
 
 		// item.setMaxWidth(FrameGraphics.getMaxFrameSize().width);
@@ -983,6 +929,6 @@
 	}
 	
-	public void addToSurrogates(Item surrogate) {
-		this._surrogates.add(surrogate);
+	public void addToSurrogatesOnLoad(Item surrogate, Item parent) {
+		parent.addToSurrogates(surrogate);
 	}
 
@@ -991,5 +937,5 @@
 		boolean bReparse = false;
 		
-		for (Item i : getItems()) {
+		for (Item i : getSortedItems()) {
 			Integer anchorLeft   = i.getAnchorLeft();
 			Integer anchorRight  = i.getAnchorRight();
@@ -1039,6 +985,10 @@
 	}
 
-	public void addAllItems(Collection<Item> toAdd)
-	{
+	public void addAllItems(Collection<Item> toAdd)	{
+		addAllItems(toAdd, _body);
+		addAllItems(toAdd, _primaryItemsBody);
+	}
+	
+	protected void addAllItems(Collection<Item> toAdd, ItemsList list) {
 		for (Item i : toAdd) {
 			// If an annotation is being deleted clear the annotation list
@@ -1047,10 +997,9 @@
 			}
 			// TODO Improve efficiency when addAll is called
-			addItem(i);
-		}
-	}
-
-	public void removeAllItems(Collection<Item> toRemove)
-	{
+			addItem(i, true, list);
+		}
+	}
+
+	public void removeAllItems(Collection<Item> toRemove) {
 		for (Item i : toRemove) {
 			// If an annotation is being deleted clear the annotation list
@@ -1066,6 +1015,14 @@
 	}
 
-	public void removeItem(Item item, boolean recalculate)
-	{
+	public void removeItem(Item item, boolean recalculate) {
+		removeItem(item, recalculate, _body);
+		if (item.isSurrogate()) {
+			removeItem(item, recalculate, _surrogateItemsBody);
+		} else {
+			removeItem(item, recalculate, _primaryItemsBody);
+		}
+	}
+	
+	protected void removeItem(Item item, boolean recalculate, ItemsList toRemoveFrom) {
 		// If an annotation is being deleted clear the annotation list
 		if (item.isAnnotation()) {
@@ -1073,5 +1030,5 @@
 		}
 
-		if (_body.remove(item)) {
+		if (toRemoveFrom.remove(item)) {
 			change();
 			// Remove widgets from the widget list
@@ -1098,6 +1055,5 @@
 	 * @param type  The type of event that occurred
 	 */
-	private void addToUndo(Collection<Item> items, History.Type type)
-	{
+	private void addToUndo(ItemsList items, History.Type type) {
 		if (items.size() < 1) {
 			return;
@@ -1107,11 +1063,9 @@
 	}
 	
-	public void addToUndoDelete(Collection<Item> items)
-	{
+	public void addToUndoDelete(ItemsList items) {
 		addToUndo(items, History.Type.deletion);
 	}
 	
-	public void addToUndoMove(Collection<Item> items)
-	{
+	public void addToUndoMove(ItemsList items) {
 		addToUndo(items, History.Type.movement);
 	}
@@ -1147,6 +1101,6 @@
     		break;
 		case movement:
-			List<Item> changed = new LinkedList<Item>(_body);
-			changed.retainAll(undo.items);
+			ItemsList changed = new ItemsList(_body);
+			changed.retainHistory(undo.items);
 			_redo.push(new History(changed, History.Type.movement));
 			for(Item i : undo.items) {
@@ -1207,6 +1161,6 @@
     		break;
 		case movement:
-			List<Item> changed = new LinkedList<Item>(_body);
-			changed.retainAll(redo.items);
+			ItemsList changed = new ItemsList(_body);
+			changed.retainHistory(redo.items);
 			_undo.push(new History(changed, History.Type.movement));
 			for(Item i : redo.items) {
@@ -1677,5 +1631,5 @@
 	{
 		for (Overlay o : _overlays.keySet()) {
-			for (Item i : o.Frame.getItems()) {
+			for (Item i : o.Frame.getSortedItems()) {
 				i.onParentStateChanged(new ItemParentStateChangedEvent(
 								this,
@@ -1695,5 +1649,5 @@
 				_overlays.remove(o);
 				
-				for (Item i : f.getItems()) {
+				for (Item i : f.getSortedItems()) {
 					_overlayItems.remove(i);
 					i.onParentStateChanged(new ItemParentStateChangedEvent(
@@ -1788,5 +1742,5 @@
 		}
 
-		List<Item> copies = ItemUtils.CopyItems(toMergeWith.getItems());
+		List<Item> copies = ItemUtils.CopyItems(toMergeWith.getSortedItems());
 		copies.remove(toMergeWith.getNameItem());
 
@@ -1834,5 +1788,5 @@
 	public void clear(boolean keepAnnotations)
 	{
-		List<Item> newBody = new ArrayList<Item>(0);
+		ItemsList newBody = new ItemsList();
 		
 		Item title = getTitleItem();
@@ -2010,4 +1964,5 @@
 		// reset attributes
 		dot.setParent(this);
+		dot.setOwner(template.getOwner());
 		return dot;
 	}
@@ -2018,5 +1973,5 @@
 
 		// check for an updated template...
-		for (Item i : this.getItems()) {
+		for (Item i : this.getSortedItems()) {
 			if (ItemUtils.startsWithTag(i, templateTag)) {
 				t = (Text) i;
@@ -2032,5 +1987,5 @@
 			t = defaultTemplate;
 		}
-
+		
 		// If the item is linked apply any attribute pairs on the child frame
 		String link = t.getAbsoluteLink();
@@ -2038,4 +1993,8 @@
 		// need to get link first because copy doesnt copy the link
 		t = t.copy();
+		// If the template does not have a owner then it should be set to the current user.
+		if (t.getOwner() == null) {
+			t.setOwner(UserSettings.UserName.get());
+		}
 		t.setTooltip(null);
 		if (link != null) {
@@ -2202,5 +2161,5 @@
 	public boolean moveMouseToTextItem(int index)
 	{
-		List<Item> items = getItems();
+		List<Item> items = getSortedItems();
 		int itemsFound = 0;
 		for (int i = 0; i < items.size(); i++) {
@@ -2228,5 +2187,5 @@
 	public boolean moveMouseToDefaultLocation()
 	{
-		List<Item> items = getItems();
+		List<Item> items = getSortedItems();
 
 		for (Item it : items) {
@@ -2527,5 +2486,5 @@
 	public List<Item> getVisibleItems()
 	{
-		return getItems(true);
+		return getSortedItems(true);
 	}
 
@@ -2559,5 +2518,5 @@
 	 * @return the list of items to be saved to a text file
 	 */
-	public List<Item> getItemsToSave() {
+	/*public List<Item> getItemsToSave() {
 		if (!_sorted) {
 			Collections.sort(_body);
@@ -2599,10 +2558,51 @@
 
 		return toSave;
-	}
-	
-	public List<Item> getSurrogateItemsToSave() {
-		List<Item> surrogates = new ArrayList<Item>();
-		_body.forEach(item -> surrogates.addAll(item.getSurrogates()));
-		return surrogates;
+	}*/
+	
+	public List<Item> getItemsToSave() {
+		return getItemsToSave(BodyType.PrimaryBody);
+	}
+	
+	public List<Item> getItemsToSave(BodyType type) {
+		assert(!type.equals(BodyType.BodyDisplay));
+		switch (type) {
+		case SurrogateBody:
+			return getItemsToSave(_surrogateItemsBody);
+		case BodyDisplay:
+			return getItemsToSave(_body);
+		case PrimaryBody:
+		default:
+			return getItemsToSave(_primaryItemsBody);
+		}
+	}
+	
+	private List<Item> getItemsToSave(ItemsList body) {
+		body.sort();
+		List<Widget> seenWidgets = new ArrayList<Widget>();
+		
+		List<Item> toSave = new ArrayList<Item>();
+		
+		body.removeIf(item -> item.dontSave());
+		for (Item item: body) {
+			if (item instanceof WidgetCorner) {
+				// Save the widget source.  
+				// Each widget has multiple WidgetCorner's..ignore them if we already have the source. 
+				Widget iw = ((WidgetCorner) item).getWidgetSource();
+				if (seenWidgets.contains(iw)) { continue; }
+				seenWidgets.add(iw);
+				toSave.add(iw.getSource());
+			} else if (item instanceof XRayable) {
+				// XRayable Items have their sources saved.
+				XRayable x = (XRayable) item;
+				toSave.addAll(x.getItemsToSave());
+			} else if (item.hasEnclosures()) {
+				// Deals with Circle objects only?
+				continue;
+			} else {
+				toSave.add(item);
+			}
+		}
+		
+		return toSave;
 	}
 
@@ -2623,11 +2623,10 @@
 	}
 
-	public Collection<Item> getAllItems()
-	{
-		Collection<Item> allItems = new LinkedHashSet<Item>(_body);
+	public Collection<Item> getAllItems() {
+		ItemsList allItems = new ItemsList(_body);
 		
 		allItems.addAll(_overlayItems);
 		allItems.addAll(_vectorItems);
-		return allItems;
+		return allItems.underlying();
 	}
 
@@ -2648,5 +2647,5 @@
 		Collection<Text> textItems = new ArrayList<Text>();
 		
-		for (Item i : getItems(true)) {
+		for (Item i : getSortedItems(true)) {
 			// only add up normal body text items
 			if ((i instanceof Text)) {
@@ -2669,5 +2668,5 @@
 	public void recalculate()
 	{
-		for (Item i : getItems()) {
+		for (Item i : getSortedItems()) {
 			if (i.hasFormula() && !i.isAnnotation()) {
 				i.calculate(i.getFormula());
@@ -2700,5 +2699,5 @@
 		Collection<Text> items = new LinkedHashSet<Text>();
 		
-		for (Item i : getItems(true)) {
+		for (Item i : getSortedItems(true)) {
 			// only add up normal body text items
 			if (i instanceof Text && !i.isAnnotation()) {
@@ -2788,6 +2787,6 @@
 	}
 	
-	public List<Item> getBodyItemsWithInsufficientPermissions() {
-		return _bodyHiddenDueToPermissions;
+	public Collection<Item> getBodyItemsWithInsufficientPermissions() {
+		return _bodyHiddenDueToPermissions.underlying();
 	}
 	
@@ -2898,4 +2897,12 @@
 		return members;
 	}
+	
+	public boolean hasSurrogates() {
+		return !_surrogateItemsBody.isEmpty();
+	}
+
+	private boolean meetsVisibilityRequirements(boolean requireVisible, Item i) {
+		return i.isVisible() || (!requireVisible && !i.isDeleted());
+	}
 
 	private static final class History {
@@ -2906,11 +2913,11 @@
 		}
 		
-		public final List<Item> items;
+		public final ItemsList items;
 		
 		public final Type type;
 		
-		public History(Collection<Item> items, Type type)
+		public History(ItemsList changed, Type type)
 		{
-			this.items = new LinkedList<Item>(items);
+			this.items = new ItemsList(changed);
 			this.type = type;
 		}
@@ -2922,3 +2929,17 @@
 		}
 	}
+
+	protected boolean hasAnnotations() {
+		return _annotations != null && _annotations.size() > 0;
+	}
+
+	protected ItemsList getBody() {
+		return _body;
+	}
+	protected ItemsList getPrimaryBody() {
+		return _primaryItemsBody;
+	}
+	protected ItemsList getSurrogateBody() {
+		return _surrogateItemsBody;
+	}
 }
Index: trunk/src/org/expeditee/gui/FrameCreator.java
===================================================================
--- trunk/src/org/expeditee/gui/FrameCreator.java	(revision 1414)
+++ trunk/src/org/expeditee/gui/FrameCreator.java	(revision 1415)
@@ -276,5 +276,5 @@
 		_lastX = START_X;
 		// Check for @Start
-		for (Item it : toUse.getItems()) {
+		for (Item it : toUse.getSortedItems()) {
 			if (it instanceof Text) {
 				Text t = (Text) it;
Index: trunk/src/org/expeditee/gui/FrameGraphics.java
===================================================================
--- trunk/src/org/expeditee/gui/FrameGraphics.java	(revision 1414)
+++ trunk/src/org/expeditee/gui/FrameGraphics.java	(revision 1415)
@@ -141,5 +141,5 @@
 		EcosystemManager.getGraphicsManager().clear(backgroundColor);
 
-		List<Item> visibleItems = new LinkedList<Item>();
+		List<Item> itemsToPaintCanditates = new LinkedList<Item>();
 		List<Widget> paintWidgets;
 
@@ -147,10 +147,10 @@
 			// Add all the items for this frame and any other from other
 			// frames
-			visibleItems.addAll(toPaint.getAllItems());
+			itemsToPaintCanditates.addAll(toPaint.getAllItems());
 			paintWidgets = toPaint.getAllOverlayWidgets();
 			paintWidgets.addAll(toPaint.getInteractiveWidgets());
 		} else {
-			visibleItems.addAll(toPaint.getVisibleItems());
-			visibleItems.addAll(toPaint.getVectorItems());
+			itemsToPaintCanditates.addAll(toPaint.getVisibleItems());
+			itemsToPaintCanditates.addAll(toPaint.getVectorItems());
 			paintWidgets = toPaint.getInteractiveWidgets();
 		}
@@ -181,9 +181,9 @@
 
 		if (clip == null) {
-			paintItems = visibleItems;
+			paintItems = itemsToPaintCanditates;
 		} else {
 			fillOnlyItems = new HashSet<Item>();
 			paintItems = new LinkedList<Item>();
-			for (Item i : visibleItems) {
+			for (Item i : itemsToPaintCanditates) {
 				if (clip == null || i.isInDrawingArea(clip.getBounds())) {
 					paintItems.add(i);
@@ -201,5 +201,5 @@
 		// Only paint files and lines once ... between anchored AND free items
 		PaintPictures(paintItems, fillOnlyItems, paintedFillsAndLines);
-		PaintLines(visibleItems);
+		PaintLines(itemsToPaintCanditates);
 
 
@@ -380,4 +380,5 @@
 
 		List<Item> toFill = new LinkedList<Item>();
+		
 		for (Item i : toPaint) {
 			// Ignore items that have already been done!
Index: trunk/src/org/expeditee/gui/FrameIO.java
===================================================================
--- trunk/src/org/expeditee/gui/FrameIO.java	(revision 1414)
+++ trunk/src/org/expeditee/gui/FrameIO.java	(revision 1415)
@@ -88,5 +88,4 @@
  */
 
-
 public class FrameIO {
 
@@ -214,81 +213,4 @@
 	}
 	
-//	public static void changeParentAndSubFolders(String newFolder) {
-//		// Partial Paths.
-//		PARENT_FOLDER = newFolder;	
-//		String resourcesPublicPath = PARENT_FOLDER + "resources-public" + File.separator;
-//		String resourcesPrivateIndividualPath = PARENT_FOLDER + "resources-" + UserSettings.UserName.get() + File.separator;
-//
-//		// Standard paths.
-//		PUBLIC_PATH = PARENT_FOLDER + "public" + File.separator;
-//		TRASH_PATH = PARENT_FOLDER + "trash" + File.separator;
-//		HELP_PATH = PARENT_FOLDER + "documentation" + File.separator;
-//		PROFILE_PATH = PARENT_FOLDER + "profiles" + File.separator;
-//		EXPORTS_PATH = PARENT_FOLDER + "exports" + File.separator;
-//		STATISTICS_PATH = PARENT_FOLDER + "statistics" + File.separator;
-//		LOGS_PATH = PARENT_FOLDER + "logs" + File.separator;
-//				
-//		
-//		// Conditional paths
-//		if (UserSettings.PublicAndPrivateResources) {
-//			// Work with a system of public and private folders
-//			
-//			FONT_PATH = resourcesPublicPath + "fonts" + File.separator;
-//			DICT_PATH = resourcesPublicPath + "dict" + File.separator;
-//			IMAGES_PATH = resourcesPublicPath + "images" + File.separator;
-//			AUDIO_PATH = resourcesPublicPath + "audio" + File.separator;
-//			FRAME_PATH = resourcesPublicPath + "framesets" + File.separator;
-//		} else {
-//			FONT_PATH = PARENT_FOLDER + "fonts" + File.separator;
-//			DICT_PATH = PARENT_FOLDER + "dict" + File.separator;
-//			IMAGES_PATH = PARENT_FOLDER + "images" + File.separator;
-//			AUDIO_PATH = PARENT_FOLDER + "audio" + File.separator;
-//			FRAME_PATH = PARENT_FOLDER + "framesets" + File.separator;
-//			DEAD_DROPS_PATH = PARENT_FOLDER + "deaddrops" + File.separator;
-//		}
-//		
-//		if (!UserSettings.PublicAndPrivateResources || (AuthenticatorBrowser.isAuthenticationRequired() && !AuthenticatorBrowser.isAuthenticated())) {
-//			
-//			if (UserSettings.UserName.get().equals(AuthenticatorBrowser.USER_NOBODY)) {
-//				System.err.println("**** FrameIO::changeParentAndSubFolders(): Not setting subfolders for user '"+AuthenticatorBrowser.USER_NOBODY+"'");
-//			}
-//			
-//			// If we are using the old regime, or user.name set to Browser.USER_NOBODY
-//			// => then these paths should not be used.
-//			RESOURCES_PATH = null;
-//			SHARED_FRAMESETS_PATH = null;
-//			RESOURCES_PRIVATE_PATH = null;		
-//			FRAME_PRIVATE_PATH = null;
-//			IMAGES_PRIVATE_PATH = null;
-//			AUDIO_PRIVATE_PATH = null;
-//			CONTACTS_PATH = null;
-//			HELP_PRIVATE_PATH = null;
-//			
-//			if (!UserSettings.PublicAndPrivateResources) {
-//				MESSAGES_PATH = PARENT_FOLDER + "messages" + File.separator;
-//			} else {
-//				MESSAGES_PATH = resourcesPrivateIndividualPath + "messages" + File.separator;
-//			}
-//			
-//		} else {
-//			RESOURCES_PATH = resourcesPublicPath + "documentation" + File.separator;
-//			SHARED_FRAMESETS_PATH = resourcesPrivateIndividualPath + "framesets-shared" + File.separator;
-//			
-//			RESOURCES_PRIVATE_PATH = PARENT_FOLDER + "resources-private" + File.separator;
-//			FRAME_PRIVATE_PATH = resourcesPrivateIndividualPath + "framesets" + File.separator;
-//			IMAGES_PRIVATE_PATH = resourcesPrivateIndividualPath + "images" + File.separator;
-//			AUDIO_PRIVATE_PATH = resourcesPrivateIndividualPath + "audio" + File.separator;
-//			CONTACTS_PATH = resourcesPrivateIndividualPath + "contacts" + File.separator;
-//			HELP_PRIVATE_PATH = resourcesPrivateIndividualPath + "documentation" + File.separator;
-//			MESSAGES_PATH = resourcesPrivateIndividualPath + "messages" + File.separator;
-//			MAIL_PATH = resourcesPrivateIndividualPath + "mail" + File.separator;
-//			DEAD_DROPS_PATH = resourcesPrivateIndividualPath + "deaddrops" + File.separator;
-//		} 
-//			
-//		
-//		System.err.println("**** FrameIO::changeParentAndSubFolder(): Calling AudioPathManger.changeParentAndSubFolder()");
-//		AudioPathManager.changeParentAndSubFolders(newFolder);
-//	}
-	
 	// All methods are static, this should not be instantiated
 	private FrameIO() {
@@ -1001,5 +923,5 @@
 		template.resetDateCreated();
 
-		for (Item i : template.getItems()) {
+		for (Item i : template.getSortedItems()) {
 			if (ItemUtils.startsWithTag(i, ItemUtils.TAG_PARENT)) {
 				i.setLink(null);
@@ -1009,6 +931,10 @@
 		// do auto shrinking of the title IF not in twin frames mode and the title is not centred
 		Item titleItem = template.getTitleItem();
-
-		if (!DisplayController.isTwinFramesOn() && !Justification.center.equals(((Text)titleItem).getJustification())) {
+		if (titleItem == null) {
+			return template; 
+		}
+		
+		boolean titleItemJustified = titleItem == null || !Justification.center.equals(((Text)titleItem).getJustification());
+		if (!DisplayController.isTwinFramesOn() && titleItemJustified) {
 			if ((titleItem.getX() + 1) < template.getNameItem().getX()) {
 				int title_item_xr = titleItem.getX() + titleItem.getBoundsWidth(); // should really be '... -1'
@@ -1307,5 +1233,5 @@
 				EcosystemManager.getMiscManager().beep();
 			} else if (checkBackup
-					&& ItemUtils.ContainsExactTag(toSave.getItems(),
+					&& ItemUtils.ContainsExactTag(toSave.getSortedItems(),
 							ItemUtils.TAG_BACKUP)) {
 				SuspendCache();
@@ -1338,5 +1264,5 @@
 				}
 
-				Item i = ItemUtils.FindExactTag(toSave.getItems(),
+				Item i = ItemUtils.FindExactTag(toSave.getSortedItems(),
 						ItemUtils.TAG_BACKUP);
 				i.setLink(original.getName());
@@ -1480,5 +1406,5 @@
 	}
 
-	public static Frame CreateNewProfile(String username, Map<String, Setting> initialSettings, Map<String, Consumer<Frame>> toNotifyOnSet) throws InvalidFramesetNameException, ExistingFramesetException  {
+	public static Frame CreateNewProfile(String username, Map<String, Setting> initialSettings, Map<String, Consumer<Frame>> toNotifyOnSet) throws InvalidFramesetNameException, ExistingFramesetException {
 		Frame profile = CreateFrameset(username, PROFILE_PATH, true);
 		if (profile != null) {
@@ -2110,4 +2036,11 @@
 	}
 	
+	public static boolean personalResourcesExist(String username) {
+		Path personalResources = Paths.get(FrameIO.PARENT_FOLDER).resolve("resources-" + username);
+		File personalResourcesFile = personalResources.toFile();
+		boolean directoryExists = personalResourcesFile.exists() && personalResourcesFile.isDirectory();
+		return directoryExists;
+	}
+	
 	public static Path setupPersonalResources(String username) {
 		Path personalResources = Paths.get(FrameIO.PARENT_FOLDER).resolve("resources-" + username);
Index: trunk/src/org/expeditee/gui/FrameUtils.java
===================================================================
--- trunk/src/org/expeditee/gui/FrameUtils.java	(revision 1414)
+++ trunk/src/org/expeditee/gui/FrameUtils.java	(revision 1415)
@@ -60,4 +60,5 @@
 import org.expeditee.core.bounds.AxisAlignedBoxBounds;
 import org.expeditee.core.bounds.PolygonBounds;
+import org.expeditee.encryption.items.surrogates.Label;
 import org.expeditee.gio.EcosystemManager;
 import org.expeditee.gio.gesture.StandardGestureActions;
@@ -384,5 +385,5 @@
 		}
 
-		for (Item i : current.getItems()) {
+		for (Item i : current.getSortedItems()) {
 			i.setHighlightMode(Item.HighlightMode.None);
 			i.setHighlightColorToDefault();
@@ -642,5 +643,5 @@
 	 * @return True if the image was created successfully, false otherwise
 	 */
-	private static boolean createPicture(Frame frame, Text txt) {
+	private static boolean createPicture(Frame frame, Text txt, ItemsList items) {
 		// attempt to create the picture
 		Picture pic = ItemUtils.CreatePicture(txt);
@@ -659,7 +660,11 @@
 			return false;
 		}
-		frame.addItem(pic);
+		frame.addItem(pic, true, items);
 
 		return true;
+	}
+	
+	private static boolean createPictureInBody(Frame frame, Text txt) {
+		return createPicture(frame, txt, frame.getBody());
 	}
 
@@ -678,5 +683,5 @@
 	 * @author Brook Novak
 	 */
-	private static boolean createWidget(Frame frame, Text txt) {
+	private static boolean createWidget(Frame frame, Text txt, ItemsList list) {
 
 		if (frame == null) {
@@ -713,9 +718,13 @@
 		}
 
-		frame.removeItem(txt);
-
-		frame.addAllItems(iw.getItems());
+		frame.removeItem(txt, true, list);
+
+		frame.addAllItems(iw.getItems(), list);
 
 		return true;
+	}
+	
+	private static boolean createWidgetInBody(Frame frame, Text txt) {
+		return createWidget(frame, txt, frame.getBody());
 	}
 
@@ -857,40 +866,9 @@
 		return dirsToAdd;
 	}
-
-	public static void Parse(Frame toParse) {
-		Parse(toParse, false);
-	}
-
-	/**
-	 * Checks for any special Annotation items and updates the display as necessary.
-	 * Special Items: Images, overlays, sort.
-	 * 
-	 */
-	public static void Parse(Frame toParse, boolean firstParse) {
-		Parse(toParse, firstParse, false);
-	}
-
-	/**
-	 * 
-	 * @param toParse
-	 * @param firstParse
-	 * @param ignoreAnnotations
-	 *            used to prevent infinate loops such as when performing TDFC with
-	 *            an ao tag linked to a frame with an frameImage of a frame which
-	 *            also has an ao tag on it.
-	 */
-	public static void Parse(Frame toParse, boolean firstParse, boolean ignoreAnnotations) {
-		// TODO check why we are getting toParse == null... when profile frame
-		// is being created and change the lines below
-		if (toParse == null) {
-			return;
-		}
-
-		if (firstParse) {
-			ItemUtils.EnclosedCheck(toParse.getItems());
-		}
-
-		List<Item> items = toParse.getItems();
-
+	
+	private static void transformOutOfPlaceItems(Frame toParse, ItemsList toTransform) {
+		// Get all items from toTransform that have not been marked as deleted.
+		List<Item> items = toParse.getItems(false, toTransform);
+		
 		// if XRayMode is on, replace pictures with their underlying text
 		if (DisplayController.isXRayMode()) {
@@ -901,5 +879,5 @@
 			for (Item i : items) {
 				if (i instanceof XRayable) {
-					toParse.removeItem(i);
+					toParse.removeItem(i, true, toTransform);
 					// Show the items
 					for (Item item : ((XRayable) i).getConnected()) {
@@ -908,7 +886,7 @@
 					}
 				} else if (i instanceof WidgetCorner) {
-					toParse.removeItem(i);
+					toParse.removeItem(i, true, toTransform);
 				} else if (i instanceof WidgetEdge) {
-					toParse.removeItem(i);
+					toParse.removeItem(i, true, toTransform);
 				} else if (i.hasFormula()) {
 					i.setText(i.getFormula());
@@ -920,13 +898,8 @@
 
 			for (Widget iw : widgets) {
-				toParse.addItem(iw.getSource());
-			}
-		}
-
-		// Text title = null;
-		// Text template = UserSettingsTemplate.copy();
-
-		List<Overlay> overlays = new ArrayList<Overlay>();
-		List<Vector> vectors = new ArrayList<Vector>();
+				toParse.addItem(iw.getSource(), true, toTransform);
+			}
+		}
+
 
 		// disable reading of cached overlays if in twinframes mode
@@ -935,16 +908,10 @@
 		}
 
-		// DotType pointtype = DotType.square;
-		// boolean filledPoints = true;
-
-		UserAppliedPermission permission = toParse.getUserAppliedPermission();
 		toParse.clearAnnotations();
 
 		// check for any new overlay items
-		for (Item i : toParse.getItems()) {
+		items = toParse.getItems(false, toTransform);
+		for (Item i : items) {
 			try {
-				// reset overlay permission
-				i.setOverlayPermission(null);
-				// i.setPermission(permission);
 				if (i instanceof WidgetCorner) {
 					// TODO improve efficiency so it only updates once... using
@@ -952,29 +919,105 @@
 					i.update();
 				} else if (i instanceof Text) {
+					if (!DisplayController.isXRayMode() && i.isAnnotation()) {
+						if (ItemUtils.startsWithTag(i, ItemUtils.TAG_IMAGE, true)) {
+							if (!i.hasEnclosures()) {
+								createPicture(toParse, (Text) i, toTransform);
+							}
+							// check for frame images
+						} else if (ItemUtils.startsWithTag(i, ItemUtils.TAG_FRAME_IMAGE) && i.getLink() != null
+								&& !i.getAbsoluteLink().equalsIgnoreCase(toParse.getName())) {
+							XRayable image = null;
+							if (i.hasEnclosures()) {
+								// i.setHidden(true);
+								// image =
+								// i.getEnclosures().iterator().next();
+								// image.refresh();
+							} else {
+								image = new FrameImage((Text) i, null);
+							}
+							// TODO Add the image when creating new
+							// FrameImage
+							toParse.addItem(image, true, toTransform);
+						} else if (ItemUtils.startsWithTag(i, ItemUtils.TAG_BITMAP_IMAGE) && i.getLink() != null
+								&& !i.getAbsoluteLink().equalsIgnoreCase(toParse.getName())) {
+							XRayable image = null;
+							if (i.hasEnclosures()) {
+								// image =
+								// i.getEnclosures().iterator().next();
+								// image.refresh();
+								// i.setHidden(true);
+							} else {
+								// If a new bitmap is created for a
+								// frame which already has a bitmap dont
+								// recreate the bitmap
+								image = new FrameBitmap((Text) i, null);
+							}
+							toParse.addItem(image, true, toTransform);
+						} else if (ItemUtils.startsWithTag(i, "@c")) {
+							// Can only have a @c
+							if (!i.hasEnclosures() && i.getLines().size() == 1) {
+								Circle circle = new Circle((Text) i);
+								toParse.addItem(circle, true, toTransform);
+							}
+							// Check for JSItem
+						} else if (ItemUtils.startsWithTag(i, "@js")) {
+							JSItem jsItem = new JSItem((Text) i);
+							toParse.addItem(jsItem, true, toTransform);
+							// Check for interactive widgets
+						} else if (ItemUtils.startsWithTag(i, ItemUtils.TAG_IWIDGET)) {
+							createWidget(toParse, (Text) i, toTransform);
+						}
+
+						// TODO decide exactly what to do here!!
+						toParse.addAnnotation((Text) i);
+					} else if (!DisplayController.isXRayMode() && i.hasFormula()) {
+						i.calculate(i.getFormula());
+					}
+				}
+			} catch (Exception e) {
+				Logger.Log(e);
+				e.printStackTrace();
+				System.err
+						.println("**** Have temporarily supressed MessageBay call, as resulted in infinite recursion");
+				// MessageBay.warningMessage("Exception occured when loading " +
+				// i.getClass().getSimpleName() + "(ID: "
+				// + i.getID() + ") " + e.getMessage() != null ? e.getMessage() : "");
+			}
+		}
+
+		/*
+		 * for (Item i : items) { if (i instanceof Dot) { ((Dot)
+		 * i).setPointType(pointtype); ((Dot) i).useFilledPoints(filledPoints); } }
+		 */
+
+		if (DisplayController.isTwinFramesOn()) {
+			FrameIO.ResumeCache();
+		}
+
+
+	}
+	
+	private static void generatingSupportingItems(Frame toParse, 
+			ItemsList toBuildOff, boolean ignoreAnnotations) {
+		// Get all items from toBuildOff that have not been marked as deleted.
+		List<Item> items = toParse.getItems(false, toBuildOff);
+
+		List<Overlay> overlays = new ArrayList<Overlay>();
+		List<Vector> vectors = new ArrayList<Vector>();
+
+		// disable reading of cached overlays if in twinframes mode
+		if (DisplayController.isTwinFramesOn()) {
+			FrameIO.SuspendCache();
+		}
+
+		UserAppliedPermission permission = toParse.getUserAppliedPermission();
+		// check for any new overlay items
+		for (Item i : items) {
+			try {
+				// reset overlay permission
+				i.setOverlayPermission(null);
+				if (i instanceof Text) {
 					if (i.isAnnotation()) {
-						if (ItemUtils.startsWithTag(i, ItemUtils.TAG_POINTTYPE)) {
-							Text txt = (Text) i;
-							String line = txt.getFirstLine();
-							line = ItemUtils.StripTag(line, ItemUtils.GetTag(ItemUtils.TAG_POINTTYPE));
-
-							if (line != null) {
-								line = line.toLowerCase();
-								if (line.indexOf(" ") > 0) {
-									String fill = line.substring(line.indexOf(" ") + 1);
-									if (fill.startsWith("nofill")) {
-										// filledPoints = false;
-									} else {
-										// filledPoints = true;
-									}
-								}
-
-								if (line.startsWith("circle")) {
-									// pointtype = DotType.circle;
-								} else {
-									// pointtype = DotType.square;
-								}
-							}
-						} // check for new VECTOR items
-						else if (!DisplayController.isXRayMode() && ItemUtils.startsWithTag(i, ItemUtils.TAG_VECTOR)
+						if (!DisplayController.isXRayMode() && ItemUtils.startsWithTag(i, ItemUtils.TAG_VECTOR)
 								&& i.getLink() != null) {
 							if (!i.getAbsoluteLink().equals(toParse.getName())) {
@@ -1047,59 +1090,5 @@
 							}
 						}
-						// check for Images and widgets
-						else {
-							if (!DisplayController.isXRayMode()) {
-								if (ItemUtils.startsWithTag(i, ItemUtils.TAG_IMAGE, true)) {
-									if (!i.hasEnclosures()) {
-										createPicture(toParse, (Text) i);
-									}
-									// check for frame images
-								} else if (ItemUtils.startsWithTag(i, ItemUtils.TAG_FRAME_IMAGE) && i.getLink() != null
-										&& !i.getAbsoluteLink().equalsIgnoreCase(toParse.getName())) {
-									XRayable image = null;
-									if (i.hasEnclosures()) {
-										// i.setHidden(true);
-										// image =
-										// i.getEnclosures().iterator().next();
-										// image.refresh();
-									} else {
-										image = new FrameImage((Text) i, null);
-									}
-									// TODO Add the image when creating new
-									// FrameImage
-									toParse.addItem(image);
-								} else if (ItemUtils.startsWithTag(i, ItemUtils.TAG_BITMAP_IMAGE) && i.getLink() != null
-										&& !i.getAbsoluteLink().equalsIgnoreCase(toParse.getName())) {
-									XRayable image = null;
-									if (i.hasEnclosures()) {
-										// image =
-										// i.getEnclosures().iterator().next();
-										// image.refresh();
-										// i.setHidden(true);
-									} else {
-										// If a new bitmap is created for a
-										// frame which already has a bitmap dont
-										// recreate the bitmap
-										image = new FrameBitmap((Text) i, null);
-									}
-									toParse.addItem(image);
-								} else if (ItemUtils.startsWithTag(i, "@c")) {
-									// Can only have a @c
-									if (!i.hasEnclosures() && i.getLines().size() == 1) {
-										toParse.addItem(new Circle((Text) i));
-									}
-									// Check for JSItem
-								} else if (ItemUtils.startsWithTag(i, "@js")) {
-									toParse.addItem(new JSItem((Text) i));
-									// Check for interactive widgets
-								} else if (ItemUtils.startsWithTag(i, ItemUtils.TAG_IWIDGET)) {
-									createWidget(toParse, (Text) i);
-								}
-							}
-							// TODO decide exactly what to do here!!
-							toParse.addAnnotation((Text) i);
-						}
-					} else if (!DisplayController.isXRayMode() && i.hasFormula()) {
-						i.calculate(i.getFormula());
+						
 					}
 				}
@@ -1118,5 +1107,7 @@
 		 */
 
-		FrameIO.ResumeCache();
+		if (DisplayController.isTwinFramesOn()) {
+			FrameIO.ResumeCache();
+		}
 
 		toParse.clearOverlays();
@@ -1124,5 +1115,63 @@
 		toParse.addAllOverlays(overlays);
 		toParse.addAllVectors(vectors);
-
+	}
+
+	public static void Parse(Frame toParse) {
+		Parse(toParse, false);
+	}
+
+	/**
+	 * Checks for any special Annotation items and updates the display as necessary.
+	 * Special Items: Images, overlays, sort.
+	 * 
+	 */
+	public static void Parse(Frame toParse, boolean firstParse) {
+		Parse(toParse, firstParse, false);
+	}
+
+	/**
+	 * 
+	 * @param toParse
+	 * @param firstParse
+	 * @param ignoreAnnotations
+	 *            used to prevent infinate loops such as when performing TDFC with
+	 *            an ao tag linked to a frame with an frameImage of a frame which
+	 *            also has an ao tag on it.
+	 */	
+	public static void Parse(Frame toParse, boolean firstParse, boolean ignoreAnnotations) { 
+		List<String> accessList = Label.getAccessibleLabelsNames(new ItemsList(toParse.getPrimaryBody()));
+		
+		ItemsList primaries = toParse.getPrimaryBody();
+		ItemsList surrogates = toParse.getSurrogateBody();
+		
+		transformOutOfPlaceItems(toParse, primaries);
+		transformOutOfPlaceItems(toParse, surrogates);
+		
+		toParse.getInteractableItems().clear();
+		List<Item> newBody = parseFromPrimary(primaries, accessList);
+		toParse.getBody().clear();
+		toParse.getBody().addAll(newBody);
+		generatingSupportingItems(toParse, toParse.getBody(), ignoreAnnotations);
+		
+		if (firstParse) {
+			ItemUtils.EnclosedCheck(toParse.getSortedItems());
+		}
+	}
+
+	private static List<Item> parseFromPrimary(ItemsList primaryBody, List<String> access) {
+		List<Item> parsedBody = new ArrayList<Item>();
+		
+		for (Item item: primaryBody) {
+			String encryptionLabel = item.getEncryptionLabel();
+			if (encryptionLabel == null || encryptionLabel.isEmpty()) {
+				parsedBody.add(item);
+			} else if (access.contains(encryptionLabel)) {
+				parsedBody.add(item);
+			} else {
+				parsedBody.addAll(item.getSurrogates());
+			}
+		}
+		
+		return parsedBody;
 	}
 
@@ -1225,5 +1274,5 @@
 				if (LastEdited.contains(x, y) && !FreeItems.getInstance().contains(LastEdited)
 						&& LastEdited.getParent() == DisplayController.getCurrentFrame()
-						&& LastEdited.getParent().getItems().contains(LastEdited)) {
+						&& LastEdited.getParent().getSortedItems().contains(LastEdited)) {
 					LastEdited.setOverlayPermission(UserAppliedPermission.full);
 					return LastEdited;
@@ -1412,5 +1461,5 @@
 			return null;
 		}
-		List<Item> items = current.getItems();
+		List<Item> items = current.getSortedItems();
 
 		// Remove all items that are connected to freeItems
@@ -1572,5 +1621,5 @@
 			MessageBay.suppressMessages(true);
 			int lastNumber = FrameIO.getLastNumber(defaultFrame.getFramesetName());
-			for (int i = 1; i <= lastNumber; i++) {
+			for (int i = 1; i <= lastNumber; i++) {				
 				// Load in next default, if it doesn't exist continue loop.
 				defaultFrame = FrameIO.LoadFrame(defaultFrame.getFramesetName() + i);
@@ -1670,5 +1719,5 @@
 						Frame indexFrame = FrameIO.LoadFrame(framesetName + '1');
 						// Look through the folder for help index pages
-						if (indexFrame != null && ItemUtils.FindTag(indexFrame.getItems(), "@HelpIndex") != null) {
+						if (indexFrame != null && ItemUtils.FindTag(indexFrame.getSortedItems(), "@HelpIndex") != null) {
 							// yPos += spacing;
 							yPos += 30;
Index: trunk/src/org/expeditee/gui/ItemsList.java
===================================================================
--- trunk/src/org/expeditee/gui/ItemsList.java	(revision 1415)
+++ trunk/src/org/expeditee/gui/ItemsList.java	(revision 1415)
@@ -0,0 +1,100 @@
+package org.expeditee.gui;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.function.Predicate;
+
+import org.expeditee.items.Item;
+
+/**
+ * Extends a ArrayList of Items through composition in order to keep it sorted.
+ */
+public class ItemsList implements Iterable<Item> {
+	private List<Item> items = new ArrayList<Item>();
+	private boolean sorted = true;
+	
+	public ItemsList() { }
+	
+	public ItemsList(ItemsList initialList) {
+		items.addAll(initialList.items);
+	}
+	
+	public ItemsList(Collection<Item> unsorted) {
+		items.addAll(unsorted);
+		sort();
+	}
+	
+	public void add(Item item) {
+		items.add(item);
+		sorted = false;
+	}
+	
+	public void addAll(Collection<Item> toAdd) {
+		items.addAll(toAdd);
+	}
+	
+	public void sort() {
+		if (!sorted) {
+			items.removeIf(item -> item == null);
+		}
+		Collections.sort(items);
+		sorted = true;
+	}
+
+	@Override
+	public Iterator<Item> iterator() {
+		//sort();
+		return items.iterator();
+	}
+	
+	public boolean contains(Item item) {
+		return items.contains(item);
+	}
+	
+	public int size() {
+		return items.size();
+	}
+	
+	public void invalidateSorted() {
+		sorted = false;
+	}
+	
+	public boolean remove(Item item) {
+		return items.remove(item);
+	}
+	
+	public void removeAll(ItemsList newBody) {
+		items.removeAll(newBody.items);
+	}
+	
+	public void retainHistory(ItemsList historyItems) {
+		items.retainAll(historyItems.items);
+	}
+	
+	public int indexOf(Item item) {
+		return items.indexOf(item);
+	}
+	
+	public void set(int index, Item item) {
+		items.set(index, item);
+	}
+
+	public boolean removeIf(Predicate<Item> condition) {
+		return items.removeIf(condition);
+	}	
+	
+	public Collection<Item> underlying() {
+		return items;
+	}
+	
+	public boolean isEmpty() { 
+		return items.isEmpty();
+	}
+
+	public void clear() {
+		items.clear();
+	}
+}
Index: trunk/src/org/expeditee/gui/MessageBay.java
===================================================================
--- trunk/src/org/expeditee/gui/MessageBay.java	(revision 1414)
+++ trunk/src/org/expeditee/gui/MessageBay.java	(revision 1415)
@@ -279,6 +279,21 @@
 
 		if (!displayAlways && message.equals(_lastMessage)) {
+			Item lastMessage = _messages.get(_messages.size() - 1);
+			String text = lastMessage.getText();
+			if (text.endsWith("}")) {
+				int startOfRepeat = text.lastIndexOf("{");
+				String repeatString = text.substring(startOfRepeat);
+				repeatString = repeatString.substring(1, repeatString.length() - 1);
+				try {
+					int repeatCount = Integer.parseInt(repeatString) + 1;
+					text = text.substring(0, startOfRepeat).trim() + " {" + repeatCount + "}";
+				} catch (NumberFormatException e) {
+					e.printStackTrace();
+				}
+			} else {
+				text = text.trim() + " {2}";
+			}
+			lastMessage.setText(text);
 			DisplayController.DisableMailMode();
-			Misc.beep();
 			return null;
 		}
Index: trunk/src/org/expeditee/gui/Vector.java
===================================================================
--- trunk/src/org/expeditee/gui/Vector.java	(revision 1414)
+++ trunk/src/org/expeditee/gui/Vector.java	(revision 1415)
@@ -28,5 +28,8 @@
 
 /**
- * TODO: Explain WTF this is. cts16
+ * A vector is a type of overlay with additional features:
+ * 	- a location (origin)
+ *  - size (scaled from frame)
+ *  - etc
  */
 public class Vector extends Overlay {
Index: trunk/src/org/expeditee/io/Conversion.java
===================================================================
--- trunk/src/org/expeditee/io/Conversion.java	(revision 1414)
+++ trunk/src/org/expeditee/io/Conversion.java	(revision 1415)
@@ -691,13 +691,32 @@
 			return getExpediteeColorCode((Colour) output);
 
-		// covert points
+		// convert points
 		if (output instanceof Point)
 			return ((Point) output).getX() + " " + ((Point) output).getY();
 
-		if (output instanceof Boolean)
-			if ((Boolean) output)
-				return null;
-			else
-				return "F";
+		if (output instanceof Boolean) {
+			try {
+				Class<?> parentClass = method.getDeclaringClass();
+				Field defaultValueField = parentClass.getField(method.getName() + "Default");
+				boolean defaultValue = defaultValueField.getBoolean(null);
+				if (defaultValue == (boolean) output) {
+					return null;
+				}
+			} catch (IllegalArgumentException e) {
+				e.printStackTrace();
+			} catch (SecurityException e) {
+				e.printStackTrace();
+			} catch (NoSuchFieldException e) {
+				// true is the default for boolean values when no other default is provided
+				if ((boolean) output) {
+					return null;
+				} else {
+					return "F";
+				}
+			} catch (IllegalAccessException e) {
+				e.printStackTrace();
+			}
+			return output;
+		}
 
 		if (output instanceof int[]) {
Index: trunk/src/org/expeditee/io/DefaultFrameReader.java
===================================================================
--- trunk/src/org/expeditee/io/DefaultFrameReader.java	(revision 1414)
+++ trunk/src/org/expeditee/io/DefaultFrameReader.java	(revision 1415)
@@ -181,9 +181,10 @@
 			_DelayedItemTags.add('/');
 			
-			_ItemTagsExt.put(DefaultFrameWriter.ENCRYPTION_LABEL_STR, Item.class.getMethod("setEncryptionLabel", pString));
+			_ItemTagsExt.put(DefaultFrameWriter.ENCRYPTION_LABEL_STR, Item.class.getMethod("setEncryptionLabelOnLoad", pString));
 			
 			_ItemTagsExt.put(DefaultFrameWriter.PLACEHOLDER_STR, Text.class.getMethod("setPlaceholder", pString));
 			_ItemTagsExt.put(DefaultFrameWriter.SINGLE_LINE_ONLY_STR, Text.class.getMethod("setSingleLineOnly", pBool));
 			_ItemTagsExt.put(DefaultFrameWriter.TAB_INDEX_STR, Text.class.getMethod("setTabIndex", pInt));
+			_ItemTagsExt.put(DefaultFrameWriter.ACCEPTS_ENTER, Item.class.getMethod("setAcceptsEnter", pBool));
 		} catch (Exception e) {
 			e.printStackTrace();
Index: trunk/src/org/expeditee/io/DefaultFrameWriter.java
===================================================================
--- trunk/src/org/expeditee/io/DefaultFrameWriter.java	(revision 1414)
+++ trunk/src/org/expeditee/io/DefaultFrameWriter.java	(revision 1415)
@@ -99,4 +99,5 @@
 	public static final String PLACEHOLDER_STR = "_ph";
 	public static final String ENCRYPTION_LABEL_STR = "_el";
+	public static final String ACCEPTS_ENTER = "_ae";
 	public static final String MAGNETIZED_ITEM_BOTTOM_STR = MAGNETIZED_ITEM_BOTTOM + "";
 	public static final String MAGNETIZED_ITEM_TOP_STR = MAGNETIZED_ITEM_TOP + "";
@@ -263,4 +264,5 @@
 			_ItemTagsExt.put(DefaultFrameWriter.SINGLE_LINE_ONLY_STR, Text.class.getMethod("isSingleLineOnly"));
 			_ItemTagsExt.put(DefaultFrameWriter.TAB_INDEX_STR, Text.class.getMethod("getTabIndex"));
+			_ItemTagsExt.put(DefaultFrameWriter.ACCEPTS_ENTER, Item.class.getMethod("acceptsKeyboardEnter"));
 		} catch (Exception e) {
 			e.printStackTrace();
@@ -308,5 +310,5 @@
 				this.writeAnnotationTitle(starting.getTitleItem());
 			else
-				this.writeTitle(starting.getTitleItem(), starting.getItems());
+				this.writeTitle(starting.getTitleItem(), starting.getSortedItems());
 		}
 	}
Index: trunk/src/org/expeditee/io/DefaultTreeWriter.java
===================================================================
--- trunk/src/org/expeditee/io/DefaultTreeWriter.java	(revision 1414)
+++ trunk/src/org/expeditee/io/DefaultTreeWriter.java	(revision 1415)
@@ -88,5 +88,5 @@
 	protected List<Item> getSortedItems(Frame frame) 
 	{
-		List<Item> items = frame.getItems();
+		List<Item> items = frame.getSortedItems();
 		return items;
 	}
Index: trunk/src/org/expeditee/io/JavaWriter.java
===================================================================
--- trunk/src/org/expeditee/io/JavaWriter.java	(revision 1414)
+++ trunk/src/org/expeditee/io/JavaWriter.java	(revision 1415)
@@ -61,5 +61,5 @@
 	protected List<Item> getSortedItems(Frame frame) 
 	{
-		List<Item> y_ordered_items = frame.getItems();
+		List<Item> y_ordered_items = frame.getSortedItems();
 		
 		for (Item item: y_ordered_items) {
Index: trunk/src/org/expeditee/io/PDF2Writer.java
===================================================================
--- trunk/src/org/expeditee/io/PDF2Writer.java	(revision 1414)
+++ trunk/src/org/expeditee/io/PDF2Writer.java	(revision 1415)
@@ -186,5 +186,5 @@
 		
 		Frame child;
-		for(Item i : current.getItems()) {
+		for(Item i : current.getSortedItems()) {
 			if(i.isAnnotation())
 				continue;
@@ -209,5 +209,5 @@
 			writeStartFrame(f);
     		Text title = f.getTitleItem();
-    		for(Item i : f.getItems()) {
+    		for(Item i : f.getSortedItems()) {
     			if(i != title) {
     				this.writeItem(i);
@@ -220,5 +220,5 @@
     				this.writeAnnotationTitle(title);
     			else
-    				this.writeTitle(title, f.getItems());
+    				this.writeTitle(title, f.getSortedItems());
     		}
 		}
Index: trunk/src/org/expeditee/io/TXTWriter.java
===================================================================
--- trunk/src/org/expeditee/io/TXTWriter.java	(revision 1414)
+++ trunk/src/org/expeditee/io/TXTWriter.java	(revision 1415)
@@ -42,8 +42,8 @@
 	@Override
 	protected void writeStartFrame(Frame toParse) throws IOException {
-		if (ItemUtils.ContainsTag(toParse.getItems(), "@join"))
+		if (ItemUtils.ContainsTag(toParse.getSortedItems(), "@join"))
 			_join = !_join;
 
-		if (ItemUtils.ContainsTag(toParse.getItems(), "@indent"))
+		if (ItemUtils.ContainsTag(toParse.getSortedItems(), "@indent"))
 			_indent++;
 
@@ -73,9 +73,9 @@
 	@Override
 	protected void writeEndFrame(Frame toParse) throws IOException {
-		if (ItemUtils.ContainsTag(toParse.getItems(), "@indent"))
+		if (ItemUtils.ContainsTag(toParse.getSortedItems(), "@indent"))
 			if (_indent > 0)
 				_indent--;
 
-		if (ItemUtils.ContainsTag(toParse.getItems(), "@join"))
+		if (ItemUtils.ContainsTag(toParse.getSortedItems(), "@join"))
 			_join = !_join;
 
@@ -85,5 +85,5 @@
 	@Override
 	protected void resumeFrame(Frame resuming) {
-		_join = ItemUtils.ContainsTag(resuming.getItems(), "@join");
+		_join = ItemUtils.ContainsTag(resuming.getSortedItems(), "@join");
 	}
 
Index: trunk/src/org/expeditee/io/WebParser.java
===================================================================
--- trunk/src/org/expeditee/io/WebParser.java	(revision 1414)
+++ trunk/src/org/expeditee/io/WebParser.java	(revision 1415)
@@ -366,5 +366,5 @@
 
 						frameToAddTo = FrameIO.CreateFrame(frameToAddTo.getFramesetName(), pageTitle, null);
-						frameToAddTo.removeAllItems(frameToAddTo.getItems());
+						frameToAddTo.removeAllItems(frameToAddTo.getSortedItems());
 
 						try {
Index: trunk/src/org/expeditee/io/flowlayout/DimensionExtent.java
===================================================================
--- trunk/src/org/expeditee/io/flowlayout/DimensionExtent.java	(revision 1414)
+++ trunk/src/org/expeditee/io/flowlayout/DimensionExtent.java	(revision 1415)
@@ -38,7 +38,6 @@
 	public static DimensionExtent calcMinMaxXExtent(List<Item>items)
 	{
-
 		int min_x = Integer.MAX_VALUE;
-		int max_x = Integer.MIN_VALUE;
+		int max_x = Integer.MIN_VALUE + 1; // +1 makes it safe to do math.abs on
 		
 		for (Item item : items) {
@@ -59,7 +58,6 @@
 	public static DimensionExtent calcMinMaxYExtent(List<Item>items)
 	{
-
 		int min_y = Integer.MAX_VALUE;
-		int max_y = Integer.MIN_VALUE;
+		int max_y = Integer.MIN_VALUE + 1; // +1 makes it safe to do math.abs on
 		
 		for (Item item : items) {
Index: trunk/src/org/expeditee/io/flowlayout/XGroupItem.java
===================================================================
--- trunk/src/org/expeditee/io/flowlayout/XGroupItem.java	(revision 1414)
+++ trunk/src/org/expeditee/io/flowlayout/XGroupItem.java	(revision 1415)
@@ -635,5 +635,5 @@
 		double enclosureArea = 0.0;
 
-		for (Item i : frame.getItems()) {
+		for (Item i : frame.getSortedItems()) {
 
 			// Go through all the enclosures ...
Index: trunk/src/org/expeditee/items/Circle.java
===================================================================
--- trunk/src/org/expeditee/items/Circle.java	(revision 1414)
+++ trunk/src/org/expeditee/items/Circle.java	(revision 1415)
@@ -28,5 +28,4 @@
 import org.expeditee.core.Stroke;
 import org.expeditee.core.bounds.AxisAlignedBoxBounds;
-import org.expeditee.core.bounds.CombinationBoxBounds;
 import org.expeditee.core.bounds.EllipticalBounds;
 import org.expeditee.core.bounds.PolygonBounds;
Index: trunk/src/org/expeditee/items/Dot.java
===================================================================
--- trunk/src/org/expeditee/items/Dot.java	(revision 1414)
+++ trunk/src/org/expeditee/items/Dot.java	(revision 1415)
@@ -392,5 +392,5 @@
 		// TODO is the code below needed... what for?
 		for (Line line : getLines()) {
-			if (line.getID() < 0 && !current.getItems().contains(line)) {
+			if (line.getID() < 0 && !current.getSortedItems().contains(line)) {
 				line.setID(current.getNextItemID());
 				line.setHighlightColorToDefault();
Index: trunk/src/org/expeditee/items/Item.java
===================================================================
--- trunk/src/org/expeditee/items/Item.java	(revision 1414)
+++ trunk/src/org/expeditee/items/Item.java	(revision 1415)
@@ -48,4 +48,7 @@
 import org.expeditee.core.bounds.PolygonBounds;
 import org.expeditee.encryption.items.surrogates.EncryptionDetail;
+import org.expeditee.encryption.items.surrogates.EncryptionDetail.Type;
+import org.expeditee.encryption.items.surrogates.Label;
+import org.expeditee.encryption.items.surrogates.Label.LabelResult;
 //import org.expeditee.encryption.items.surrogates.Surrogate;
 import org.expeditee.gio.EcosystemManager;
@@ -156,10 +159,10 @@
 
 	public static final Cursor.CursorType CROP_CURSOR = Cursor.CursorType.CROSSHAIR;
-
+	
 	/** The default value for integer attributes */
 	public static final int DEFAULT_INTEGER = -1;
-
+	
 	private static final int BRIGHTNESS = 185;
-
+	
 	/** Contains all dots (including this one) that form an enclosure if this dot is part of an enclosing shape. */
 	private Collection<Item> _enclosure = null;
@@ -317,4 +320,8 @@
 	
 	private Data _data = new Data();
+	
+	// Used via reflection by AttributeUtils to determine if the boolean value is different from default.
+	public static final boolean acceptsKeyboardEnterDefault = false;
+	private boolean _acceptsKeyboardEnter = acceptsKeyboardEnterDefault;
 
 	private Item surrogateFor = null;
@@ -326,4 +333,5 @@
 	
 	{
+		EncryptionDetail unencryptedOnSave = new EncryptionDetail(EncryptionDetail.Type.UnencryptedOnSave);
 		for(Character tag: DefaultFrameWriter.getItemTags().keySet()) {
 			if (tag == 'T' || tag == 'S') {
@@ -332,10 +340,10 @@
 				surrogatePropertyInheritanceDefault.put(tag + "", true);
 			}
-			primaryPropertyEncryptionDefault.put(tag + "", EncryptionDetail.UnencryptedOnSave);
+			primaryPropertyEncryptionDefault.put(tag + "", unencryptedOnSave);
 		}
 		
 		for(String tag: DefaultFrameWriter.getItemTagsExt().keySet()) {
 			surrogatePropertyInheritanceDefault.put(tag, true);
-			primaryPropertyEncryptionDefault.put(tag, EncryptionDetail.UnencryptedOnSave);
+			primaryPropertyEncryptionDefault.put(tag, unencryptedOnSave);
 		}
 	}
@@ -383,5 +391,5 @@
 		dest.setLinkTemplate(this.getLinkTemplate());
 
-		// dest.setMaxWidth(this.getMaxWidth());
+		// dest.setWidth(this.getWidth());
 
 		dest.setOffset(this.getOffset());
@@ -424,8 +432,16 @@
 		}
 		
-		final String currentUser = UserSettings.UserName.get();
-		if (parent != null && (parent.getOwner() == null || currentUser.compareTo(parent.getOwner()) != 0)) {
-			dest.setOwner(currentUser);
-		}
+		String currentUser = UserSettings.UserName.get();
+//		if (parent != null && !currentUser.equals(parent.getOwner())) {
+//			//dest.setOwner(currentUser);
+//		} else {
+//			System.err.println("I have duplicated a item and made it owned by "
+//					+ "current user, whereas the old code would not have "
+//					+ "changed ownership at this time.");
+//			System.err.println("Item: " + dest + ", Class: " + dest.getClass());
+//			System.err.println("Current owner: " + dest.getOwner());
+//			System.err.println("Current user: " + currentUser);
+//		}
+		dest.setOwner(currentUser);
 	}
 	
@@ -438,5 +454,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.DOT_TYPE_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.DOT_TYPE_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.DOT_TYPE_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -461,5 +478,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.DOT_TYPE_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.FILLED_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.FILLED_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -494,5 +512,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.DOT_TYPE_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.GRADIENT_ANGLE_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.GRADIENT_ANGLE_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -567,5 +586,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.DOT_TYPE_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.PERMISSION_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.PERMISSION_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1114,5 +1134,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.FORMULA_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.FORMULA_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.FORMULA_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1389,5 +1410,11 @@
 		if (otherBounds.equals(thisBounds)) return true;
 
-		return otherBounds.intersects(thisBounds);
+		boolean intersects = otherBounds.intersects(thisBounds);
+		
+		/*if (intersects) {
+			System.err.println("Found intersection between this item (" + this + ") with bounds: " + thisBounds + "...and...");
+			System.err.println("item with bounds: " + otherBounds.toString());
+		}*/
+		return intersects;
 
 		// Need to check the second equality so that we dont pick up circles
@@ -1523,5 +1550,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.TOOLTIP_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.TOOLTIP_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.TOOLTIP_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1827,5 +1855,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ACTION_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1847,5 +1876,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.DATA_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.DATA_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.DATA_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1863,5 +1893,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ACTION_CURSOR_ENTER_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_CURSOR_ENTER_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_CURSOR_ENTER_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1875,5 +1906,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ACTION_CURSOR_LEAVE_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_CURSOR_LEAVE_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_CURSOR_LEAVE_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1887,5 +1919,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ACTION_ENTER_FRAME_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_ENTER_FRAME_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_ENTER_FRAME_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1899,5 +1932,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ACTION_LEAVE_FRAME_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_LEAVE_FRAME_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_LEAVE_FRAME_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1914,5 +1948,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ACTION_MARK_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_MARK_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ACTION_MARK_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1947,5 +1982,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ARROW_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ARROW_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ARROW_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1985,5 +2021,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.BACKGROUND_COLOR_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.BACKGROUND_COLOR_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.BACKGROUND_COLOR_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2000,5 +2037,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.BORDER_COLOR_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.BORDER_COLOR_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.BORDER_COLOR_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2039,5 +2077,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.CONSTRAINT_IDS_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.CONSTRAINT_IDS_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.CONSTRAINT_IDS_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2068,5 +2107,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.DATE_CREATED_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.DATE_CREATED_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.DATE_CREATED_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2091,5 +2131,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.FILL_COLOR_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.FILL_COLOR_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.FILL_COLOR_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2112,5 +2153,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.GRADIENT_COLOR_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.GRADIENT_COLOR_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.GRADIENT_COLOR_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2134,5 +2176,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.FILL_PATTERN_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.FILL_PATTERN_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.FILL_PATTERN_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2156,5 +2199,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.HIGHLIGHT_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.HIGHLIGHT_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.HIGHLIGHT_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2175,5 +2219,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.TYPE_AND_ID_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.TYPE_AND_ID_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.TYPE_AND_ID_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2191,5 +2236,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LINE_IDS_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINE_IDS_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINE_IDS_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2206,5 +2252,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LINE_PATTERN_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINE_PATTERN_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINE_PATTERN_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2246,5 +2293,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LINK_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2258,5 +2306,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LINK_HISTORY_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_HISTORY_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_HISTORY_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2284,5 +2333,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LINK_FRAMESET_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_FRAMESET_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_FRAMESET_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2299,5 +2349,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LINK_MARK_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_MARK_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_MARK_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2316,5 +2367,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LINK_TEMPLATE_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_TEMPLATE_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LINK_TEMPLATE_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2350,5 +2402,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.OWNER_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.OWNER_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.OWNER_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2541,5 +2594,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.POSITION_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.POSITION_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.POSITION_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2585,5 +2639,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.THICKNESS_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.THICKNESS_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.THICKNESS_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2697,5 +2752,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.POSITION_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.POSITION_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.POSITION_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2715,5 +2771,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.POSITION_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.POSITION_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.POSITION_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2827,5 +2884,5 @@
 
 		current.addItem(this, false);
-		current.setResort(true);
+		current.invalidateSorted();
 		setRelativeLink();
 		setFloating(false);
@@ -3527,5 +3584,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_LEFT_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_LEFT_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_LEFT_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -3543,5 +3601,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_RIGHT_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_RIGHT_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_RIGHT_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -3559,5 +3618,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_TOP_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_TOP_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_TOP_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -3576,5 +3636,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_BOTTOM_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_BOTTOM_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_BOTTOM_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -3886,5 +3947,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.MAGNETIZED_ITEM_LEFT_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_LEFT_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_LEFT_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -3911,5 +3973,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.MAGNETIZED_ITEM_RIGHT_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_RIGHT_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_RIGHT_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -3936,5 +3999,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.MAGNETIZED_ITEM_TOP_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_TOP_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_TOP_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -3961,5 +4025,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.MAGNETIZED_ITEM_BOTTOM_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_BOTTOM_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.MAGNETIZED_ITEM_BOTTOM_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -3975,4 +4040,14 @@
 	
 	public void setEncryptionLabel(String label) {
+		if (this.getParent().getEncryptionLabel() == null) {
+			MessageBay.displayMessage("Items can only be entrypted if the frame they are on is.");
+			return;
+		}
+		LabelResult labelResult = Label.getLabel(label);
+		if (labelResult != LabelResult.SuccessResolveLabelToKey) {
+			MessageBay.displayMessage(labelResult.toString());
+			return;
+		}
+		
 		this._encryptionLabel = label;
 		this.getSurrogates().clear();
@@ -3980,4 +4055,8 @@
 		if (copy instanceof Text) {	copy.setText("Encrypted"); }
 		this.addToSurrogates(copy);
+	}
+	
+	public void setEncryptionLabelOnLoad(String label) {
+		this._encryptionLabel = label;
 	}
 
@@ -4006,5 +4085,5 @@
 		Frame current = dot.getParentOrCurrentFrame();
 		current.removeItem(dot);
-		ItemUtils.EnclosedCheck(current.getItems());
+		ItemUtils.EnclosedCheck(current.getSortedItems());
 		return text;
 		// TODO: Should this add the newly-created Text item to the frame? cts16
@@ -4029,5 +4108,5 @@
 		current.addItem(dot);
 		DisplayController.setCursor(Item.DEFAULT_CURSOR);
-		ItemUtils.EnclosedCheck(current.getItems());
+		ItemUtils.EnclosedCheck(current.getSortedItems());
 		return dot;
 	}
@@ -4044,10 +4123,15 @@
 		this.surrogateItems.add(surrogate);
 		surrogate.setAsSurrogateFor(this);
+		this.getParent().addItem(surrogate);
+		
+		EncryptionDetail reencryptOnSave = new EncryptionDetail(EncryptionDetail.Type.ReencryptOnSave);
+		EncryptionDetail unencryptedOnSave = new EncryptionDetail(EncryptionDetail.Type.UnencryptedOnSave);
+		EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
 		
 		for (Character tag: DefaultFrameWriter.getItemTags().keySet()) {
 			if (tag == 'T') {
-				primaryPropertyEncryption.put(tag + "", EncryptionDetail.ReencryptOnSave);
+				primaryPropertyEncryption.put(tag + "", reencryptOnSave.clone());
 			} else {
-				primaryPropertyEncryption.put(tag + "", EncryptionDetail.UnencryptedOnSave);
+				primaryPropertyEncryption.put(tag + "", unencryptedOnSave.clone());
 			}
 					
@@ -4060,5 +4144,5 @@
 		
 		for (String tag: DefaultFrameWriter.getItemTagsExt().keySet()) {
-			primaryPropertyEncryption.put(tag, EncryptionDetail.UnencryptedOnSave);
+			primaryPropertyEncryption.put(tag, inheritanceCheckOnSave.clone());
 			surrogate.surrogatePropertyInheritance.put(tag + "", true);
 		}
@@ -4077,5 +4161,6 @@
 		
 		if (encryptionDetail == null) {
-			return EncryptionDetail.UnencryptedOnSave;
+			EncryptionDetail unencryptedOnSave = new EncryptionDetail(EncryptionDetail.Type.UnencryptedOnSave);
+			return unencryptedOnSave;
 		} else {
 			return encryptionDetail;
@@ -4091,13 +4176,40 @@
 	}
 	
-
-	/**
-	 * If when setting a property, we find that the primary has a undeciphered value, when we must containue using that undeciphered value
+	public void setTagNotInherited(String tag) {
+		surrogatePropertyInheritance.put(tag, false);
+	}
+	
+	public boolean hasAccessToItemAsPrimary() {
+		String label = this.getEncryptionLabel();
+		if (this.isSurrogate() || label == null || label.length() == 0) {
+			return true;
+		}
+		
+		return Label.getLabel(label) == LabelResult.SuccessResolveLabelToKey;
+	}
+	
+
+	/**
+	 * If when setting a property, we find that the primary has a undeciphered value, when we must continue using that undeciphered value
 	 * when eventually saving.
 	 * @return
 	 */
 	protected boolean subjectToInheritanceCheckOnSave(String tag) {
-		if (getPrimary() == null) return false;
-		return getPrimary().primaryPropertyEncryption.get(tag) != EncryptionDetail.UseUndecipheredValueOnSave;
+		Item primary = getPrimary();
+		if (primary == null) return false;
+		EncryptionDetail primaryItemTagEncryptionDetail = primary.primaryPropertyEncryption.get(tag);
+		Type primaryItemTagEncryptionDetailType = primaryItemTagEncryptionDetail.getEncryptionDetailType();
+		return primaryItemTagEncryptionDetailType != EncryptionDetail.Type.UseUndecipheredValueOnSave;
+	}
+
+	public boolean acceptsKeyboardEnter() {
+		return _acceptsKeyboardEnter;
+	}
+		
+	public void setAcceptsEnter(boolean value) {
+		if (this.getText() != null && this.getText().equals("Beep")) {
+			System.err.println();
+		}
+		_acceptsKeyboardEnter = value;
 	}
 }
Index: trunk/src/org/expeditee/items/ItemUtils.java
===================================================================
--- trunk/src/org/expeditee/items/ItemUtils.java	(revision 1414)
+++ trunk/src/org/expeditee/items/ItemUtils.java	(revision 1415)
@@ -616,5 +616,5 @@
 			Item start = lineEndMap.get(c.getStart());
 			Item end = lineEndMap.get(c.getEnd());
-			int id = DisplayController.getCurrentFrame().getNextItemID();
+			int id = start.getParent().getNextItemID();
 			if (start != null && end != null) {
 				new Constraint(start, end, id, c.getType());
@@ -748,9 +748,9 @@
 
 	public static void New() {
-		EnclosedCheck(DisplayController.getCurrentFrame().getItems());
+		EnclosedCheck(DisplayController.getCurrentFrame().getSortedItems());
 	}
 
 	public static void Old() {
-		OldEnclosedCheck(DisplayController.getCurrentFrame().getItems());
+		OldEnclosedCheck(DisplayController.getCurrentFrame().getSortedItems());
 	}
 
@@ -1098,6 +1098,6 @@
 			return;
 		}
-		EnclosedCheck(frame.getItems());
-		Justify(frame.getItems());
+		EnclosedCheck(frame.getSortedItems());
+		Justify(frame.getSortedItems());
 	}
 }
Index: trunk/src/org/expeditee/items/Text.java
===================================================================
--- trunk/src/org/expeditee/items/Text.java	(revision 1414)
+++ trunk/src/org/expeditee/items/Text.java	(revision 1415)
@@ -409,5 +409,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.WIDTH_TO_SAVE_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.WIDTH_TO_SAVE_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.WIDTH_TO_SAVE_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -432,5 +433,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.MIN_WIDTH_TO_SAVE_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.MIN_WIDTH_TO_SAVE_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.MIN_WIDTH_TO_SAVE_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -453,4 +455,6 @@
 			return this.getPrimary().getWidth();
 		} else {
+			if (_width == null || _width <= 0)
+				return null;
 			return _width;
 		}
@@ -458,8 +462,11 @@
 
 	public Integer getAbsoluteWidth() {
-		if (_width == null) {
+		if (_width == null || _width == Integer.MIN_VALUE) {
+			// When absoluting Integer.MIN_VALUE, the java API is defined to give you back Integer.MIN_VALUE!!?!
+			// This is because of the asymmetry of two's complement integer representation.
+			// We would prefer to use Integer.MAX_VALUE in this circumstance.
 			return Integer.MAX_VALUE;
 		}
-
+		
 		return Math.abs(_width);
 	}
@@ -469,4 +476,6 @@
 			return this.getPrimary().getMinWidth();
 		} else {
+			if (_minWidth == null || _minWidth <= 0)
+				return null;
 			return _minWidth;
 		}
@@ -513,5 +522,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.JUSTIFICATION_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.JUSTIFICATION_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.JUSTIFICATION_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -694,5 +704,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.TEXT_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.TEXT_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.TEXT_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1327,10 +1338,11 @@
 
 		invalidateAll();
-		
+				
 		if (isSurrogate()) {
 			surrogatePropertyInheritance.put(DefaultFrameWriter.FONT_STR, false);
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.FONT_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.FONT_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.FONT_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1554,5 +1566,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.SPACING_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.SPACING_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.SPACING_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1595,5 +1608,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.WORD_SPACING_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.WORD_SPACING_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.WORD_SPACING_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1626,5 +1640,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LETTER_SPACING_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LETTER_SPACING_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.LETTER_SPACING_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1650,5 +1665,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.INITIAL_SPACING_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.INITIAL_SPACING_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.INITIAL_SPACING_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -1777,8 +1793,8 @@
 
 		int minX = Integer.MAX_VALUE;
-		int maxX = Integer.MIN_VALUE;
+		int maxX = Integer.MIN_VALUE + 1; // +1 makes it safe to do math.abs on
 
 		int minY = Integer.MAX_VALUE;
-		int maxY = Integer.MIN_VALUE;
+		int maxY = Integer.MIN_VALUE + 1; // +1 makes it safe to do math.abs on
 
 		float y = -1;
@@ -1892,5 +1908,5 @@
 				return;
 			}
-			for (Item item : DisplayController.getCurrentFrame().getItems()) {
+			for (Item item : DisplayController.getCurrentFrame().getSortedItems()) {
 				if (item instanceof Line) {
 					lines.add(new org.expeditee.core.Line(((Line) item).getStartItem().getPosition(),
@@ -1914,5 +1930,5 @@
 		}
 
-		float width = Float.MAX_VALUE;
+		float width = (float) Integer.MAX_VALUE;
 		if (limitWidth) {
 			if (_width == null) {
@@ -1945,5 +1961,5 @@
 							paintFont,
 							new Point(getX(), getY()), lines != null ? lines.toArray(new org.expeditee.core.Line[1]) : null,
-							paintFont.getSize() > MINIMUM_FONT_SIZE ? (int) width : (int) Float.MAX_VALUE, 
+							paintFont.getSize() > MINIMUM_FONT_SIZE ? (int) width : Integer.MAX_VALUE, 
 							(int) getSpacing(), 
 							true, 
@@ -2553,5 +2569,5 @@
 				Integer width = getWidth();
 				if (width == null || width < 0) {
-					setWidth(Integer.MIN_VALUE + 1);
+					setWidth(Integer.MIN_VALUE + 1); // +1 makes it safe to do math.abs on
 				}
 			} else if (frameWidth - getX() > ADJUST_WIDTH_THRESHOLD) {
@@ -2866,5 +2882,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_LEFT_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_LEFT_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_LEFT_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2900,5 +2917,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_RIGHT_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_RIGHT_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_RIGHT_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2941,5 +2959,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_TOP_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_TOP_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_TOP_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -2987,5 +3006,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_BOTTOM_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_BOTTOM_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_BOTTOM_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -3101,8 +3121,8 @@
 	//
 	// int min_xl = Integer.MAX_VALUE;
-	// int max_xr = Integer.MIN_VALUE;
+	// int max_xr = Integer.MIN_VALUE + 1; // +1 makes it safe to do math.abs on
 	//
 	// int min_yt = Integer.MAX_VALUE;
-	// int max_yb = Integer.MIN_VALUE;
+	// int max_yb = Integer.MIN_VALUE + 1; // +1 makes it safe to do math.abs on
 	//
 	//
@@ -3168,5 +3188,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.AUTO_WRAP_TO_SAVE_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.AUTO_WRAP_TO_SAVE_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.AUTO_WRAP_TO_SAVE_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -3307,5 +3328,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.MASK_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.MASK_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.MASK_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -3330,5 +3352,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.PLACEHOLDER_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.PLACEHOLDER_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.PLACEHOLDER_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -3360,5 +3383,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.SINGLE_LINE_ONLY_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.SINGLE_LINE_ONLY_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.SINGLE_LINE_ONLY_STR, inheritanceCheckOnSave);
 			}
 		}
@@ -3380,5 +3404,6 @@
 			Item primary = getPrimary();
 			if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.TAB_INDEX_STR)) {
-				primary.primaryPropertyEncryption.put(DefaultFrameWriter.TAB_INDEX_STR, EncryptionDetail.InheritanceCheckOnSave);
+				EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
+				primary.primaryPropertyEncryption.put(DefaultFrameWriter.TAB_INDEX_STR, inheritanceCheckOnSave);
 			}
 		}
Index: trunk/src/org/expeditee/items/XRayable.java
===================================================================
--- trunk/src/org/expeditee/items/XRayable.java	(revision 1414)
+++ trunk/src/org/expeditee/items/XRayable.java	(revision 1415)
@@ -26,5 +26,4 @@
 import org.expeditee.core.Point;
 import org.expeditee.gui.DisplayController;
-import org.expeditee.gui.FrameGraphics;
 
 public abstract class XRayable extends Item {
Index: trunk/src/org/expeditee/network/FrameShare.java
===================================================================
--- trunk/src/org/expeditee/network/FrameShare.java	(revision 1414)
+++ trunk/src/org/expeditee/network/FrameShare.java	(revision 1415)
@@ -414,5 +414,5 @@
 		
 		List<File> imageFiles = new LinkedList<File>();
-		for(Item i : toSave.getItems()) {
+		for(Item i : toSave.getSortedItems()) {
 			if(i instanceof Picture) {
 				((Picture) i).moveToImagesFolder();
Index: trunk/src/org/expeditee/setting/ArraySetting.java
===================================================================
--- trunk/src/org/expeditee/setting/ArraySetting.java	(revision 1414)
+++ trunk/src/org/expeditee/setting/ArraySetting.java	(revision 1415)
@@ -37,11 +37,9 @@
 	}
 
-    	public T getSafe(int i) {
-		
-		if(i < _value.length){
-			
+    public T getSafe(int i) {
+		if(i < _value.length) {	
 			return _value[i];
 		}
-		else{
+		else {
 			return _default[i];
 		}		
@@ -71,27 +69,34 @@
 		
 		if (_value.length > 0) {
-			Frame arrayFrame = FrameIO.CreateFrame(frameset, null, null);
-			arrayFrame.getTitleItem().delete();
-			
-			int x = 100;
-			int y = 100;
-			for (T v: _value) {
-				if (v == null) continue;
-				Text representation;
-				if (v instanceof Representable) {
-					representation = ((Representable) v).generateRepresentation("Array Entry", "");
-					representation.setPosition(x, y);
-					representation.setID(arrayFrame.getNextItemID());
-					arrayFrame.addItem(representation);
-				} else {
-					representation = arrayFrame.addText(x, y, v.toString(), null);
-				}
-				y += representation.getBoundsHeight();
-			}
-			FrameIO.ForceSaveFrame(arrayFrame);
-			t.setLink(arrayFrame.getName());
+			createChildFrame(frameset, t, null);
 		}
 		
 		return t;
 	}
+
+	protected void createChildFrame(String frameset, Text t, String frameTitle) {
+		Frame arrayFrame = FrameIO.CreateFrame(frameset, frameTitle, null);
+		
+		if (frameTitle != null) {
+			arrayFrame.getTitleItem().delete();
+		}
+		
+		int x = 100;
+		int y = 100;
+		for (T v: _value) {
+			if (v == null) continue;
+			Text representation;
+			if (v instanceof Representable) {
+				representation = ((Representable) v).generateRepresentation("Array Entry", "");
+				representation.setPosition(x, y);
+				representation.setID(arrayFrame.getNextItemID());
+				arrayFrame.addItem(representation);
+			} else {
+				representation = arrayFrame.addText(x, y, v.toString(), null);
+			}
+			y += representation.getBoundsHeight();
+		}
+		FrameIO.ForceSaveFrame(arrayFrame);
+		t.setLink(arrayFrame.getName());
+	}
 }
Index: trunk/src/org/expeditee/settings/Settings.java
===================================================================
--- trunk/src/org/expeditee/settings/Settings.java	(revision 1414)
+++ trunk/src/org/expeditee/settings/Settings.java	(revision 1415)
@@ -21,4 +21,5 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -30,4 +31,6 @@
 import org.expeditee.gui.FrameCreator;
 import org.expeditee.gui.MessageBay;
+import org.expeditee.items.Item;
+import org.expeditee.items.ItemParentStateChangedEvent;
 import org.expeditee.items.Text;
 import org.expeditee.items.widgets.Password;
@@ -194,5 +197,7 @@
 						}
 
-						if(s == null) continue;
+						if(s == null) {
+							continue;
+						}
 						
 						if(validPages.size() > 1) {
@@ -226,4 +231,11 @@
         }
 		
+		// Having parsed this page, we must alter all the items on the frame that they are no longer being shown.
+		// For things such as WidgetCorners, this means that they will be removed from live consideration.
+		Collection<Item> allItems = child.getAllItems();
+		for (Item i: allItems) {
+			i.onParentStateChanged(new ItemParentStateChangedEvent(child, ItemParentStateChangedEvent.EVENT_TYPE_HIDDEN));
+		}
+		
 		// if the page was a settings page, check if it has any subpages
 		for(Text t : child.getTextItems()) {
@@ -275,4 +287,5 @@
 			int x = 0, y = 0;
 			
+			Frame currentFrame = frames.getCurrentFrame();
 			if (key.toLowerCase().equals("pass")) {
 				// Special case for Password widgets
@@ -280,6 +293,6 @@
 				Password pw = new Password(passwordWidgetText, null);
 				pw.setPassword("");
-				frames.getCurrentFrame().removeItem(passwordWidgetText);
-				frames.getCurrentFrame().addAllItems(pw.getItems());
+				currentFrame.removeItem(passwordWidgetText);
+				currentFrame.addAllItems(pw.getItems());
 				x = passwordWidgetText.getX() + passwordWidgetText.getBoundsWidth();
 				y = passwordWidgetText.getY();
@@ -291,9 +304,14 @@
 				// Construct and add text representation for setting.  
 				// If a setting has no initialised value then it is not included.
-				Text settingRepresentation = setting.generateRepresentation(key, frames.getCurrentFrame().getFramesetName()).copy();
-				if (settingRepresentation.getBounds() == null) {
+				String framesetName = currentFrame.getFramesetName();
+				Text template = setting.generateRepresentation(key, framesetName);
+				if (template == null) {
 					continue;
 				}
-				settingRepresentation.setID(frames.getCurrentFrame().getNextItemID());
+				Text settingRepresentation = template.copy();
+				if (settingRepresentation == null || settingRepresentation.getBounds() == null) {
+					continue;
+				}
+				settingRepresentation.setID(currentFrame.getNextItemID());
 				frames.addItem(settingRepresentation, false);				
 				x = settingRepresentation.getX() + settingRepresentation.getBoundsWidth();
@@ -303,5 +321,5 @@
 			x = Math.max(250, x + 20);
 			// Add tooltip for setting
-			Text tooltip = frames.getCurrentFrame().addText(x, y, "// " + setting.getTooltip(), null);
+			Text tooltip = currentFrame.addText(x, y, "// " + setting.getTooltip(), null);
 			tooltip.rebuild(true);
 			if (tooltip.getY() + tooltip.getBoundsHeight() > frames.getLastY()) {
Index: trunk/src/org/expeditee/settings/UserSettings.java
===================================================================
--- trunk/src/org/expeditee/settings/UserSettings.java	(revision 1414)
+++ trunk/src/org/expeditee/settings/UserSettings.java	(revision 1415)
@@ -283,55 +283,4 @@
 	}
 
-//	public static void appendDefaultFolders() {
-//		if (PublicAndPrivateResources && AuthenticatorBrowser.isAuthenticated()) {
-//			// The comments here explain how things have changed with the new regime.
-//			// FrameDirs
-//			// 1. PROFILE_PATH					Still points to same place.
-//			// 2. SHARED_FRAMESETS_PATH			Still points to same place. (encryption stops just anyone reading it)
-//			// 3. framesets-<username>			Generated on user account creation and must be refreshed on user switching.  Also gives access to tutorial stuffs.
-//			// 4. FRAME_PATH					<expeditee-home>\resources-public\framesets.
-//			// 5. HELP_PUBLIC_PATH				<expeditee-home>\resources-public\documentation.
-//			// 6. MESSAGES_PATH					Still points to same place.  Should these be per user and encrypted?
-//			// 7. PUBLIC_PATH					Still points to same place.  Kept for compatibility.
-//			FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.PROFILE_PATH);
-//			FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.FRAME_PRIVATE_PATH);
-//			FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.SHARED_FRAMESETS_PATH);
-//			FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.FRAME_PATH);
-//			FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.RESOURCES_PATH);
-//			FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.MESSAGES_PATH);
-//			FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.PUBLIC_PATH);
-//			FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.HELP_PRIVATE_PATH);
-//			FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.MAIL_PATH);
-//			FolderSettings.FrameDirs.setDefault(FolderSettings.FrameDirs.get());
-//						
-//			// ImageDirs
-//			// 1. resources-<username>\images	Generated on user account creation and must be refreshed on user switching.
-//			// 2. IMAGES_PATH					<expeditee-home>\resources-public\images
-//			FolderSettings.ImageDirs.addAbsoluteDir(FrameIO.IMAGES_PRIVATE_PATH);
-//			FolderSettings.ImageDirs.addAbsoluteDir(FrameIO.IMAGES_PATH);
-//			FolderSettings.ImageDirs.setDefault(FolderSettings.ImageDirs.get());
-//			
-//			FolderSettings.AudioDirs.addAbsoluteDir(FrameIO.AUDIO_PRIVATE_PATH);
-//			FolderSettings.AudioDirs.addAbsoluteDir(FrameIO.AUDIO_PATH);
-//			FolderSettings.AudioDirs.setDefault(FolderSettings.AudioDirs.get());
-//		} else {
-//			FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.FRAME_PATH);
-//			FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.PUBLIC_PATH);
-//			FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.PROFILE_PATH);
-//			FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.HELP_PATH);
-//			FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.MESSAGES_PATH);
-//			if (FrameIO.FRAME_PRIVATE_PATH != null) {
-//				FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.FRAME_PRIVATE_PATH);
-//			}
-//			FolderSettings.FrameDirs.setDefault(FolderSettings.FrameDirs.get());
-//			
-//			FolderSettings.ImageDirs.addAbsoluteDir(FrameIO.IMAGES_PATH);
-//			FolderSettings.ImageDirs.setDefault(FolderSettings.ImageDirs.get());
-//			
-//			FolderSettings.AudioDirs.addAbsoluteDir(FrameIO.AUDIO_PATH);
-//			FolderSettings.AudioDirs.setDefault(FolderSettings.AudioDirs.get());
-//		}
-//	}
-
 	/**
 	 * Find the appropriate directory to store application settings in for
Index: trunk/src/org/expeditee/settings/identity/secrets/KeyList.java
===================================================================
--- trunk/src/org/expeditee/settings/identity/secrets/KeyList.java	(revision 1414)
+++ trunk/src/org/expeditee/settings/identity/secrets/KeyList.java	(revision 1415)
@@ -1,8 +1,14 @@
 package org.expeditee.settings.identity.secrets;
 
+import java.util.List;
+import java.util.function.Predicate;
+
+import org.expeditee.gui.Frame;
 import org.expeditee.items.Text;
+import org.expeditee.setting.ArraySetting;
 import org.expeditee.setting.TextSetting;
 
 public class KeyList {
+	
 	public static final TextSetting PersonalKey = new TextSetting("The AES key used to secure your profile frame - do not share with anyone!", "PersonalKey") {	
 		@Override
@@ -20,3 +26,34 @@
 		}
 	};
+	
+	public static final ArraySetting<Text> UserLabels = new ArraySetting<Text>("The labels (and their associated keys) that you have either created or recieved.", 
+			"UserLabels", new Text[] { }) {
+		
+		@Override
+		public boolean setSetting(Text text) {
+			Frame child = text.getChild();
+    		if (child == null) {
+    			return false;
+    		}
+    		
+    		Predicate<Text> hasNoData = t -> { 
+    			List<String> data = t.getData();
+    			return data == null || data.isEmpty();
+    		};
+    		List<Text> textItems = child.getBodyTextItems(false);
+    		textItems.removeIf(hasNoData);
+    		_value = textItems.toArray(new Text[] {});
+    		
+    		return true;
+		}
+		
+		@Override
+		public Text generateRepresentation(String label, String frameset) {
+			Text t = new Text(label);
+			
+			createChildFrame(frameset, t, "My Labels");
+			
+			return t;
+		}
+	};
 }
Index: trunk/src/org/expeditee/stats/TreeStats.java
===================================================================
--- trunk/src/org/expeditee/stats/TreeStats.java	(revision 1414)
+++ trunk/src/org/expeditee/stats/TreeStats.java	(revision 1415)
@@ -57,5 +57,5 @@
 		_treeFrames = 1;
 		// Now get all add all the trees for linked items
-		for (Item i : topFrame.getItems()) {
+		for (Item i : topFrame.getSortedItems()) {
 			String link = i.getAbsoluteLink();
 			if (link == null)
