Package jmt.gui.common.panels

Examples of jmt.gui.common.panels.StationParameterPanel


    Object stationKey = null;
    stationKey = stationsList.getSelectedValue();
    if (stationParsPane != null) {
      stationParsPane.setData(stationKey);
    } else {
      stationParsPane = new StationParameterPanel(stationData, classData, stationKey);
      add(stationParsPane, BorderLayout.CENTER);
    }
  }
View Full Code Here


  public void showStationParameterPanel(Object stationKey, Object classKey, int index) {
    if (stationParsPane != null) {
      stationParsPane.setData(stationKey);

    } else {
      stationParsPane = new StationParameterPanel(stationData, classData, stationKey);
      add(stationParsPane, BorderLayout.CENTER);
    }
    if (index == 0) {
      stationParsPane.showQueueSectionPanel();
    } else if (index == 1) {
View Full Code Here

    // if a source has been inserted in the model but no open classes
    // defined show the class panel
    else if ((problemSubType == ModelChecker.SOURCE_WITH_NO_OPEN_CLASSES_ERROR) && (problemType == ModelChecker.ERROR_PROBLEM)) {
      dialogFactory.getDialog(new jmodelClassesPanel(model, model), "Manage User Classes");
    } else if ((problemSubType == ModelChecker.ROUTING_ERROR) && (problemType == ModelChecker.ERROR_PROBLEM)) {
      StationParameterPanel tempPanel = new StationParameterPanel(model, model, relatedStation);
      String stationName = model.getStationName(relatedStation);
      // set the station parameter panel to show the routing section
      tempPanel.showRoutingSectionPanel(relatedClass);
      dialogFactory.getDialog(tempPanel, "Editing " + stationName + " Properties...");
    }
    // if a class may be routed into a station whose forward stations are
    // all sink show an error message
    else if ((problemSubType == ModelChecker.ALL_FORWARD_STATION_ARE_SINK_ERROR) && (problemType == ModelChecker.ERROR_PROBLEM)) {
      String stationName = model.getStationName(relatedStation);
      String className = model.getClassName(relatedClass);
      JOptionPane.showMessageDialog(null, "Close class " + className + " may be routed into " + stationName
          + " whose forward station are all sink.", "Error", JOptionPane.ERROR_MESSAGE);
    }
    // if no open classes defined but at least a sink has been defined show
    // the class panel
    else if ((problemSubType == ModelChecker.SINK_BUT_NO_OPEN_CLASSES_ERROR) && (problemType == ModelChecker.ERROR_PROBLEM)) {
      dialogFactory.getDialog(new jmodelClassesPanel(model, model), "Manage User Classes");
      // JOptionPane.showConfirmDialog(null,"Add an open class to the
      // model?",
      // "Error",JOptionPane.OK_CANCEL_OPTION,JOptionPane.ERROR_MESSAGE);
    }
    // if an open class defined but no sink have been defined show an error
    // message
    else if ((problemSubType == ModelChecker.NO_SINK_WITH_OPEN_CLASSES_ERROR) && (problemType == ModelChecker.ERROR_PROBLEM)) {
      JOptionPane.showMessageDialog(null, "Open classes defined but no sink, add a sink to the model.", "Error", JOptionPane.ERROR_MESSAGE);
    }
    // if an open class defined but no source show an error message
    else if ((problemSubType == ModelChecker.OPEN_CLASS_BUT_NO_SOURCE_ERROR) && (problemType == ModelChecker.ERROR_PROBLEM)) {
      JOptionPane.showMessageDialog(null, "Open classes defined but no source, add a source to the model.", "Error", JOptionPane.ERROR_MESSAGE);
    }
    // if there is a station link error show an error message
    else if ((problemSubType == ModelChecker.STATION_LINK_ERROR) && (problemType == ModelChecker.ERROR_PROBLEM)) {
      String stationName = model.getStationName(relatedStation);
      JOptionPane.showMessageDialog(null, "The station " + stationName + " is not forward linked, add a forward link", "Error",
          JOptionPane.ERROR_MESSAGE);
    } else if ((problemType == ModelChecker.ERROR_PROBLEM) && (problemSubType == ModelChecker.JOIN_WITHOUT_FORK_ERROR)) {
      JOptionPane.showMessageDialog(null, "One or more join found but no fork. Please, remove all join or add a fork");
    }
    // if it is a reference station error show the class panel
    /*
     * else if ((problemSubType ==
     * ModelChecker.OPEN_CLASS_REFERENCE_STATION_ERROR) && (problemType ==
     * ModelChecker.ERROR_PROBLEM)) { DialogFactory.getDialog(new
     * jmodelClassesPanel(model,model),"Manage User Classes");
     * model.manageJobs(); //a close class may be added }
     */
    // used only in JMVA conversion
    else if ((problemSubType == ModelChecker.BCMP_DIFFERENT_QUEUEING_STRATEGIES_WARNING) && (problemType == ModelChecker.WARNING_PROBLEM)) {
      String name = this.getStationDefinition().getStationName(relatedStation);
      int k = JOptionPane
          .showConfirmDialog(
              null,
              "According to BCMP theorem hypothesis each station must have the same queue\nstrategy for each class, but different per class queue strategy were found at "
                  + name + ".\nDo you want to edit " + name + " queue strategy?\n\n", "Mixed queue strategy found",
              JOptionPane.WARNING_MESSAGE);
      if (k == 0) {
        StationParameterPanel tempPanel = new StationParameterPanel(model, model, relatedStation);
        // set the station parameter panel to show the queue section
        tempPanel.showQueueSectionPanel();
        dialogFactory.getDialog(tempPanel, "Editing " + name + " Properties...");
      }
    }
    // used only in JMVA conversion
    else if ((problemSubType == ModelChecker.BCMP_FCFS_DIFFERENT_SERVICE_TYPES_WARNING) && (problemType == ModelChecker.WARNING_PROBLEM)) {
      String name = this.getStationDefinition().getStationName(relatedStation);
      int k = JOptionPane.showConfirmDialog(null,
          "According to BCMP theorem hypothesis, a FCFS server must have the same service times for each class,\nbut at " + name
              + " the service strategy is mixed, i.e. both load dependent and independent were found.\nDo you want to edit " + name
              + " service parameters?\n\n", "Mixed service strategies found", JOptionPane.WARNING_MESSAGE);
      if (k == 0) {
        StationParameterPanel tempPanel = new StationParameterPanel(model, model, relatedStation);
        // set the station parameter panel to show the queue section
        tempPanel.showServiceSectionPanel();
        dialogFactory.getDialog(tempPanel, "Editing " + name + " Properties...");
      }
    }
    // used only in JMVA conversion
    else if ((problemSubType == ModelChecker.BCMP_FCFS_EXPONENTIAL_WARNING) && (problemType == ModelChecker.WARNING_PROBLEM)) {
      String name = this.getStationDefinition().getStationName(relatedStation);
      int k = JOptionPane.showConfirmDialog(null,
          "According to BCMP theorem hypothesis, in a FCFS server all the service time distribution\nmust be exponential, but at " + name
              + " at least one non exponential distribution was found.\nDo you want to edit " + name + " service parameters?\n\n",
          "Non exponential distribution in FCFS server", JOptionPane.WARNING_MESSAGE);
      if (k == 0) {
        StationParameterPanel tempPanel = new StationParameterPanel(model, model, relatedStation);
        // set the station parameter panel to show the queue section
        tempPanel.showServiceSectionPanel();
        dialogFactory.getDialog(tempPanel, "Editing " + name + " Properties...");
      }
    }
    // used only in JMVA conversion
    else if ((problemSubType == ModelChecker.BCMP_FCFS_DIFFERENT_SERVICE_TIMES_WARNING) && (problemType == ModelChecker.WARNING_PROBLEM)) {
      String name = this.getStationDefinition().getStationName(relatedStation);
      int k = JOptionPane
          .showConfirmDialog(
              null,
              "According to BCMP theorem hypothesis, in a FCFS server all the per class service time mean values\nmust be the same. If the service strategies are load dependent the mean value in each range\nhas to be the same for each class.\nDo you want to edit "
                  + name + " service parameters?\n\n", "Non exponential distribution in FCFS server", JOptionPane.WARNING_MESSAGE);
      if (k == 0) {
        StationParameterPanel tempPanel = new StationParameterPanel(model, model, relatedStation);
        // set the station parameter panel to show the queue section
        tempPanel.showServiceSectionPanel();
        dialogFactory.getDialog(tempPanel, "Editing " + name + " Properties...");
      }
    }
    // used only for to JMVA conversion, for non Random Routing routing
    // strategy errors
    else if ((problemType == ModelChecker.WARNING_PROBLEM) && (problemSubType == ModelChecker.BCMP_NON_STATE_INDEPENDENT_ROUTING_WARNING)) {
      int k = JOptionPane
          .showConfirmDialog(
              null,
              "Convert all non state independent routing strategies to Random Routing?\n\nAccording to the BCMP theorem the routing probabilities must be independent from the state of the model.\nChoosing ok all non state independent routing strategies inside a station will be converted to Random Routing.\nDo you want to convert all non state independent routing strategies to Random Routing?\n\n",
              "BCMP hypothesis not verified", JOptionPane.ERROR_MESSAGE);
      if (k == 0) {
        mc.setAllStateDependentRoutingStrategyToRandomRouting();
      }
    }
    // if there are more than one sink show a warning message
    else if ((problemSubType == ModelChecker.MORE_THAN_ONE_SINK_WARNING) && (problemType == ModelChecker.WARNING_PROBLEM)) {
      JOptionPane
          .showMessageDialog(
              null,
              "If more than one sink is reacheable by the same open class the computed throughput may not be accurate.\nPlease check the model before starting simulation.",
              "Warning", JOptionPane.WARNING_MESSAGE);
    }
    // if a station (server or delay) is not backward connected show a
    // warning message
    else if ((problemSubType == ModelChecker.NO_BACKWARD_LINK_WARNING) && (problemType == ModelChecker.WARNING_PROBLEM)) {
      String stationName = model.getStationName(relatedStation);
      JOptionPane.showMessageDialog(null, "The station " + stationName
          + " is not backward linked. Please check the model before starting simulation.", "Warning", JOptionPane.WARNING_MESSAGE);
    } else if ((problemSubType == ModelChecker.PARAMETRIC_ANALYSIS_MODEL_MODIFIED_WARNING) && (problemType == ModelChecker.WARNING_PROBLEM)) {
      String message = "Check parametric analysis model?\n\nThe parametric analysis model previously defined had become inconsistent with the \nsimulation model. It will be automatically modified when simulation will be started.\nDo you want to autocorrect and check parametric analysis panel?\n\n";
      int k = JOptionPane.showConfirmDialog(null, message, "Inconsistent parametric analysis model", JOptionPane.WARNING_MESSAGE);
      if (k == 0) {
        model.getParametricAnalysisModel().checkCorrectness(true);
        ParametricAnalysisPanel paPanel = new ParametricAnalysisPanel(model, model, model, this);
        dialogFactory.getDialog(paPanel, "Edit what-if analysis parameters");
      }
    } else if ((problemSubType == ModelChecker.PARAMETRIC_ANALYSIS_NO_MORE_AVAIBLE_WARNING) && (problemType == ModelChecker.WARNING_PROBLEM)) {
      String message = "Parametric analysis was set, but no parametric analysis is now avaible,\nsince the simulation model was changed. It is only possible to execute normal simulation.\nDo you wish to continue anyway?\n\n";
      int k = JOptionPane.showConfirmDialog(null, message, "Parametric analysis not avaible", JOptionPane.WARNING_MESSAGE);
      if (k == 0) {
        model.setParametricAnalysisEnabled(false);
        model.setParametricAnalysisModel(null);
      }
    } else if ((problemSubType == ModelChecker.FORK_WITHOUT_JOIN_WARNING) && (problemType == ModelChecker.WARNING_PROBLEM)) {
      JOptionPane.showMessageDialog(null, "A fork was found but no join. Please check the topology");
    } else if ((problemSubType == ModelChecker.EMPTY_BLOCKING_REGION)) {
      int k = JOptionPane.showConfirmDialog(null, "Delete empty finite capacity regions?\n", "Empty finite capacity regions found",
          JOptionPane.ERROR_MESSAGE);
      if (k == 0) {
        mc.deleteEmptyBlockingRegions();
      }
    } else if (problemSubType == ModelChecker.PRELOADING_WITH_BLOCKING) {
      editSimulationParameters();
    } else if ((problemType == ModelChecker.ERROR_PROBLEM) && (problemSubType == ModelChecker.LOAD_DEPENDENT_ROUTING_INVALID)) {
            StationParameterPanel tempPanel = new StationParameterPanel(model, model, relatedStation);
      String stationName = model.getStationName(relatedStation);
      // set the station parameter panel to show the routing section
      tempPanel.showRoutingSectionPanel(relatedClass);
      dialogFactory.getDialog(tempPanel, "Editing " + stationName + " Properties...");
    } else if ((problemSubType == ModelChecker.CS_MATRIX_HAS_ROWS_LESS_THAN_ONE) && (problemType == ModelChecker.ERROR_PROBLEM)) {
        StationParameterPanel tempPanel = new StationParameterPanel(model, model, relatedStation);
        String name = this.getStationDefinition().getStationName(relatedStation);
        tempPanel.showCsSectionPanel();
        dialogFactory.getDialog(tempPanel, "Editing " + name + " Properties...");
    } else if ((problemSubType == ModelChecker.CS_FOLLOWED_BY_A_BAS) && (problemType == ModelChecker.ERROR_PROBLEM)) {
      String name = this.getStationDefinition().getStationName(relatedStation);
      JOptionPane.showMessageDialog(null, name + " is followed by a queue implementing a BAS stratregy. This topology is not allowed.", "Error", JOptionPane.ERROR_MESSAGE);
    } else if ((problemSubType == ModelChecker.CS_BETWEEN_FORK_JOIN) && (problemType == ModelChecker.ERROR_PROBLEM)) {
View Full Code Here

   */
  public void startEditingAtCell(Object cell) {
    graph.startEditingAtCell(cell);
    if ((cell != null) && (cell instanceof JmtCell)) {
      JmtCell jcell = (JmtCell) cell;
      StationParameterPanel stationPanel = new jmt.gui.common.panels.StationParameterPanel(model, model,
          ((CellComponent) jcell.getUserObject()).getKey());
      // Adds on the top a panel to change station name
      stationPanel.add(new StationNamePanel(model, ((CellComponent) jcell.getUserObject()).getKey()), BorderLayout.NORTH);
      dialogFactory.getDialog(stationPanel, "Editing " + jcell.getUserObject().toString() + " Properties...");

      // Updates cell dimensions if name was changed too much...
      Hashtable<Object, Map> nest = new Hashtable<Object, Map>();
      Dimension cellDimension = jcell.getSize(graph);
View Full Code Here

TOP

Related Classes of jmt.gui.common.panels.StationParameterPanel

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.