コード例 #1
0
ファイル: GrowBar.java プロジェクト: jordibrus/proview
  public void open(BufferedReader reader) {
    String line;
    StringTokenizer token;
    boolean end_found = false;

    try {
      while ((line = reader.readLine()) != null) {
        token = new StringTokenizer(line);
        int key = Integer.valueOf(token.nextToken());
        if (cmn.debug) System.out.println("GrowBar : " + line);

        switch (key) {
          case Glow.eSave_GrowBar:
            break;
          case Glow.eSave_GrowBar_max_value:
            max_value = new Double(token.nextToken()).doubleValue();
            break;
          case Glow.eSave_GrowBar_min_value:
            min_value = new Double(token.nextToken()).doubleValue();
            break;
          case Glow.eSave_GrowBar_bar_value:
            bar_value = new Double(token.nextToken()).doubleValue();
            break;
          case Glow.eSave_GrowBar_bar_bordercolor:
            bar_bordercolor = Integer.valueOf(token.nextToken());
            break;
          case Glow.eSave_GrowBar_bar_borderwidth:
            bar_borderwidth = Integer.valueOf(token.nextToken());
            break;
          case Glow.eSave_GrowBar_bar_drawtype:
            bar_drawtype = Integer.valueOf(token.nextToken());
            break;
          case Glow.eSave_GrowBar_rect_part:
            super.open(reader);
            break;
          case Glow.eSave_GrowBar_trace_data1:
            if (token.hasMoreTokens()) trace.data[0] = token.nextToken();
            break;
          case Glow.eSave_GrowBar_trace_data2:
            if (token.hasMoreTokens()) trace.data[1] = token.nextToken();
            break;
          case Glow.eSave_GrowBar_trace_data3:
            if (token.hasMoreTokens()) trace.data[2] = token.nextToken();
            break;
          case Glow.eSave_GrowBar_trace_data4:
            if (token.hasMoreTokens()) trace.data[3] = token.nextToken();
            break;
          case Glow.eSave_GrowBar_trace_data5:
            if (token.hasMoreTokens()) trace.data[4] = token.nextToken();
            break;
          case Glow.eSave_GrowBar_trace_data6:
            if (token.hasMoreTokens()) trace.data[5] = token.nextToken();
            break;
          case Glow.eSave_GrowBar_trace_data7:
            if (token.hasMoreTokens()) trace.data[6] = token.nextToken();
            break;
          case Glow.eSave_GrowBar_trace_data8:
            if (token.hasMoreTokens()) trace.data[7] = token.nextToken();
            break;
          case Glow.eSave_GrowBar_trace_data9:
            if (token.hasMoreTokens()) trace.data[8] = token.nextToken();
            break;
          case Glow.eSave_GrowBar_trace_data10:
            if (token.hasMoreTokens()) trace.data[9] = token.nextToken();
            break;
          case Glow.eSave_GrowBar_trace_attr_type:
            trace.attr_type = Integer.valueOf(token.nextToken());
            break;
          case Glow.eSave_GrowBar_trace_color:
            trace.color = Integer.valueOf(token.nextToken());
            break;
          case Glow.eSave_GrowBar_access:
            trace.access = Integer.valueOf(token.nextToken());
            break;
          case Glow.eSave_GrowBar_cycle:
            trace.cycle = Integer.valueOf(token.nextToken());
            break;
          case Glow.eSave_GrowBar_ref_object:
            if (token.hasMoreTokens()) trace.ref_object = token.nextToken();
            break;
          case Glow.eSave_GrowBar_userdata_cb:
            if (cmn.appl != null)
              userdata = cmn.appl.growUserdataOpen(reader, this, Glow.eUserdataCbType_Node);
            break;

          case Glow.eSave_End:
            end_found = true;
            break;
          default:
            System.out.println("Syntax error in GrowBar");
            break;
        }
        if (end_found) break;
      }

    } catch (Exception e) {
      System.out.println("IOException GrowBar");
    }
  }
コード例 #2
0
ファイル: GrowAxis.java プロジェクト: jordibrus/proview
  public void open(BufferedReader reader) {
    String line;
    StringTokenizer token;
    boolean end_found = false;

    try {
      while ((line = reader.readLine()) != null) {
        token = new StringTokenizer(line);
        int key = Integer.valueOf(token.nextToken());
        if (cmn.debug) System.out.println("GrowAxis : " + line);

        switch (key) {
          case Glow.eSave_GrowAxis:
            break;
          case Glow.eSave_GrowAxis_text_size:
            text_size = Integer.valueOf(token.nextToken());
            break;
          case Glow.eSave_GrowAxis_text_drawtype:
            text_drawtype = Integer.valueOf(token.nextToken());
            break;
          case Glow.eSave_GrowAxis_text_color_drawtype:
            text_color_drawtype = Integer.valueOf(token.nextToken());
            break;
          case Glow.eSave_GrowAxis_max_value:
            max_value = new Double(token.nextToken()).doubleValue();
            break;
          case Glow.eSave_GrowAxis_min_value:
            min_value = new Double(token.nextToken()).doubleValue();
            break;
          case Glow.eSave_GrowAxis_lines:
            lines = Integer.valueOf(token.nextToken());
            break;
          case Glow.eSave_GrowAxis_longquotient:
            longquotient = Integer.valueOf(token.nextToken());
            break;
          case Glow.eSave_GrowAxis_valuequotient:
            valuequotient = Integer.valueOf(token.nextToken());
            break;
          case Glow.eSave_GrowAxis_format:
            if (token.hasMoreTokens()) format = token.nextToken();
            break;
          case Glow.eSave_GrowAxis_rect_part:
            super.open(reader);
            break;
          case Glow.eSave_GrowAxis_userdata_cb:
            if (cmn.appl != null)
              userdata = cmn.appl.growUserdataOpen(reader, this, Glow.eUserdataCbType_Node);
            break;
          case Glow.eSave_End:
            end_found = true;
            break;
          default:
            System.out.println("Syntax error in GrowAxis");
            break;
        }
        if (end_found) break;
      }

      configure();
      if (format != null) cFormat = new GlowCFormat(format);

    } catch (Exception e) {
      System.out.println("IOException GrowAxis");
    }
  }