-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathPathController.java
More file actions
40 lines (34 loc) · 1.51 KB
/
Copy pathPathController.java
File metadata and controls
40 lines (34 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package subway.Controller;
import subway.View.InputView;
import subway.View.OutputView;
import java.util.Scanner;
public class PathController {
private static final String PATH_CONTROLLER_SHORT_DISTANCE="1";
private static final String PATH_CONTROLLER_SHORT_TIME="2";
private static final String PATH_CONTROLLER_BACK="B";
OutputView outputView=new OutputView();
InputView inputView =new InputView();
ComputeShortValue computeShortValue =new ComputeShortValue();
public void startPathMenu(Scanner scanner) {
outputView.setPathMenuPathStandard();
String tmpSavePathMenuChoice = inputView.getChooseFunction(scanner);
pathMenuChoice(scanner,tmpSavePathMenuChoice);
}
public void pathMenuChoice(Scanner scanner,String tmpSavePathMenuChoice) {
if(tmpSavePathMenuChoice.equals(PATH_CONTROLLER_BACK)) {
return ;
}
if(tmpSavePathMenuChoice.equals(PATH_CONTROLLER_SHORT_TIME)) {
setPathControllerShortTime(scanner);
}
if(tmpSavePathMenuChoice.equals(PATH_CONTROLLER_SHORT_DISTANCE)) {
setPathControllerShortDistance(scanner);
}
}
public void setPathControllerShortDistance(Scanner scanner) {
computeShortValue.setDistanceGraph(inputView.getStationStart(scanner),inputView.getStationEnd(scanner));
}
public void setPathControllerShortTime(Scanner scanner) {
computeShortValue.setTimeGraph(inputView.getStationEnd(scanner),inputView.getStationStart(scanner));
}
}