Location: Halloy, Bernard, Loussouarn, Goldbeter, 2002 @ 9b24d1c9771a / halloy_2002_copy.xul

Author:
Tommy Yu <tommy.yu@auckland.ac.nz>
Date:
2015-02-12 17:33:39+13:00
Desc:
Pruning off that extra head
Permanent Source URI:
https://models.physiomeproject.org/workspace/halloy_bernard_loussouarn_goldbeter_2002/rawfile/9b24d1c9771a149c9dc7af9134d4f35b0ad36629/halloy_2002_copy.xul

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="layout-diagram" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" style="overflow: auto" onload="setupDocument()">
<hbox>
	<scale id="zoom_scale" value="10" min="7" max="14" flex="4"/>
	<label value="Zoom" control="zoom_scale" flex="1"/>
	<button id="reset_button" label="Reset View" flex="1"/>
	<spacer flex="34"/>
</hbox>
<script>
<![CDATA[
window.model_entities =
  {

			
	M: {
		id: "M",
		y: "M/M",
		x: "environment/time",
		graph: "Traces: Clickable Elements Against Time (month)",
		colour: "#ff9900",
		linestyle: "none"
	},

	T: {
		id: "T",
		y: "T/T",
		x: "environment/time",
		graph: "Traces: Clickable Elements Against Time (month)",
		colour: "#ff00cc",
		linestyle: "none"
	},

	A: {
		id: "A",
		y: "A/A",
		x: "environment/time",
		graph: "Traces: Clickable Elements Against Time (month)",
		colour: "#cc00ff",
		linestyle: "none"
	},


	L: {
		id: "L",
		y: "L/L",
		x: "environment/time",
		graph: "Traces: Clickable Elements Against Time (month)",
		colour: "#3300ff",
		linestyle: "none"
	}
	
			
 // Repeat the above section for each controllable graph trace.
 // Remember to add a comma to each repeat after the final },
 // except for the final one!
 
};

function flushVisibilityInformation(entity_id, entity_colour)
{
	var message = "";
	var entity;

	if (typeof pcenv != "undefined")
	{
		for (var i in window.model_entities)
		{
			entity = window.model_entities[i];
			if (typeof entity_id == "undefined" || entity_id == window.model_entities[i].id)
			{
				pcenv.selectTrace
				(
					entity.graph,
					entity.x,
					entity.y,
					typeof entity_colour == "undefined" ? "" : entity_colour,
					entity.linestyle
				);
			}
			if (entity.linestyle != "none")
				message += i + ", ";
		}
		pcenv.status(message == "" ? "No fluxes displayed" : "Displaying flux of " + message.slice(0, -2));
	}
}

function processSelectEntity(event)
{
	if (typeof pcenv != "undefined")
		pcenv.status("In processSelectEntity");

	var entity = window.model_entities[window.svgIdToName[event.currentTarget.id]];

	switch(entity.linestyle)
	{
	case "none":
		entity.linestyle = "lines";
		highlightEntity(event.currentTarget.id);
		break;
	case "lines":
		entity.linestyle = "none";
		unlightEntity(event.currentTarget.id);
		break;
	}

	flushVisibilityInformation(entity.id);
}

function processContext(event)
{
	// if (event.button != 2)
	//   return true;

	var entity = window.model_entities[window.svgIdToName[event.currentTarget.id]];

	if (entity.context == null)
		return true;

	var menu = document.getElementById("entityContextMenu");

	for (var c = menu.firstChild, x = null; c != null; c = x)
	{
		x = c.nextSibling;
		menu.removeChild(c);
	}

	for (var i in entity.context)
	{
		var item = entity.context[i];

		var mitem = document.createElementNS
		(
			"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
			"menuitem"
		);

		mitem.setAttribute("label", item.label);
		mitem.setAttribute("url", item.url);
		mitem.addEventListener("command", processShowEntityURL, false);
		menu.appendChild(mitem);
	}

	menu.showPopup(window.diagram, event.screenX, event.screenY, "context");

	event.stopPropagation;
	return false;
}

function processShowEntityURL(event)
{
	url = event.target.getAttribute("url");

	window.open(url);

	var hl = document.getElementById("hidden-link");
	hl.href = url;

	// This is ugly, but it is one way to force everything through the proper
	// external handler...
	var evt = document.createEvent("HTMLEvents");
	evt.initEvent("click", true, true);
	hl.dispatchEvent(evt);
}

function highlightEntity(id)
{
	for (var path = document.getElementById(id + "_path1"), i = 1; path != null; path = document.getElementById(id + "_path" + ++i))
	{
		if (!(i in window.model_entities[window.svgIdToName[id]].path_colours))
			window.model_entities[window.svgIdToName[id]].path_colours[i] = path.attributes.getNamedItem("stroke").value;
		path.attributes.getNamedItem("stroke").value = "#ff0000";
	}
}

function highlightEntityOnRollover(event) {
	if (window.model_entities[window.svgIdToName[event.currentTarget.id]].colour)
		flushVisibilityInformation(event.currentTarget.id, "#ffffff");

	if (window.model_entities[window.svgIdToName[event.currentTarget.id]].linestyle == "none")
		highlightEntity(event.currentTarget.id);
}

function unlightEntity(id)
{
	for (var path = document.getElementById(id + "_path1"), i = 1; path != null; path = document.getElementById(id + "_path" + ++i))
		path.attributes.getNamedItem("stroke").value = window.model_entities[window.svgIdToName[id]].path_colours[i];
}

function unlightEntityOnRollover(event) {
	if (window.model_entities[window.svgIdToName[event.currentTarget.id]].colour)
		flushVisibilityInformation(event.currentTarget.id, window.model_entities[window.svgIdToName[event.currentTarget.id]].colour);

	if (window.model_entities[window.svgIdToName[event.currentTarget.id]].linestyle == "none")
		unlightEntity(event.currentTarget.id);
}

var mouseDown = false;
var initial_x;
var initial_y;
var viewBox;

function startDrag(event)
{
	if (event.button)
		return true;

	mouseDown = true;

	initial_x = parseInt(currentZoom * event.pageX + parseInt(viewBox.value.match(/^-?\d+/)[0]));
	initial_y = parseInt(currentZoom * event.pageY + parseInt(viewBox.value.match(/^-?\d+\s+(-?(\d+))/)[1]));
}

function stopDrag(event)
{
	if (!event.button)
		mouseDown = false;
}

function moveDrag(event)
{
	if (mouseDown == true)
		viewBox.value = viewBox.value.replace(/^-?\d+\s+-?\d+/, parseInt(initial_x - currentZoom * event.pageX) + " " + parseInt(initial_y - currentZoom * event.pageY));
}

function reset()
{
	var zoom_scale = document.getElementById("zoom_scale")
	zoom_scale.value = zoom_scale.originalValue;
	viewBox.value = viewBox.originalValue;
}

var initialZoom;
var currentZoom = 1;
var initialHeight;
var initialWidth;

function zoomDiagram(event)
{
	currentZoom = initialZoom / event.currentTarget.value;
	viewBox.value = viewBox.value.replace(/\d+\s+\d+$/, parseInt(initialHeight * currentZoom) + " " + parseInt(initialWidth * currentZoom));
}

function setupDocument()
{
	flushVisibilityInformation();

	window.diagram = document.getElementById("sachse");

	window.svgIdToName = {};

	for (var name in window.model_entities)
	{
		var id = window.model_entities[name].id;
		window.model_entities[name].path_colours = [];

		var svg = document.getElementById(id);
		window.svgIdToName[id] = name;

		svg.addEventListener("click", processSelectEntity, false);
		svg.addEventListener("contextmenu", processContext, false);
		svg.addEventListener("mouseover", highlightEntityOnRollover ,false);
		svg.addEventListener("mouseout", unlightEntityOnRollover, false);
	}

	document.getElementsByTagName("svg")[0].addEventListener("mousedown", startDrag, false);
	document.addEventListener("mouseup", stopDrag, false);
	document.addEventListener("mousemove", moveDrag, false);
	document.getElementById("reset_button").addEventListener("click", reset, false);

	document.getElementById("zoom_scale").addEventListener("change", zoomDiagram, false);
	document.getElementById("zoom_scale").originalValue = document.getElementById("zoom_scale").value;

	viewBox = document.getElementsByTagName("svg")[0].attributes.getNamedItem("viewBox");
	viewBox.originalValue = viewBox.value;

	initialZoom = document.getElementById("zoom_scale").value;
	initialHeight = parseInt(viewBox.value.match(/(\d+)\s+\d+$/)[1]);
	initialWidth = parseInt(viewBox.value.match(/\d+$/)[0]);
}

]]>
</script>

