629 @Override public String getName() { return "snapToPixel"; } 630 @Override public CssMetaData<Region, Boolean> getCssMetaData() { 631 return StyleableProperties.SNAP_TO_PIXEL; 632 } 633 @Override public void invalidated() { 634 boolean value = get(); 635 if (_snapToPixel != value) { 636 _snapToPixel = value; 637 updateSnappedInsets(); 638 requestParentLayout(); 639 } 640 } 641 }; 642 } 643 return snapToPixel; 644 } 645 646 /** 647 * The top, right, bottom, and left padding around the region's content. 648 * This space will be included in the calculation of the region's 649 * minimum and preferred sizes. By default padding is Insets.EMPTY. Setting the 650 * value to null should be avoided. 651 */ 652 private ObjectProperty<Insets> padding = new StyleableObjectProperty<Insets>(Insets.EMPTY) { 653 // Keep track of the last valid value for the sake of 654 // rollback in case padding is set to null. Note that 655 // Richard really does not like this pattern because 656 // it essentially means that binding the padding property 657 // is not possible since a binding expression could very 658 // easily produce an intermediate null value. 659 660 // Also note that because padding is set virtually everywhere via CSS, and CSS 661 // requires a property object in order to set it, there is no benefit to having 662 // lazy initialization here. 663 664 private Insets lastValidValue = Insets.EMPTY; 665 666 @Override public Object getBean() { return Region.this; } 667 @Override public String getName() { return "padding"; } 668 @Override public CssMetaData<Region, Insets> getCssMetaData() { 669 return StyleableProperties.PADDING; 670 } | 629 @Override public String getName() { return "snapToPixel"; } 630 @Override public CssMetaData<Region, Boolean> getCssMetaData() { 631 return StyleableProperties.SNAP_TO_PIXEL; 632 } 633 @Override public void invalidated() { 634 boolean value = get(); 635 if (_snapToPixel != value) { 636 _snapToPixel = value; 637 updateSnappedInsets(); 638 requestParentLayout(); 639 } 640 } 641 }; 642 } 643 return snapToPixel; 644 } 645 646 /** 647 * The top, right, bottom, and left padding around the region's content. 648 * This space will be included in the calculation of the region's 649 * minimum and preferred sizes. By default, padding is {@code Insets.EMPTY}. Setting the 650 * value to {@code null} should be avoided. 651 */ 652 private ObjectProperty<Insets> padding = new StyleableObjectProperty<Insets>(Insets.EMPTY) { 653 // Keep track of the last valid value for the sake of 654 // rollback in case padding is set to null. Note that 655 // Richard really does not like this pattern because 656 // it essentially means that binding the padding property 657 // is not possible since a binding expression could very 658 // easily produce an intermediate null value. 659 660 // Also note that because padding is set virtually everywhere via CSS, and CSS 661 // requires a property object in order to set it, there is no benefit to having 662 // lazy initialization here. 663 664 private Insets lastValidValue = Insets.EMPTY; 665 666 @Override public Object getBean() { return Region.this; } 667 @Override public String getName() { return "padding"; } 668 @Override public CssMetaData<Region, Insets> getCssMetaData() { 669 return StyleableProperties.PADDING; 670 } |