Search in sources :

Example 1 with ATFDevice

use of de.neemann.digital.builder.ATF150x.ATFDevice in project Digital by hneemann.

the class TableDialog method createCreateMenu.

private JMenu createCreateMenu() {
    JMenu createMenu = new JMenu(Lang.get("menu_table_create"));
    createMenu.add(new ToolTipAction(Lang.get("menu_table_createCircuit")) {

        @Override
        public void actionPerformed(ActionEvent actionEvent) {
            createCircuit(ExpressionModifier.IDENTITY);
        }
    }.setToolTip(Lang.get("menu_table_createCircuit_tt")).setAccelerator("F2").enableAcceleratorIn(table).createJMenuItem());
    createMenu.add(new ToolTipAction(Lang.get("menu_table_createCircuitJK")) {

        @Override
        public void actionPerformed(ActionEvent actionEvent) {
            createCircuit(true, ExpressionModifier.IDENTITY);
        }
    }.setToolTip(Lang.get("menu_table_createCircuitJK_tt")).createJMenuItem());
    createMenu.add(new ToolTipAction(Lang.get("menu_table_createTwo")) {

        @Override
        public void actionPerformed(ActionEvent actionEvent) {
            createCircuit(new TwoInputs());
        }
    }.setToolTip(Lang.get("menu_table_createTwo_tt")).createJMenuItem());
    createMenu.add(new ToolTipAction(Lang.get("menu_table_createNAnd")) {

        @Override
        public void actionPerformed(ActionEvent actionEvent) {
            createCircuit(new NAnd());
        }
    }.setToolTip(Lang.get("menu_table_createNAnd_tt")).createJMenuItem());
    if (Main.isExperimentalMode()) {
        createMenu.add(new ToolTipAction(Lang.get("menu_table_createNAndTwo")) {

            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                createCircuit(new TwoInputs(), new NAnd());
            }
        }.setToolTip(Lang.get("menu_table_createNAndTwo_tt")).createJMenuItem());
        createMenu.add(new ToolTipAction(Lang.get("menu_table_createNOr")) {

            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                createCircuit(new NOr());
            }
        }.setToolTip(Lang.get("menu_table_createNOr_tt")).createJMenuItem());
        createMenu.add(new ToolTipAction(Lang.get("menu_table_createNOrTwo")) {

            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                createCircuit(new TwoInputs(), new NOr());
            }
        }.setToolTip(Lang.get("menu_table_createNOrTwo_tt")).createJMenuItem());
    }
    JMenu hardware = new JMenu(Lang.get("menu_table_create_hardware"));
    register(hardware, new GenerateCUPL(CuplExporter::new, "GAL16v8/CUPL"));
    register(hardware, new GenerateFile("jed", () -> new ExpressionToFileExporter(new Gal16v8JEDECExporter()), "GAL16v8/JEDEC", Lang.get("menu_table_create_jedec_tt")));
    register(hardware, new GenerateCUPL(Gal22v10CuplExporter::new, "GAL22v10/CUPL"));
    register(hardware, new GenerateFile("jed", () -> new ExpressionToFileExporter(new Gal22v10JEDECExporter()), "GAL22v10/JEDEC", Lang.get("menu_table_create_jedec_tt")));
    for (ATFDevice atfDev : ATFDevice.values()) {
        register(hardware, new GenerateCUPL(atfDev::getCuplExporter, "ATF150x/" + atfDev.getMenuName() + "/CUPL"));
        register(hardware, new GenerateFile("tt2", () -> atfDev.createExpressionToFileExporter(TableDialog.this, getProjectName()), "ATF150x/" + atfDev.getMenuName() + "/TT2, JEDEC", Lang.get("menu_table_createTT2_tt")));
    }
    createMenu.add(hardware);
    return createMenu;
}
Also used : Gal16v8JEDECExporter(de.neemann.digital.builder.Gal16v8.Gal16v8JEDECExporter) GenerateFile(de.neemann.digital.gui.components.table.hardware.GenerateFile) ActionEvent(java.awt.event.ActionEvent) NAnd(de.neemann.digital.analyse.expression.modify.NAnd) ATFDevice(de.neemann.digital.builder.ATF150x.ATFDevice) NOr(de.neemann.digital.analyse.expression.modify.NOr) ToolTipAction(de.neemann.gui.ToolTipAction) GenerateCUPL(de.neemann.digital.gui.components.table.hardware.GenerateCUPL) ExpressionToFileExporter(de.neemann.digital.builder.ExpressionToFileExporter) Gal22v10JEDECExporter(de.neemann.digital.builder.Gal22v10.Gal22v10JEDECExporter) TwoInputs(de.neemann.digital.analyse.expression.modify.TwoInputs)

Aggregations

NAnd (de.neemann.digital.analyse.expression.modify.NAnd)1 NOr (de.neemann.digital.analyse.expression.modify.NOr)1 TwoInputs (de.neemann.digital.analyse.expression.modify.TwoInputs)1 ATFDevice (de.neemann.digital.builder.ATF150x.ATFDevice)1 ExpressionToFileExporter (de.neemann.digital.builder.ExpressionToFileExporter)1 Gal16v8JEDECExporter (de.neemann.digital.builder.Gal16v8.Gal16v8JEDECExporter)1 Gal22v10JEDECExporter (de.neemann.digital.builder.Gal22v10.Gal22v10JEDECExporter)1 GenerateCUPL (de.neemann.digital.gui.components.table.hardware.GenerateCUPL)1 GenerateFile (de.neemann.digital.gui.components.table.hardware.GenerateFile)1 ToolTipAction (de.neemann.gui.ToolTipAction)1 ActionEvent (java.awt.event.ActionEvent)1