Package net.sf.orexio.lopf.container

Examples of net.sf.orexio.lopf.container.Container


      jListAdresss
          .addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent e) {
              if(jListAdresss.getSelectedIndex()==-1){return;}
              Address   address=null;
              Container   container=(Container)jListAdresss.getSelectedValue();
              try{address=(Address)container.getData();}
              catch(IOException ex){ex.printStackTrace();}
              catch(ClassNotFoundException ex){ex.printStackTrace();}
              if(address!=null){
                propertiesTable.setProperties(address.getProperties());
              }
View Full Code Here


   
    // Retrieve selected element
    if (jList.getSelectedIndex() >= 0
        && jList.getSelectedIndex() < jList
            .getModel().getSize()){
      Container container=(Container)jList.getSelectedValue();
      try{
        data=container.getData();
      }catch(IOException e){
        Messages.showException(e);
      }catch(ClassNotFoundException e){
        Messages.showException(e);
      }
View Full Code Here

 
  private void elementRemove(){
    if (!jList.isSelectionEmpty()) {
      try {
        for (Object containerObject : jList.getSelectedValues()) {
          Container container= (Container) containerObject;
          try{vector.remove(container);}
          catch(java.io.IOException e){Messages.showException(e);}
          catch(ClassNotFoundException e){Messages.showException(e);}
        }
      } catch (ArrayIndexOutOfBoundsException e) {
View Full Code Here

      Object value,            // value to display
      int index,               // cell index
      boolean isSelected,      // is the cell selected
      boolean cellHasFocus)    // does the cell have focus
    {
      Container    container=(Container)value;
   
      setText(container.toString());
     
      try{setIcon(Event.getIcon(Class.forName(container.getType())));}
      catch(ClassNotFoundException e){}
       
        if (isSelected) {
            setBackground(list.getSelectionBackground());
            setForeground(list.getSelectionForeground());
View Full Code Here

  public Object getElementAt(int index) {
    return events.get(index);
  }

  public Event getDataAt(int index){
    Container   container=events.get(index);
    Event    event=null;
   
    try{
      event=(Event)container.getData();
    }catch(ClassNotFoundException e){
      Messages.showException(e);
    }catch(java.io.IOException e){
      Messages.showException(e);
    }
View Full Code Here

    }
  }
 
  private void plantationsShow(){
    if (jPanelPlantationsViewer != null) {
      Container   container=(Container)jComboBoxPlantations.getSelectedItem();
      Plantation   plantation;
     
      if(container!=null){
        try{
          plantation=(Plantation)container.getData();
        }catch(IOException e){
          Messages.showException(e);
          return;
        }catch(ClassNotFoundException e){
          Messages.showException(e);
          return;
        }
       
        if(jPanelPlantationsViewer.getPlantation().equals(plantation)){
          return;
        }
      }
     
      jPanelPlantationsViewer.setVisible(false);
      jPanelPlantationsDetails.remove(jPanelPlantationsViewer);
      Data.removeDataListener(jPanelPlantationsViewer);
      jPanelPlantationsViewer = null;
    }
    if (jComboBoxPlantations.getModel().getSize() > 0 && jComboBoxPlantations.getSelectedItem()!=null) {
      Plantation plantation;
     
     
      Container container;
      container=(Container)jComboBoxPlantations.getSelectedItem();
      try{
        plantation=(Plantation)container.getData();
      }catch(IOException e){
        Messages.showException(e);
        return;
      }catch(ClassNotFoundException e){
        Messages.showException(e);
View Full Code Here

  public Object getElementAt(int index) {
    Object object = null;
    try{
      if (!showInstalledOnly) {
        Container container=cultureViewer.culture.getHardwares().get(index);
        object = container.getData();
      } else {
        int rank = 0;
        for (Container container : cultureViewer.culture.getHardwares()) {
          Hardware hardware;
          hardware=(Hardware)container.getData();
          if(hardware!=null){
            if (rank == index) {
              object = hardware;
            }
            if (hardware.isInstalled()) {
View Full Code Here

   */
  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();}
                  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();
View Full Code Here

TOP

Related Classes of net.sf.orexio.lopf.container.Container

Copyright © 2018 www.massapicom. 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.