argutia.gui
Class DocumentColore

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.DefaultStyledDocument
          extended by argutia.gui.batchStyledDocument.BatchStyledDocument
              extended by argutia.gui.DocumentColore
All Implemented Interfaces:
AffichableAvecStyle, Serializable, Document, StyledDocument
public class DocumentColore
extends BatchStyledDocument
implements AffichableAvecStyle

Permet de manipuler des documents avec coloration syntaxique en temps réel et le munit de méthodes de traductions pour l'import et l'export dans des fichiers texte ainsi que pour la mise à jour de la syntaxe des opérateurs.

Author:
Geoffroy AUBRY
See Also:
Serialized Form
Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.text.DefaultStyledDocument
DefaultStyledDocument.AttributeUndoableEdit, DefaultStyledDocument.ElementBuffer, DefaultStyledDocument.ElementSpec, DefaultStyledDocument.SectionElement
 
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
protected DocumentEvent dernierEvenement
           
private String fileSectionTitle
           
private EventListenerList listeners
           
private static long serialVersionUID
           
private String title
           
 
Fields inherited from class argutia.gui.batchStyledDocument.BatchStyledDocument
eol
 
Fields inherited from class javax.swing.text.DefaultStyledDocument
buffer, BUFFER_SIZE_DEFAULT
 
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
DocumentColore(StyleContext styles, String key)
           
 
Method Summary
 void addFileListener(FileListener l)
           
private void colorer()
           
protected void fireFileEvent(FileEvent.Type type)
           
 String getFileSectionTitle()
           
private int getNumLigne(int offset)
           
 Style getStyle(MyStyles.StyleNames styleName)
           
 String getTitle()
           
 void insertString(int offset, String s, AttributeSet style)
          Insère le texte spécifié dans le document.
 void remove(int offset, int length)
           
 void removeFileListener(FileListener l)
           
 void remplacerUnitesOldOrthographe(Collection<Representation> modifies)
           
 void setText(String txt)
           
 String toString()
           
 void toStyledString(BatchStyledDocument doc)
          Ajoute du texte mis en forme au BatchedContent passé en paramètre.
 
Methods inherited from class argutia.gui.batchStyledDocument.BatchStyledDocument
appendBatchLineFeed, appendBatchString, appendBatchStringln, clear, getText, processBatchUpdates
 
Methods inherited from class javax.swing.text.DefaultStyledDocument
addDocumentListener, addStyle, create, createDefaultRoot, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, getStyleNames, insert, insertUpdate, removeDocumentListener, removeStyle, removeUpdate, setCharacterAttributes, setLogicalStyle, setParagraphAttributes, styleChanged
 
Methods inherited from class javax.swing.text.AbstractDocument
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, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.text.Document
addUndoableEditListener, createPosition, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, putProperty, removeUndoableEditListener, render
 
Field Detail

serialVersionUID

private static final long serialVersionUID
Constant Field Value:
1467592138L

dernierEvenement

protected DocumentEvent dernierEvenement

title

private final String title

fileSectionTitle

private String fileSectionTitle

listeners

private final EventListenerList listeners
Constructor Detail

DocumentColore

public DocumentColore(StyleContext styles,
                      String key)
Method Detail

addFileListener

public void addFileListener(FileListener l)

removeFileListener

public void removeFileListener(FileListener l)

fireFileEvent

protected void fireFileEvent(FileEvent.Type type)

getTitle

public String getTitle()

getFileSectionTitle

public String getFileSectionTitle()

insertString

public void insertString(int offset,
                         String s,
                         AttributeSet style)
Description copied from class: BatchStyledDocument
Insère le texte spécifié dans le document. Le texte est inséré dans le document à partir de l'offset spécifié et avec les attributs de style fournis.

Specified by:
insertString in interface Document
Overrides:
insertString in class BatchStyledDocument
Parameters:
offset - position à partir de laquelle doit être inséré le texte spécifié.
s - texte à insérer.
style - attributs de style du texte à insérer.

remove

public void remove(int offset,
                   int length)
Specified by:
remove in interface Document
Overrides:
remove in class AbstractDocument

setText

public void setText(String txt)

getStyle

public Style getStyle(MyStyles.StyleNames styleName)

remplacerUnitesOldOrthographe

public void remplacerUnitesOldOrthographe(Collection<Representation> modifies)

getNumLigne

private int getNumLigne(int offset)

colorer

private void colorer()

toString

public String toString()
Overrides:
toString in class Object

toStyledString

public void toStyledString(BatchStyledDocument doc)
Description copied from interface: AffichableAvecStyle
Ajoute du texte mis en forme au BatchedContent passé en paramètre.

Specified by:
toStyledString in interface AffichableAvecStyle
See Also:
MyStyles
Argutia JavaDoc
23 décembre 2007