Ignore:
Timestamp:
08/07/19 14:14:42 (5 years ago)
Author:
bln4
Message:

New piping and functionality implementation to support the encrypting of images.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/Item.java

    r1426 r1427  
    4747import org.expeditee.core.bounds.EllipticalBounds;
    4848import org.expeditee.core.bounds.PolygonBounds;
     49import org.expeditee.encryption.core.EncryptedImage;
    4950import org.expeditee.encryption.items.surrogates.EncryptionDetail;
    5051import org.expeditee.encryption.items.surrogates.EncryptionDetail.Type;
     
    40494050                }
    40504051               
     4052                //Setup surrogate items.
    40514053                Item copy = this.copy();
    40524054                if (copy.isAnnotation()) {
     
    40754077                        copy.setText("Encrypted");
    40764078                }
     4079               
     4080                // Encrypt XRayables representative files and update pointer.
     4081                Collection<? extends XRayable> xrayables = this.getEnclosures();
     4082                for (XRayable xray: xrayables) {
     4083                        if (xray instanceof Picture) {
     4084                                EncryptedImage.encryptImage((Picture) xray, labelResult.key);
     4085                                Text source = xray._source;
     4086                                String oldName = xray.getName();
     4087                                String newName = oldName.substring(0, oldName.lastIndexOf('.')) + EncryptedImage.EXPEDITEE_ENCRYPTED_IMAGE_EXTENSION;
     4088                                source.setText(source.getText().replace(oldName, newName));
     4089                        }
     4090                }
     4091               
    40774092                this.addToSurrogates(copy);
    40784093        }
Note: See TracChangeset for help on using the changeset viewer.