Package jmt.gui.jaba

Examples of jmt.gui.jaba.JabaModel


  /**
   * gets status from data object
   */
  public void sync() {
    /* arrays are copied to ensure data object consistency is preserved */
    JabaModel data = ew.getData();
    synchronized (data) {
      zeroLD = (data.isLd() && (data.getMaxpop() == 0));
      classes = data.getClasses();
      stations = data.getStations();

      classNames = data.getClassNames();
      stationNames = data.getStationNames();
      stationTypes = data.getStationTypes();

      serviceDemands = ArrayUtils.copy3per2(data.getServiceTimes(), data.getVisits());
    }
  }
View Full Code Here


  private void commit() {

    stTable.stopEditing();

    JabaModel data = ew.getData();
    synchronized (data) {
      data.setServiceTimes(serviceDemands);
      data.setVisits(createUnitaryVisits());
    }
  }
View Full Code Here

  /**
   * gets status from data object
   */
  public void sync() {
    /* arrays are copied to ensure data object consistency is preserved */
    JabaModel data = ew.getData();
    synchronized (data) {
      zeroLD = (data.isLd() && (data.getMaxpop() == 0));
      classes = data.getClasses();
      stations = data.getStations();

      classNames = data.getClassNames();
      stationNames = data.getStationNames();
      stationTypes = data.getStationTypes();

      serviceTimes = ArrayUtils.copy3(data.getServiceTimes());
    }
  }
View Full Code Here

  private void commit() {

    stTable.stopEditing();

    JabaModel data = ew.getData();
    synchronized (data) {
      data.setServiceTimes(serviceTimes);
    }
  }
View Full Code Here

    hasDeletes = false;
    classOps.clear();

    /* sync status with data object */
    /* arrays are copied to ensure data object consistency is preserved */
    JabaModel data = ew.getData();
    synchronized (data) {
      classes = data.getClasses();
      isLd = data.isLd();
      classNames = ArrayUtils.copy(data.getClassNames());
      classTypes = ArrayUtils.copy(data.getClassTypes());
      classData = ArrayUtils.copy(data.getClassData());

      //NEW
      //@author Stefano Omini
      if (isLd) {
        //if load dependent is no more supported after class changes
        //remove all load dependent stations
        if (!(data.isClosed() && !data.isMultiClass())) {
          JOptionPane
              .showMessageDialog(
                  this,
                  "<html><center>jMVA allows Load Dependent stations only for single class closed model. <br> Load Dependent stations will be replaced with Load Independent stations.</center></html>",
                  "Warning", JOptionPane.WARNING_MESSAGE);
          data.removeLD();
          isLd = false;
        }
      }
      //end NEW
    }
View Full Code Here

      }
    }

    classTable.stopEditing();

    JabaModel data = ew.getData();

    synchronized (data) {

      if (hasDeletes) {
        //if at some point rows have been deleted
        //play back all ops in the same order on the data object
        playbackClassOps(data);
      } else {
        data.resize(data.getStations(), classes); //otherwise a simple resize is ok
      }

      data.setClassNames(classNames);
      data.setClassTypes(classTypes);
      data.setClassData(classData);

      //NEW
      //@author Stefano Omini
      sync();
      //end NEW
View Full Code Here

  /**
   * gets status from data object
   */
  private void sync() {
    /* arrays are copied to ensure data object consistency is preserved */
    JabaModel data = ew.getData();
    synchronized (data) {
      classes = data.getClasses();
      stations = data.getStations();

      classNames = data.getClassNames();
      stationNames = data.getStationNames();
      visits = ArrayUtils.copy2(data.getVisits());
    }
  }
View Full Code Here

  private void commit() {

    visitTable.stopEditing();

    JabaModel data = ew.getData();
    synchronized (data) {
      data.setVisits(visits);
    }
  }
View Full Code Here

    hasDeletes = false;
    stationOps.clear();

    /* sync status with data object */
    /* arrays are copied to ensure data object consistency is preserved */
    JabaModel data = ew.getData();
    synchronized (data) {
      stations = data.getStations();
      pop = data.getMaxpop();

      //OLD
      // closedSystem = data.isClosed();

      //NEW
      //@author Stefano Omini
      //if true, load dependent stations are allowed
      //(at the moment, only single class closed models allow LD stations)
      LD_enabled_system = data.isClosed() && !data.isMultiClass();
      //end NEW

      //TODO: sostituire LD??
      stationNames = ArrayUtils.copy(data.getStationNames());
      stationTypes = ArrayUtils.copy(data.getStationTypes());
    }

    stationSpinner.setValue(new Integer(stations));
  }
View Full Code Here

      }
    }

    stationTable.stopEditing();

    JabaModel data = ew.getData();
    synchronized (data) {

      if (hasDeletes) {
        playbackStationOps(data); //play back ops on the data object
      } else {
        data.resize(stations, data.getClasses());
      }
      data.setStationNames(stationNames);
      data.setStationTypes(stationTypes);

      //NEW
      //@author Stefano Omini
      sync();
      //end NEW
View Full Code Here

TOP

Related Classes of jmt.gui.jaba.JabaModel

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.