コード例 #1
0
 private void GraphOpen() {
   graphStart.setEnabled(false);
   graphSetting.getParam();
   tabCom.getParam();
   Param.selectedTabIndex = SettingFrame.getSelectedIndex();
   if (Param.selectedTabIndex == 0) {
   } else if ((Param.selectedTabIndex == 1) && (tabSubGHz.getParam(true) == true)) {
   } else {
     graphStart.setEnabled(true);
     return;
   }
   chart = new ComChart(graphStart);
   chart.pack();
   RefineryUtilities.centerFrameOnScreen(chart);
   chart.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
   chart.setVisible(true);
   chart.addWindowListener(
       new WindowAdapter() {
         public void windowClosing() {
           LazuriteGraph.GraphClose();
         }
       });
 }
コード例 #2
0
  private boolean writeGraphFile(File graphFile) {

    graphSetting.getParam();
    tabCom.getParam();
    tabSubGHz.getParam();

    Properties properties = new Properties();

    properties.setProperty("selectedTab", String.valueOf(SettingFrame.getSelectedIndex()));

    for (int i = 0; i < 4; i++) {
      properties.setProperty("GraphEnb" + String.valueOf(i), Boolean.toString(Param.GraphEnb[i]));
      properties.setProperty("GraphAxisText" + String.valueOf(i), Param.GraphAxisText[i]);
      properties.setProperty("LineNum" + String.valueOf(i), Integer.toString(Param.LineNum[i]));
    }
    properties.setProperty("GraphTitle", Param.GraphTitle);
    properties.setProperty("comBaud", Integer.toString(Param.comBaud));
    if (Param.comPort == null) {
      Param.comPort = "";
    }
    properties.setProperty("comPort", Param.comPort);
    properties.setProperty("subghzBaud", Integer.toString(Param.subghzBaud));
    properties.setProperty("subghzStrTxaddr", Param.subghzStrTxaddr);
    properties.setProperty("subghzPwr", Integer.toString(Param.subghzPwr));
    properties.setProperty("subghzPanid", Param.subghzPanid);
    properties.setProperty("subghzChannel", Integer.toString(Param.subghzChannel));

    try {
      FileOutputStream outputStream = new FileOutputStream(graphFile);
      properties.store(outputStream, "store test"); // 書き込み
      outputStream.close();
    } catch (Exception ex) {
      System.out.println(ex.getMessage());
    }
    return true;
  }