|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.brains2b.thex.BinaryDocument
public class BinaryDocument
BinaryDocument is the content provider for binary data.
The content is stored in the Elements of this Documents. These Elements are able to
be loaded from the BinaryIOKit
to only use when accessed.
Field Summary |
---|
Fields inherited from interface javax.swing.text.Document |
---|
StreamDescriptionProperty, TitleProperty |
Constructor Summary | |
---|---|
BinaryDocument()
Constructor with no content |
|
BinaryDocument(byte[] b)
Constructor setting byte[] as content |
Method Summary | |
---|---|
void |
addDocumentListener(javax.swing.event.DocumentListener listener)
|
void |
addUndoableEditListener(javax.swing.event.UndoableEditListener listener)
|
javax.swing.text.Position |
createPosition(int offs)
|
void |
documentUpdated()
mark this document as updated and reset all changes by firing fireInsertUpdate(DocumentEvent)
but no UndoableEditEvent |
protected void |
fireChangedUpdate(javax.swing.event.DocumentEvent de)
fire the DocumentEvent changed for all listeners |
protected void |
fireInsertUpdate(javax.swing.event.DocumentEvent de)
fire the DocumentEvent insert for all listeners |
protected void |
fireRemoveUpdate(javax.swing.event.DocumentEvent de)
fire the DocumentEvent remove for all listeners |
protected void |
fireUndoableEdit(javax.swing.event.UndoableEditEvent ue)
fire the UndoableEditEvent for all listeners |
byte[] |
getBytes(int offset,
int length)
get the content of this document as byte[] |
javax.swing.text.Element |
getDefaultRootElement()
|
javax.swing.text.Position |
getEndPosition()
|
java.lang.String |
getLastString()
get the character that was typed as first part of a hexidecimal twosome or null if there was an equal number of valid characters entered |
int |
getLength()
|
java.lang.Object |
getProperty(java.lang.Object key)
|
javax.swing.text.Element[] |
getRootElements()
|
javax.swing.text.Position |
getStartPosition()
|
java.lang.String |
getText(int offset,
int length)
|
void |
getText(int offset,
int length,
javax.swing.text.Segment txt)
|
void |
insertBytes(int offset,
byte[] b,
javax.swing.text.AttributeSet a)
insert bytes into this document |
void |
insertString(int offset,
java.lang.String str,
javax.swing.text.AttributeSet a)
|
void |
putProperty(java.lang.Object key,
java.lang.Object value)
|
void |
remove(int offs,
int len)
|
void |
removeBytes(int offset,
int len)
remove bytes from this document between offset and length |
void |
removeDocumentListener(javax.swing.event.DocumentListener listener)
|
void |
removeUndoableEditListener(javax.swing.event.UndoableEditListener listener)
|
void |
render(java.lang.Runnable r)
|
void |
replaceBytes(int offset,
int length,
byte[] b,
javax.swing.text.AttributeSet atts)
replace the current content at offset and length with the new byte[] |
void |
setLastString(java.lang.String lastString)
set the first character of a hexidecimal twosome or null if there should not be one |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BinaryDocument()
public BinaryDocument(byte[] b)
b
- byte[]Method Detail |
---|
public void addDocumentListener(javax.swing.event.DocumentListener listener)
addDocumentListener
in interface javax.swing.text.Document
public void addUndoableEditListener(javax.swing.event.UndoableEditListener listener)
addUndoableEditListener
in interface javax.swing.text.Document
public javax.swing.text.Position createPosition(int offs) throws javax.swing.text.BadLocationException
createPosition
in interface javax.swing.text.Document
javax.swing.text.BadLocationException
public javax.swing.text.Element getDefaultRootElement()
getDefaultRootElement
in interface javax.swing.text.Document
public javax.swing.text.Position getEndPosition()
getEndPosition
in interface javax.swing.text.Document
public int getLength()
getLength
in interface javax.swing.text.Document
public java.lang.Object getProperty(java.lang.Object key)
getProperty
in interface javax.swing.text.Document
public javax.swing.text.Element[] getRootElements()
getRootElements
in interface javax.swing.text.Document
public javax.swing.text.Position getStartPosition()
getStartPosition
in interface javax.swing.text.Document
public java.lang.String getText(int offset, int length) throws javax.swing.text.BadLocationException
getText
in interface javax.swing.text.Document
javax.swing.text.BadLocationException
public void getText(int offset, int length, javax.swing.text.Segment txt) throws javax.swing.text.BadLocationException
getText
in interface javax.swing.text.Document
javax.swing.text.BadLocationException
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
javax.swing.text.BadLocationException
public byte[] getBytes(int offset, int length) throws javax.swing.text.BadLocationException
offset
- int start of the content to returnlength
- int length of the content to return
javax.swing.text.BadLocationException
- if the content between offset and length cannot be retrievedgetText(int, int)
public void insertBytes(int offset, byte[] b, javax.swing.text.AttributeSet a) throws javax.swing.text.BadLocationException
offset
- int position to insert the byte[] atb
- byte[]a
- AttributeSet not used
javax.swing.text.BadLocationException
- if the content cannot be inserted at the given offsetinsertString(int, String, AttributeSet)
public void putProperty(java.lang.Object key, java.lang.Object value)
putProperty
in interface javax.swing.text.Document
public void remove(int offs, int len) throws javax.swing.text.BadLocationException
remove
in interface javax.swing.text.Document
javax.swing.text.BadLocationException
public void removeBytes(int offset, int len) throws javax.swing.text.BadLocationException
offset
- intlen
- int
javax.swing.text.BadLocationException
- if the content cannot be found between offset and lengthremove(int, int)
public void removeDocumentListener(javax.swing.event.DocumentListener listener)
removeDocumentListener
in interface javax.swing.text.Document
public void removeUndoableEditListener(javax.swing.event.UndoableEditListener listener)
removeUndoableEditListener
in interface javax.swing.text.Document
public void replaceBytes(int offset, int length, byte[] b, javax.swing.text.AttributeSet atts) throws javax.swing.text.BadLocationException
offset
- int position to replace the byte[] withlength
- int length of content to removeb
- byte[]atts
- AttributeSet not used
javax.swing.text.BadLocationException
- if the content cannot be inserted at the given offset and lengthpublic void render(java.lang.Runnable r)
render
in interface javax.swing.text.Document
protected void fireChangedUpdate(javax.swing.event.DocumentEvent de)
de
- DocumentEventprotected void fireInsertUpdate(javax.swing.event.DocumentEvent de)
de
- DocumentEventprotected void fireRemoveUpdate(javax.swing.event.DocumentEvent de)
de
- DocumentEventprotected void fireUndoableEdit(javax.swing.event.UndoableEditEvent ue)
ue
- UndoableEditEventpublic java.lang.String getLastString()
public void setLastString(java.lang.String lastString)
lastString
- Stringpublic void documentUpdated()
fireInsertUpdate(DocumentEvent)
but no UndoableEditEvent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |