cdox.gui.action
Class CaretUpdater

java.lang.Object
  extended bycdox.gui.action.CaretUpdater
All Implemented Interfaces:
javax.swing.event.CaretListener, java.util.EventListener

public class CaretUpdater
extends java.lang.Object
implements javax.swing.event.CaretListener

A simple class to update the fontBox and fontSizeBox of the CDoxFrame if the user moves the caret in a new textElement(that is in a TextPane).

Version:
May 16th 2002
Author:
Rutger Bezema, Andreas Schmitz

Constructor Summary
CaretUpdater(CDoxFrame cF, TextPane tP)
          Constucts a new CaretUpdater with the specified TextPane.
 
Method Summary
 void caretUpdate(javax.swing.event.CaretEvent ce)
          This method is inherited from the CaretListener interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CaretUpdater

public CaretUpdater(CDoxFrame cF,
                    TextPane tP)
Constucts a new CaretUpdater with the specified TextPane.

Parameters:
cF - the CDoxFrame
tP - the typing TextPane
See Also:
CDDrawingPane
Method Detail

caretUpdate

public void caretUpdate(javax.swing.event.CaretEvent ce)
This method is inherited from the CaretListener interface. It is called each time a caret-event has taken place. That is the cursor(caret) moved. It first gets the fontsize and font-family of the current position and than checks if it is the same as the last update, if not the fontBox and fontSizeBox of the CFrame are updated.

Specified by:
caretUpdate in interface javax.swing.event.CaretListener
Parameters:
ce - the caretEvent.