modules/controls/src/main/java/javafx/scene/chart/BarChart.java

Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization


  36 import javafx.animation.ParallelTransition;
  37 import javafx.animation.Timeline;
  38 import javafx.application.Platform;
  39 import javafx.beans.NamedArg;
  40 import javafx.beans.property.DoubleProperty;
  41 import javafx.beans.value.WritableValue;
  42 import javafx.collections.FXCollections;
  43 import javafx.collections.ObservableList;
  44 import javafx.geometry.Orientation;
  45 import javafx.scene.Node;
  46 import javafx.scene.layout.StackPane;
  47 import javafx.util.Duration;
  48 
  49 import com.sun.javafx.charts.Legend;
  50 import com.sun.javafx.charts.Legend.LegendItem;
  51 
  52 import javafx.css.StyleableDoubleProperty;
  53 import javafx.css.CssMetaData;
  54 import javafx.css.PseudoClass;
  55 
  56 import com.sun.javafx.css.converters.SizeConverter;
  57 
  58 import javafx.css.Styleable;
  59 import javafx.css.StyleableProperty;
  60 
  61 /**
  62  * A chart that plots bars indicating data values for a category. The bars can be vertical or horizontal depending on
  63  * which axis is a category axis.
  64  * @since JavaFX 2.0
  65  */
  66 public class BarChart<X,Y> extends XYChart<X,Y> {
  67 
  68     // -------------- PRIVATE FIELDS -------------------------------------------
  69     
  70     private Map<Series<X,Y>, Map<String, Data<X,Y>>> seriesCategoryMap = new HashMap<>();
  71     private Legend legend = new Legend();
  72     private final Orientation orientation;
  73     private CategoryAxis categoryAxis;
  74     private ValueAxis valueAxis;
  75     private Timeline dataRemoveTimeline;
  76     private double bottomPos  = 0;




  36 import javafx.animation.ParallelTransition;
  37 import javafx.animation.Timeline;
  38 import javafx.application.Platform;
  39 import javafx.beans.NamedArg;
  40 import javafx.beans.property.DoubleProperty;
  41 import javafx.beans.value.WritableValue;
  42 import javafx.collections.FXCollections;
  43 import javafx.collections.ObservableList;
  44 import javafx.geometry.Orientation;
  45 import javafx.scene.Node;
  46 import javafx.scene.layout.StackPane;
  47 import javafx.util.Duration;
  48 
  49 import com.sun.javafx.charts.Legend;
  50 import com.sun.javafx.charts.Legend.LegendItem;
  51 
  52 import javafx.css.StyleableDoubleProperty;
  53 import javafx.css.CssMetaData;
  54 import javafx.css.PseudoClass;
  55 
  56 import javafx.css.converter.SizeConverter;
  57 
  58 import javafx.css.Styleable;
  59 import javafx.css.StyleableProperty;
  60 
  61 /**
  62  * A chart that plots bars indicating data values for a category. The bars can be vertical or horizontal depending on
  63  * which axis is a category axis.
  64  * @since JavaFX 2.0
  65  */
  66 public class BarChart<X,Y> extends XYChart<X,Y> {
  67 
  68     // -------------- PRIVATE FIELDS -------------------------------------------
  69     
  70     private Map<Series<X,Y>, Map<String, Data<X,Y>>> seriesCategoryMap = new HashMap<>();
  71     private Legend legend = new Legend();
  72     private final Orientation orientation;
  73     private CategoryAxis categoryAxis;
  74     private ValueAxis valueAxis;
  75     private Timeline dataRemoveTimeline;
  76     private double bottomPos  = 0;