Search in sources :

Example 1 with Project

use of com.cburch.logisim.proj.Project in project logisim-evolution by reds-heig.

the class Frame method isProjectFrameAt.

private static boolean isProjectFrameAt(int x, int y) {
    for (Project current : Projects.getOpenProjects()) {
        Frame frame = current.getFrame();
        if (frame != null) {
            Point loc = frame.getLocationOnScreen();
            int d = Math.abs(loc.x - x) + Math.abs(loc.y - y);
            if (d <= 3) {
                return true;
            }
        }
    }
    return false;
}
Also used : Project(com.cburch.logisim.proj.Project) JFrame(javax.swing.JFrame) LFrame(com.cburch.logisim.gui.generic.LFrame) Point(java.awt.Point) Point(java.awt.Point)

Example 2 with Project

use of com.cburch.logisim.proj.Project in project logisim-evolution by reds-heig.

the class LayoutEditHandler method copy.

@Override
public void copy() {
    Project proj = frame.getProject();
    Selection sel = frame.getCanvas().getSelection();
    proj.doAction(SelectionActions.copy(sel));
}
Also used : Project(com.cburch.logisim.proj.Project)

Example 3 with Project

use of com.cburch.logisim.proj.Project in project logisim-evolution by reds-heig.

the class LayoutEditHandler method delete.

@Override
public void delete() {
    Project proj = frame.getProject();
    Selection sel = frame.getCanvas().getSelection();
    proj.doAction(SelectionActions.clear(sel));
}
Also used : Project(com.cburch.logisim.proj.Project)

Example 4 with Project

use of com.cburch.logisim.proj.Project in project logisim-evolution by reds-heig.

the class LayoutEditHandler method selectAll.

@Override
public void selectAll() {
    Project proj = frame.getProject();
    Selection sel = frame.getCanvas().getSelection();
    selectSelectTool(proj);
    Circuit circ = proj.getCurrentCircuit();
    sel.addAll(circ.getWires());
    sel.addAll(circ.getNonWires());
    proj.repaintCanvas();
}
Also used : Project(com.cburch.logisim.proj.Project) Circuit(com.cburch.logisim.circuit.Circuit)

Example 5 with Project

use of com.cburch.logisim.proj.Project in project logisim-evolution by reds-heig.

the class LayoutEditHandler method cut.

@Override
public void cut() {
    Project proj = frame.getProject();
    Selection sel = frame.getCanvas().getSelection();
    proj.doAction(SelectionActions.cut(sel));
}
Also used : Project(com.cburch.logisim.proj.Project)

Aggregations

Project (com.cburch.logisim.proj.Project)26 Circuit (com.cburch.logisim.circuit.Circuit)11 Component (com.cburch.logisim.comp.Component)7 Location (com.cburch.logisim.data.Location)5 Action (com.cburch.logisim.proj.Action)5 AttributeSet (com.cburch.logisim.data.AttributeSet)3 Bounds (com.cburch.logisim.data.Bounds)3 Selection (com.cburch.logisim.gui.main.Selection)3 Wire (com.cburch.logisim.circuit.Wire)2 ComponentUserEvent (com.cburch.logisim.comp.ComponentUserEvent)2 LoadFailedException (com.cburch.logisim.file.LoadFailedException)2 Loader (com.cburch.logisim.file.Loader)2 ToolAttributeAction (com.cburch.logisim.gui.main.ToolAttributeAction)2 MoveGesture (com.cburch.logisim.tools.move.MoveGesture)2 MoveResult (com.cburch.logisim.tools.move.MoveResult)2 File (java.io.File)2 IOException (java.io.IOException)2 Map (java.util.Map)2 Selection (com.cburch.draw.canvas.Selection)1 CanvasObject (com.cburch.draw.model.CanvasObject)1