<popupset>
  <menupopup id="entityContextMenu" />
</popupset>

<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 width="423px" height="486px" viewBox="0 0 423 486" enable-background="new 0 0 423 486" xml:space="preserve">
<g id="A">
	<rect id="A_path1" x="265.736" y="70.609" fill="#FFFFFF" stroke="#000000" width="36" height="48.429"/>
	<g>
		<path d="M277.88,100.824L274.52,111h-4.32l10.991-32.352h5.041L297.271,111h-4.463l-3.457-10.176H277.88z M288.488,97.56
			l-3.217-9.312c-0.672-2.112-1.151-4.032-1.631-5.904h-0.146c-0.432,1.872-0.96,3.888-1.584,5.856l-3.168,9.36H288.488z"/>
	</g>
</g>
<g id="T">
	<rect id="T_path1" x="136.231" y="290.609" fill="#FFFFFF" stroke="#000000" width="36" height="48.43"/>
	<g>
		<path d="M152.095,302.199h-9.841v-3.551h23.952v3.551h-9.888V331h-4.224V302.199z"/>
	</g>
</g>
<g id="M">
	<rect id="M_path1" x="136.231" y="518.57" fill="#FFFFFF" stroke="#000000" width="36" height="48.43"/>
	<g>
		<path d="M165.847,544.753c-0.24-4.513-0.528-9.984-0.528-13.968h-0.096c-1.152,3.744-2.448,7.824-4.08,12.287l-5.712,15.696
			h-3.168l-5.28-15.407c-1.536-4.608-2.784-8.736-3.696-12.576h-0.096c-0.096,4.031-0.336,9.408-0.624,14.304l-0.864,13.872h-3.983
			l2.256-32.352h5.328l5.52,15.646c1.344,3.983,2.4,7.536,3.264,10.896h0.097c0.863-3.265,2.016-6.815,3.456-10.896l5.76-15.646
			h5.328l2.016,32.352h-4.128L165.847,544.753z"/>
	</g>
