<commit_before>/* 
 * Copyright (C) 2012 B3Partners B.V.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * Buffer component
 * Creates a influence component.
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 */
Ext.define ("viewer.components.Influence",{
    extend: "viewer.components.Search",  
    panel: null,
    config: {
        layers: null
    },
    location: null,
    vectorLayer: null,
    layerSelector:null,
    removeButton: null,
    markerId: 'influence_marker',
    /**
     * Constructor for influence
     * @constructor
     */
    constructor: function (conf){     
        if(conf.searchUrl && conf.searchUrl!=""){
            conf.searchconfigs=[{
                id: 1,
                url: conf.searchUrl,
                name: conf.searchName
            }];
        }else{
            conf.searchconfigs=[];
        }
        viewer.components.Influence.superclass.constructor.call(this, conf);
        this.removeButton=this.form.getChildByElement(this.name+"_remove")
        this.removeButton.setVisible(false);
        
        this.toolMapClick = this.viewerController.mapComponent.createTool({
            type: viewer.viewercontroller.controller.Tool.MAP_CLICK,
            id: this.name + "toolMapClick",
            handler:{
                fn: this.mapClicked,
                scope:this
            },
            viewerController: this.viewerController
        });
        
        /*this.vectorLayer=this.viewerController.mapComponent.createVectorLayer({
            name: this.name + 'VectorLayer',
            geometrytypes:["Polygon"],
            showmeasures:false,
            viewerController: this.viewerController,
            editable: true,
            style: {
                fillcolor: "0xFF0000",
                fillopacity: 50,
                strokecolor: "0xFF0000",
                strokeopacity: 50
            }
        });
        this.viewerController.mapComponent.getMap().addLayer(this.vectorLayer);  */      
        
        
        var config = {
            viewerController : this.viewerController,
            restriction : "hasConfiguredLayers",
            id : this.name + "layerSelector",
            layers: this.layers,
            div: this.name + 'LayerSelectorPanel'
        };
        this.layerSelector = Ext.create("viewer.components.LayerSelector",config);        
        return this;
    },
    /**
     * Get the items for this form.
     * @overwrite
     */
    getFormItems: function(){
        var itemList=viewer.components.Influence.superclass.getFormItems.call(this);
        //the items that must be placed before the search items.
        var formItemsBefore = new Array();
       
        formItemsBefore.push({
            id: this.name + 'LayerSelectorPanel',
            xtype: "container",
            width: '100%',
            height: 25
        });
        itemList= formItemsBefore.concat(itemList);
        //only if there is a search button add the or label
        if (this.searchconfigs.length> 0){
            itemList.push({
                xtype: 'label',<commit_msg>Wrong restriction for layerselector in Influence component<commit_after>/* 
 * Copyright (C) 2012 B3<EMAIL>ners B.V.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * Buffer component
 * Creates a influence component.
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 */
Ext.define ("viewer.components.Influence",{
    extend: "viewer.components.Search",  
    panel: null,
    config: {
        layers: null
    },
    location: null,
    vectorLayer: null,
    layerSelector:null,
    removeButton: null,
    markerId: 'influence_marker',
    /**
     * Constructor for influence
     * @constructor
     */
    constructor: function (conf){     
        if(conf.searchUrl && conf.searchUrl!=""){
            conf.searchconfigs=[{
                id: 1,
                url: conf.searchUrl,
                name: conf.searchName
            }];
        }else{
            conf.searchconfigs=[];
        }
        viewer.components.Influence.superclass.constructor.call(this, conf);
        this.removeButton=this.form.getChildByElement(this.name+"_remove")
        this.removeButton.setVisible(false);
        
        this.toolMapClick = this.viewerController.mapComponent.createTool({
            type: viewer.viewercontroller.controller.Tool.MAP_CLICK,
            id: this.name + "toolMapClick",
            handler:{
                fn: this.mapClicked,
                scope:this
            },
            viewerController: this.viewerController
        });
        
        /*this.vectorLayer=this.viewerController.mapComponent.createVectorLayer({
            name: this.name + 'VectorLayer',
            geometrytypes:["Polygon"],
            showmeasures:false,
            viewerController: this.viewerController,
            editable: true,
            style: {
                fillcolor: "0xFF0000",
                fillopacity: 50,
                strokecolor: "0xFF0000",
                strokeopacity: 50
            }
        });
        this.viewerController.mapComponent.getMap().addLayer(this.vectorLayer);  */      
        
        
        var config = {
            viewerController : this.viewerController,
            restriction : "influence",
            layers: this.layers,
            div: this.name + 'LayerSelectorPanel'
        };
        this.layerSelector = Ext.create("viewer.components.LayerSelector",config);        
        return this;
    },
    /**
     * Get the items for this form.
     * @overwrite
     */
    getFormItems: function(){
        var itemList=viewer.components.Influence.superclass.getFormItems.call(this);
        //the items that must be placed before the search items.
        var formItemsBefore = new Array();
       
        formItemsBefore.push({
            id: this.name + 'LayerSelectorPanel',
            xtype: "container",
            width: '100%',
            height: 25
        });
        itemList= formItemsBefore.concat(itemList);
        //only if there is a search button add the or label
        if (this.searchconfigs.length> 0){
            itemList.push({
                xtype: 'label',
{'fraction_non_alphanumeric': 0.10307898259705489, 'fraction_numerical': 0.007228915662650603, 'mean_word_length': 2.0259214256784124, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5074230', 'n_tokens_mistral': 2037, 'n_tokens_neox': 1957, 'n_words': 526}