com.raelity.jvi.swing
Class TextViewCache
java.lang.Object
com.raelity.jvi.swing.TextViewCache
- All Implemented Interfaces:
- PropertyChangeListener, EventListener, ChangeListener
public class TextViewCache
- extends Object
- implements PropertyChangeListener, ChangeListener
This class caches information about the various components that make
up the VI model. This class listens to these components as needed to
keep the cache up to date. All info is derived through a JEditorPane.
Nested Class Summary |
static class |
TextViewCache.FreezeViewport
Stabilize (do not allow scrolling) the JViewport displaying
the indicated JEditorPane. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cacheTrace
public static BooleanOption cacheTrace
TextViewCache
public TextViewCache(TextView textView)
getCursor
public final ViFPOS getCursor()
getViewport
public final JViewport getViewport()
getFheight
public final int getFheight()
getViewTopLine
public int getViewTopLine()
- Returns:
- the top line number
setViewTopLine
public void setViewTopLine(int line)
getViewBottomLine
public int getViewBottomLine()
getViewBlankLines
public int getViewBlankLines()
getViewLines
public int getViewLines()
- Returns:
- number of lines on viewport
fillLinePositions
protected void fillLinePositions()
fillLinePositionsFinally
protected void fillLinePositionsFinally()
- determine document indicators visible in the viewport
modelToView
public Rectangle modelToView(int offset)
throws BadLocationException
- Throws:
BadLocationException
attach
public void attach(JEditorPane editor)
- This is called from the managing textview,
listen to things that affect the cache.
detach
public void detach(JEditorPane ep)
- Dissassociate from the observed components.
shutdown
public void shutdown(JEditorPane ep)
propertyChange
public void propertyChange(PropertyChangeEvent e)
- Specified by:
propertyChange
in interface PropertyChangeListener
stateChanged
public void stateChanged(ChangeEvent e)
- Specified by:
stateChanged
in interface ChangeListener