Examples of Locatable


Examples of ptolemy.kernel.util.Locatable

         *   the root of this graph model.
         *  @return An iterator of Link objects, all of which have
         *   the given node as their head.
         */
        public Iterator inEdges(Object node) {
            Locatable location = (Locatable) node;
            //ComponentPort port = (ComponentPort) location.getContainer();

            // make sure that the links to relations that we are connected to
            // are up to date.
            // Go through all the links, creating a list of
View Full Code Here

Examples of ptolemy.kernel.util.Locatable

         *   the root of this graph model.
         *  @return An iterator of Link objects, all of which have their
         *   tail as the given node.
         */
        public Iterator outEdges(Object node) {
            Locatable location = (Locatable) node;
            //ComponentPort port = (ComponentPort) location.getContainer();

            // make sure that the links to relations that we are connected to
            // are up to date.
            // Go through all the links, creating a list of
View Full Code Here

Examples of ptolemy.kernel.util.Locatable

         @param eventSource The source of the event that will be dispatched,
         *   e.g. the view that made this call.
         *  @param node The node.
         */
        public void removeNode(final Object eventSource, Object node) {
            Locatable location = (Locatable) node;
            ComponentPort port = (ComponentPort) location.getContainer();
            NamedObj container = port.getContainer();
            ;

            StringBuffer moml = new StringBuffer();
            moml.append("<deletePort name=\"" + port.getName(container)
View Full Code Here

Examples of ptolemy.kernel.util.Locatable

         @param n The object to be rendered.  This object should
         *  of type Locatable.
         *  @return A Figure.
         */
        public Figure render(Object n) {
            Locatable location = (Locatable) n;
            final NamedObj object = location.getContainer();
            EditorIcon icon;

            try {
                // In theory, there shouldn't be more than one
                // icon, but if there are, use the last one.
View Full Code Here

Examples of ptolemy.kernel.util.Locatable

            // because we have no way of representing it in this editor.
            return;
        }

        Port port1 = (Port) linkedPortList.get(0);
        Locatable location1 = _getLocation(port1.getContainer());
        Port port2 = (Port) linkedPortList.get(1);
        Locatable location2 = _getLocation(port2.getContainer());

        Arc link;

        try {
            link = new Arc();
View Full Code Here

Examples of ptolemy.kernel.util.Locatable

            NamedObj topObject = (NamedObj) topObjects.next();
            try {
                Iterator locations = topObject.attributeList(Locatable.class)
                        .iterator();
                while (locations.hasNext()) {
                    Locatable location = (Locatable) locations.next();
                    double[] locationValue = location.getLocation();
                    for (int i = 0; i < locationValue.length; i++) {
                        locationValue[i] += _PASTE_OFFSET;
                    }
                    location.setLocation(locationValue);
                }
            } catch (IllegalActionException e) {
                MessageHandler.error("Change failed", e);
            }
        }
View Full Code Here

Examples of ptolemy.kernel.util.Locatable

     @param node The node.
     *  @return True if the node is associated with a desired location.
     */
    public boolean hasLocation(Object node) {
        if (node instanceof Locatable) {
            Locatable object = (Locatable) node;
            double[] location = object.getLocation();

            if ((location != null) && (location.length == 2)) {
                return true;
            }
        }
View Full Code Here

Examples of ptolemy.kernel.util.Locatable

         @param node The node, which is assumed to be a location.
         *  @return An iterator of Arc objects, all of which have
         *   the given node as their head.
         */
        public Iterator inEdges(Object node) {
            Locatable icon = (Locatable) node;

            // Go through all the links, creating a list of
            // those we are connected to.
            List stateLinkList = new LinkedList();
            Iterator links = _linkSet.iterator();
View Full Code Here

Examples of ptolemy.kernel.util.Locatable

         @param node The node, which is assumed to be a location.
         *  @return An iterator of Arc objects, all of which have
         *   the given node as their tail.
         */
        public Iterator outEdges(Object node) {
            Locatable icon = (Locatable) node;

            // Go through all the links, creating a list of
            // those we are connected to.
            List stateLinkList = new LinkedList();
            Iterator links = _linkSet.iterator();
View Full Code Here

Examples of ptolemy.kernel.util.Locatable

    public class LinkTarget extends PerimeterTarget {
        public boolean acceptHead(Connector c, Figure f) {
            Object object = f.getUserObject();

            if (object instanceof Locatable) {
                Locatable location = (Locatable) object;

                if (location.getContainer() instanceof Entity) {
                    return true;
                } else {
                    return false;
                }
            }
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.