MutableAttributeSet currentTextAttributes(){
  MutableAttributeSet attributes=new SimpleAttributeSet(characterAttributes);
  Integer fontnum;
  Integer stateItem;
  fontnum=(Integer)parserState.get("f");
  String fontFamily;
  if (fontnum != null)   fontFamily=fontTable.get(fontnum);
 else   fontFamily=null;
  if (fontFamily != null)   StyleConstants.setFontFamily(attributes,fontFamily);
 else   attributes.removeAttribute(StyleConstants.FontFamily);
  if (colorTable != null) {
    stateItem=(Integer)parserState.get("cf");
    if (stateItem != null) {
      Color fg=colorTable[stateItem.intValue()];
      StyleConstants.setForeground(attributes,fg);
    }
 else {
      attributes.removeAttribute(StyleConstants.Foreground);
    }
  }
  if (colorTable != null) {
    stateItem=(Integer)parserState.get("cb");
    if (stateItem != null) {
      Color bg=colorTable[stateItem.intValue()];
      attributes.addAttribute(StyleConstants.Background,bg);
    }
 else {
      attributes.removeAttribute(StyleConstants.Background);
    }
  }
  Style characterStyle=(Style)parserState.get("characterStyle");
  if (characterStyle != null)   attributes.setResolveParent(characterStyle);
  return attributes;
}

MutableAttributeSet currentTextAttributes ( ) { MutableAttributeSet attributes = new SimpleAttributeSet ( characterAttributes ) ; Integer fontnum ; Integer stateItem ; fontnum = ( Integer ) parserState . get ( "f" ) ; String fontFamily ; if ( fontnum != null ) fontFamily = fontTable . get ( fontnum ) ; else fontFamily = null ; if ( fontFamily != null ) StyleConstants . setFontFamily ( attributes , fontFamily ) ; else attributes . removeAttribute ( StyleConstants . FontFamily ) ; if ( colorTable != null ) { stateItem = ( Integer ) parserState . get ( "cf" ) ; if ( stateItem != null ) { Color fg = colorTable [ stateItem . intValue ( ) ] ; StyleConstants . setForeground ( attributes , fg ) ; } else { attributes . removeAttribute ( StyleConstants . Foreground ) ; } } if ( colorTable != null ) { stateItem = ( Integer ) parserState . get ( "cb" ) ; if ( stateItem != null ) { Color bg = colorTable [ stateItem . intValue ( ) ] ; attributes . addAttribute ( StyleConstants . Background , bg ) ; } else { attributes . removeAttribute ( StyleConstants . Background ) ; } } Style characterStyle = ( Style ) parserState . get ( "characterStyle" ) ; if ( characterStyle != null ) attributes . setResolveParent ( characterStyle ) ; return attributes ; }
calculates the current text ( character ) attributes in a form suitable for swingtext from the current parser state .
