Package ptolemy.actor

Examples of ptolemy.actor.Manager$State


        if (result) {
            Nameable container = getContainer();

            if (container instanceof CompositeActor) {
                Manager manager = ((CompositeActor) container).getManager();

                if (manager != null) {
                    manager.finish();
                } else {
                    throw new IllegalActionException(this,
                            "Cannot stop without a Manager.");
                }
            } else {
View Full Code Here


        // has problems finding resources like files specified in
        // parameters if the xml file was specified as an absolute path.
        CompositeActor toplevel = (CompositeActor) parser.parse(null, new File(
                xmlFileName).toURI().toURL());

        _manager = new Manager(toplevel.workspace(), "MoMLSimpleApplication");
        toplevel.setManager(_manager);
        toplevel.addChangeListener(this);
        _manager.addExecutionListener(this);
        _manager.execute();
View Full Code Here

            if (model instanceof CompositeActor) {
                CompositeActor actor = (CompositeActor) model;

                // Create a manager if necessary.
                Manager manager = actor.getManager();

                if (manager == null) {
                    manager = new Manager(actor.workspace(), "manager");
                    actor.setManager(manager);
                }

                manager.addExecutionListener(this);
                _activeCount++;

                // Run the model in a new thread.
                manager.startRun();
            }
        }
    }
View Full Code Here

                TypedCompositeActor model = (TypedCompositeActor) GiottoCodeGenerator.this
                        .getContainer();

                // Preinitialize and resolve types.
                CompositeActor toplevel = (CompositeActor) model.toplevel();
                Manager manager = toplevel.getManager();

                if (manager == null) {
                    manager = new Manager(toplevel.workspace(), "manager");
                    toplevel.setManager(manager);
                }

                manager.preinitializeAndResolveTypes();

                TextEffigy codeEffigy = TextEffigy.newTextEffigy(configuration
                        .getDirectory(), generateGiottoCode(model));
                codeEffigy.setModified(true);
                configuration.createPrimaryTableau(codeEffigy);

                // end the model execution.
                manager.stop();
                manager.wrapup();
            } catch (Exception ex) {
                throw new InternalErrorException(object, ex,
                        "Cannot generate code. Perhaps outside Vergil?");
            }
        }
View Full Code Here

                        // wait for the user to press the Resume
                        // button.
                        if (debugProfile.isListening(event.getType())) {
                            String message = objToHighlight.getName() + " "
                                    + event.getType().getName();
                            Manager manager = ((Actor) objToHighlight)
                                    .getManager();
                            render(figure, manager, message);
                        }
                    }
                }
View Full Code Here

            NameDuplicationException {
        // Create the model.
        super(workspace);
        setName("LorenzSystem");

        Manager manager = new Manager(workspace, "Manager");
        setManager(manager);

        // Set up the top level composite actor, director and manager
        CTMultiSolverDirector director = new CTMultiSolverDirector(this,
                "CTMultiSolverDirector");
View Full Code Here

        CompositeActor container = (CompositeActor) getContainer();

        _requestFinishOnReceivers();

        // Now wake up threads that depend on the manager.
        Manager manager = container.getManager();

        // NOTE: Used to do the notification in a new thread.
        // For some reason, however, this isn't sufficient.
        // Have to click the stop button twice.
        // (new NotifyThread(manager)).start();
        synchronized (manager) {
            manager.notifyAll();
        }

        // Wait until all threads stop.
        synchronized (this) {
            while (_activeThreads.size() > 0) {
View Full Code Here

            // This might not actually be a top level, because we might
            // be looking inside.  So we check before creating a manager.
            if ((_toplevel.getContainer() == null)
                    && _toplevel instanceof CompositeActor) {
                if (((CompositeActor) _toplevel).getManager() == null) {
                    _manager = new Manager(_workspace, "manager");
                    _manager.addExecutionListener(this);
                    ((CompositeActor) _toplevel).setManager(_manager);
                } else {
                    _manager = ((CompositeActor) _toplevel).getManager();
                }
View Full Code Here

            if (((Effigy) tableau.getContainer()) instanceof PtolemyEffigy) {
                PtolemyEffigy effigy = (PtolemyEffigy) (tableau.getContainer());
                CompositeActor actor = (CompositeActor) effigy.getModel();

                // Create a manager if necessary.
                Manager manager = actor.getManager();

                if (manager == null) {
                    manager = new Manager(actor.workspace(), "manager");
                    actor.setManager(manager);
                }

                //manager.addExecutionListener(this);
                manager.execute();
            }
        }

        return demosURL;
    }
View Full Code Here

        NamedObj ptModel = getModel();

        if (ptModel instanceof CompositeActor
                && (ptModel.getContainer() == null)) {
            CompositeActor ptActorModel = (CompositeActor) ptModel;
            Manager manager = ptActorModel.getManager();

            if (manager != null) {
                manager.stop();
            }
        }

        return super._close();
    }
View Full Code Here

TOP

Related Classes of ptolemy.actor.Manager$State

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.