コード例 #1
0
  private Locale getLocale() {

    java.util.List result = new java.util.ArrayList();
    String language = "";
    String country = "";
    String variant = "";

    // -----------------------------------------------------------------
    // <locale language="en" country="GB" variant="J" />
    // -----------------------------------------------------------------
    result = PM_XML_Utils.getElementListe(document, "//" + TAG_LOCALE);
    if (result.size() == 1) {
      Element el = (Element) result.get(0);
      language = PM_XML_Utils.getAttribute(el, ATTR_LOCALE_LANGUAGE);
      country = PM_XML_Utils.getAttribute(el, ATTR_LOCALE_COUNTRY);
      variant = PM_XML_Utils.getAttribute(el, ATTR_LOCALE_VARIANT);
    }

    if (language.length() == 0) {
      return null;
    }
    // if (country.length() == 0) {
    // return new Locale(language);
    // }
    // if (variant.length() == 0) {
    // return new Locale(language, country);
    // }

    return new Locale(language, country, variant);
  }
コード例 #2
0
  private void setMpeg() {
    java.util.List result = new java.util.ArrayList();

    // -----------------------------------------------------------------
    // <diashow>
    // -----------------------------------------------------------------
    result = PM_XML_Utils.getElementListe(document, "//" + TAG_VDR);
    if (result.size() == 1) {
      // support vdr (make for example mpeg files)
      mpeg = true;
    }
  }
コード例 #3
0
  // =====================================================
  // private: setPreftch()
  //
  // <prefetch plus="2" minus="0"/>
  //
  // =====================================================
  private void setPrefetch() {
    java.util.List result = new java.util.ArrayList();

    // -----------------------------------------------------------------
    // <datum>
    // -----------------------------------------------------------------
    result = PM_XML_Utils.getElementListe(document, "//" + TAG_PREFETCH);
    if (result.size() == 1) {
      Element elPrefetch = (Element) result.get(0);
      prefetchPlus = PM_XML_Utils.getAttributeInt(elPrefetch, ATTR_PREFETCH_PLUS);
      prefetchMinus = PM_XML_Utils.getAttributeInt(elPrefetch, ATTR_PREFETCH_MINUS);
    }
  }
コード例 #4
0
  // =====================================================
  // private: setDatumJahrVonBis()
  //
  // <datum jahr-von="1998" jahr-bis="2007"/>
  //
  // =====================================================
  private void setDateFromTo() {
    java.util.List result = new java.util.ArrayList();

    // -----------------------------------------------------------------
    // <datum>
    // -----------------------------------------------------------------
    result = PM_XML_Utils.getElementListe(document, "//" + TAG_DATUM);
    if (result.size() == 1) {
      Element elDatum = (Element) result.get(0);
      datumJahrVon = PM_XML_Utils.getAttributeInt(elDatum, ATTR_DATUM_JAHR_VON);
      datumJahrBis = PM_XML_Utils.getAttributeInt(elDatum, ATTR_DATUM_JAHR_BIS);
    }
  }
コード例 #5
0
  private void setSlideshow() {
    java.util.List result = new java.util.ArrayList();

    // -----------------------------------------------------------------
    // <diashow>
    // -----------------------------------------------------------------
    result = PM_XML_Utils.getElementListe(document, "//" + TAG_DIASHOW);
    if (result.size() == 1) {
      Element el = (Element) result.get(0);
      slideshowText1 = PM_XML_Utils.getAttribute(el, ATTR_DIASHOW_TEXT1);
      slideshowText2 = PM_XML_Utils.getAttribute(el, ATTR_DIASHOW_TEXT2);
      slideshowText3 = PM_XML_Utils.getAttribute(el, ATTR_DIASHOW_TEXT3);
    }
  }
コード例 #6
0
  private File getHomeFile() {

    File home = null;
    java.util.List result = new java.util.ArrayList();
    String value = null;

    // -----------------------------------------------------------------
    // <bilder>
    // -----------------------------------------------------------------
    result = PM_XML_Utils.getElementListe(document, "//" + TAG_HOME + "/" + TAG_BILDER);
    if (result.size() == 1) {
      value = ((Element) result.get(0)).getTextTrim();
      value = PM_Utils.removeLastSeparatorChar(value);
      home = new File(value);
      if (!home.isDirectory()) {
        home = null;
      }
    }
    return home;
  }