예제 #1
0
  @Override
  public void reconfigureChartCanvas() {
    final boolean gasOnly =
        statComboBox.getSelectedItem().hasMinGas
            && separateMinsGasCheckBox.isSelected()
            && !minsCheckBox.isSelected();

    final Presentation p = presentationComboBox.getSelectedItem();

    for (final Chart<?> chart : chartsComp.getChartsCanvas().getChartList()) {
      if (chart instanceof LineTimeChart) {
        final LineTimeChart lc = (LineTimeChart) chart;
        lc.setPresentation(p);

        // Stroke depends on the presentation:
        for (final DataModel<LineChartDataSet> model : lc.getDataModelList()) {
          int i = 0;
          for (final LineChartDataSet dataSet : model.getDataSetList())
            dataSet.setStroke(i++ > 0 || gasOnly ? p.storke : p.storkeDouble);
        }
      }
    }
  }