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 92054f7294cdeaf6712589ca346431dc8cdeb4bb..9f86345117dcb6f8b2679d837cbed0523e20189d 100644 --- a/simpleexample2/fxui/src/main/java/simpleex/ui/LatLongCellController.java +++ b/simpleexample2/fxui/src/main/java/simpleex/ui/LatLongCellController.java @@ -6,6 +6,8 @@ import java.util.Iterator; import javafx.geometry.Insets; 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; @@ -83,9 +85,17 @@ public class LatLongCellController { */ 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