Signed-off-by: sky-weihao <110458260@qq.com>
Merge branch 'master' of https://github.com/cuter44/JUkagaka.git into sky-weihao
@@ -1,5 +1,17 @@
+package jukagaka.ghost.cyaughost;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import jukagaka.Ghost.*;
+
+import jukagaka.shell.JUkaShell;
+import jukagaka.shell.UkagakaWin;
+import jukagaka.shell.cyaushell.CyauShell;
+
 class  CyauGhost extends JUkaGhost
 {
 	    /**
      * <p>主要 Shell</p>
      * <p>主要 Shell 是指在主调模块未指定具体 Shell 情况下供给的缺省 Shell,
@@ -105,13 +117,22 @@ class  CyauGhost extends JUkaGhost

     /**
      * <p>此方法不包含任何代码, 仅仅作为 token 存在.</p>
      * <p>(*) 任何扩展此类的子类都必须以此方法签名重写该方法<br>
      * 子类的该方法会在所有 JUkaComponentCtrl 初始化完成后被调用, 以引导 Ghost 开始工作</p>
-     */
+     *现在CyauGhost中onStart代码用于测试，根据传说，手法非常暴力
+	 */
     public static void onStart()
     {
+		JUkaGhost.onstart();
+		CyauGhost temGhost = CyauGhost.createGhost();
+        CyauShell tmpshell = CyauShell.createShell();
+		temGhost.masterShell=tmpshell;
+        UkagakaWin tmpukawin = tmpshell.getUkagaka();
+        tmpukawin.setVisible(true);
+        tmpukawin.repaint();
+        tmpukawin.clip();
         return;
     }

   // Speak & Marco System | 宏解析
     //   ∧
@@ -123,38 +144,27 @@ class  CyauGhost extends JUkaGhost
      //* <p>内建宏解析器.(待续)
      //* </p>
      //* @return 最终解析的说话内容
      //*/
     //public String speak(String argSpeech, JUkaShell argShell)
-
+//null值为文件路径名
+    public static CyauGhost createGhost(
+		CyauGhost cyauGhost=new CyauGhost();
+	    //initalize方法为当Ghost保存文件存在后使用，
+		//这个方法为在程序实在运行时使用
+	    JUkaGhost.initalize(cyauGhost,null);
+        //这个null值也为文件名，不过这是在创建时候做出的文件名
+		//该方法作为测试时创建初始Ghost使用
+		JUkaGhost.createGhost(cyauGhost,null);
+
+		return cyauGhost;
+     }
   // Other | 杂项
-

 	//存储Ghost人格以及部分Shell

-	public void OPStorage(GhostOperatingSystem os)
-	{
-

-	}
-
-	public static void OSStorage(GhostOperatingSystem os) throws IOException
-	{
-            ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream("GhostOperatingSystemFile.txt"));
-
-
-	}
-
-
-
-    public static GhostOperatingSystem OSReading() throws IOException, ClassNotFoundException{
-            ObjectInputStream input = new ObjectInputStream(new FileInputStream("GhostOperatingSystemFile.txt"));
-
-            return ((GhostOperatingSystem)input.readObject());
-
-
-        }

 	public static void main(String[] args)
 	{

 	}
@@ -3,17 +3,18 @@
  * @version v120827
  */

 package jukagaka.ghost;

+import java.io.*;
 import jukagaka.*;
 import jukagaka.shell.*;
 import jukagaka.shell.cyaushell.CyauShell;

 import java.util.ArrayList;

