Ich denke, ich habe das Problem, dass ich zu prozedural denke. Mir ist nämlich beim durchgehen einiger Beispiele und Tutorials aufgefallen, dass die Autoren oft Klassen erstellen, die ich so nicht gemacht hätte. Ich habe mir dann dazu Gedanken gemacht, und bin zu dem Ergebnis gekommen, dass ich gar nicht weiß, wann ich eine Klasse besser in mehrere Klassen aufspalte.
Als Beispiel habe ich die Hauptklasse meines Rezepte-Programms. Sie ist unter anderem für das Haupt-Frame verantwortlich:
(Klasse wird nicht vollständig angezeigt im Forum)
Als Beispiel habe ich die Hauptklasse meines Rezepte-Programms. Sie ist unter anderem für das Haupt-Frame verantwortlich:
Code:
package mampf;
import com.jgoodies.looks.plastic.Plastic3DLookAndFeel;
import com.jgoodies.looks.plastic.theme.ExperienceBlue;
import java.awt.Color;
import java.awt.Image;
import mampf.types.Type;
import mampf.subtypes.SubType;
import mampf.preparationtype.PreparationType;
import mampf.regions.Region;
import mampf.quantityunit.QuantityUnit;
import mampf.subtypes.JDialogSubType;
import mampf.regions.JDialogRegion;
import mampf.quantityunit.JDialogQuantityUnit;
import mampf.ingredients.*;
import mampf.types.JDialogType;
import java.net.URL;
import javax.swing.table.DefaultTableModel;
import java.util.Vector;
import javax.swing.ListSelectionModel;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.event.ListSelectionListener;
import javax.swing.event.ListSelectionEvent;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import javax.swing.ImageIcon;
import javax.swing.SwingUtilities;
import mampf.preparationtype.JDialogPreparationType;
import org.jdesktop.swingx.JXTable;
public class JFrameMampfMain extends javax.swing.JFrame {
//constants
private static final String MAMPF_VERSION = "0.0.1";//application version
public static final String DB_NAME = "mampf_database.yap";//database name
public static final int FS_EMPTY = -1;
public static final int FS_NEW = 0;
public static final int FS_EDIT = 1;
public static final int FS_VIEW = 2;
public static final int FS_ENABLED = 3;
//propertys
private Db4oDataAbstractionLayer m_dal;
private Recipe m_recipe;
private Type m_type;
private SubType m_subtype;
private PreparationType m_preparationtype;
private Region m_region;
private Ingredient m_ingredient;
private QuantityUnit m_quantityunit;
public int m_iMainStatus;
public int m_iIngredientStatus;
//constructors
/**
* Constructor
*
*/
public JFrameMampfMain() {
setLookAndFeel();//set SystemLook&Feel
initComponents();
SwingUtilities.updateComponentTreeUI(this);
this.setTitle(this.getTitle() + " " + MAMPF_VERSION);
//set status
if(jXTableRecipe.getRowCount() == 0) setMainStatus(FS_EMPTY);
else setMainStatus(FS_EMPTY);
//init the JTables
setFirstColumnInvisible(jXTableRecipe);
initRecipeTable();//init the table with columns
setColumnPropTableRecipe();
initRecipeIngredientTable();
setFirstColumnInvisible(jXTableRecipeIngredients);
//SelectionListener for RecipeList
ListSelectionListener rowListenerRecipe = new ListSelectionListener() {
public void valueChanged(final ListSelectionEvent e) {
if(jXTableRecipe.getRowCount() > 0 && m_iMainStatus != FS_NEW && m_iMainStatus != FS_EDIT){
int row = jXTableRecipe.getSelectedRow();
if(row <= -1) return;
DefaultTableModel tablemodel = (DefaultTableModel)jXTableRecipe.getModel();
Recipe rc = (Recipe)tablemodel.getValueAt(row, 0);
if(!rc.equals(m_recipe)){
m_recipe = rc;
fillRecipeToGui(m_recipe);
}
}
}
};
jXTableRecipe.getSelectionModel().addListSelectionListener(rowListenerRecipe);
//SelectionListener for RecipeIngredientList
ListSelectionListener rowListenerRecipeIngredient = new ListSelectionListener() {
public void valueChanged(final ListSelectionEvent ex) {
if(jXTableRecipeIngredients.getRowCount() > 0){
//show the marked object
int row = jXTableRecipeIngredients.getSelectedRow();
if(row <= -1) return;
DefaultTableModel model = (DefaultTableModel)jXTableRecipeIngredients.getModel();
RecipeIngredient ri = (RecipeIngredient)model.getValueAt(row, 0);
fillRecipeIngredientToTextFields(ri);
//setIngredientStatus(FS_VIEW);
}
}
};
jXTableRecipeIngredients.getSelectionModel().addListSelectionListener(rowListenerRecipeIngredient);
jProgressBarRecipe.setVisible(false);
//Icon setzen
setTitleIcon();
}
private void setTitleIcon(){
URL url = JFrameMampfMain.class.getResource("images/cheff.png");
if(url == null) return;
ImageIcon icon = new ImageIcon(url);
Image image = icon.getImage();
this.setIconImage(image);
}
private void initProgressBarRecipe(){
jProgressBarRecipe.setMinimum(0);
jProgressBarRecipe.setMaximum(getRecipeCount());
jProgressBarRecipe.setVisible(true);
}
private int getRecipeCount(){
return m_dal.getObjectCount(new Recipe());
}
/**
* select the row
*
* @param row
*/
private void changeSelectionTableRecipe(int row){
if(jXTableRecipe.getRowCount() > 0){
jXTableRecipe.changeSelection(row, 0, true, false);
}
}
/**
* sets the look&feel of the application (default=SystemLook&Feel)
*/
private void setLookAndFeel(){
try {
//set Look&Feel
/*UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());*/
Plastic3DLookAndFeel lf = new Plastic3DLookAndFeel();
lf.setPlasticTheme(new ExperienceBlue());
UIManager.setLookAndFeel(lf);
} catch( Exception e ) {
System.out.println(e.getLocalizedMessage());
}
}
/**
* fll a recipe to gui
*
* @param Recipe
*/
private void fillRecipeToGui(Recipe recipe){
jTextFieldDish.setText(recipe.getDish());
if(recipe.getType() != null){
jTextFieldType.setText(recipe.getType().getType());
} else {
jTextFieldType.setText("");
}
if(recipe.getSubType() != null){
jTextFieldSubType.setText(recipe.getSubType().getSubType());
} else {
jTextFieldSubType.setText("");
}
if(recipe.getPreparationType() != null){
jTextFieldPreparationType.setText(recipe.getPreparationType().getPrearationType());
} else {
jTextFieldPreparationType.setText("");
}
if(recipe.getRegion() != null){
jTextFieldRegion.setText(recipe.getRegion().getRegion());
} else {
jTextFieldRegion.setText("");
}
jFormattedTextFieldLengthTime.setText(Short.toString(recipe.getLengthTime()));
jFormattedTextFieldCalorificValue.setText(Integer.toString(recipe.getCalorificValue()));
jFormattedTextFieldPoints.setText(Float.toString(recipe.getPoints()));
jFormattedTextFieldNumberOfPersons.setText(Byte.toString(recipe.getNumberOfPersons()));
jTextFieldSource.setText(recipe.getSource());
jComboBoxGrade.setSelectedIndex(recipe.getGrade()-1);
jTextFieldGradeReason.setText(recipe.getGradeReason());
jTextAreaComments.setText(recipe.getComments());
jTextAreaPreparation.setText(recipe.getPreparation());
fillRecipeIngredientsList(recipe.getRecipeIngredients());
}
/**
* fll the RecipeIngredient-List with recipes RecipeIngredient
*
* @param ArrayList<RecipeIngredient>
*/
private void fillRecipeIngredientsList(ArrayList<RecipeIngredient> ri){
if(ri == null) return;
DefaultTableModel tablemodel = (DefaultTableModel)jXTableRecipeIngredients.getModel();
tablemodel.setRowCount(0);
for(int i=0; i < ri.size(); i++){
Vector vector = new Vector();
vector.add(ri.get(i));
vector.add(ri.get(i).getQuantity());
vector.add(ri.get(i).getRecipeIngredient().getIngredient());
vector.add(ri.get(i).getRecipeIngredientQuantityUnit().getQuantityUnit());
tablemodel.addRow(vector);
}
jXTableRecipeIngredients.setModel(tablemodel);
setColumnPropTableRecipeIngredient();
}
/**
* fll the MainList with recipes
*
*/
private void fillRecipeMainList(){
initProgressBarRecipe();
DefaultTableModel tablemodel = (DefaultTableModel)jXTableRecipe.getModel();
tablemodel.setRowCount(0);//liste leeren
Recipe recipe = new Recipe();
ArrayList<Recipe> recipes = null;
try {
recipes = m_dal.getObjectArraList(recipe);
} catch (Db4oDalException ex) {
}
if(recipes == null){
setMainStatus(FS_EMPTY);
return;
}
if(recipes.size() == 0){
setMainStatus(FS_EMPTY);
return;
}
//Collections.sort(types);
for(int i=0; i < recipes.size(); i++){
Vector vector = new Vector();
vector.add(recipes.get(i));
vector.add(recipes.get(i).getDish());
if(recipes.get(i).getType() != null){
vector.add(recipes.get(i).getType().getType());
} else {
vector.add("");
}
if(recipes.get(i).getSubType() != null){
vector.add(recipes.get(i).getSubType().getSubType());
} else {
vector.add("");
}
if(recipes.get(i).getPreparationType() != null){
vector.add(recipes.get(i).getPreparationType().getPrearationType());
} else {
vector.add("");
}
if(recipes.get(i).getRegion() != null){
vector.add(recipes.get(i).getRegion().getRegion());
} else {
vector.add("");
}
vector.add(recipes.get(i).getGrade());
tablemodel.addRow(vector);
jProgressBarRecipe.setValue(i+1);
jProgressBarRecipe.paint(jProgressBarRecipe.getGraphics());
}
jXTableRecipe.setModel(tablemodel);
setColumnPropTableRecipe();
setMainStatus(FS_VIEW);
jProgressBarRecipe.setVisible(false);
}
/**
* save a recipe
*
* @return boolen err-code
*/
private boolean saveRecipe(){
Calendar calendar = new GregorianCalendar();
if(m_iMainStatus == FS_NEW){
m_recipe = new Recipe();//create a new recipe-object
m_recipe.setDateCreated(calendar.getTime());
} else {
deleteAllRecipeIngredients(m_recipe);
m_recipe.setDateLastModified(calendar.getTime());
}
fillRecipeFromGui(m_recipe);//fill recipe-object
fillRecipeIngredientsToRecipe(m_recipe);
if(!isRecipeOk(m_recipe)){
JOptionPane.showMessageDialog(this, java.util.ResourceBundle.getBundle("mampf/language").getString("missing_dish"),
java.util.ResourceBundle.getBundle("mampf/language").getString("error"), JOptionPane.OK_CANCEL_OPTION);
return false;
}
if((m_iMainStatus == FS_NEW && isUnique(m_recipe)) ||
m_iMainStatus == FS_EDIT){
try{
m_dal.storeObject(m_recipe);
} catch (Db4oDalException ex) {
JOptionPane.showMessageDialog(this, java.util.ResourceBundle.getBundle("mampf/language").getString("error_saving") +
ex.getLocalizedMessage(), java.util.ResourceBundle.getBundle("mampf/language").getString("error"),
JOptionPane.OK_CANCEL_OPTION);
return false;
}
} else {
JOptionPane.showMessageDialog(this, java.util.ResourceBundle.getBundle("mampf/language").getString("msg_ingredient") +
m_recipe.getDish() + java.util.ResourceBundle.getBundle("mampf/language").getString("msg_exists"),
java.util.ResourceBundle.getBundle("mampf/language").getString("error"), JOptionPane.OK_CANCEL_OPTION);
}
return true;
}
private boolean deleteRecipe(){
if(JOptionPane.showConfirmDialog(this,"Soll der Datesatz wirklich gelöscht werden?","Achtung !",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE) == 0){
try {
m_dal.deleteObject(m_recipe);
} catch (Db4oDalException ex) {
JOptionPane.showMessageDialog(this, java.util.ResourceBundle.getBundle("mampf/language").getString("error_delete") +
ex.getMessage(), java.util.ResourceBundle.getBundle("mampf/language").getString("error"), JOptionPane.OK_CANCEL_OPTION);
return false;
}
fillRecipeMainList();
return true;
}
return true;
}
/**
* proof if object is unique in database
*
* @param object
*/
protected boolean isUnique(Recipe recipe){
ArrayList<Recipe> recipes = new ArrayList<Recipe>();
try {
recipes = m_dal.getObjectArraList(recipe);
} catch (Db4oDalException ex) {
}
if(recipes == null) return true;
if(recipes.size() > 0) return false;
else return true;
}
/**
* fill recipe-ingredients from JTable to ArrayList
*
* @param Recipe
* @return Recipe
*/
private Recipe fillRecipeIngredientsToRecipe(Recipe recipe){
ArrayList<RecipeIngredient> ri = recipe.getRecipeIngredients();
if(ri == null ){
ri = new ArrayList<RecipeIngredient>();
}
DefaultTableModel tablemodel = (DefaultTableModel)jXTableRecipeIngredients.getModel();
for(int i=0;i < tablemodel.getRowCount(); i++){
ri.add((RecipeIngredient)tablemodel.getValueAt(i, 0));
}
recipe.setRecipeIngredients(ri);
return recipe;
}
/**
* delete all objects from the ArrayList
*
* @param Recipe
* @return Recipe
*/
private Recipe deleteAllRecipeIngredients(Recipe recipe){
ArrayList<RecipeIngredient> ri = recipe.getRecipeIngredients();
ri.clear();
return recipe;
}
/**
* fill a recipe-object from the gui
*
* @param Recipe
* @return Recipe
*/
private Recipe fillRecipeFromGui(Recipe recipe){
recipe.setDish(jTextFieldDish.getText());
recipe.setType(m_type);
recipe.setSubType(m_subtype);
recipe.setPreparationType(m_preparationtype);
recipe.setRegion(m_region);
if(jFormattedTextFieldLengthTime.getText().isEmpty()){
recipe.setLengthTime((byte)0);
} else {
recipe.setLengthTime(Byte.parseByte(jFormattedTextFieldLengthTime.getText()));
}
if(jFormattedTextFieldCalorificValue.getText().isEmpty()){
recipe.setCalorificValue(0);
} else {
recipe.setCalorificValue(Integer.parseInt(jFormattedTextFieldCalorificValue.getText()));
}
if(jFormattedTextFieldPoints.getText().isEmpty()){
recipe.setPoints(0);
} else {
recipe.setPoints(Float.parseFloat(jFormattedTextFieldPoints.getText().replace(',', '.')));
}
if(jFormattedTextFieldNumberOfPersons.getText().isEmpty()){
recipe.setNumberOfPersons((byte)0);
} else {
recipe.setNumberOfPersons(Byte.parseByte(jFormattedTextFieldNumberOfPersons.getText()));
}
recipe.setSource(jTextFieldSource.getText());
recipe.setGrade(Byte.parseByte(jComboBoxGrade.getModel().getSelectedItem().toString()));
recipe.setGradeReason(jTextFieldGradeReason.getText());
recipe.setComments(jTextAreaComments.getText());
recipe.setPreparation(jTextAreaPreparation.getText());
return recipe;
}
/**
* proof if the recipe is ok
*
* @param Recipe
*/
private boolean isRecipeOk(Recipe recipe){
if(recipe.getDish().isEmpty()){
JOptionPane.showMessageDialog(this, java.util.ResourceBundle.getBundle("mampf/language").getString("missing_dish"), java.util.ResourceBundle.getBundle("mampf/language").getString("error"),
JOptionPane.OK_CANCEL_OPTION);
return false;
}
return true;
}
/**
* open a master-data dialog
*
* @param JDialogMasterData: dialog
*/
private void showMasterDataDialog(JDialogMasterData dialog){
//open a dialog
dialog.pack();
dialog.setLocationRelativeTo(this);
dialog.setVisible(true);
}
/**
* show the recipeingredient in the gui
*
* @param RecipeIngredient
*/
public void fillRecipeIngredientToTextFields(RecipeIngredient ri){
float menge = ri.getQuantity();
jFormattedTextFieldQuantity.setText(String.valueOf(menge));
jTextFieldIngredientName.setText(
ri.getRecipeIngredient().getIngredient());
jTextFieldQuantityUnit.setText(
ri.getRecipeIngredientQuantityUnit().getQuantityUnit());
}
/**
* proof if RecipeIngredient is filled
*
* @param a float quantity
* @param b Ingredient
* @param c QuantityUnit
* @return boolean
*/
private boolean isRecipeIngredientOk(float quantity, Ingredient ingredient,
QuantityUnit quantityunit){
if(quantity > 0 && ingredient != null && quantityunit != null){
return true;
} else return false;
}
/**
* proof if RecipeIngredient is unique in this recipe
*
* @param Ingredient
* @return boolean
*/
public boolean isRecipeIngredientUnique(Ingredient ingredient){
for(int i= 0; i < jXTableRecipeIngredients.getRowCount(); i++){
if(ingredient.getIngredient() ==
jXTableRecipeIngredients.getValueAt(i, 1)){
return false;
}
}
return true;
}
/**
* creates a DefaultTableModel, add 7 columns
*
*/
private void initRecipeTable(){
DefaultTableModel tableModel = new DefaultTableModel();
tableModel.addColumn("Object");
tableModel.addColumn(java.util.ResourceBundle.getBundle("mampf/language").getString("dish"));
tableModel.addColumn(java.util.ResourceBundle.getBundle("mampf/language").getString("type"));
tableModel.addColumn(java.util.ResourceBundle.getBundle("mampf/language").getString("subtype"));
tableModel.addColumn(java.util.ResourceBundle.getBundle("mampf/language").getString("preparationtype"));
tableModel.addColumn(java.util.ResourceBundle.getBundle("mampf/language").getString("region"));
tableModel.addColumn(java.util.ResourceBundle.getBundle("mampf/language").getString("grade"));
jXTableRecipe.setModel(tableModel);
//setColumnPropTableRecipe();
}
/**
* sets colums not editable and the with
*/
private void setColumnPropTableRecipe(){
jXTableRecipe.getColumnExt(0).setEditable(false);
jXTableRecipe.getColumnExt(1).setEditable(false);
jXTableRecipe.getColumnExt(2).setEditable(false);
jXTableRecipe.getColumnExt(3).setEditable(false);
jXTableRecipe.getColumnExt(4).setEditable(false);
jXTableRecipe.getColumnExt(5).setEditable(false);
jXTableRecipe.getColumnExt(0).setPreferredWidth(325);
jXTableRecipe.getColumnExt(1).setPreferredWidth(130);
jXTableRecipe.getColumnExt(2).setPreferredWidth(130);
jXTableRecipe.getColumnExt(3).setPreferredWidth(130);
jXTableRecipe.getColumnExt(4).setPreferredWidth(130);
jXTableRecipe.getColumnExt(5).setPreferredWidth(60);
jXTableRecipe.setAutoResizeMode(JXTable.AUTO_RESIZE_OFF);
jXTableRecipe.setSelectionMode(ListSelectionModel.SINGLE_SELECTION );
}
private void setColumnPropTableRecipeIngredient(){
jXTableRecipeIngredients.getColumnExt(0).setEditable(false);
jXTableRecipeIngredients.getColumnExt(1).setEditable(false);
jXTableRecipeIngredients.getColumnExt(2).setEditable(false);
jXTableRecipeIngredients.getColumnExt(0).setPreferredWidth(50);
jXTableRecipeIngredients.getColumnExt(1).setPreferredWidth(205);
jXTableRecipeIngredients.getColumnExt(2).setPreferredWidth(100);
jXTableRecipeIngredients.setAutoResizeMode(jXTableRecipeIngredients.AUTO_RESIZE_OFF);
jXTableRecipeIngredients.setSelectionMode(ListSelectionModel.SINGLE_SELECTION );
}
/**
* sets the first column of the recipe list invisible
*/
protected void setFirstColumnInvisible(JXTable table){
table.getColumnExt(0).setVisible(false);
}
/**
* creates a DefaultTableModel, add 4 columns
*
*/
private void initRecipeIngredientTable(){
DefaultTableModel tableModel = new DefaultTableModel();
tableModel.addColumn("Object");
tableModel.addColumn(java.util.ResourceBundle.getBundle("mampf/language").getString("quantity"));
tableModel.addColumn(java.util.ResourceBundle.getBundle("mampf/language").getString("ingredient"));
tableModel.addColumn(java.util.ResourceBundle.getBundle("mampf/language").getString("quantityunit"));
jXTableRecipeIngredients.setModel(tableModel);
setColumnPropTableRecipeIngredient();
}
/**
* Sets the type
*
* @param Type
*/
public void setType(Type type){
m_type = type;
}
/**
* fill type to gui
*
* @param Type
*/
public void setTypeToTextField(Type type){
jTextFieldType.setText(type.getType());
}
/**
* Sets the subtype
*
* @param SubType
*/
public void setSubType(SubType subtype){
m_subtype = subtype;
}
/**
* fill subtype to gui
*
* @param SubType
*/
public void setSubTypeToTextField(SubType subtype){
jTextFieldSubType.setText(subtype.getSubType());
}
/**
* Sets the preparationtype
*
* @param PreparationType
*/
public void setPreparationType(PreparationType preparationtype){
m_preparationtype = preparationtype;
}
/**
* fill subtype to gui
*
* @param SubType
*/
public void setPreparationTypeToTextField(PreparationType preparationtype){
jTextFieldPreparationType.setText(preparationtype.getPrearationType());
}
/**
* Sets the region
*
* @param Region
*/
public void setRegion(Region region){
m_region = region;
}
/**
* fill region to gui
*
* @param Region
*/
public void setRegionToTextField(Region region){
jTextFieldRegion.setText(region.getRegion());
}
/**
* Sets the ingredient
*
* @param Ingredient
*/
public void setIngredient(Ingredient igredient){
m_ingredient = igredient;
}
/**
* fill ingredient to gui
*
* @param Ingredient
*/
public void setIngredientToTextField(Ingredient igredient){
jTextFieldIngredientName.setText(igredient.getIngredient());
}
/**
* Sets the quantity unit
*
* @param QuantityUnit
*/
public void setQuantityUnit(QuantityUnit quantityunit){
m_quantityunit = quantityunit;
}
/**
* fill quantity unit to gui
*
* @param QuantityUnit
*/
public void setQuantityUnitToTextField(QuantityUnit quantityunit){
jTextFieldQuantityUnit.setText(quantityunit.getQuantityUnit());
}
/**
* sets the main-status and sets gui-components enabled/disabled
*
* @param int Status
*/
public void setMainStatus(int iStatus){
m_iMainStatus = iStatus;
switch(iStatus){
case FS_EMPTY:
jButtonRecipeNew.setEnabled(true);
jButtonRecipeEdit.setEnabled(false);
jButtonRecipeSave.setEnabled(false);
jButtonRecipeCancel.setEnabled(false);
jButtonRecipeDelete.setEnabled(false);
jButtonRecipePrint.setEnabled(false);
jButtonMampfInfo.setEnabled(true);
jXTableRecipe.setEnabled(false);
jTextFieldDish.setEnabled(false);
jTextFieldType.setEnabled(false);
jButtonSearchType.setEnabled(false);
jTextFieldSubType.setEnabled(false);
jButtonSearchSubType.setEnabled(false);
jTextFieldPreparationType.setEnabled(false);
jButtonSearchPreparationType.setEnabled(false);
jTextFieldRegion.setEnabled(false);
jButtonSearchRegion.setEnabled(false);
jFormattedTextFieldLengthTime.setEnabled(false);
jFormattedTextFieldCalorificValue.setEnabled(false);
jFormattedTextFieldPoints.setEnabled(false);
jFormattedTextFieldNumberOfPersons.setEnabled(false);
jTextFieldSource.setEnabled(false);
jComboBoxGrade.setEnabled(false);
jTextFieldGradeReason.setEnabled(false);
jTextAreaComments.setEnabled(false);
jTextAreaPreparation.setEnabled(false);
jLabelStatus.setText(java.util.ResourceBundle.getBundle("mampf/language").getString("status_empty"));
jLabelStatus.setForeground(java.awt.Color.BLACK);
setIngredientStatus(iStatus);
break;
case FS_EDIT:
jButtonRecipeNew.setEnabled(false);
jButtonRecipeEdit.setEnabled(false);
jButtonRecipeSave.setEnabled(true);
jButtonRecipeCancel.setEnabled(true);
jButtonRecipeDelete.setEnabled(false);
jButtonRecipePrint.setEnabled(false);
jButtonMampfInfo.setEnabled(false);
jXTableRecipe.setEnabled(false);
jTextFieldDish.setEnabled(true);
jTextFieldDish.requestFocus();
jTextFieldType.setEnabled(true);
jButtonSearchType.setEnabled(true);
jTextFieldSubType.setEnabled(true);
jButtonSearchSubType.setEnabled(true);
jTextFieldPreparationType.setEnabled(true);
jButtonSearchPreparationType.setEnabled(true);
jTextFieldRegion.setEnabled(true);
jButtonSearchRegion.setEnabled(true);
jFormattedTextFieldLengthTime.setEnabled(true);
jFormattedTextFieldCalorificValue.setEnabled(true);
jFormattedTextFieldPoints.setEnabled(true);
jFormattedTextFieldNumberOfPersons.setEnabled(true);
jTextFieldSource.setEnabled(true);
jComboBoxGrade.setEnabled(true);
jTextFieldGradeReason.setEnabled(true);
jTextAreaComments.setEnabled(true);
jTextAreaPreparation.setEnabled(true);
jLabelStatus.setText(java.util.ResourceBundle.getBundle("mampf/language").getString("status_edit"));
jLabelStatus.setForeground(java.awt.Color.RED);
setIngredientStatus(FS_ENABLED);
break;
case FS_NEW:
jButtonRecipeNew.setEnabled(false);
jButtonRecipeEdit.setEnabled(false);
jButtonRecipeSave.setEnabled(true);
jButtonRecipeCancel.setEnabled(true);
jButtonRecipeDelete.setEnabled(false);
jButtonRecipePrint.setEnabled(false);
jButtonMampfInfo.setEnabled(false);
jXTableRecipe.setEnabled(false);
jTextFieldDish.setEnabled(true);
jTextFieldDish.setText("");
jTextFieldDish.requestFocus();
jTextFieldType.setEnabled(true);
jTextFieldType.setText("");
jButtonSearchType.setEnabled(true);
jTextFieldSubType.setEnabled(true);
jTextFieldSubType.setText("");
jButtonSearchSubType.setEnabled(true);
jButtonSearchSubType.setText("");
jTextFieldPreparationType.setEnabled(true);
jTextFieldPreparationType.setText("");
jButtonSearchPreparationType.setEnabled(true);
jButtonSearchPreparationType.setText("");
jTextFieldRegion.setEnabled(true);
jTextFieldRegion.setText("");
jButtonSearchRegion.setEnabled(true);
jButtonSearchRegion.setText("");
jFormattedTextFieldLengthTime.setEnabled(true);
jFormattedTextFieldLengthTime.setText("0");
jFormattedTextFieldCalorificValue.setEnabled(true);
jFormattedTextFieldCalorificValue.setText("0");
jFormattedTextFieldPoints.setEnabled(true);
jFormattedTextFieldPoints.setText("0,0");
jFormattedTextFieldNumberOfPersons.setEnabled(true);
jFormattedTextFieldNumberOfPersons.setText("0");
jTextFieldSource.setEnabled(true);
jTextFieldSource.setText("");
jComboBoxGrade.setEnabled(true);
jComboBoxGrade.setSelectedIndex(0);
jTextFieldGradeReason.setEnabled(true);
jTextFieldGradeReason.setText("");
jTextAreaComments.setEnabled(true);
jTextAreaComments.setText("");
jTextAreaPreparation.setEnabled(true);
jTextAreaPreparation.setText("");
jLabelStatus.setText(java.util.ResourceBundle.getBundle("mampf/language").getString("status_new"));
DefaultTableModel tabelmodel = (DefaultTableModel)jXTableRecipeIngredients.getModel();
tabelmodel.setRowCount(0);
jLabelStatus.setForeground(java.awt.Color.blue);
setIngredientStatus(FS_ENABLED);
break;
case FS_VIEW:
jButtonRecipeNew.setEnabled(true);
jButtonRecipeEdit.setEnabled(true);
jButtonRecipeSave.setEnabled(false);
jButtonRecipeCancel.setEnabled(false);
jButtonRecipeDelete.setEnabled(true);
jButtonRecipePrint.setEnabled(true);
jButtonMampfInfo.setEnabled(true);
jXTableRecipe.setEnabled(true);
jTextFieldDish.setEnabled(false);
jTextFieldType.setEnabled(false);
jButtonSearchType.setEnabled(false);
jTextFieldSubType.setEnabled(false);
jButtonSearchSubType.setEnabled(false);
jTextFieldPreparationType.setEnabled(false);
jButtonSearchPreparationType.setEnabled(false);
jTextFieldRegion.setEnabled(false);
jButtonSearchRegion.setEnabled(false);
jFormattedTextFieldLengthTime.setEnabled(false);
jFormattedTextFieldCalorificValue.setEnabled(false);
jFormattedTextFieldPoints.setEnabled(false);
jFormattedTextFieldNumberOfPersons.setEnabled(false);
jTextFieldSource.setEnabled(false);
jComboBoxGrade.setEnabled(false);
jTextFieldGradeReason.setEnabled(false);
jTextAreaComments.setEnabled(false);
jTextAreaPreparation.setEnabled(false);
jLabelStatus.setText(java.util.ResourceBundle.getBundle("mampf/language").getString("status_view"));
jLabelStatus.setForeground(new Color(85,150,85));
break;
}
}
/**
* sets the ingredient-status and sets gui-components enabled/disabled
*
* @param int IngredientStatus
*/
public void setIngredientStatus(int iIngredientStatus){
m_iIngredientStatus = iIngredientStatus;
switch(iIngredientStatus){
case FS_EMPTY:
jButtonIngredientNew.setEnabled(false);
jButtonIngredientAdd.setEnabled(false);
jButtonIngredientEdit.setEnabled(false);
jButtonIngredientRemove.setEnabled(false);
jButtonIngredientCancel.setEnabled(false);
jFormattedTextFieldQuantity.setEnabled(false);
jTextFieldIngredientName.setEnabled(false);
jButtonSearchIngredient.setEnabled(false);
jTextFieldQuantityUnit.setEnabled(false);
jButtonSearchQuantityUnit.setEnabled(false);
jXTableRecipeIngredients.setEnabled(false);
break;
case FS_ENABLED:
jButtonIngredientNew.setEnabled(true);
jButtonIngredientAdd.setEnabled(false);
jButtonIngredientEdit.setEnabled(false);
jButtonIngredientRemove.setEnabled(false);
jButtonIngredientCancel.setEnabled(false);
jFormattedTextFieldQuantity.setEnabled(false);
jTextFieldIngredientName.setEnabled(false);
jButtonSearchIngredient.setEnabled(false);
jTextFieldQuantityUnit.setEnabled(false);
jButtonSearchQuantityUnit.setEnabled(false);
jXTableRecipeIngredients.setEnabled(true);
break;
case FS_EDIT:
jButtonIngredientNew.setEnabled(true);
jButtonIngredientAdd.setEnabled(false);
jButtonIngredientEdit.setEnabled(false);
jButtonIngredientRemove.setEnabled(false);
jButtonIngredientCancel.setEnabled(false);
/*jButtonRecipeNew.setEnabled(false);
jButtonRecipeEdit.setEnabled(false);
jButtonRecipeSave.setEnabled(false);
jButtonRecipeCancel.setEnabled(false);
jButtonRecipeDelete.setEnabled(false);
jButtonRecipePrint.setEnabled(false);
jButtonMampfInfo.setEnabled(false);*/
jFormattedTextFieldQuantity.setEnabled(true);
jTextFieldIngredientName.setEnabled(true);
jButtonSearchIngredient.setEnabled(true);
jTextFieldQuantityUnit.setEnabled(true);
jButtonSearchQuantityUnit.setEnabled(true);
jXTableRecipeIngredients.setEnabled(true);
jFormattedTextFieldQuantity.requestFocus();
break;
case FS_NEW:
jButtonIngredientNew.setEnabled(false);
jButtonIngredientAdd.setEnabled(true);
jButtonIngredientEdit.setEnabled(false);
jButtonIngredientRemove.setEnabled(false);
jButtonIngredientCancel.setEnabled(true);
/*jButtonRecipeNew.setEnabled(false);
jButtonRecipeEdit.setEnabled(false);
jButtonRecipeSave.setEnabled(false);
jButtonRecipeCancel.setEnabled(false);
jButtonRecipeDelete.setEnabled(false);
jButtonRecipePrint.setEnabled(false);
jButtonMampfInfo.setEnabled(false);*/
jFormattedTextFieldQuantity.setEnabled(true);
jFormattedTextFieldQuantity.setText("");
jTextFieldIngredientName.setEnabled(true);
jTextFieldIngredientName.setText("");
jButtonSearchIngredient.setEnabled(true);
jTextFieldQuantityUnit.setEnabled(true);
jTextFieldQuantityUnit.setText("");
jButtonSearchQuantityUnit.setEnabled(true);
jXTableRecipeIngredients.setEnabled(true);
jFormattedTextFieldQuantity.requestFocus();
break;
case FS_VIEW:
jButtonIngredientNew.setEnabled(false);
jButtonIngredientAdd.setEnabled(true);
jButtonIngredientEdit.setEnabled(true);
jButtonIngredientRemove.setEnabled(true);
jButtonIngredientCancel.setEnabled(false);
setMainStatus(m_iMainStatus);
jFormattedTextFieldQuantity.setEnabled(false);
jTextFieldIngredientName.setEnabled(false);
jButtonSearchIngredient.setEnabled(false);
jTextFieldQuantityUnit.setEnabled(false);
jButtonSearchQuantityUnit.setEnabled(false);
jXTableRecipeIngredients.setEnabled(true);
break;
}
}
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanelRecipeList = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jXTableRecipe = new org.jdesktop.swingx.JXTable();
jPanelDish = new javax.swing.JPanel();
jTextFieldDish = new javax.swing.JTextField();
jToolBarMain = new javax.swing.JToolBar();
jButtonRecipeNew = new javax.swing.JButton();
jButtonRecipeEdit = new javax.swing.JButton();
jButtonRecipeSave = new javax.swing.JButton();
jButtonRecipeCancel = new javax.swing.JButton();
jButtonRecipeDelete = new javax.swing.JButton();
jButtonRecipePrint = new javax.swing.JButton();
jButtonMampfInfo = new javax.swing.JButton();
jTabbedPaneRecipe = new javax.swing.JTabbedPane();
jPanelRecipeInfo = new javax.swing.JPanel();
jPanelInfo1 = new javax.swing.JPanel();
jLabelType = new javax.swing.JLabel();
jLabelPreparationType = new javax.swing.JLabel();
jTextFieldType = new javax.swing.JTextField();
jTextFieldPreparationType = new javax.swing.JTextField();
jButtonSearchType = new javax.swing.JButton();
jButtonSearchPreparationType = new javax.swing.JButton();
jLabelSubType = new javax.swing.JLabel();
jLabelRegion = new javax.swing.JLabel();
jTextFieldSubType = new javax.swing.JTextField();
jTextFieldRegion = new javax.swing.JTextField();
jButtonSearchSubType = new javax.swing.JButton();
jButtonSearchRegion = new javax.swing.JButton();
jLabelLengthTime = new javax.swing.JLabel();
jFormattedTextFieldLengthTime = new javax.swing.JFormattedTextField();
jLabelCalorificValue = new javax.swing.JLabel();
jFormattedTextFieldCalorificValue = new javax.swing.JFormattedTextField();
jLabelNumberOfPersons = new javax.swing.JLabel();
jFormattedTextFieldNumberOfPersons = new javax.swing.JFormattedTextField();
jLabelPoints = new javax.swing.JLabel();
jFormattedTextFieldPoints = new javax.swing.JFormattedTextField();
jPanelInfo2 = new javax.swing.JPanel();
jLabelGrade = new javax.swing.JLabel();
jComboBoxGrade = new javax.swing.JComboBox();
jLabelGradeReason = new javax.swing.JLabel();
jTextFieldGradeReason = new javax.swing.JTextField();
jLabelSource = new javax.swing.JLabel();
jTextFieldSource = new javax.swing.JTextField();
jLabelComments = new javax.swing.JLabel();
jScrollPane5 = new javax.swing.JScrollPane();
jTextAreaComments = new javax.swing.JTextArea();
jPanelRecipePreperation = new javax.swing.JPanel();
jPanelIngredients = new javax.swing.JPanel();
jLabelQuantity = new javax.swing.JLabel();
jLabelIngredientName = new javax.swing.JLabel();
jLabelQuantityUnit = new javax.swing.JLabel();
jFormattedTextFieldQuantity = new javax.swing.JFormattedTextField();
jTextFieldIngredientName = new javax.swing.JTextField();
jTextFieldQuantityUnit = new javax.swing.JTextField();
jScrollPane2 = new javax.swing.JScrollPane();
jXTableRecipeIngredients = new org.jdesktop.swingx.JXTable();
jButtonSearchIngredient = new javax.swing.JButton();
jButtonSearchQuantityUnit = new javax.swing.JButton();
jToolBar1 = new javax.swing.JToolBar();
jButtonIngredientNew = new javax.swing.JButton();
jButtonIngredientAdd = new javax.swing.JButton();
jButtonIngredientRemove = new javax.swing.JButton();
jButtonIngredientEdit = new javax.swing.JButton();
jButtonIngredientCancel = new javax.swing.JButton();
jPanelPreparationText = new javax.swing.JPanel();
jScrollPane3 = new javax.swing.JScrollPane();
jTextAreaPreparation = new javax.swing.JTextArea();
jToolBarStatus = new javax.swing.JToolBar();
jLabelStatus = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JToolBar.Separator();
jLabel1 = new javax.swing.JLabel();
jProgressBarRecipe = new javax.swing.JProgressBar();
jMenuBarMain = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenu2 = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Mampf");
setResizable(false);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
formWindowClosing(evt);
}
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
}
});
jPanelRecipeList.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Rezepte", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 11))); // NOI18N
jPanelRecipeList.setFocusable(false);
jXTableRecipe.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Object", "Gericht", "Art", "Unterart", "Zubereitung", "Region", "Note"
}
) {
Class[] types = new Class [] {
java.lang.Object.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Byte.class
};
boolean[] canEdit = new boolean [] {
false, false, false, false, false, false, false
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
jXTableRecipe.setFont(new java.awt.Font("Dialog", 0, 10));
jScrollPane1.setViewportView(jXTableRecipe);
javax.swing.GroupLayout jPanelRecipeListLayout = new javax.swing.GroupLayout(jPanelRecipeList);
jPanelRecipeList.setLayout(jPanelRecipeListLayout);
jPanelRecipeListLayout.setHorizontalGroup(
jPanelRecipeListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelRecipeListLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 922, Short.MAX_VALUE)
.addContainerGap())
);
jPanelRecipeListLayout.setVerticalGroup(
jPanelRecipeListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelRecipeListLayout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
.addContainerGap())
);
jPanelDish.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Gericht", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 11))); // NOI18N
jPanelDish.setFocusable(false);
javax.swing.GroupLayout jPanelDishLayout = new javax.swing.GroupLayout(jPanelDish);
jPanelDish.setLayout(jPanelDishLayout);
jPanelDishLayout.setHorizontalGroup(
jPanelDishLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelDishLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jTextFieldDish, javax.swing.GroupLayout.DEFAULT_SIZE, 922, Short.MAX_VALUE)
.addContainerGap())
);
jPanelDishLayout.setVerticalGroup(
jPanelDishLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelDishLayout.createSequentialGroup()
.addComponent(jTextFieldDish, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(13, Short.MAX_VALUE))
);
jToolBarMain.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jToolBarMain.setOpaque(false);
jButtonRecipeNew.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mampf/images/document-new.png"))); // NOI18N
jButtonRecipeNew.setText("Neu");
jButtonRecipeNew.setToolTipText("Neues Rezept");
jButtonRecipeNew.setFocusable(false);
jButtonRecipeNew.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButtonRecipeNew.setInheritsPopupMenu(true);
jButtonRecipeNew.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jButtonRecipeNew.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonRecipeNewMouseClicked(evt);
}
});
jToolBarMain.add(jButtonRecipeNew);
jButtonRecipeEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mampf/images/accessories-text-editor.png"))); // NOI18N
jButtonRecipeEdit.setText("Bearbeiten");
jButtonRecipeEdit.setToolTipText("Rezept bearbeiten");
jButtonRecipeEdit.setFocusable(false);
jButtonRecipeEdit.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButtonRecipeEdit.setInheritsPopupMenu(true);
jButtonRecipeEdit.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jButtonRecipeEdit.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonRecipeEditMouseClicked(evt);
}
});
jToolBarMain.add(jButtonRecipeEdit);
jButtonRecipeSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mampf/images/media-floppy.png"))); // NOI18N
jButtonRecipeSave.setText("Speichern");
jButtonRecipeSave.setToolTipText("Rezept speichern");
jButtonRecipeSave.setFocusable(false);
jButtonRecipeSave.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButtonRecipeSave.setInheritsPopupMenu(true);
jButtonRecipeSave.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jButtonRecipeSave.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonRecipeSaveMouseClicked(evt);
}
});
jToolBarMain.add(jButtonRecipeSave);
jButtonRecipeCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mampf/images/process-stop.png"))); // NOI18N
jButtonRecipeCancel.setText("Abbrechen");
jButtonRecipeCancel.setToolTipText("Abbrechen");
jButtonRecipeCancel.setFocusable(false);
jButtonRecipeCancel.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButtonRecipeCancel.setInheritsPopupMenu(true);
jButtonRecipeCancel.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jButtonRecipeCancel.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonRecipeCancelMouseClicked(evt);
}
});
jToolBarMain.add(jButtonRecipeCancel);
jButtonRecipeDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mampf/images/user-trash.png"))); // NOI18N
jButtonRecipeDelete.setText("Löschen");
jButtonRecipeDelete.setToolTipText("Rezept löschen");
jButtonRecipeDelete.setFocusable(false);
jButtonRecipeDelete.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButtonRecipeDelete.setInheritsPopupMenu(true);
jButtonRecipeDelete.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jButtonRecipeDelete.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonRecipeDeleteMouseClicked(evt);
}
});
jToolBarMain.add(jButtonRecipeDelete);
jButtonRecipePrint.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mampf/images/printer.png"))); // NOI18N
jButtonRecipePrint.setText("Drucken");
jButtonRecipePrint.setToolTipText("Rezept drucken");
jButtonRecipePrint.setFocusable(false);
jButtonRecipePrint.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButtonRecipePrint.setInheritsPopupMenu(true);
jButtonRecipePrint.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jToolBarMain.add(jButtonRecipePrint);
jButtonMampfInfo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mampf/images/help-browser.png"))); // NOI18N
jButtonMampfInfo.setText("Info");
jButtonMampfInfo.setToolTipText("Info");
jButtonMampfInfo.setFocusable(false);
jButtonMampfInfo.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButtonMampfInfo.setInheritsPopupMenu(true);
jButtonMampfInfo.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jButtonMampfInfo.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonMampfInfoMouseClicked(evt);
}
});
jToolBarMain.add(jButtonMampfInfo);
jLabelType.setLabelFor(jTextFieldType);
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("mampf/language"); // NOI18N
jLabelType.setText(bundle.getString("type")); // NOI18N
jLabelType.setFocusable(false);
jLabelType.setRequestFocusEnabled(false);
jLabelType.setVerifyInputWhenFocusTarget(false);
jLabelPreparationType.setLabelFor(jTextFieldPreparationType);
jLabelPreparationType.setText("Zubereitungsart");
jLabelPreparationType.setFocusable(false);
jLabelPreparationType.setRequestFocusEnabled(false);
jLabelPreparationType.setVerifyInputWhenFocusTarget(false);
jTextFieldType.setEditable(false);
jTextFieldPreparationType.setEditable(false);
jButtonSearchType.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mampf/images/system-search.png"))); // NOI18N
jButtonSearchType.setToolTipText("Art suchen");
jButtonSearchType.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonSearchTypeMouseClicked(evt);
}
});
jButtonSearchPreparationType.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mampf/images/system-search.png"))); // NOI18N
jButtonSearchPreparationType.setToolTipText("Zubereitungsart suchen");
jButtonSearchPreparationType.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonSearchPreparationTypeMouseClicked(evt);
}
});
jLabelSubType.setLabelFor(jTextFieldSubType);
jLabelSubType.setText(bundle.getString("subtype")); // NOI18N
jLabelSubType.setFocusable(false);
jLabelSubType.setRequestFocusEnabled(false);
jLabelSubType.setVerifyInputWhenFocusTarget(false);
jLabelRegion.setLabelFor(jTextFieldRegion);
jLabelRegion.setText("Unterart");
jLabelRegion.setFocusable(false);
jLabelRegion.setRequestFocusEnabled(false);
jLabelRegion.setVerifyInputWhenFocusTarget(false);
jTextFieldSubType.setEditable(false);
jTextFieldRegion.setEditable(false);
jButtonSearchSubType.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mampf/images/system-search.png")));
(Klasse wird nicht vollständig angezeigt im Forum)