Package org.andrewberman.ui

Examples of org.andrewberman.ui.Point


    {
      PhyloTree pt = (PhyloTree) tree;
      PhyloNode h = pt.hoveredNode;
      if (h != null)
      {
        Point point = new Point(getX(h), getY(h));
        float dist = (float) point.distance(mousePt);
        float bulgedSize = BulgeUtil.bulge(dist, .7f, 30);
        if (textSize <= 12)
          h.zoomTextSize = bulgedSize;
        else
          h.zoomTextSize = 1f;
View Full Code Here


    UIUtils.loadUISinglets(p);
    this.p = p;
    EventManager.instance.add(this);

    rect = new Rectangle2D.Float(0, 0, 0, 0);
    tempPt = new Point(0, 0);

    aTween = new Tween(this, TweenQuad.tween, Tween.INOUT, 1f, .25f, FRAMES);
    wTween = new Tween(this, TweenQuad.tween, Tween.INOUT, 1.5f, 1.1f,
        FRAMES);
    hTween = new Tween(this, TweenQuad.tween, Tween.INOUT, 1.5f, 1.1f,
View Full Code Here

      return;
    if (FocusManager.instance.getFocusedObject() != null)
      return;

    // System.out.println("Hover event!");
    Point pt = model;

//    NodeRange r = PhyloWidget.ui.nearest.nearest;
//    if (r == null)
//      return;
//
View Full Code Here

    if (hidden)
      return;
    if (e.getID() != MouseEvent.MOUSE_PRESSED)
      return;

    Point p1;
    if (useCameraCoordinates)
      p1 = model;
    else
      p1 = screen;
View Full Code Here

     *
     * 1. Get all nodes within a reasonable range. 2. Score the closest
     * nodes, adding points for closeness but deducting points for being
     * off-axis.
     */
    Point base = new Point();
    NodeRange cur = getCurRange();

    /*
     * The LEFT or RIGHT directions should always go IN or OUT of the tree,
     * while the up and down will use the score-based search.
     */
    if (dir == LEFT || dir == RIGHT)
    {
      RootedTree t = cur.render.getTree();
      PhyloNode curNode = null;
      if (dir == LEFT)
      {
        if (t.getParentOf(cur.node) != null)
        {
          curNode = (PhyloNode) t.getParentOf(cur.node);
          setCurRange(rangeForNode(cur.render, curNode));
          return;
        }
      } else if (dir == RIGHT)
      {
        if (!t.isLeaf(cur.node))
        {
          List kids = t.getChildrenOf(cur.node);
          curNode = (PhyloNode) kids.get(kids.size() - 1);
          setCurRange(rangeForNode(cur.render, curNode));
          return;
        }
      }

    }

    switch (dir)
    {
      case (LEFT):
        base.setLocation(-1, .1);
        break;
      case (RIGHT):
        base.setLocation(1, -.1);
        break;
      case (UP):
        base.setLocation(0, -1);
        break;
      case (DOWN):
        base.setLocation(0, 1);
        break;
    }

    pt.setLocation(cur.node.getX(), cur.node.getY());
    getWithinRange(cur.node.getX(), cur.node.getY(), 200);
    Point pt2 = new Point();
    float maxScore = -Float.MAX_VALUE;
    NodeRange maxRange = null;
    for (int i = 0; i < nearNodes.size(); i++)
    {
      NodeRange r = (NodeRange) nearNodes.get(i);
      if (r.type == NodeRange.LABEL)
        continue;
      if (r.node == cur.node)
        continue;
      pt2.setLocation(r.node.getX(), r.node.getY());
      float score = score(pt, pt2, base);
      if (score > maxScore)
      {
        maxScore = score;
        maxRange = r;
View Full Code Here

    super(app);
    inset = style.padX;

    drawRect = new RoundRectangle2D.Float(0, 0, 0, 0, 0, 0);
    mouseRect = new RoundRectangle2D.Float(0, 0, 0, 0, 0, 0);
    mousePt = new Point(0, 0);
    rotation = new DockRotationHandler();
    rotation.setRotation(BOTTOM);

    setWidth(40);
    layout();
View Full Code Here

    super.keyEvent(e);
  }

  public void mouseEvent(MouseEvent e, Point screen, Point model)
  {
    Point useMe = model;
    if (isRootMenu() && !useCameraCoordinates)
      useMe = screen;
    /*
     * create a copy of the point we decided to use, and translate it
     * accordingly.
 
View Full Code Here

  boolean mousePressed, mouseDragging, controlPressed;

  public Tool(PApplet p)
  {
    this.p = p;
    downPoint = new Point(0, 0);
    curPoint = new Point(0, 0);
  }
View Full Code Here

TOP

Related Classes of org.andrewberman.ui.Point

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.