*/
    private void createMenuBar() {        JMenu m;        menuBar = new JMenuBar();        JMenuItem save = createMenuItem("Save", null, "Save current map",                "control S");        JMenuItem saveAs = createMenuItem("Save as...", null,                "Save current map as new file", "control shift S");        JMenuItem close = createMenuItem("Close", null, "Close this map",                "control W");        JMenuItem print =            createMenuItem("Print...", null, "Print the map", "control P");        recentMenu = new JMenu("Open Recent");        mapEventAdapter.addListener(save);        mapEventAdapter.addListener(saveAs);        mapEventAdapter.addListener(close);        mapEventAdapter.addListener(print);        m = new JMenu("File");        m.add(createMenuItem("New", null, "Start a new map", "control N"));        m.add(createMenuItem("Open...", null, "Open a map", "control O"));        m.add(recentMenu);        m.add(save);        m.add(saveAs);        // TODO: Re-add print menuitem when printing is functional        //m.addSeparator();        //m.add(print);        //mapEventAdapter.addListener(print);        m.addSeparator();        m.add(close);        m.add(createMenuItem("Exit", null, "Exit the map editor", "control Q"));        menuBar.add(m);        undoMenuItem = new TMenuItem(undoAction);        redoMenuItem = new TMenuItem(redoAction);        undoMenuItem.setEnabled(false);        redoMenuItem.setEnabled(false);        JMenu transformSub = new JMenu("Transform");        transformSub.add(new TMenuItem(rot90Action, true));        transformSub.add(new TMenuItem(rot180Action, true));        transformSub.add(new TMenuItem(rot270Action, true));        transformSub.addSeparator();        transformSub.add(new TMenuItem(flipHorAction, true));        transformSub.add(new TMenuItem(flipVerAction, true));        mapEventAdapter.addListener(transformSub);        m = new JMenu("Edit");        m.add(undoMenuItem);        m.add(redoMenuItem);        m.addSeparator();        m.add(new TMenuItem(copyAction, true));        m.add(new TMenuItem(cutAction, true));        m.add(new TMenuItem(pasteAction, true));        m.addSeparator();        m.add(transformSub);        m.addSeparator();        m.add(createMenuItem("Preferences...",                    null, "Configure options of the editor", null));        mapEventAdapter.addListener(undoMenuItem);        mapEventAdapter.addListener(redoMenuItem);        menuBar.add(m);        m = new JMenu("Map");        m.add(createMenuItem("Resize", null, "Modify map dimensions"));        m.add(createMenuItem("Search", null, "Search for/Replace tiles"));        m.addSeparator();        m.add(createMenuItem("Properties", null, "Map properties"));        mapEventAdapter.addListener(m);        menuBar.add(m);        layerAdd = createMenuItem("Add Layer", null, "Add a layer");        layerClone = createMenuItem("Duplicate Layer", null,                "Duplicate current layer");        layerDel = createMenuItem("Delete Layer", null,                "Delete current layer");        layerUp = createMenuItem("Move Layer Up", null,                "Move layer up one in layer stack", "shift PAGE_UP");        layerDown = createMenuItem("Move Layer Down", null,                "Move layer down one in layer stack", "shift PAGE_DOWN");        layerMerge = createMenuItem("Merge Down", null,                "Merge current layer onto next lower", "shift control M");        layerMergeAll = createMenuItem("Merge All", null, "Merge all layers");        mapEventAdapter.addListener(layerAdd);        m = new JMenu("Layer");        m.add(layerAdd);        m.add(layerClone);        m.add(layerDel);        m.addSeparator();        m.add(layerUp);        m.add(layerDown);        m.addSeparator();        m.add(layerMerge);        m.add(layerMergeAll);        mapEventAdapter.addListener(m);        menuBar.add(m);        m = new JMenu("Tilesets");        m.add(createMenuItem("New tileset...", null,                    "Add a new internal tileset"));        m.add(createMenuItem("Import tileset...", null,                    "Import an external tileset"));        m.addSeparator();        m.add(createMenuItem("Tileset Manager", null,                    "Open the tileset manager"));        mapEventAdapter.addListener(m);        menuBar.add(m);        /*        m = new JMenu("Objects");        m.add(createMenuItem("Add Object", null, "Add an object"));        mapEventAdapter.addListener(m);        menuBar.add(m);        */        JMenu modifySub = new JMenu("Modify");        modifySub.add(createMenuItem("Expand Selection", null, ""));        modifySub.add(createMenuItem("Contract Selection", null, ""));                m = new JMenu("Select");        m.add(new TMenuItem(selectAllAction, true));        m.add(new TMenuItem(cancelSelectionAction, true));        m.add(new TMenuItem(inverseAction, true));        m.addSeparator();        m.add(modifySub);        mapEventAdapter.addListener(m);        menuBar.add(m);                gridMenuItem = new JCheckBoxMenuItem("Show Grid");        gridMenuItem.addActionListener(this);        gridMenuItem.setToolTipText("Toggle grid");        gridMenuItem.setAccelerator(KeyStroke.getKeyStroke("control G"));        boundaryMenuItem = new JCheckBoxMenuItem("Show Boundaries");        boundaryMenuItem.addActionListener(this);        boundaryMenuItem.setToolTipText("Toggle layer boundaries");        boundaryMenuItem.setAccelerator(KeyStroke.getKeyStroke("control E"));        m = new JMenu("View");        m.add(new TMenuItem(zoomInAction));        m.add(new TMenuItem(zoomOutAction));        m.add(new TMenuItem(zoomNormalAction));        m.addSeparator();        m.add(gridMenuItem);        // TODO: Enable when boudary drawing code finished.        //m.add(boundaryMenuItem);        mapEventAdapter.addListener(m);        menuBar.add(m);        m = new JMenu("Help");        m.add(createMenuItem("About", null, "Show about window"));		m.add(createMenuItem("About Plugins", null, "Show plugin window"));        menuBar.add(m);    }