Package ca.nengo.ui.lib.world.piccolo

Examples of ca.nengo.ui.lib.world.piccolo.WorldObjectImpl


    // statusPanel.setLayout(new BorderLayout());
    //
    // statusPanel.setBackground(Style.COLOR_BACKGROUND);
    // statusPanel.setBorder(new EtchedBorder());
    textHolder = getWorld();
    textLabels = new WorldObjectImpl();
    textHolder.addChild(textLabels);
    textLayoutListener = new TextLayoutListener();
    textHolder.addPropertyChangeListener(Property.BOUNDS_CHANGED, textLayoutListener);
    textLabels.addChild(statusTextBackground);
    textLabels.addChild(statusMessageLabel);
View Full Code Here


      menubar.setHighlighted(true);

      BoundsHandle.removeBoundsHandlesFrom(this);
      break;
    case NORMAL:
      WorldObjectImpl source = mySourceRef.get();

      if (savedWindowBounds != null) {
        setBounds(savedWindowBounds);
        setOffset(savedWindowOffset);
      } else {
        setWidth(DEFAULT_WIDTH);
        setHeight(DEFAULT_HEIGHT);
        if (source != null) {
          setOffset((getWidth() - source.getWidth()) / -2f, source.getHeight() + 20);
        }

      }
      if (source != null) {
        if (myEventConsumer != null) {
          removeInputEventListener(myEventConsumer);
          myEventConsumer = null;
        }

        source.addChild(this);
        myBorder.setVisible(true);

        BoundsHandle.addBoundsHandlesTo(this);
        if (mySourceShadow == null) {

          mySourceShadow = new RectangularEdge(source, this);
          source.addChild(mySourceShadow, 0);
        }
      } else {
        Util.Assert(false, "Window still active after source destroyed");
      }
View Full Code Here

    closeButton = new Button(new CloseIcon(BUTTON_SIZE), new Runnable() {
      public void run() {
        myWindow.close();
      }
    });
    buttonHolder = new WorldObjectImpl();
    addChild(buttonHolder);
    buttonHolder.addChild(maximizeButton);
    buttonHolder.addChild(normalButton);
    buttonHolder.addChild(minimizeButton);
    buttonHolder.addChild(closeButton);
View Full Code Here

public class ProbeIcon extends ModelIcon {

  public static Color DEFAULT_COLOR = NengoStyle.COLOR_LIGHT_PURPLE;

  public ProbeIcon(ModelObject parent) {
    super(parent, new WorldObjectImpl(new Triangle()));

  }
View Full Code Here

  public FunctionInputIcon(ModelObject parent) {
    super(parent, createTextIcon());
  }

  private static WorldObject createTextIcon() {
    WorldObject titleHolder = new WorldObjectImpl();

    Text title = new Text(TEXT);
    title.setFont(FONT);

    title.setOffset(PADDING * 1.5, -0.5 * PADDING);
    titleHolder.addChild(title);

    titleHolder.setBounds(0, 0, title.getWidth() + PADDING * 2, title.getHeight());
    return titleHolder;
  }
View Full Code Here

    presspt = pie.getPosition();

    pressNode = null;
    for (PNode node = pie.getPath().getPickedNode(); node != null; node = node.getParent()) {
      if (node instanceof PiccoloNodeInWorld) {
        WorldObjectImpl wo = (WorldObjectImpl) ((PiccoloNodeInWorld) node).getWorldObject();
       
        if (wo != null && wo.isSelectable()) {
          if (!(wo instanceof Window && ((Window)wo).isMaximized())) {
            // this object is not a maximized window, so move to front
            moveStackToFront(wo);
          }
         
          if (wo instanceof Window) {
            // select the parent (Network, ensemble, etc.) of the clicked window
            WorldObjectImpl parent = (WorldObjectImpl)wo.getParent();
            if (parent != null && parent.getWorld() != null) {
              parent.getWorld().getSelectionHandler().unselectAll();
              parent.getWorld().getSelectionHandler().select(parent);
            }
          }
         
          pressNode = wo;
          return;
View Full Code Here

  public void select(Collection<WorldObjectImpl> items) {
    boolean changes = false;
    Iterator<WorldObjectImpl> itemIt = items.iterator();
    while (itemIt.hasNext()) {
      WorldObjectImpl node = itemIt.next();
      changes |= internalSelect(node);
    }
    if (changes) {
      activeSelectionChanged();
    }
View Full Code Here

  public void unselect(Collection<WorldObjectImpl> items) {
    boolean changes = false;
    Iterator<WorldObjectImpl> itemIt = items.iterator();
    while (itemIt.hasNext()) {
      WorldObjectImpl node = (WorldObjectImpl) itemIt.next();
      changes |= internalUnselect(node);
    }
    if (changes) {
      passiveSelectionChanged();
    }
View Full Code Here

    if (selectionEn.hasNext()) {
      e.setHandled(true);
      PDimension d = e.getDeltaRelativeTo(selectableParent.getPiccolo());

      while (selectionEn.hasNext()) {
        WorldObjectImpl node = selectionEn.next();
        if (!node.isAnimating()) {
          PDimension gDist = new PDimension();
          gDist.setSize(d);

          node.localToParent(node.globalToLocal(gDist));

          node.dragOffset(gDist.getWidth(), gDist.getHeight());
        }
      }
    }
  }
View Full Code Here

    Iterator<PNode> itemsIt = items.iterator();
    while (itemsIt.hasNext()) {
      PNode next = itemsIt.next();
      if (next instanceof PiccoloNodeInWorld) {
        WorldObjectImpl wo = (WorldObjectImpl) ((PiccoloNodeInWorld) next).getWorldObject();
        allObjects.add(wo);
      }

    }
View Full Code Here

TOP

Related Classes of ca.nengo.ui.lib.world.piccolo.WorldObjectImpl

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.