src/share/classes/javax/swing/text/ComponentView.java

Print this page




 357             bias[0] = Position.Bias.Forward;
 358             return getStartOffset();
 359         }
 360         bias[0] = Position.Bias.Backward;
 361         return getEndOffset();
 362     }
 363 
 364     // --- member variables ------------------------------------------------
 365 
 366     private Component createdC;
 367     private Invalidator c;
 368 
 369     /**
 370      * This class feeds the invalidate back to the
 371      * hosting View.  This is needed to get the View
 372      * hierarchy to consider giving the component
 373      * a different size (i.e. layout may have been
 374      * cached between the associated view and the
 375      * container hosting this component).
 376      */

 377     class Invalidator extends Container implements PropertyChangeListener {
 378 
 379         // NOTE: When we remove this class we are going to have to some
 380         // how enforce setting of the focus traversal keys on the children
 381         // so that they don't inherit them from the JEditorPane. We need
 382         // to do this as JEditorPane has abnormal bindings (it is a focus cycle
 383         // root) and the children typically don't want these bindings as well.
 384 
 385         Invalidator(Component child) {
 386             setLayout(null);
 387             add(child);
 388             cacheChildSizes();
 389         }
 390 
 391         /**
 392          * The components invalid layout needs
 393          * to be propagated through the view hierarchy
 394          * so the views (which position the component)
 395          * can have their layout recomputed.
 396          */




 357             bias[0] = Position.Bias.Forward;
 358             return getStartOffset();
 359         }
 360         bias[0] = Position.Bias.Backward;
 361         return getEndOffset();
 362     }
 363 
 364     // --- member variables ------------------------------------------------
 365 
 366     private Component createdC;
 367     private Invalidator c;
 368 
 369     /**
 370      * This class feeds the invalidate back to the
 371      * hosting View.  This is needed to get the View
 372      * hierarchy to consider giving the component
 373      * a different size (i.e. layout may have been
 374      * cached between the associated view and the
 375      * container hosting this component).
 376      */
 377     @SuppressWarnings("serial") // JDK-implementation class
 378     class Invalidator extends Container implements PropertyChangeListener {
 379 
 380         // NOTE: When we remove this class we are going to have to some
 381         // how enforce setting of the focus traversal keys on the children
 382         // so that they don't inherit them from the JEditorPane. We need
 383         // to do this as JEditorPane has abnormal bindings (it is a focus cycle
 384         // root) and the children typically don't want these bindings as well.
 385 
 386         Invalidator(Component child) {
 387             setLayout(null);
 388             add(child);
 389             cacheChildSizes();
 390         }
 391 
 392         /**
 393          * The components invalid layout needs
 394          * to be propagated through the view hierarchy
 395          * so the views (which position the component)
 396          * can have their layout recomputed.
 397          */