Commit 074aacd0 authored by George Adrian Stoica's avatar George Adrian Stoica

Merge branch 'issue-10-display-latlong-metadata-in-the-fx-ui' into...

Merge branch 'issue-10-display-latlong-metadata-in-the-fx-ui' into issue-11-allow-user-to-enter-and-update-metadata-about-the-latlong-points
parents 3d030784 57aca30b
Pipeline #53027 passed with stage
in 2 minutes and 7 seconds
......@@ -278,4 +278,24 @@ public class MetaData {
}
}
}
/**
* Convenience method to check if the metadat contains custom properties
* that is other properties than the name and description
* @return true if there are any properties apart from name and description false otherwise
*/
public boolean hasCustomProperties() {
boolean result = false;
final Iterator<String> props = this.propertyNames();
if(props.hasNext()) {
while (props.hasNext()) {
final String propName = props.next();
if((propName!=NAME_PROPERTY)&&(propName!=DESCRIPTION_PROPERTY)) {
result = true;
break;
}
}
}
return result;
}
}
......@@ -10,6 +10,8 @@ import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;
......@@ -93,9 +95,17 @@ private LatLongCell latLongCell;
*/
protected void prepareView(boolean selected) {
this.hBox = new HBox();
this.hBox.setSpacing(3.0);
this.coordinatesLabel = new Label(this.latLong.toString());
coordinatesLabel.setPrefWidth(200.0);
coordinatesLabel.setPrefWidth(180.0);
this.hBox.getChildren().add(coordinatesLabel);
if (this.latLong.hasMetaData()) {
if(this.latLong.getMetaData().hasCustomProperties()) {
this.hBox.getChildren().add(new ImageView(new Image(getClass().getResourceAsStream((selected?"i_selected.png":"i.png")))));
}
}
if(selected) {
this.editMetadataButton = new Button("...");
this.hBox.getChildren().add(editMetadataButton);
......
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