Examples of ProgressStatusEvent


Examples of games.stendhal.server.events.ProgressStatusEvent

   *
   * @param player Player to sent the event to
   */
  private void sendProgressTypes(Player player) {
    List<String> list = Arrays.asList("Open Quests", "Completed Quests", "Production");
    player.addEvent(new ProgressStatusEvent(list));
  }
View Full Code Here

Examples of games.stendhal.server.events.ProgressStatusEvent

   * @param player Player to sent the event to
   * @param progressType the type of progress the player is interested in
   */
  private void sendItemList(Player player, String progressType) {
    if (progressType.equals("Open Quests")) {
      player.addEvent(new ProgressStatusEvent(progressType,
        SingletonRepository.getStendhalQuestSystem().getOpenQuests(player)));
    } else if (progressType.equals("Completed Quests")) {
      player.addEvent(new ProgressStatusEvent(progressType,
        SingletonRepository.getStendhalQuestSystem().getCompletedQuests(player)));
    } else if (progressType.equals("Production")) {
      player.addEvent(new ProgressStatusEvent(progressType,
          SingletonRepository.getProducerRegister().getWorkingProducerNames(player)));
    }
  }
View Full Code Here

Examples of games.stendhal.server.events.ProgressStatusEvent

   * @param item name of item to get details about
   */
  private void sendDetails(Player player, String progressType, String item) {
    StendhalQuestSystem questSystem = SingletonRepository.getStendhalQuestSystem();
    if (progressType.equals("Open Quests") || progressType.equals("Completed Quests")) {
      player.addEvent(new ProgressStatusEvent(progressType, item,
        questSystem.getQuestDescription(player, item),
        questSystem.getQuestProgressDetails(player, item)));
    } else if (progressType.equals("Production")) {
      player.addEvent(new ProgressStatusEvent(progressType, item,
          SingletonRepository.getProducerRegister().getProductionDescription(player, item),
          SingletonRepository.getProducerRegister().getProductionDetails(player, item)));
    }
  }
View Full Code Here

Examples of org.glassfish.api.admin.progress.ProgressStatusEvent

            } else if (CommandProgress.EVENT_PROGRESSSTATUS_CHANGE.equals(name)) {
                if (commandProgress == null) {
                    logger.log(Level.WARNING, strings.get("progressstatus.event.applyerror", "Inapplicable progress status event"));
                    return;
                }
                ProgressStatusEvent pse = event.getData(ProgressStatusEvent.class, MediaType.APPLICATION_JSON_TYPE);
                client.mirror(pse);
            }
        } catch (IOException ex) {
            logger.log(Level.SEVERE, strings.get("progressstatus.event.parseerror", "Can not parse progress status event"), ex);
        }
View Full Code Here

Examples of org.glassfish.api.admin.progress.ProgressStatusEvent

            } else if (CommandProgress.EVENT_PROGRESSSTATUS_CHANGE.equals(name)) {
                if (commandProgress == null) {
                    logger.log(Level.WARNING, strings.get("progressstatus.event.applyerror", "Inapplicable progress status event"));
                    return;
                }
                ProgressStatusEvent pse = event.getData(ProgressStatusEvent.class, CONTENT_TYPE);
                client.mirror(pse);
            }
        } catch (IOException ex) {
            logger.log(Level.SEVERE, strings.get("progressstatus.event.parseerror", "Can not parse progress status event"), ex);
        }
View Full Code Here

Examples of org.glassfish.api.admin.progress.ProgressStatusEvent

                }
            } else if ("progress-status".equals(fieldname)) {
                source = ProgressStatusDTOJsonProprietaryReader.readProgressStatus(jp);
            }
        }
        return new ProgressStatusEvent(source, parentId, message, spinner, allocatedSteps, changed.toArray(new Changed[changed.size()]));
    }
View Full Code Here

Examples of org.glassfish.api.admin.progress.ProgressStatusEvent

    }
   
    public static ProgressStatusEvent readProgressStatusEvent(JsonParser jp) throws IOException {
        String id = null;
        JsonToken token = null;
        ProgressStatusEvent result = null;
        while ((token = jp.nextToken()) != JsonToken.END_OBJECT) {
            if (token == JsonToken.START_OBJECT) {
                String nm = jp.getCurrentName();
                if ("set".equals(nm)) {
                    result = new ProgressStatusEventSet(id);
View Full Code Here

Examples of org.glassfish.api.admin.progress.ProgressStatusEvent

            } else if (CommandProgress.EVENT_PROGRESSSTATUS_CHANGE.equals(name)) {
                if (commandProgress == null) {
                    logger.log(Level.WARNING, strings.get("progressstatus.event.applyerror", "Inapplicable progress status event"));
                    return;
                }
                ProgressStatusEvent pse = event.getData(ProgressStatusEvent.class, MediaType.APPLICATION_JSON_TYPE);
                client.mirror(pse);
            }
        } catch (IOException ex) {
            logger.log(Level.SEVERE, strings.get("progressstatus.event.parseerror", "Can not parse progress status event"), ex);
        }
View Full Code Here

Examples of org.glassfish.api.admin.progress.ProgressStatusEvent

                }
            } else if ("progress-status".equals(fieldname)) {
                source = ProgressStatusDTOJsonReader.readProgressStatus(jp);
            }
        }
        return new ProgressStatusEvent(source, parentId, message, spinner, allocatedSteps, changed.toArray(new Changed[changed.size()]));
    }
View Full Code Here

Examples of org.glassfish.api.admin.progress.ProgressStatusEvent

    public synchronized ProgressStatusMirroringImpl createMirroringChild(int allocatedSteps) {
        allocateStapsForChildProcess(allocatedSteps);
        String childId = (id == null ? "" : id) + "." + (children.size() + 1);
        ProgressStatusMirroringImpl result = new ProgressStatusMirroringImpl(null, this, childId);
        children.add(new ChildProgressStatus(allocatedSteps, result));
        fireEvent(new ProgressStatusEvent(result, allocatedSteps));
        return result;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.