Examples of EditorIcon


Examples of ptolemy.vergil.icon.EditorIcon

        SingletonParameter _hideName = new SingletonParameter(this, "_hideName");
        _hideName.setToken(BooleanToken.TRUE);
        _hideName.setVisibility(Settable.EXPERT);

        // The icon.
        EditorIcon _icon = new EditorIcon(this, "_icon");
        RectangleAttribute rectangle = new RectangleAttribute(_icon,
                "rectangle");
        rectangle.width.setExpression("155.0");
        rectangle.height.setExpression("20.0");
        rectangle.fillColor.setExpression("{1.0, 0.7, 0.7, 1.0}");
View Full Code Here

Examples of ptolemy.vergil.icon.EditorIcon

        _showParameters.addChoice("All");
        _showParameters.setExpression("None");
        _showParameters.setDisplayName("Show parameters");

        // The icon.
        EditorIcon _icon = new EditorIcon(this, "_icon");
        RectangleAttribute rectangle = new RectangleAttribute(_icon,
                "rectangle");
        rectangle.width.setExpression("120.0");
        rectangle.height.setExpression("20.0");
        rectangle.fillColor.setExpression("{0.2,1.0,1.0,1.0}");
View Full Code Here

Examples of ptolemy.vergil.icon.EditorIcon

        final NamedObj object = getTarget();

        // Do this as a change request since it may add a new icon.
        ChangeRequest request = new ChangeRequest(this, "Edit Custom Icon") {
            protected void _execute() throws Exception {
                EditorIcon icon = null;
                List iconList = object.attributeList(EditorIcon.class);

                if (iconList.size() > 0) {
                    // Get the last icon.
                    icon = (EditorIcon) iconList.get(iconList.size() - 1);
                }

                if (icon == null) {
                    icon = new EditorIcon(object, "_icon");
                } else if (icon instanceof XMLIcon) {
                    // There is an icon currently that is not custom.
                    // Without trashing the _iconDescription, we can remove
                    // this icon and replace it.
                    icon.setContainer(null);
                    icon = new EditorIcon(object, "_icon");

                    // Propagate this to derived objects, being
                    // careful to not trash their custom icons
                    // if they have them.  However, there is a trickiness.
                    // They may not have a custom icon, but rather have
                    // an instance of XMLIcon.  We have to remove that
                    // first.
                    Iterator derivedObjects = object.getDerivedList()
                            .iterator();

                    while (derivedObjects.hasNext()) {
                        NamedObj derived = (NamedObj) derivedObjects.next();

                        // See whether it has an icon.
                        EditorIcon derivedIcon = null;
                        List derivedIconList = derived
                                .attributeList(EditorIcon.class);

                        if (derivedIconList.size() > 0) {
                            // Get the last icon.
                            derivedIcon = (EditorIcon) derivedIconList
                                    .get(derivedIconList.size() - 1);
                        }

                        if (derivedIcon instanceof XMLIcon) {
                            // There is an icon currently that is not custom.
                            // Without trashing the _iconDescription, we can remove
                            // this icon and replace it.
                            derivedIcon.setContainer(null);
                        }
                    }

                    // Now it is safe to propagate.
                    icon.propagateExistence();
View Full Code Here

Examples of ptolemy.vergil.icon.EditorIcon

        // In theory, there should be only one.
        // But just in case, we remove all.
        Iterator icons = object.attributeList(EditorIcon.class).iterator();

        while (icons.hasNext()) {
            EditorIcon icon = (EditorIcon) icons.next();

            // An XMLIcon is not a custom icon, so don't remove it.
            if (!(icon instanceof XMLIcon)) {
                String moml = "<deleteProperty name=\"" + icon.getName()
                        + "\"/>";
                MoMLChangeRequest request = new MoMLChangeRequest(this, object,
                        moml);
                object.requestChange(request);
            }
View Full Code Here

Examples of ptolemy.vergil.icon.EditorIcon

    private static void _removeEditorIcons(GTEntity entity)
    throws KernelException {
        for (Object editorIconObject :
            ((NamedObj) entity).attributeList(EditorIcon.class)) {
            EditorIcon editorIcon = (EditorIcon) editorIconObject;
            editorIcon.setContainer(null);
        }
    }
View Full Code Here

Examples of ptolemy.vergil.icon.EditorIcon

            _setIconDescription(_entity, iconDescription);

            List<?> editorIconList = actor.attributeList(EditorIcon.class);

            for (Object editorIconObject : editorIconList) {
                EditorIcon editorIcon = (EditorIcon) editorIconObject;
                EditorIcon icon = (EditorIcon) editorIcon.clone(
                        ((NamedObj) _entity).workspace());
                icon.setName("_icon");
                EditorIcon oldIcon =
                    (EditorIcon) ((NamedObj) _entity).getAttribute("_icon");
                if (oldIcon != null) {
                    oldIcon.setContainer(null);
                }
                icon.setContainer((NamedObj) _entity);
                break;
            }
        }
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.