package jp.ac.kyutech.mns.ist;

import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;

import javax.swing.Icon;
import javax.swing.JFrame;
import javax.swing.JPanel;

import jp.ac.kyutech.mns.ist.util.QuickMenuActionManager;

public class ConfigPanel extends JPanel {
	private static final long serialVersionUID = -5485725559777307133L;

	public Icon tabIcon;
	public String tabTitle;
	long lastUpdated = 0;
	public JFrame frame;//config window
	
	public ConfigPanel(JFrame p){
		frame = p;
		tabIcon = QuickMenuActionManager.createNavigationIcon("general/Import"+"24");
		tabTitle = "Import";
		
//		JButton jb = new JButton("最新の状態に更新する");
//		jb.addActionListener(new ActionListener(){
//			@Override
//			public void actionPerformed(ActionEvent arg0) {
//				update();
//			}
//		});
//		add(jb);
		addMouseMotionListener(new MouseMotionAdapter() {
			public void mouseMoved(MouseEvent ev){
				checkupdate(); //最新の状態に更新
//				System.out.println("update");
			}
		});
	}
	//画面の更新
	public void checkupdate(){
		long now = System.currentTimeMillis();
		if (now - lastUpdated > 2000) {
			update();
			lastUpdated = now;
		}
	}
	public void update(){
//		System.out.println(lastUpdated);
	}
}
