Example #1
0
  /**
   * Move to the specified origin (in bins)
   *
   * @param newBinX new location X
   * @param newBinY new location Y
   */
  private void moveTo(double newBinX, double newBinY) {
    try {
      MatrixZoomData zd = getZd();

      final double wBins = (superAdapter.getHeatmapPanel().getWidth() / getScaleFactor());
      double maxX = zd.getXGridAxis().getBinCount() - wBins;

      final double hBins = (superAdapter.getHeatmapPanel().getHeight() / getScaleFactor());
      double maxY = zd.getYGridAxis().getBinCount() - hBins;

      double x = Math.max(0, Math.min(maxX, newBinX));
      double y = Math.max(0, Math.min(maxY, newBinY));

      xContext.setBinOrigin(x);
      yContext.setBinOrigin(y);

      superAdapter.repaint();
    } catch (Exception e) {
      e.printStackTrace();
    }

    if (linkedMode) {
      broadcastLocation();
    }
  }
Example #2
0
  // Note - this is an inefficient method, used to support tooltip text only.
  public float getNormalizedObservedValue(int binX, int binY) {
    float val = Float.NaN;
    try {
      val = getZd().getObservedValue(binX, binY, normalizationType);
    } catch (Exception e) {
      e.printStackTrace();
    }

    return val;
  }