Package com.cburch.logisim.gui.main

Examples of com.cburch.logisim.gui.main.Canvas$MyListener


    return tool;
  }

  public Selection getSelection() {
    if (frame == null) return null;
    Canvas canvas = frame.getCanvas();
    if (canvas == null) return null;
    return canvas.getSelection();
  }
View Full Code Here


    CircuitState old = circuitState;
    Circuit oldCircuit = old == null ? null : old.getCircuit();
    Circuit newCircuit = value.getCircuit();
    boolean circuitChanged = old == null || oldCircuit != newCircuit;
    if (circuitChanged) {
      Canvas canvas = frame == null ? null : frame.getCanvas();
      if (canvas != null) {
        if (tool != null) tool.deselect(canvas);
        Selection selection = canvas.getSelection();
        if (selection != null) {
          Action act = SelectionActions.dropAll(selection);
          if (act != null) {
            doAction(act);
          }
View Full Code Here

  }

  public void setTool(Tool value) {
    if (tool == value) return;
    Tool old = tool;
    Canvas canvas = frame.getCanvas();
    if (old != null) old.deselect(canvas);
    Selection selection = canvas.getSelection();
    if (selection != null && !selection.isEmpty()) {
      Circuit circuit = canvas.getCircuit();
      CircuitMutation xn = new CircuitMutation(circuit);
      if (value == null) {
        Action act = SelectionActions.dropAll(selection);
        if (act != null) {
          doAction(act);
View Full Code Here

      PinAttributes attrs = (PinAttributes) state.getAttributeSet();
      if (!attrs.isInput()) return;
 
      java.awt.Component sourceComp = e.getComponent();
      if (sourceComp instanceof Canvas && !state.isCircuitRoot()) {
        Canvas canvas = (Canvas) e.getComponent();
        CircuitState circState = canvas.getCircuitState();
        java.awt.Component frame = SwingUtilities.getRoot(canvas);
        int choice = JOptionPane.showConfirmDialog(frame,
            Strings.get("pinFrozenQuestion"),
            Strings.get("pinFrozenTitle"),
            JOptionPane.OK_CANCEL_OPTION,
            JOptionPane.WARNING_MESSAGE);
        if (choice == JOptionPane.OK_OPTION) {
          circState = circState.cloneState();
          canvas.getProject().setCircuitState(circState);
          state = circState.getInstanceState(state.getInstance());
        } else {
          return;
        }
      }
View Full Code Here

    public Selection getSelection() {
        if (frame == null) {
            return null;
        }

        Canvas canvas = frame.getCanvas();
        if (canvas == null) {
            return null;
        }

        return canvas.getSelection();
    }
View Full Code Here

        CircuitState old = circuitState;
        Circuit oldCircuit = old == null ? null : old.getCircuit();
        Circuit newCircuit = value.getCircuit();
        boolean circuitChanged = old == null || oldCircuit != newCircuit;
        if (circuitChanged) {
            Canvas canvas = frame == null ? null : frame.getCanvas();
            if (canvas != null) {
                if (tool != null) {
                    tool.deselect(canvas);
                }

                Selection selection = canvas.getSelection();
                if (selection != null) {
                    Action act = SelectionActions.dropAll(selection);
                    if (act != null) {
                        doAction(act);
                    }
View Full Code Here

        if (tool == value) {
            return;
        }

        Tool old = tool;
        Canvas canvas = frame.getCanvas();
        if (old != null) {
            old.deselect(canvas);
        }

        Selection selection = canvas.getSelection();
        if (selection != null && !selection.isEmpty()) {
            if (value == null || !getOptions().getMouseMappings().containsSelectTool()) {
                Action act = SelectionActions.anchorAll(selection);
                if (act != null) {
                    doAction(act);
View Full Code Here

            PinAttributes attrs = (PinAttributes) state.getAttributeSet();
            if (!attrs.isInput()) return;

            java.awt.Component sourceComp = e.getComponent();
            if (sourceComp instanceof Canvas && !state.isCircuitRoot()) {
                Canvas canvas = (Canvas) e.getComponent();
                CircuitState circState = canvas.getCircuitState();
                java.awt.Component frame = SwingUtilities.getRoot(canvas);
                int choice = JOptionPane.showConfirmDialog(frame,
                        getFromLocale("pinFrozenQuestion"),
                        getFromLocale("pinFrozenTitle"),
                        JOptionPane.OK_CANCEL_OPTION,
                        JOptionPane.WARNING_MESSAGE);
                if (choice == JOptionPane.OK_OPTION) {
                    circState = circState.cloneState();
                    canvas.getProject().setCircuitState(circState);
                    state = circState.getInstanceState(state.getInstance());
                } else {
                    return;
                }
            }
View Full Code Here

TOP

Related Classes of com.cburch.logisim.gui.main.Canvas$MyListener

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.