com.github.croesch.micro_debug.gui.components.controller
Class MainController

java.lang.Object
  extended by com.github.croesch.micro_debug.gui.components.controller.MainController
All Implemented Interfaces:
com.github.croesch.micro_debug.mic1.api.IProcessorInterpreter

public final class MainController
extends Object
implements com.github.croesch.micro_debug.mic1.api.IProcessorInterpreter

The main controller of the GUI of the debugger. Contains the logical actions to perform based on events received from the main GUIs components.

Since:
Date: Apr 11, 2012
Author:
croesch

Constructor Summary
MainController(com.github.croesch.micro_debug.mic1.Mic1 proc, MainView view, com.github.croesch.micro_debug.debug.BreakpointManager bpm, boolean updateAfterTick)
          Constructs the main controller for the given main view.
 
Method Summary
 boolean canContinue(int microLine, int macroLine, com.github.croesch.micro_debug.mic1.controlstore.MicroInstruction currentInstruction, com.github.croesch.micro_debug.mic1.controlstore.MicroInstruction nextInstruction)
          
 com.github.croesch.micro_debug.debug.BreakpointManager getBpm()
          Returns the breakpoint model used by this controller.
 com.github.croesch.micro_debug.mic1.Mic1 getProcessor()
          Returns the Mic1 processor being debugged by this debugger.
 void setInterrupted(boolean interrupt)
          Sets if the running processor should be interrupted.
 void tickDone(com.github.croesch.micro_debug.mic1.controlstore.MicroInstruction instruction, boolean macroCodeFetching)
          
 void updateView()
          Performs an update of the view components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MainController

public MainController(com.github.croesch.micro_debug.mic1.Mic1 proc,
                      MainView view,
                      com.github.croesch.micro_debug.debug.BreakpointManager bpm,
                      boolean updateAfterTick)
Constructs the main controller for the given main view.

Parameters:
proc - the processor to interprete
view - the view this controller controlls and interacts with
bpm - the model for breakpoints of this debugger
updateAfterTick - whether the view should be updated after each single tick of the processor
Since:
Date: Apr 11, 2012
Method Detail

getBpm

@NotNull
public com.github.croesch.micro_debug.debug.BreakpointManager getBpm()
Returns the breakpoint model used by this controller.

Returns:
the BreakpointManager that is the model, managing the breakpoints of the debugger.
Since:
Date: Apr 11, 2012

canContinue

public boolean canContinue(int microLine,
                           int macroLine,
                           com.github.croesch.micro_debug.mic1.controlstore.MicroInstruction currentInstruction,
                           com.github.croesch.micro_debug.mic1.controlstore.MicroInstruction nextInstruction)

Specified by:
canContinue in interface com.github.croesch.micro_debug.mic1.api.IProcessorInterpreter

tickDone

public void tickDone(com.github.croesch.micro_debug.mic1.controlstore.MicroInstruction instruction,
                     boolean macroCodeFetching)

Specified by:
tickDone in interface com.github.croesch.micro_debug.mic1.api.IProcessorInterpreter

updateView

public void updateView()
Performs an update of the view components. Use with care - might be slow.

Since:
Date: Jun 2, 2012

getProcessor

@NotNull
public com.github.croesch.micro_debug.mic1.Mic1 getProcessor()
Returns the Mic1 processor being debugged by this debugger.

Returns:
the processor being debugged.
Since:
Date: Jun 2, 2012

setInterrupted

public void setInterrupted(boolean interrupt)
Sets if the running processor should be interrupted.

Parameters:
interrupt - true, if the running processor should be interrupted.
Since:
Date: Jun 2, 2012


Copyright © 2012. All Rights Reserved.