if (description.startsWith(htmlString)) { htmlMode = true; label.setText(description); } else { htmlMode = false;   if (description.length()>1) {  if (getFont()!=null) map.put(TextAttribute.FONT, getFont());  attText = new AttributedString(description, map);  paragraph = attText.getIterator(); paragraphStart = paragraph.getBeginIndex(); paragraphEnd = paragraph.getEndIndex();  int i = 1; for (char c = paragraph.first(); c != paragraph.DONE; c = paragraph.next()) if (c == '\n') i++; breaks = new int[i];  i = 0; for (char c = paragraph.first(); c != paragraph.DONE; c = paragraph.next()) if (c == '\n') breaks[i++]=paragraph.getIndex(); breaks[i] = paragraphEnd;  lineMeasurer = new LineBreakMeasurer(paragraph, frc); } else { lineMeasurer = null; paragraph = null; attText = null; breaks = null; } } }
updateText(); }
public void setDescription(String description){	this.description = description;		if (description.startsWith(htmlString))		{			htmlMode = true;			label.setText(description);		}		else		{			htmlMode = false;			if (description.length()>1)			{		     	// let attText be an AttributedCharacterIterator containing at least one character, otherwise null		        if (getFont()!=null) map.put(TextAttribute.FONT, getFont());				    	attText = new AttributedString(description, map);						paragraph = attText.getIterator();				paragraphStart = paragraph.getBeginIndex();			    paragraphEnd = paragraph.getEndIndex();				int i = 1;			    for (char c = paragraph.first(); c != paragraph.DONE; c = paragraph.next())			         if (c == '\n')			         	i++;			    breaks = new int[i];				i = 0;			    for (char c = paragraph.first(); c != paragraph.DONE; c = paragraph.next())			         if (c == '\n')			         	breaks[i++]=paragraph.getIndex();				breaks[i] = paragraphEnd;					 			lineMeasurer = new LineBreakMeasurer(paragraph, frc);			}			else			{				lineMeasurer = null;				paragraph = null;				attText = null;				breaks = null;			}		}	}