Class Comment_Document

  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.PlainDocument
          extended by HiRISE.HiPlan.Utilities.Comment_Document
All Implemented Interfaces:
Serializable, Document

public class Comment_Document
extends PlainDocument

A plain document that converts input text into text suitable for the PTF comment field. Only ASCII characters between decimal 32 and decimal 126, inclusive, are allowed; other characters are removed from the input. Double-quotes are converted to single quotes, since the PTF format disallows double-quotes. Note that newlines and tabs are outside the allowed range.

Christian Schaller - UA/PIRL
See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
Field Summary
static String ID
          Class identification name with source code version and date.
Fields inherited from class javax.swing.text.PlainDocument
lineLimitAttribute, tabSizeAttribute
Fields inherited from class javax.swing.text.AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
Constructor Summary
          Creates a new Comment_Document using the PlainDocument's default content container.
Comment_Document(AbstractDocument.Content container)
          Creates a new Comment_Document using the specified container for the document's content.
Method Summary
 void insertString(int offset, String str, AttributeSet a)
          Inserts content into the document.
Methods inherited from class javax.swing.text.PlainDocument
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate
Methods inherited from class javax.swing.text.AbstractDocument
addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values
Constructor Detail


public Comment_Document()
Creates a new Comment_Document using the PlainDocument's default content container.

See Also:


public Comment_Document(AbstractDocument.Content container)
Creates a new Comment_Document using the specified container for the document's content.

container - the document's content container.
See Also:
Method Detail


public void insertString(int offset,
                         String str,
                         AttributeSet a)
                  throws BadLocationException
Inserts content into the document. Each whitespace character is replaced by a simple space.

Specified by:
insertString in interface Document
insertString in class PlainDocument
offset - the starting offset, at least 0.
str - the string to insert; null/empty strings are not inserted.
a - the attributes for the inserted content; this document does not use attributes.
See Also:
PlainDocument.insertString(int, java.lang.String, javax.swing.text.AttributeSet)


Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona