Search in sources :

Example 1 with LibraryListener

use of com.cburch.logisim.file.LibraryListener in project logisim-evolution by reds-heig.

the class Project method setLogisimFile.

public void setLogisimFile(LogisimFile value) {
    LogisimFile old = this.file;
    if (old != null) {
        for (LibraryListener l : fileListeners) {
            old.removeLibraryListener(l);
        }
    }
    file = value;
    stateMap.clear();
    depends = new Dependencies(file);
    undoLog.clear();
    redoLog.clear();
    undoMods = 0;
    fireEvent(ProjectEvent.ACTION_SET_FILE, old, file);
    setCurrentCircuit(file.getMainCircuit());
    if (file != null) {
        for (LibraryListener l : fileListeners) {
            file.addLibraryListener(l);
        }
    }
    // toggle it so that everybody hears the file is
    file.setDirty(true);
    // fresh
    file.setDirty(false);
}
Also used : LogisimFile(com.cburch.logisim.file.LogisimFile) LibraryListener(com.cburch.logisim.file.LibraryListener)

Aggregations

LibraryListener (com.cburch.logisim.file.LibraryListener)1 LogisimFile (com.cburch.logisim.file.LogisimFile)1