Examples of Effigy


Examples of ptolemy.actor.gui.Effigy

                && applicationBlankPtolemyEffigyAtStartup.getExpression()
                        .equals("true")) {
            PtolemyEffigy.Factory factory = new PtolemyEffigy.Factory(
                    directory, directory.uniqueName("ptolemyEffigy"));

            Effigy effigy = factory.createEffigy(directory, null, null);
            configuration.createPrimaryTableau(effigy);
        }

        try {
            // First, we see if we can find the welcome window by
            // looking at the default configuration.
            // FIXME: this seems wrong, we should be able to get
            // an attribute from the configuration that names the
            // welcome window.
            String configurationURLString = _configurationURL.toExternalForm();
            String base = configurationURLString.substring(0,
                    configurationURLString.lastIndexOf("/"));

            welcomeURL = specToURL(base + "/welcomeWindow.xml");
            introURL = specToURL(base + "/intro.htm");
            _parser.reset();
            _parser.setContext(configuration);
            _parser.parse(welcomeURL, welcomeURL);
        } catch (Throwable throwable) {
            // OK, that did not work, try a different method.
            if (_configurationSubdirectory == null) {
                _configurationSubdirectory = "full";
            }

            // FIXME: This code is Dog slow for some reason.
            welcomeURL = specToURL(_basePath + "/" + _configurationSubdirectory
                    + "/welcomeWindow.xml");
            introURL = specToURL(_basePath + "/" + _configurationSubdirectory
                    + "/intro.htm");
            _parser.reset();
            _parser.setContext(configuration);
            _parser.parse(welcomeURL, welcomeURL);
        }

        Effigy doc = (Effigy) configuration.getEntity("directory.doc");

        doc.identifier.setExpression(introURL.toExternalForm());

        return configuration;
    }
View Full Code Here

