Package ptolemy.actor.gui

Examples of ptolemy.actor.gui.Configuration


        if (button.equals("Configure Parameters")) {
            new EditParametersDialog(parent, object);
            return;
        }

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

        if (button.equals("Configure Arguments")) {
            if (!(object instanceof GenericJNIActor)) {
                throw new InternalErrorException("Tried to configure an "
View Full Code Here


         @param object The object to configure.
         *  @param parent The parent window, or null if there is none.
         */
        public void createEditor(NamedObj object, Frame parent) {
            try {
                Configuration configuration = ((TableauFrame) parent)
                        .getConfiguration();

                NamedObj container = object.getContainer();

                _taskMap = new HashMap();
                _taskState = new ArrayList();
                plot = new Plot();
                plot.setTitle("TM Schedule");
                plot.setButtons(true);

                // We put the plotter as a sub-effigy of the toplevel effigy,
                // so that it closes when the model is closed.
                Effigy effigy = Configuration.findEffigy(toplevel());
                PlotEffigy schedulePlotterEffigy = new PlotEffigy(effigy,
                        container.uniqueName("schedulePlotterEffigy"));
                schedulePlotterEffigy.setPlot(plot);
                schedulePlotterEffigy.identifier.setExpression("TM Schedule");

                configuration.createPrimaryTableau(schedulePlotterEffigy);

                plot.setVisible(true);
            } catch (Throwable throwable) {
                throw new InternalErrorException(object, throwable,
                        "Cannot create Schedule Plotter");
View Full Code Here

            caveatsPanel.add(messageArea);

            JButton moreInfoButton = new JButton("More Info");
            moreInfoButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    Configuration configuration = getConfiguration();
                    URL infoURL = getClass().getResource(
                            "../../../doc/codegen.htm");

                    try {
                        configuration.openModel(null, infoURL, infoURL
                                .toExternalForm());
                    } catch (Exception ex) {
                        throw new InternalErrorException(model, ex,
                                "Failed to open doc/codegen.htm: ");
                    }
View Full Code Here

        for (int i = 0; i < input.getWidth(); i++) {
            if (input.hasToken(i)) {
                synchronized (this) {
                    Entity model = ((ActorToken) input.get(0)).getEntity();
                    Effigy effigy = Configuration.findEffigy(toplevel());
                    Configuration configuration = (Configuration) effigy
                            .toplevel();
                    try {
                        _parser.reset();
                        // Export the model into moml string and then import it
                        // again. Needed b some models with unnoticeable state.
                        NamedObj newModel = _parser.parse(model.exportMoML());
                        Tableau tableau = configuration.openModel(newModel,
                                effigy);
                        if (_tableaus[i] != null) {
                            _tableaus[i].close();
                        }
                        _tableaus[i] = tableau;
View Full Code Here

         * documentation for the given object
         */
        public JMenuItem create(final JContextMenu menu, final NamedObj object) {
            Action action = new GetDocumentationAction() {
                public void actionPerformed(ActionEvent e) {
                    Configuration configuration = getConfiguration();
                    setConfiguration(configuration);
                    super.actionPerformed(e);
                }
            };

View Full Code Here

            putValue("tooltip", "Change the Vergil preferences");
            putValue(GUIUtilities.MNEMONIC_KEY, Integer.valueOf(KeyEvent.VK_E));
        }

        public void actionPerformed(ActionEvent e) {
            Configuration configuration = getConfiguration();
            PtolemyPreferences preferences = null;

            try {
                preferences = (PtolemyPreferences) configuration.getAttribute(
                        PtolemyPreferences.PREFERENCES_WITHIN_CONFIGURATION,
                        PtolemyPreferences.class);
            } catch (IllegalActionException ex) {
                MessageHandler.error("Preferences attribute found, "
                        + "but not of the right class.", ex);
View Full Code Here

     *   the library, if one needs to be created.
     *  @return The new library, or null if there is no
     *   configuration.
     */
    protected CompositeEntity _createDefaultLibrary(Workspace workspace) {
        Configuration configuration = getConfiguration();

        if (configuration != null) {
            CompositeEntity result = (CompositeEntity) configuration
                    .getEntity("icon editor library");

            if (result == null) {
                // Create a default library by directly reading the
                // default XML description.
View Full Code Here

    private static LibraryAttribute _importActorLibrary(Tableau tableau,
            LibraryAttribute gtLibrary) {
        if (gtLibrary != null) {
            try {
                Configuration configuration =
                    (Configuration) tableau.toplevel();
                CompositeEntity actorLibrary = (CompositeEntity) configuration
                        .getEntity("actor library");
                CompositeEntity library = gtLibrary.getLibrary();
                for (Object entityObject : actorLibrary.entityList()) {
                    try {
                        ComponentEntity libraryEntity =
View Full Code Here

    private static boolean isMultipleDocumentationAllowed() {
        // FIXME: This is necessary for Kepler, but not for Ptolemy?
        // Why?
        boolean retVal = false;
        List configsList = Configuration.configurations();
        Configuration config = null;
        Object object = null;
        for (Iterator it = configsList.iterator(); it.hasNext();) {
            config = (Configuration) it.next();
            if (config != null) {
                break;
            }
        }
        if (config == null) {
            throw new KernelRuntimeException("Could not find "
                    + "configuration, list of configurations was "
                    + configsList.size() + " elements, all were null.");
        }
        // Look up the attribute (if it exists)
        StringAttribute multipleDocumentationAllowed = (StringAttribute) config
                .getAttribute("_multipleDocumentationAllowed");
        if (multipleDocumentationAllowed != null) {
            retVal = Boolean.parseBoolean(multipleDocumentationAllowed
                    .getExpression());
        }
View Full Code Here

                String result = "";
                String rootNodeName = dropObj.getElementName();
                List configsList = Configuration.configurations();

                Configuration config = null;
                Object object = null;
                for (Iterator it = configsList.iterator(); it.hasNext();) {
                    config = (Configuration) it.next();
                    if (config != null)
                        break;
                }
                StringAttribute alternateGetMomlActionAttribute = (StringAttribute) config
                        .getAttribute("_alternateGetMomlAction");
                if ((alternateGetMomlActionAttribute != null) && (lsidFlag)) {
                    String alternateGetMomlClassName = alternateGetMomlActionAttribute
                            .getExpression();
                    try {
View Full Code Here

TOP

Related Classes of ptolemy.actor.gui.Configuration

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.