VWSampleLaunchApplication
このサンプル Java™ Launch ステップ・プロセッサー・クラスは、IBM® FileNet® P8 Platform資料ライブラリーの『Developer samples』セクションに用意されているサンプルの一部です。
詳細については、「プロセス開発環境の構成」を参照してください。
VWSampleLaunchApplication のソース・コードは以下のとおりです。
package samples.vwpanel.samplelaunch;
import javax.swing.*;
import java.awt.*;
import filenet.vw.base.*;
import filenet.vw.toolkit.utils.*;
import samples.vwpanel.samplelaunch.images.VWImageLoader;
import samples.vwpanel.samplelaunch.resources.VWResource;
/**
* This is the sample Launch Step Processor application class.
*
* @version 1, 0
* @since IWWS1.00
*/
public class VWSampleLaunchApplication extends VWBaseLaunchableApplication
{
// declare constants
private static final int APP_WIDTH = 770;
private static final int APP_HEIGHT = 475;
// declare variables
private VWSampleLaunchPanel m_sampleLaunchPanel = null;
/**
* The main method of the application.
*
* @param argv The command line argument to this application.
* @since IWWS1.00
*/
public static void main(String argv[])
{
try
{
// initialize our logger
VWDebug.init(VWLogger.ERROR);
// コマンド行パラメーターを取得
VWCommandLineArgs args = new VWCommandLineArgs(argv);
// セッション情報オブジェクトを作成
VWSessionInfo sessionInfo = new VWSessionInfo(null, null, args);
if (!sessionInfo.verifyLogon(null))
System.exit(1);
// アプリケーションを作成
VWSampleLaunchApplication pApp = new VWSampleLaunchApplication();
pApp.init(sessionInfo);
// Init Online Help
VWHelp.init(pApp);
}
catch (Exception ex)
{
VWDebug.logException(ex);
}
}
//--------------------------------------
// IVWLaunchableApp methods
//--------------------------------------
/**
* Initialize the Workflow application.
*
* @param sessionInfo the session information
* @since IWWS1.00
*/
public void init(VWSessionInfo sessionInfo)
{
try
{
super.init(sessionInfo);
// アプリケーションのタイトルを設定
setTitle(VWResource.s_appTitle);
// フレームのアイコンを設定
ImageIcon icon = VWImageLoader.createImageIcon("launcher.gif");
if (icon != null && icon.getImage() != null)
setIconImage(icon.getImage());
updatePosition(APP_WIDTH, APP_HEIGHT);
// 表示可能であることを確認
show();
// メインパネルを作成
m_sampleLaunchPanel = new VWSampleLaunchPanel();
// コントロールを追加
getContentPane().setLayout(new BorderLayout(4,4));
getContentPane().add(m_sampleLaunchPanel, BorderLayout.CENTER);
// finish the initialization
m_sampleLaunchPanel.init(m_sessionInfo);
}
catch (Exception ex)
{
VWDebug.logException(ex);
}
}
//--------------------------------------
// protected methods
//--------------------------------------
/**
* Performs clean up.
*
* @return false if the application should not be destroyed
* @since IWWS1.00
*/
protected boolean destroy()
{
try
{
if (m_sampleLaunchPanel != null)
m_sampleLaunchPanel.destroy();
return super.destroy();
}
catch (Exception ex)
{
VWDebug.logException(ex);
}
return false;
}
//--------------------------------------
// private methods
//--------------------------------------
}