</g>
<g>
	<path d="M154.612,9.875v10.579c0,1.403,0.063,2.387,0.194,2.95c0.104,0.399,0.265,0.688,0.477,0.863
		c0.212,0.176,0.437,0.264,0.671,0.264c0.294,0,0.568-0.147,0.82-0.441c0.254-0.294,0.438-0.876,0.557-1.747h0.719
		c-0.198,1.573-0.586,2.66-1.159,3.258c-0.574,0.598-1.302,0.898-2.18,0.898c-0.866,0-1.558-0.264-2.072-0.79
		c-0.517-0.527-0.826-1.44-0.933-2.74c-1.196,1.328-2.331,2.254-3.404,2.777c-1.072,0.522-2.003,0.784-2.788,0.784
		c-0.527,0-1.043-0.103-1.549-0.306c-0.505-0.204-0.997-0.503-1.478-0.9c-0.023,1.7,0.125,3.183,0.443,4.45
		c0.225,0.902,0.338,1.536,0.338,1.899c0,0.633-0.161,1.137-0.482,1.513c-0.321,0.375-0.687,0.563-1.096,0.563
		c-0.421,0-0.767-0.164-1.035-0.492c-0.361-0.445-0.543-1.002-0.543-1.67c0-0.328,0.07-0.738,0.21-1.23
		c0.326-1.102,0.53-2.063,0.612-2.883c0.139-1.407,0.209-2.602,0.209-3.586V9.875h2.938v10.134c0,1.195,0.101,2.056,0.299,2.583
		c0.199,0.527,0.56,0.945,1.074,1.255c0.519,0.311,1.033,0.465,1.551,0.465c0.609,0,1.332-0.182,2.165-0.545
		c0.833-0.363,1.68-0.95,2.536-1.759V9.875H154.612z"/>
	<path d="M160.544,21.003h2.219v15.146h7.258v1.839h-9.477V21.003z"/>
