Package cn.edu. ynu. Sei. ATM. Client. UI;
Import java. RMI. RemoteException;
Import org. Eclipse. SWT. SWT;
Import org. Eclipse. SWT. Widgets. Button;
Import org. Eclipse. SWT. Widgets. composite;
Import org. Eclipse. SWT. Widgets. label;
Import org. Eclipse. SWT. Widgets. MessageBox;
Import org. Eclipse. SWT. Widgets. text;
/**
* Balance query window
* @ Author 88250
*/
Public class balancequerycomposite extends Composite
{
/**
* Return button
*/
Private button returnbtn = NULL;
/**
* Indicates the number of acceptable tags.
*/
Private Label promptavailableamountlbl = NULL;
/**
* Display the number of optional fields
*/
Private text availableamounttext = NULL;
/**
* Balance display domain
*/
Private text balancetext = NULL;
/**
* Balance label prompt
*/
Private Label promptbalancelbl = NULL;
/**
* The Account type label is displayed.
*/
Private Label promptaccounttypelbl = NULL;
/**
* Account type display domain
*/
Private text accounttypetext = NULL;
/**
* Account ID Display domain
*/
Private text accountidtext = NULL;
/**
* The account ID label is displayed.
*/
Private Label promptaccountidlbl = NULL;
/**
* Create a balance query window container
* @ Param parent window container
*/
Public balancequerycomposite (composite parent)
{
Super (parent, SWT. None );
Createcontents ();
}
/**
* Display account information
*/
Public void displayaccountinfo ()
{
Try
{
Accountidtext. settext (integer
. Tostring (accountselectcomposite. Account. GETID ()));
Accounttypetext. settext (accountselectcomposite. Account
. Getaccounttype ());
Balancetext. settext (float. tostring (accountselectcomposite. Account
. Getbalance ()));
Availableamounttext. settext (float
. Tostring (accountselectcomposite. Account. getremain ()));
}
Catch (RemoteException re)
{
MessageBox exitdlg = new MessageBox (this. getshell ());
Exitdlg. settext ("network connection problems ....");
Exitdlg. setmessage ("cannot connect to the server, and the system will quit! ");
Exitdlg. open ();
System. Exit (0 );
Re. printstacktrace ();
}
Catch (exception E)
{
E. printstacktrace ();
}
}
/**
* Create a balance query window container containing controls
*/
Private void createcontents ()
{
Promptaccountidlbl = new label (this, SWT. None );
Promptaccountidlbl. settext ("account ID :");
Promptaccountidlbl. setbounds (26, 20, 55, 20 );
Accountidtext = new text (this, SWT. Border );
Accountidtext. seteditable (false );
Accountidtext. setbounds (82, 14, 80, 25 );
Accounttypetext = new text (this, SWT. Border );
Accounttypetext. seteditable (false );
Accounttypetext. setbounds (82, 46, 80, 25 );
Promptaccounttypelbl = new label (this, SWT. None );
Promptaccounttypelbl. settext ("Account type :");
Promptaccounttypelbl. setbounds (14, 51, 65, 20 );
Promptbalancelbl = new label (this, SWT. None );
Promptbalancelbl. settext ("Current Balance :");
Promptbalancelbl. setbounds (15, 86, 65, 20 );
Balancetext = new text (this, SWT. Border );
Balancetext. seteditable (false );
Balancetext. setbounds (83, 82, 80, 25 );
Availableamounttext = new text (this, SWT. Border );
Availableamounttext. seteditable (false );
Availableamounttext. setbounds (83,118, 80, 25 );
Promptavailableamountlbl = new label (this, SWT. None );
Promptavailableamountlbl. settext ("value :");
Promptavailableamountlbl. setbounds (17,122, 65, 20 );
Returnbtn = new button (this, SWT. Border );
Returnbtn. settext ("return ");
Returnbtn. setbounds (124,154, 40, 30 );
}
/**
* Get the return button
* @ Return: Return button
*/
Public button getreturnlbl ()
{
Return returnbtn;
}
@ Override
Public void dispose ()
{
Super. Dispose ();
}
@ Override
Protected void checksubclass ()
{
// Disable the check that prevents subclassing of SWT Components
}
}