Package gui

Examples of gui.GUIManager


      nManag = new DOPTNetworkManager(peerIndex);
    if (Main.algorithm.equals(JUPITER_ALGO))
      nManag = new JupiterNetworkManager(peerIndex);

    /* Start and show the gui */
    GUIManager gui = new GUIManager(nManag, peerIndex);
    nManag.connectToGUI(gui);
    nManag.start();

    gui.showGUI();


    /* Check if the test driver needs to run */
    if (args.length > 1 && args[1].equals("test")) {

View Full Code Here


  public static final String COMMAND_INS = "ins";
  public static final String COMMAND_DEL = "del";


  public static void test(int peerIndex, NetworkManager nm) {
    GUIManager gui = nm.getGUI();

    try {
      BufferedReader buff = new BufferedReader(new FileReader(COMMAND_FILE + peerIndex));

      while(true) {
        String command = buff.readLine();
        System.out.println("["+ Thread.currentThread().getId() + "]" + " Command " + command);
        if (command == null)
          break;

        synchronized (JupiterNetworkManager.lock) {
          if (command.substring(0, 3).equals(COMMAND_INS))
            gui.insertCharInDoc(Integer.parseInt(command.substring(8, 9)) - 1, command.charAt(5));
          if (command.substring(0, 3).equals(COMMAND_DEL))
            gui.deleteCharFromDoc(Integer.parseInt(command.substring(4, 5)) - 1);
        }

        /* Wait before executing next task */
        Thread.sleep(randomWithRange(1, 5) * 100);
      }
 
View Full Code Here

TOP

Related Classes of gui.GUIManager

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.