⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 somaconsole.java

📁 一个agent 工具包,可以开发移动设备应用,考虑了安全措施
💻 JAVA
字号:
package SOMA.applet;

import SOMA.output.*;
import SOMA.explorer.*;
import java.awt.*;

public class SOMAConsole extends OutputFrame
{
	DirExplorerItem root;
	ExplorerThread explorer;
	//String loadScriptDirectory = "";

	public SOMAConsole( String title )
	{
	  super( title );

	  // Carico uno script
    MenuItem loadScript = new MenuItem( "Load script file...", new MenuShortcut( java.awt.event.KeyEvent.VK_L ) );

    /*
    loadScript.addActionListener(
        new ActionListener()
          {
            public void actionPerformed(ActionEvent e)
            {
              FileDialog fileDialog = new FileDialog(
                  SOMAConsole.this,
                  "Load script",
                  FileDialog.LOAD );

              fileDialog.setDirectory( loadScriptDirectory );
              fileDialog.show();

              String file = fileDialog.getFile();

              if( file != null )
              {
                try
                {
                  new ExplorerThread(
                    root,
                    new FileInputStream( file ),
                    out,
                    true ).start();
                }
                catch( Exception f )
                {
                  f.printStackTrace( out );
                }

                loadScriptDirectory = fileDialog.getDirectory();
              }
            }
          });*/

    menu1.insert( loadScript, 0 );
    menu1.insertSeparator( 1 );

	  OnExitCommand = new OutputFrame.Listener()
	    {
	      public void run()
	      {
	        //root.Execute( "exit" );
	        //root.Execute( "util threads" );

	        //explorer.Stop();
	        /*
	        try
	        {
	          explorer.join();
	        }
	        catch( Exception e )
	        {
	          e.printStackTrace();
	        }*/

	        setVisible( false );
	        dispose();
	      }
	    };

	  setVisible( true );

	  try
		{
		  System.setErr( out );
		  System.setOut( out );
		  System.setIn( in );
		}
		catch( Exception e )
		{
		  out.println( "------------------------------------------------------------"  );
		  out.println( "- Error reassigning standard streams: " + e );
		  out.println( "------------------------------------------------------------"  );
		  e.printStackTrace( out );
		  out.println( "------------------------------------------------------------"  );
		}

	  root = SOMA.Main.buildMenu();
	  explorer = new ExplorerThread( root, in, out, true );
    explorer.addExit();

    // Lo posso fare solo ora che ho root
    loadScript.addActionListener( new LoadScriptActionListener( this, "Load script", root, out ) );

    explorer.start();
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -