protected ChatGlyph createSubtitle ( Graphics2D gfx , int type , long timestamp , Icon icon , int indent , String text , boolean expires ) { Dimension is = new Dimension ( ) ; if ( icon != null ) { is . setSize ( icon . getIconWidth ( ) , icon . getIconHeight ( ) ) ; } Rectangle vbounds = _target . getViewBounds ( ) ; Label label = _logic . createLabel ( text ) ; label . setFont ( _logic . getFont ( type ) ) ; int paddedIconWidth = ( icon == null ) ? 0 : is . width + ICON_PADDING ; label . setTargetWidth ( vbounds . width - indent - paddedIconWidth - 2 * ( _subtitleXSpacing + Math . max ( UIManager . getInt ( "ScrollBar.width" ) , PAD ) ) ) ; label . layout ( gfx ) ; gfx . dispose ( ) ; Dimension ls = label . getSize ( ) ; Rectangle r = new Rectangle ( 0 , 0 , ls . width + indent + paddedIconWidth , Math . max ( is . height , ls . height ) ) ; r . grow ( 0 , 1 ) ; Point iconpos = r . getLocation ( ) ; iconpos . translate ( indent , r . height - is . height - 1 ) ; Point labelpos = r . getLocation ( ) ; labelpos . translate ( indent + paddedIconWidth , 1 ) ; Rectangle lr = new Rectangle ( r . x + indent + paddedIconWidth , r . y , r . width - indent - paddedIconWidth , ls . height + 2 ) ; // last a really long time if we're not supposed to expire long lifetime = Integer . MAX_VALUE ; if ( expires ) { lifetime = getChatExpire ( timestamp , label . getText ( ) ) - timestamp ; } Shape shape = _logic . getSubtitleShape ( type , lr , r ) ; return new ChatGlyph ( this , type , lifetime , r . union ( shape . getBounds ( ) ) , shape , icon , iconpos , label , labelpos , _logic . getOutlineColor ( type ) ) ; }
Create a subtitle - a line of text that goes on the bottom .