Simplify ComponentLocator
This commit is contained in:
@ -9,27 +9,23 @@ public abstract class PICComponent {
|
||||
IOPortInterface ioPorts;
|
||||
TimerInterface timer;
|
||||
InterruptInterface interrupts;
|
||||
//TableInterface table;
|
||||
//WindowManagement createWindow;
|
||||
FrontendControllerInterface frontendController;
|
||||
WatchdogTimerInterface watchdogTimer;
|
||||
ProgramStackInterface programStack;
|
||||
CommandInterface commands;
|
||||
ToggleButtonInterface toggleButtonExt;
|
||||
|
||||
void initialize(PICComponents picComponents) {
|
||||
toggleButtonExt = (ToggleButtonInterface) picComponents.getComponent(ToggleButtonInterface.class);
|
||||
dataRegister = (DataRegisterInterface) picComponents.getComponent(DataRegisterInterface.class);
|
||||
eeprom = (EEPROMInterface) picComponents.getComponent(EEPROMInterface.class);
|
||||
ioPorts = (IOPortInterface) picComponents.getComponent(IOPortInterface.class);
|
||||
preScaler = (PreScalerInterface) picComponents.getComponent(PreScalerInterface.class);
|
||||
timer = (TimerInterface) picComponents.getComponent(TimerInterface.class);
|
||||
interrupts = (InterruptInterface) picComponents.getComponent(InterruptInterface.class);
|
||||
//table = (TableInterface) picComponents.getComponent(TableInterface.class);
|
||||
//createWindow = (WindowManagement) picComponents.getComponent(WindowManagement.class);
|
||||
frontendController = (FrontendControllerInterface) picComponents.getComponent(FrontendControllerInterface.class);
|
||||
watchdogTimer = (WatchdogTimerInterface) picComponents.getComponent(WatchdogTimerInterface.class);
|
||||
programStack = (ProgramStackInterface) picComponents.getComponent(ProgramStackInterface.class);
|
||||
commands = (CommandInterface) picComponents.getComponent(CommandInterface.class);
|
||||
void initialize(PICComponentLocator locator) {
|
||||
toggleButtonExt = locator.getComponent(ToggleButtonInterface.class);
|
||||
dataRegister = locator.getComponent(DataRegisterInterface.class);
|
||||
eeprom = locator.getComponent(EEPROMInterface.class);
|
||||
ioPorts = locator.getComponent(IOPortInterface.class);
|
||||
preScaler = locator.getComponent(PreScalerInterface.class);
|
||||
timer = locator.getComponent(TimerInterface.class);
|
||||
interrupts = locator.getComponent(InterruptInterface.class);
|
||||
frontendController = locator.getComponent(FrontendControllerInterface.class);
|
||||
watchdogTimer = locator.getComponent(WatchdogTimerInterface.class);
|
||||
programStack = locator.getComponent(ProgramStackInterface.class);
|
||||
commands = locator.getComponent(CommandInterface.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user