Package ptolemy.kernel.util

Examples of ptolemy.kernel.util.IllegalActionException


        case _NEARESTNEIGHBOR:
            _interpolation = new InterpolationNearest();
            break;

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

        RenderedOp newImage = JAI.create("affine", oldImage, _affineTransform,
                _interpolation);
View Full Code Here


                    _entity = parser.parse(null, url);
                    ParserAttribute parserAttribute = new ParserAttribute(
                            _entity, "_parser");
                    parserAttribute.setParser(parser);
                } catch (Exception ex) {
                    throw new IllegalActionException(this, ex,
                            "Failed to read model from: " + url);
                }
            } else {
                // No URL given, so we should create a blank entity.
                _createBlankEntity();
View Full Code Here

                _effigy = new PtolemyEffigy(containerEffigy,
                        "ModelDisplay Effigy");
                _effigy.setModel(_entity);
                _tableau = new Tableau(_effigy, "tableau");
            } catch (NameDuplicationException e) {
                throw new IllegalActionException(this, e,
                        "Failed to create tableau.");
            }
            _frame = new TableauFrame(_tableau);
            setFrame(_frame);
            _tableau.setFrame(_frame);
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 == subSampleBits) {
            _subSampleBits = ((IntToken) subSampleBits.getToken()).intValue();
        } else if (attribute == xOrigin) {
View Full Code Here

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

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

        RenderedOp newImage = JAI.create("Rotate", parameters);
View Full Code Here

        if (_debugging) {
            _debug("Invoking fire");
        }

        if (modelString.getWidth() < 1) {
            throw new IllegalActionException(getName() + "need to have"
                    + "the modelString port be connected");
        } else if (modelString.hasToken(0)) {
            StringToken str = null;

            try {
                str = (StringToken) modelString.get(0);

                _parser.reset();

                CompositeActor model = (CompositeActor) _parser.parse(str
                        .stringValue());
                StringWriter writer = new StringWriter();

                try {
                    model.exportMoML(writer, 1);
                } catch (Exception ex) {
                    // FIXME: don't ignore?
                }

                String modelMoML = writer.toString();

                if (((BooleanToken) connectPorts.getToken()).booleanValue()) {
                    _moml = "<group>\n" + modelMoML
                            + "<relation name=\"newR1\" "
                            + "class=\"ptolemy.actor.TypedIORelation\">\n"
                            + "</relation>\n" + "<relation name=\"newR2\" "
                            + "class=\"ptolemy.actor.TypedIORelation\">\n"
                            + "</relation>\n"
                            + "<link port=\"input\" relation=\"newR1\"/>\n"
                            + "<link port=\"" + model.getName()
                            + ".input\" relation=\"newR1\"/>\n"
                            + "<link port=\"" + model.getName()
                            + ".output\" relation=\"newR2\"/>\n"
                            + "<link port=\"output\" relation=\"newR2\"/>\n"
                            + "</group>";
                } else {
                    _moml = "<group>\n" + modelMoML + "</group>";
                }
            } catch (Exception ex) {
                if (_debugging) {
                    _debug("Problem parsing " + str.stringValue());
                }

                throw new IllegalActionException(this, ex, "Problem parsing "
                        + str.stringValue());
            }
        }

        super.fire();
View Full Code Here

                        .toString());
                connect(input, constActor.trigger);
                connect(constActor.output, output);
            } //otherwise, do nothing.
        } catch (Exception ex) {
            throw new IllegalActionException(this, ex, "preinitialize() failed");
        }

        //connect(input, output);
        super.preinitialize();
    }
View Full Code Here

                if (_debugging) {
                    _debug("create a instance of the specified director");
                }
            }
        } catch (Exception ex) {
            throw new IllegalActionException("get an illegal action exception"
                    + "when create director" + ex);
        }
    }
View Full Code Here

                    parametersGray.setGamma((float) _gamma);
                }

                if (_setBackground) {
                    if (_valueArray.length < 1) {
                        throw new IllegalActionException("Need "
                                + "one value to set Transparency");
                    } else {
                        parametersGray.setBackgroundGray(_valueArray[0]);
                    }
                }

                _imageEncodeParam = parametersGray;
            } else if (parameters instanceof PNGEncodeParam.RGB) {
                PNGEncodeParam.RGB parametersRGB = new PNGEncodeParam.RGB();
                parametersRGB.setBitDepth(_bitDepth);
                parametersRGB.setInterlacing(_adam7Interlacing);

                if (_setGamma) {
                    parametersRGB.setGamma((float) _gamma);
                }

                if (_setBackground) {
                    if (_valueArray.length < 3) {
                        throw new IllegalActionException("Need "
                                + "three values to set transparency");
                    } else {
                        int[] RGBvalues = new int[3];

                        for (int i = 0; i < 3; i++) {
View Full Code Here

            } else if (natureName.equals("complexToReal")) {
                _dataNature = _COMPLEX_TO_REAL;
            } else if (natureName.equals("realToComplex")) {
                _dataNature = _REAL_TO_COMPLEX;
            } else {
                throw new IllegalActionException(this,
                        "Unrecognized dataNature type: " + natureName);
            }
        } else if (attribute == scalingType) {
            String typeName = scalingType.getExpression();

            if (typeName.equals("dimensions")) {
                _scalingType = _DIMENSIONS;
            } else if (typeName.equals("unitary")) {
                _scalingType = _UNITARY;
            } else if (typeName.equals("none")) {
                _scalingType = _NONE;
            } else {
                throw new IllegalActionException(this,
                        "Unrecognized scaling type: " + typeName);
            }
        } else {
            super.attributeChanged(attribute);
        }
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.