Package com.pcmsolutions.device.EMU.E4.zcommands

Examples of com.pcmsolutions.device.EMU.E4.zcommands.AbstractDeviceContextZMTCommand


        if (newSelection)
            this.clearSelection();
        String name;
        Integer firstSelectedPreset = null;
        for (int i = 0,j = pctm.getRowCount(); i < j; i++) {
            ReadablePreset preset = (ReadablePreset) pctm.getValueAt(i, 1);
            try {
                if (useDisplayName)
                    name = preset.getPresetDisplayName();
                else
                    name = preset.getPresetName();
            } catch (NoSuchPresetException e) {
                continue;
            } catch (PresetEmptyException e) {
                name = DeviceContext.EMPTY_PRESET;
            }
            m = p.matcher(name);

            boolean res = false;
            if (fullMatch)
                res = m.matches();
            else
                res = m.find();

            if (res) {
                if (firstSelectedPreset == null)
                    firstSelectedPreset = preset.getPresetNumber();
                this.addRowSelectionInterval(i, i);
                this.addColumnSelectionInterval(0, 0);
            }
        }
        return firstSelectedPreset;
View Full Code Here


            for (int i = 0; i < destSamples.length; i++)
                sendSample(destSamples[i], is.getLocalFile(), destNames[i]);
        }

        public void copySample(Integer srcSample, Integer[] destSamples, String[] destNames) throws SampleMediator.SampleMediationException {
            SampleRetrievalInfo sri = new Impl_SampleRetrievalInfo(srcSample);
            retrieveSample(sri);
            for (int i = 0; i < destSamples.length; i++)
                if (srcSample.intValue() != destSamples[i].intValue())
                    sendSample(destSamples[i], sri.getFile(), destNames[i]);
        }
View Full Code Here

    protected JMenuItem[] getCustomMenuItems() {
        JMenuItem smi = null;
        Object[] selObjs = ZUtilities.eliminateInstances(this.getSelObjects(), String.class);
        try {
            SampleContext sc = preset.getDeviceContext().getDefaultSampleContext();
            if (ClassUtility.areAllInstanceOf(selObjs, ReadableParameterModel.class)) {
                ReadableParameterModel[] models = (ReadableParameterModel[]) Arrays.asList(selObjs).toArray(new ReadableParameterModel[selObjs.length]);
                if (ParameterModelUtilities.areAllOfId(models, 38) && !ParameterModelUtilities.areAllOfValue(models, 0)) {
                    Set s = ParameterModelUtilities.getValueSet(models);
                    ReadableSample[] samples = new ReadableSample[s.size()];
                    int si = 0;
                    for (Iterator i = s.iterator(); i.hasNext();)
                        samples[si++] = convertPassThroughSample(sc.getReadableSample((Integer) i.next()));
                    String mstr;
                    if (samples.length == 1)
                        mstr = samples[0].getSampleDisplayName();
                    else
                        mstr = "Selected samples";
View Full Code Here

            for (int i = 0; i < destSamples.length; i++)
                sendSample(destSamples[i], is.getLocalFile(), destNames[i]);
        }

        public void copySample(Integer srcSample, Integer[] destSamples, String[] destNames) throws SampleMediator.SampleMediationException {
            SampleRetrievalInfo sri = new Impl_SampleRetrievalInfo(srcSample);
            retrieveSample(sri);
            for (int i = 0; i < destSamples.length; i++)
                if (srcSample.intValue() != destSamples[i].intValue())
                    sendSample(destSamples[i], sri.getFile(), destNames[i]);
        }
View Full Code Here

        for (int i = 0,j = sobjs.length; i < j; i++)
            if (sobjs[i] instanceof ReadablePreset)
                readablePresets.add(sobjs[i]);

        return new ContextPresetSelection(presetContext.getDeviceContext(), presetContext, (ReadablePreset[]) readablePresets.toArray(new ReadablePreset[readablePresets.size()]));
    }
View Full Code Here

            // 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

TOP

Related Classes of com.pcmsolutions.device.EMU.E4.zcommands.AbstractDeviceContextZMTCommand

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.