コード例 #1
0
 /** Constructs a new RegisterWithGUI. */
 public RegisterWithGUI() {
   if (GatesManager.getInstance().isChipsGUIEnabled()) {
     gui = new RegisterComponent();
     gui.setName("Reg:");
     gui.setLocation(180, 10);
     gui.reset();
     gui.addListener(this);
     gui.addErrorListener(this);
   }
 }
コード例 #2
0
 protected void clockUp() {
   short in = inputPins[0].get(); // 16 bit input
   short load = inputPins[1].get(); // load bit
   if (load == 1) {
     value = in;
     if (gui != null) gui.setValueAt(0, value);
   }
 }
コード例 #3
0
 // updates the given value
 private void updateValue(short newValue) {
   value = newValue;
   outputPins[0].set(newValue);
   evalParent();
   if (gui != null) gui.setValueAt(0, newValue);
 }