</g>
<g>
	<path d="M158.429,55.531h-7.898c1.781,0.985,3.131,2.076,4.051,3.271c0.919,1.196,1.379,2.58,1.379,4.15
		c0,1.806-0.729,3.354-2.184,4.644c-1.455,1.29-3.404,1.935-5.846,1.935c-2.571,0-4.736-0.874-6.498-2.621
		c-1.761-1.747-2.642-3.857-2.642-6.332c0-1.489,0.369-2.837,1.108-4.045s1.675-2.12,2.807-2.735c1.132-0.615,2.864-0.923,5.2-0.923
		h10.521L158.429,55.531L158.429,55.531z M149.215,55.531c-0.49-0.021-0.865-0.031-1.122-0.031c-2.094,0-3.646,0.47-4.657,1.41
		c-1.013,0.94-1.519,2.267-1.519,3.981c0,2.244,0.603,4.047,1.808,5.409c1.205,1.362,2.631,2.043,4.28,2.043
		c1.379,0,2.515-0.496,3.402-1.487c0.888-0.991,1.334-2.42,1.334-4.286C152.742,59.873,151.566,57.526,149.215,55.531z"/>
	<path d="M161.028,64.003h2.218v15.146h7.258v1.839h-9.476V64.003z"/>
</g>
<g>
	<path d="M267.691,187.625v10.579c0,1.403,0.063,2.387,0.192,2.95c0.105,0.399,0.267,0.688,0.478,0.863
		c0.213,0.176,0.436,0.264,0.672,0.264c0.293,0,0.568-0.147,0.82-0.441c0.254-0.294,0.438-0.876,0.557-1.747h0.719
		c-0.198,1.573-0.586,2.66-1.16,3.258c-0.573,0.598-1.301,0.898-2.18,0.898c-0.867,0-1.557-0.264-2.072-0.79
		c-0.516-0.527-0.825-1.44-0.932-2.74c-1.197,1.328-2.332,2.254-3.404,2.777c-1.073,0.522-2.004,0.784-2.789,0.784
		c-0.526,0-1.043-0.103-1.549-0.306c-0.504-0.204-0.996-0.503-1.477-0.9c-0.023,1.7,0.125,3.183,0.442,4.45
		c0.226,0.902,0.339,1.536,0.339,1.899c0,0.633-0.162,1.137-0.482,1.513c-0.322,0.375-0.688,0.563-1.096,0.563
		c-0.422,0-0.767-0.164-1.035-0.492c-0.361-0.445-0.543-1.002-0.543-1.67c0-0.328,0.07-0.738,0.209-1.23
		c0.326-1.102,0.531-2.063,0.613-2.883c0.139-1.407,0.209-2.602,0.209-3.586v-14.012h2.938v10.134c0,1.195,0.101,2.056,0.299,2.583
		c0.199,0.527,0.56,0.945,1.074,1.255c0.519,0.311,1.033,0.465,1.551,0.465c0.609,0,1.332-0.182,2.164-0.545
		c0.834-0.363,1.681-0.95,2.537-1.759v-12.134H267.691z"/>
	<path d="M276.396,210.396l-1.765,5.342h-2.27l5.771-16.985h2.646l5.795,16.985h-2.344l-1.814-5.342H276.396z M281.965,208.682
		l-1.688-4.889c-0.354-1.109-0.605-2.117-0.857-3.1h-0.075c-0.228,0.983-0.505,2.042-0.832,3.075l-1.662,4.914H281.965z"/>
