예제 #1
0
 private SettingConfig generateSetting() {
   SettingConfig s = new SettingConfig();
   s.dir = TEXT_dir.getText();
   s.logBuffer = SizeType.get((String) SELECT_logBuffer.getSelectedItem()).getSize();
   try {
     s.delay = Integer.parseInt((String) SELECT_delay.getSelectedItem());
     if (s.delay < 100) s.delay = 100;
   } catch (Exception e) {
   }
   s.seek = CHK_seek.isSelected();
   if (s.seek) {
     try {
       s.seekType = SeekType.get((String) SELECT_seekType.getSelectedItem());
     } catch (Exception e) {
     }
     try {
       s.seekPos = Long.parseLong(TEXT_seekPos.getText());
     } catch (Exception e) {
     }
   }
   s.charset = CharsetType.get((String) SELECT_charset.getSelectedItem());
   try {
     s.overflowNum = Integer.parseInt(TEXT_limit.getText());
   } catch (Exception e) {
   }
   s.showLineNumber = CHK_showLineNumber.isSelected();
   s.softWrap = CHK_softWrap.isSelected();
   return s;
 }
예제 #2
0
 private void generateSeekInfo() {
   String seekTypeStr = (String) SELECT_seekType.getSelectedItem();
   SeekType seekType = SeekType.get(seekTypeStr);
   long pos = 0;
   try {
     pos = Long.parseLong(TEXT_seekPos.getText());
   } catch (Exception e) {
   }
   String info =
       "Print From "
           + (seekType.isSeekHead() ? "HEAD" : "TAIL")
           + " by "
           + (seekType.isSeekLine() ? "Lines" : "Pos")
           + " at "
           + (seekType.isSeekLine() ? "Line" : "Pos")
           + " "
           + pos;
   LABEL_seek.setText(info);
 }