public void setLocation(float x, float y) { this.x = x; this.y = y; notifyListeners(new AnnotationChangeEvent(this, this)); }
@Override public void focusGained( final FocusEvent arg0 ) { annotation.setColor( Color.RED.darker() ); } } );
/** * 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(); }
chartPanel.addKeyListener( new MyKeyListener() ); annotation = new XYTextSimpleAnnotation( chartPanel ); annotation.setFont( SMALL_FONT.deriveFont( Font.BOLD ) ); annotation.setColor( annotationColor.darker() ); plot.addAnnotation( annotation );
/** * 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(); }
chartPanel.addKeyListener( new MyKeyListener() ); annotation = new XYTextSimpleAnnotation( chartPanel ); annotation.setFont( SMALL_FONT.deriveFont( Font.BOLD ) ); annotation.setColor( annotationColor.darker() ); plot.addAnnotation( annotation );
annotation.setLocation( 0.5f, 0.5f ); annotation.setText( "No data" ); fireThresholdChanged();
@Override public void focusLost( final FocusEvent arg0 ) { annotation.setColor( annotationColor.darker() ); }
public void setLocation(float x, float y) { this.x = x; this.y = y; notifyListeners(new AnnotationChangeEvent(this, this)); }
annotation.setLocation( 0.5f, 0.5f ); annotation.setText( "No data" ); fireThresholdChanged();
@Override public void focusGained( final FocusEvent arg0 ) { annotation.setColor( Color.RED.darker() ); } } );
public void setColor(Color color) { this.color = color; notifyListeners(new AnnotationChangeEvent(this, this)); }
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(); }
@Override public void focusLost( final FocusEvent arg0 ) { annotation.setColor( annotationColor.darker() ); }
public void setColor(Color color) { this.color = color; notifyListeners(new AnnotationChangeEvent(this, this)); }
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(); }