Index: trunk/src/org/expeditee/gui/Frame.java
===================================================================
--- trunk/src/org/expeditee/gui/Frame.java	(revision 1505)
+++ trunk/src/org/expeditee/gui/Frame.java	(revision 1506)
@@ -47,5 +47,7 @@
 import org.expeditee.core.Image;
 import org.expeditee.core.bounds.PolygonBounds;
+import org.expeditee.encryption.io.EncryptedExpWriter;
 import org.expeditee.encryption.items.EncryptionPermissionTriple;
+import org.expeditee.encryption.items.UserAppliedEncryptionPermission;
 import org.expeditee.encryption.items.surrogates.Label;
 import org.expeditee.encryption.items.surrogates.Label.LabelInfo;
@@ -195,6 +197,6 @@
 
 	private String _encryptionLabel;
-	
 	private String _homogeneousEncryptionLabel;
+	private List<String> _hetrogeneousEncryptionLabels = new ArrayList<String>();	
 	
 	private String _groupFrameName;
@@ -3007,4 +3009,36 @@
 	
 	public void setFrameEncryptionLabel(String label) {
+		if (label == null) {
+			_encryptionLabel = null;
+			return;
+		}
+		
+		String errorMessage = "You do not have sufficient permissions to set the encryption label to " + label + " on frame " + getName();
+		UserAppliedEncryptionPermission p = getFrameEncryptionPermission().getPermission(this.getOwner(), this.getGroupMembers());
+		String homogeneousEncryptionLabel = getHomogeneousEncryptionLabel();
+		if (homogeneousEncryptionLabel == null) { homogeneousEncryptionLabel = getFrameEncryptionLabel(); }
+		if (homogeneousEncryptionLabel == null) { homogeneousEncryptionLabel = EncryptedExpWriter.getLabelNone(); } 
+		
+		List<String> hetrogeneousFrameOwnerLabels = getHetrogeneousFrameOwnerLabels();
+		
+		switch (p) {
+		case none:
+			MessageBay.displayMessage(errorMessage);
+			return;
+		case homogeneous: 
+			if (!homogeneousEncryptionLabel.equals(label)) {
+				MessageBay.displayMessage(errorMessage);
+				return;
+			}
+			break;
+		case hetrogeneous_owner:
+			if (!homogeneousEncryptionLabel.equals(label) && !hetrogeneousFrameOwnerLabels.contains(label)) {
+				MessageBay.displayMessage(errorMessage);
+				return;
+			}
+			break;
+		case hetrogeneous: break;
+		}
+		
 		LabelInfo labelResult = Label.getLabel(label);
 		boolean isProfileOrNone = label.equals("Profile") || label.equals("None");
@@ -3018,6 +3052,14 @@
 		_encryptionLabel = label;
 	}
+
+	public boolean hasEncryptionPermissionOrHigher(UserAppliedEncryptionPermission permissionLevel) {
+		UserAppliedEncryptionPermission p = getFrameEncryptionPermission().getPermission(this.getOwner(), this.getGroupMembers());
+		return p.ordinal() >= permissionLevel.ordinal();
+	}
 	
 	public EncryptionPermissionTriple getFrameEncryptionPermission() {
+		if (_frameEncryptionPermission == null) {
+			_frameEncryptionPermission = EncryptionPermissionTriple.convertString("300");
+		}
 		return _frameEncryptionPermission;
 	}
@@ -3029,4 +3071,27 @@
 	public String getHomogeneousEncryptionLabel() {
 		return _homogeneousEncryptionLabel;
+	}
+	
+	public List<String> getHetrogeneousFrameOwnerLabels() {
+		if (_hetrogeneousEncryptionLabels == null) {
+			_hetrogeneousEncryptionLabels = new ArrayList<String>();
+		}
+		return _hetrogeneousEncryptionLabels;
+	}
+	
+	public void addToHetrogeneousFrameOwnerLabels(String label) {
+		if (!UserSettings.UserName.get().equals(this.getOwner())) {
+			MessageBay.displayMessage("Only the owner of a frame is able to add hetrogeneous owner encryption labels.");
+			return;
+		}
+		
+		if (_hetrogeneousEncryptionLabels == null) {
+			_hetrogeneousEncryptionLabels = new ArrayList<String>();
+		}
+		if (_hetrogeneousEncryptionLabels.contains(label)) {
+			_hetrogeneousEncryptionLabels.remove(label);
+		} else {
+			_hetrogeneousEncryptionLabels.add(label);
+		}
 	}
 	
@@ -3036,6 +3101,5 @@
 		if (!isProfileOrNone && !labelResult.is(LabelResult.SuccessResolveLabelToKey)) {
 			MessageBay.displayMessage(labelResult.toString());
-			this._homogeneousEncryptionLabel = null;
-			return;
+			MessageBay.displayMessage("You will not be able to set the FrameEncryptionLabel to the Homogeneous Label.");
 		}
 		
