Search in sources :

Example 1 with UnitPrintQueueDialog

use of megameklab.com.ui.dialog.UnitPrintQueueDialog in project megameklab by MegaMek.

the class UnitPrintManager method printMenu.

public static JMenu printMenu(final JFrame parent, JMenuItem item) {
    JMenu printMenu = new JMenu("Print");
    printMenu.setMnemonic(KeyEvent.VK_P);
    printMenu.add(item);
    printMenu.addSeparator();
    item = new JMenuItem("Queue Units to Print");
    item.setMnemonic(KeyEvent.VK_Q);
    item.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            new UnitPrintQueueDialog(parent);
        }
    });
    printMenu.add(item);
    printMenu.addSeparator();
    item = new JMenuItem("Other Unit");
    item.setMnemonic(KeyEvent.VK_O);
    item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
    item.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            UnitPrintManager.printSelectedUnit(parent);
        }
    });
    printMenu.add(item);
    item = new JMenuItem("From File");
    item.setMnemonic(KeyEvent.VK_I);
    item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.CTRL_MASK));
    item.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            UnitPrintManager.printUnitFile(parent);
        }
    });
    printMenu.add(item);
    item = new JMenuItem("From File (Single Unit Per RS)");
    item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK));
    item.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            UnitPrintManager.printUnitFile(parent, true);
        }
    });
    printMenu.add(item);
    printMenu.addSeparator();
    item = new JMenuItem("From MUL");
    item.setMnemonic(KeyEvent.VK_M);
    item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, ActionEvent.CTRL_MASK));
    item.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            UnitPrintManager.printMuls(parent, false);
        }
    });
    printMenu.add(item);
    item = new JMenuItem("From MUL (Single Unit Per RS)");
    item.setMnemonic(KeyEvent.VK_R);
    item.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            UnitPrintManager.printMuls(parent, true);
        }
    });
    printMenu.add(item);
    return printMenu;
}
Also used : ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) UnitPrintQueueDialog(megameklab.com.ui.dialog.UnitPrintQueueDialog) JMenuItem(javax.swing.JMenuItem) JMenu(javax.swing.JMenu)

Aggregations

ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 JMenu (javax.swing.JMenu)1 JMenuItem (javax.swing.JMenuItem)1 UnitPrintQueueDialog (megameklab.com.ui.dialog.UnitPrintQueueDialog)1