/*
* SelectPanel.java
*
* Created on 3 novembre 2004, 13:42
*/
package reservation.system.panels;
import reservation.system.functions.Functions;
import reservation.system.Profile;
import reservation.system.Flight;
import reservation.system.Person;
import reservation.system.Pos;
import reservation.CustomDialog;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.table.*;
import java.awt.event.*;
import java.util.Vector;
import java.awt.Dimension;
import java.util.StringTokenizer;
/**
* This class hold Flight structure. This object allows to see the flight present in the database.
* It use a GUI that contains a form with the several field to fill.
* @author Texier Mathieu and Frederic Bidon
*/
public class FlightsPanel extends Panels {
/** Creates new form FlightsPanel */
public FlightsPanel () {
flightTable.setRowSelectionAllowed (false);
jScrollPane.setViewportView (flightTable);
add (jScrollPane);
}
/**
* Causes this container to lay out its components.
*/
public void doLayout () {
jScrollPane.setBounds (20, 20, 500, 120);
flightTable.setBounds (20, 20, 500, 120);
}
/**
* Set the size of the panel
* @return an instance of Dimension that represents the minimum size of this container.
*/
}
/**
* Set the size of the panel
* @return an instance of Dimension that represents the preferred size of this container.
*/
}
/**
* Initialize the number of the field and fill them with default values.
* Dispaly the label of the Window.
*/
public void init () {
try {
String[] listFlight
= fs.
getFlightList ();
int size = listFlight.length;
String title
[] = {"Name",
"Rows",
"Row length"};
for(int i = 0; i < size; i++) {
Flight flight = fs.selectFlight (listFlight[i]);
listData[i][0] = flight.getFlightName ();
listData
[i
][1] = Integer.
toString(flight.
getDimension ().
getRow ());
listData
[i
][2] = Integer.
toString(flight.
getDimension ().
getCol ());
}
} catch (Exception e
) {CustomDialog.
alert(e
);}
}
/**
* Proceed the execution of the action
* @return the result of the request.
* @param unUsed not used
* @throws Exception if the command is not executed.
*/
return "";
}
}