Skip to content
Snippets Groups Projects
Commit 80ccb3f5 authored by George Adrian Stoica's avatar George Adrian Stoica
Browse files

added the cell renderer to the list inside AbstractFxAppController

parent 707d1f61
No related branches found
No related tags found
1 merge request!6Issue 11 allow user to enter and update metadata about the latlong points
...@@ -12,7 +12,9 @@ import javafx.geometry.Point2D; ...@@ -12,7 +12,9 @@ import javafx.geometry.Point2D;
import javafx.scene.Node; import javafx.scene.Node;
import javafx.scene.control.Alert; import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType; import javafx.scene.control.Alert.AlertType;
import javafx.util.Callback;
import javafx.scene.control.ButtonType; import javafx.scene.control.ButtonType;
import javafx.scene.control.ListCell;
import javafx.scene.control.ListView; import javafx.scene.control.ListView;
import javafx.scene.control.Slider; import javafx.scene.control.Slider;
import simpleex.core.LatLong; import simpleex.core.LatLong;
...@@ -84,6 +86,13 @@ public abstract class AbstractFxAppController { ...@@ -84,6 +86,13 @@ public abstract class AbstractFxAppController {
// the location list // the location list
locationListView.getSelectionModel().selectedIndexProperty() locationListView.getSelectionModel().selectedIndexProperty()
.addListener((prop, oldValue, newValue) -> updateMapMarker(true)); .addListener((prop, oldValue, newValue) -> updateMapMarker(true));
//connect the cell renderer to the list
locationListView.setCellFactory(new Callback<ListView<LatLong>, ListCell<LatLong>>() {
@Override
public ListCell<LatLong> call(ListView<LatLong> listView) {
return new LatLongCell();
}
});
} }
private void handleMapDragged(final Node node, final double dx, final double dy) { private void handleMapDragged(final Node node, final double dx, final double dy) {
...@@ -157,6 +166,7 @@ public abstract class AbstractFxAppController { ...@@ -157,6 +166,7 @@ public abstract class AbstractFxAppController {
if (selectedIndex >= 0 && selectedIndex < latLongs.length) { if (selectedIndex >= 0 && selectedIndex < latLongs.length) {
locationListView.getSelectionModel().select(selectedIndex); locationListView.getSelectionModel().select(selectedIndex);
} }
} }
private ObjectMapper objectMapper; private ObjectMapper objectMapper;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment