diff --git a/simpleexample2/core/src/main/java/simpleex/core/MetaData.java b/simpleexample2/core/src/main/java/simpleex/core/MetaData.java index bd8d8d4212c7493ec950b2078d3ea5ab67bdd6de..0395ec312c54464ef107b82b117cc172d26d7b6d 100644 --- a/simpleexample2/core/src/main/java/simpleex/core/MetaData.java +++ b/simpleexample2/core/src/main/java/simpleex/core/MetaData.java @@ -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; + } } diff --git a/simpleexample2/fxui/src/main/java/simpleex/ui/LatLongCellController.java b/simpleexample2/fxui/src/main/java/simpleex/ui/LatLongCellController.java index 779d60900553d94764496185852aa7dfa4e80ecb..4bc5b3da9fac4ae3a500e3d89783a2d1ff4e9e46 100644 --- a/simpleexample2/fxui/src/main/java/simpleex/ui/LatLongCellController.java +++ b/simpleexample2/fxui/src/main/java/simpleex/ui/LatLongCellController.java @@ -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); diff --git a/simpleexample2/fxui/src/main/resources/simpleex/ui/i.png b/simpleexample2/fxui/src/main/resources/simpleex/ui/i.png new file mode 100644 index 0000000000000000000000000000000000000000..1460dbb35089acf6bf1dde84aae34a45d6f48bfc Binary files /dev/null and b/simpleexample2/fxui/src/main/resources/simpleex/ui/i.png differ diff --git a/simpleexample2/fxui/src/main/resources/simpleex/ui/i_selected.png b/simpleexample2/fxui/src/main/resources/simpleex/ui/i_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..1c9c9515d2c2131918c0f527bf4d034a68bf04c2 Binary files /dev/null and b/simpleexample2/fxui/src/main/resources/simpleex/ui/i_selected.png differ