Esempio n. 1
0
  public Element createXML() {
    if (agents.getSelectedIndex() + 1 < agents.getModel().getSize()) {
      Element e = (Element) AgentComboBoxModel.getAgents().get(agents.getSelectedIndex());
      Vector settings = new Vector();
      // Eigenschaften ab 7 werden als Settings fürs Tool ausgelesen (EXIF-Tags) :)
      // ist keines gesetzt, so wird der Vector wieder auf null gesetzt :)
      boolean atLeastOneSettingDefined = false;
      Iterator itVals = ctm.getValues().iterator();
      int tempCount = 0;
      for (Object o : ctm.getKeys()) {
        String tempKey = (String) o;
        String tempVal = (String) itVals.next();
        if (tempVal.length() > 0
            && tempCount > 5) { // Wenn Wert da und wenns keiner der ersten 6 std werte is
          settings.add(tempKey + "=" + tempVal);
          atLeastOneSettingDefined = true;
        }
        tempCount++;
      }
      if (!atLeastOneSettingDefined) settings = null;
      String time = null;
      if (datatable.getValueAt(0, 1).toString().length() > 0)
        time = datatable.getValueAt(0, 1).toString();

      String tool = null;
      int count = 0;
      for (Object o1 : ctm.getKeys()) {
        String s = (String) o1;
        if (s.equals("Make")) {
          if (tool == null) tool = new String();
          tool = ctm.getValues().get(count) + " " + tool;
        }
        if (s.equals("Model")) {
          if (tool == null) tool = new String();
          tool = tool + ctm.getValues().get(count);
        }
        count++;
      }
      Mpeg7CreationInformation m7ci = new Mpeg7CreationInformation(e, tool, settings, time);
      // Getting data ....
      String bits = null, fformat = null, fsize = null, ih = null, iw = null;
      if (datatable.getValueAt(1, 1).toString().length() > 0)
        fformat = datatable.getValueAt(1, 1).toString();
      if (datatable.getValueAt(2, 1).toString().length() > 0)
        fsize = datatable.getValueAt(2, 1).toString();
      if (datatable.getValueAt(4, 1).toString().length() > 0)
        ih = datatable.getValueAt(4, 1).toString();
      if (datatable.getValueAt(3, 1).toString().length() > 0)
        iw = datatable.getValueAt(3, 1).toString();
      if (datatable.getValueAt(5, 1).toString().length() > 0)
        bits = datatable.getValueAt(5, 1).toString();
      Mpeg7MediaFormat m7mf = new Mpeg7MediaFormat(bits, fformat, fsize, ih, iw);
      Element mediaFormat = m7mf.createDocument();
      Element ret = new Element("return", mediaFormat.getNamespace()).addContent(mediaFormat);
      ret.addContent(m7ci.createDocument().detach());
      return ret;
    } else {
      return null;
    }
  }
Esempio n. 2
0
 public void updateTable() {
   ctm.fireTableDataChanged();
 }
Esempio n. 3
0
 public void resetTable() {
   ctm.resetValues();
 }
Esempio n. 4
0
 public void addKeyValuePair(String key, String value) {
   ctm.addKeyValuePair(key, value);
 }