Class StreamPane.DocumentCreator

  • All Implemented Interfaces:
    java.lang.Runnable, java.util.concurrent.Future<javax.swing.text.StyledDocument>, java.util.concurrent.RunnableFuture<javax.swing.text.StyledDocument>
    Enclosing class:
    StreamPane

    private final class StreamPane.DocumentCreator
    extends javax.swing.SwingWorker<javax.swing.text.StyledDocument,​java.lang.Integer>
    A SwingWorker extended class that convert the stream to text loads in a document.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.SwingWorker

        javax.swing.SwingWorker.StateValue
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private DocumentCreator​(StreamPaneView targetView, java.lang.String filterKey, boolean nice)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addOperators​(java.lang.Object obj, javax.swing.text.StyledDocument docu)  
      protected javax.swing.text.StyledDocument doInBackground()  
      protected void done()  
      private javax.swing.text.StyledDocument getContentStreamDocument​(java.io.InputStream inputStream)  
      private javax.swing.text.StyledDocument getDocument​(java.io.InputStream inputStream, java.lang.String encoding)  
      private java.lang.String getStringOfStream​(java.io.InputStream in, java.lang.String encoding)  
      private javax.swing.text.StyledDocument getXMLDocument​(java.io.InputStream inputStream, java.lang.String encoding)  
      (package private) void writeIndent​(javax.swing.text.StyledDocument docu)  
      private void writeOperand​(java.lang.Object obj, javax.swing.text.StyledDocument docu)  
      private void writeToken​(java.lang.Object obj, javax.swing.text.StyledDocument docu)  
      • Methods inherited from class javax.swing.SwingWorker

        addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • filterKey

        private final java.lang.String filterKey
      • nice

        private final boolean nice
      • indent

        private int indent
      • needIndent

        private boolean needIndent
    • Constructor Detail

      • DocumentCreator

        private DocumentCreator​(StreamPaneView targetView,
                                java.lang.String filterKey,
                                boolean nice)
    • Method Detail

      • doInBackground

        protected javax.swing.text.StyledDocument doInBackground()
        Specified by:
        doInBackground in class javax.swing.SwingWorker<javax.swing.text.StyledDocument,​java.lang.Integer>
      • done

        protected void done()
        Overrides:
        done in class javax.swing.SwingWorker<javax.swing.text.StyledDocument,​java.lang.Integer>
      • getStringOfStream

        private java.lang.String getStringOfStream​(java.io.InputStream in,
                                                   java.lang.String encoding)
      • getDocument

        private javax.swing.text.StyledDocument getDocument​(java.io.InputStream inputStream,
                                                            java.lang.String encoding)
      • getXMLDocument

        private javax.swing.text.StyledDocument getXMLDocument​(java.io.InputStream inputStream,
                                                               java.lang.String encoding)
      • getContentStreamDocument

        private javax.swing.text.StyledDocument getContentStreamDocument​(java.io.InputStream inputStream)
      • writeToken

        private void writeToken​(java.lang.Object obj,
                                javax.swing.text.StyledDocument docu)
      • writeOperand

        private void writeOperand​(java.lang.Object obj,
                                  javax.swing.text.StyledDocument docu)
                           throws javax.swing.text.BadLocationException
        Throws:
        javax.swing.text.BadLocationException
      • addOperators

        private void addOperators​(java.lang.Object obj,
                                  javax.swing.text.StyledDocument docu)
                           throws javax.swing.text.BadLocationException
        Throws:
        javax.swing.text.BadLocationException
      • writeIndent

        void writeIndent​(javax.swing.text.StyledDocument docu)
                  throws javax.swing.text.BadLocationException
        Throws:
        javax.swing.text.BadLocationException