OSDN Git Service

modified: build/classes/parauni/CommandController.class master
authorYouhei KARIKAWA <karihei@users.sourceforge.jp>
Wed, 11 Nov 2009 19:43:17 +0000 (04:43 +0900)
committerYouhei KARIKAWA <karihei@users.sourceforge.jp>
Wed, 11 Nov 2009 19:43:17 +0000 (04:43 +0900)
modified:   build/classes/parauni/DataBase.class
modified:   build/classes/parauni/Main.class
modified:   dist/ParaUni.jar
modified:   src/parauni/CommandController.java
modified:   src/parauni/DataBase.java
modified:   src/parauni/Main.java
build/classes/parauni/TaskCenter$1.class
build/classes/parauni/TaskCenter$2.class
build/classes/parauni/TaskCenter.class
build/classes/parauni/TaskCenterPanel$1.class
build/classes/parauni/TaskCenterPanel$2.class
build/classes/parauni/TaskCenterPanel$3.class
build/classes/parauni/TaskCenterPanel$4.class
build/classes/parauni/TaskCenterPanel.class
build/classes/parauni/TaskViewer.class
build/classes/parauni/VirtualMachineModel$ScreenCaptureThread.class
build/classes/parauni/VirtualMachineModel$ThumnailThread.class
build/classes/parauni/VirtualMachineModel$VMThread.class
build/classes/parauni/VirtualMachineModel.class
build/classes/parauni/VirtualMachineView.class
dist/README.TXT
src/parauni/TaskCenter.form
src/parauni/TaskCenter.java
src/parauni/TaskCenterPanel.form
src/parauni/TaskCenterPanel.java
src/parauni/TaskViewer.java
src/parauni/VirtualMachineModel.java
src/parauni/VirtualMachineView.java
        switch.sh

build/classes/parauni/CommandController.class
build/classes/parauni/DataBase.class
build/classes/parauni/Main.class
dist/ParaUni.jar
src/parauni/CommandController.java
src/parauni/DataBase.java
src/parauni/Main.java

index 7ad4d0b..dd48422 100644 (file)
Binary files a/build/classes/parauni/CommandController.class and b/build/classes/parauni/CommandController.class differ
index cccebdd..5b709d1 100644 (file)
Binary files a/build/classes/parauni/DataBase.class and b/build/classes/parauni/DataBase.class differ
index 9092892..3063267 100644 (file)
Binary files a/build/classes/parauni/Main.class and b/build/classes/parauni/Main.class differ
index 4b95d43..728ec02 100644 (file)
Binary files a/dist/ParaUni.jar and b/dist/ParaUni.jar differ
index 09eec1e..0f7067a 100644 (file)
@@ -2,6 +2,9 @@ package parauni;
 
 import java.io.IOException;
 import java.sql.SQLException;
 
 import java.io.IOException;
 import java.sql.SQLException;
