Search in sources :

Example 26 with CircuitState

use of com.cburch.logisim.circuit.CircuitState in project logisim-evolution by reds-heig.

the class ComponentSelector method setLogModel.

public void setLogModel(Model value) {
    this.logModel = value;
    DefaultTreeModel model = (DefaultTreeModel) getModel();
    CircuitNode curRoot = (CircuitNode) model.getRoot();
    CircuitState state = logModel == null ? null : logModel.getCircuitState();
    if (state == null) {
        if (curRoot != null)
            model.setRoot(null);
        return;
    }
    if (curRoot == null || curRoot.circuitState != state) {
        curRoot = new CircuitNode(null, state, null);
        model.setRoot(curRoot);
    }
}
Also used : CircuitState(com.cburch.logisim.circuit.CircuitState) DefaultTreeModel(javax.swing.tree.DefaultTreeModel)

Aggregations

CircuitState (com.cburch.logisim.circuit.CircuitState)26 Component (com.cburch.logisim.comp.Component)6 Circuit (com.cburch.logisim.circuit.Circuit)5 ArrayList (java.util.ArrayList)4 ComponentDrawContext (com.cburch.logisim.comp.ComponentDrawContext)3 Location (com.cburch.logisim.data.Location)3 Instance (com.cburch.logisim.instance.Instance)3 InstanceState (com.cburch.logisim.instance.InstanceState)3 Color (java.awt.Color)3 Dimension (java.awt.Dimension)3 Simulator (com.cburch.logisim.circuit.Simulator)2 SubcircuitFactory (com.cburch.logisim.circuit.SubcircuitFactory)2 Bounds (com.cburch.logisim.data.Bounds)2 Value (com.cburch.logisim.data.Value)2 LogisimFile (com.cburch.logisim.file.LogisimFile)2 Graphics (java.awt.Graphics)2 TreePath (javax.swing.tree.TreePath)2 CircuitListener (com.cburch.logisim.circuit.CircuitListener)1 SimulatorEvent (com.cburch.logisim.circuit.SimulatorEvent)1 AppearancePort (com.cburch.logisim.circuit.appear.AppearancePort)1