package cz.vutbr.feec.sim.ha;

import javax.swing.JPanel;

import org.apache.log4j.Logger;

import cz.vutbr.feec.simlib.RealTimeStepper;

public class RealTimeSteperRefresh extends RealTimeStepper {
	private static Logger logger = Logger.getLogger(RealTimeSteperRefresh.class.getName());
	
	private JPanel panel = null;
	
	public RealTimeSteperRefresh(int stepLength, JPanel panel) {
		super(stepLength);
		this.panel = panel;
		
	}
	public RealTimeSteperRefresh(int stepLength) {
		super(stepLength);
		setName("RealTimeSynchronizer-Thr");
	}
	
	@Override
	public void onExpired() {
		logger.debug("EXPIRED: "+getSimulation().getTime());
		if(panel!= null) {
			panel.repaint();
		}
	}

}