-public class JUkaGhost extends JUkaComponent
+public class JUkaGhost extends JUkaComponent implements Serializable
 {
   // Shell Manipulate | Shell 操控
     /**
      * <p>主要 Shell</p>
      * <p>主要 Shell 是指在主调模块未指定具体 Shell 情况下供给的缺省 Shell,
@@ -138,37 +139,44 @@ public class JUkaGhost extends JUkaComponent
      //* </p>
      //* @return 最终解析的说话内容
      //*/
     //public String speak(String argSpeech, JUkaShell argShell)

-  // Other | 杂项
-
-	protected  void GhostOperatingSystem()
-	{
+    public static JUkaGhost createGhost(JUkaGhost os,String GhostFile){
+
+        os.mainGhost=new GhostOperatingSystem();
+        os.mainGhost.initalizeOS();
+
+		return os;
+
 	}

-	//存储Ghost人格以及部分Shell
+	public static JUkaGhost initalizeGhost(JUkaGhost os,String argFile) throws IOException, ClassNotFoundException{
+		os=OSReading();
+
+		return os;
+	}
+  // Other | 杂项
+

-	public void OPStorage(GhostOperatingSystem os)
-	{
+	//存储Ghost人格以及部分Shell,进行中


-	}

 	public static void OSStorage(GhostOperatingSystem os) throws IOException
 	{
             ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream("GhostOperatingSystemFile.txt"));


 	}



-    public GhostOperatingSystem OSReading() throws IOException, ClassNotFoundException{
+    public static JUkaGhost OSReading() throws IOException, ClassNotFoundException{
             ObjectInputStream input = new ObjectInputStream(new FileInputStream("GhostOperatingSystemFile.txt"));

-            return ((GhostOperatingSystem)input.readObject());
+            return ((JUkaGhost)input.readObject());


         }

 /**
@@ -71,11 +71,11 @@ public class CyauShell extends JUkaShell

         // 加载图像资源
         try
         {
             Class classOfSampleShell = Class.forName("jukagaka.shell.cyaushell.CyauShell");
-            JUkaShellCtrl.prefetchImageResource(classOfSampleShell, CyauShell.DEFAULT_INI, "images", true);
+            JUkaShell.prefetchImageResource(classOfSampleShell, CyauShell.DEFAULT_INI, "images", true);
         }
         catch (Exception ex)
         {
             System.err.println(ex);
             return;
@@ -109,11 +109,11 @@ public class CyauShell extends JUkaShell
         //// 用于测试 Shell 装/卸载 及 图像加载时间的代码.
         System.out.println(CyauShell.install());
         try
         {
             Class classOfSampleShell = Class.forName("jukagaka.shell.cyaushell.CyauShell");
-            JUkaShellCtrl.prefetchImageResource(classOfSampleShell, CyauShell.DEFAULT_INI, "images", true);
+            JUkaShell.prefetchImageResource(classOfSampleShell, CyauShell.DEFAULT_INI, "images", true);
         }
         catch (Exception ex)
         {
             System.err.println(ex);
             return;

我看到了。。。好多坑。。。。
Signed-off-by: sky-weihao <110458260@qq.com>
@@ -25,20 +25,26 @@ class  CyauGhost extends JUkaGhost
      * <p>它通常指向 assignedShell[1].<br>
      * 虽然在此平台上没有定义, 但 slaveShell 一般对应于传统的"使魔"</p>
      */
     protected JUkaShell slaveShell;

-
+
     protected GhostOperatingSystem mainGhost;
     /**
      * <p>链接的 Shell 的记录表</p>
      * <p>注意并非必需填充这个数据域(比如只有一个 Shell 时), 这种情况下应该重写
      * getAssignedShell() 以正确地返回需求的 Shell 对象.</p>
      */
     protected ArrayList<JUkaShell> assignedShell = null;

     /**
+	 *作为记录单个Ghost的文件名
+	 *文件名用创建和打开指定Ghost
+	 */
+	String ghostargFile = JUkaUtility.getProgramDir()+"ghost/JUkaGhost1.txt";
+
+    /**
      * <p>根据指定的序号获取该 Ghost 控制的 Shell </p>
      */
     public JUkaShell getAssignedShell(int argShellID)
     {
         if (argShellID >= this.assignedShell.size())
@@ -110,10 +116,12 @@ class  CyauGhost extends JUkaGhost
      * <p>(*) 任何扩展此类的子类都必须以此方法签名重写该方法<br>
      * 子类的该方法会在 JUkagaka 启动时被调用, 以提供机会让 Ghost 完成初始化工作</p>
      */
     public static void onLoad()
     {
+		JUkaGhost.onload();
+
         return;
     }

     /**
      * <p>此方法不包含任何代码, 仅仅作为 token 存在.</p>
@@ -149,11 +157,11 @@ class  CyauGhost extends JUkaGhost
 //null值为文件路径名
     public static CyauGhost createGhost(
 		CyauGhost cyauGhost=new CyauGhost();
 	    //initalize方法为当Ghost保存文件存在后使用，
 		//这个方法为在程序实在运行时使用
-	    JUkaGhost.initalize(cyauGhost,null);
+	    JUkaGhost.initalize(cyauGhost,ghostargFile);
         //这个null值也为文件名，不过这是在创建时候做出的文件名
 		//该方法作为测试时创建初始Ghost使用
 		JUkaGhost.createGhost(cyauGhost,null);

 		return cyauGhost;
 -160,25 +160,22 @@ public class JUkaGhost extends JUkaComponent implements Serializable

 	//存储Ghost人格以及部分Shell,进行中



-	public static void OSStorage(GhostOperatingSystem os) throws IOException
+	public static void OSStorage(GhostOperatingSystem os,String ghostargFile) throws IOException
 	{
-            ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream("GhostOperatingSystemFile.txt"));
-
-
+            ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(ghostargFile));
+			output.close();
 	}



-    public static JUkaGhost OSReading() throws IOException, ClassNotFoundException{
-            ObjectInputStream input = new ObjectInputStream(new FileInputStream("GhostOperatingSystemFile.txt"));
-
-            return ((JUkaGhost)input.readObject());
-
-
+    public static JUkaGhost OSReading(String ghostargFile) throws IOException, ClassNotFoundException{
+            ObjectInputStream input = new ObjectInputStream(new FileInputStream(ghostargFile));
+			input.close();
+            return ((JUkaGhost)input.readObject());
         }

 /**
      * @deprecated 此方法目前仅用于调试
      */

Signed-off-by: sky-weihao <110458260@qq.com>
Merge branch 'galin' of https://github.com/cuter44/JUkagaka.git into sky-weihao

Conflicts:
	sample-cyau-shell/CyauShell.java