import java.awt.*;
import java.awt.event.*;
+import businessLogic.HouseManager;
import businessLogic.OfferManager;
import com.toedter.calendar.JCalendar;
private final JLabel lblNewLabel = new JLabel("");
private final JRadioButton ruralHouseName = new JRadioButton(
"Use RuralHouse name");
+ private final JRadioButton district = new JRadioButton("Use district name");
private final ButtonGroup buttonGroup = new ButtonGroup();
private final JMenuBar menuBar = new JMenuBar();
private final JMenu mnMoreOptions = new JMenu("Search Options");
private final JTextField nBaths = new JTextField();
private final JLabel lblParkings = new JLabel("Parking slots:");
private final JTextField nParkings = new JTextField();
+ private HouseManager houseMan = new HouseManager();
- public QueryAvailabilityGUI2(Vector<RuralHouse> v) {
+ public QueryAvailabilityGUI2() {
nParkings.setText("");
nParkings.setColumns(10);
nBaths.setColumns(10);
try {
- jbInit(v);
+ jbInit();
} catch (Exception e) {
e.printStackTrace();
}
}
- private void jbInit(Vector<RuralHouse> v) throws Exception {
+ private void jbInit() throws Exception {
this.getContentPane().setLayout(null);
this.setSize(new Dimension(550, 500));
this.setTitle("Set availability");
- jComboBox1 = new JComboBox(v);
+ //TODO here we should add the districts of villatripas this is just for testing purposes
+ jComboBox1 = new JComboBox(this.houseMan.getAllRuralHouses());
jComboBox1.setBounds(new Rectangle(115, 30, 115, 20));
jLabel2.setText("First day :");
jLabel2.setBounds(new Rectangle(20, 134, 85, 25));
getContentPane().add(lblNewLabel);
- JRadioButton district = new JRadioButton("Use district name");
- district.setSelected(true);
- buttonGroup.add(district);
+ district.setSelected(true);;
district.setBounds(20, 69, 128, 20);
getContentPane().add(district);
buttonGroup.add(ruralHouseName);
+ buttonGroup.add(district);
ruralHouseName.setBounds(276, 60, 177, 38);
district.addItemListener(new ItemListener() {
@Override
}
private void jButton1_actionPerformed(ActionEvent e) {
-
+ if(this.district.isSelected()){
+ //show list of houses GUI
+ }
+ else if(this.ruralHouseName.isSelected()){
+ //show features of specific house
+ }
}
private void jButton2_actionPerformed(ActionEvent e) {