Examples of repaintCanvas()


Examples of com.cburch.logisim.proj.Project.repaintCanvas()

    // Maybe user is clicking within the current caret.
    if (caret != null) {
      if (caret.getBounds(g).contains(e.getX(), e.getY())) { // Yes
        caret.mousePressed(e);
        proj.repaintCanvas();
        return;
      } else { // No. End the current caret.
        caret.stopEditing();
      }
    }
View Full Code Here

Examples of com.cburch.logisim.proj.Project.repaintCanvas()

      caretCanvas = canvas;
      caretCircuit = canvas.getCircuit();
      caret.addCaretListener(listener);
      caretCircuit.addCircuitListener(listener);
    }
    proj.repaintCanvas();
  }

  @Override
  public void mouseDragged(Canvas canvas, Graphics g, MouseEvent e) {
    //TODO: enhance label editing
View Full Code Here

Examples of com.cburch.logisim.proj.Project.repaintCanvas()

    Selection sel = frame.getCanvas().getSelection();
    selectSelectTool(proj);
    Circuit circ = proj.getCurrentCircuit();
    sel.addAll(circ.getWires());
    sel.addAll(circ.getNonWires());
    proj.repaintCanvas();
  }
 
  @Override
  public void raise() {
    ; // not yet supported in layout mode
View Full Code Here

Examples of com.cburch.logisim.proj.Project.repaintCanvas()

      Project proj = menubar.getProject();
      Simulator sim = proj == null ? null : proj.getSimulator();
      if (src == run || src == LogisimMenuBar.SIMULATE_ENABLE) {
        if (sim != null) {
          sim.setIsRunning(!sim.isRunning());
          proj.repaintCanvas();
        }
      } else if (src == reset) {
        if (sim != null) sim.requestReset();
      } else if (src == step || src == LogisimMenuBar.SIMULATE_STEP) {
        if (sim != null) sim.step();
View Full Code Here

Examples of com.cburch.logisim.proj.Project.repaintCanvas()

    // selection is being modified
    Collection<Component> in_sel = sel.getComponentsContaining(start, g);
    if (!in_sel.isEmpty()) {
      if ((e.getModifiers() & InputEvent.SHIFT_MASK) == 0) {
        setState(proj, MOVING);
        proj.repaintCanvas();
        return;
      } else {
        Action act = SelectionActions.drop(sel, in_sel);
        if (act != null) {
          proj.doAction(act);
View Full Code Here

Examples of com.cburch.logisim.proj.Project.repaintCanvas()

        if (!in_sel.contains(comp)) {
          sel.add(comp);
        }
      }
      setState(proj, MOVING);
      proj.repaintCanvas();
      return;
    }

    // The user clicked on the background. This is a rectangular
    // selection (maybe with the shift key down).
View Full Code Here

Examples of com.cburch.logisim.proj.Project.repaintCanvas()

      if (act != null) {
        proj.doAction(act);
      }
    }
    setState(proj, RECT_SELECT);
    proj.repaintCanvas();
  }

  @Override
  public void mouseDragged(Canvas canvas, Graphics g, MouseEvent e) {
    if (state == MOVING) {
View Full Code Here

Examples of com.cburch.logisim.proj.Project.repaintCanvas()

      handleMoveDrag(canvas, curDx, curDy, e.getModifiersEx());
    } else if (state == RECT_SELECT) {
      Project proj = canvas.getProject();
      curDx = e.getX() - start.getX();
      curDy = e.getY() - start.getY();
      proj.repaintCanvas();
    }
  }
 
  private void handleMoveDrag(Canvas canvas, int dx, int dy, int modsEx) {
    boolean connect = shouldConnect(canvas, modsEx);
View Full Code Here

Examples of com.cburch.logisim.proj.Project.repaintCanvas()

          Selection sel = proj.getSelection();
          proj.doAction(SelectionActions.translate(sel, dx, dy, repl));
        }
      }
      moveGesture = null;
      proj.repaintCanvas();
    } else if (state == RECT_SELECT) {
      Bounds bds = Bounds.create(start).add(start.getX() + curDx,
        start.getY() + curDy);
      Circuit circuit = canvas.getCircuit();
      Selection sel = proj.getSelection();
View Full Code Here

Examples of com.cburch.logisim.proj.Project.repaintCanvas()

      Action act = SelectionActions.drop(sel, in_sel);
      if (act != null) {
        proj.doAction(act);
      }
      setState(proj, IDLE);
      proj.repaintCanvas();
    }
  }
 
  @Override
  public void keyPressed(Canvas canvas, KeyEvent e) {
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.