VWSampleStepApplication
このサンプル Java™ ステップ・プロセッサー・クラスは、資料ライブラリーの『Developer samples』セクションに用意されているサンプルの一部です。
詳細については、「プロセス開発環境の構成」を参照してください。
VWSampleStepApplication のソース・コードは以下のとおりです。
package samples.vwpanel.samplestep;
import javax.swing.*;
import java.awt.*;
import filenet.vw.base.*;
import filenet.vw.toolkit.runtime.step.IVWStepProcessor;
import filenet.vw.toolkit.utils.*;
import samples.vwpanel.samplestep.images.VWImageLoader;
import samples.vwpanel.samplestep.resources.VWResource;
/**
* This is the sample Step Processor application class.
*
* @version 1, 0
* @since IWWS1.00
*/
public class VWSampleStepApplication extends VWBaseLaunchableApplication implements IVWStepProcessor
{
// declare constants
private static final int APP_WIDTH = 770;
private static final int APP_HEIGHT = 535;
// declare variables
private VWSampleStepPanel m_sampleStepPanel = 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);
// アプリケーションを作成
VWSampleStepApplication pApp = new VWSampleStepApplication();
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("step.gif");
if (icon != null && icon.getImage() != null)
setIconImage(icon.getImage());
updatePosition(APP_WIDTH, APP_HEIGHT);
// 表示可能であることを確認
show();
// メインパネルを作成
m_sampleStepPanel = new VWSampleStepPanel();
// コントロールを追加
getContentPane().setLayout(new BorderLayout(4,4));
getContentPane().add(m_sampleStepPanel, BorderLayout.CENTER);
// finish the initialization
m_sampleStepPanel.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_sampleStepPanel != null)
m_sampleStepPanel.destroy();
return super.destroy();
}
catch (Exception ex)
{
VWDebug.logException(ex);
}
return false;
}
//--------------------------------------
// private methods
//--------------------------------------
}