package jp.hasc.hasctool.ui.views;

import jp.hasc.hasctool.core.messaging.MessageProcessor;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.ViewPart;

/**
 * スペクトログラムを表示するビューです
 * @author hiro,iwasaki
 */
public class SpectrogramView extends ViewPart {

	private SpectrogramViewWidget spectrogramViewWidget_;
	public static final String ID = "jp.hasc.hasctool.ui.views.SpectrogramView";
	
	@Override
	public void createPartControl(Composite parent) {
		spectrogramViewWidget_=new SpectrogramViewWidget(parent, SWT.NONE);
	}
	
	@Override
	public void setFocus() {
	}
	
	public MessageProcessor getInputPort() { return spectrogramViewWidget_.getInputPort(); }
	
	private void onInit(IViewSite site) {
	}
	
	@Override
	public void init(IViewSite site, IMemento memento) throws PartInitException {
		super.init(site, memento);
		onInit(site);
	}

	@Override
	public void init(IViewSite site) throws PartInitException {
		super.init(site);
		onInit(site);
	}

	public SpectrogramViewWidget getSpectrogramViewWidget() {
		return spectrogramViewWidget_;
	}
}
