File tree Expand file tree Collapse file tree 2 files changed +9
-18
lines changed
modules/javafx.graphics/src/main/java Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Original file line number Diff line number Diff line change 2525package com .sun .javafx .scene ;
2626
2727public enum LayoutFlags {
28- DIRTY_ROOT (1 ),
29- DIRTY_BRANCH (2 ),
30- NEEDS_LAYOUT (4 );
31-
32- LayoutFlags (int value ) {
33- this .value = value ;
34- }
35-
36- private final int value ;
37-
38- public int getValue () {
39- return value ;
40- }
28+ DIRTY_ROOT ,
29+ DIRTY_BRANCH ,
30+ NEEDS_LAYOUT
4131}
Original file line number Diff line number Diff line change 3535import javafx .collections .ListChangeListener .Change ;
3636import javafx .collections .ObservableList ;
3737import java .util .ArrayList ;
38+ import java .util .EnumSet ;
3839import java .util .HashSet ;
3940import java .util .List ;
4041import java .util .Set ;
@@ -887,26 +888,26 @@ private final ParentTraversalEngine getTraversalEngine() {
887888 * *
888889 **********************************************************************/
889890
890- private int layoutDirtyBits ;
891+ private final Set < LayoutFlags > layoutFlags = EnumSet . noneOf ( LayoutFlags . class ) ;
891892
892893 boolean isLayoutClean () {
893- return layoutDirtyBits == 0 ;
894+ return layoutFlags . isEmpty () ;
894895 }
895896
896897 void setLayoutFlag (LayoutFlags flag ) {
897898 if (needsLayout != null ) {
898899 needsLayout .set (flag == LayoutFlags .NEEDS_LAYOUT );
899900 }
900901
901- layoutDirtyBits |= flag . getValue ( );
902+ layoutFlags . add ( flag );
902903 }
903904
904905 private void clearLayoutFlags () {
905- layoutDirtyBits = 0 ;
906+ layoutFlags . clear () ;
906907 }
907908
908909 private boolean isLayoutFlag (LayoutFlags flag ) {
909- return ( layoutDirtyBits & flag . getValue ()) != 0 ;
910+ return layoutFlags . contains ( flag ) ;
910911 }
911912
912913 /**
You can’t perform that action at this time.
0 commit comments