Package fr.soleil.comete.bean.datarecorder.model.utils

Examples of fr.soleil.comete.bean.datarecorder.model.utils.Parameter


        int iNbLabels = parameterVector.size();
        // for each item of the vector, create the label with the name specified in
        // the vector, create the textfield associated and add them
        // to the panel
        for (int i = 0; i < iNbLabels; i++) {
            Parameter param = parameterVector.get(i);
            // create label
            JLabel lb = new JLabel(param.getDescription());
            // get indice of current element
            String strIndice = new Integer(i).toString();
            // create a component associated to type
            JComponent cp = createComponent(param, strIndice);
            // add labels & textfiel to the panel
View Full Code Here


                String strName = vectNameIndice.get(0);
                String strIndice = vectNameIndice.get(1);

                // getParameter whose name is strName
                Parameter param = getParam(strName);

                if (strIndice.equals(strInd)) {
                    // test if this component is a textfield
                    if (cp instanceof JTextField) {
                        JTextField tf = (JTextField) cp;
                        if (tf.getText().length() > 0) {
                            return param.getName() + "=" + tf.getText();
                        }
                        else {
                            return param.getName() + "=" + param.getDefaultValue();
                        }

                    }
                    else if (cp instanceof JComboBox) {
                        JComboBox cb = (JComboBox) cp;
                        if (cb.getSelectedItem() != null) {
                            return param.getName() + "=" + cb.getSelectedItem().toString();
                        }
                        else {
                            return param.getName() + "=" + param.getDefaultValue();
                        }
                    }
                    else if (cp instanceof JSpinner) {
                        JSpinner sp = (JSpinner) cp;
                        if (sp.getValue() != null) {
                            return param.getName() + "=" + sp.getValue().toString();
                        }
                        else {
                            return param.getName() + "=" + param.getDefaultValue();
                        }
                    }
                    else if (cp instanceof PnlFileChooser) {
                        PnlFileChooser pnl = (PnlFileChooser) cp;
                        if (pnl.getTextField().getText().length() > 0) {
                            return param.getName() + "=" + pnl.getTextField().getText();
                        }
                        else {
                            return param.getName() + "=" + param.getDefaultValue();
                        }
                    }
                    else if (cp instanceof JCheckBox) {
                        JCheckBox cb = (JCheckBox) cp;
                        Boolean bool = new Boolean(cb.isSelected());
                        return param.getName() + "=" + bool.toString();
                    }
                }
            }
        }
        return null;
