Changeset 102


Ignore:
Timestamp:
10/11/02 16:00:56 (21 years ago)
Author:
piso
Message:

Moved empty(), getLastView(), setLastView(), saveView() from SystemBuffer?.java to Buffer.java.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/SystemBuffer.java

    r92 r102  
    33 *
    44 * Copyright (C) 1998-2002 Peter Graves
    5  * $Id: SystemBuffer.java,v 1.6 2002-10-11 01:37:49 piso Exp $
     5 * $Id: SystemBuffer.java,v 1.7 2002-10-11 16:00:56 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    5858    private String loadEncoding;
    5959    private List tags;
    60     private View lastView;
    6160
    6261    protected SystemBuffer()
     
    129128    }
    130129
    131     public final List getTags()
     130    public synchronized final List getTags()
    132131    {
    133132        return tags;
    134133    }
    135134
    136     public final void setTags(List tags)
     135    public synchronized final void setTags(List tags)
    137136    {
    138137        this.tags = tags;
     
    147146    {
    148147        return lineSeparator;
    149     }
    150 
    151     public final View getLastView()
    152     {
    153         if (lastView != null)
    154             return (View) lastView.clone();
    155         else
    156             return null;
    157     }
    158 
    159     public final void setLastView(View view)
    160     {
    161         lastView = (View) view.clone();
    162     }
    163 
    164     public void saveView(Editor editor)
    165     {
    166         final View view = saveViewInternal(editor);
    167         editor.setView(this, view);
    168         setLastView(view);
    169148    }
    170149
     
    570549    }
    571550
    572     public void empty()
    573     {
    574         _empty();
    575         setTags(null);
    576         // Invalidate any stored views that are referencing the old contents
    577         // of this buffer.
    578         if (lastView != null)
    579             lastView.invalidate();
    580         for (EditorIterator it = new EditorIterator(); it.hasNext();) {
    581             Editor ed = it.nextEditor();
    582             View view = ed.getView(this);
    583             if (view != null)
    584                 view.invalidate();
    585             if (ed.getBuffer() == this) {
    586                 ed.setDot(null);
    587                 ed.setMark(null);
    588                 ed.setTopLine(null);
    589             }
    590         }
    591     }
    592 
    593551    /*package*/ void _empty()
    594552    {
Note: See TracChangeset for help on using the changeset viewer.