Changeset 1477 for trunk/src/org/expeditee/items
- Timestamp:
- 12/03/19 15:29:07 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.