View Full Code Here

                // iteration on tab
                for (int i = 2; i < tabParameters.length; i++) {
                    // get value which contains all infos about a parameter
                    String strParameterScriptInfos = tabParameters[i];
                    // create ObjectParameter
                    Parameter param = new Parameter(strParameterScriptInfos, strTargetDir);
                    paramList.add(param);
                }
                if (paramList.size() > 0) {
                    // update string parameter
                    String strParameters = "-D ";
                    for (Parameter param : paramList) {
                        if (param.getName() != null && param.getDefaultValue() != null) {
                            if (!param.getDefaultValue().equals("")) {
                                strParameters = strParameters + param.getName() + "=" + param.getDefaultValue() + ",";
                            }
                        }
                    }
                    if (strParameters.endsWith(",")) {
                        strParameters = strParameters.substring(0, strParameters.length() - 1);
View Full Code Here

            if (strCurrentValueParameter != null) {
                strCurrentValueParameter = strCurrentValueParameter.replaceAll(DATA_FILE, "");
            }
            // create object Parameter with defaut parameter & current parameter
            // if it exists
            Parameter param = new Parameter(strParameter, strCurrentValueParameter);
            vectParam.add(param);

        }

        Vector<String> vectValues = postRecordingModelListener.getCustumModelParameters(vectParam, strExplanations);
View Full Code Here

    // iteration on tab
    for (int i = 2; i < tabParameters.length; i++) {
        // get value which contains all infos about a parameter
        String strParameterScriptInfos = tabParameters[i];
        // create ObjectParameter
        Parameter param = new Parameter(strParameterScriptInfos, strTargetDir);
        paramList.add(param);
    }
    if (paramList.size() > 0) {
        // update string parameter
        String strParameters = "-D ";
        for (Parameter param : paramList) {
      if (param.getName() != null && param.getDefaultValue() != null) {
          if (!param.getDefaultValue().equals("")) {
        strParameters = strParameters + param.getName() + "=" + param.getDefaultValue() + ",";
          }
      }
        }
        if (strParameters.endsWith(",")) {
      strParameters = strParameters.substring(0, strParameters.length() - 1);
View Full Code Here

      if (strCurrentValueParameter != null) {
    strCurrentValueParameter = strCurrentValueParameter.replaceAll(DATA_FILE, "");
      }
      // create object Parameter with defaut parameter & current parameter
      // if it exists
      Parameter param = new Parameter(strParameter, strCurrentValueParameter);
      vectParam.add(param);

  }

  Vector<String> vectValues = postRecordingModelListener.getCustumModelParameters(vectParam, strExplanations);
View Full Code Here

                // iteration on tab
                for (int i = 2; i < tabParameters.length; i++) {
                    // get value which contains all infos about a parameter
                    String strParameterScriptInfos = tabParameters[i];
                    // create ObjectParameter
                    Parameter param = new Parameter(strParameterScriptInfos, strTargetDir);
                    paramList.add(param);
                }
                if (paramList.size() > 0) {
                    // update string parameter
                    String strParameters = "-D ";
                    for (Parameter param : paramList) {
                        if (param.getName() != null && param.getDefaultValue() != null) {
                            if (!param.getDefaultValue().equals("")) {
                                strParameters = strParameters + param.getName() + "=" + param.getDefaultValue() + ",";
                            }
                        }
                    }
                    if (strParameters.endsWith(",")) {
                        strParameters = strParameters.substring(0, strParameters.length() - 1);
View Full Code Here

            if (strCurrentValueParameter != null) {
                strCurrentValueParameter = strCurrentValueParameter.replaceAll(DATA_FILE, "");
            }
            // create object Parameter with defaut parameter & current parameter
            // if it exists
            Parameter param = new Parameter(strParameter, strCurrentValueParameter);
            vectParam.add(param);

        }

        Vector<String> vectValues = postRecordingModelListener.getCustumModelParameters(vectParam, strExplanations);
View Full Code Here

        int iNbLabels = parameterVector.size();
        // for each item of the vector, create the label with the name specified in
        // the vector, create the textfield associated and add them
        // to the panel
        for (int i = 0; i < iNbLabels; i++) {
            Parameter param = parameterVector.get(i);
            // create label
            JLabel lb = new JLabel(param.getDescription());
            // get indice of current element
            String strIndice = new Integer(i).toString();
            // create a component associated to type
            JComponent cp = createComponent(param, strIndice);
            // add labels & textfiel to the panel
View Full Code Here

                String strName = vectNameIndice.get(0);
                String strIndice = vectNameIndice.get(1);

                // getParameter whose name is strName
                Parameter param = getParam(strName);

                if (strIndice.equals(strInd)) {
                    // test if this component is a textfield
                    if (cp instanceof JTextField) {
                        JTextField tf = (JTextField) cp;
                        if (tf.getText().length() > 0) {
                            return param.getName() + "=" + tf.getText();
                        }
                        else {
                            return param.getName() + "=" + param.getDefaultValue();
                        }

                    }
                    else if (cp instanceof JComboBox) {
                        JComboBox cb = (JComboBox) cp;
                        if (cb.getSelectedItem() != null) {
                            return param.getName() + "=" + cb.getSelectedItem().toString();
                        }
                        else {
                            return param.getName() + "=" + param.getDefaultValue();
                        }
                    }
                    else if (cp instanceof JSpinner) {
                        JSpinner sp = (JSpinner) cp;
                        if (sp.getValue() != null) {
                            return param.getName() + "=" + sp.getValue().toString();
                        }
                        else {
                            return param.getName() + "=" + param.getDefaultValue();
                        }
                    }
                    else if (cp instanceof PnlFileChooser) {
                        PnlFileChooser pnl = (PnlFileChooser) cp;
                        if (pnl.getTextField().getText().length() > 0) {
                            return param.getName() + "=" + pnl.getTextField().getText();
                        }
                        else {
                            return param.getName() + "=" + param.getDefaultValue();
                        }
                    }
                    else if (cp instanceof JCheckBox) {
                        JCheckBox cb = (JCheckBox) cp;
                        Boolean bool = new Boolean(cb.isSelected());
                        return param.getName() + "=" + bool.toString();
                    }
                }
            }
        }
        return null;
View Full Code Here

TOP

Related Classes of fr.soleil.comete.bean.datarecorder.model.utils.Parameter

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.