+import java.util.Date;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  *
 
 /**
  *
@@ -16,9 +19,15 @@ public class CommandController {
     public boolean CommandSelector(String com) throws IOException, SQLException, ClassNotFoundException{
         UserTaskModel utaskmodel = new UserTaskModel();
         UserTaskView utaskview = new UserTaskView();
     public boolean CommandSelector(String com) throws IOException, SQLException, ClassNotFoundException{
         UserTaskModel utaskmodel = new UserTaskModel();
         UserTaskView utaskview = new UserTaskView();
-        String comlist[] = com.split(" ");
-        String head = comlist[0];
-        String arg[] = new String[comlist.length-1];
+               VirtualMachineModel vmmodel = new VirtualMachineModel();
+        VirtualMachineView vmview = new VirtualMachineView();
+
+               String comlist[] = com.split(" ");
+
+               // コマンド
+               String head = comlist[0];
+        // 引数
+               String arg[] = new String[comlist.length-1];
 
         // 残りの引数をargに格納
         for (int i = 0;i < comlist.length-1; i++) {
 
         // 残りの引数をargに格納
         for (int i = 0;i < comlist.length-1; i++) {
@@ -31,9 +40,19 @@ public class CommandController {
 
         } else if(head.equals("lstask")){
             utaskview.showTaskList();
 
         } else if(head.equals("lstask")){
             utaskview.showTaskList();
+        } else if(head.equals("lsvm")){
+            vmview.showVMList();
         } else if(head.equals("vmrun")){
         } else if(head.equals("vmrun")){
-
-        } else if(head.equals("exit")){
+            vmmodel.vmRun(arg);
+        } else if(head.equals("isa")){
+            vmmodel.checkVMP("1");
+ } else if(head.equals("test")){
+        //vmmodel.test();
+        //new TaskViewer();
+       //Thread.sleep(5000);
+      
+   new TaskCenterPanel();
+        } else if(head.equals("exit") || head.equals("quit")){
             return false;
         } else {
             System.out.println("command not found.");
             return false;
         } else {
             System.out.println("command not found.");
index 8585bb7..483e987 100644 (file)
@@ -15,21 +15,26 @@ import java.util.regex.Pattern;
  */
 public class DataBase {
     String TASK_TBL = "task_tbl";
  */
 public class DataBase {
     String TASK_TBL = "task_tbl";
+       String VM_TBL = "vm_tbl";
     Connection con;
     Statement st;
 
     Connection con;
     Statement st;
 
-    public DataBase() throws SQLException{
+    public DataBase(){
         try {
             Class.forName("org.sqlite.JDBC");
         try {
             Class.forName("org.sqlite.JDBC");
-            con = DriverManager.getConnection("jdbc:sqlite:puc.db");
-            st = con.createStatement();
-            st.setQueryTimeout(1);
-            con.setAutoCommit(false);
-            
+                       try {
+                               con = DriverManager.getConnection("jdbc:sqlite:puc.db");
+                   st = con.createStatement();
+                       st.setQueryTimeout(1);
+                           con.setAutoCommit(false);
+                       } catch (SQLException ex) {
+                               Logger.getLogger(DataBase.class.getName()).log(Level.SEVERE, null, ex);
+                       }          
         } catch (ClassNotFoundException ex) {
             Logger.getLogger(DataBase.class.getName()).log(Level.SEVERE, null, ex);
         }
     }
         } catch (ClassNotFoundException ex) {
             Logger.getLogger(DataBase.class.getName()).log(Level.SEVERE, null, ex);
         }
     }
+
     
     // データベースを初期化
     public void initDB() throws SQLException{
     
     // データベースを初期化
     public void initDB() throws SQLException{
@@ -42,29 +47,40 @@ public class DataBase {
                 "SDATE datatime," +
                 "EDATE datatime," +
                 "OUTLINE string)");
                 "SDATE datatime," +
                 "EDATE datatime," +
                 "OUTLINE string)");
-
-    
     }
     }
+
     public void commit() throws SQLException{
         con.commit();
     }
 
     public void commit() throws SQLException{
         con.commit();
     }
 
-    public ResultSet executeQuery(String sql) throws SQLException{
-        ResultSet rs = st.executeQuery(sql);
+    public ResultSet executeQuery(String sql){
+      ResultSet rs;
+      try {
+        rs = st.executeQuery(sql);
         return rs;
         return rs;
+      } catch (SQLException ex) {
+        Logger.getLogger(DataBase.class.getName()).log(Level.SEVERE, null, ex);
+      }
+      return null;
     }
             
 
     }
             
 
-    public int executeUpdate(String sql) throws SQLException{
-        Connection con = DriverManager.getConnection("jdbc:sqlite:puc.db");
-        Statement st = con.createStatement();
+    public int executeUpdate(String sql){
+      try {
         return st.executeUpdate(sql);
         return st.executeUpdate(sql);
+      } catch (SQLException ex) {
+        Logger.getLogger(DataBase.class.getName()).log(Level.SEVERE, null, ex);
+      }
+      return -1;
     }
 
     }
 
-    public void close() throws SQLException{
-        Connection con = DriverManager.getConnection("jdbc:sqlite:puc.db");
-        Statement st = con.createStatement();
+    public void close(){
+      try {
+        con.close();
         st.close();
         st.close();
+      } catch (SQLException ex) {
+        Logger.getLogger(DataBase.class.getName()).log(Level.SEVERE, null, ex);
+      }  
     }
 
     public boolean isDate(String date){
     }
 
     public boolean isDate(String date){
index a9aba30..4924036 100644 (file)
@@ -13,7 +13,8 @@ public class Main {
      * @param args the command line arguments
      */
     public static void main(String[] args) throws IOException, ClassNotFoundException, SQLException {
      * @param args the command line arguments
      */
     public static void main(String[] args) throws IOException, ClassNotFoundException, SQLException {
-        new TextView();
+      //new TaskCenterPanel();
+      new TextView();
         //new DataBase();
     }
 
         //new DataBase();
     }