コード例 #1
0
 /* (non-Javadoc)
  * @see de.artcom.timeline.controller.TimeRangeController#mouseDragged(java.awt.event.MouseEvent)
  */
 @Override
 public void mouseDragged(MouseEvent e) {
   super.mouseDragged(e);
   boolean _myPressedShift =
       (e.getModifiersEx() & MouseEvent.SHIFT_DOWN_MASK) == MouseEvent.SHIFT_DOWN_MASK;
   if (_myPressedShift) {
     switch (_myLoopAction) {
       case MOVE_END:
         _myTrackDataController
             .trackData()
             .scaleRange(_myLoopStart, _myLoopEnd, _myNewLoopStart, _myNewLoopEnd);
         break;
       case MOVE_BOTH:
         if (_myMoveList == null) break;
         for (ControlPoint myPoint : _myMoveList) {
           _myTrackDataController
               .trackData()
               .move(
                   myPoint,
                   new ControlPoint(
                       myPoint.time() + (_myNewLoopStart - _myLoopStart), myPoint.value()));
         }
         break;
       default:
         break;
     }
   }
 }
コード例 #2
0
  public ArrayList<ControlPoint> prepareInsertion(
      double theInsertionPoint, double theRange, TrackData theModel) {

    //		double myLowValue = theModel.getValue(theInsertionPoint);
    //		double myHighValue = theModel.getValue(theInsertionPoint + theRange);

    // first we need a copy of our last selected points
    ArrayList<ControlPoint> myInsertion = new ArrayList<ControlPoint>();
    for (ControlPoint myControlPoint : _myLastSelection) {
      myInsertion.add(myControlPoint.clone());
    }

    // then add the first and the last point (
    //		myInsertion.add(0, new ControlPoint(_myLastLowerBound, myLowValue));
    //		myInsertion.add(new ControlPoint(_myLastUpperBound, myHighValue));

    for (ControlPoint myPoint : myInsertion) {
      myPoint.time(myPoint.time() - _myLastLowerBound);
    }

    return myInsertion;
  }