Examples of PNode


Examples of edu.umd.cs.piccolo.PNode

    public Point2D getOffset() {
        return myPNode.getOffset();
    }

    public WorldObject getParent() {
        PNode parent = getPiccolo().getParent();
        if (parent != null) {
            return ((PiccoloNodeInWorld) parent).getWorldObject();
        } else {
            return null;
        }
View Full Code Here

Examples of edu.umd.cs.piccolo.PNode

     * (non-Javadoc)
     *
     * @see ca.shu.ui.lib.world.impl.IWorldObject#getWorldLayer()
     */
    public WorldLayer getWorldLayer() {
        PNode node = myPNode;

        while (node != null) {
            WorldObject wo = ((PiccoloNodeInWorld) node).getWorldObject();

            if (wo instanceof WorldLayer) {
                return (WorldLayer) wo;
            }

            node = node.getParent();
        }

        return null;

    }
View Full Code Here

Examples of edu.umd.cs.piccolo.PNode

      wo.childAdded(((PiccoloNodeInWorld) child).getWorldObject());
    }
  }

  public PNode removeChild(int arg0) {
    PNode node = super.removeChild(arg0);

    if (wo != null && node != null && node instanceof PiccoloNodeInWorld) {
      wo.childRemoved(((PiccoloNodeInWorld) node).getWorldObject());
    }
View Full Code Here

Examples of edu.umd.cs.piccolo.PNode

    return myPickDelay;
  }

  protected WorldObject getTooltipNode(PInputEvent event) {

    PNode node = event.getPickedNode();
    while (node != null) {

      if (node instanceof PiccoloNodeInWorld) {
        WorldObject wo = ((PiccoloNodeInWorld) node).getWorldObject();

        /*
         * Do nothing if the mouse is over the controls
         */
        if (node == controls) {
          setKeepPickAlive(true);
          return null;
        } else if (wo instanceof WorldLayer || wo instanceof Window) {
          break;
        } else if (wo.getTooltip() != null) {
          return null; // hack to eliminate tool tips
          //return wo;
        }

      }

      node = node.getParent();
    }
    setKeepPickAlive(false);
    return null;

  }
View Full Code Here

Examples of edu.umd.cs.piccolo.PNode

    } else if (event.getClickCount() == 2) {
      doubleClicked = true;
    }

    if (altClicked || doubleClicked) {
      PNode node = event.getPickedNode();
      while (node != null) {
        if (node instanceof PiccoloNodeInWorld) {

          WorldObject wo = ((PiccoloNodeInWorld) node).getWorldObject();

          if (wo.isSelectable()) {
            if (doubleClicked) {
              wo.doubleClicked();
            }
            if (altClicked) {
              wo.altClicked();
            }
            break;
          }

        }
        node = node.getParent();
      }
    }
    super.mouseClicked(event);

  }
View Full Code Here

Examples of edu.umd.cs.piccolo.PNode

  private PNode edgeHolder;

  public GroundNode() {
    super();
    this.edgeHolder = new PNode();
  }
View Full Code Here

Examples of edu.umd.cs.piccolo.PNode

   *
   */
  private static final long serialVersionUID = 1L;

  public static void addBoundsHandlesTo(WorldObjectImpl wo) {
    PNode aNode = wo.getPiccolo();
    aNode
        .addChild(new BoundsHandle(PBoundsLocator
            .createEastLocator(aNode)));
    aNode
        .addChild(new BoundsHandle(PBoundsLocator
            .createWestLocator(aNode)));
    aNode.addChild(new BoundsHandle(PBoundsLocator
        .createNorthLocator(aNode)));
    aNode.addChild(new BoundsHandle(PBoundsLocator
        .createSouthLocator(aNode)));
    aNode.addChild(new BoundsHandle(PBoundsLocator
        .createNorthEastLocator(aNode)));
    aNode.addChild(new BoundsHandle(PBoundsLocator
        .createNorthWestLocator(aNode)));
    aNode.addChild(new BoundsHandle(PBoundsLocator
        .createSouthEastLocator(aNode)));
    aNode.addChild(new BoundsHandle(PBoundsLocator
        .createSouthWestLocator(aNode)));
  }
View Full Code Here

Examples of edu.umd.cs.piccolo.PNode

        .createSouthWestLocator(aNode)));
  }

  @SuppressWarnings("unchecked")
    public static void removeBoundsHandlesFrom(WorldObjectImpl wo) {
    PNode aNode = wo.getPiccolo();

    ArrayList<BoundsHandle> handles = new ArrayList<BoundsHandle>();

    Iterator<PNode> i = aNode.getChildrenIterator();
    while (i.hasNext()) {
      PNode each = i.next();
      if (each instanceof BoundsHandle) {
        handles.add((BoundsHandle) each);
      }
    }
    aNode.removeChildren(handles);
View Full Code Here

Examples of edu.umd.cs.piccolo.PNode

  @Override
  public void dragHandle(PDimension aLocalDimension, PInputEvent aEvent) {
    PBoundsLocator l = (PBoundsLocator) getLocator();

    PNode n = l.getNode();
    PBounds b = n.getBounds();

    PNode parent = getParent();
    if (parent != n && parent instanceof PCamera) {
      ((PCamera) parent).localToView(aLocalDimension);
    }

    localToGlobal(aLocalDimension);
View Full Code Here

Examples of edu.umd.cs.piccolo.PNode

    }
  }

  @Override
  public PNode removeChild(int arg0) {
    PNode node = super.removeChild(arg0);

    if (worldObjectParent != null && node != null && node instanceof PiccoloNodeInWorld) {
      worldObjectParent.childRemoved(((PiccoloNodeInWorld) node).getWorldObject());
    }
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.