Package org.andrewberman.ui.tools

Examples of org.andrewberman.ui.tools.Tool


  public void mouseEvent(MouseEvent e, Point screen, Point model)
  {
    mousePt.setLocation(screen);
    pt.setLocation(screen);
    Tool t = EventManager.instance.getToolManager().getCurrentTool();
    if (t == null)
      return;
    if (PhyloWidget.ui.context.isOpen())
      return;
    if (getCurRange() == null)
      return;
    if (FocusManager.instance.getFocusedObject() != null)
      return;
    PhyloWidget.trees.getRenderer().setMouseLocation(pt);
    setCurRange(getNearestNode((float) pt.getX(), (float) pt.getY()));
    boolean containsPoint = containsPoint(getCurRange(), pt);
    switch (e.getID())
    {
      case (MouseEvent.MOUSE_MOVED):
      case (MouseEvent.MOUSE_DRAGGED):
        PhyloTree tree = (PhyloTree) PhyloWidget.trees.getTree();
        if (containsPoint && t.respondToOtherEvents())
        {
          UIUtils.setCursor(this, p, Cursor.HAND_CURSOR);
          tree.setHoveredNode(getCurRange().node);
        } else
        {
          UIUtils.releaseCursor(this, p);
          tree.setHoveredNode(null);
        }
        break;
      case (MouseEvent.MOUSE_PRESSED):
        if (containsPoint && t.respondToOtherEvents())
        {
          openContextMenu();
          isGlowing = false;
        }
        break;
    }
    if (!t.respondToOtherEvents())
    {
      PhyloTree tree = (PhyloTree) PhyloWidget.trees.getTree();
      tree.setHoveredNode(null);
      setCurRange(null);
    }
View Full Code Here


  public void setCurRange(NodeRange r)
  {
    if (r != null && r != curNodeRange)
    {
      Tool t = EventManager.instance.getToolManager().getCurrentTool();
      if (t.respondToOtherEvents())
      {
        RootedTree tree = r.render.getTree();
        PhyloWidget.ui.updateNodeInfo(tree, r.node);
      }
    }
View Full Code Here

      return;
    ToolDockItem activeItem = null;
    for (int i = 0; i < items.size(); i++)
    {
      ToolDockItem tdi = (ToolDockItem) items.get(i);
      Tool t = (Tool) tdi.getTool();
      if (t.getShortcut() != null)
      {
        Shortcut s = t.getShortcut();
        if (s.matchesKeyEvent(e))
        {
          activeItem = tdi;
        }
      }
View Full Code Here

TOP

Related Classes of org.andrewberman.ui.tools.Tool

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.