* This method initializes this
*
* @return void
*/
private void initialize() {
ContainerVector varietiesAvaible = Resources.getResources().getVarieties();
java.util.Iterator<Container> iterator=varietiesAvaible.iterator();
while(iterator.hasNext()){
Container ghost=(Container)iterator.next();
Variety variety;
try{variety=(Variety)ghost.getData();}
catch(ClassNotFoundException e){Messages.showException(e);variety=null;}
catch(IOException e){Messages.showException(e);variety=null;}
// Checking if variety type is added.
Plants plants=(Plants)panel.getEvent();
if (!plants.getVarieties().contains(variety)) {
// Adding jMenu
JMenuItem jMenuItem = new JMenuItem();
jMenuItem.setText(variety.getName());
jMenuItem.setName(variety.toString());
jMenuItem
.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(
java.awt.event.ActionEvent e) {
JMenuItem jMenuItem = (JMenuItem) e.getSource();
ContainerVector varietiesAvaible = Resources.getResources().getVarieties();
java.util.Iterator<Container> iterator=varietiesAvaible.iterator();
while(iterator.hasNext()){
Container ghost=(Container)iterator.next();
Variety variety;
try{variety=(Variety)ghost.getData();}