< prev index next >

modules/controls/src/main/java/javafx/scene/control/skin/ProgressIndicatorSkin.java

Print this page




   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javafx.scene.control.skin;
  27 

  28 import java.util.ArrayList;
  29 import java.util.Collections;
  30 import java.util.List;
  31 
  32 import javafx.animation.Animation;
  33 import javafx.animation.KeyFrame;
  34 import javafx.animation.KeyValue;
  35 import javafx.animation.Timeline;
  36 import javafx.beans.property.BooleanProperty;
  37 import javafx.beans.property.IntegerProperty;
  38 import javafx.beans.property.ObjectProperty;
  39 import javafx.beans.value.WritableValue;
  40 import javafx.collections.FXCollections;
  41 import javafx.collections.ObservableList;
  42 import javafx.geometry.NodeOrientation;
  43 import javafx.geometry.VPos;
  44 import javafx.scene.Node;
  45 import javafx.scene.control.Control;
  46 import javafx.scene.control.ProgressIndicator;
  47 import javafx.scene.control.SkinBase;


 258         }
 259     }
 260 
 261 
 262 
 263     /***************************************************************************
 264      *                                                                         *
 265      * Private implementation                                                  *
 266      *                                                                         *
 267      **************************************************************************/
 268 
 269     void initialize() {
 270         boolean isIndeterminate = control.isIndeterminate();
 271         if (isIndeterminate) {
 272             // clean up determinateIndicator
 273             determinateIndicator = null;
 274 
 275             // create spinner
 276             spinner = new IndeterminateSpinner(spinEnabled.get(), progressColor.get());
 277             getChildren().setAll(spinner);
 278             if (control.impl_isTreeVisible()) {
 279                 if (indeterminateTransition != null) {
 280                     indeterminateTransition.play();
 281                 }
 282             }
 283         } else {
 284             // clean up after spinner
 285             if (spinner != null) {
 286                 if (indeterminateTransition != null) {
 287                     indeterminateTransition.stop();
 288                 }
 289                 spinner = null;
 290             }
 291 
 292             // create determinateIndicator
 293             determinateIndicator = new DeterminateIndicator(control, this, progressColor.get());
 294             getChildren().setAll(determinateIndicator);
 295         }
 296     }
 297 
 298     void updateProgress() {




   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javafx.scene.control.skin;
  27 
  28 import com.sun.javafx.scene.NodeHelper;
  29 import java.util.ArrayList;
  30 import java.util.Collections;
  31 import java.util.List;
  32 
  33 import javafx.animation.Animation;
  34 import javafx.animation.KeyFrame;
  35 import javafx.animation.KeyValue;
  36 import javafx.animation.Timeline;
  37 import javafx.beans.property.BooleanProperty;
  38 import javafx.beans.property.IntegerProperty;
  39 import javafx.beans.property.ObjectProperty;
  40 import javafx.beans.value.WritableValue;
  41 import javafx.collections.FXCollections;
  42 import javafx.collections.ObservableList;
  43 import javafx.geometry.NodeOrientation;
  44 import javafx.geometry.VPos;
  45 import javafx.scene.Node;
  46 import javafx.scene.control.Control;
  47 import javafx.scene.control.ProgressIndicator;
  48 import javafx.scene.control.SkinBase;


 259         }
 260     }
 261 
 262 
 263 
 264     /***************************************************************************
 265      *                                                                         *
 266      * Private implementation                                                  *
 267      *                                                                         *
 268      **************************************************************************/
 269 
 270     void initialize() {
 271         boolean isIndeterminate = control.isIndeterminate();
 272         if (isIndeterminate) {
 273             // clean up determinateIndicator
 274             determinateIndicator = null;
 275 
 276             // create spinner
 277             spinner = new IndeterminateSpinner(spinEnabled.get(), progressColor.get());
 278             getChildren().setAll(spinner);
 279             if (NodeHelper.isTreeVisible(control)) {
 280                 if (indeterminateTransition != null) {
 281                     indeterminateTransition.play();
 282                 }
 283             }
 284         } else {
 285             // clean up after spinner
 286             if (spinner != null) {
 287                 if (indeterminateTransition != null) {
 288                     indeterminateTransition.stop();
 289                 }
 290                 spinner = null;
 291             }
 292 
 293             // create determinateIndicator
 294             determinateIndicator = new DeterminateIndicator(control, this, progressColor.get());
 295             getChildren().setAll(determinateIndicator);
 296         }
 297     }
 298 
 299     void updateProgress() {


< prev index next >