Search in sources :

Example 1 with TextSegment

use of nitf.TextSegment in project imageio-ext by geosolutions-it.

the class NITFImageWriter method addTextSegment.

/**
 * Add a new text Segment to the record with the information provided by the {@link TextWrapper} instance
 *
 * @param record
 * @param wrapper
 * @throws NITFException
 */
private void addTextSegment(Record record, List<TextWrapper> texts) throws NITFException {
    if (texts != null && !texts.isEmpty()) {
        for (TextWrapper wrapper : texts) {
            TextSegment text = record.newTextSegment();
            TextSubheader textSubHeader = text.getSubheader();
            NITFUtilities.setField("TEXTID", textSubHeader.getTextID(), wrapper.getId());
            NITFUtilities.setField("TXTITL", textSubHeader.getTitle(), wrapper.getTitle());
            NITFUtilities.setField("TXTALVL", textSubHeader.getAttachmentLevel(), wrapper.getAttachmentLevel());
            NITFUtilities.setField("TSCLSY", textSubHeader.getSecurityGroup().getClassificationSystem(), wrapper.getSecurityClassificationSystem());
            NITFUtilities.setField("TXTDT", textSubHeader.getDateTime(), wrapper.getDateTime());
            NITFUtilities.setField("ENCRYP", textSubHeader.getEncrypted(), Integer.toString(wrapper.getEncrypted()));
            NITFUtilities.setField("TXTFMT", textSubHeader.getFormat(), wrapper.getFormat());
        }
    }
}
Also used : TextSubheader(nitf.TextSubheader) TextWrapper(it.geosolutions.imageio.plugins.nitronitf.wrapper.TextWrapper) TextSegment(nitf.TextSegment)

Aggregations

TextWrapper (it.geosolutions.imageio.plugins.nitronitf.wrapper.TextWrapper)1 TextSegment (nitf.TextSegment)1 TextSubheader (nitf.TextSubheader)1