Newer
Older
MagnetRON / src / org / ntlab / deltaViewer / MagnetRONMenuBar.java
package org.ntlab.deltaViewer;

import java.util.List;

import javax.swing.JMenu;
import javax.swing.JMenuBar;

import org.ntlab.actions.ExtractAction;
import org.ntlab.actions.OpenAction;
import org.ntlab.actions.StartAnimationAction;
import org.ntlab.actions.StopAnimationAction;
import org.ntlab.actions.ZoomInAction;
import org.ntlab.actions.ZoomOutAction;
import org.ntlab.featureExtractor.Feature;
import org.ntlab.actions.ZoomActualAction;

public class MagnetRONMenuBar extends JMenuBar {
	private MagnetRONFrame magnetRON;
	private JMenu extractsMenu;

	public MagnetRONMenuBar(MagnetRONFrame magnetRON) {
		super();
		this.magnetRON = magnetRON;
		
		JMenu fileMenu = add(new JMenu("ファイル"));
		fileMenu.add(new OpenAction(magnetRON));

		extractsMenu = add(new JMenu("機能抽出"));

		JMenu animationSettingMenu = add(new JMenu("アニメーション設定"));
		
		JMenu viewMenu = add(new JMenu("表示"));
		viewMenu.add(new ZoomInAction(magnetRON.getViewer()));
		viewMenu.add(new ZoomOutAction(magnetRON.getViewer()));
		viewMenu.add(new ZoomActualAction(magnetRON.getViewer()));
	
		JMenu animationMenu = add(new JMenu("アニメーション"));
		animationMenu.add(new StartAnimationAction(magnetRON));
		animationMenu.add(new StopAnimationAction(magnetRON));
	}

	public void updateExtractsMenu(List<Feature> features) {
		extractsMenu.removeAll();
		for (Feature feature: features) {
			extractsMenu.add(new ExtractAction(feature, magnetRON));
		}
	}
	
}