Examples of Mucus


Examples of net.sf.nfp.mini.data.Mucus

  public static Vector loadFromRMS(RecordStore rms) throws RecordStoreNotOpenException, InvalidRecordIDException, RecordStoreException, IOException {
    Vector registry = new Vector(rms.getNumRecords());
    RecordEnumeration enumeration = rms.enumerateRecords(null,null,false);
    while(enumeration.hasNextElement()) {
      int id = enumeration.nextRecordId();
      Mucus mucus = new Mucus();
      ByteArrayInputStream bin = new ByteArrayInputStream(rms.getRecord(id));
      DataInputStream in = new DataInputStream(bin);
      mucus.readFrom(in);
      mucus.setId(id);
      registry.addElement(mucus);
    }
    System.out.println("MucusUtils.loadFromRMS():"+registry);
    return registry;
  }
View Full Code Here

Examples of net.sf.nfp.mini.data.Mucus

  }

  public static Vector createDefaultsVector() {
    Vector registry;
    Mucus[] defaults = new Mucus[]{
        new Mucus(1, Mucus.NONE,"${mucus.none}")
        new Mucus(2, Mucus.POOR,"${mucus.poor}")
        new Mucus(3, Mucus.FINE,"${mucus.fine}")
    };
    registry = new Vector(defaults.length);
    for(int i=0; i<defaults.length;++i)
      registry.addElement(defaults[i]);
    return registry;
View Full Code Here

Examples of net.sf.nfp.mini.data.Mucus

      } catch (Exception e) {
        e.printStackTrace();
        throw new RuntimeException(e.toString());
      }
    }else{
      Mucus mucus = (Mucus) parameter;
      save(mucus);
      refresh();
    }
  }
View Full Code Here

Examples of net.sf.nfp.mini.data.Mucus

  public void setView(Displayable v) {
    this.list = (List) v;
    list.addCommand(new ActionCommand("${edit}", Command.ITEM, 1) {
      public Navigation execute(Displayable d) throws Exception {
        Mucus mucus = (Mucus) registry.elementAt(list
            .getSelectedIndex());
        return new Navigation("edit-mucus", mucus);
      }
    });
    list.addCommand(new ActionCommand("${add}", Command.SCREEN, 2) {
      public Navigation execute(Displayable d) throws Exception {
        return new Navigation("edit-mucus", new Mucus());
      }
    });
    list.addCommand(new ActionCommand("${remove}", Command.ITEM, 3) {
      public Navigation execute(Displayable d) throws Exception {
        Mucus mucus = (Mucus) registry.elementAt(list
            .getSelectedIndex());
        rms.deleteRecord(mucus.getId());
        refresh();
        return null;
      }
    });
    list.addCommand(new ActionCommand("${default}", Command.ITEM, 3) {
View Full Code Here

Examples of net.sf.nfp.mini.data.Mucus

  private void refresh() throws RecordStoreException, IOException {
    Utils.deleteAll(list);
    registry = MucusUtils.loadFromRMS(rms);
    for (int i = 0; i < registry.size(); ++i) {
      Mucus m = (Mucus) registry.elementAt(i);
      System.out.println("mucus=" + i + ": " + m.toString());
      list.append(m.getId() + ": ["
          + MucusEditorView.CATEGORY_NAMES[m.getCategory()] + "] "
          + m.toString(),
          MucusRegistry.instance().getImage(m));
    }
  }
View Full Code Here

Examples of net.sf.nfp.mini.data.Mucus

  }

  private void saveDefaults() throws IOException, RecordStoreException {
    registry = MucusUtils.createDefaultsVector();
    for (int i = 0; i < registry.size(); ++i) {
      Mucus mucus = (Mucus) registry.elementAt(i);
      mucus.setId(0);
      save(mucus);
    }
  }
View Full Code Here

Examples of net.sf.nfp.mini.data.Mucus

    name.setString(mucus.toString());
    categories.setSelectedIndex(mucus.getCategory(), true);
  }

  public Mucus getMucus() {
    return new Mucus(id, (byte)categories.getSelectedIndex(), name.getString());
  }
View Full Code Here

Examples of net.sf.nfp.mini.data.Mucus

  public void refreshMucusList() {
    Log.log("InputView.refreshMucusList()");
    Utils.deleteAll(mucusChoise);
    Vector all = MucusRegistry.instance().getAll();
    for(int i=0;i<all.size();++i) {
      Mucus mucus = (Mucus) all.elementAt(i);
      mucusChoise.append(mucus.toString(), MucusRegistry.instance().getImage(mucus));
    }
  }
View Full Code Here

Examples of net.sf.nfp.mini.data.Mucus

        //#else
        temperature = Utils.parseTemperature(tempString);
        //#endif
      }
    }   
    Mucus mucus = (Mucus) MucusRegistry.instance().getAll().elementAt(mucusChoise.getSelectedIndex())
    return new Observation(dateField.getDate(), temperature, mucus, bleeding, disturbed, "");
  }
View Full Code Here

Examples of net.sf.nfp.mini.data.Mucus

  }
 
  private int getMucusIndex(int mucusId) {
    Vector all = MucusRegistry.instance().getAll();
    for (int i = 0; i < all.size(); i++) {
      Mucus mucus = (Mucus) all.elementAt(i);
      if(mucus.getId() == mucusId)
        return i;
    }
    return -1;
  }
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.