jdk/src/java.desktop/share/classes/javax/swing/text/GlyphView.java
changeset 31886 5787a1b5682a
parent 30462 507bcb03c954
child 32132 f48fe5540347
equal deleted inserted replaced
31885:6a51d0e0c491 31886:5787a1b5682a
   536 
   536 
   537         }
   537         }
   538     }
   538     }
   539 
   539 
   540     /**
   540     /**
       
   541      * {@inheritDoc}
       
   542      */
       
   543     @Override
       
   544     public int getResizeWeight(int axis) {
       
   545         if (axis == View.X_AXIS) {
       
   546             return 1;
       
   547         }
       
   548         return 0;
       
   549     }
       
   550 
       
   551     /**
   541      * Determines the minimum span for this view along an axis.
   552      * Determines the minimum span for this view along an axis.
   542      *
   553      *
   543      * <p>This implementation returns the longest non-breakable area within
   554      * <p>This implementation returns the longest non-breakable area within
   544      * the view as a minimum span for {@code View.X_AXIS}.</p>
   555      * the view as a minimum span for {@code View.X_AXIS}.</p>
   545      *
   556      *
   550      */
   561      */
   551     @Override
   562     @Override
   552     public float getMinimumSpan(int axis) {
   563     public float getMinimumSpan(int axis) {
   553         switch (axis) {
   564         switch (axis) {
   554             case View.X_AXIS:
   565             case View.X_AXIS:
       
   566                 if (getResizeWeight(X_AXIS) == 0) {
       
   567                     return getPreferredSpan(X_AXIS);
       
   568                 }
   555                 if (minimumSpan < 0) {
   569                 if (minimumSpan < 0) {
   556                     minimumSpan = 0;
   570                     minimumSpan = 0;
   557                     int p0 = getStartOffset();
   571                     int p0 = getStartOffset();
   558                     int p1 = getEndOffset();
   572                     int p1 = getEndOffset();
   559                     while (p1 > p0) {
   573                     while (p1 > p0) {