Package ptolemy.data.expr

Examples of ptolemy.data.expr.FileParameter.asURL()


     */
    protected void _help() {
        try {
            FileParameter helpAttribute = (FileParameter) getModel()
                    .getAttribute("_help", FileParameter.class);
            URL doc = helpAttribute.asURL();
            getConfiguration().openModel(null, doc, doc.toExternalForm());
        } catch (Exception ex) {
            super._help();
        }
    }
View Full Code Here


            FileParameter helpAttribute = (FileParameter) configuration
                    .getAttribute("_helpDocViewer", FileParameter.class);
            URL doc;

            if (helpAttribute != null) {
                doc = helpAttribute.asURL();
            } else {
                doc = getClass().getClassLoader().getResource(helpFile);
            }

            configuration.openModel(null, doc, doc.toExternalForm());
View Full Code Here

        // attribute of the configuration.
        // If we don't have an _about, or _about returns
        // no models, then look in the complete demos location

        if (aboutAttribute != null) {
            baseURL = aboutAttribute.asURL();
            String aboutURLString = baseURL.toExternalForm();
            String base = aboutURLString.substring(0,
                    aboutURLString.lastIndexOf("/"));
            baseURL = MoMLApplication.specToURL(base + "/intro.htm");
            System.out.println("HTMLAbout._expandLibrary(): looking in about URL: " + baseURL);
View Full Code Here

            if (fileOrURLParameter == null) {
                throw new InternalErrorException(object, null,
                        "No \"fileOrURL\" attribute.");
            } else {
                try {
                    if (fileOrURLParameter.asURL() == null) {
                        ModelDirectory directory = configuration.getDirectory();

                        StringParameter initialDefaultContentsParameter = (StringParameter) object
                                .getAttribute("initialDefaultContents");
                        String defaultText = "";
View Full Code Here

        _icon = new ImageIcon(this, "_icon");
        _icon.setPersistent(false);
        FileParameter source = new FileParameter(this, "source");
        source
                .setExpression("$CLASSPATH/ptolemy/vergil/kernel/attributes/ptIIplanetIcon.gif");
        URL url = source.asURL();
        Toolkit tk = Toolkit.getDefaultToolkit();
        Image image = tk.getImage(url);
        _icon.setImage(image);
    }
View Full Code Here

                FileParameter aboutAttribute = (FileParameter) configuration
                        .getAttribute("_about", FileParameter.class);
                URL doc;

                if (aboutAttribute != null) {
                    doc = aboutAttribute.asURL();
                } else {
                    doc = getClass().getClassLoader().getResource(aboutFile);
                }

                // The usual mechanism for opening a file is:
View Full Code Here

                Configuration configuration = getConfiguration();
                FileParameter iconAttribute = (FileParameter) configuration
                        .getAttribute("_applicationIcon", FileParameter.class);

                if (iconAttribute != null) {
                    url = iconAttribute.asURL();
                }
            } catch (Throwable ex) {
                // Ignore, we will set url to the default.
            }
            if (url == null) {
View Full Code Here

            FileParameter helpAttribute = (FileParameter) configuration
                    .getAttribute("_help", FileParameter.class);
            URL doc;

            if (helpAttribute != null) {
                doc = helpAttribute.asURL();
            } else {
                doc = getClass().getClassLoader().getResource(helpFile);
            }

            configuration.openModel(null, doc, doc.toExternalForm());
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.