Creates FillOptions out of a Feature.

@param feature feature to be converted
434081
@Nullable
  static FillOptions fromFeature(@NonNull Feature feature) {
    if (feature.geometry() == null) {
      throw new RuntimeException("geometry field is required");
    }
    if (!(feature.geometry() instanceof Polygon)) {      return null;
    }

    FillOptions options = new FillOptions();
    options.geometry = (Polygon) feature.geometry();
    if (feature.hasProperty(PROPERTY_FILL_OPACITY)) {
      options.fillOpacity = feature.getProperty(PROPERTY_FILL_OPACITY).getAsFloat();
    }
    if (feature.hasProperty(PROPERTY_FILL_COLOR)) {
      options.fillColor = feature.getProperty(PROPERTY_FILL_COLOR).getAsString();
    }
    if (feature.hasProperty(PROPERTY_FILL_OUTLINE_COLOR)) {
      options.fillOutlineColor = feature.getProperty(PROPERTY_FILL_OUTLINE_COLOR).getAsString();
    }
    if (feature.hasProperty(PROPERTY_FILL_PATTERN)) {
      options.fillPattern = feature.getProperty(PROPERTY_FILL_PATTERN).getAsString();
    }
    if (feature.hasProperty(PROPERTY_IS_DRAGGABLE)) {
      options.isDraggable = feature.getProperty(PROPERTY_IS_DRAGGABLE).getAsBoolean();
    }
    return options;
  }
619901
public void addFeaturePath( String featurePath, String filter ) {
        if (!featurePaths.contains(featurePath)) {
            featurePaths.add(featurePath);
            if (filter == null) {
                filter = "";
            }
            featureFilter.add(filter);
        }
    }
185149
function(feature) {
        this.layer.removeFeatures(this.vertices, {silent: true});
        this.vertices = [];
        this.layer.destroyFeatures(this.virtualVertices, {silent: true});
        this.virtualVertices = [];
        if(this.dragHandle) {
            this.layer.destroyFeatures([this.dragHandle], {silent: true});
            delete this.dragHandle;
        }
        if(this.radiusHandle) {
            this.layer.destroyFeatures([this.radiusHandle], {silent: true});
            delete this.radiusHandle;
        }
        this.layer.drawFeature(this.feature, 'default');
        this.feature = null;
        OpenLayers.Util.removeItem(this.layer.selectedFeatures, feature);
        this.onModificationEnd(feature);
        this.layer.events.triggerEvent("afterfeaturemodified", {
            feature: feature,
            modified: this.modified
        });
        this.modified = false;
    }
455484
@SuppressWarnings("PMD.NPathComplexity")
    protected static void processAssigneeData(Feature feature, JSONObject assignee) {
        if (assignee == null) {
            return;
        }
        String key = getString(assignee, "key");
        String name = getString(assignee, "name");
        String displayName = getString(assignee, "displayName");
        feature.setsOwnersID(key != null ? Collections.singletonList(key) : Collections.EMPTY_LIST);
        feature.setsOwnersUsername(name != null ? Collections.singletonList(name) : Collections.EMPTY_LIST);
        feature.setsOwnersShortName(feature.getsOwnersUsername());
        feature.setsOwnersFullName(displayName != null ? Collections.singletonList(displayName) : Collections.EMPTY_LIST);
    }
761221
public void addFeature(String feature) {
        if (feature == null) {
            throw new IllegalArgumentException("Invalid null argument passed for addFeature");
        }
        feature = feature.trim();
        if (!feature.isEmpty()) { 
            Feature newFeature = new Feature();
            newFeature.addText(feature);
            featureList.add(newFeature);
        }
    }
106875
function(features, geometry) {
        for(var i=0, len=features.length; i<len; ++i) {
            if(features[i].geometry === geometry) {
                features.splice(i, 1);
                break;
            }
        }
    }
1200287
public Set<Feature> getFeature(FeatureEnum feature)
  {
    return ImmutableSet.copyOf(features.get(feature));
  }
1321175
private ShapeStyle createStyleForFeature(Feature feature) {
		ShapeStyle style = null;
		if (null != feature) {
			FeatureStyleInfo styleInfo = null;
			if (feature.getStyleId() != null) {
				String check = feature.getStyleId();
				if (null != check) {
					for (FeatureStyleInfo fsi :
							feature.getLayer().getLayerInfo().getNamedStyleInfo().getFeatureStyles()) {
						if (check.equals(fsi.getStyleId())) {
							styleInfo = fsi;
							break;
						}
					}
				}
			}
			style = new ShapeStyle(styleInfo);
	
			Geometry geometry = feature.getGeometry();
			if (null != geometry) {
				switch (geometry.getLayerType()) {
					case LINESTRING:
					case MULTILINESTRING:
						style.merge(lineSelectStyle);
						break;
					case POLYGON:
					case MULTIPOLYGON:
						style.merge(polygonSelectStyle);
						break;
					case POINT:
					case MULTIPOINT:
						style.merge(pointSelectStyle);
						break;
					default:
						throw new IllegalStateException("Cannot create style for feature with Geometry type " +
								geometry.getLayerType());
				}
			}
		}
		return style;
	}