</g>
<g>
	<path d="M35.566,187.625v10.579c0,1.403,0.063,2.387,0.193,2.95c0.105,0.399,0.266,0.688,0.478,0.863
		c0.212,0.176,0.436,0.264,0.671,0.264c0.294,0,0.568-0.147,0.82-0.441c0.254-0.294,0.438-0.876,0.557-1.747h0.719
		c-0.198,1.573-0.586,2.66-1.159,3.258c-0.574,0.598-1.302,0.898-2.18,0.898c-0.867,0-1.558-0.264-2.073-0.79
		c-0.516-0.527-0.825-1.44-0.932-2.74c-1.196,1.328-2.331,2.254-3.404,2.777c-1.072,0.522-2.003,0.784-2.789,0.784
		c-0.526,0-1.043-0.103-1.548-0.306c-0.505-0.204-0.997-0.503-1.478-0.9c-0.023,1.7,0.125,3.183,0.442,4.45
		c0.226,0.902,0.339,1.536,0.339,1.899c0,0.633-0.161,1.137-0.482,1.513c-0.321,0.375-0.687,0.563-1.096,0.563
		c-0.421,0-0.767-0.164-1.035-0.492c-0.361-0.445-0.543-1.002-0.543-1.67c0-0.328,0.07-0.738,0.21-1.23
		c0.326-1.102,0.53-2.063,0.612-2.883c0.139-1.407,0.209-2.602,0.209-3.586v-14.012h2.938v10.134c0,1.195,0.1,2.056,0.299,2.583
		c0.199,0.527,0.56,0.945,1.074,1.255c0.518,0.311,1.033,0.465,1.551,0.465c0.609,0,1.332-0.182,2.165-0.545s1.68-0.95,2.536-1.759
		v-12.134H35.566z"/>
	<path d="M44.75,200.618h-5.166v-1.865h12.575v1.865h-5.191v15.12H44.75V200.618z"/>
</g>
<g>
	<path d="M271.508,237.281h-7.897c1.781,0.985,3.131,2.076,4.051,3.271c0.92,1.196,1.379,2.58,1.379,4.15
		c0,1.806-0.729,3.354-2.184,4.644c-1.455,1.29-3.404,1.935-5.847,1.935c-2.569,0-4.735-0.874-6.497-2.621
		c-1.761-1.747-2.642-3.857-2.642-6.332c0-1.489,0.369-2.837,1.109-4.045c0.737-1.208,1.674-2.12,2.807-2.735
		c1.131-0.615,2.863-0.923,5.199-0.923h10.521L271.508,237.281L271.508,237.281z M262.295,237.281
		c-0.491-0.021-0.866-0.031-1.123-0.031c-2.094,0-3.646,0.47-4.657,1.41c-1.013,0.94-1.519,2.267-1.519,3.981
		c0,2.244,0.603,4.047,1.808,5.409c1.204,1.362,2.631,2.043,4.28,2.043c1.379,0,2.515-0.496,3.402-1.487
		c0.888-0.991,1.334-2.42,1.334-4.286C265.82,241.623,264.645,239.276,262.295,237.281z"/>
	<path d="M276.879,257.396l-1.764,5.342h-2.268l5.77-16.985h2.646l5.797,16.985h-2.345l-1.813-5.342H276.879z M282.449,255.682
		l-1.689-4.889c-0.352-1.109-0.604-2.117-0.856-3.1h-0.074c-0.227,0.983-0.504,2.042-0.832,3.075l-1.664,4.914H282.449z"/>
</g>
<g>
	<path d="M39.383,237.281h-7.897c1.781,0.985,3.131,2.076,4.051,3.271c0.919,1.196,1.379,2.58,1.379,4.15
		c0,1.806-0.729,3.354-2.184,4.644c-1.455,1.29-3.404,1.935-5.847,1.935c-2.57,0-4.735-0.874-6.497-2.621
		c-1.761-1.747-2.642-3.857-2.642-6.332c0-1.489,0.369-2.837,1.108-4.045c0.738-1.208,1.675-2.12,2.807-2.735
		c1.132-0.615,2.864-0.923,5.2-0.923h10.521L39.383,237.281L39.383,237.281z M30.169,237.281c-0.49-0.021-0.865-0.031-1.122-0.031
		c-2.094,0-3.646,0.47-4.657,1.41c-1.013,0.94-1.519,2.267-1.519,3.981c0,2.244,0.603,4.047,1.808,5.409
		c1.204,1.362,2.631,2.043,4.28,2.043c1.379,0,2.515-0.496,3.402-1.487c0.888-0.991,1.334-2.42,1.334-4.286
		C33.696,241.623,32.52,239.276,30.169,237.281z"/>
	<path d="M45.233,247.618h-5.166v-1.865h12.575v1.865h-5.191v15.12h-2.218V247.618z"/>
