public StyledParagraph(AttributedCharacterIterator aci,char[] chars){
  int start=aci.getBeginIndex();
  int end=aci.getEndIndex();
  length=end - start;
  int index=start;
  aci.first();
  do {
    final int nextRunStart=aci.getRunLimit();
    final int localIndex=index - start;
    Map<? extends Attribute,?> attributes=aci.getAttributes();
    attributes=addInputMethodAttrs(attributes);
    Decoration d=Decoration.getDecoration(attributes);
    addDecoration(d,localIndex);
    Object f=getGraphicOrFont(attributes);
    if (f == null) {
      addFonts(chars,attributes,localIndex,nextRunStart - start);
    }
 else {
      addFont(f,localIndex);
    }
    aci.setIndex(nextRunStart);
    index=nextRunStart;
  }
 while (index < end);
  if (decorations != null) {
    decorationStarts=addToVector(this,length,decorations,decorationStarts);
  }
  if (fonts != null) {
    fontStarts=addToVector(this,length,fonts,fontStarts);
  }
}

public StyledParagraph ( AttributedCharacterIterator aci , char [ ] chars ) { int start = aci . getBeginIndex ( ) ; int end = aci . getEndIndex ( ) ; length = end - start ; int index = start ; aci . first ( ) ; do { final int nextRunStart = aci . getRunLimit ( ) ; final int localIndex = index - start ; Map < ? extends Attribute , ? > attributes = aci . getAttributes ( ) ; attributes = addInputMethodAttrs ( attributes ) ; Decoration d = Decoration . getDecoration ( attributes ) ; addDecoration ( d , localIndex ) ; Object f = getGraphicOrFont ( attributes ) ; if ( f == null ) { addFonts ( chars , attributes , localIndex , nextRunStart - start ) ; } else { addFont ( f , localIndex ) ; } aci . setIndex ( nextRunStart ) ; index = nextRunStart ; } while ( index < end ) ; if ( decorations != null ) { decorationStarts = addToVector ( this , length , decorations , decorationStarts ) ; } if ( fonts != null ) { fontStarts = addToVector ( this , length , fonts , fontStarts ) ; } }
create a new styledparagraph over the given styled text .
