Exemple #1
0
 void removeDisplay(int index) {
   waitCursor();
   dtypeV.removeElementAt(index);
   setupImg();
   // sbPos = getEvtXCord (begTime);
   // sbPos = getW( currImg.begT, begTime );
   sbPos = getEvtXCord(begTime - FrameBegTime);
   currImg = img[0];
   adjustZoomImg(sbPos);
   panePosX = _xPix + getW(currImg.begT, begTime);
   parent.zoomH();
   normalCursor();
 }
Exemple #2
0
  /** This function renders in viewport view corresponding to given start and end times */
  void changeExTime(double start, double end) {
    double diff = end - start;
    if (diff <= 0.0) return;

    // int pos = getW (0, start);
    int pos = getW(FrameBegTime, start);
    parent.hbar.setValue(pos); // Position the scrollbar at the start time
    parent.setPosition(pos); // render the view with this start time

    // Now zoom in/out so that the end time corresponds with the given one.
    zoomH((endTime - begTime) / diff);
    parent.zoomH();
  }
Exemple #3
0
 void addDisplay(int dtype) {
   waitCursor();
   dtypeV.addElement(new Integer(dtype));
   setupImg();
   // sbPos = getEvtXCord (begTime);
   // sbPos = getW( currImg.begT, begTime );
   sbPos = getEvtXCord(begTime - FrameBegTime);
   currImg = img[0];
   adjustZoomImg(sbPos);
   panePosX = _xPix + getW(currImg.begT, begTime);
   parent.zoomH();
   normalCursor();
 }
Exemple #4
0
  /** This function renders in viewport view corresponding to given start and current end times */
  void changeFromTime(double start) {
    if (start >= endTime || start < 0) {
      new ErrorDiag(null, "value must be >= 0 and < " + Double.toString(endTime));
      return;
    }

    double diff = endTime - start;

    // int pos = getW (0, start);
    int pos = getW(FrameBegTime, start);
    parent.hbar.setValue(pos); // Position the scrollbar at the start time
    parent.setPosition(pos); // render the view with this start time

    // Now zoom in/out so that the end time corresponds with the given one.
    zoomH((endTime - begTime) / diff);
    parent.zoomH();
  }
Exemple #5
0
  /** Method called whenver the canvas has to be resized */
  void Resize() {
    waitCursor();

    Dimension dimVP = parent.vport.getExtentSize();
    widthCan = dimVP.width;
    heightCan = dimVP.height;

    _xPix = 3 * widthCan;
    _yPix = heightCan;

    if (_yPix < 1) _yPix = 1;
    if (_xPix < 1) _xPix = 1;

    //  Calling both methods may not be needed
    //  setPreferredSize( getPreferredSize() );
    setSize(getPreferredSize());

    maxT = tMaxT;
    xDensity = (widthCan / maxT) * zoomH;
    maxT += (endGap / xDensity);
    xDensity = (widthCan / maxT) * zoomH;

    //  setupImg() HAS to be called in every call of Resize(),
    //  So window redraws can be done correctly.   Resize() is called
    //  by componentResized() which is called when window is resized
    updateH();
    setupImg();

    if (setupComplete) {
      // sbPos = getEvtXCord (begTime);
      // sbPos = getW(currImg.begT, begTime);
      sbPos = getEvtXCord(begTime - FrameBegTime);
      currImg = img[0];
      adjustZoomImg(sbPos);
    } else drawInitImg();

    panePosX = _xPix + getW(currImg.begT, begTime);
    parent.zoomH();
    normalCursor();
  }