src/share/classes/java/awt/font/StyledParagraph.java

Print this page




  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  *
  25  */
  26 
  27 /*
  28  * (C) Copyright IBM Corp. 1999,  All rights reserved.
  29  */
  30 package java.awt.font;
  31 
  32 import java.awt.Font;
  33 import java.awt.Toolkit;
  34 import java.awt.im.InputMethodHighlight;
  35 import java.text.Annotation;
  36 import java.text.AttributedCharacterIterator;
  37 import java.text.AttributedCharacterIterator.Attribute;
  38 import java.util.Vector;
  39 import java.util.HashMap;
  40 import java.util.Map;

  41 import sun.font.Decoration;
  42 import sun.font.FontResolver;
  43 import sun.text.CodePointIterator;
  44 
  45 /**
  46  * This class stores Font, GraphicAttribute, and Decoration intervals
  47  * on a paragraph of styled text.
  48  * <p>
  49  * Currently, this class is optimized for a small number of intervals
  50  * (preferrably 1).
  51  */
  52 final class StyledParagraph {
  53 
  54     // the length of the paragraph
  55     private int length;
  56 
  57     // If there is a single Decoration for the whole paragraph, it
  58     // is stored here.  Otherwise this field is ignored.
  59 
  60     private Decoration decoration;
  61 
  62     // If there is a single Font or GraphicAttribute for the whole
  63     // paragraph, it is stored here.  Otherwise this field is ignored.




  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  *
  25  */
  26 
  27 /*
  28  * (C) Copyright IBM Corp. 1999,  All rights reserved.
  29  */
  30 package java.awt.font;
  31 
  32 import java.awt.Font;
  33 import java.awt.Toolkit;
  34 import java.awt.im.InputMethodHighlight;
  35 import java.text.Annotation;
  36 import java.text.AttributedCharacterIterator;
  37 import java.text.AttributedCharacterIterator.Attribute;
  38 import java.util.Vector;
  39 import java.util.HashMap;
  40 import java.util.Map;
  41 import sun.font.CodePointIterator;
  42 import sun.font.Decoration;
  43 import sun.font.FontResolver;

  44 
  45 /**
  46  * This class stores Font, GraphicAttribute, and Decoration intervals
  47  * on a paragraph of styled text.
  48  * <p>
  49  * Currently, this class is optimized for a small number of intervals
  50  * (preferrably 1).
  51  */
  52 final class StyledParagraph {
  53 
  54     // the length of the paragraph
  55     private int length;
  56 
  57     // If there is a single Decoration for the whole paragraph, it
  58     // is stored here.  Otherwise this field is ignored.
  59 
  60     private Decoration decoration;
  61 
  62     // If there is a single Font or GraphicAttribute for the whole
  63     // paragraph, it is stored here.  Otherwise this field is ignored.