Package com.pcmsolutions.system

Examples of com.pcmsolutions.system.CommandFailedException


        try {
            if (num == 0) {
                // try use primary target
                p = getTarget();
                if (p == null)
                    throw new CommandFailedException("Null Target");
                ParameterModelUtilities.dispatchEditChainGroups(ParameterModelUtilities.extractEditableParameterModelChainGroups(new Object[]{p}), new EditableParameterModel.EditChainValueProvider() {
                    public Integer getValue(EditableParameterModel model, EditableParameterModel leadModel) throws ParameterUnavailableException {
                        try {
                            return reflectValue(model);
                        } catch (ParameterUnavailableException e) {
View Full Code Here


        } else { // from argument[0]
            int temp_pivot;
            try {
                temp_pivot = p.getParameterDescriptor().getValueForUnitlessString(pivotStr).intValue();
            } catch (Exception e) {
                throw new CommandFailedException("pivot is invalid");
            }

            if (!p.getParameterDescriptor().isValidValue(IntPool.get(temp_pivot)))
                throw new CommandFailedException("pivot value is not valid");
            pivot = temp_pivot - minv;
        }

        float nv = 2 * pivot - val;

View Full Code Here

    public void execute(Object invoker, Object[] arguments) throws IllegalArgumentException, CommandFailedException  // IllegalArgumentException thrown for insufficient number of arguments
    {
        ReadablePreset[] presets = getTargets();

        if (!PresetContextMacros.areAllSameContext(presets))
            throw new CommandFailedException("Presets must be all from same context");

        presetIndexes = PresetContextMacros.extractUniquePresetIndexes(presets);
        pc = presets[0].getPresetContext();

        synchronized (this) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    new CreatePresetPackageDialog(ZoeosFrame.getInstance(), "New Preset Package");
                }
            });
            while (true) {
                try {
                    wait();
                    if (done)
                        break;
                } catch (InterruptedException e) {
                }
            }
        }

        if (err != null)
            throw new CommandFailedException(err.getMessage());
    }
View Full Code Here

    private void createAndSavePresetPackage(PresetContext pc, Integer[] indexes, String name, String notes, boolean is, AudioFileFormat.Type format, boolean im, boolean imm) throws CommandFailedException {
        PresetPackage pkg = null;
        try {
            pkg = PackageFactory.createPresetPackage(pc, indexes, true, name, notes, im, imm, is, format, null);
        } catch (PackageGenerationException e) {
            throw new CommandFailedException("Error saving preset package: " + e.getMessage());
        }
        File extFile = null;
        synchronized (this.getClass()) {
            assertChooser();
            fc.setSelectedFile(new File(name));
            int retval = fc.showSaveDialog(ZoeosFrame.getInstance());
            if (retval == JFileChooser.APPROVE_OPTION) {
                File f = fc.getSelectedFile();
                //File extFile = new File(f.getAbsolutePath() + "." + PresetPackage.PRESET_PKG_EXT);
                extFile = ZUtilities.replaceExtension(f, PresetPackage.PRESET_PKG_EXT);

                if (extFile.exists() && JOptionPane.showConfirmDialog(ZoeosFrame.getInstance(), "Overwrite " + extFile.getName() + " ?", "File Already Exists", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == 1)
                    return;

                ZPREF_lastDir.putValue(extFile.getAbsolutePath());
            }
        }
        if (extFile != null) {
            try {
                PackageFactory.savePresetPackage(pkg, extFile);
            } catch (PackageGenerationException e) {
                throw new CommandFailedException("Error saving preset package: " + e.getMessage());
            } finally {
                try {
                    pc.getDeviceContext().sampleMemoryDefrag(false);
                } catch (ZDeviceNotRunningException e) {
                } catch (RemoteUnreachableException e) {
View Full Code Here

                    }
                    Thread.yield();
                }
            }
        } catch (NoSuchPresetException e) {
            throw new CommandFailedException("Preset Not Found.");
        }
    }
View Full Code Here

        }
    }

    private void refreshPreset(ReadablePreset p) throws CommandFailedException, NoSuchPresetException {
        if (p == null)
            throw new CommandFailedException("Null Target");
        p.refreshPreset();
    }
View Full Code Here

                    links[n].removeLink();
                    Thread.yield();
                }
            }
        } catch (NoSuchPresetException e) {
            throw new CommandFailedException("Preset Not Found.");
        } catch (NoSuchLinkException e) {
            throw new CommandFailedException("No such link ");
        } catch (PresetEmptyException e) {
            throw new CommandFailedException("Preset Empty");
        }
    }
View Full Code Here

        try {
            if (num == 0) {
                // try use primary target
                p = getTarget();
                if (p == null)
                    throw new CommandFailedException("Null Target");
                maxValue(p);
            }
            for (int n = 0; n < num; n++) {
                maxValue(params[n]);
                Thread.yield();
            }
        } catch (ParameterValueOutOfRangeException e) {
            throw new CommandFailedException("Parameter Value Out Of Range");
        } catch (IllegalParameterIdException e) {
            throw new CommandFailedException("Illegal Parameter");
        } catch (ParameterUnavailableException e) {
            throw new CommandFailedException("Parameter unavailable");
        }
    }
View Full Code Here

        }
    }

    private void maxValue(EditableParameterModel p) throws ParameterValueOutOfRangeException, ParameterUnavailableException, CommandFailedException, IllegalParameterIdException {
        if (p == null)
            throw new CommandFailedException("Null Target");
        p.setValue(p.getParameterDescriptor().getMaxValue());
    }
View Full Code Here

        try {
            if (num == 0) {
                // try use primary target
                p = getTarget();
                if (p == null)
                    throw new CommandFailedException("Null Target");
                midValue(p);
            }
            for (int n = 0; n < num; n++) {
                midValue(params[n]);
                Thread.yield();
            }
        } catch (Exception e) {
            throw new CommandFailedException(e.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of com.pcmsolutions.system.CommandFailedException

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.