Esempio n. 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);
  }
Esempio n. 2
0
  private void processKiosk() {
    String k = config.getString("kiosk");
    if (k == null) k = "false";
    final int x = StringUtils.stringToInt(config.getString("kioskX"), -1);
    final int y = StringUtils.stringToInt(config.getString("kioskY"), -1);

    final boolean kiosk = Boolean.parseBoolean(k);
    if (kiosk && x != -1 && y != -1) {
      applicationFrame.setLocation(x, y);
    }
    Swarm.getApplication().setFullScreenMode(kiosk);
  }
Esempio n. 3
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;
  }