text: var BaseElement = require("../BaseElement");
  var forceLayoutNodeFunctions = require("../forceLayoutNodeFunctions")();
  
  module.exports = (function() {
  	var Base = function(graph) {
  		BaseElement.apply(this, arguments);
  
  		var that = this,
  			// Basic attributes
  			links,
  			rendertype = "round",
  			// Additional attributes
  			maxIndividualCount,
  			ignoreLocalHoverEvents = false,
  			// Element containers
  			nodeElement;
  
  		// array to store my properties; // we will need this also later for semantic zooming stuff
  		var assignedProperties = [];
  		that.editingTextElement = false;
  
  		this.isPropertyAssignedToThisElement = function(property) {
  			return false;
  		};
  
  		this.addProperty = function(property) {
  			if (assignedProperties.indexOf(property) === -1) {
  				assignedProperties.push(property);
  			}
  		};
  
  		this.removePropertyElement = function(property) {
  			if (assignedProperties.indexOf(property) !== -1) {
  				assignedProperties.splice(assignedProperties.indexOf(property), 1);
  			}
  		};
  		this.getMyProperties = function() {
  			return assignedProperties;
  		};
  		this.copyOtherProperties = function(otherProperties) {
  			assignedProperties = otherProperties;
  		};
  
  		this.copyInformation = function(other) {
  			console.log(other.labelForCurrentLanguage());
  			if (other.type() !== "owl:Thing") that.label(other.label());
  			that.copyOtherProperties(other.getMyProperties());
  			if (other.type() === "owl:Class") {
  				that.backupLabel(other.label());
  				// console.log("copied backup label"+that.backupLabel());
  			}
  			if (other.backupLabel() !== undefined) {
  				that.backupLabel(other.backupLabel());
  			}
  		};
  
  		this.enableEditing = function(autoEditing) {
  			if (autoEditing === false) return;
  			that.raiseDoubleClickEdit(true);
  		};
  
  		this.renderType = function(t) {
  			if (!arguments.length) return rendertype;
  			rendertype = t;
  			return this;
  		};
  		// Properties
  
  		this.links = function(p) {
  			if (!arguments.length) return links;
  			links = p;
  			return this;
  		};
  
  		this.maxIndividualCount = function(p) {
  			if (!arguments.length) return maxIndividualCount;
  			maxIndividualCount = p;
  			return this;
  		};
  
  		this.nodeElement = function(p) {
  			if (!arguments.length) return nodeElement;
  			nodeElement = p;
  			return this;
  		};
  
  		/**
  		 * Returns css classes generated from the data of this object.
  		 * @returns {Array}
  		 */
  		that.collectCssClasses = function() {
  			var cssClasses = [];
  
  			if (typeof that.styleClass() === "string") {
  				cssClasses.push(that.styleClass());
  			}
  
  			cssClasses = cssClasses.concat(that.visualAttributes());
  
  			return cssClasses;
  		};
  
  		// Reused functions TODO refactor
  		this.addMouseListeners = function() {
  			// Empty node
  			if (!that.nodeElement()) {
  				console.warn(this);
  				return;
  			}
  
  			that
  				.nodeElement()
  				.selectAll("*")
  				.on("mouseover", onMouseOver)
  				.on("mouseout", onMouseOut);
  		};
  
  		this.animationProcess = function() {
  			var animRuns = false;
  			if (that.getHalos()) {
  				var haloGr = that.getHalos();
  				var haloEls = haloGr.selectAll(".searchResultA");
  				animRuns = haloGr.attr("animationRunning");
  				if (typeof animRuns !== "boolean") {
  					// parse this to a boolean value
  					animRuns = animRuns === "true";
  				}
  				if (animRuns === false) {
  					haloEls.classed("searchResultA", false);
  					haloEls.classed("searchResultB", true);
  				}
  			}
  			return animRuns;
  		};
  
  		this.foreground = function() {
  			var selectedNode = that.nodeElement().node(),
  				nodeContainer = selectedNode.parentNode;
  			// check if the halo is present and an animation is running
  			if (that.animationProcess() === false) {
  				// Append hovered element as last child to the container list.
  				nodeContainer.appendChild(selectedNode);
  			}
  		};
  
  		function onMouseOver() {
  			if (that.mouseEntered() || ignoreLocalHoverEvents === true) {
  				return;
  			}
  
  			var selectedNode = that.nodeElement().node(),
  				nodeContainer = selectedNode.parentNode;
  
  			// Append hovered element as last child to the container list.
  			if (that.animationProcess() === false) {
  				nodeContainer.appendChild(selectedNode);
  			}
  			that.setHoverHighlighting(true);
  			that.mouseEntered(true);
  			if (
  				graph.editorMode() === true &&
  				graph.ignoreOtherHoverEvents() === false
  			) {
  				graph.activateHoverElements(true, that);
  			}
  		}
  
  		function onMouseOut() {
  			that.setHoverHighlighting(false);
  			that.mouseEntered(false);
  			if (
  				graph.editorMode() === true &&
  				graph.ignoreOtherHoverEvents() === false
  			) {
  				graph.activateHoverElements(false);
  			}
  		}
  
  		forceLayoutNodeFunctions.addTo(this);
  	};
  
  	Base.prototype = Object.create(BaseElement.prototype);
  	Base.prototype.constructor = Base;
  
  	return Base;
  })();
  