Package com.cburch.logisim.tools

Examples of com.cburch.logisim.tools.Tool


    }

    private Tool getToolFor(MouseEvent e) {
      if (menu_on) return null;

      Tool ret = mappings.getToolFor(e);
      if (ret == null) return proj.getTool();
      else return ret;
    }
View Full Code Here


    //
    // KeyListener methods
    //
    public void keyPressed(KeyEvent e) {
      Tool tool = proj.getTool();
      if (tool != null) tool.keyPressed(Canvas.this, e);
    }
View Full Code Here

    public void keyPressed(KeyEvent e) {
      Tool tool = proj.getTool();
      if (tool != null) tool.keyPressed(Canvas.this, e);
    }
    public void keyReleased(KeyEvent e) {
      Tool tool = proj.getTool();
      if (tool != null) tool.keyReleased(Canvas.this, e);
    }
View Full Code Here

    public void keyReleased(KeyEvent e) {
      Tool tool = proj.getTool();
      if (tool != null) tool.keyReleased(Canvas.this, e);
    }
    public void keyTyped(KeyEvent e) {
      Tool tool = proj.getTool();
      if (tool != null) tool.keyTyped(Canvas.this, e);
    }
View Full Code Here

          mappings = file.getOptions().getMouseMappings();
        }
      } else if (act == ProjectEvent.ACTION_SET_TOOL) {
        viewport.setErrorMessage(null, null);
       
        Tool t = event.getTool();
        if (t == nullsetCursor(Cursor.getDefaultCursor());
        else            setCursor(t.getCursor());
      } else if (act == ProjectEvent.ACTION_SET_STATE) {
        CircuitState oldState = (CircuitState) event.getOldData();
        CircuitState newState = (CircuitState) event.getData();
        if (oldState != null && newState != null) {
          Propagator oldProp = oldState.getPropagator();
View Full Code Here

        if (t == proj.getCurrentCircuit() && t != null) {
          proj.setCurrentCircuit(proj.getLogisimFile().getMainCircuit());
        }
       
        if (proj.getTool() == event.getData()) {
          Tool next = findTool(proj.getLogisimFile().getOptions()
                    .getToolbarData().getContents());
          if (next == null) {
            for (Library lib : proj.getLogisimFile().getLibraries()) {
              next = findTool(lib.getTools());
              if (next != null) break;
View Full Code Here

        }
      }
    }
   
    private Tool findTool(List<? extends Tool> opts) {
      Tool ret = null;
      for (Tool o : opts) {
        if (ret == null && o != null) ret = o;
        else if (o instanceof EditTool) ret = o;
      }
      return ret;
View Full Code Here

  Element fromMouseMappings() {
    Element elt = doc.createElement("mappings");
    MouseMappings map = file.getOptions().getMouseMappings();
    for (Map.Entry<Integer,Tool> entry : map.getMappings().entrySet()) {
      Integer mods = entry.getKey();
      Tool tool = entry.getValue();
      Element toolElt = fromTool(tool);
      String mapValue = InputEventUtil.toString(mods.intValue());
      toolElt.setAttribute("map", mapValue);
      elt.appendChild(toolElt);
    }
View Full Code Here

    this.contents.clear();
    for (Tool srcTool : other.contents) {
      if (srcTool == null) {
        this.addSeparator();
      } else {
        Tool toolCopy = file.findTool(srcTool);
        if (toolCopy != null) {
          Tool dstTool = toolCopy.cloneTool();
          AttributeSets.copy(srcTool.getAttributeSet(),
              dstTool.getAttributeSet());
          this.addTool(dstTool);
          addAttributeListeners(toolCopy);
        }
      }
    }
View Full Code Here

    contents.add(pos, null);
    fireToolbarChanged();
  }

  public Object move(int from, int to) {
    Tool moved = contents.remove(from);
    contents.add(to, moved);
    fireToolbarChanged();
    return moved;
  }
View Full Code Here

TOP

Related Classes of com.cburch.logisim.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.