@Override public void execute() { // store the data in an accessible way organiseData(); // get the unit List<IStoreItem> outputs = new ArrayList<IStoreItem>(); // put the names into a string String title = _tx.getName() + " and " + _rx.getName(); // ok, generate the new series IQuantityCollection<?> target = getOutputCollection(title); outputs.add(target); // store the output super.addOutput(target); // start adding values. performCalc(outputs); // tell each series that we're a dependent Iterator<ICollection> iter = data.values().iterator(); while (iter.hasNext()) { ICollection iCollection = iter.next(); iCollection.addDependent(this); } // ok, done List<IStoreItem> res = new ArrayList<IStoreItem>(); res.add(target); getStore().addAll(res); }
public Collection<ICommand<IStoreItem>> actionsFor( List<IStoreItem> selection, IStore destination) { Collection<ICommand<IStoreItem>> res = new ArrayList<ICommand<IStoreItem>>(); if (appliesTo(selection)) { StoreGroup groupA = (StoreGroup) selection.get(0); StoreGroup groupB = (StoreGroup) selection.get(1); ICommand<IStoreItem> newC = new DopplerShiftOperation( null, groupA, groupB, destination, "Doppler between tracks (from " + groupA.getName() + ")", "Calculate doppler between two tracks", selection); res.add(newC); newC = new DopplerShiftOperation( null, groupB, groupA, destination, "Doppler between tracks (from " + groupB.getName() + ")", "Calculate doppler between two tracks", selection); res.add(newC); } return res; }