home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161a.iso / handson / files / copyjava.exe / com / sun / java / swing / text / DefaultTextUI$UpdateHandler.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-02-26  |  2.1 KB  |  51 lines

  1. package com.sun.java.swing.text;
  2.  
  3. import com.sun.java.swing.event.DocumentEvent;
  4. import com.sun.java.swing.event.DocumentListener;
  5. import java.awt.Rectangle;
  6. import java.beans.PropertyChangeEvent;
  7. import java.beans.PropertyChangeListener;
  8.  
  9. class DefaultTextUI$UpdateHandler implements PropertyChangeListener, DocumentListener {
  10.    // $FF: synthetic field
  11.    private final DefaultTextUI this$0;
  12.  
  13.    public final void propertyChange(PropertyChangeEvent var1) {
  14.       Object var2 = var1.getOldValue();
  15.       Object var3 = var1.getNewValue();
  16.       if (var2 instanceof Document || var3 instanceof Document) {
  17.          if (var2 != null) {
  18.             ((Document)var2).removeDocumentListener(this);
  19.          }
  20.  
  21.          if (var3 != null) {
  22.             ((Document)var3).addDocumentListener(this);
  23.          }
  24.  
  25.          this.this$0.modelChanged();
  26.       }
  27.  
  28.       this.this$0.propertyChange(var1);
  29.    }
  30.  
  31.    public final void insertUpdate(DocumentEvent var1) {
  32.       Rectangle var2 = this.this$0.painted ? new Rectangle(this.this$0.editor.getSize()) : null;
  33.       this.this$0.rootView.insertUpdate(var1, var2, this.this$0.rootView.getViewFactory());
  34.    }
  35.  
  36.    public final void removeUpdate(DocumentEvent var1) {
  37.       Rectangle var2 = this.this$0.painted ? new Rectangle(this.this$0.editor.getSize()) : null;
  38.       this.this$0.rootView.removeUpdate(var1, var2, this.this$0.rootView.getViewFactory());
  39.    }
  40.  
  41.    public final void changedUpdate(DocumentEvent var1) {
  42.       Rectangle var2 = this.this$0.painted ? new Rectangle(this.this$0.editor.getSize()) : null;
  43.       this.this$0.rootView.changedUpdate(var1, var2, this.this$0.rootView.getViewFactory());
  44.    }
  45.  
  46.    DefaultTextUI$UpdateHandler(DefaultTextUI var1) {
  47.       this.this$0 = var1;
  48.       this.this$0 = var1;
  49.    }
  50. }
  51.