Gabriel95 / scalafx

Automatically exported from code.google.com/p/scalafx
Other
0 stars 0 forks source link

Chart classes should have secondary constructors to support hierarchical building pattern #72

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Most of the chart classes do not have secondary constructors. This prevents use 
of the hierarchical building pattern. For instance, when creating BarChart we 
currently have to address properties through a variable holding the chart:

  val barChart1 = BarChart(new CategoryAxis(), new NumberAxis())
  barChart1.title = "Speculations"
  barChart1.data = createChartData(data1)
  barChart1.legendVisible = false
  barChart1.onMouseClicked = showInTable(barChart1.title(), data1)

With a secondary constructor taking axis as arguments (corresponding to similar 
delegate constructor) we could use hierarchical building pattern:

  val barChart1 = new BarChart(new CategoryAxis(), new NumberAxis()) {
    title = "Speculations"
    data = createChartData(data1)
    legendVisible = false
    onMouseClicked = showInTable(title(), data1)
  }

Secondary constructors, corresponding to delegate constructors, should be added 
for all chart classes.

Original issue reported on code.google.com by jpsacha on 9 Aug 2013 at 12:10

GoogleCodeExporter commented 8 years ago
See also Issue 79

Original comment by jpsacha on 6 Sep 2013 at 3:55

GoogleCodeExporter commented 8 years ago
This issue was closed by revision e8d59a14066c.

Original comment by jpsacha on 8 Sep 2013 at 3:36