Examples of ptolemy.actor.gui.Effigy

    /** Close this tableau.
     *  @return Always return true.
     */
    public boolean close() {
        Effigy effigy = (Effigy) getContainer();
        System.out.println("SimpleTableau.close(): effigy: " + effigy);
        if (effigy.isModified()) {
            File file = effigy.getWritableFile();
            System.out.println("Writing " + file);
            try {
                effigy.writeFile(file);
                effigy.setModified(false);
            } catch (IOException ex) {
                throw new KernelRuntimeException(effigy, "Failed to write "
                        + file);
            }
        }
View Full Code Here

Examples of ptolemy.actor.gui.Effigy

        URL inurl = specToURL("thales/configs/singleWindow/singleWindowWelcomeWindow.xml");
        _parser.reset();
        _parser.setContext(configuration);
        _parser.parse(inurl, inurl);

        Effigy doc = (Effigy) configuration.getEntity("directory.doc");
        URL idurl = specToURL("ptolemy/configs/full/intro.htm");
        doc.identifier.setExpression(idurl.toExternalForm());

        if (_mainFrame != null) {
            _mainFrame.setConfiguration(configuration);
View Full Code Here

Examples of ptolemy.actor.gui.Effigy

        _palettePane.remove(_libraryScrollPane);
        _palettePane.remove(_graphPanner);

        JScrollPane _treeVergil = new JScrollPane();
        NavigationTreeModel treeModel = null;
        Effigy effigy = getEffigy();

        if (effigy instanceof NavigableEffigy) {
            treeModel = ((NavigableEffigy) effigy).getNavigationModel();
        }
View Full Code Here

Examples of ptolemy.actor.gui.Effigy

        _alreadyReadInputs = true;

        if (_model instanceof CompositeActor) {
            // Will need the effigy for the model this actor is in.
            NamedObj toplevel = toplevel();
            final Effigy myEffigy = Configuration.findEffigy(toplevel);

            // If there is no such effigy, then skip trying to open a tableau.
            // The model may have no graphical elements.
            if (myEffigy != null) {
                try {
                    // Conditionally show the model in Vergil. The openModel()
                    // method also creates the right effigy.
                    if ((_openOnFiringValue == _OPEN_IN_VERGIL)
                            || (_openOnFiringValue == _OPEN_IN_VERGIL_FULL_SCREEN)) {
                        // NOTE: The opening must occur in the event thread.
                        // Regrettably, we cannot continue with the firing until
                        // the open is complete, so we use the very dangerous
                        // invokeAndWait() method.
                        Runnable doOpen = new Runnable() {
                            public void run() {
                                Configuration configuration = (Configuration) myEffigy
                                        .toplevel();

                                if (_debugging) {
                                    _debug("** Using the configuration to open a tableau.");
                                }

                                try {
                                    // NOTE: Executing this in the event thread averts
                                    // a race condition... Previous close(), which was
                                    // deferred to the UI thread, will have completed.
                                    _exception = null;
                                    _tableau = configuration.openModel(_model,
                                            myEffigy);

                                    // Set this tableau to be a master so that when it
                                    // gets closed, all its subwindows get closed.
                                    _tableau.setMaster(true);
                                } catch (KernelException e) {
                                    // Record the exception for later reporting.
                                    _exception = e;
                                }

                                _tableau.show();

                                JFrame frame = _tableau.getFrame();

                                if (frame != null) {
                                    if (_openOnFiringValue == _OPEN_IN_VERGIL_FULL_SCREEN) {
                                        if (frame instanceof ExtendedGraphFrame) {
                                            ((ExtendedGraphFrame) frame)
                                                    .fullScreen();
                                        }
                                    }

                                    frame.toFront();
                                }
                            }
                        };

                        try {
                            SwingUtilities.invokeAndWait(doOpen);
                        } catch (Exception ex) {
                            throw new IllegalActionException(this, null, ex,
                                    "Open failed.");
                        }

                        if (_exception != null) {
                            // An exception occurred while trying to open.
                            throw new IllegalActionException(this, null,
                                    _exception, "Failed to open.");
                        }
                    } else {
                        // Need an effigy for the model, or else graphical elements
                        // of the model will not work properly.  That effigy needs
                        // to be contained by the effigy responsible for this actor.
                        PtolemyEffigy newEffigy = new PtolemyEffigy(myEffigy,
                                myEffigy.uniqueName(_model.getName()));
                        newEffigy.setModel(_model);

                        // Since there is no tableau, this is probably not
                        // necessary, but as a safety precaution, we prevent
                        // writing of the model.
View Full Code Here

Examples of ptolemy.actor.gui.Effigy

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

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

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

        if (tableau == null) {
            try {
                tableau = new Tableau(effigy, "codeGeneratorGUI");
            } catch (KernelException e) {
View Full Code Here

Examples of ptolemy.actor.gui.Effigy

                NamedObj parent = (NamedObj) ((Instantiable) _target)
                        .getParent();
                List docAttributes = parent.attributeList(DocAttribute.class);
                DocAttribute attribute = (DocAttribute) docAttributes
                        .get(docAttributes.size() - 1);
                Effigy effigy = getEffigy();
                DocEffigy newEffigy = new DocEffigy((CompositeEntity) effigy
                        .getContainer(), effigy.getContainer().uniqueName(
                        "parentClass"));
                newEffigy.setDocAttribute(attribute);
                DocTableau tableau = new DocTableau(newEffigy, "docTableau");
                tableau.show();
            } catch (Exception e) {
View Full Code Here

Examples of ptolemy.actor.gui.Effigy

    protected void _addMenus() {
        super._addMenus();

        Tableau tableau = getTableau();
        if (tableau != null) {
            Effigy tableauContainer = (Effigy) tableau.getContainer();
            if (tableauContainer != null) {
                JMenu buildMenu = new JMenu("Build");
                buildMenu.setMnemonic(KeyEvent.VK_B);
                _menubar.add(buildMenu);
View Full Code Here

Examples of ptolemy.actor.gui.Effigy

    }

    public void initialize() throws IllegalActionException {
        super.initialize();
        if (_table == null) {
            Effigy containerEffigy = Configuration.findEffigy(toplevel());
            try {
                _tableau = new Tableau(containerEffigy, "tableau");
            } catch (NameDuplicationException e) {
                throw new IllegalActionException(this, e,
                        "Failed to create tableau.");
View Full Code Here

Examples of ptolemy.actor.gui.Effigy

    /** Listener for build menu commands. */
    private class BuildMenuListener implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            try {
                Effigy effigy = (Effigy) getTableau().getContainer();
                Tableau tableau = new DocBuilderTableau(effigy,
                        "DocBuilderTableau");
                tableau.show();
            } catch (Throwable throwable) {
                MessageHandler.error("Cannot create build", throwable);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.