OSDN Git Service

modified: build/classes/parauni/CommandController.class
[parauni/para-repos.git] / src / parauni / CommandController.java
1 package parauni;
2
3 import java.io.IOException;
4 import java.sql.SQLException;
5 import java.util.Date;
6 import java.util.logging.Level;
7 import java.util.logging.Logger;
8
9 /**
10  *
11  * @author karihei
12  */
13 public class CommandController {
14     // String com;
15     public CommandController(){
16         // 保留
17     }
18
19     public boolean CommandSelector(String com) throws IOException, SQLException, ClassNotFoundException{
20         UserTaskModel utaskmodel = new UserTaskModel();
21         UserTaskView utaskview = new UserTaskView();
22                 VirtualMachineModel vmmodel = new VirtualMachineModel();
23         VirtualMachineView vmview = new VirtualMachineView();
24
25                 String comlist[] = com.split(" ");
26
27                 // コマンド
28                 String head = comlist[0];
29         // 引数
30                 String arg[] = new String[comlist.length-1];
31
32         // 残りの引数をargに格納
33         for (int i = 0;i < comlist.length-1; i++) {
34             arg[i] = comlist[i+1];
35         }
36
37         if(head.equals("mktask")){
38             utaskmodel.makeTask(arg);
39         } else if(head.equals("rmtask")){
40
41         } else if(head.equals("lstask")){
42             utaskview.showTaskList();
43         } else if(head.equals("lsvm")){
44             vmview.showVMList();
45         } else if(head.equals("vmrun")){
46             vmmodel.vmRun(arg);
47         } else if(head.equals("isa")){
48             vmmodel.checkVMP("1");
49  } else if(head.equals("test")){
50         //vmmodel.test();
51         //new TaskViewer();
52        //Thread.sleep(5000);
53       
54    new TaskCenterPanel();
55         } else if(head.equals("exit") || head.equals("quit")){
56             return false;
57         } else {
58             System.out.println("command not found.");
59         }
60
61         return true;
62     }
63
64
65 }