7878 * @see Component
7979 */
8080public class Container extends Component implements Iterable <Component > {
81- static boolean enableLayoutOnPaint = true ;
81+ private static boolean enableLayoutOnPaint = true ;
8282 /**
8383 * Workaround for the behavior of the sidemenu bar on iOS etc. which translates aggressively,
8484 * this is visible with the table component where the lines slide out of place
8585 */
8686 static int sidemenuBarTranslation ;
87- static boolean blockOverdraw = false ;
87+ private static boolean blockOverdraw ;
8888 boolean scrollableX ;
8989 boolean scrollableY ;
9090 /**
@@ -152,6 +152,10 @@ public Container(Layout layout, String uiid) {
152152 setFocusable (false );
153153 }
154154
155+ static void blockOverdraw () {
156+ blockOverdraw = true ;
157+ }
158+
155159 /**
156160 * Constructs a new Container with a new layout manager.
157161 *
@@ -1002,6 +1006,10 @@ public void replaceAndWait(final Component current, final Component next, final
10021006 replaceComponents (current , next , t , true , false , null , 0 , 0 , true );
10031007 }
10041008
1009+ static void setEnableLayoutOnPaint (boolean val ) {
1010+ enableLayoutOnPaint = val ;
1011+ }
1012+
10051013 /**
10061014 * This method replaces the current Component with the next Component.
10071015 * Current Component must be contained in this Container.
@@ -1014,13 +1022,13 @@ public void replaceAndWait(final Component current, final Component next, final
10141022 * @param layoutAnimationSpeed the speed of the layout animation after replace is completed
10151023 */
10161024 public void replaceAndWait (final Component current , final Component next , final Transition t , int layoutAnimationSpeed ) {
1017- enableLayoutOnPaint = false ;
1025+ setEnableLayoutOnPaint ( false ) ;
10181026 replaceComponents (current , next , t , true , false , null , 0 , layoutAnimationSpeed , true );
10191027 if (layoutAnimationSpeed > 0 ) {
10201028 animateLayoutAndWait (layoutAnimationSpeed );
10211029 }
10221030 dontRecurseContainer = false ;
1023- enableLayoutOnPaint = true ;
1031+ setEnableLayoutOnPaint ( true ) ;
10241032 }
10251033
10261034 /**
@@ -3700,7 +3708,7 @@ public void morphAndWait(Component source, Component destination, int duration)
37003708
37013709 private void morph (Component source , Component destination , int duration , boolean wait , Runnable onCompletion ) {
37023710 setShouldCalcPreferredSize (true );
3703- enableLayoutOnPaint = false ;
3711+ setEnableLayoutOnPaint ( false ) ;
37043712 dontRecurseContainer = true ;
37053713 int deltaX = getAbsoluteX ();
37063714 int deltaY = getAbsoluteY ();
@@ -3755,7 +3763,7 @@ private void morph(Component source, Component destination, int duration, boolea
37553763 */
37563764 private ComponentAnimation animateHierarchy (final int duration , boolean wait , int opacity , boolean add ) {
37573765 setShouldCalcPreferredSize (true );
3758- enableLayoutOnPaint = false ;
3766+ setEnableLayoutOnPaint ( false ) ;
37593767 dontRecurseContainer = true ;
37603768 Vector comps = new Vector ();
37613769 findComponentsInHierachy (comps );
@@ -3853,7 +3861,7 @@ public ComponentAnimation createAnimateUnlayout(int duration, int opacity, Runna
38533861 */
38543862 private ComponentAnimation animateUnlayout (final int duration , boolean wait , int opacity , Runnable callback , boolean add ) {
38553863 setShouldCalcPreferredSize (true );
3856- enableLayoutOnPaint = false ;
3864+ setEnableLayoutOnPaint ( false ) ;
38573865 final int componentCount = getComponentCount ();
38583866 int [] beforeX = new int [componentCount ];
38593867 int [] beforeY = new int [componentCount ];
@@ -3913,7 +3921,7 @@ private ComponentAnimation animateLayout(final int duration, boolean wait, int o
39133921 return null ;
39143922 }
39153923 setShouldCalcPreferredSize (true );
3916- enableLayoutOnPaint = false ;
3924+ setEnableLayoutOnPaint ( false ) ;
39173925 final int componentCount = getComponentCount ();
39183926 int [] beforeX = new int [componentCount ];
39193927 int [] beforeY = new int [componentCount ];
@@ -4362,7 +4370,7 @@ protected void updateState() {
43624370 }
43634371 thisContainer .repaint ();
43644372 if (System .currentTimeMillis () - startTime >= duration ) {
4365- enableLayoutOnPaint = true ;
4373+ setEnableLayoutOnPaint ( true ) ;
43664374 thisContainer .dontRecurseContainer = false ;
43674375 Form f = thisContainer .getComponentForm ();
43684376 finished = true ;
0 commit comments