コード例 #1
0
  /*
   * (non-Javadoc)
   *
   * @see org.dxf2svg.parser.SectionHandler#parseGroup(int, java.lang.String)
   */
  public void parseGroup(int groupCode, DXFValue value) {
    if (groupCode == TABLE_CODE) {
      // switch table
      if (TABLE_END.equals(value)) {
        table = "";

        if (parse) {
          handler.endParsing();
          parse = false;
        }
      } else if (TABLE_START.equals(value)) {
      } else {
        if (parse) {
          handler.endParsing();
        }

        table = value.getValue();

        if (handlers.containsKey(table)) {
          handler = (DXFTableHandler) handlers.get(table);
          handler.setDXFDocument(this.doc);
          handler.startParsing();
          parse = true;
        } else {
          parse = false;
        }
      }
    } else {
      if (parse) {
        handler.parseGroup(groupCode, value);
      }
    }
  }
コード例 #2
0
 public void addDXFTableHandler(DXFTableHandler handler) {
   handlers.put(handler.getTableKey(), handler);
 }