Package com.pcmsolutions.device.EMU.E4.gui.table

Examples of com.pcmsolutions.device.EMU.E4.gui.table.DragAndDropTable


            id2col.put(IntPool.get(id), IntPool.get(i + 1));

            colWidthCount += columnData[i].width;

            if (id == 44) {
                arrSectionData.add(new SectionData(
                        UIColors.getTableFirstSectionBG(),
                        UIColors.getTableFirstSectionFG(),
                        colWidthCount,
                        "MAIN"));
                sectionIndex++;
                colWidthCount = 0;
            } else if (id == 48) {
                arrSectionData.add(new SectionData(
                        UIColors.getTableSecondSectionBG(),
                        UIColors.getTableSecondSectionFG(),
                        colWidthCount,
                        "KEY WIN", new MouseAdapter() {
                            public void mouseReleased(MouseEvent e) {
                                if (e.isPopupTrigger()) {
                                    new WinPopupMenu(WinValueProfile.ZPREF_keyWinDisplayMode).getPopupMenu().show(e.getComponent(), e.getX(), e.getY());
                                }
                            }

                            public void mousePressed(MouseEvent e) {
                                if (e.isPopupTrigger()) {
                                    new WinPopupMenu(WinValueProfile.ZPREF_keyWinDisplayMode).getPopupMenu().show(e.getComponent(), e.getX(), e.getY());
                                }
                            }

                            public void mouseClicked(MouseEvent e) {
                                if (e.isPopupTrigger()) {
                                    new WinPopupMenu(WinValueProfile.ZPREF_keyWinDisplayMode).getPopupMenu().show(e.getComponent(), e.getX(), e.getY());
                                } else if (e.getClickCount() >= 2) {
                                    try {
                                        WinValueProfile.ZPREF_keyWinDisplayMode.putValue((WinValueProfile.ZPREF_keyWinDisplayMode.getValue() + 1) % 3);
                                    } catch (Exception e1) {
                                        e1.printStackTrace();
                                    }
                                }
                            }
                        }));
                sectionIndex++;
                colWidthCount = 0;

            } else if (id == 52) {
                arrSectionData.add(new SectionData(
                        UIColors.getTableThirdSectionBG(),
                        UIColors.getTableThirdSectionFG(),
                        colWidthCount,
                        "VELOCITY WIN", new MouseAdapter() {
                            public void mouseReleased(MouseEvent e) {
                                if (e.isPopupTrigger()) {
                                    new WinPopupMenu(WinValueProfile.ZPREF_velWinDisplayMode).getPopupMenu().show(e.getComponent(), e.getX(), e.getY());
                                }
                            }

                            public void mousePressed(MouseEvent e) {
                                if (e.isPopupTrigger()) {
                                    new WinPopupMenu(WinValueProfile.ZPREF_velWinDisplayMode).getPopupMenu().show(e.getComponent(), e.getX(), e.getY());
                                }
                            }

                            public void mouseClicked(MouseEvent e) {
                                if (e.isPopupTrigger()) {
                                    new WinPopupMenu(WinValueProfile.ZPREF_velWinDisplayMode).getPopupMenu().show(e.getComponent(), e.getX(), e.getY());
                                } else if (e.getClickCount() >= 2) {
                                    try {
                                        WinValueProfile.ZPREF_velWinDisplayMode.putValue((WinValueProfile.ZPREF_velWinDisplayMode.getValue() + 1) % 3);
                                    } catch (Exception e1) {
                                        e1.printStackTrace();
                                    }
                                }
                            }
                        }));
                sectionIndex++;
                colWidthCount = 0;
            } else if (id == 56) {
                arrSectionData.add(new SectionData(
                        UIColors.getTableFourthSectionBG(),
                        UIColors.getTableFourthSectionFG(),
                        colWidthCount,
                        "REALTIME WIN", new MouseAdapter() {
                            public void mouseReleased(MouseEvent e) {
                                if (e.isPopupTrigger()) {
                                    new WinPopupMenu(WinValueProfile.ZPREF_rtWinDisplayMode).getPopupMenu().show(e.getComponent(), e.getX(), e.getY());
                                }
                            }

                            public void mousePressed(MouseEvent e) {
                                if (e.isPopupTrigger()) {
                                    new WinPopupMenu(WinValueProfile.ZPREF_rtWinDisplayMode).getPopupMenu().show(e.getComponent(), e.getX(), e.getY());
                                }
                            }

                            public void mouseClicked(MouseEvent e) {
                                if (e.isPopupTrigger()) {
                                    new WinPopupMenu(WinValueProfile.ZPREF_rtWinDisplayMode).getPopupMenu().show(e.getComponent(), e.getX(), e.getY());
                                } else if (e.getClickCount() >= 2) {
                                    try {
                                        WinValueProfile.ZPREF_rtWinDisplayMode.putValue((WinValueProfile.ZPREF_rtWinDisplayMode.getValue() + 1) % 3);
                                    } catch (Exception e1) {
                                        e1.printStackTrace();
                                    }
                                }
                            }
                        }));
                sectionIndex++;
                colWidthCount = 0;
            } else if (customIds.length > 0 && id == (customIds[customIds.length - 1]).intValue()) {
                arrSectionData.add(new SectionData(
                        UIColors.getTableFifthSectionBG(),
                        UIColors.getTableFifthSectionFG(),
                        colWidthCount,
                        "USER"));
                sectionIndex++;
View Full Code Here


        // replace "" below with " " to make the section headers visible
        String sStr = "";
        //if (totalChnls > 16)
        //    sStr = " ";

        sectionData[0] = new SectionData(UIColors.getTableFirstSectionBG(), UIColors.getTableFirstSectionFG(), pw, sStr);
        sectionData[1] = new SectionData(UIColors.getTableSecondSectionBG(), UIColors.getTableSecondSectionFG(), vw + pnw + sw, sStr);
    }
