package org.skyve.metadata.view.model.map;

import org.locationtech.jts.geom.Geometry;

public class MapFeature {
	private Geometry geometry;
	private boolean zoomable = true;
	private boolean editable = false;
	private String strokeColour;
	private String fillColour;
	private String fillOpacity;
	private String iconRelativeFilePath;
	private Integer iconAnchorX;
	private Integer iconAnchorY;

	public MapFeature() {
	}

	public MapFeature(Geometry geometry,
						boolean zoomable,
						boolean editable,
						String strokeColour,
						String fillColour,
						String fillOpacity,
						String iconRelativeFilePath,
						Integer iconAnchorX,
						Integer iconAnchorY) {
		this.geometry = geometry;
		this.zoomable = zoomable;
		this.editable = editable;
		this.strokeColour = strokeColour;
		this.fillColour = fillColour;
		this.fillOpacity = fillOpacity;
		this.iconRelativeFilePath = iconRelativeFilePath;
		this.iconAnchorX = iconAnchorX;
		this.iconAnchorY = iconAnchorY;
	}

	public Geometry getGeometry() {
		return geometry;
	}

	public void setGeometry(Geometry geometry) {
		this.geometry = geometry;
	}

	public boolean isZoomable() {
		return zoomable;
	}

	public void setZoomable(boolean zoomable) {
		this.zoomable = zoomable;
	}

	public boolean isEditable() {
		return editable;
	}

	public void setEditable(boolean editable) {
		this.editable = editable;
	}

	public String getStrokeColour() {
		return strokeColour;
	}

	public void setStrokeColour(String strokeColour) {
		this.strokeColour = strokeColour;
	}

	public String getFillColour() {
		return fillColour;
	}

	public void setFillColour(String fillColour) {
		this.fillColour = fillColour;
	}

	public String getFillOpacity() {
		return fillOpacity;
	}

	public void setFillOpacity(String fillOpacity) {
		this.fillOpacity = fillOpacity;
	}

	public String getIconRelativeFilePath() {
		return iconRelativeFilePath;
	}

	public void setIconRelativeFilePath(String iconRelativeFilePath) {
		this.iconRelativeFilePath = iconRelativeFilePath;
	}

	public Integer getIconAnchorX() {
		return iconAnchorX;
	}

	public void setIconAnchorX(Integer iconAnchorX) {
		this.iconAnchorX = iconAnchorX;
	}

	public Integer getIconAnchorY() {
		return iconAnchorY;
	}

	public void setIconAnchorY(Integer iconAnchorY) {
		this.iconAnchorY = iconAnchorY;
	}
}

@@ -267,30 +267,29 @@
 r;%0A%09private 
-String
+Float
  fillOpacity
@@ -454,19 +454,16 @@
 ometry,%0A
-%09%09%09
 %09%09%09boole
@@ -478,19 +478,16 @@
 ble,%0A%09%09%09
-%09%09
-%09
 boolean 
@@ -496,19 +496,16 @@
 itable,%0A
-%09%09%09
 %09%09%09Strin
@@ -512,35 +512,32 @@
 g strokeColour,%0A
-%09%09%09
 %09%09%09String fillCo
@@ -545,25 +545,21 @@
 our,%0A%09%09%09
-%09%09%09String
+Float
  fillOpa
@@ -567,19 +567,16 @@
 ity,%0A%09%09%09
-%09
-%09%09
 String i
@@ -596,19 +596,16 @@
 lePath,%0A
-%09%09%09
 %09%09%09Integ
@@ -620,19 +620,16 @@
 nchorX,%0A
-%09%09%09
 %09%09%09Integ
@@ -800,22 +800,20 @@
 lour;%0A%09%09
-this.f
+setF
 illOpaci
@@ -806,35 +806,33 @@
 %09%09setFillOpacity
- = 
+(
 fillOpacity;%0A%09%09t
@@ -826,16 +826,17 @@
 lOpacity
+)
 ;%0A%09%09this
@@ -1645,38 +1645,37 @@
 ur;%0A%09%7D%0A%0A%09public 
-String
+float
  getFillOpacity(
@@ -1709,57 +1709,415 @@
 %7D%0A%0A%09
-public void setFillOpacity(String fillOpacity) %7B%0A
+/**%0A%09 * Set the fill opacity of this map feature. Expects a float between 0.0 (fully transparent) and 1.0 (fully opaque).%0A%09 * %0A%09 * @param fillOpacity The fill opacity of the feature%0A%09 */%0A%09public void setFillOpacity(Float fillOpacity) %7B%0A%09%09if (fillOpacity != null) %7B%0A%09%09%09if (fillOpacity.floatValue() %3E 1.0) %7B%0A%09%09%09%09fillOpacity = 1.0f;%0A%09%09%09%7D%0A%09%09%09if (fillOpacity.floatValue() %3C 0.0) %7B%0A%09%09%09%09fillOpacity = 0.0f;%0A%09%09%09%7D%0A%0A%09
 %09%09th
@@ -2142,24 +2142,28 @@
 illOpacity;%0A
+%09%09%7D%0A
 %09%7D%0A%0A%09public 

Update MapFeature fillOpacity to be a Float instead of a String and perform range checking