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

added indicator for additional properties

this should fix issue 10
parent 2a9ca324
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 #53026 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;
}
}
......@@ -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);
......
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