import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;

public class ScaleBar extends Box {
    double min, max;
    JTextField loField, hiField;
    JCheckBox autoscale;
    Border border;

    JPanel range;

    public ScaleBar() {
	super(BoxLayout.Y_AXIS);
	
     	Font font = new Font("MonoSpaced", Font.PLAIN, 10);
	setFont(font);
	
	range = new JPanel(new GridLayout(2,3));
	
	hiField = new JTextField("100.0", 4);
	loField = new JTextField("-100.0", 4);
	autoscale = new JCheckBox("auto scale");

	hiField.setHorizontalAlignment(JTextField.RIGHT);
	loField.setHorizontalAlignment(JTextField.RIGHT);

	//hiField.setActionCommand("HiField");
	//loField.setActionCommand("LoField");

	range.add(new JLabel("Max ")); range.add(hiField); range.add(new JLabel("mV"));
	range.add(new JLabel("Min ")); range.add(loField); range.add(new JLabel("mV"));
	
	border = BorderFactory.createEtchedBorder();
	border=BorderFactory.createTitledBorder(border, "Settings");

	add(range);
	add(createGlue());
	add(autoscale);

	setBorder(border);
    }    

    public double getLow() { return min; }
    public double getHigh() { return max; }

}



