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

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
No related branches found
No related tags found
1 merge request!6Issue 11 allow user to enter and update metadata about the latlong points
Pipeline #53027 passed
......@@ -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);
......
simpleexample2/fxui/src/main/resources/simpleex/ui/i.png

525 B

simpleexample2/fxui/src/main/resources/simpleex/ui/i_selected.png

609 B

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