Package com.cburch.logisim.proj

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


                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

            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

            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

                    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

            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

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

            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

            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();
                }
View Full Code Here

        // 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

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.