package mauda.plugin.binqueue;

import mauda.*;
import mauda.plugin.fibheap.*;

//import jedas.*;
//import java.awt.event.MouseEvent;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: University of Freiburg -- Institute of Computer Science</p>
 * @author Tobias Lauer
 * @version 3.2.5
 */

public class BinQueueInteractive extends FibHeapInteractive {

    boolean firstTime;
    
    public BinQueueInteractive(Exercise exercise) {
    	super(exercise);
    }

	/*
    public void initJedas() {
        //jf.setMenuBar(null);
        //jf.setTitle("Binomial Queue Demo");
        //for (int j=0; j<100; j++) {
        //    node[j] = null;
        //}
        compPanel.clear();
        fheap = new BinQueue(exercise.scheduler);
        fheap.rootList.setVisible(false);
        compPanel.addItem(fheap);
        Jedas.updateDisplay();
        firstTime = true;

    }

    public void run() {

        if (firstTime) {
            ( (BinQueue) fheap).showMessage(
                "Please wait ... building a sample Binomial Queue", 0);
            FibNode.FLASHTIME = 1;
            FibNode.MARKTIME = 1;
            FibNode.MOVETIME = 1;
            FibHeap.ENTRYTIME = 1;
            FibHeap.pauseLength = 1;
            FibHeap.pointerSpeed = 1;

            for (int j = 0; j < 14; j++) {
                randomIns();
            }

            FibNode.FLASHTIME = 220;
            FibNode.MARKTIME = 300;
            FibNode.MOVETIME = 600;
            FibHeap.ENTRYTIME = 300;
            FibHeap.pauseLength = 500;
            FibHeap.pointerSpeed = 1;
            ( (BinQueue) fheap).hideMessage();
            ( (BinQueue) fheap).showMessage(
                "Use right mouse button to select an operation", 2);

            firstTime = false;
        }

        super.run();
    }

    public static void main(String[] args) {
        BinQueueInteractive binQ = new BinQueueInteractive();
        binQ.initJedas();
    }

    public void mouseReleased(MouseEvent e) {
        ((BinQueue)fheap).hideMessage();
        super.mouseReleased(e);
    }*/
}
