/[classpath]/classpath/javax/swing/text/GapContent.java
ViewVC logotype

Diff of /classpath/javax/swing/text/GapContent.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by mark, Sat Jul 2 20:32:51 2005 UTC revision 1.13 by rabbit78, Thu Jul 21 15:05:45 2005 UTC
# Line 353  public class GapContent Line 353  public class GapContent
353    {    {
354      return buffer;      return buffer;
355    }    }
356    
357      /**
358       * Replaces a portion of the storage with the specified items.
359       *
360       * @param position the position at which to remove items
361       * @param rmSize the number of items to remove
362       * @param addItems the items to add at location
363       * @param addSize the number of items to add
364       */
365      protected void replace(int position, int rmSize, Object addItems,
366                             int addSize)
367      {
368        // Remove content
369        shiftGap(position);
370        gapEnd += rmSize;
371    
372        // If gap is too small, enlarge the gap.
373        if ((gapEnd - gapStart) < addSize)
374          shiftEnd(addSize);
375    
376        // Add new items to the buffer.
377        System.arraycopy(addItems, 0, buffer, gapStart, addSize);
378        gapStart += addSize;
379      }
380  }  }

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26