@Override
  public void initialize(Context<String, Integer> context) {
    super.initialize(context);

    IMap<Integer, State> states = hazelcastInstance.getMap("states");
    for (State s : states.values()) {
      String abbreviation = s.getAbbreviation();
      String name = s.getName();
      abbreviationMapping.put(abbreviation, name);
    }
  }
  protected void paintComponent(Graphics g) {
    super.paintComponent(g);
    resourceLabel.update(state);

    Graphics2D g2 = (Graphics2D) g;

    for (Planet planet : state.getPlanets()) {
      new PlanetRenderer(planet).draw(g2);
    }
  }
 private void areAllStatesReachable() {
   areNbInitialFinalStatesValid();
   if (validationInput != null) {
     validationInput.reach();
   }
   for (State s : Diagram.getInstance().getAllStates()) {
     if (!s.isReach()) {
       this.addError(new DiagramError("State unreachable : " + s.toString()));
       isValid = false;
     }
   }
   for (State s : Diagram.getInstance().getAllStates()) {
     s.setReach(false);
     s.setAlreadyTest(false);
   }
 }
 private void areStatesValid() {
   for (State s : Diagram.getInstance().getAllStates()) {
     s.apply(validVisitor);
   }
 }