package Ui;

import java.awt.*;

import java.util.*;

import java.awt.event.* ;

import Maths.*;



public class ScrollbarPanel extends Panel implements AdjustmentListener{

	/* this class defines a component that is consists of a scrollbar and a label which shows the value
	   of the scrollbar accompagnied by a string explaining the context a the value (e.g. 'degree','weight',..).
	   The value read of the scrollbar is converted to string and added to the label component.
	Last change:  TMC   4 Jan 98    7:05 pm
	   */

	public Scrollbar scroll;//the scrollbar component

	public Label titel;//the label component

	public String ttel;//the string contained within the label

	public CurvePanel target;

	public Languages language;

	public ScrollbarPanel (CurvePanel target, int orient, int value, int visible, int min, int max,String ttel){

		/* constructor */

		this.target = target;

		this.scroll = new Scrollbar(orient,value,visible,min,max);

		scroll.addAdjustmentListener(this);

		this.language = CurveWindow.the_language;

		//the text within the label consists of the value of the scrollbar and the name of the value
		this.titel = new Label(ttel+String.valueOf(scroll.getValue()),Label.LEFT);

		this.ttel = ttel;

		setLayout(new FlowLayout(1));

		add(scroll);

		add(titel);

	};


	public ScrollbarPanel (int orient, int value, int visible, int min, int max,String ttel){

		this.scroll = new Scrollbar(orient,value,visible,min,max);

		this.language = CurveWindow.the_language;

		this.titel = new Label(ttel+String.valueOf(scroll.getValue()),Label.LEFT);

		this.ttel = ttel;

		setLayout(new FlowLayout(1));

		add(scroll);

		add(titel);

	};


    public void adjustmentValueChanged(AdjustmentEvent e) {

	System.out.println("to be overridden");
    
    }


}
        