79542
public boolean containsFeature(Feature feature) {
		switch (feature) {
			case DRILLDOWN:
				return !getDrilldownOptions().isEmpty();
			case GLOBAL:
				return getGlobal() != null;
			case INTERACTION:
				return !getInteractionFunctions().isEmpty();
			case LIVEDATA:
				return !getLiveDataSeries().isEmpty();
			case SELECTION:
				return !getSelectionFunctions().isEmpty();
			default:
				throw new UnsupportedFeatureException(feature);
		}
	}
33284
public static <A, B, C> FeatureGenerator<A, C> convertingFeatureGenerator(
      FeatureGenerator<B, C> generator, Function<A, B> converter) {
    return new ConvertingFeatureGenerator<A, B, C>(generator, converter);
  }
742153
public <C extends Feature> C get(Class<C> feature)
    {
        final Feature found = typeToFeature.get(feature);
        if (found != null)
        {
            return feature.cast(found);
        }
        throw new LionEngineException(ERROR_FEATURE_NOT_FOUND + feature.getName());
    }
100014
private void _addFeatureOnce(Object name, Feature feature) {
        String _name = String.valueOf(name);
        if (!this.feature().containsKey(_name)) {
            this.feature().put(_name, feature);
        }
    }
141513
protected void invokeFeature(String featureSwitch, Feature feature ) {
        if(Config.getBooleanProperty(featureSwitch,true)) {
            feature.execute();
        }
    }
371581
function(feature) {
        if (!feature.fid) { 
            OpenLayers.Console.userError(OpenLayers.i18n("noFID")); 
            return false; 
        }
        var deleteNode = this.createElementNS(this.wfsns, 'wfs:Delete');
        deleteNode.setAttribute("typeName", this.featurePrefix + ':' + this.featureName); 
        deleteNode.setAttribute("xmlns:" + this.featurePrefix, this.featureNS); 

        var filterNode = this.createElementNS(this.ogcns, 'ogc:Filter');
        var filterIdNode = this.createElementNS(this.ogcns, 'ogc:FeatureId');
        filterIdNode.setAttribute("fid", feature.fid);
        filterNode.appendChild(filterIdNode);
        deleteNode.appendChild(filterNode);

        return deleteNode;
    }
319936
public void setFeatures(Map<String, List<org.geomajas.layer.feature.Feature>> featureMap) {
		MapModel mapModel = mapWidget.getMapModel();

		for (Entry<String, List<org.geomajas.layer.feature.Feature>> clientLayerId : featureMap.entrySet()) {
			Layer<?> layer = mapModel.getLayer(clientLayerId.getKey());
			if (null != layer) {
				List<org.geomajas.layer.feature.Feature> orgFeatures = clientLayerId.getValue();
				if (!orgFeatures.isEmpty()) {
					addFeatures(layer, orgFeatures);
				}
			}
		}
	}
1255040
public FeatureSet with(Feature feature) {
    if (features.contains(feature)) {
      return this;
    }
    return new FeatureSet(add(features, feature));
  }
1352189
function(feature) {
        var geometry = feature.geometry;
        var geometryNode = this.buildGeometryNode(geometry);
        var geomContainer = this.createElementNS(this.featureNS,
                                                 this.featurePrefix + ":" +
                                                 this.geometryName);
        geomContainer.appendChild(geometryNode);
        var featureNode = this.createElementNS(this.gmlns,
                                               "gml:" + this.featureName);
        var featureContainer = this.createElementNS(this.featureNS,
                                                    this.featurePrefix + ":" +
                                                    this.layerName);
        var fid = feature.fid || feature.id;
        featureContainer.setAttribute("fid", fid);
        featureContainer.appendChild(geomContainer);
        for(var attr in feature.attributes) {
            var attrText = this.createTextNode(feature.attributes[attr]); 
            var nodename = attr.substring(attr.lastIndexOf(":") + 1);
            var attrContainer = this.createElementNS(this.featureNS,
                                                     this.featurePrefix + ":" +
                                                     nodename);
            attrContainer.appendChild(attrText);
            featureContainer.appendChild(attrContainer);
        }    
        featureNode.appendChild(featureContainer);
        return featureNode;
    }