Package com.pcmsolutions.device.EMU.E4

Examples of com.pcmsolutions.device.EMU.E4.Remotable$Parameter


            // do import!!
            if (comp instanceof PresetContextTable) {
                final PresetContextTable pct = (PresetContextTable) comp;
                int row = pct.getSelectedRow();
                try {
                    ContextPresetSelection ips = ((ContextPresetSelection) t.getTransferData(PresetContextTransferHandler.presetContextFlavor));

                    final ReadablePreset[] sourceReadablePresets = ips.getReadablePresets();
                    final Object[] destRowObjects = new Object[sourceReadablePresets.length];
                    for (int i = 0,j = sourceReadablePresets.length; i < j; i++)
                        destRowObjects[i] = pct.getValueAt(row + i, 0);

                    /*Arrays.sort(sourceReadablePresets);
                    ArrayList destPresetObjs = new ArrayList();
                    for (int i = 0,j = sourceReadablePresets.length; i < j; i++) {
                        if (!(row + i < pct.getRowCount()))
                            break;
                        destPresetObjs.addDesktopElement(pct.getValueAt(row + i, 0));
                    }
                    final ReadablePreset[] dpos = new ReadablePreset[destPresetObjs.size()];
                    destPresetObjs.toArray(dpos);
                    */
                    Integer[] destIndexes = new Integer[destRowObjects.length];

                    for (int i = 0; i < destIndexes.length; i++)
                        destIndexes[i] = ((ReadablePreset) destRowObjects[i]).getPresetNumber();

                    String confirmStr = PresetContextMacros.getOverwriteConfirmationString(((ReadablePreset) destRowObjects[0]).getPresetContext(), destIndexes);

                    int ok = JOptionPane.showConfirmDialog(ZoeosFrame.getInstance(), confirmStr, "Confirm Preset Bulk Copy", JOptionPane.YES_NO_OPTION);
                    if (ok == 0)
                        if (pct.getPresetContext() == ips.getPresetContext())
                            dropContextLocalPresets(destRowObjects, sourceReadablePresets, pct);
                        else
                            dropIsolatedPresets(ips, destRowObjects);
                } catch (UnsupportedFlavorException e) {
                    e.printStackTrace();
View Full Code Here


                }
            }
        }
        if (comp instanceof DefaultPresetEditorPanel) {
            if (t.isDataFlavorSupported(SampleContextTransferHandler.sampleContextFlavor)) {
                ContextSampleSelection sel;
                ReadablePreset rp = ((DefaultPresetEditorPanel) comp).getPreset();
                try {
                    sel = (ContextSampleSelection) t.getTransferData(SampleContextTransferHandler.sampleContextFlavor);
                    if (rp instanceof ContextEditablePreset) {
                        final Integer[] sampleIndexes = sel.getSampleIndexes();
                        if (sampleIndexes.length < 1)
                            return false;

                        try {
                            PresetContextMacros.applySamplesToPreset(((ContextEditablePreset) rp).getPresetContext(), rp.getPresetNumber(), sampleIndexes);
View Full Code Here

    public boolean importData(JComponent comp, Transferable t) {
        if (t.isDataFlavorSupported(SampleContextTransferHandler.sampleContextFlavor)) {
            // do import!!
            if (comp instanceof PresetContextTable) {
                try {
                    final ContextSampleSelection sel = (ContextSampleSelection) t.getTransferData(SampleContextTransferHandler.sampleContextFlavor);
                    final PresetContextTable pct = (PresetContextTable) comp;

                    final int selRow = pct.getSelectedRow();
                    final Integer[] sampleIndexes = sel.getSampleIndexes();

                    Object o = pct.getValueAt(selRow, 0);
                    if (o instanceof ContextEditablePreset)
                        PresetContextMacros.applySamplesToPreset(((ContextEditablePreset) o).getPresetContext(), ((ContextEditablePreset) o).getPresetNumber(), sampleIndexes);
                } catch (UnsupportedFlavorException e) {
View Full Code Here

    }

    public VoiceParameterSelection getSelection() {
        VoiceParameterSelection vps = super.getSelection();
        if (vps != null)
            return new CordParameterSelection(vps);
        return null;
    }
View Full Code Here

    public boolean importData(JComponent comp, Transferable t) {
        if (comp instanceof EditableLinkTable.LinkSelectionAcceptor) {
            if (t.isDataFlavorSupported(LinkTableTransferHandler.linkFlavor)) {
                try {
                    LinkSelection ils = (LinkSelection) t.getTransferData(LinkTableTransferHandler.linkFlavor);
                    ((EditableLinkTable.LinkSelectionAcceptor) comp).setSelection(ils);
                    return true;
                } catch (UnsupportedFlavorException e) {
                    e.printStackTrace();
                } catch (IOException e) {
View Full Code Here

                }
            }
        } else if (comp instanceof EditableLinkTable.LinkSelectionAcceptor) {
            if (t.isDataFlavorSupported(linkFlavor)) {
                try {
                    LinkSelection ils = (LinkSelection) t.getTransferData(linkFlavor);
                    ((EditableLinkTable.LinkSelectionAcceptor) comp).setSelection(ils);
                    return true;
                } catch (UnsupportedFlavorException e) {
                    e.printStackTrace();
                } catch (IOException e) {
View Full Code Here

        int[] selCols = getSelectedColumns();
        // map columns to TableColumnModel
        for (int i = 0, n = selCols.length; i < n; i++)
            selCols[i] = convertColumnIndexToModel(selCols[i]) - 1; // +1 used here to compensate for row header

        return new MultiModeSelection(device, mmtm.getMultimodeContext(), selCols, selRows);
    }
View Full Code Here

            }
        }
        if (comp instanceof EditablePresetParameterTable.PresetParameterSelectionAcceptor) {
            if (t.isDataFlavorSupported(PresetParameterTableTransferHandler.presetParameterFlavor)) {
                try {
                    PresetParameterSelection pps = (PresetParameterSelection) t.getTransferData(PresetParameterTableTransferHandler.presetParameterFlavor);
                    ((EditablePresetParameterTable.PresetParameterSelectionAcceptor) comp).setSelection(pps);
                    return true;
                } catch (UnsupportedFlavorException e) {
                    e.printStackTrace();
                } catch (IOException e) {
View Full Code Here

            }
            Object obj = getModel().getValueAt(row, 0);

            Integer[] ids = (Integer[]) idList.toArray(new Integer[idList.size()]);
            if (obj instanceof ReadablePreset.ReadableVoice)
                return new VoiceParameterSelection((ReadablePreset.ReadableVoice) obj, ids);
            else if (obj instanceof ReadablePreset.ReadableVoice.ReadableZone)
                return new VoiceParameterSelection(((ReadablePreset.ReadableVoice.ReadableZone) obj).getVoice(), ids, ((ReadablePreset.ReadableVoice.ReadableZone) obj).getZoneParams(ids));
            else
                throw new IllegalStateException("column 0 is not a voice nor a zone");
        }
        return null;
    }
View Full Code Here

            }

        Integer[] arrIds = new Integer[ids.size()];
        ids.toArray(arrIds);
        try {
            return new VoiceParameterSelection(voice, arrIds, VoiceParameterSelection.voiceCategoryStringToEnum(category));
        } catch (ZDeviceNotRunningException e) {
            e.printStackTrace();
        } catch (IllegalParameterIdException e) {
            e.printStackTrace();
        } catch (PresetEmptyException e) {
View Full Code Here

TOP

Related Classes of com.pcmsolutions.device.EMU.E4.Remotable$Parameter

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.