Examples of Plants


Examples of net.sf.cannagrower.data.event.Plants

    jPopupMenuVarietiesAdd.show(jButtonAdd, 0, 0);
  }

  protected void doRemove(){
    int   variety=getJTablePlants().getSelectedRow();
    Plants   plants=(Plants)this.getEvent();
    if(variety<0){return;}
    plants.setPlants(plants.getVarieties().get(variety), 0);
  }
View Full Code Here

Examples of net.sf.cannagrower.data.event.Plants

      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();}
                  catch(ClassNotFoundException ex){Messages.showException(ex);variety=null;}
                  catch(IOException ex){Messages.showException(ex);variety=null;}
                 
                  if(variety.toString().equals(jMenuItem.getName())){
                    Plants plants=(Plants)panel.getEvent();
                    plants.setPlants(variety,1);
                    // Refresh
                    panel.setEvent(panel.getEvent());
                  }
                }
              }
View Full Code Here
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.