示例#1
0
 /** Method to set Metric from the graph. */
 public boolean setMetricFromGraph() {
   if (!saimcytopro.getMetric().isComplete()) {
     getApplication()
         .getMainWindow()
         .showNotification(
             messages.getString("MetricPanel.settingnotablenotcomplete")); // $NON-NLS-1$
     return false;
   } else {
     Node node = saimcytopro.getMetric();
     String expr = saimcytopro.getMetric().toString();
     config.setMetricExpression(expr);
     System.out.println(node.param1 + " - " + node.param2); // $NON-NLS-1$
     if (node.param1 != null && node.param2 != null) {
       config.setAcceptanceThreshold(node.param1);
       config.setVerificationThreshold(node.param2);
       getApplication()
           .getMainWindow()
           .showNotification(
               "Setting: "
                   + expr
                   + "with thresholds "
                   + node.param1
                   + " / "
                   + node.param2); //$NON-NLS-1$
       return checkButtons();
     } else {
       getApplication()
           .getMainWindow()
           .showNotification(
               messages.getString("MetricPanel.settingnotablenothreholds")); // $NON-NLS-1$
       return false;
     }
   }
 }
示例#2
0
    @Override
    public void layoutClick(LayoutClickEvent event) {
      // its left button
      if (event.getButtonName().equalsIgnoreCase("left")
          && event.getClickedComponent() instanceof Label) { // $NON-NLS-1$
        String labelValue = ((Label) event.getClickedComponent()).getValue().toString();

        switch (shape) {
          case SOURCE:
            {
              String pref = config.getSource().var.replaceAll("\\?", ""); // $NON-NLS-1$
              saimcytoprocess.addNode(
                  pref + "." + labelValue, SAIMCytoprocess.NODE_TYPE.SOURCE); // $NON-NLS-1$
              break;
            }
          case TARGET:
            {
              String pref = config.getTarget().var.replaceAll("\\?", ""); // $NON-NLS-1$
              saimcytoprocess.addNode(
                  pref + "." + labelValue, SAIMCytoprocess.NODE_TYPE.TARGET); // $NON-NLS-1$
              break;
            }
          case OPERATOR:
            double t1 =
                Double.parseDouble(
                    SAIMCytoprocessProperties.getProperty(
                        SAIMCytoprocessProperties.OPERATOR_DEFAULT_THRESHOLD_1));
            double t2 =
                Double.parseDouble(
                    SAIMCytoprocessProperties.getProperty(
                        SAIMCytoprocessProperties.OPERATOR_DEFAULT_THRESHOLD_2));
            saimcytoprocess.addNode(labelValue, SAIMCytoprocess.NODE_TYPE.OPERATOR, t1, t2);
            break;

          case MEASURE:
            saimcytoprocess.addNode(labelValue, SAIMCytoprocess.NODE_TYPE.MEASURE);
        }
        // repaint
        saimcytoprocess.repaintGraph();
      }
    }
示例#3
0
  private SAIMCytoprocess makeCytographer() {

    int hadjust = 100;
    int wadjust = 350;

    int wm = Math.round(((SAIMApplication) getApplication()).getMainWindow().getWidth());
    int hm = Math.round(((SAIMApplication) getApplication()).getMainWindow().getHeight());

    final int HEIGHT = hm > hadjust ? hm - hadjust : 600;
    final int WIDTH = wm > wadjust ? wm - wadjust : 900;

    saimcytopro = new SAIMCytoprocess(WIDTH, HEIGHT, (SAIMApplication) getApplication());

    CytoprocessProperties.defaults();

    saimcytopro.loadMetricExpression();

    return saimcytopro;
  }