question: 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 ; }
target:  Calculates the current text (character) attributes in a form suitable for SwingText from the current parser state.