private void updateLogXAxisCheckBox() { HistogramPanelModel.HistogramConfig config = createHistogramConfig(); final boolean enabled = dataset != null && model.hasStx(config) && model.getStx(config).getMinimum() > 0 && !model.getStx(config).isLogHistogram(); Binding binding = xAxisRangeControl.getBindingContext().getBinding(PROPERTY_NAME_LOG_SCALED); if (!enabled) { binding.setPropertyValue(false); } log10AxisEnablement.apply(); binding.adjustComponents(); }
private void createUI() { dataset = new XIntervalSeriesCollection(); chart = ChartFactory.createHistogram( CHART_TITLE, "Values", "Frequency in #pixels", dataset, PlotOrientation.VERTICAL, false, // Legend? true, // tooltips false // url ); final XYPlot xyPlot = chart.getXYPlot(); xyPlot.setDomainZeroBaselineStroke(new BasicStroke(0.2f)); final XYBarRenderer renderer = (XYBarRenderer) xyPlot.getRenderer(); renderer.setDrawBarOutline(false); renderer.setShadowVisible(false); renderer.setShadowYOffset(-4.0); renderer.setBaseToolTipGenerator(new XYPlotToolTipGenerator()); renderer.setBarPainter(new StandardXYBarPainter()); renderer.setSeriesPaint(0, new Color(0, 0, 200)); createUI(createChartPanel(chart), createOptionsPanel(), bindingContext); isInitialized = true; final Binding minBinding = xAxisRangeControl.getBindingContext().getBinding("min"); final double min = (Double) minBinding.getPropertyValue(); final Binding maxBinding = xAxisRangeControl.getBindingContext().getBinding("max"); final double max = (Double) maxBinding.getPropertyValue(); if (!histogramComputing && min > max) { minBinding.setPropertyValue(max); maxBinding.setPropertyValue(min); } updateXAxis(); }