Esempio n. 1
0
  /**
   * Updates the bottom part of the {@link RegIntTab} with information about the Xref selected in
   * the top part of RIPTab and its interaction
   *
   * @param xref one of the interaction partners (displayed in the top part of the RIPTAB) of the
   *     Xref selected in the main pathway
   * @param results the results object from updating the top part of the RIPTab by selecting an Xref
   *     in the main pathway
   */
  public void updateBackpagePanel(Xref xref, ResultsObj results) {
    backpagePanel.removeAll();
    backpagePanel.setLayout(new BoxLayout(backpagePanel, BoxLayout.PAGE_AXIS));

    PathwayElement e = PathwayElement.createPathwayElement(ObjectType.DATANODE);
    e.setDataSource(xref.getDataSource());
    e.setElementID(xref.getId());
    BackpageTextProvider bpt = new BackpageTextProvider();

    bpt.addBackpageHook(new BackpageInfo(swingEngine.getGdbManager().getCurrentGdb(), results));
    // TODO: fix file table, doesn't always show files
    bpt.addBackpageHook(new BackpageFileTable(results, plugin));
    bpt.addBackpageHook(new BackpagePMID(results));
    // TODO: change this to use multiple BridgeDb databases?
    bpt.addBackpageHook(
        new BackpageTextProvider.BackpageXrefs(swingEngine.getGdbManager().getCurrentGdb()));
    bpt.addBackpageHook(new BackpageExpression(plugin.getDesktop().getGexManager()));
    bpt.addBackpageHook(new BackpageMiscInfo(results));
    BackpagePane bpp = new BackpagePane(bpt, swingEngine.getEngine());
    bpp.setInput(e);

    bpp.addHyperlinkListener(
        new HyperlinkListener() {

          @Override
          public void hyperlinkUpdate(HyperlinkEvent e) {
            if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
              try {
                Desktop.getDesktop().browse(e.getURL().toURI());
              } catch (IOException e1) {
                e1.printStackTrace();
              } catch (URISyntaxException e1) {
                e1.printStackTrace();
              }
            }
          }
        });
    backpagePanel.add(bpp);

    backpagePanel.revalidate();
    backpagePanel.repaint();
  }