Methods Summary |
---|
public void | actionPerformed(java.awt.event.ActionEvent event)
String strCmd;
strCmd = event.getActionCommand ();
if ( strCmd.equals(ACTION_FINISH) || strCmd.equals(ACTION_CANCEL) ) {
if ( strCmd.equals(ACTION_FINISH) ) {
if ( onPageDone(panelCurPage) == false )
return;
if ( onFinish() == false ) {
setPage ( getFirstPage() );
return;
}
}
strResultAction = strCmd;
this.dispose ();
}
else if ( strCmd.equals(ACTION_BACK) ) {
setPrevPage ();
}
else if ( strCmd.equals(ACTION_NEXT) ) {
setNextPage ();
}
|
private java.awt.Panel | createPanelButtons()
Panel panel;
Panel panelButtons;
panelButtons = new Panel ( new FlowLayout(FlowLayout.RIGHT) );
panel = new Panel ( new GridLayout(1,0,6,6) );
panelButtons.add ( panel );
buttonBack = new Button ( ACTION_BACK );
buttonBack.addActionListener ( this );
panel.add ( buttonBack );
buttonNext = new Button ( ACTION_NEXT );
buttonNext.addActionListener ( this );
panel.add ( buttonNext );
buttonFinish = new Button ( ACTION_FINISH );
buttonFinish.addActionListener ( this );
panel.add ( buttonFinish );
buttonCancel = new Button ( ACTION_CANCEL );
buttonCancel.addActionListener ( this );
panel.add ( buttonCancel );
return ( panelButtons );
|
public java.lang.String | getAction()
return ( strResultAction );
|
public java.awt.Panel | getCurrentPage()
return ( panelCurPage );
|
protected java.awt.Panel | getFirstPage()
Panel panelPage = null;
if ( vectorPages != null && !vectorPages.isEmpty() ) {
panelPage = (Panel) vectorPages.firstElement ();
}
return ( panelPage );
|
protected java.awt.Panel | getLastPage()
Panel panelPage = null;
if ( vectorPages != null && !vectorPages.isEmpty() ) {
panelPage = (Panel) vectorPages.lastElement ();
}
return ( panelPage );
|
protected java.awt.Panel | getNextPage(java.awt.Panel panelPage)
int nIndex;
Panel panelPageNext = null;
if ( panelPage == null ) {
panelPageNext = getFirstPage ();
}
else if ( vectorPages != null && !vectorPages.isEmpty() ) {
nIndex = vectorPages.indexOf ( panelPage );
if ( nIndex >= 0 && nIndex < vectorPages.size() - 1 )
panelPageNext = (Panel) vectorPages.elementAt ( nIndex + 1 );
}
return ( panelPageNext );
|
protected java.awt.Panel | getPrevPage(java.awt.Panel panelPage)
int nIndex;
Panel panelPagePrev = null;
if ( panelPage == null ) {
panelPagePrev = getLastPage ();
}
else if ( vectorPages != null && !vectorPages.isEmpty() ) {
nIndex = vectorPages.indexOf ( panelPage );
if ( nIndex > 0 && nIndex < vectorPages.size() )
panelPagePrev = (Panel) vectorPages.elementAt ( nIndex - 1 );
}
return ( panelPagePrev );
|
protected void | init()
Panel panel;
Panel panelContent;
ImageArea imageArea;
Image image;
this.setBackground ( Color.lightGray );
this.setLayout ( new BorderLayout(6,6) );
this.setResizable ( false );
// this.addWindowListener ( this );
panelContent = new Panel ( new BorderLayout(6,6) );
panelContent.setBackground ( Color.lightGray );
this.add ( panelContent, BorderLayout.CENTER );
if ( strImage != null ) {
panel = new Panel ( new BorderLayout() );
panelContent.add ( panel, BorderLayout.WEST );
image = ImageArea.loadImage ( strImage, this, true );
imageArea = new ImageArea ( image );
imageArea.setInsets ( 12, 12, 12, 12 );
panel.add ( imageArea, BorderLayout.NORTH );
}
layoutCard = new CardLayout ( 6, 6 );
panelPages = new JMPanel ( layoutCard );
panelPages.setEmptyBorder ( 6, 6, 6, 6 );
panelContent.add ( panelPages, BorderLayout.CENTER );
panel = createPanelButtons ();
panelContent.add ( panel, BorderLayout.SOUTH );
|
protected boolean | isFirstPage(java.awt.Panel panelPage)
boolean boolResult;
boolResult = (panelPage == getFirstPage());
return ( boolResult );
|
protected boolean | isLastPage(java.awt.Panel panelPage)
boolean boolResult;
boolResult = (panelPage == getLastPage());
return ( boolResult );
|
protected boolean | onFinish()
return ( true );
|
protected boolean | onPageActivate(java.awt.Panel panelPage)
return ( true );
|
protected boolean | onPageDone(java.awt.Panel panelPage)
return ( true );
|
protected void | setNextPage()
Panel panelPage;
if ( panelCurPage != null && onPageDone(panelCurPage) == false )
return;
panelPage = getNextPage ( panelCurPage );
setPage ( panelPage );
|
private void | setPage(java.awt.Panel panelPage)
if ( panelPage == null )
return;
panelCurPage = panelPage;
onPageActivate ( panelCurPage );
panelPages.add ( panelCurPage, panelCurPage.getName() );
layoutCard.show ( panelPages, panelCurPage.getName() );
if ( isFirstPage(panelCurPage) ) {
buttonBack.setEnabled ( false );
if ( getFocusOwner() == buttonBack )
buttonNext.requestFocus ();
}
else {
buttonBack.setEnabled ( true );
}
if ( isLastPage(panelCurPage) ) {
buttonNext.setEnabled ( false );
buttonFinish.setEnabled ( true );
if ( getFocusOwner() == buttonNext )
buttonFinish.requestFocus ();
}
else {
buttonNext.setEnabled ( true );
buttonFinish.setEnabled ( false );
}
this.validate ();
panelCurPage.validate ();
|
public void | setPages(java.awt.Panel[] arrPages)
int i;
int nCount;
if ( arrPages != null ) {
panelCurPage = null;
nCount = arrPages.length;
vectorPages = new Vector ();
for ( i = 0; i < nCount; i++ )
vectorPages.addElement ( arrPages[i] );
}
setNextPage ();
|
protected void | setPrevPage()
Panel panelPage;
panelPage = getPrevPage ( panelCurPage );
setPage ( panelPage );
|
public void | windowActivated(java.awt.event.WindowEvent event)
|
public void | windowClosed(java.awt.event.WindowEvent event)
|
public void | windowClosing(java.awt.event.WindowEvent event)
this.dispose ();
|
public void | windowDeactivated(java.awt.event.WindowEvent event)
|
public void | windowDeiconified(java.awt.event.WindowEvent event)
|
public void | windowIconified(java.awt.event.WindowEvent event)
|
public void | windowOpened(java.awt.event.WindowEvent event)
|