< prev index next >

modules/javafx.controls/src/main/java/javafx/scene/control/ProgressBar.java

Print this page




  58  * @since JavaFX 2.0
  59  */
  60 public class ProgressBar extends ProgressIndicator {
  61 
  62 
  63     /***************************************************************************
  64      *                                                                         *
  65      * Constructors                                                            *
  66      *                                                                         *
  67      **************************************************************************/
  68 
  69     /**
  70      * Creates a new indeterminate ProgressBar.
  71      */
  72     public ProgressBar() {
  73         this(INDETERMINATE_PROGRESS);
  74     }
  75 
  76     /**
  77      * Creates a new ProgressBar with the given progress value.

  78      */
  79     public ProgressBar(double progress) {
  80         // focusTraversable is styleable through css. Calling setFocusTraversable
  81         // makes it look to css like the user set the value and css will not
  82         // override. Initializing focusTraversable by calling set on the
  83         // CssMetaData ensures that css will be able to override the value.
  84         ((StyleableProperty<Boolean>)(WritableValue<Boolean>)focusTraversableProperty()).applyStyle(null, Boolean.FALSE);
  85         setProgress(progress);
  86         getStyleClass().setAll(DEFAULT_STYLE_CLASS);
  87     }
  88 
  89     /***************************************************************************
  90      *                                                                         *
  91      * Methods                                                                 *
  92      *                                                                         *
  93      **************************************************************************/
  94 
  95     /** {@inheritDoc} */
  96     @Override protected Skin<?> createDefaultSkin() {
  97         return new ProgressBarSkin(this);




  58  * @since JavaFX 2.0
  59  */
  60 public class ProgressBar extends ProgressIndicator {
  61 
  62 
  63     /***************************************************************************
  64      *                                                                         *
  65      * Constructors                                                            *
  66      *                                                                         *
  67      **************************************************************************/
  68 
  69     /**
  70      * Creates a new indeterminate ProgressBar.
  71      */
  72     public ProgressBar() {
  73         this(INDETERMINATE_PROGRESS);
  74     }
  75 
  76     /**
  77      * Creates a new ProgressBar with the given progress value.
  78      * @param progress the progress
  79      */
  80     public ProgressBar(double progress) {
  81         // focusTraversable is styleable through css. Calling setFocusTraversable
  82         // makes it look to css like the user set the value and css will not
  83         // override. Initializing focusTraversable by calling set on the
  84         // CssMetaData ensures that css will be able to override the value.
  85         ((StyleableProperty<Boolean>)(WritableValue<Boolean>)focusTraversableProperty()).applyStyle(null, Boolean.FALSE);
  86         setProgress(progress);
  87         getStyleClass().setAll(DEFAULT_STYLE_CLASS);
  88     }
  89 
  90     /***************************************************************************
  91      *                                                                         *
  92      * Methods                                                                 *
  93      *                                                                         *
  94      **************************************************************************/
  95 
  96     /** {@inheritDoc} */
  97     @Override protected Skin<?> createDefaultSkin() {
  98         return new ProgressBarSkin(this);


< prev index next >