Пример #1
0
  public String createCodeGRS() {
    Vector<GRObject> child = grpage.getListChild(nameXml);

    if (child == null) return "";

    StringBuffer buff = new StringBuffer();
    int y1 = this.y1Original;

    if (section == GRObject.SECTION_BODY) y1 = y1 - grpage.getHeaderSize();

    buff.append("<list>\n");
    buff.append("<id>" + nameXml + "</id>\n");
    buff.append("<top>" + GRLibrary.fromPixelsToMillimeters(y1) + "</top>\n");
    buff.append("<height>" + GRLibrary.fromPixelsToMillimeters(heightOriginal) + "</height>\n");
    buff.append("<hposition>");
    if (hPosition) buff.append("relative");
    else buff.append("absolute");
    buff.append("</hposition>\n");

    buff.append("<row>\n");

    for (int i = 0; i < child.size(); i++) buff.append(child.get(i).createCodeGRS() + "\n");

    buff.append("</row>\n");

    buff.append("</list>");

    return buff.toString();
  }
Пример #2
0
  public static String lineOctToASCII(String value) {
    StringBuffer buffer = new StringBuffer();

    for (int i = 0; i < value.length(); i++) {

      if (value.codePointAt(i) == 92) {
        buffer.append(GRLibrary.fromOctToASCII(value.substring((i + 1), (i + 4))));
        i = i + 3;
      } else {
        buffer.append(value.charAt(i));
      }
    }
    return buffer.toString();
  }
Пример #3
0
  public static String lineASCIIToOct(String value) {

    StringBuffer buffer = new StringBuffer();
    boolean parentesiGraffa = false;

    for (int i = 0; i < value.length(); i++) {
      if (value.codePointAt(i) == 123) {
        parentesiGraffa = true;
      }

      if (parentesiGraffa) {
        buffer.append(value.substring(i, (i + 1)));
      } else {
        buffer.append(GRLibrary.fromASCIIToOct(value.codePointAt(i)));
      }

      if (value.codePointAt(i) == 125) {
        parentesiGraffa = false;
      }
    }

    return buffer.toString();
  }