Package fr.utbm.gi.vi51.pw.environment

Examples of fr.utbm.gi.vi51.pw.environment.WorldModelState


   */
  @Override
  public void environmentChanged(EnvironmentEvent event) {
    synchronized(getTreeLock()) {
      if (event instanceof WorldModelEvent && this.environment==null) {
        WorldModelEvent e = (WorldModelEvent)event;
        this.environment = e.getStateProvider();
      }
      this.lastState = this.environment.getState();
      repaint();
    }
  }
View Full Code Here


   */
  @Override
  public void environmentChanged(EnvironmentEvent event) {
    synchronized(getTreeLock()) {
      if (event instanceof WorldModelEvent && this.environment==null) {
        WorldModelEvent e = (WorldModelEvent)event;
        this.environment = e.getStateProvider();
      }
      this.lastState = this.environment.getState();
      repaint();
    }
  }
View Full Code Here

      drawAgents(g2d, currentDim);
    }
   
    private void drawAgents(Graphics2D g2d, Dimension currentDim) {
      WorldModelState state = getLastState();
      if (state!=null) {
        for (SituatedObject p : state.getObjects()) {
          drawAgent(
              g2d,
              (int)p.getX(), (int)p.getY(),
              (int)(p.getDirection().getX()*DIRECTION_RADIUS),
              (int)(p.getDirection().getY()*DIRECTION_RADIUS),
              state.isLeader(p));
        }
      }
    }
 
View Full Code Here

      drawAgents(g2d, currentDim);
    }
   
    private void drawAgents(Graphics2D g2d, Dimension currentDim) {
      WorldModelState state = getLastState();
      if (state!=null) {
        for (SituatedObject p : state.getObjects())
        {
          if(p instanceof AgentBody)
          {
            drawAgent(
                g2d,
                (int)p.getX(), (int)p.getY(),
                (int)(p.getDirection().getX()*DIRECTION_RADIUS),
                (int)(p.getDirection().getY()*DIRECTION_RADIUS),
                state.isLeader(p));
          }
          if(p instanceof Floor)
          {
            drawFloor(g2d,
                (int)p.getX(), (int)p.getY(),
View Full Code Here

        LocalizedString.get(MainProgram.class, "USE_STEERING_MESSAGE"), //$NON-NLS-1$
        LocalizedString.get(MainProgram.class, "USE_STEERING_TITLE"), //$NON-NLS-1$
        JOptionPane.YES_NO_OPTION,
        JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION;

    FrameworkGUI gui = new GUI(WORLD_SIZE_X, WORLD_SIZE_Y);
   
    Environment environment = new WorldModel(WORLD_SIZE_X, WORLD_SIZE_Y);
   
    FrameworkLauncher.launchEnvironment(environment, gui, EXECUTION_DELAY);
View Full Code Here

        LocalizedString.get(MainProgram.class, "USE_STEERING_MESSAGE"), //$NON-NLS-1$
        LocalizedString.get(MainProgram.class, "USE_STEERING_TITLE"), //$NON-NLS-1$
        JOptionPane.YES_NO_OPTION,
        JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION;

    FrameworkGUI gui = new GUI(WORLD_SIZE_X, WORLD_SIZE_Y);
   
    Environment environment = new WorldModel(WORLD_SIZE_X, WORLD_SIZE_Y);
   
    FrameworkLauncher.launchEnvironment(environment, gui, EXECUTION_DELAY);
View Full Code Here

TOP

Related Classes of fr.utbm.gi.vi51.pw.environment.WorldModelState

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.