package cz.cvut.fel.restauracefel.manager.manager_gui;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JTextField;
import cz.cvut.fel.restauracefel.library.service.Validator;
/**
* Trida vytvarejici GUI formular vyuzivany tridou RecipeDialog.
*
* @author Jarda
*/
public class RecipeForm extends javax.swing.JPanel {
/**
* Konstruktor tridy RecipeForm.
*/
public RecipeForm() {
initComponents();
}
/**
* Metoda cistici vsechny vstupni komponenty.
*/
public void clearFields(){
Validator.clearTextField(jTextFieldQuantity);
Validator.clearComboBox(jComboBoxMaterialType);
}
public JTextField getQuantityTextField(){
return jTextFieldQuantity;
}
public JComboBox getMaterialTypeComboBox(){
return jComboBoxMaterialType;
}
public JComboBox getMaterialComboBox(){
return jComboBoxMaterial;
}
public JComboBox getUnitTypeComboBox(){
return jComboBoxUnit;
}
public JButton getInsertButton(){
return jButtonInsert;
}
public JButton getDeleteButton(){
return jButtonDelete;
}
public JLabel getMenuItemLabel(){
return jLabelMenuItem;
}
/** 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() {
jLabelType = new javax.swing.JLabel();
jLabelMaterial = new javax.swing.JLabel();
jComboBoxMaterialType = new javax.swing.JComboBox();
jComboBoxMaterial = new javax.swing.JComboBox();
jLabelQuantity = new javax.swing.JLabel();
jTextFieldQuantity = new javax.swing.JTextField();
jComboBoxUnit = new javax.swing.JComboBox();
jLabelName = new javax.swing.JLabel();
jLabelMenuItem = new javax.swing.JLabel();
jButtonInsert = new javax.swing.JButton();
jButtonDelete = new javax.swing.JButton();
jLabelType.setText("Druh suroviny");
jLabelMaterial.setText("Surovina");
jLabelQuantity.setText("Množství");
jLabelName.setText("Položka menu");
jLabelMenuItem.setFont(new java.awt.Font("Tahoma", 1, 12));
jLabelMenuItem.setText("AAA");
jButtonInsert.setText("Vložit do receptury");
jButtonDelete.setText("Odstranit z receptury");
jButtonDelete.setEnabled(false);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabelName)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabelMenuItem))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(jButtonInsert)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButtonDelete))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabelType)
.addComponent(jLabelMaterial)
.addComponent(jLabelQuantity))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jComboBoxMaterialType, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jComboBoxMaterial, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextFieldQuantity, javax.swing.GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jComboBoxUnit, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelName)
.addComponent(jLabelMenuItem))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelType)
.addComponent(jComboBoxMaterialType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelMaterial)
.addComponent(jComboBoxMaterial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelQuantity)
.addComponent(jTextFieldQuantity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jComboBoxUnit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButtonInsert)
.addComponent(jButtonDelete))
.addContainerGap(40, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButtonDelete;
private javax.swing.JButton jButtonInsert;
private javax.swing.JComboBox jComboBoxMaterial;
private javax.swing.JComboBox jComboBoxMaterialType;
private javax.swing.JComboBox jComboBoxUnit;
private javax.swing.JLabel jLabelMaterial;
private javax.swing.JLabel jLabelMenuItem;
private javax.swing.JLabel jLabelName;
private javax.swing.JLabel jLabelQuantity;
private javax.swing.JLabel jLabelType;
private javax.swing.JTextField jTextFieldQuantity;
// End of variables declaration//GEN-END:variables
}