question: void updateVisibilityModel ( ) { Component c = getContainer ( ) ; if ( c instanceof JTextField ) { JTextField field = ( JTextField ) c ; BoundedRangeModel vis = field . getHorizontalVisibility ( ) ; int hspan = ( int ) getPreferredSpan ( X_AXIS ) ; int extent = vis . getExtent ( ) ; int maximum = Math . max ( hspan , extent ) ; extent = ( extent == 0 ) ? maximum : extent ; int value = maximum - extent ; int oldValue = vis . getValue ( ) ; if ( ( oldValue + extent ) > maximum ) { oldValue = maximum - extent ; } value = Math . max ( 0 , Math . min ( value , oldValue ) ) ; vis . setRangeProperties ( value , extent , 0 , maximum , false ) ; } }
target:  Update the visibility model with the associated JTextField (if there is one) to reflect the current visibility as a result of changes to the document model.  The bounded range properties are updated.  If the view hasn't yet been shown the extent will be zero and we just set it to be full until determined otherwise.