/** * Refreshes the histogram content. Call this method when the values in the * values map changed to update histogram display. */ public void refresh() { final double old = getThreshold(); key = allKeys.get( jComboBoxFeature.getSelectedIndex() ); final double[] values = valuesMap.get( key ); if ( null == values || 0 == values.length ) { dataset = new LogHistogramDataset(); annotation.setLocation( 0.5f, 0.5f ); annotation.setText( "No data" ); } else { final int nBins = TMUtils.getNBins( values, 8, 100 ); dataset = new LogHistogramDataset(); if ( nBins > 1 ) { dataset.addSeries( DATA_SERIES_NAME, values, nBins ); } } plot.setDataset( dataset ); threshold = old; chartPanel.repaint(); }
/** * Refreshes the histogram content. Call this method when the values in the * values map changed to update histogram display. */ public void refresh() { final double old = getThreshold(); key = allKeys.get( jComboBoxFeature.getSelectedIndex() ); final double[] values = valuesMap.get( key ); if ( null == values || 0 == values.length ) { dataset = new LogHistogramDataset(); annotation.setLocation( 0.5f, 0.5f ); annotation.setText( "No data" ); } else { final int nBins = TMUtils.getNBins( values, 8, 100 ); dataset = new LogHistogramDataset(); if ( nBins > 1 ) { dataset.addSeries( DATA_SERIES_NAME, values, nBins ); } } plot.setDataset( dataset ); threshold = old; chartPanel.repaint(); }
annotation.setLocation( 0.5f, 0.5f ); annotation.setText( "No data" ); fireThresholdChanged();
annotation.setLocation( 0.5f, 0.5f ); annotation.setText( "No data" ); fireThresholdChanged();
private void redrawThresholdMarker() { final String selectedFeature = allKeys.get( jComboBoxFeature.getSelectedIndex() ); final double[] values = valuesMap.get( selectedFeature ); if ( null == values ) return; if ( jRadioButtonAbove.isSelected() ) { intervalMarker.setStartValue( threshold ); intervalMarker.setEndValue( plot.getDomainAxis().getUpperBound() ); } else { intervalMarker.setStartValue( plot.getDomainAxis().getLowerBound() ); intervalMarker.setEndValue( threshold ); } float x, y; if ( threshold > 0.85 * plot.getDomainAxis().getUpperBound() ) { x = ( float ) ( threshold - 0.15 * plot.getDomainAxis().getRange().getLength() ); } else { x = ( float ) ( threshold + 0.05 * plot.getDomainAxis().getRange().getLength() ); } y = ( float ) ( 0.85 * plot.getRangeAxis().getUpperBound() ); annotation.setText( String.format( "%.2f", threshold ) ); annotation.setLocation( x, y ); fireThresholdChanged(); }
private void redrawThresholdMarker() { final String selectedFeature = allKeys.get( jComboBoxFeature.getSelectedIndex() ); final double[] values = valuesMap.get( selectedFeature ); if ( null == values ) return; if ( jRadioButtonAbove.isSelected() ) { intervalMarker.setStartValue( threshold ); intervalMarker.setEndValue( plot.getDomainAxis().getUpperBound() ); } else { intervalMarker.setStartValue( plot.getDomainAxis().getLowerBound() ); intervalMarker.setEndValue( threshold ); } float x, y; if ( threshold > 0.85 * plot.getDomainAxis().getUpperBound() ) { x = ( float ) ( threshold - 0.15 * plot.getDomainAxis().getRange().getLength() ); } else { x = ( float ) ( threshold + 0.05 * plot.getDomainAxis().getRange().getLength() ); } y = ( float ) ( 0.85 * plot.getRangeAxis().getUpperBound() ); annotation.setText( String.format( "%.2f", threshold ) ); annotation.setLocation( x, y ); fireThresholdChanged(); }