Commit b9a9738f authored by Luna Riegel's avatar Luna Riegel
Browse files

Feat: Add CityObject retrieval passthrough for View

parent c3ec34c5
...@@ -119,6 +119,14 @@ public class CityDoctorModel { ...@@ -119,6 +119,14 @@ public class CityDoctorModel {
return globalErrors; return globalErrors;
} }
public CityObject getCityObject(GmlId gmlid){
CityObject co = cache.get(gmlid);
if(co == null){
throw new IllegalArgumentException("Requested CityObject " + gmlid +", which doesn't exist");
}
return co;
}
public File getFile() { public File getFile() {
return file; return file;
} }
......
...@@ -1604,6 +1604,15 @@ public class CityDoctorController { ...@@ -1604,6 +1604,15 @@ public class CityDoctorController {
return model; return model;
} }
public CityObject retrieveCityObject(GmlId gmlId) {
try{
return model.getCityObject(gmlId);
}catch(IllegalArgumentException e){
logger.warn(e.getMessage());
return null;
}
}
public void showView(View v) { public void showView(View v) {
v.fireOnShowEvent(model, currentChecker, mainWindow); v.fireOnShowEvent(model, currentChecker, mainWindow);
} }
......
...@@ -5,6 +5,7 @@ import de.hft.stuttgart.citydoctor2.check.ValidationConfiguration; ...@@ -5,6 +5,7 @@ import de.hft.stuttgart.citydoctor2.check.ValidationConfiguration;
import de.hft.stuttgart.citydoctor2.datastructure.BoundingBox; import de.hft.stuttgart.citydoctor2.datastructure.BoundingBox;
import de.hft.stuttgart.citydoctor2.datastructure.CityObject; import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
import de.hft.stuttgart.citydoctor2.datastructure.FeatureType; import de.hft.stuttgart.citydoctor2.datastructure.FeatureType;
import de.hft.stuttgart.citydoctor2.datastructure.GmlId;
import de.hft.stuttgart.citydoctor2.gui.logger.GuiLogger; import de.hft.stuttgart.citydoctor2.gui.logger.GuiLogger;
import de.hft.stuttgart.citydoctor2.gui.tree.Renderable; import de.hft.stuttgart.citydoctor2.gui.tree.Renderable;
import de.hft.stuttgart.citydoctor2.gui.tree.RenderableTreeCell; import de.hft.stuttgart.citydoctor2.gui.tree.RenderableTreeCell;
...@@ -830,6 +831,9 @@ public class MainWindow extends Application { ...@@ -830,6 +831,9 @@ public class MainWindow extends Application {
node.getFeatureExportAction(this); node.getFeatureExportAction(this);
} }
public CityObject retrieveCityObject(GmlId id){
return controller.retrieveCityObject(id);
}
private void setupSelectListener(TreeView<Renderable> view) { private void setupSelectListener(TreeView<Renderable> view) {
view.getSelectionModel().selectedItemProperty().addListener((obs, oldI, newI) -> { view.getSelectionModel().selectedItemProperty().addListener((obs, oldI, newI) -> {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment