Exemplo n.º 1
0
  private void processPanel(Session session, Element element, HashMap additionalInformation) {
    panelElementPresent = true;
    String panelName = element.getAttribute("name");
    if (panelName == null) {
      panelName = "Panel" + panelCounter++;
    }

    List<Track> panelTracks = new ArrayList();
    NodeList elements = element.getChildNodes();
    for (int i = 0; i < elements.getLength(); i++) {
      Node childNode = elements.item(i);
      if (childNode.getNodeName().equalsIgnoreCase(SessionElement.DATA_TRACK.getText())
          || // Is this a track?
          childNode.getNodeName().equalsIgnoreCase(SessionElement.TRACK.getText())) {

        List<Track> tracks = processTrack(session, (Element) childNode, additionalInformation);
        if (tracks != null) {
          panelTracks.addAll(tracks);
        }
      } else {
        process(session, childNode, additionalInformation);
      }
    }

    TrackPanel panel = IGV.getInstance().getTrackPanel(panelName);
    panel.addTracks(panelTracks);
  }
Exemplo n.º 2
0
  private void addLeftoverTracks(Collection<List<Track>> tmp) {
    Map<String, TrackPanel> trackPanelCache = new HashMap();
    if (version < 3 || !panelElementPresent) {
      for (List<Track> tracks : tmp) {
        for (Track track : tracks) {
          if (track != geneTrack && track != seqTrack && track.getResourceLocator() != null) {

            TrackPanel panel = trackPanelCache.get(track.getResourceLocator().getPath());
            if (panel == null) {
              panel = IGV.getInstance().getPanelFor(track.getResourceLocator());
              trackPanelCache.put(track.getResourceLocator().getPath(), panel);
            }
            panel.addTrack(track);
          }
        }
      }
    }
  }