public abstract class ModelUpdate {
- private GraphChanges changes;
+ private Resource oldModel; // old model that is going to be updated (User modified model)
+ private Resource newModel; // new model that contains the updates (New design model)
+ private Resource originalModel; // original model (optional) that is used for detecting and retaining user made changes (Old design model)
+
+ private GraphChanges changes; // changes between old /new
private UpdateTree updateTree;
private UpdateList updateList;
- private GraphChanges changes2;
+ private GraphChanges changes2; // changes between original / old
private UpdateTree updateTree2;
private UpdateList updateList2;
- private GraphChanges changes3;
+ private GraphChanges changes3; // changes between original / new
private UpdateTree updateTree3;
private UpdateList updateList3;
setInput(oldModel, newModel, null, false);
}
+ /**
+ * Initialises the ModelUpdate with given input
+ * @param oldModel the model that is going to be updated (User modified model)
+ * @param newModel the model containing updates (New design model)
+ * @param originalModel the model that is used for detecting and retaining user made changes (Old design model). Parameter can be null.
+ * @param newDistinct when originalModel is given, additions to the old and the new model (when compared to the original model) are forced to be distinct.
+ * @throws DatabaseException
+ */
public void setInput(Resource oldModel, Resource newModel, Resource originalModel, boolean newDistinct) throws DatabaseException{
+ this.oldModel = oldModel;
+ this.newModel = newModel;
+ this.originalModel = originalModel;
addFilters(filters);
if (originalModel != null) {
// tree way comparison
if (originalModel != null) {
- createDefaultSelections();
+ defaultSelections();
}
init = true;
}
+ public Resource getOldModel() {
+ return oldModel;
+ }
+
+ public Resource getNewModel() {
+ return newModel;
+ }
+
+ public Resource getOriginalModel() {
+ return originalModel;
+ }
+
public boolean isInit() {
return init;
}
}
}
- protected void createDefaultSelections() {
+ public void defaultSelections() {
+ if (changes3 == null) {
+ return;
+ }
// select all changes
for (Entry<Resource, UpdateOp> op : updateTree.getUpdateOps().getResourceMap().entrySet()) {
op.getValue().select(true);