package org.ntlab.deltaViewer; import java.util.List; import javax.swing.JCheckBox; import javax.swing.JMenu; import javax.swing.JMenuBar; import org.ntlab.actions.ExtractAction; import org.ntlab.actions.OpenAction; 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("アニメーション設定")); JCheckBox defaultCheck = new JCheckBox("通常", true); defaultCheck.addActionListener(new ZoomActualAction(magnetRON.getViewer())); defaultCheck.setEnabled(false); animationSettingMenu.add(defaultCheck); JMenu viewMenu = add(new JMenu("表示")); viewMenu.add(new ZoomInAction(magnetRON.getViewer())); viewMenu.add(new ZoomOutAction(magnetRON.getViewer())); viewMenu.add(new ZoomActualAction(magnetRON.getViewer())); } public void updateExtractsMenu(List<Feature> features) { extractsMenu.removeAll(); for (Feature feature: features) { extractsMenu.add(new ExtractAction(feature, magnetRON)); } } }