public synchronized void updateLineWidthIfNecessary(int logicalLine,int widthInPixels){
  if (logicalLine < myLineWidths.size()) {
    int currentWidth=myLineWidths.get(logicalLine);
    if (widthInPixels > currentWidth) {
      myLineWidths.set(logicalLine,widthInPixels);
    }
    if (widthInPixels > myMaxWidth) {
      myMaxWidth=widthInPixels;
    }
    maxCalculatedLine=Math.max(maxCalculatedLine,logicalLine);
  }
}

public synchronized void updateLineWidthIfNecessary ( int logicalLine , int widthInPixels ) { if ( logicalLine < myLineWidths . size ( ) ) { int currentWidth = myLineWidths . get ( logicalLine ) ; if ( widthInPixels > currentWidth ) { myLineWidths . set ( logicalLine , widthInPixels ) ; } if ( widthInPixels > myMaxWidth ) { myMaxWidth = widthInPixels ; } maxCalculatedLine = Math . max ( maxCalculatedLine , logicalLine ) ; } }
notifies current container about visual width change of the target logical line . < p / > please note that there is a possible case that particular logical line is represented in more than one visual lines , hence , this method may be called multiple times with the same logical line argument but different with values . current container is expected to store max of the given values then .