</g>
<g>
	<path d="M175.202,415.63c-1.381-0.517-2.306-1.067-2.772-1.653c-0.468-0.588-0.702-1.285-0.702-2.096
		c0-1.092,0.455-2.001,1.367-2.729c1.237-0.998,2.866-1.496,4.889-1.496c1.203,0,2.284,0.141,3.242,0.424
		c0.958,0.281,1.608,0.648,1.953,1.102c0.346,0.453,0.518,0.879,0.518,1.278c0,0.364-0.152,0.696-0.455,0.997
		c-0.305,0.299-0.654,0.449-1.051,0.449c-0.644,0-1.177-0.418-1.604-1.256s-0.778-1.351-1.06-1.537
		c-0.455-0.305-1.016-0.457-1.682-0.457c-1.052,0-1.886,0.308-2.505,0.923c-0.618,0.614-0.928,1.45-0.928,2.504
		c0,1.031,0.257,1.821,0.771,2.372c0.514,0.551,1.22,0.826,2.118,0.826c0.304,0,0.637-0.022,0.997-0.068
		c0.572-0.079,1.021-0.119,1.35-0.119c0.502,0,0.843,0.063,1.023,0.189c0.182,0.127,0.271,0.277,0.271,0.451
		s-0.076,0.31-0.229,0.406c-0.21,0.155-0.577,0.233-1.104,0.233c-0.117,0-0.312-0.019-0.579-0.058
		c-0.608-0.086-1.104-0.131-1.49-0.131c-0.98,0-1.786,0.322-2.411,0.965c-0.625,0.646-0.938,1.492-0.938,2.546
		c0,1.229,0.324,2.186,0.975,2.87c0.651,0.684,1.492,1.025,2.523,1.025c0.831,0,1.511-0.25,2.038-0.752
		c0.305-0.291,0.626-0.897,0.966-1.818c0.223-0.606,0.404-0.979,0.545-1.119c0.375-0.373,0.773-0.561,1.195-0.561
		c0.492,0,0.907,0.17,1.248,0.508c0.34,0.338,0.51,0.758,0.51,1.258c0,0.806-0.463,1.546-1.389,2.222
		c-1.348,0.967-3.063,1.451-5.147,1.451c-2.202,0-3.897-0.485-5.087-1.455c-1.19-0.97-1.783-2.045-1.783-3.226
		c0-0.843,0.319-1.643,0.958-2.401S173.537,416.25,175.202,415.63z"/>
</g>
<g>
	<g>
		<line fill="none" stroke="#000000" x1="41" y1="98" x2="256" y2="98"/>
		<polygon points="253.191,101.703 254.764,98 253.191,94.296 261.969,98 		"/>
	</g>
</g>
<g>
	<g>
		<line fill="none" stroke="#000000" x1="279" y1="119" x2="173" y2="286"/>
		<polygon points="171.379,281.645 173.662,284.957 177.632,285.613 169.801,291.04 		"/>
	</g>
</g>
<g>
	<g>
		<line fill="none" stroke="#000000" stroke-dasharray="3,3" x1="154" y1="344" x2="154" y2="510"/>
		<polygon points="150.297,507.191 154,508.765 157.704,507.191 154,515.97 		"/>
	</g>
</g>
<g>
	<g>
		<line fill="none" stroke="#000000" x1="32" y1="123" x2="138" y2="290"/>
		<polygon points="36.632,123.387 32.662,124.043 30.378,127.356 28.801,117.96 		"/>
	</g>
</g>
<g id="L">
	<rect id="L_path1" x="8.624" y="70.609" fill="#FFFFFF" stroke="#000000" width="36" height="48.429"/>
	<g>
		<path d="M17.6,78.648h4.224v28.848h13.824V111H17.6V78.648z"/>
	</g>
</g>
</svg>
</window>