Package ptolemy.kernel.util

Examples of ptolemy.kernel.util.InternalErrorException


        try {
            newObject.alphabet.setTypeAtLeast(ArrayType
                    .arrayOf(newObject.input));
        } catch (IllegalActionException e) {
            // Should have been caught before.
            throw new InternalErrorException(e);
        }
        return newObject;
    }
View Full Code Here


        if (attrList.size() == 0) {
            // Create and attach a new instance
            try {
                new UndoStackAttribute(_model, "_undoInfo");
            } catch (KernelException e) {
                throw new InternalErrorException(e);
            }
        }
    }
View Full Code Here

        // This is static so that ptolemy.actor.lib.jni.CompiledCompositeActor
        // will not depend on ptolemy.codegen.

        // FindBugs wants this.
        if (!(compositeActor instanceof ptolemy.actor.lib.jni.CompiledCompositeActor)) {
            throw new InternalErrorException(compositeActor, null,
                    " is not an instance of "
                            + "ptolemy.actor.lib.jni.CompiledCompositeActor.");
        }

        ptolemy.actor.lib.jni.CompiledCompositeActor actor = (ptolemy.actor.lib.jni.CompiledCompositeActor) compositeActor;
View Full Code Here

        // will not depend on ptolemy.codegen
        CodeGenerator codeGenerator = null;
        try {
            // FindBugs wants this.
            if (!(compositeActor instanceof ptolemy.actor.lib.jni.CompiledCompositeActor)) {
                throw new InternalErrorException(
                        compositeActor,
                        null,
                        " is not an instance of "
                                + "ptolemy.actor.lib.jni.CompiledCompositeActor.");
            }
View Full Code Here

                try {
                    _inConnectionsChanged = true;
                    int width = input.getWidth();
                    _relation.setWidth(width);
                } catch (IllegalActionException e) {
                    throw new InternalErrorException(e);
                } finally {
                    _inConnectionsChanged = false;
                }
            }
        }
View Full Code Here

        if (container == null && _relation != null) {
            try {
                _relation.setContainer(null);
            } catch (NameDuplicationException e) {
                throw new InternalErrorException(e);
            }
            _relation = null;
        }

        super.setContainer(container);
View Full Code Here

        // Remove the previous relation, if necessary.
        if (_relation != null) {
            try {
                _relation.setContainer(null);
            } catch (NameDuplicationException e) {
                throw new InternalErrorException(e);
            }
            _relation = null;
        }

        NamedObj container = getContainer();
        if (container instanceof TypedCompositeActor) {
            // If the container is not a typed composite actor, then don't create
            // a relation. Probably the container is a library.
            try {
                _relation = new TypedIORelation(
                        (TypedCompositeActor) container, container
                                .uniqueName("publisherRelation"));
                // Prevent the relation and its links from being exported.
                _relation.setPersistent(false);
                // Prevent the relation from showing up in vergil.
                new Parameter(_relation, "_hide", BooleanToken.TRUE);
                // Set the width of the relation to match the
                // width of the input.
                _relation.setWidth(input.getWidth());
            } catch (NameDuplicationException e) {
                throw new InternalErrorException(e);
            }
            output.link(_relation);

            // Link to the subscribers.
            while (subscribers.hasNext()) {
View Full Code Here

                // This will have the side effect of removing the effigy
                // from the directory if there are no more tableaux in it.
                try {
                    _tableau.setContainer(null);
                } catch (KernelException ex) {
                    throw new InternalErrorException(ex);
                }
            }

            _tableau = null;
            _effigy = null;
View Full Code Here

     *  event thread.
     *  @param in The token to display
     */
    protected void _display(Token in) {
        if (!(in instanceof ImageToken)) {
            throw new InternalErrorException(
                    "Input is not an ImageToken. It is: " + in);
        }

        // See also ptolemy/actor/lib/image/ImageTableau.java
        if (_frame != null) {
            List tokens = new LinkedList();
            tokens.add(in);

            try {
                _effigy.setTokens(tokens);
            } catch (IllegalActionException e) {
                throw new InternalErrorException(e);
            }
        } else if (_picture != null) {
            Image image = ((ImageToken) in).asAWTImage();
            int xSize = image.getWidth(null);
            int ySize = image.getHeight(null);
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 InternalErrorException(
                            "Cannot find effigy for top level: "
                                    + toplevel().getFullName());
                }

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

                    // 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());

                    _frame = new ImageWindow();

                    _tableau = new ImageTableau(_effigy, "tokenTableau",
                            _frame, _oldXSize, _oldYSize);
                    _tableau.setTitle(getName());
                    _frame.setTableau(_tableau);
                    _windowProperties.setProperties(_frame);

                    // Regrettably, since setSize() in swing doesn't actually
                    // set the size of the frame, we have to also set the
                    // size of the internal component.
                    Component[] components = _frame.getContentPane()
                            .getComponents();

                    if (components.length > 0) {
                        _pictureSize.setSize(components[0]);
                    }

                    _tableau.show();
                } catch (Exception ex) {
                    throw new InternalErrorException(ex);
                }
            } else {
                // Erase previous image.
                _effigy.clear();
View Full Code Here

TOP

Related Classes of ptolemy.kernel.util.InternalErrorException

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.