Package club.ui

Source Code of club.ui.ModifyEvent

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package club.ui;

import club.beans.ConfigBean;
import club.beans.EventBean;
import club.beans.EventStatusBean;
import club.beans.EventTypeBean;
import club.data.DataAttendance;
import club.data.DataConfig;
import club.data.DataEventType;
import club.data.DataEvent;
import club.ulti.Validator;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;

/**
*
* @author Quang
*/
public class ModifyEvent extends javax.swing.JDialog {
private Double val;
    /**
     * Creates new form EventEntry
     */
    public ModifyEvent(java.awt.Frame parent, boolean modal, int eventID) {
        super(parent, modal);
        currentEvent = dataEvent.getEventByID(eventID);
        currentID = eventID;
        initComponents();
        initContent();
        this.setLocationRelativeTo(null);
        val=Double.parseDouble(tfFee.getText());
    }
   
    /*
     * manual initial content
     */
   
    private void initContent(){
        initEventType();
        initStatus();
        initInfo();
        initDate();
    }
    private void initDate(){
        try {
            int year = new java.util.Date().getYear() + 1903;
            calDate.setSelectableDateRange(new java.util.Date(),new SimpleDateFormat("mm-dd-YYYY").parse("12-31-" + year));

        } catch (ParseException ex) {
            Logger.getLogger(EventEntry.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
   
    private void initEventType(){
        eventTypeList = dataType.getAllEventTypes("");
        cbbEventType.removeAllItems();
        for (EventTypeBean bean : eventTypeList){
            cbbEventType.addItem(bean);
        }
    }
   
    private void initStatus(){
        cbbStatus.removeAllItems();
        for (int i=0; i< 3; i++){
            cbbStatus.addItem(new EventStatusBean(i));
        }
        cbbStatus.addItem(new EventStatusBean(-1));
    }
   
  
   
    private void initInfo(){
        tfName.setText(currentEvent.getEventName());
        taDescription.setText(currentEvent.getDescription());
        calDate.setDate(currentEvent.getDate());
        tfTime.setText(String.valueOf(currentEvent.getDuration()) );
        tfVenue.setText(currentEvent.getVenue());
        tfFee.setText(String.valueOf(currentEvent.getFee()));
        EventTypeBean bean = dataType.getEventTypeByID(currentEvent.getEventType());
        cbbEventType.setSelectedItem(bean);
        cbbStatus.setSelectedItem(new EventStatusBean(currentEvent.getStatus()));
    }

    /*
     * Functions
     */
   
    private void saveEvent(int id){
        String des = taDescription.getText();
        java.util.Date date = calDate.getDate();
        float duration = Float.parseFloat(tfTime.getText());
        String venue = tfVenue.getText();
        int type = ((EventTypeBean)cbbEventType.getSelectedItem()).getEventType();
        double fee = Double.parseDouble(tfFee.getText());
        DataConfig dataConfig = new DataConfig();
        ConfigBean config = dataConfig.readConfigFile();
        int adminID = config.getAdminID();
       
        int status = ((EventStatusBean)cbbStatus.getSelectedItem()).getID();
        double cost = 1;
        String name = tfName.getText();
        if (status == -1 && dataEvent.isRemovable(currentID)==false){
            JOptionPane.showMessageDialog(rootPane, "You have to empty the attendancel list first","Error",JOptionPane.ERROR_MESSAGE);
        }
        else if (dataEvent.updateEventByID(id, des, date, duration, venue, type, fee, date, adminID, status, cost, name)){
            JOptionPane.showMessageDialog(this, "Successfully saved  event " + type);
            val=val-fee;
            if(val>0){
                DataAttendance att=new DataAttendance();
               
                att.discountEventFee(id, val, adminID);
            }
            this.dispose();
        } else{
            JOptionPane.showMessageDialog(this, "Error!");
        }
    }
   
    private void addEventType(){
        String name = tfNewEventType.getText();
        boolean flag = dataType.insertEventType(name);
        if (flag){
            JOptionPane.showMessageDialog(this, "Successfully added new event type");
            tfNewEventType.setText("");
            initEventType();
        } else{
            JOptionPane.showMessageDialog(this, "Error! Existed Type");
        }
    }
   
    private void filterEventType(){
        String query = tfEventFilter.getText().trim();
        eventTypeList = dataType.getAllEventTypes(query);
        cbbEventType.removeAllItems();
        for (EventTypeBean bean : eventTypeList){
            cbbEventType.addItem(bean);
        }
    }
   
    private ArrayList validateAllForm(){
        ArrayList errors = new ArrayList();
        if (!Validator.checkIsNotEmpty(tfName.getText())){
            errors.add("Name can not be empty");
        }
        try{
            if (!Validator.checkFutureDay(calDate.getDate())){
                errors.add("Invalid Starting time! That time has already passed away");
             }
        } catch (Exception e){
            errors.add("You have to choose start time");
        }
       
        if (!Validator.checkPositiveFloat(tfTime.getText())){
            errors.add("Duration can not be empty and must be a positive float value");
        }
        if (!Validator.checkIsNotEmpty(tfVenue.getText())){
            errors.add("Venue can not be empty");
        }
        if (!Validator.checkPositiveDouble(tfFee.getText())){
            errors.add("Fee can not be empty and must be a double value");
        }
        return errors;
    }
   
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jRadioButton1 = new javax.swing.JRadioButton();
        lbDescription = new javax.swing.JLabel();
        lbVenue = new javax.swing.JLabel();
        lbTime = new javax.swing.JLabel();
        tfVenue = new javax.swing.JTextField();
        tfTime = new javax.swing.JTextField();
        btnSaveEvent = new javax.swing.JButton();
        btnQuit = new javax.swing.JButton();
        spDescription = new javax.swing.JScrollPane();
        taDescription = new javax.swing.JTextArea();
        jLabel1 = new javax.swing.JLabel();
        lbFee = new javax.swing.JLabel();
        tfFee = new javax.swing.JTextField();
        calDate = new com.toedter.calendar.JDateChooser();
        lbStatus = new javax.swing.JLabel();
        cbbStatus = new javax.swing.JComboBox();
        jPanel1 = new javax.swing.JPanel();
        lbEventType = new javax.swing.JLabel();
        tfNewEventType = new javax.swing.JTextField();
        btnAddEventType = new javax.swing.JButton();
        btnCost = new javax.swing.JButton();
        tfEventFilter = new javax.swing.JTextField();
        lbEventFilter = new javax.swing.JLabel();
        cbbEventType = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        lbName = new javax.swing.JLabel();
        tfName = new javax.swing.JTextField();

        jRadioButton1.setText("jRadioButton1");

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Update event");
        setResizable(false);

        lbDescription.setText("Description");

        lbVenue.setText("Venue");

        lbTime.setText("Duration");

        tfVenue.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                tfVenueFocusGained(evt);
            }
        });
        tfVenue.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                tfVenueKeyReleased(evt);
            }
        });

        tfTime.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                tfTimeFocusGained(evt);
            }
        });
        tfTime.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                tfTimeKeyReleased(evt);
            }
        });

        btnSaveEvent.setIcon(new javax.swing.ImageIcon(getClass().getResource("/club/icon/edit.png"))); // NOI18N
        btnSaveEvent.setText("Update");
        btnSaveEvent.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSaveEventActionPerformed(evt);
            }
        });

        btnQuit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/club/icon/cancel.png"))); // NOI18N
        btnQuit.setText("Cancel");
        btnQuit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnQuitActionPerformed(evt);
            }
        });

        taDescription.setColumns(20);
        taDescription.setRows(5);
        taDescription.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                taDescriptionFocusGained(evt);
            }
        });
        taDescription.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                taDescriptionKeyReleased(evt);
            }
        });
        spDescription.setViewportView(taDescription);

        jLabel1.setText("Date");

        lbFee.setText("Fee");

        tfFee.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                tfFeeFocusGained(evt);
            }
        });
        tfFee.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                tfFeeKeyReleased(evt);
            }
        });

        lbStatus.setText("Status");

        cbbStatus.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Type of Event"));

        lbEventType.setText("Event Type");

        tfNewEventType.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                tfNewEventTypeFocusGained(evt);
            }
        });

        btnAddEventType.setText("Create new type");
        btnAddEventType.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddEventTypeActionPerformed(evt);
            }
        });

        btnCost.setText("Cost");
        btnCost.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCostActionPerformed(evt);
            }
        });

        tfEventFilter.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                tfEventFilterFocusGained(evt);
            }
        });
        tfEventFilter.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                tfEventFilterKeyReleased(evt);
            }
        });

        lbEventFilter.setText("Filter");

        cbbEventType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jLabel2.setText("You can quickly create new type of event with textbox below.");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(cbbEventType, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbEventFilter)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tfEventFilter))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(lbEventType)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(tfNewEventType, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnAddEventType)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnCost)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addComponent(lbEventType)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cbbEventType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbEventFilter)
                    .addComponent(tfEventFilter, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnCost)
                    .addComponent(tfNewEventType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnAddEventType))
                .addContainerGap())
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {btnAddEventType, btnCost, cbbEventType, tfEventFilter, tfNewEventType});

        lbName.setText("Name");

        tfName.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                tfNameFocusGained(evt);
            }
        });
        tfName.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                tfNameKeyReleased(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addGap(67, 67, 67)
                            .addComponent(btnSaveEvent, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(btnQuit, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(layout.createSequentialGroup()
                            .addContainerGap()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(lbTime)
                                        .addComponent(lbVenue)
                                        .addComponent(lbFee)
                                        .addComponent(lbStatus))
                                    .addGap(18, 18, 18)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(tfVenue, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(tfTime, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(cbbStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(tfFee, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(lbDescription)
                                        .addComponent(lbName)
                                        .addComponent(jLabel1))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(spDescription, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(tfName, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(calDate, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)))))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {tfFee, tfTime, tfVenue});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbName))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(spDescription, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbDescription))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(calDate, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbTime)
                    .addComponent(tfTime, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(9, 9, 9)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfVenue, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbVenue))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cbbStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbStatus))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfFee, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbFee))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(25, 25, 25)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnSaveEvent, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnQuit, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {calDate, tfFee, tfName, tfTime, tfVenue});

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnQuitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQuitActionPerformed
        // TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_btnQuitActionPerformed

    private void btnSaveEventActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveEventActionPerformed
        // TODO add your handling code here:
        if (validateAllForm().size() == 0){
                saveEvent(currentID);
        
        } else{
            Validator.showErrors(validateAllForm());
        }
    }//GEN-LAST:event_btnSaveEventActionPerformed

    private void btnAddEventTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddEventTypeActionPerformed
        addEventType();
       
    }//GEN-LAST:event_btnAddEventTypeActionPerformed

    private void taDescriptionKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_taDescriptionKeyReleased
        // TODO add your handling code here:
       
    }//GEN-LAST:event_taDescriptionKeyReleased

    private void tfTimeKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tfTimeKeyReleased
        // TODO add your handling code here:
        Validator.Validate(tfTime, Validator.checkFloat(tfTime.getText()));
    }//GEN-LAST:event_tfTimeKeyReleased

    private void tfVenueKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tfVenueKeyReleased
        // TODO add your handling code here:
        Validator.Validate(tfVenue, Validator.checkIsNotEmpty(tfVenue.getText()));
    }//GEN-LAST:event_tfVenueKeyReleased

    private void tfFeeKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tfFeeKeyReleased
        // TODO add your handling code here:
        Validator.Validate(tfFee, Validator.checkPositiveDouble(tfFee.getText()));
    }//GEN-LAST:event_tfFeeKeyReleased

    private void tfEventFilterKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tfEventFilterKeyReleased
        // TODO add your handling code here:
        filterEventType();
    }//GEN-LAST:event_tfEventFilterKeyReleased

    private void btnCostActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCostActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_btnCostActionPerformed

    private void tfNameKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tfNameKeyReleased
        // TODO add your handling code here:
        Validator.Validate(tfName, Validator.checkIsNotEmpty(tfName.getText()));
    }//GEN-LAST:event_tfNameKeyReleased

    private void tfNameFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_tfNameFocusGained
        // TODO add your handling code here:
        tfName.selectAll();
    }//GEN-LAST:event_tfNameFocusGained

    private void taDescriptionFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_taDescriptionFocusGained
        // TODO add your handling code here:
        taDescription.selectAll();
    }//GEN-LAST:event_taDescriptionFocusGained

    private void tfTimeFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_tfTimeFocusGained
        // TODO add your handling code here:
        tfTime.selectAll();
    }//GEN-LAST:event_tfTimeFocusGained

    private void tfVenueFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_tfVenueFocusGained
        // TODO add your handling code here:
        tfVenue.selectAll();
    }//GEN-LAST:event_tfVenueFocusGained

    private void tfFeeFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_tfFeeFocusGained
        // TODO add your handling code here:
        tfFee.selectAll();
    }//GEN-LAST:event_tfFeeFocusGained

    private void tfEventFilterFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_tfEventFilterFocusGained
        // TODO add your handling code here:
        tfEventFilter.selectAll();
    }//GEN-LAST:event_tfEventFilterFocusGained

    private void tfNewEventTypeFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_tfNewEventTypeFocusGained
        // TODO add your handling code here:
        tfNewEventType.selectAll();
    }//GEN-LAST:event_tfNewEventTypeFocusGained

    /**
     * @param args the command line arguments
     */
    int currentID;
    List<EventTypeBean> eventTypeList;
    DataEvent dataEvent = new DataEvent();
    DataEventType dataType = new DataEventType();
    EventBean currentEvent;    //the current event
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAddEventType;
    private javax.swing.JButton btnCost;
    private javax.swing.JButton btnQuit;
    private javax.swing.JButton btnSaveEvent;
    private com.toedter.calendar.JDateChooser calDate;
    private javax.swing.JComboBox cbbEventType;
    private javax.swing.JComboBox cbbStatus;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JLabel lbDescription;
    private javax.swing.JLabel lbEventFilter;
    private javax.swing.JLabel lbEventType;
    private javax.swing.JLabel lbFee;
    private javax.swing.JLabel lbName;
    private javax.swing.JLabel lbStatus;
    private javax.swing.JLabel lbTime;
    private javax.swing.JLabel lbVenue;
    private javax.swing.JScrollPane spDescription;
    private javax.swing.JTextArea taDescription;
    private javax.swing.JTextField tfEventFilter;
    private javax.swing.JTextField tfFee;
    private javax.swing.JTextField tfName;
    private javax.swing.JTextField tfNewEventType;
    private javax.swing.JTextField tfTime;
    private javax.swing.JTextField tfVenue;
    // End of variables declaration//GEN-END:variables
}
TOP

Related Classes of club.ui.ModifyEvent

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.