Beispiel #1
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();
  }
Beispiel #2
0
 /**
  * causes the histogram frame to be displayed for the given state name
  */
 private void getStateHistogram( String name )
 {
     waitCursor();
     parent.waitCursor();
     parent.canvas.waitCursor();
     parent.init_win.waitCursor();
     RecDef def = getRecDef( name );
     if ( def != null ) 
         hists.addElement( new Histwin( def, parent ) );
     parent.init_win.normalCursor();
     parent.canvas.normalCursor();
     parent.normalCursor();
     normalCursor();
 }
Beispiel #3
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();
  }
Beispiel #4
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();
 }
Beispiel #5
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();
 }
Beispiel #6
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();
  }
Beispiel #7
0
  //  private void adjustPosition()
  public void adjustPosition() {
    StateGroup group;
    StateInterval state;
    double duration;
    double max_duration = 0;

    Enumeration groups = all_states.visible.elements();
    while (groups.hasMoreElements()) {
      group = (StateGroup) groups.nextElement();
      if (group.size() > 0) {
        state = (StateInterval) group.lastElement();
        duration = state.info.endT - FrameBegTime;
        if (duration > max_duration) max_duration = duration;
      }
    }

    boolean end = false;

    if (max_duration < tMaxT || max_duration > tMaxT) {
      if (max_duration < tMaxT) end = true;
      double diff = tMaxT - max_duration;
      tMaxT = max_duration;
      maxT -= diff;
      updateH();
      parent.setHoriz();
      centralizeH();
    }

    if (end) {
      if ((parent.hbar.getValue() + parent.hbar.getVisibleAmount()) >= parent.hbar.getMaximum()) {
        parent.hbar.setValue(maxH - widthCan);
        adjustImgH(parent.hbar.getValue());
        parent.vport.setViewPosition(new Point(panePosX, 0));
        debug.println("adjustPosition() : ");
        debug.println("\t" + "parent.hbar.setValue(" + (maxH - widthCan) + ")");
        debug.println("\t" + "parent.vport.setViewPosition(" + panePosX + ", 0)");
      }
    }
  }
Beispiel #8
0
 /** Handle the event when JViewport is resized */
 public void componentResized(ComponentEvent e) {
   debug.println("*******" + "___componentResized()___ : start!");
   parent.waitCursor();
   if (parent.setupComplete) Resize();
   parent.normalCursor();
 }
Beispiel #9
0
 void adjustElTimeField() {
   parent.adjustElTimeField(currTime - elapsedPoint);
 }
Beispiel #10
0
 /** Adjust field values */
 void adjustTimeField(int x) {
   cursorPos = (x - _xPix);
   parent.adjustTimeField(currTime = currImg.begT + getTime(cursorPos));
 }