FileDocCategorySizeDatePackage
CheckinDialog.javaAPI DocExample3895Thu Oct 13 14:58:00 BST 2005com.samscdrental.display

CheckinDialog

public class CheckinDialog extends JDialog

Title: Sams CD Rental Store

Description:

Copyright: Copyright (c) 2004

Company:

author
Ken Pugh
version
1.0

Fields Summary
private static final long
serialVersionUID
JLabel
jLabel1
JLabel
jLabel2
PhysicalIDTextField
theCDDiscPhysicalIDField
JToggleButton
doneButton
JToggleButton
cancelButton
RentalOperations
theRentalOperations
Constructors Summary
public CheckinDialog()

	   
	
		try
		{
			jbInit();
		}
		catch ( Exception e )
		{
			e.printStackTrace();
		}
	
Methods Summary
voidCancelButton_actionPerformed(java.awt.event.ActionEvent e)

		setVisible( false );
	
voidDoneButton_actionPerformed(java.awt.event.ActionEvent e)

		try
		{
			PhysicalID aPhysicalID = theCDDiscPhysicalIDField.getPhysicalID();
			theRentalOperations.checkinCDDisc( aPhysicalID );
		}
		catch ( PhysicalIDFormatDeviation exception )
		{
			DisplayHelper.displayError( this, exception.getMessage() );
			return;

		}
		catch ( CheckInDeviation exception )
		{

			DisplayHelper.displayError( this, exception.getMessage() );
			return;
		}
		catch ( LateReturnDeviation exception )
		{

			OverdueRentalReportPlainTextFormat
				aOverdueRentalReportPlainTextFormat =
				Reports.createOverdueRentalReport( exception.
				getOverdueRentalDTO() );
			DisplayHelper.displayError( this,
										aOverdueRentalReportPlainTextFormat.
										getReportString() );

		}
		setVisible( false );

	
private voidjbInit()

		jLabel1.setFont( new java.awt.Font( "Dialog", 1, 15 ) );
		jLabel1.setText( "Checkin" );
		jLabel1.setBounds( new Rectangle( 167, 40, 70, 32 ) );
		this.getContentPane().setLayout( null );
		jLabel2.setText( "CD Disc ID" );
		jLabel2.setBounds( new Rectangle( 107, 113, 72, 16 ) );
		theCDDiscPhysicalIDField.setText( "" );
		theCDDiscPhysicalIDField.setBounds( new Rectangle( 205, 111, 96, 20 ) );
		doneButton.setText( "Done" );
		doneButton.setBounds( new Rectangle( 125, 186, 80, 23 ) );
		doneButton.addActionListener( new
									  CheckinDialog_DoneButton_actionAdapter( this ) );
		cancelButton.setText( "Cancel" );
		cancelButton.setBounds( new Rectangle( 215, 186, 80, 23 ) );
		cancelButton.addActionListener( new
										CheckinDialog_CancelButton_actionAdapter( this ) );
		this.getContentPane().setBackground( SystemColor.control );
		this.setJMenuBar( null );
		this.setModal( true );
		this.setTitle( "CheckIn " );
		this.getContentPane().add( jLabel1, null );
		this.getContentPane().add( doneButton, null );
		this.getContentPane().add( theCDDiscPhysicalIDField, null );
		this.getContentPane().add( jLabel2, null );
		this.getContentPane().add( cancelButton, null );