Personal web server - Java Swing - O Reilly Once we’ve filled the
Java Swing - O Reilly Once we’ve filled the gap (line 5), the array must be enlarged (line 6) to hold the entire document. 20.1.16.1 Constructors public GapContent() Creates a content object with an initial array size of 10. public GapContent(int initialLength) Creates a content object with the specified size. 20.1.16.2 AbstractDocument.Content Methods The following methods implement the AbstractDocument.Content interface. public Position createPosition(int offset) throws BadLocationException Creates a Position at the specific document offset. This implementation manages a sorted array of positions to make it easy to find the marks that need to be updated when the gap is shifted. public void getChars(int where, int len, Segment chars) throws BadLocationException Populates the given Segment with the requested text (len characters, starting at where). If the requested text falls entirely on one side of the gap, the whole internal array is returned. If not, a new array is constructed, containing the specified range with the gap removed. public String getString(int where, int len) throws BadLocationException Uses getChars() to return the requested portion of the content. public UndoableEdit insertString(int where, String str) throws BadLocationException Inserts the specified text at the given location. The gap and positions are adjusted as necessary. Currently, this method always returns null. public int length() Returns the length of the content. The gap does not count in this value. public UndoableEdit remove(int where, int nitems) throws BadLocationException Removes the specified number of characters from the content, starting at where. The gap and positions are updated as necessary. 20.1.17 The AbstractDocument.AttributeContext Interface This inner-interface of AbstractDocument defines a set of methods for managing attributes in one or more documents. The idea is that replicating AttributeSets throughout a Document could be very expensive. Implementations of this interface (see the StyleContext class in Chapter 21) are intended to provide intelligent management of attribute sets, eliminating costly duplication. - 640
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.