- Timestamp:
- 12/03/19 15:29:07 (4 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Misc.java
r1468 r1477 86 86 public class Misc { 87 87 88 89 public static String keyCharacter() {90 return "\uD83D\uDD11";91 }92 93 88 /** 94 89 * Causes the system to beep -
trunk/src/org/expeditee/gui/AttributeUtils.java
r1430 r1477 336 336 _Attrib.put("EnterClick", Item.class.getMethod("acceptsKeyboardEnter"), 337 337 Item.class.getMethod("setAcceptsEnter", pBool)); 338 _Attrib.put("KeyImage", Item.class.getMethod("keyType"), 339 Item.class.getMethod("setKeyType", pString)); 338 340 339 341 // Aliases for attribute setting -
trunk/src/org/expeditee/gui/Frame.java
r1460 r1477 47 47 import org.expeditee.encryption.items.EncryptionPermissionTriple; 48 48 import org.expeditee.encryption.items.surrogates.Label; 49 import org.expeditee.encryption.items.surrogates.Label.LabelInfo; 50 import org.expeditee.encryption.items.surrogates.Label.LabelResult; 49 51 import org.expeditee.gio.EcosystemManager; 50 52 import org.expeditee.gio.gesture.Gesture; … … 2986 2988 2987 2989 public void setEncryptionLabel(String label) { 2990 LabelInfo labelResult = Label.getLabel(label); 2991 boolean isProfileOrNone = label.equals("Profile") || label.equals("None"); 2992 if (!isProfileOrNone && !labelResult.is(LabelResult.SuccessResolveLabelToKey)) { 2993 MessageBay.displayMessage(labelResult.toString()); 2994 this._encryptionLabel = null; 2995 return; 2996 } 2997 2988 2998 this.setChanged(true); 2989 2999 _encryptionLabel = label; -
trunk/src/org/expeditee/items/Item.java
r1466 r1477 40 40 import org.expeditee.core.Dimension; 41 41 import org.expeditee.core.Fill; 42 import org.expeditee.core.Font; 42 43 import org.expeditee.core.GradientFill; 43 44 import org.expeditee.core.Point; … … 48 49 import org.expeditee.core.bounds.PolygonBounds; 49 50 import org.expeditee.encryption.core.EncryptedImage; 51 import org.expeditee.encryption.items.KeyType; 50 52 import org.expeditee.encryption.items.surrogates.EncryptionDetail; 51 53 import org.expeditee.encryption.items.surrogates.EncryptionDetail.Type; … … 332 334 protected Map<String, EncryptionDetail> primaryPropertyEncryption = new HashMap<String, EncryptionDetail>(primaryPropertyEncryptionDefault); 333 335 protected Map<String, Boolean> surrogatePropertyInheritance = new HashMap<String, Boolean>(surrogatePropertyInheritanceDefault); 336 337 private KeyType keyType = KeyType.NotAKey; 334 338 335 339 { … … 3116 3120 protected void paintLink() { 3117 3121 paintLinkGraphic(getX() - LEFT_MARGIN, getY() + getLinkYOffset()); 3122 paintKeyGraphic(getX() - LEFT_MARGIN, getY() + getLinkYOffset()); 3123 paintPadlockGraphic(getX() - LEFT_MARGIN, getY() + getLinkYOffset()); 3118 3124 } 3119 3125 … … 3175 3181 3176 3182 g.setAntialiasing(false); 3183 } 3184 } 3185 3186 protected void paintKeyGraphic(int x, int y) { 3187 Colour fontColour = null; 3188 switch (this.keyType()) { 3189 case PartialKey: 3190 fontColour = Colour.LIGHT_GRAY; 3191 break; 3192 case FullKey: 3193 fontColour = Colour.BLACK; 3194 break; 3195 default: 3196 return; 3197 } 3198 3199 GraphicsManager g = EcosystemManager.getGraphicsManager(); 3200 g.setAntialiasing(true); 3201 Font font = new Font(); 3202 g.drawString("\uD83D\uDD11", new Point(x,y), font, fontColour); 3203 g.setAntialiasing(false); 3204 } 3205 3206 protected void paintPadlockGraphic(int x, int y) { 3207 String encryptionLabel = this.getEncryptionLabel(); 3208 if (encryptionLabel != null && encryptionLabel.length() > 0) { 3209 GraphicsManager g = EcosystemManager.getGraphicsManager(); 3210 g.setAntialiasing(true); 3211 Font font = new Font(); 3212 g.drawString("\uD83D\uDD12", new Point(x,y), font, Colour.BLACK); 3213 g.setAntialiasing(false); 3214 } 3215 } 3216 3217 public KeyType keyType() { 3218 return keyType; 3219 } 3220 3221 public void setKeyType(String s) { 3222 try { 3223 keyType = KeyType.valueOf(s); 3224 } catch (IllegalArgumentException e) { 3225 keyType = KeyType.NotAKey; 3177 3226 } 3178 3227 }
Note:
See TracChangeset
for help on using the changeset viewer.