Beispiel #1
0
  @Override
  public void configure(final ConfigFile cf) {
    super.configure(cf);
    if (cf == null) return;

    tLessThan = StringUtils.stringToDouble(cf.getString("past"), Double.NaN);
    tGreaterThan = StringUtils.stringToDouble(cf.getString("future"), Double.NaN);
  }
Beispiel #2
0
  @Override
  public boolean allowOK(boolean edit) {
    String host = wwsHost.getText();
    String message = null;

    if (host == null || host.length() == 0 || host.indexOf(';') != -1 || host.indexOf(':') != -1)
      message = "There is an error with the WWS IP address or host name.";

    int ip = StringUtils.stringToInt(wwsPort.getText(), -1);
    if (ip < 0 || ip > 65535) message = "There is an error with the WWS port.";

    double to = StringUtils.stringToDouble(wwsTimeout.getText(), -1);
    if (to <= 0) message = "There is an error with the WWS time out (must be > 0).";

    if (message != null) {
      JOptionPane.showMessageDialog(applicationFrame, message, "Error", JOptionPane.ERROR_MESSAGE);
      return false;
    } else return true;
  }