Example #1
0
 public void createDataPanels() {
   removeAll();
   for (ReferenceFrame f : FrameManager.getFrames()) {
     if (f.isVisible()) {
       DataPanel dp = new DataPanel(f, this);
       add(dp);
     }
   }
   invalidate();
 }
Example #2
0
  private void autoscaleGroup(List<Track> trackList) {

    List<ReferenceFrame> frames =
        FrameManager.isGeneListMode()
            ? FrameManager.getFrames()
            : Arrays.asList(FrameManager.getDefaultFrame());

    List<Range> inViewRanges = new ArrayList<Range>();

    synchronized (trackList) {
      for (Track track : trackList) {
        if (track instanceof ScalableTrack) {
          for (ReferenceFrame frame : frames) {
            Range range = ((ScalableTrack) track).getInViewRange(frame);
            if (range != null) {
              inViewRanges.add(range);
            }
          }
        }
      }

      if (inViewRanges.size() > 0) {

        Range inter = computeScale(inViewRanges);

        for (Track track : trackList) {

          DataRange dr = track.getDataRange();
          float min = Math.min(0, inter.min);
          float base = Math.max(min, dr.getBaseline());
          float max = inter.max;
          // Pathological case where min ~= max  (no data in view)
          if (max - min <= (2 * Float.MIN_VALUE)) {
            max = min + 1;
          }

          DataRange newDR = new DataRange(min, base, max, dr.isDrawBaseline());
          newDR.setType(dr.getType());
          track.setDataRange(newDR);
        }
      }
    }
  }