Loading src/main/java/ecorp/easy/installer/controllers/MainWindowController.java +13 −22 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import ecorp.easy.installer.controllers.stepControllers.Stoppable; import ecorp.easy.installer.models.Phone; import ecorp.easy.installer.models.steps.IStep; import ecorp.easy.installer.tasks.CommandExecutionTask; import ecorp.easy.installer.threads.ThreadFactory; import ecorp.easy.installer.utils.UiUtils; import java.io.IOException; Loading Loading @@ -62,10 +61,9 @@ public class MainWindowController implements Initializable { @FXML Button nextButton; @FXML Label titleLabel; ResourceBundle i18n ;//internationalization String currentSubRootId =null; ThreadFactory factory = new ThreadFactory("/yaml/"); Phone device; //Object encapsulating data about the device to flash private ResourceBundle i18n ;//internationalization private String currentSubRootId =null; Phone phone; //Object encapsulating data about the device to flash private String currentStepKey = "f0"; private Object subController; Loading Loading @@ -195,7 +193,7 @@ public class MainWindowController implements Initializable { String fxmlName = ""; String title ="installationTitle"; if(currentStepKey.equals(IStep.LAST_STEP_KEY)){ if(device.isFlashed()){ if(phone.isFlashed()){ fxmlName="7-flashResult.fxml"; title="installationTitle"; }else{ Loading @@ -203,7 +201,7 @@ public class MainWindowController implements Initializable { title="feedback_mTitle"; } }else{ final IStep step = factory.getFlashMould().getSteps().get(currentStepKey); final IStep step = phone.getFlashingProcess().getSteps().get(currentStepKey); switch(step.getType()){ case "askAccount": Loading Loading @@ -241,7 +239,7 @@ public class MainWindowController implements Initializable { case "flashResultRoot": final String fxmlFileName; final String nextViewTitle; if( device.isFlashed() ){ if( phone.isFlashed() ){ fxmlFileName = "8-congrats.fxml"; nextViewTitle ="congrats_mTitle"; } Loading Loading @@ -274,13 +272,12 @@ public class MainWindowController implements Initializable { /** * Put device object inside the factory * @param device the device object * @param phone the device object */ public void setDevice(Phone device){ this.factory.changeMould(device); this.device = device; CommandExecutionTask.updateCommonParam("DEVICE_ID", device.getSerialNo()); CommandExecutionTask.updateCommonParam("DEVICE_DEVICE", device.getAdbDevice()); public void setPhone(Phone phone){ this.phone = phone; CommandExecutionTask.updateCommonParam("DEVICE_ID", phone.getSerialNo()); CommandExecutionTask.updateCommonParam("DEVICE_DEVICE", phone.getAdbDevice()); } /** Loading @@ -294,7 +291,6 @@ public class MainWindowController implements Initializable { /** * Close previous view after a fadeOut, and open new view * @param previousNodeId * @param fxmlName * @param viewTitle * @param controller optionnal controller for the new UI. Should be null if already defined in FXML Loading Loading @@ -403,11 +399,6 @@ public class MainWindowController implements Initializable { }); } // Private method relative to Flash & preparation Thread public ThreadFactory getThreadFactory(){ return factory; } // Other methods /** * Method call when app is closing Loading Loading @@ -451,8 +442,8 @@ public class MainWindowController implements Initializable { * Allow subController to access to the device's information * @return */ public Phone getDevice() { return device; public Phone getPhone() { return phone; } Loading src/main/java/ecorp/easy/installer/controllers/stepControllers/CustomExecutableController.java +2 −2 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ public class CustomExecutableController extends StepController<CustomExecutableS new Locale.Builder() .setRegion("en") .setLanguage("EN") .setVariant(parentController.getDevice().getInternalCode()) .setVariant(parentController.getPhone().getInternalCode()) .build()); private int currentEmphasizedInstruction = 0; Loading Loading @@ -89,7 +89,7 @@ public class CustomExecutableController extends StepController<CustomExecutableS displayInstructionImage(instructions.get(currentEmphasizedInstruction)); instructionsCount = instructions.size(); globalProgressMgr = new FlashGlobalProgressManager(parentController.getThreadFactory().getStepsCount()); globalProgressMgr = new FlashGlobalProgressManager(parentController.getPhone().getFlashingProcess().getStepsCount()); for(int i = 0;i < step.getStepNumber(); i++){ globalProgressMgr.updateProgression(); } Loading src/main/java/ecorp/easy/installer/controllers/stepControllers/CustomStepController.java +2 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ public class CustomStepController extends StepController<ICustomStep>{ new Locale.Builder() .setRegion("en") .setLanguage("EN") .setVariant(parentController.getDevice().getInternalCode()) .setVariant(parentController.getPhone().getInternalCode()) .build()); private int currentEmphasizedInstruction = 0; Loading Loading @@ -77,7 +77,7 @@ public class CustomStepController extends StepController<ICustomStep>{ instructionsCount = instructions.size(); globalProgressMgr = new FlashGlobalProgressManager(parentController.getThreadFactory().getStepsCount()); globalProgressMgr = new FlashGlobalProgressManager(parentController.getPhone().getFlashingProcess().getStepsCount()); for(int i = 0;i < step.getStepNumber(); i++){ globalProgressMgr.updateProgression(); } Loading src/main/java/ecorp/easy/installer/controllers/stepControllers/LoadStepController.java +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ public class LoadStepController extends StepController<LoadStep> implements Stop } globalProgressMgr = new FlashGlobalProgressManager(parentController.getThreadFactory().getStepsCount()); globalProgressMgr = new FlashGlobalProgressManager(parentController.getPhone().getFlashingProcess().getStepsCount()); for(int i = 0;i < step.getStepNumber(); i++){ globalProgressMgr.updateProgression(); } Loading src/main/java/ecorp/easy/installer/controllers/stepControllers/StepController.java +2 −2 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public class StepController<S extends IStep> implements Initializable{ final String stepKey = parentController.getCurrentStepKey(); System.out.println("stepKey = "+stepKey); step = (S) parentController.getThreadFactory().getFlashMould().getSteps().get(stepKey); step = (S) parentController.getPhone().getFlashingProcess().getSteps().get(stepKey); parentController.setNextButtonOnClickListener( ( MouseEvent event) -> { if(event.getEventType().equals(MouseEvent.MOUSE_CLICKED)){ Loading Loading @@ -82,7 +82,7 @@ public class StepController<S extends IStep> implements Initializable{ System.out.println("onStepEnd() load: "+step.getNextStepKey()); parentController.setCurrentStepKey(step.getNextStepKey()); if(step.getNextStepKey().equals(IStep.LAST_STEP_KEY)){ parentController.getDevice().setFlashed(); parentController.getPhone().setFlashed(); } parentController.loadSubScene(); Loading Loading
src/main/java/ecorp/easy/installer/controllers/MainWindowController.java +13 −22 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import ecorp.easy.installer.controllers.stepControllers.Stoppable; import ecorp.easy.installer.models.Phone; import ecorp.easy.installer.models.steps.IStep; import ecorp.easy.installer.tasks.CommandExecutionTask; import ecorp.easy.installer.threads.ThreadFactory; import ecorp.easy.installer.utils.UiUtils; import java.io.IOException; Loading Loading @@ -62,10 +61,9 @@ public class MainWindowController implements Initializable { @FXML Button nextButton; @FXML Label titleLabel; ResourceBundle i18n ;//internationalization String currentSubRootId =null; ThreadFactory factory = new ThreadFactory("/yaml/"); Phone device; //Object encapsulating data about the device to flash private ResourceBundle i18n ;//internationalization private String currentSubRootId =null; Phone phone; //Object encapsulating data about the device to flash private String currentStepKey = "f0"; private Object subController; Loading Loading @@ -195,7 +193,7 @@ public class MainWindowController implements Initializable { String fxmlName = ""; String title ="installationTitle"; if(currentStepKey.equals(IStep.LAST_STEP_KEY)){ if(device.isFlashed()){ if(phone.isFlashed()){ fxmlName="7-flashResult.fxml"; title="installationTitle"; }else{ Loading @@ -203,7 +201,7 @@ public class MainWindowController implements Initializable { title="feedback_mTitle"; } }else{ final IStep step = factory.getFlashMould().getSteps().get(currentStepKey); final IStep step = phone.getFlashingProcess().getSteps().get(currentStepKey); switch(step.getType()){ case "askAccount": Loading Loading @@ -241,7 +239,7 @@ public class MainWindowController implements Initializable { case "flashResultRoot": final String fxmlFileName; final String nextViewTitle; if( device.isFlashed() ){ if( phone.isFlashed() ){ fxmlFileName = "8-congrats.fxml"; nextViewTitle ="congrats_mTitle"; } Loading Loading @@ -274,13 +272,12 @@ public class MainWindowController implements Initializable { /** * Put device object inside the factory * @param device the device object * @param phone the device object */ public void setDevice(Phone device){ this.factory.changeMould(device); this.device = device; CommandExecutionTask.updateCommonParam("DEVICE_ID", device.getSerialNo()); CommandExecutionTask.updateCommonParam("DEVICE_DEVICE", device.getAdbDevice()); public void setPhone(Phone phone){ this.phone = phone; CommandExecutionTask.updateCommonParam("DEVICE_ID", phone.getSerialNo()); CommandExecutionTask.updateCommonParam("DEVICE_DEVICE", phone.getAdbDevice()); } /** Loading @@ -294,7 +291,6 @@ public class MainWindowController implements Initializable { /** * Close previous view after a fadeOut, and open new view * @param previousNodeId * @param fxmlName * @param viewTitle * @param controller optionnal controller for the new UI. Should be null if already defined in FXML Loading Loading @@ -403,11 +399,6 @@ public class MainWindowController implements Initializable { }); } // Private method relative to Flash & preparation Thread public ThreadFactory getThreadFactory(){ return factory; } // Other methods /** * Method call when app is closing Loading Loading @@ -451,8 +442,8 @@ public class MainWindowController implements Initializable { * Allow subController to access to the device's information * @return */ public Phone getDevice() { return device; public Phone getPhone() { return phone; } Loading
src/main/java/ecorp/easy/installer/controllers/stepControllers/CustomExecutableController.java +2 −2 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ public class CustomExecutableController extends StepController<CustomExecutableS new Locale.Builder() .setRegion("en") .setLanguage("EN") .setVariant(parentController.getDevice().getInternalCode()) .setVariant(parentController.getPhone().getInternalCode()) .build()); private int currentEmphasizedInstruction = 0; Loading Loading @@ -89,7 +89,7 @@ public class CustomExecutableController extends StepController<CustomExecutableS displayInstructionImage(instructions.get(currentEmphasizedInstruction)); instructionsCount = instructions.size(); globalProgressMgr = new FlashGlobalProgressManager(parentController.getThreadFactory().getStepsCount()); globalProgressMgr = new FlashGlobalProgressManager(parentController.getPhone().getFlashingProcess().getStepsCount()); for(int i = 0;i < step.getStepNumber(); i++){ globalProgressMgr.updateProgression(); } Loading
src/main/java/ecorp/easy/installer/controllers/stepControllers/CustomStepController.java +2 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ public class CustomStepController extends StepController<ICustomStep>{ new Locale.Builder() .setRegion("en") .setLanguage("EN") .setVariant(parentController.getDevice().getInternalCode()) .setVariant(parentController.getPhone().getInternalCode()) .build()); private int currentEmphasizedInstruction = 0; Loading Loading @@ -77,7 +77,7 @@ public class CustomStepController extends StepController<ICustomStep>{ instructionsCount = instructions.size(); globalProgressMgr = new FlashGlobalProgressManager(parentController.getThreadFactory().getStepsCount()); globalProgressMgr = new FlashGlobalProgressManager(parentController.getPhone().getFlashingProcess().getStepsCount()); for(int i = 0;i < step.getStepNumber(); i++){ globalProgressMgr.updateProgression(); } Loading
src/main/java/ecorp/easy/installer/controllers/stepControllers/LoadStepController.java +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ public class LoadStepController extends StepController<LoadStep> implements Stop } globalProgressMgr = new FlashGlobalProgressManager(parentController.getThreadFactory().getStepsCount()); globalProgressMgr = new FlashGlobalProgressManager(parentController.getPhone().getFlashingProcess().getStepsCount()); for(int i = 0;i < step.getStepNumber(); i++){ globalProgressMgr.updateProgression(); } Loading
src/main/java/ecorp/easy/installer/controllers/stepControllers/StepController.java +2 −2 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public class StepController<S extends IStep> implements Initializable{ final String stepKey = parentController.getCurrentStepKey(); System.out.println("stepKey = "+stepKey); step = (S) parentController.getThreadFactory().getFlashMould().getSteps().get(stepKey); step = (S) parentController.getPhone().getFlashingProcess().getSteps().get(stepKey); parentController.setNextButtonOnClickListener( ( MouseEvent event) -> { if(event.getEventType().equals(MouseEvent.MOUSE_CLICKED)){ Loading Loading @@ -82,7 +82,7 @@ public class StepController<S extends IStep> implements Initializable{ System.out.println("onStepEnd() load: "+step.getNextStepKey()); parentController.setCurrentStepKey(step.getNextStepKey()); if(step.getNextStepKey().equals(IStep.LAST_STEP_KEY)){ parentController.getDevice().setFlashed(); parentController.getPhone().setFlashed(); } parentController.loadSubScene(); Loading