Package ptolemy.kernel.util

Examples of ptolemy.kernel.util.IllegalActionException


        case _UNITARY:
            idftParameters.add(DFTDescriptor.SCALING_UNITARY);
            break;

        default:
            throw new IllegalActionException(this,
                    "Invalid value for scaling type");
        }

        switch (_dataNature) {
        case _COMPLEX_TO_COMPLEX:
            idftParameters.add(DFTDescriptor.COMPLEX_TO_COMPLEX);
            break;

        case _COMPLEX_TO_REAL:
            idftParameters.add(DFTDescriptor.COMPLEX_TO_REAL);
            break;

        case _REAL_TO_COMPLEX:
            idftParameters.add(DFTDescriptor.REAL_TO_COMPLEX);
            break;

        default:
            throw new IllegalActionException(this, "Invalid data natures");
        }

        RenderedOp newImage = JAI.create("idft", idftParameters);
        output.send(0, new JAIImageToken(newImage));
    }
View Full Code Here


            // Need an effigy and a tableau so that menu ops work properly.
            if (_tableau == null) {
                Effigy containerEffigy = Configuration.findEffigy(toplevel());

                if (containerEffigy == null) {
                    throw new IllegalActionException(this,
                            "Cannot find effigy for top level: "
                                    + toplevel().getFullName());
                }

                try {
                    _effigy = new TokenEffigy(containerEffigy, containerEffigy
                            .uniqueName("tokenEffigy"));

                    // The default identifier is "Unnamed", which is
                    // no good for two reasons: Wrong title bar label,
                    // and it causes a save-as to destroy the original window.
                    _effigy.identifier.setExpression(getFullName());

                    // The second argument prevents a status bar.
                    _frame = new TableauFrame(null, null, this);
                    _tableau = new MatrixTokenTableau(_effigy, "tokenTableau",
                            (TableauFrame) _frame);
                    ((TableauFrame) _frame).setTableau(_tableau);
                    setFrame(_frame);
                    _tableau.show();
                } catch (Exception ex) {
                    throw new IllegalActionException(this, null, ex,
                            "Error creating effigy and tableau");
                }
            } else {
                // Erase previous text.
                _effigy.clear();
View Full Code Here

        if (attribute == errorTolerance) {
            double tolerance = ((DoubleToken) errorTolerance.getToken())
                    .doubleValue();

            if (tolerance <= 0.0) {
                throw new IllegalActionException(this,
                        "Error tolerance must be greater than 0.");
            }

            _errorTolerance = tolerance;
        } else if (attribute == direction) {
            String crossingDirections = direction.stringValue();

            if (crossingDirections.equalsIgnoreCase("falling")) {
                _detectFallingCrossing = true;
                _detectRisingCrossing = false;
            } else if (crossingDirections.equalsIgnoreCase("rising")) {
                _detectFallingCrossing = false;
                _detectRisingCrossing = true;
            } else if (crossingDirections.equalsIgnoreCase("both")) {
                _detectFallingCrossing = true;
                _detectRisingCrossing = true;
            } else {
                throw new IllegalActionException("Unknown direction: "
                        + crossingDirections);
            }
        } else if (attribute == level) {
            _level = ((DoubleToken) level.getToken()).doubleValue();
        } else {
View Full Code Here

     @exception IllegalActionException If the director is not
     *  a CTDirector or the parent class throws it.
     */
    public void preinitialize() throws IllegalActionException {
        if (!(getDirector() instanceof CTDirector)) {
            throw new IllegalActionException("LevelCrossingDetector can only"
                    + " be used inside CT domain.");
        }

        super.preinitialize();
    }
View Full Code Here

            int max = ((IntToken) maximum.getToken()).intValue();
            int major = ((IntToken) majorTickSpacing.getToken()).intValue();
            int minor = ((IntToken) minorTickSpacing.getToken()).intValue();

            if ((min > max)) {
                throw new IllegalActionException(this, "The minimum value "
                        + "of the slider cannot be larger than the maximum "
                        + "value.");
            }

            if (slider != null) {
View Full Code Here

            throws IllegalActionException {
        if (attribute == samplePeriod) {
            double p = ((DoubleToken) samplePeriod.getToken()).doubleValue();

            if (p <= 0) {
                throw new IllegalActionException(this,
                        " Sample period must be greater than 0.");
            } else {
                _samplePeriod = p;
            }
        } else {
View Full Code Here

            } else if (typeName.equals("bilinear")) {
                _interpolationType = _BILINEAR;
            } else if (typeName.equals("nearestNeighbor")) {
                _interpolationType = _NEARESTNEIGHBOR;
            } else {
                throw new IllegalActionException(this,
                        "Unrecognized interpolation type: " + typeName);
            }
        } else if (attribute == xScaleFactor) {
            _xScaleFactor = ((DoubleToken) xScaleFactor.getToken())
                    .doubleValue();
View Full Code Here

        case _NEARESTNEIGHBOR:
            parameters.add(new InterpolationNearest());
            break;

        default:
            throw new IllegalActionException(
                    "Invalid value for interpolationType");
        }

        RenderedOp newImage = JAI.create("scale", parameters);
        output.send(0, new JAIImageToken(newImage));
View Full Code Here

            throws IllegalActionException {
        if (attribute == fileOrURL) {
            _fileURL = fileOrURL.asURL();

            if (_fileURL == null) {
                throw new IllegalActionException("No such file: "
                        + fileOrURL.getExpression());
            }
        } else {
            super.attributeChanged(attribute);
        }
View Full Code Here

                // If we are running under the windows installer, Web Start
                // or any other jar based installation, we need to be
                // able to handle images in jar files.
                seekableStream = new FileCacheSeekableStream(inputStream);
            } catch (IOException ex) {
                throw new IllegalActionException(this, ex,
                        "Unable to load file '" + _fileURL + "'");
            }

            _outputtedImage = JAI.create("stream", seekableStream);

            /*PlanarImage dummy =*/_outputtedImage.getRendering();
        } finally {
            if (seekableStream != null) {
                try {
                    seekableStream.close();
                } catch (Throwable throwable2) {
                    throw new IllegalActionException(this, throwable2,
                            "Unable to close SeekableStream for '" + _fileURL
                                    + "'");
                }
            }

            if (inputStream != null) {
                try {
                    inputStream.close();
                } catch (Throwable throwable3) {
                    throw new IllegalActionException(this, throwable3,
                            "Unable to close InputStream for '" + _fileURL
                                    + "'");
                }
            }
        }
View Full Code Here

TOP

Related Classes of ptolemy.kernel.util.IllegalActionException

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.