Package ptolemy.kernel.util

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


     @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

         @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

         @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

    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

Related Classes of ptolemy.kernel.util.Locatable

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.