-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from yprie/sprint1/interview-management
Sprint1/interview management
- Loading branch information
Showing
10 changed files
with
294 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/components/interviewSelector/appCommands/ChangeColorInterviewCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package components.interviewSelector.appCommands; | ||
|
||
import application.configuration.Configuration; | ||
import application.history.HistoryManager; | ||
import components.interviewSelector.controllers.InterviewSelectorCellController; | ||
import components.interviewSelector.controllers.NewInterviewController; | ||
import components.interviewSelector.modelCommands.AddInterviewCommand; | ||
import components.interviewSelector.modelCommands.ChangeColorInterview; | ||
import components.modelisationSpace.moment.modelCommands.ChangeColorMoment; | ||
import models.Interview; | ||
import models.Project; | ||
import utils.DialogState; | ||
import utils.command.Executable; | ||
import utils.popups.WarningPopup; | ||
|
||
public class ChangeColorInterviewCommand implements Executable { | ||
private Interview interview; | ||
private String newColor; | ||
private boolean userCommand; | ||
private InterviewSelectorCellController interviewSelectorCellController; | ||
public ChangeColorInterviewCommand(Interview interview, String newColor, InterviewSelectorCellController interviewSelectorCellController) { | ||
this.interview = interview; | ||
this.newColor = newColor; | ||
this.userCommand = true; | ||
this.interviewSelectorCellController=interviewSelectorCellController; | ||
} | ||
@Override | ||
public Void execute() { | ||
String oldColor = interview.getColor(); | ||
HistoryManager.addCommand(new ChangeColorInterview(interview, newColor, oldColor,interviewSelectorCellController), userCommand); | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/components/interviewSelector/modelCommands/ChangeColorInterview.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package components.interviewSelector.modelCommands; | ||
|
||
import application.history.ModelUserActionCommand; | ||
import components.interviewSelector.controllers.InterviewSelectorCellController; | ||
import models.Interview; | ||
import models.Project; | ||
|
||
|
||
public class ChangeColorInterview extends ModelUserActionCommand { | ||
|
||
private Interview interview; | ||
private String oldColor; | ||
private String newColor; | ||
private InterviewSelectorCellController interviewSelectorCellController; | ||
public ChangeColorInterview(Interview i, String newColor, String oldColor, InterviewSelectorCellController interviewSelectorCellController) { | ||
this.interviewSelectorCellController=interviewSelectorCellController; | ||
this.interview = i; | ||
this.newColor = newColor; | ||
this.oldColor = oldColor; | ||
} | ||
|
||
@Override | ||
public Void execute() { | ||
interview.setColor(newColor); | ||
interviewSelectorCellController.updateColor(); | ||
return null; | ||
} | ||
|
||
@Override | ||
public Void undo() { | ||
interview.setColor(oldColor); | ||
return null; | ||
} | ||
} |
Oops, something went wrong.