View Full Code Here

        super(dev);
        this.ids = new Integer[ids.length];
        this.vals = new Integer[ids.length];
        //this.valStrings = new String[ids.length];
        this.category = category;
        MasterContext mc = dev.getMasterContext();
        DeviceParameterContext dpc = dev.getDeviceParameterContext();
        this.ids = (Integer[]) ids.clone();
        vals = mc.getMasterParams(ids);

        /*for (int i = 0, n = ids.length; i < n; i++) {
            try {
                valStrings[i] = deviceParameterContext.getMasterContext().getParameterDescriptor(ids[i]).getStringForValue(vals[i]);
            } catch (ParameterValueOutOfRangeException e) {
View Full Code Here

            return has32Channels;
        }

        private void assertCh(Integer ch) throws IllegalMidiChannelException {
            if (ch.intValue() < 1 || (has32Channels && ch.intValue() > 32) || (!has32Channels && ch.intValue() > 16))
                throw new IllegalMidiChannelException(ch);
        }
View Full Code Here

    protected JMenuItem[] getCustomMenuItems() {
        final int[] selRows = this.getSelectedRows();
        Action sda = new AbstractAction("Disable Channel") {
            public void actionPerformed(ActionEvent e) {
                MultiModeContext mmc = null;
                try {
                    mmc = device.getMultiModeContext();
                    for (int i = 0,j = selRows.length; i < j; i++) {
                        try {
                            mmc.setPreset(IntPool.get(selRows[i] + 1), IntPool.get(-1));
                        } catch (IllegalMidiChannelException e1) {
                            e1.printStackTrace();
                        }
                    }
                } catch (ZDeviceNotRunningException e1) {
                    e1.printStackTrace();
                }
            }
        };
        JMenuItem pmi = null;
        try {
            ArrayList selPresets = new ArrayList();
            PresetContext dpc = device.getDefaultPresetContext();
            MultiModeContext mmc = device.getMultiModeContext();
            for (int i = 0; i < selRows.length; i++) {
                Integer preset = mmc.getPreset(IntPool.get(selRows[i] + 1));        // +1 because midi channels indexed from 1
                if (preset.intValue() >= 0)
                    selPresets.add(dpc.getReadablePreset(preset));
            }
            if (selPresets.size() > 0) {
View Full Code Here

    }

    public boolean checkPopup(MouseEvent e) {
        if (e.isPopupTrigger()) {
            Object[] sels = new Object[0];
            MultiModeContext mmc;
            try {
                mmc = this.device.getMultiModeContext();
            } catch (ZDeviceNotRunningException e1) {
                return false;
            }
View Full Code Here

        private final Integer[] values = new Integer[4];
        private final String[] valueStrings = new String[4];

        public Impl_MultiModeChannelSelection(MultiModeContext mmc, int[] selCols, int row) {
            channel = IntPool.get(row + 1);
            MultiModeDescriptor mmd = mmc.getMultiModeDescriptor();
            GeneralParameterDescriptor preset_pd = mmd.getPresetParameterDescriptor();
            GeneralParameterDescriptor vol_pd = mmd.getVolumeParameterDescriptor();
            GeneralParameterDescriptor pan_pd = mmd.getPanParameterDescriptor();
            GeneralParameterDescriptor submix_pd = mmd.getSubmixParameterDescriptor();

            MultiModeMap m = mmc.getMultimodeMap();

            for (int i = 0, n = selCols.length; i < n; i++) {
                if (selCols[i] == 0) {
View Full Code Here

            GeneralParameterDescriptor preset_pd = mmd.getPresetParameterDescriptor();
            GeneralParameterDescriptor vol_pd = mmd.getVolumeParameterDescriptor();
            GeneralParameterDescriptor pan_pd = mmd.getPanParameterDescriptor();
            GeneralParameterDescriptor submix_pd = mmd.getSubmixParameterDescriptor();

            MultiModeMap m = mmc.getMultimodeMap();

            for (int i = 0, n = selCols.length; i < n; i++) {
                if (selCols[i] == 0) {
                    try {
                        values[0] = m.getPreset(channel);
                        valueStrings[0] = preset_pd.getStringForValue(values[0]);
                    } catch (IllegalMidiChannelException e) {
                        e.printStackTrace();
                    } catch (ParameterValueOutOfRangeException e) {
                        e.printStackTrace();
                    }
                }

                if (selCols[i] == 1) {
                    try {
                        values[1] = m.getVolume(channel);
                        valueStrings[1] = vol_pd.getStringForValue(values[1]);
                    } catch (IllegalMidiChannelException e) {
                        e.printStackTrace();
                    } catch (ParameterValueOutOfRangeException e) {
                        e.printStackTrace();
                    }
                }
                if (selCols[i] == 2) {
                    try {
                        values[2] = m.getPan(channel);
                        valueStrings[2] = pan_pd.getStringForValue(values[2]);
                    } catch (IllegalMidiChannelException e) {
                        e.printStackTrace();
                    } catch (ParameterValueOutOfRangeException e) {
                        e.printStackTrace();
                    }
                }
                if (selCols[i] == 3) {
                    try {
                        values[3] = m.getSubmix(channel);
                        valueStrings[3] = submix_pd.getStringForValue(values[3]);
                    } catch (IllegalMidiChannelException e) {
                        e.printStackTrace();
                    } catch (ParameterValueOutOfRangeException e) {
                        e.printStackTrace();
View Full Code Here

        dropOverExtent = -1;
    }

    public void setSelection(VoiceParameterSelection sel) {
        try {
            DeviceParameterContext dpc = voices[0].getPreset().getDeviceParameterContext();
            Integer[] ids = sel.getIds();
            Integer[] vals = sel.getVals();
            int thisCat = VoiceParameterSelection.voiceCategoryStringToEnum(category);
            int selCat = sel.getCategory();
            if (thisCat != selCat) {
                for (int i = 0,j = ids.length; i < j; i++) {
                    // need convert ids first
                    ids[i] = ParameterUtilities.convertVoiceEnvelopeId(thisCat, selCat, ids[i]);
                    vals[i] = dpc.getParameterDescriptor(ids[i]).constrainValue(vals[i]);
                }
            }

            try {
                PresetContextMacros.setContextVoicesParam(voices, ids, vals);
View Full Code Here

        this.ids = new Integer[ids.length];
        this.vals = new Integer[ids.length];
        //this.valStrings = new String[ids.length];
        this.category = category;
        MasterContext mc = dev.getMasterContext();
        DeviceParameterContext dpc = dev.getDeviceParameterContext();
        this.ids = (Integer[]) ids.clone();
        vals = mc.getMasterParams(ids);

        /*for (int i = 0, n = ids.length; i < n; i++) {
            try {
View Full Code Here

TOP

Related Classes of com.pcmsolutions.device.EMU.E4.gui.table.DragAndDropTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.