Commit e6f8f6c9 authored by Eric Duminil's avatar Eric Duminil
Browse files

RegionChooser: fxapp as private attribute.

parent 14e8c601
...@@ -193,7 +193,7 @@ public RegionChooserBrowser() { ...@@ -193,7 +193,7 @@ public RegionChooserBrowser() {
(ObservableValue<? extends State> ov, State oldState, State newState) -> { (ObservableValue<? extends State> ov, State oldState, State newState) -> {
if (newState == State.SUCCEEDED) { if (newState == State.SUCCEEDED) {
JSObject regionChooserJS = (JSObject) webEngine.executeScript("regionChooser"); JSObject regionChooserJS = (JSObject) webEngine.executeScript("regionChooser");
regionChooserJS.setMember("fxapp", fxapp); regionChooserJS.call("setFxApp", fxapp);
regionChooserJS.call("ready"); regionChooserJS.call("ready");
try { try {
fxapp.importNovaFactoryBoundingBoxes(); fxapp.importNovaFactoryBoundingBoxes();
......
...@@ -104,7 +104,7 @@ var regionChooser = (function(){ ...@@ -104,7 +104,7 @@ var regionChooser = (function(){
feature["source"] = "CityGML"; feature["source"] = "CityGML";
var citygmlHere; var citygmlHere;
if (fromJavaFX) { if (fromJavaFX) {
citygmlHere = publicScope.fxapp.checkIfCityGMLSAreAvailable(project, name); citygmlHere = fxapp.checkIfCityGMLSAreAvailable(project, name);
} }
feature["available"] = citygmlHere; feature["available"] = citygmlHere;
}); });
...@@ -228,7 +228,7 @@ var regionChooser = (function(){ ...@@ -228,7 +228,7 @@ var regionChooser = (function(){
if (proj4.defs(srsName)){ if (proj4.defs(srsName)){
$("html").addClass("wait"); $("html").addClass("wait");
console.log("Selected region is written in " + srsName + " coordinate system."); console.log("Selected region is written in " + srsName + " coordinate system.");
publicScope.fxapp.downloadRegionFromCityGML(sketchAsWKT(srsName), feature.get("project"), feature.get("name"), srsName); fxapp.downloadRegionFromCityGML(sketchAsWKT(srsName), feature.get("project"), feature.get("name"), srsName);
var end = new Date().getTime(); var end = new Date().getTime();
var time = end - start; var time = end - start;
console.log('DL Execution time: ' + time); console.log('DL Execution time: ' + time);
...@@ -306,7 +306,7 @@ var regionChooser = (function(){ ...@@ -306,7 +306,7 @@ var regionChooser = (function(){
}; };
novafactory_layer.selectSaveFile = function(zipFilename) { novafactory_layer.selectSaveFile = function(zipFilename) {
publicScope.fxapp.extractZIPtoGML(zipFilename); fxapp.extractZIPtoGML(zipFilename);
}; };
publicScope.downloadRegionFromNovaFACTORY = function(i) { publicScope.downloadRegionFromNovaFACTORY = function(i) {
...@@ -314,7 +314,7 @@ var regionChooser = (function(){ ...@@ -314,7 +314,7 @@ var regionChooser = (function(){
var feature = novafactory_vectors.getFeatures()[i]; var feature = novafactory_vectors.getFeatures()[i];
// Waiting 100ms in order to let the cursor change // Waiting 100ms in order to let the cursor change
setTimeout(function() { setTimeout(function() {
publicScope.fxapp.downloadRegion(sketchAsWKT(), feature.get('name'), novafactory_layer); fxapp.downloadRegion(sketchAsWKT(), feature.get('name'), novafactory_layer);
}, 100); }, 100);
} }
...@@ -326,19 +326,23 @@ var regionChooser = (function(){ ...@@ -326,19 +326,23 @@ var regionChooser = (function(){
featureProjection : ol.proj.get('EPSG:3857') featureProjection : ol.proj.get('EPSG:3857')
}); });
} }
function focusOnMap() { function focusOnMap() {
$('#map').focus(); $('#map').focus();
// $('#map').scrollIntoView(); // $('#map').scrollIntoView();
} }
publicScope.fxapp = undefined;
var fxapp = undefined;
publicScope.setFxApp = function(app){
fxapp = app;
}
// Executed by JavaFX when whole page is loaded. // Executed by JavaFX when whole page is loaded.
publicScope.ready = function() { publicScope.ready = function() {
fromJavaFX = true; fromJavaFX = true;
console.log = function(message){ console.log = function(message){
publicScope.fxapp.log(message); fxapp.log(message);
} }
console.log("READY!"); console.log("READY!");
} }
......
Markdown is supported
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