Package ptolemy.kernel.util

Examples of ptolemy.kernel.util.InternalErrorException


    public Object clone(Workspace workspace) throws CloneNotSupportedException  {
        SequentialClock newObject = (SequentialClock)super.clone(workspace);
        try {
            newObject.output.setTypeAtLeast(ArrayType.elementType(newObject.values));
        } catch (IllegalActionException e) {
            throw new InternalErrorException(e);
        }
        return newObject;
    }
View Full Code Here


                        }
                    }
                }

                if (field == null) {
                    throw new InternalErrorException("Field '" + port.getName()
                            + "' in '" + _class + "' is null?");
                } else {
                    if (typ.equals("boolean")) {
                        try {
                            port.send(0,
                                    new BooleanToken(field.getBoolean(obj)));
                        } catch (IllegalAccessException ex) {
                            throw new IllegalActionException(this, ex, "Type '"
                                    + typ + "' is not castable");
                        }
                    } else if (typ.equals("double")) {
                        try {
                            port.send(0, new DoubleToken(field.getDouble(obj)));
                        } catch (IllegalAccessException ex) {
                            throw new IllegalActionException(this, ex, "Type '"
                                    + typ + "' is not castable");
                        }
                    } else if (typ.equals("int")) {
                        try {
                            port.send(0, new IntToken(field.getInt(obj)));
                        } catch (IllegalAccessException ex) {
                            throw new IllegalActionException(this, ex, "Type '"
                                    + typ + "' is not castable");
                        }
                    } else if (typ.equals("char")) {
                        try {
                            port.send(0, new UnsignedByteToken(field
                                    .getChar(obj)));
                        } catch (IllegalAccessException ex) {
                            throw new IllegalActionException(this, ex, "Type '"
                                    + typ + "' is not castable");
                        }
                    } else if (typ.equals("class [I")) {
                        try {
                            if (field == null) {
                                throw new InternalErrorException(
                                        "field == null?");
                            }
                            if (obj == null) {
                                throw new InternalErrorException("obj == null?");
                            }
                            if (field.get(obj) == null) {
                                throw new InternalErrorException(
                                        "field.get(obj)  == null? (field = "
                                                + field + " obj = " + obj);
                            }
                            Token[] toks = new Token[((int[]) field.get(obj)).length];
View Full Code Here

    public Object clone(Workspace workspace) throws CloneNotSupportedException  {
        Pulse newObject = (Pulse)super.clone(workspace);
        try {
            newObject.output.setTypeAtLeast(ArrayType.elementType(newObject.values));
        } catch (IllegalActionException e) {
            throw new InternalErrorException(e);
        }
        return newObject;
    }
View Full Code Here

            // Do this first, because it may throw an exception, and
            // we have not yet changed any state.
            if (container != null) {
                if (!(container instanceof GenericJNIActor)) {
                    throw new InternalErrorException("Expecting a container "
                            + "of type GenericJNIActor, got " + container);
                } else {
                    _container = (GenericJNIActor) container;
                    if (((GenericJNIActor) container).getArgument(getName()) == null) {
                        // Only add if the argument is not already present.
View Full Code Here

    public Object clone(Workspace workspace) throws CloneNotSupportedException  {
        Sequence newObject = (Sequence)super.clone(workspace);
        try {
            newObject.output.setTypeAtLeast(ArrayType.elementType(newObject.values));
        } catch (IllegalActionException e) {
            throw new InternalErrorException(e);
        }
        return newObject;
    }
View Full Code Here

        // This is always used to configure the container, so
        // we just use that.
        JNICodeGenerator codeGenerator = (JNICodeGenerator) getContainer();

        if (!(parent instanceof TableauFrame)) {
            throw new InternalErrorException(
                    "Can't create a JNICodeGeneratorGUIFactory without a tableau!");
        }

        Effigy effigy = ((TableauFrame) parent).getEffigy();

        // FIXME: Is the cast safe?
        Tableau tableau = (Tableau) effigy.getEntity("JNICodeGeneratorGUI");

        if (tableau == null) {
            try {
                tableau = new Tableau(effigy, "JNICodeGeneratorGUI");
            } catch (KernelException e) {
                throw new InternalErrorException(e);
            }
        }

        Frame frame = tableau.getFrame();

        if (frame == null) {
            try {
                frame = new JNICodeGeneratorGUI(codeGenerator, tableau);
            } catch (KernelException e) {
                throw new InternalErrorException(e);
            }
        }

        // Show the result.
        frame.pack();
View Full Code Here

        setTitle(codeGenerator.getName());

        if ((getEffigy() == null) || (getEffigy().uri == null)
                || (getEffigy().uri.getURI() == null)) {
            throw new InternalErrorException("Cannot get an effigy!");
        }

        // Caveats panel.
        JPanel caveatsPanel = new JPanel();
        caveatsPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
View Full Code Here

    public Object clone(Workspace workspace) throws CloneNotSupportedException  {
        PoissonClock newObject = (PoissonClock)super.clone(workspace);
        try {
            newObject.output.setTypeAtLeast(ArrayType.elementType(newObject.values));
        } catch (IllegalActionException e) {
            throw new InternalErrorException(e);
        }
        return newObject;
    }
View Full Code Here

            $ASSIGN$_resultArray(i, _stateToken);
            try {
                step.update();
                $ASSIGN$_stateToken(_stateToken.add(step.getToken()));
            } catch (IllegalActionException ex) {
                throw new InternalErrorException(this, ex, "Should not be thrown because we have already " + "verified that the tokens can be added");
            }
        }
        output.send(0, $BACKUP$_resultArray(), count);
        if (_firingCountLimit != 0) {
            _iterationCount += count;
View Full Code Here

        Configuration configuration = (Configuration) Configuration.findEffigy(
                object.getContainer()).toplevel();

        if (button.equals("Configure Arguments")) {
            if (!(object instanceof GenericJNIActor)) {
                throw new InternalErrorException("Tried to configure an "
                        + "object that is not a GenericJNIActor");
            } else {
                new ArgumentConfigurerDialog(parent, (GenericJNIActor) object,
                        configuration);
                return;
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.