public class Observation_ID_Document
extends javax.swing.text.PlainDocument
PlainDocument
that allows only those characters suitable for the
text form of a HiRISE observation ID. These include letters, numbers, and
the underscore ('_') character only. Furthermore, letters are
forced into uppercase and spaces are converted to underscores. All other
characters are ignored and never become part of the
Observation_ID_Document's content.javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID
Class identification name with source code version and date.
|
Constructor and Description |
---|
Observation_ID_Document()
Creates a new Observation_ID_Document using the
PlainDocument 's default content container. |
Observation_ID_Document(javax.swing.text.AbstractDocument.Content container)
Creates a new Observation_ID_Document using the specified container
for the document's content.
|
Modifier and Type | Method and Description |
---|---|
void |
insertString(int offset,
java.lang.String str,
javax.swing.text.AttributeSet a)
Inserts content into the document.
|
static java.lang.String |
transformText(java.lang.String str)
Transforms input text according to the observation ID document rules.
|
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate
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
public static final java.lang.String ID
public Observation_ID_Document()
PlainDocument
's default content container.PlainDocument.PlainDocument()
public Observation_ID_Document(javax.swing.text.AbstractDocument.Content container)
container
- the document's content container.PlainDocument.PlainDocument(AbstractDocument.Content)
public void insertString(int offset, java.lang.String str, javax.swing.text.AttributeSet a) throws javax.swing.text.BadLocationException
insertString
in interface javax.swing.text.Document
insertString
in class javax.swing.text.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.javax.swing.text.BadLocationException
PlainDocument.insertString(int, java.lang.String, javax.swing.text.AttributeSet)
public static java.lang.String transformText(java.lang.String str)
str
- the input text; may be null.Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona