com.raelity.jvi.swing
Class TextViewCache.FreezeViewport

java.lang.Object
  extended by com.raelity.jvi.swing.TextViewCache.FreezeViewport
All Implemented Interfaces:
EventListener, DocumentListener
Enclosing class:
TextViewCache

public static class TextViewCache.FreezeViewport
extends Object
implements DocumentListener

Stabilize (do not allow scrolling) the JViewport displaying the indicated JEditorPane. This is typically used when the underlying document may change while being edited in another view. The stop() method is used to release the listeners and so unfreeze the viewport.

This is a one shot class. The editor is expected to be good to go. Only document changes are listened to. The first char of the top line is pinned to the upper left corner. If needed, this could be extended to pin the horizontal position as well.


Constructor Summary
TextViewCache.FreezeViewport(JEditorPane ep)
           
 
Method Summary
 void changedUpdate(DocumentEvent e)
           
 void insertUpdate(DocumentEvent e)
           
 void removeUpdate(DocumentEvent e)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextViewCache.FreezeViewport

public TextViewCache.FreezeViewport(JEditorPane ep)
Method Detail

stop

public void stop()

insertUpdate

public void insertUpdate(DocumentEvent e)
Specified by:
insertUpdate in interface DocumentListener

removeUpdate

public void removeUpdate(DocumentEvent e)
Specified by:
removeUpdate in interface DocumentListener

changedUpdate

public void changedUpdate(DocumentEvent e)
Specified by:
changedUpdate in interface DocumentListener