Package org.woped.core.config

Examples of org.woped.core.config.IMetricsConfiguration


   * @param algorithmGroupID  ID of the group
   * @return          List of all algorithms contained in it
   */
  public static List<String> getAlgoNames(String algorithmGroupID){
    List<String> algoNames = new ArrayList<String>();
    IMetricsConfiguration metricsConfig = ConfigurationManager.getMetricsConfiguration();
    for(String id:metricsConfig.getAlgorithmIDsFromGroup(algorithmGroupID))
      algoNames.add(metricsConfig.getAlgorithmName(id) != null ? metricsConfig.getAlgorithmName(id) : metricsConfig.getVariableName(id));
    return algoNames;
  }
View Full Code Here


   * are filled correctly.
   * @param metricID of the metric that is to be displayed
   * @return
   */
  public static void displayMetric(String metricID){
    IMetricsConfiguration metricsConfig = ConfigurationManager.getMetricsConfiguration();
   
    if(metricsConfig.isAlgorithm(metricID)){
      for(int i = 0; i < MetricsBuilderPanel.jAlgorithmListTab1.getModel().getSize(); i++)
        if(((NameIDListEntry)MetricsBuilderPanel.jAlgorithmListTab1.getModel().getElementAt(i)).getMetricID().equals(metricID)){
          MetricsBuilderPanel.jAlgorithmListTab1.setSelectedIndex(i);
          MetricsBuilderPanel.jAlgorithmListTab2.setSelectedIndex(i);
          MetricsBuilderPanel.jAlgorithmListTab3.setSelectedIndex(i);
          break;
        }
     
      MetricsBuilderPanel.jMetricsIDTextField.setText(metricID);
      MetricsBuilderPanel.jMetricsFormulaTextField.setText(metricsConfig.getAlgorithmFormula(metricID));
      MetricsBuilderPanel.jMetricsNameTextField.setText(metricsConfig.getAlgorithmName(metricID));
      MetricsBuilderPanel.jMetricsDescriptionTextField.setText(metricsConfig.getAlgorithmDescription(metricID));
      MetricsBuilderPanel.jMetricsFilePathTextField.setText(metricsConfig.getMetricOrigin(metricID));
    } else if(metricsConfig.isVariable(metricID)){
        for(int i = 0; i < MetricsBuilderPanel.jVariableListTab1.getModel().getSize(); i++)
        if(((NameIDListEntry)MetricsBuilderPanel.jVariableListTab1.getModel().getElementAt(i)).getMetricID().equals(metricID)){
          MetricsBuilderPanel.jVariableListTab1.setSelectedIndex(i);
          MetricsBuilderPanel.jVariableListTab2.setSelectedIndex(i);
          MetricsBuilderPanel.jVariableListTab3.setSelectedIndex(i);
          break;
        }
        MetricsBuilderPanel.jMetricsIDTextField.setText(metricID);
      MetricsBuilderPanel.jMetricsFormulaTextField.setText(metricsConfig.getVariableFormula(metricID));
      MetricsBuilderPanel.jMetricsNameTextField.setText(metricsConfig.getVariableName(metricID));
      MetricsBuilderPanel.jMetricsDescriptionTextField.setText(metricsConfig.getVariableDescription(metricID));
      MetricsBuilderPanel.jMetricsFilePathTextField.setText(metricsConfig.getMetricOrigin(metricID));
      }
  } 
View Full Code Here

   * @param algorithmGroupID  Name of the top layer gorup
   * @return          List of IDs of all algorithms on the lowest level
   */
  public static List<String> getLayeredAlgoNames(String algorithmGroupID){
    List<String> algoNames = new ArrayList<String>();
    IMetricsConfiguration metricsConfig = ConfigurationManager.getMetricsConfiguration();
    for(String groupId:metricsConfig.getGroupIDsFromGroup(algorithmGroupID))
      for(String id:metricsConfig.getAlgorithmIDsFromGroup(groupId))
        algoNames.add(metricsConfig.getAlgorithmName(id) != null ? metricsConfig.getAlgorithmName(id) : metricsConfig.getVariableName(id));
    return algoNames;
  }
View Full Code Here

  public IMetricsConfiguration.MetricThresholdState getTreshholdState(String metricsID){
    return valueStates.containsKey(algorithmNameToID(metricsID)) ? valueStates.get(algorithmNameToID(metricsID)) : IMetricsConfiguration.MetricThresholdState.NONE;
  }
 
  public static List<UIThreshold> getUIThresholds(String metricsID){
    IMetricsConfiguration metricsConfig = ConfigurationManager.getMetricsConfiguration();
    String id = algorithmNameToID(metricsID);
    int thresholds = metricsConfig.getMetricThresholdCount(id);
    List<UIThreshold> thresholdList = new ArrayList<UIThreshold>();
    for(int i=0;i<thresholds;i++)
      thresholdList.add(new UIThreshold(metricsConfig.getMetricThresholdLowValue(id, i),
          metricsConfig.getMetricThresholdHighValue(id, i), metricsConfig.getMetricThresholdState(id, i)));
    return thresholdList;
  }
View Full Code Here

   * @param metricsID    Name or ID of the variable or algorithm
   * @return        Whether or not the variable / algorithm can be edited
   */
  public static boolean canBeEdited(String metricsID){
    String id = algorithmNameToID(metricsID);
    IMetricsConfiguration metricsConfig = ConfigurationManager.getMetricsConfiguration();
    return metricsConfig.isCustomMetric(id);
  }
View Full Code Here

        public void mouseExited(MouseEvent arg0) {
          setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
        }

        public void mouseClicked(MouseEvent e) {
          IMetricsConfiguration metricsConfig = ConfigurationManager.getMetricsConfiguration();
          metricsConfig.deleteAlgorithm(ID);
          parent.createMainPanel();
          //TODO: Sidebar refresh
        }
      });
    }
View Full Code Here

          }

          PNMLImport pr = new PNMLImport(medi);
          OLDPNMLImport2 oldpr = new OLDPNMLImport2(medi);
          IEditor edit = null;
          IMetricsConfiguration metricsConfig = ConfigurationManager.getMetricsConfiguration();
      try{
        // Write top line with variable and algorithm names
        write = new BufferedWriter(new FileWriter(saveFile));
        List<String> metricsList = MetricsUIRequestHandler.getLayeredAlgoNames("ALL_METRICS");
        write.write("File name");
View Full Code Here

TOP

Related Classes of org.woped.core.config.IMetricsConfiguration

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.