Package org.gvt.gui

Examples of org.gvt.gui.StringInputDialog


          MessageDialog.openError(main.getShell(), "Error",
            "Name already exists. Choose another name.");
       
        again  = true;

        StringInputDialog dialog = new StringInputDialog(main.getShell(), "Rename Pathway",
          "Enter new name", tab.getText());

        dialog.setSelectText(true);

        newname = dialog.open();
      }
      while(newname != null && !newname.equals(tab.getText()) &&
        (main.getAllPathwayNames().contains(newname) ||
        main.getOpenTabNames().contains(newname)));
View Full Code Here


    // Ask user the name if it is null

    if (name == null)
    {
      StringInputDialog dialog = new StringInputDialog(main.getShell(), "Highlight By Name",
        "Enter keyword for searching entities", null);

      name = dialog.open();
    }

    // If we have a name, highlight related

    if (name != null && name.trim().length() > 0)
View Full Code Here

      }
    }

    if (refs.isEmpty() && !useSelectedNodes)
    {
      StringInputDialog dialog = new StringInputDialog(main.getShell(), "Query Pathways",
        "Enter UniProt or Entrez Gene ID", null);

      String ids = dialog.open();

      if (ids != null && ids.trim().length() > 0)
      {
        for (String id : ids.split(" "))
        {
          if (id.length() < 1) continue;
         
          String dbtext = Character.isDigit(id.charAt(0)) ?
            XRef.ENTREZ_GENE : XRef.UNIPROT;

          refs.add(new XRef(dbtext + ":" + id));
        }
      }
    }

    if (!refs.isEmpty())
    {
      try
      {
        main.lockWithMessage("Querying Pathway Commons Database ...");

        PathwayCommonsIOHandler ioHandler = new PathwayCommonsIOHandler(new SimpleIOHandler());
        Map<String, String> pathToID = new HashMap<String, String>();
        List<String> resultPathways = new ArrayList<String>();

        XRef xr = XRef.getFirstRef(refs,
          new String[]{XRef.CPATH, XRef.ENTREZ_GENE, XRef.UNIPROT});

        refs.clear();
        if (xr != null)
        {
          refs.add(xr);
        }
        else
        {
          MessageDialog.openError(main.getShell(), "No Reference ID",
            "No CPATH, Entrez Gene or UniProt ID found to query.");
        }

       
        for (XRef ref : refs)
        {
          if (ref.getDb().equalsIgnoreCase(XRef.CPATH))
          {
            ioHandler.setInputIdType(PathwayCommonsIOHandler.ID_TYPE.CPATH_ID);
          }
          else if (ref.getDb().equalsIgnoreCase(XRef.UNIPROT))
          {
            ioHandler.setInputIdType(PathwayCommonsIOHandler.ID_TYPE.UNIPROT);
          }
          else if (ref.getDb().equalsIgnoreCase(XRef.ENTREZ_GENE))
          {
            ioHandler.setInputIdType(PathwayCommonsIOHandler.ID_TYPE.ENTREZ_GENE);
          }
          else
          {
            continue;
          }

          System.out.println("Querying pathways for " + ref);

          List<List<String>> resultList = ioHandler.getPathways(ref.getRef());
          main.unlock();

          if (resultList.get(0).get(0).contains("xml"))
          {
            MessageDialog.openError(main.getShell(), "Error!", "Unexpected error!");
            resultList.clear();
          }
          else if (resultList.get(1).size() == 2)
          {
//            MessageDialog.openInformation(main.getShell(), "No results",
//              "No results found.");

            resultList.clear();
          }
          else
          {
            resultList.remove(0);
          }

          // Prepare the result as listable pathway items

          for (List<String> columns : resultList)
          {
            assert columns.size() == 4;

            String cpathid = columns.get(3);

            if (!pathToID.containsValue(cpathid))
            {
              String pathwayName = columns.get(1);
              String db = columns.get(2);

              String line = "[" + db + "] " + pathwayName;

              resultPathways.add(line);
              pathToID.put(line, cpathid);
            }
          }
        }
       
        if (!resultPathways.isEmpty())
        {
          ArrayList<String> selectedItems = new ArrayList<String>();

          ItemSelectionDialog dialog = new ItemSelectionDialog(main.getShell(),
            500,
            "Pathway Selection Dialog",
            "Select pathways to retrieve",
            resultPathways, selectedItems,
            true, true, null);

          dialog.setMinValidSelect(1);
          dialog.open();

          List<String> idList = new ArrayList<String>();

          if (!dialog.isCancelled())
          {
            for (String item : selectedItems)
            {
              idList.add(pathToID.get(item));
            }
View Full Code Here

      }
    }

    if (refs.isEmpty() && !useSelectedNodes)
    {
      StringInputDialog dialog = new StringInputDialog(main.getShell(), "Query Neighborhood",
        "Enter UniProt or Entrez Gene ID", null);

      String ids = dialog.open();

      if (ids != null && ids.trim().length() > 0)
      {
        for (String id : ids.split(" "))
        {
View Full Code Here

      }
    }

    if (id == null)
    {
      StringInputDialog dialog = new StringInputDialog(main.getShell(), "ID Dialog",
        "Enter BioPAX ID of PhysicalEntity", null);

      id = dialog.open().trim();
    }

    if (id != null)
    {
      try
View Full Code Here

TOP

Related Classes of org.gvt.gui.StringInputDialog

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.