Package com.svanloon.game.wizard.human.dialog

Examples of com.svanloon.game.wizard.human.dialog.PromptDialog


    return -1;
  }

  private String getIp() {
    UserPreferences up = new UserPreferencesManager().load();
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.ip), LanguageFactory.getInstance().getString(MessageId.whatIpDoYouWantToConnectTo), up.getIp(), false, 0, 255, -1);

    Point location = new Point(0,0);
    Dimension size = new Dimension(900,720);
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));

    dialog.prompt();
    String ip = dialog.getValue();
    up.setIp(ip);
    new UserPreferencesManager().persist(up);
    return ip;
  }
View Full Code Here


    return ip;
  }

  private String getName() {
    UserPreferences up = new UserPreferencesManager().load();
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.name), LanguageFactory.getInstance().getString(MessageId.whatsYourName), up.getName(), false, 0, 255, -1);
    Point location = new Point(0,0);
    Dimension size = new Dimension(900,720);
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));
    dialog.prompt();
    String name = dialog.getValue();
    up.setName(name);
    new UserPreferencesManager().persist(up);
    return name;
  }
View Full Code Here

  public int bid(Card trump, int min, int max, int notAllowedToBid) {
    String suffix = "";
    if(notAllowedToBid > -1) {
      suffix = " (not allowed to bid " + notAllowedToBid + ") ";
    }
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.xsBid, "playerName", getName()), LanguageFactory.getInstance().getString(MessageId.whatDoYouWantToBid) + suffix, "", true, 0, round, notAllowedToBid);
    Point location = jFrame.getLocation();
    Dimension size = jFrame.getSize();
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));
    dialog.prompt();
    int bid = dialog.getIntValue();
    return bid;
  }
View Full Code Here

    this.numberOfPlayers = Integer.valueOf(numberOfPlayers);
  }

  private int getNumberOfPlayers() {
    if(numberOfPlayers == null) {
      PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.players), LanguageFactory.getInstance().getString(MessageId.howManyHumanPlayersDoYouWant), "", true, -1, 4, -2);
      Point location = new Point(0,0);
      Dimension size = new Dimension(900,720);
      Dimension dialogSize = dialog.getSize();
      dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));
      dialog.prompt();
      return dialog.getIntValue();
    }

    return numberOfPlayers.intValue();
  }
View Full Code Here

    return player;
  }

  private String getLocalName() {
    UserPreferences up = new UserPreferencesManager().load();
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.name), LanguageFactory.getInstance().getString(MessageId.whatsYourName), up.getName(), false, 0, 255, -1);
    Point location = new Point(0,0);
    Dimension size = new Dimension(900,720);
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));
    dialog.prompt();
    String name = dialog.getValue();
    up.setName(name);
    new UserPreferencesManager().persist(up);
    return name;
  }
View Full Code Here

    }
    return -1;
  }

  private String getIp() {
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.ip), LanguageFactory.getInstance().getString(MessageId.whatIpDoYouWantToConnectTo), up.getIp(), false, 0, 255, -1);

    Point location = new Point(0,0);
    Dimension size = new Dimension(900,720);
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));

    dialog.prompt();
    String ip = dialog.getValue();
    up.setIp(ip);
    new UserPreferencesManager().persist(up);
    return ip;
  }
View Full Code Here

    new UserPreferencesManager().persist(up);
    return ip;
  }

  private String getName() {
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.name), LanguageFactory.getInstance().getString(MessageId.whatsYourName), up.getName(), false, 0, 255, -1);
    Point location = new Point(0,0);
    Dimension size = new Dimension(900,720);
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));
    dialog.prompt();
    String name = dialog.getValue();
    up.setName(name);
    new UserPreferencesManager().persist(up);
    return name;
  }
View Full Code Here

TOP

Related Classes of com.svanloon.game.wizard.human.dialog.PromptDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.