public void replace() { if (_myLastSelection.size() == 0) { return; } TrackData myModel = _myTrackDataController.trackData(); double myRange = _myLastUpperBound - _myLastLowerBound; ArrayList<ControlPoint> myInsertion = prepareInsertion(_myTimeRange.start(), myRange, myModel); myModel.replaceAll(_myTimeRange.start(), myRange, myInsertion); _myTrackDataController.view().render(); }
public void insert() { if (_myLastSelection.size() == 0) { return; } TrackData myModel = _myTrackDataController.trackData(); ArrayList<ControlPoint> myInsertion = prepareInsertion(_myTimeRange.start(), 0, myModel); // insert last selection at lower bound of current selection myModel.insertAll(_myTimeRange.start(), _myTimeRange.range(), myInsertion); _myTrackDataController.view().render(); }
public void cut() { copy(); TrackData myTrackData = _myTrackDataController.trackData(); ArrayList<ControlPoint> myRange = myTrackData.copyRange(_myTimeRange.start(), _myTimeRange.end()); myTrackData.removeAll(_myTimeRange.start(), _myTimeRange.end()); UndoHistory.instance() .apply(new CutAction(_myTrackDataController, myRange, _myTimeRange.clone())); _myTrackDataController.view().render(); }
public void copy() { TrackData myTrackData = _myTrackDataController.trackData(); // double myLowValue = myTrackData.getValue(_myTimeRange.start()); // double myHighValue = myTrackData.getValue(_myTimeRange.end()); ArrayList<ControlPoint> myRange = myTrackData.copyRange(_myTimeRange.start(), _myTimeRange.end()); _myLastSelection = new ArrayList<ControlPoint>(); _myLastLowerBound = _myTimeRange.start(); _myLastUpperBound = _myTimeRange.end(); // _myLastSelection.add(new ControlPoint(_myTimeRange.start(), myLowValue)); _myLastSelection.addAll(myRange); // _myLastSelection.add(new ControlPoint(_myTimeRange.end(), myHighValue)); }
public void cutTime(TrackView theTimelinePanel) { TrackData myModel = _myTrackDataController.trackData(); _myLastSelection = myModel.copyRange(_myTimeRange.start(), _myTimeRange.end()); myModel.cutRange(_myTimeRange.start(), _myTimeRange.end()); _myTrackDataController.view().render(); }