Examples of Tool


Examples of com.cburch.logisim.tools.Tool

        // but it exists there in the 1.4 and 5.0 versions.
        mouseDragged(e);
        return;
      }
     
      Tool tool = getToolFor(e);
      if (tool != null) {
        tool.mouseMoved(Canvas.this, getGraphics(), e);
      }
    }
View Full Code Here

Examples of com.cburch.logisim.tools.Tool

    public void mouseEntered(MouseEvent e) {
      if (drag_tool != null) {
        drag_tool.mouseEntered(Canvas.this, getGraphics(), e);
      } else {
        Tool tool = getToolFor(e);
        if (tool != null) {
          tool.mouseEntered(Canvas.this, getGraphics(), e);
        }
      }
    }
View Full Code Here

Examples of com.cburch.logisim.tools.Tool

  private void drawWithUserState(Graphics base, Graphics g, Project proj) {
    Circuit circ = proj.getCurrentCircuit();
    Selection sel = proj.getSelection();
    Set<Component> hidden;
    Tool dragTool = canvas.getDragTool();
    if (dragTool == null) {
      hidden = NO_COMPONENTS;
    } else {
      hidden = dragTool.getHiddenComponents(canvas);
      if (hidden == null) hidden = NO_COMPONENTS;
    }

    // draw halo around component whose attributes we are viewing
    boolean showHalo = AppPreferences.ATTRIBUTE_HALO.getBoolean();
    if (showHalo && haloedComponent != null && haloedCircuit == circ
        && !hidden.contains(haloedComponent)) {
      GraphicsUtil.switchToWidth(g, 3);
      g.setColor(Canvas.HALO_COLOR);
      Bounds bds = haloedComponent.getBounds(g).expand(5);
      int w = bds.getWidth();
      int h = bds.getHeight();
      double a = Canvas.SQRT_2 * w;
      double b = Canvas.SQRT_2 * h;
      g.drawOval((int) Math.round(bds.getX() + w/2.0 - a/2.0),
        (int) Math.round(bds.getY() + h/2.0 - b/2.0),
        (int) Math.round(a), (int) Math.round(b));
      GraphicsUtil.switchToWidth(g, 1);
      g.setColor(Color.BLACK);
    }

    // draw circuit and selection
    CircuitState circState = proj.getCircuitState();
    boolean printerView = AppPreferences.PRINTER_VIEW.getBoolean();
    ComponentDrawContext context = new ComponentDrawContext(canvas,
        circ, circState, base, g, printerView);
    context.setHighlightedWires(highlightedWires);
    circ.draw(context, hidden);
    sel.draw(context, hidden);

    // draw tool
    Tool tool = dragTool != null ? dragTool : proj.getTool();
    if (tool != null && !canvas.isPopupMenuUp()) {
      Graphics gCopy = g.create();
      context.setGraphics(gCopy);
      tool.draw(canvas, context);
      gCopy.dispose();
    }
  }
View Full Code Here

Examples of com.cburch.logisim.tools.Tool

    }
   
    private void copyToolAttributes(Library srcLib, Library dstLib) {
      for (Tool srcTool : srcLib.getTools()) {
        AttributeSet srcAttrs = srcTool.getAttributeSet();
        Tool dstTool = dstLib.getTool(srcTool.getName());
        if (srcAttrs != null && dstTool != null) {
          AttributeSet dstAttrs = dstTool.getAttributeSet();
          for (Attribute<?> attrBase : srcAttrs.getAttributes()) {
            @SuppressWarnings("unchecked")
            Attribute<Object> attr = (Attribute<Object>) attrBase;
            Object srcValue = srcAttrs.getValue(attr);
            Object dstValue = dstAttrs.getValue(attr);
View Full Code Here

Examples of com.cburch.logisim.tools.Tool

    HashMap<ComponentFactory,ComponentFactory> componentMap;
    HashMap<Tool,Tool> toolMap;
    componentMap = new HashMap<ComponentFactory,ComponentFactory>();
    toolMap = new HashMap<Tool,Tool>();
    for (Tool oldTool : old.getTools()) {
      Tool newTool = base.getTool(oldTool.getName());
      toolMap.put(oldTool, newTool);
      if (oldTool instanceof AddTool) {
        ComponentFactory oldFactory = ((AddTool) oldTool).getFactory();
        if (newTool != null && newTool instanceof AddTool) {
          ComponentFactory newFactory = ((AddTool) newTool).getFactory();
View Full Code Here

Examples of com.cburch.logisim.tools.Tool

  }
 
  private static void replaceAll(Map<ComponentFactory,ComponentFactory> compMap,
      Map<Tool,Tool> toolMap) {
    for (Project proj : Projects.getOpenProjects()) {
      Tool oldTool = proj.getTool();
      Circuit oldCircuit = proj.getCurrentCircuit();
      if (toolMap.containsKey(oldTool)) {
        proj.setTool(toolMap.get(oldTool));
      }
      SubcircuitFactory oldFactory = oldCircuit.getSubcircuitFactory();
View Full Code Here

Examples of com.cburch.logisim.tools.Tool

 
  private void selectSelectTool(Project proj) {
    for (Library sub : proj.getLogisimFile().getLibraries()) {
      if (sub instanceof Base) {
        Base base = (Base) sub;
        Tool tool = base.getTool("Edit Tool");
        if (tool != null) proj.setTool(tool);
      }
    }
  }
View Full Code Here

Examples of com.leapmotion.leap.Tool

    this.lastDetectedTool = new HashMap<Integer, Tool>();

    this.lastDetectedFinger.put(0, new Finger());
    this.lastDetectedPointable.put(0, new Pointable());
    this.lastDetectedHand.put(0, new Hand());
    this.lastDetectedTool.put(0, new Tool());

    // this is neccessary because the velocity of all objects has an offset.
    this.velocityOffsetTestFinger = new Finger();
  }
View Full Code Here

Examples of com.m11n.android.model.Tool

    {
      item = new Doc();
    }
    else if(Tool.ELEMENT_NAME.equals(parent.getNodeName()))
    {
      item = new Tool();
    }
   
    if(item!=null)
    {
      NodeList children = parent.getChildNodes();
View Full Code Here

Examples of com.sk89q.worldedit.command.tool.Tool

                        event.setCancelled(superPickaxe.actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session, location));
                        return;
                    }
                }

                Tool tool = session.getTool(player.getItemInHand());
                if (tool != null && tool instanceof DoubleActionBlockTool) {
                    if (tool.canUse(player)) {
                        ((DoubleActionBlockTool) tool).actSecondary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session, location);
                        event.setCancelled(true);
                    }
                }

            } else if (event.getType() == Interaction.OPEN) {
                if (player.getItemInHand() == getConfiguration().wandItem) {
                    if (!session.isToolControlEnabled()) {
                        return;
                    }

                    if (!actor.hasPermission("worldedit.selection.pos")) {
                        return;
                    }

                    RegionSelector selector = session.getRegionSelector(player.getWorld());
                    if (selector.selectSecondary(vector, ActorSelectorLimits.forActor(player))) {
                        selector.explainSecondarySelection(actor, session, vector);
                    }

                    event.setCancelled(true);
                    return;
                }

                Tool tool = session.getTool(player.getItemInHand());
                if (tool != null && tool instanceof BlockTool) {
                    if (tool.canUse(player)) {
                        ((BlockTool) tool).actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session, location);
                        event.setCancelled(true);
                    }
                }
            }
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.