Пример #1
0
  private void updateFields() {
    deLongNameValueLabel.setText(tempDE.getLongName());
    deIdValueLabel.setText(ConventionUtil.publicIdVersion(tempDE));
    if (tempDE.getContext() != null) deContextNameValueLabel.setText(tempDE.getContext().getName());
    else deContextNameValueLabel.setText("");

    if (tempDE.getValueDomain() != null)
      vdLongNameValueLabel.setText(tempDE.getValueDomain().getLongName());
    else vdLongNameValueLabel.setText("");

    if (prefs.getShowConceptCodeNameSummary()) {
      List<gov.nih.nci.ncicb.cadsr.domain.Concept> concepts =
          cadsrModule.getConcepts(tempDE.getDataElementConcept().getProperty());
      if (concepts != null && concepts.size() > 0) {
        StringBuffer conceptCodeSummary = new StringBuffer();
        StringBuffer conceptNameSummary = new StringBuffer();
        for (Concept con : concepts) {
          conceptCodeSummary.append(con.getPreferredName());
          conceptCodeSummary.append(" ");
          conceptNameSummary.append(con.getLongName());
          conceptNameSummary.append(" ");
        }
        conceptCodeSummaryValue.setText(conceptCodeSummary.toString());
        conceptNameSummaryValue.setText(conceptNameSummary.toString());
      }
    }
    enableCDELinks();
  }
Пример #2
0
  private void clear() {
    disableCDELinks();
    tempDE = DomainObjectFactory.newDataElement();

    ValueDomain vd = DomainObjectFactory.newValueDomain();

    List<AttributeDatatypePair> attTypesPairs =
        ElementsLists.getInstance().getElements(new AttributeDatatypePair("", ""));
    String datatype = null;
    String attributeName = LookupUtil.lookupFullName(de);
    for (AttributeDatatypePair pair : attTypesPairs) {
      if (pair.getAttributeName().equals(attributeName)) {
        datatype = pair.getDatatype();
      }
    }

    if (datatype == null) datatype = "";
    else {
      if (DatatypeMapping.getKeys().contains(datatype.toLowerCase()))
        datatype = DatatypeMapping.getMapping().get(datatype.toLowerCase());
    }

    vd.setLongName(datatype);

    tempDE.setValueDomain(vd);

    deLongNameValueLabel.setText("");
    deIdValueLabel.setText("");
    deContextNameValueLabel.setText("");
    vdLongNameValueLabel.setText("");
    conceptCodeSummaryValue.setText("");
    conceptNameSummaryValue.setText("");
  }
  public void setFiles(String file1, String file2) {

    if (file1 == null || file2 == null) {
      reportLabel.setText("<html>Report Generation Failed. <br>" + file2 + "</html>");
    } else {
      if (file2.endsWith(".csv")) {
        reportLabel.setText(
            "<html>Semantic Connector Report for the file:<br><div align=center> "
                + file1
                + " </div>was created. <br><br> The output report can be found here: <br><div align=center>"
                + file2
                + "</div></html>");
      } else {
        reportLabel.setText(
            "<html>Annotation of file <br><div align=center> "
                + file1
                + " </div>was completed.  <br><br> The Annotated XMI can be found here: <br><div align=center>"
                + file2
                + "</div></html>");
      }
    }
  }
Пример #4
0
  public void updateNode(UMLNode node) {
    this.node = node;
    if ((node.getUserObject() instanceof DataElement)) {
      de = (DataElement) node.getUserObject();
      if (de.getPublicId() != null) {
        deLongNameValueLabel.setText("<html><body>" + de.getLongName() + "</body></html>");
        deIdValueLabel.setText(de.getPublicId() + " v" + de.getVersion());
        deContextNameValueLabel.setText(de.getContext().getName());
        vdLongNameValueLabel.setText(de.getValueDomain().getLongName());

        // if preference is set to show Concept Summary, then :
        // call cadsrModulde.getConcepts(de.getDataElementConcept().getProperty())
        // and show the 2 fields
        if (prefs.getShowConceptCodeNameSummary()) {
          List<gov.nih.nci.ncicb.cadsr.domain.Concept> concepts =
              cadsrModule.getConcepts(de.getDataElementConcept().getProperty());
          if (concepts != null && concepts.size() > 0) {
            StringBuffer conceptCodeSummary = new StringBuffer();
            StringBuffer conceptNameSummary = new StringBuffer();
            for (Concept con : concepts) {
              conceptCodeSummary.append(con.getPreferredName());
              conceptCodeSummary.append(" ");
              conceptNameSummary.append(con.getLongName());
              conceptNameSummary.append(" ");
            }
            conceptCodeSummaryValue.setText(conceptCodeSummary.toString());
            conceptNameSummaryValue.setText(conceptNameSummary.toString());
          }
        }
        enableCDELinks();
      } else clear();

      firePropertyChangeEvent(
          new PropertyChangeEvent(
              this, ButtonPanel.SWITCH, null, StringUtil.isEmpty(de.getPublicId())));
    }
  }
 public void setOutputText(String text) {
   reportLabel.setText("<html>" + text + "</html>");
 }
Пример #6
0
 private void disableCDELinks() {
   cdeBrowserLinkValueLabel.setVisible(false);
   cdeBrowserLinkValueLabel.setText("");
 }
Пример #7
0
 private void enableCDELinks() {
   cdeBrowserLinkValueLabel.setVisible(true);
   cdeBrowserLinkValueLabel.setText(getCDEBrowserURL());
   cdeBrowserLinkValueLabel.setForeground(Color.BLUE);
 }