ISingleDriver d = (ISingleDriver)p.getDriver(); d.calculateChecksum(p); d.sendPatch(p);
frameActivated();
    protected PatchEditorFrame(String name, IPatch patch) {        // create a resizable, closable, maximizable, and iconifiable frame.        super(name, true, true, true, true);        p = patch;        // make a backup copy        originalPatch = (IPatch)p.clone();        gbc = new GridBagConstraints();        scrollPane = new JPanel();        scrollPane.setLayout(new GridBagLayout());        scrollPane.setSize(600, 400);        scroller = new JScrollPane(scrollPane);        getContentPane().add(scroller);        setSize(600, 400);        moveToDefaultLocation();        faderInEnable(PatchEdit.appConfig.getFaderEnable());        scroller.getVerticalScrollBar().addMouseListener(new MouseAdapter() {                public void mousePressed(MouseEvent e) {                }                public void mouseReleased(MouseEvent e) {                    repaint();                }            });        scroller.getHorizontalScrollBar().addMouseListener(new MouseAdapter() {                public void mousePressed(MouseEvent e) {                }                public void mouseReleased(MouseEvent e) {                    repaint();                }            });        addJSLFrameListener(new JSLFrameListener() {                public void JSLFrameClosing(JSLFrameEvent e) {                    String[] choices = new String[] {"Keep Changes",                                                     "Revert to Original",                                                     "Place Changed Version on Clipboard"                    };                    int choice;                    do {                        choice = JOptionPane.showOptionDialog                            ((Component) null,                             "What do you wish to do with the changed copy of the Patch?",                             "Save Changes?",                             JOptionPane.OK_OPTION, JOptionPane.QUESTION_MESSAGE,                             null, choices, choices[0]);                    } while (choice == JOptionPane.CLOSED_OPTION);                    if (choice == 0) { // "Keep Changes"                        if (bankFrame != null)                            bankFrame.myModel.setPatchAt(p, patchRow, patchCol);                    } else {                        if (choice == 2) // "Place Changed Version on Clipboard"                            //put on clipboard but don't 'return' just yet                            copySelectedPatch();                        //restore backup                        p.useSysexFromPatch(originalPatch);                    }                }                public void JSLFrameOpened(JSLFrameEvent e) {                }                public void JSLFrameActivated(JSLFrameEvent e) {                    // XXX: Do we really want to send the patch every                    //      time the editor gets focus?                    ISingleDriver d = (ISingleDriver)p.getDriver();                    d.calculateChecksum(p);                    d.sendPatch(p);                    gotFocus();                    Actions.setEnabled(false,                                         Actions.EN_GET                                         | Actions.EN_PASTE);                    Actions.setEnabled(true,                                         Actions.EN_COPY                                         | Actions.EN_EXPORT                                         | Actions.EN_PLAY                                         | Actions.EN_REASSIGN                                         | Actions.EN_SEND                                         | Actions.EN_SEND_TO                                         | Actions.EN_STORE);                }                public void JSLFrameClosed(JSLFrameEvent e) {                }                public void JSLFrameDeactivated(JSLFrameEvent e) {                    Actions.setEnabled(false,                                         Actions.EN_COPY                                         | Actions.EN_EXPORT                                         | Actions.EN_PLAY                                         | Actions.EN_REASSIGN                                         | Actions.EN_SEND                                         | Actions.EN_SEND_TO                                         | Actions.EN_STORE);                    lostFocus();                }                public void JSLFrameDeiconified(JSLFrameEvent e) {                }                public void JSLFrameIconified(JSLFrameEvent e) {                }            });    }