/**
 * <p>This example demonstrates how to use the
 * component Slider within
 * the GUI framework JControl/Wombat.</p>
 *
 * <p>(C) DOMOLOGIC Home Automation GmbH 2007</p>
 */
import jcontrol.ui.wombat.Frame;
import jcontrol.ui.wombat.Container;
import jcontrol.ui.wombat.event.ActionListener;
import jcontrol.ui.wombat.Border;
import jcontrol.ui.wombat.Slider;
import jcontrol.ui.wombat.event.ActionEvent;

public class WombatSliderExample extends Frame implements ActionListener {
    
    /**
     * Constructor WombatSliderExample
     */
    public WombatSliderExample() {
        // create a container for the content of this frame
        Container content = new Container();
        
        // create borders and add them to the content
        Border border = new Border("Slider", 70, 40, 180, 140, 
        		Border.STYLE_SIMPLE_BORDER);
        content.add(border);
        
        
        /* create all Sliders
           add them to the content
           and define an actionlistener for each component */           
        Slider horizontalSlider = new Slider(90, 57, 140, 18, 0, 100, 
        		Slider.ORIENTATION_HORIZONTAL);
        horizontalSlider.setEnabled(false);
        content.add(horizontalSlider);
        horizontalSlider.setActionListener(this);
        Slider verticalSlider = new Slider(150, 80, 18, 90, 0, 100, 
        		Slider.ORIENTATION_VERTICAL);
        content.add(verticalSlider);
        verticalSlider.setActionListener(this);     
        
        // set the content to this frame
        setContent(content);
        // finally, make the frame visible      
        setVisible(true);
    }

    /**
     * This method is called every time any component declared above fires an
     * action event.
     * 
     * @param e the ActionEvent
     */
    public void onActionEvent(ActionEvent e) {
        // add some code if you want to 
    }


    /**
     * The main method.
     * 
     * @param args
     *        The main arguments
     */
    public static void main(String[] args) {
        new WombatSliderExample();
    }
}