Commits

Anonymous committed b042d16

Renamed functions to "small-caps" form.
Moved edit submenus to below main elements.
ContextMilestone now tracks edit info.
Opening files clears edit selection.

Comments (0)

Files changed (10)

src/org/namesonnodes/controls/context/ContextMilestone.as

 	import asmathema.collections.sets.HashSetBuilder;
 	import org.namesonnodes.math.Taxon;
 	import org.namesonnodes.models.Context;
+	import org.namesonnodes.models.EditInfo;
 	import org.namesonnodes.models.NameEntry;
+	import org.namesonnodes.models.events.EditInfoEvent;
 	import org.namesonnodes.models.events.NameContextEvent;
 	import org.namesonnodes.models.events.NodeContextChangeEvent;
 
 		{
 			super();
 			_context = context;
+			oldEditInfo.currentState = context.editInfo.currentState;
+			oldEditInfo.nameEntry = context.editInfo.nameEntry;
+			newEditInfo.currentState = context.editInfo.currentState;
+			newEditInfo.nameEntry = context.editInfo.nameEntry;
+			context.editInfo.addEventListener(EditInfoEvent.CURRENT_STATE_CHANGE,
+											  context_editInfo_currentStateChangeHandler);
+			context.editInfo.addEventListener(EditInfoEvent.NAME_ENTRY_CHANGE,
+											  context_editInfo_nameEntryChangeHandler);
 			context.nodes.addEventListener(NodeContextChangeEvent.CHANGE,
 										   context_nodes_changeHandler);
 			context.names.addEventListener(NameContextEvent.NAME_ENTRY_ADDED,
 		private const arcsRemoved:FiniteSetBuilder = new HashSetBuilder();
 		private const namesAdded:FiniteSetBuilder = new HashSetBuilder();
 		private const namesRemoved:FiniteSetBuilder = new HashSetBuilder();
+		private const newEditInfo:EditInfo = new EditInfo();
 		private const nodesAdded:FiniteSetBuilder = new HashSetBuilder();
 		private const nodesRemoved:FiniteSetBuilder = new HashSetBuilder();
+		private const oldEditInfo:EditInfo = new EditInfo();
 		private var tracking:Boolean = true;
 
 		public function get context():Context
 		{
 			if (tracking)
 				throw new IllegalOperationError("Cannot redo while tracking.");
+			for each (var arc:FiniteList in arcsRemoved.build())
+				context.nodes.removeArc(arc.select(0) as Taxon,
+												   arc.select(1) as Taxon);
+			for each (var node:Taxon in nodesRemoved.build())
+				context.nodes.removeNode(node);
 			for each (var entry:NameEntry in namesRemoved.build())
 				context.names.removeEntry(entry);
 			for each (entry in namesAdded.build())
 				context.names.addEntry(entry);
-			for each (var node:Taxon in nodesRemoved.build())
-				context.nodes.removeNode(node);
 			for each (node in nodesAdded.build())
 				context.nodes.addNode(node);
-			for each (var arc:FiniteList in arcsRemoved.build())
-				context.nodes.removeArc(arc.select(0) as Taxon,
-												   arc.select(1) as Taxon);
 			for each (arc in arcsAdded.build())
 				context.nodes.addArc(arc.select(0) as Taxon,
 												arc.select(1) as Taxon,
 												arc.size > 2 ? Number(arc.select(2)) : Number.NaN);
+			context.editInfo.currentState = newEditInfo.currentState;
+			context.editInfo.nameEntry = newEditInfo.nameEntry;
 		}
 
 		public function stopTracking():void
 		{
 			if (tracking)
 			{
+				context.editInfo.removeEventListener(EditInfoEvent.CURRENT_STATE_CHANGE,
+													 context_editInfo_currentStateChangeHandler);
+				context.editInfo.removeEventListener(EditInfoEvent.NAME_ENTRY_CHANGE,
+													 context_editInfo_nameEntryChangeHandler);
 				context.nodes.removeEventListener(NodeContextChangeEvent.CHANGE,
 												  context_nodes_changeHandler);
 				context.names.removeEventListener(NameContextEvent.NAME_ENTRY_ADDED,
 			for each (arc in arcsAdded.build())
 				context.nodes.removeArc(arc.select(0) as Taxon,
 												   arc.select(1) as Taxon);
+			for each (node in nodesAdded.build())
+				context.nodes.removeNode(node);
+			for each (entry in namesAdded.build())
+				context.names.removeEntry(entry);
+			for each (var entry:NameEntry in namesRemoved.build())
+				context.names.addEntry(entry);
+			for each (var node:Taxon in nodesRemoved.build())
+				context.nodes.addNode(node);
 			for each (var arc:FiniteList in arcsRemoved.build())
 				context.nodes.addArc(arc.select(0) as Taxon,
 												arc.select(1) as Taxon,
 												arc.size > 2 ? Number(arc.select(2)) : Number.NaN);
-			for each (node in nodesAdded.build())
-				context.nodes.removeNode(node);
-			for each (var node:Taxon in nodesRemoved.build())
-				context.nodes.addNode(node);
-			for each (entry in namesAdded.build())
-				context.names.removeEntry(entry);
-			for each (var entry:NameEntry in namesRemoved.build())
-				context.names.addEntry(entry);
+			context.editInfo.currentState = oldEditInfo.currentState;
+			context.editInfo.nameEntry = oldEditInfo.nameEntry;
+		}
+
+		private function context_editInfo_currentStateChangeHandler(event:EditInfoEvent):void
+		{
+			newEditInfo.currentState = context.editInfo.currentState;
+		}
+
+		private function context_editInfo_nameEntryChangeHandler(event:EditInfoEvent):void
+		{
+			newEditInfo.nameEntry = context.editInfo.nameEntry;
 		}
 
 		private function context_names_nameEntryAddedHandler(event:NameContextEvent):void
 		{
 			namesAdded.addMember(event.nameEntry);
+			namesRemoved.removeMember(event.nameEntry);
 		}
 
 		private function context_names_nameEntryRemovedHandler(event:NameContextEvent):void
 		{
 			namesRemoved.addMember(event.nameEntry);
+			namesAdded.removeMember(event.nameEntry);
 		}
 
 		private function context_nodes_changeHandler(event:NodeContextChangeEvent):void

src/org/namesonnodes/controls/files/OpenFile.as

 	import org.namesonnodes.flow.ProgressOperation;
 	import org.namesonnodes.flow.events.OperationEvent;
 	import org.namesonnodes.models.Context;
+	import org.namesonnodes.models.EditState;
 	import org.namesonnodes.models.FileState;
 
 	public final class OpenFile extends AbstractProgressOperation
 		{
 			wasEmpty = (context.fileInfo.state == FileState.EMPTY);
 			milestone = new ContextMilestone(context);
+			context.editInfo.currentState = EditState.EMPTY;
+			context.editInfo.nameEntry = null;
 			return loadContext.execute();
 		}
 

src/org/namesonnodes/math/SymbolPresentation.as

 		{
 			const d:Dictionary = new Dictionary();
 			d[SymbolDefinitionURL.CLADE] =
-				<mo xmlns={MathML.NAMESPACE}>Clade</mo>;
+				<mrow xmlns={MathML.NAMESPACE}><mtext>C</mtext><mtext mathsize="small">LADE</mtext></mrow>;
 			d[SymbolDefinitionURL.CROWN_CLADE] =
-				<mo xmlns={MathML.NAMESPACE}>Crown</mo>;
+				<mrow xmlns={MathML.NAMESPACE}><mtext>C</mtext><mtext mathsize="small">ROWN</mtext></mrow>;
 			d[SymbolDefinitionURL.EXCLUSIVE_PREDECESSORS] =
-				<mo xmlns={MathML.NAMESPACE} form="infix">←</mo>;
+				<mrow xmlns={MathML.NAMESPACE}><mtext>B</mtext><mtext mathsize="small">RANCH</mtext></mrow>;
 			d[SymbolDefinitionURL.MAXIMAL] =
-				<mo xmlns={MathML.NAMESPACE}>max</mo>;
+				<mrow xmlns={MathML.NAMESPACE}><mtext>M</mtext><mtext mathsize="small">AXIMAL</mtext></mrow>;
 			d[SymbolDefinitionURL.MINIMAL] =
-				<mo xmlns={MathML.NAMESPACE}>min</mo>;
+				<mrow xmlns={MathML.NAMESPACE}><mtext>M</mtext><mtext mathsize="small">INIMAL</mtext></mrow>;
 			d[SymbolDefinitionURL.PHYLOGENETIC_GRAPH] =
 				<mo xmlns={MathML.NAMESPACE}>P</mo>;
 			d[SymbolDefinitionURL.PREDECESSOR_INTERSECTION] =
-				<msub xmlns={MathML.NAMESPACE}><mo>prc</mo><mo>∩</mo></msub>;
+				<mrow xmlns={MathML.NAMESPACE}><mtext>P</mtext><mtext mathsize="small">REDECESSOR</mtext><mtext>I</mtext><mtext mathsize="small">NTERSECT</mtext></mrow>;
 			d[SymbolDefinitionURL.PREDECESSOR_UNION] =
-				<msub xmlns={MathML.NAMESPACE}><mo>prc</mo><mo>∪</mo></msub>;
+				<mrow xmlns={MathML.NAMESPACE}><mtext>P</mtext><mtext mathsize="small">REDECESSOR</mtext><mtext>U</mtext><mtext mathsize="small">NION</mtext></mrow>;
 			d[SymbolDefinitionURL.STATE_RECONSTRUCTION] =
-				<mo xmlns={MathML.NAMESPACE}>Reconstruct</mo>;
+				<mrow xmlns={MathML.NAMESPACE}><mtext>S</mtext><mtext mathsize="small">TATE</mtext><mtext>R</mtext><mtext mathsize="small">ECONSTRUCTION</mtext></mrow>;
 			d[SymbolDefinitionURL.SUCCESSOR_INTERSECTION] =
-				<msub xmlns={MathML.NAMESPACE}><mo>suc</mo><mo>∩</mo></msub>;
+				<mrow xmlns={MathML.NAMESPACE}><mtext>P</mtext><mtext mathsize="small">UCCESSOR</mtext><mtext>I</mtext><mtext mathsize="small">NTERSECT</mtext></mrow>;
 			d[SymbolDefinitionURL.SUCCESSOR_UNION] =
-				<msub xmlns={MathML.NAMESPACE}><mo>suc</mo><mo>∪</mo></msub>;
+				<mrow xmlns={MathML.NAMESPACE}><mtext>P</mtext><mtext mathsize="small">UCCESSOR</mtext><mtext>U</mtext><mtext mathsize="small">NION</mtext></mrow>;
 			d[SymbolDefinitionURL.SYNAPOMORPHIC_PREDECESSORS] =
-				<mo xmlns={MathML.NAMESPACE} form="infix">@</mo>;
+				<mrow xmlns={MathML.NAMESPACE}><mtext>S</mtext><mtext mathsize="small">YNAPOMORPHIC</mtext><mtext>P</mtext><mtext mathsize="small">REDECESSORS</mtext></mrow>;
 			d[SymbolDefinitionURL.TOTAL_CLADE] =
-				<mo xmlns={MathML.NAMESPACE}>Total</mo>;
+				<mrow xmlns={MathML.NAMESPACE}><mtext>T</mtext><mtext mathsize="small">OTAL</mtext></mrow>;
 			d[SymbolDefinitionURL.UNIVERSAL_TAXON] =
 				<mo xmlns={MathML.NAMESPACE}>U</mo>;
 			return d;

src/org/namesonnodes/models/EditInfo.as

+/*
+   Copyright (c) 2010 T. Michael Keesey <http://tmkeesey.net/>
+
+   Permission is hereby granted, free of charge, to any person obtaining a copy
+   of this software and associated documentation files (the "Software"), to deal
+   in the Software without restriction, including without limitation the rights
+   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+   copies of the Software, and to permit persons to whom the Software is
+   furnished to do so, subject to the following conditions:
+
+   The above copyright notice and this permission notice shall be included in
+   all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+   THE SOFTWARE.
+ */
 package org.namesonnodes.models
 {
 	import flash.events.EventDispatcher;
+	import org.namesonnodes.models.events.EditInfoEvent;
 
+	[Event(name="currentStateChange",
+		type="org.namesonnodes.models.events.EditInfoEvent")]
+	[Event(name="nameEntryChange",
+		type="org.namesonnodes.models.events.EditInfoEvent")]
 	public final class EditInfo extends EventDispatcher
 	{
 		public function EditInfo()
 		{
 			super();
 		}
-		[Bindable]
-		public var currentState:String = "empty";
-		[Bindable]
-		public var nameEntry:NameEntry;
+		private var _currentState:String = EditState.EMPTY;
+		private var _nameEntry:NameEntry;
+
+		[Bindable(event="currentStateChange")]
+		[Inspectable(enumeration="empty,mathDefinition,presentations,uris",
+			defaultValue="empty")]
+		public function get currentState():String
+		{
+			return _currentState;
+		}
+
+		public function set currentState(value:String):void
+		{
+			if (value != EditState.MATH_DEFINITION &&
+				value != EditState.PRESENTATIONS && value != EditState.URIS)
+				value = EditState.EMPTY;
+			if (_currentState != value)
+			{
+				_currentState = value;
+				dispatchEvent(new EditInfoEvent(EditInfoEvent.CURRENT_STATE_CHANGE));
+			}
+		}
+
+		[Bindable(event="nameEntryChange")]
+		public function get nameEntry():NameEntry
+		{
+			return _nameEntry;
+		}
+
+		public function set nameEntry(value:NameEntry):void
+		{
+			if (_nameEntry != value)
+			{
+				_nameEntry = value;
+				dispatchEvent(new EditInfoEvent(EditInfoEvent.NAME_ENTRY_CHANGE));
+			}
+		}
 	}
 }

src/org/namesonnodes/models/EditState.as

+/*
+   Copyright (c) 2010 T. Michael Keesey <http://tmkeesey.net/>
+
+   Permission is hereby granted, free of charge, to any person obtaining a copy
+   of this software and associated documentation files (the "Software"), to deal
+   in the Software without restriction, including without limitation the rights
+   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+   copies of the Software, and to permit persons to whom the Software is
+   furnished to do so, subject to the following conditions:
+
+   The above copyright notice and this permission notice shall be included in
+   all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+   THE SOFTWARE.
+ */
+package org.namesonnodes.models
+{
+
+	public final class EditState
+	{
+		public static const EMPTY:String = "empty";
+		public static const MATH_DEFINITION:String = "mathDefinition";
+		public static const PRESENTATIONS:String = "presentations";
+		public static const URIS:String = "uris";
+	}
+}

src/org/namesonnodes/models/definitions/factories/CommonFactories.mxml

 
 				<fx:XML xmlns="http://www.w3.org/1998/Math/MathML">
 
-					<mo>max</mo>
+					<mrow>
+
+						<mtext>M</mtext>
+
+						<mtext mathsize="small">AXIMAL</mtext>
+					</mrow>
 				</fx:XML>
 			</factories:presentation>
 
 
 				<fx:XML xmlns="http://www.w3.org/1998/Math/MathML">
 
-					<mo>min</mo>
+					<mrow>
+
+						<mtext>M</mtext>
+
+						<mtext mathsize="small">INIMAL</mtext>
+					</mrow>
 				</fx:XML>
 			</factories:presentation>
 
 
 				<fx:XML xmlns="http://www.w3.org/1998/Math/MathML">
 
-					<msub>
+					<mrow>
 
-						<mo>prc</mo>
+						<mtext>P</mtext>
 
-						<mo>∪</mo>
-					</msub>
+						<mtext mathsize="small">REDECESSOR</mtext>
+
+						<mtext>U</mtext>
+
+						<mtext mathsize="small">NION</mtext>
+					</mrow>
 				</fx:XML>
 			</factories:presentation>
 
 
 				<fx:XML xmlns="http://www.w3.org/1998/Math/MathML">
 
-					<msub>
+					<mrow>
 
-						<mo>suc</mo>
+						<mtext>S</mtext>
 
-						<mo>∪</mo>
-					</msub>
+						<mtext mathsize="small">UCCESSOR</mtext>
+
+						<mtext>U</mtext>
+
+						<mtext mathsize="small">NION</mtext>
+					</mrow>
 				</fx:XML>
 			</factories:presentation>
 
 
 				<fx:XML xmlns="http://www.w3.org/1998/Math/MathML">
 
-					<msub>
+					<mrow>
 
-						<mo>prc</mo>
+						<mtext>P</mtext>
 
-						<mo>∩</mo>
-					</msub>
+						<mtext mathsize="small">REDECESSOR</mtext>
+
+						<mtext>I</mtext>
+
+						<mtext mathsize="small">NTERSECT</mtext>
+					</mrow>
 				</fx:XML>
 			</factories:presentation>
 
 
 				<fx:XML xmlns="http://www.w3.org/1998/Math/MathML">
 
-					<msub>
+					<mrow>
 
-						<mo>suc</mo>
+						<mtext>S</mtext>
 
-						<mo>∩</mo>
-					</msub>
+						<mtext mathsize="small">UCCESSOR</mtext>
+
+						<mtext>I</mtext>
+
+						<mtext mathsize="small">NTERSECT</mtext>
+					</mrow>
 				</fx:XML>
 			</factories:presentation>
 
 
 				<fx:XML xmlns="http://www.w3.org/1998/Math/MathML">
 
-					<mo form="infix">←</mo>
+					<mrow>
+
+						<mtext>B</mtext>
+
+						<mtext mathsize="small">RANCH</mtext>
+					</mrow>
 				</fx:XML>
 			</factories:presentation>
 
 
 				<fx:XML xmlns="http://www.w3.org/1998/Math/MathML">
 
-					<mo form="infix">@</mo>
+					<mrow>
+
+						<mtext>S</mtext>
+
+						<mtext mathsize="small">YNAPOMORPHIC</mtext>
+
+						<mtext>P</mtext>
+
+						<mtext mathsize="small">REDECESSORS</mtext>
+					</mrow>
 				</fx:XML>
 			</factories:presentation>
 
 
 				<fx:XML xmlns="http://www.w3.org/1998/Math/MathML">
 
-					<mo>Clade</mo>
+					<mrow>
+
+						<mtext>C</mtext>
+
+						<mtext mathsize="small">LADE</mtext>
+					</mrow>
 				</fx:XML>
 			</factories:presentation>
 
 
 				<fx:XML xmlns="http://www.w3.org/1998/Math/MathML">
 
-					<mo>Crown</mo>
+					<mrow>
+
+						<mtext>C</mtext>
+
+						<mtext mathsize="small">ROWN</mtext>
+					</mrow>
 				</fx:XML>
 			</factories:presentation>
 
 
 				<fx:XML xmlns="http://www.w3.org/1998/Math/MathML">
 
-					<mo>Total</mo>
+					<mrow>
+
+						<mtext>T</mtext>
+
+						<mtext mathsize="small">OTAL</mtext>
+					</mrow>
 				</fx:XML>
 			</factories:presentation>
 
 
 				<fx:XML xmlns="http://www.w3.org/1998/Math/MathML">
 
-					<mo>Reconstruct</mo>
+					<mrow>
+
+						<mtext>S</mtext>
+
+						<mtext mathsize="small">TATE</mtext>
+
+						<mtext>R</mtext>
+
+						<mtext mathsize="small">ECONSTRUCTION</mtext>
+					</mrow>
 				</fx:XML>
 			</factories:presentation>
 

src/org/namesonnodes/models/events/EditInfoEvent.as

+/*
+   Copyright (c) 2010 T. Michael Keesey <http://tmkeesey.net/>
+
+   Permission is hereby granted, free of charge, to any person obtaining a copy
+   of this software and associated documentation files (the "Software"), to deal
+   in the Software without restriction, including without limitation the rights
+   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+   copies of the Software, and to permit persons to whom the Software is
+   furnished to do so, subject to the following conditions:
+
+   The above copyright notice and this permission notice shall be included in
+   all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+   THE SOFTWARE.
+ */
+package org.namesonnodes.models.events
+{
+	import flash.events.Event;
+
+	public final class EditInfoEvent extends Event
+	{
+		public static const CURRENT_STATE_CHANGE:String = "currentStateChange";
+		public static const NAME_ENTRY_CHANGE:String = "nameEntryChange";
+
+		public function EditInfoEvent(type:String, bubbles:Boolean = false,
+									  cancelable:Boolean = false)
+		{
+			super(type, bubbles, cancelable);
+		}
+
+		override public function clone():Event
+		{
+			return new EditInfoEvent(type, bubbles, cancelable);
+		}
+
+		override public function toString():String
+		{
+			return formatToString("EditInfoEvent", "type", "bubbles",
+								  "cancelable", "eventPhase");
+		}
+	}
+}

src/org/namesonnodes/ui/definitions/ElementsMenu.mxml

 		 xmlns:layouts="asmathema.flex.layouts.*"
 		 xmlns:definitions="org.namesonnodes.ui.definitions.*"
 		 xmlns:factories="org.namesonnodes.models.definitions.factories.*"
-		 width="326"
-		 width.minimal="190"
+		 width="400"
+		 width.minimal="200"
 		 currentState="{minMaxControl.selected ? 'maximal' : 'minimal'}">
 
 	<s:layout>
 		<s:layout>
 
 			<layouts:HorizontalFlowLayout horizontalGap="8"
-										  verticalGap="12"
-										  padding="8"/>
+										  verticalGap="8"
+										  padding="8"
+										  verticalAlign="middle"/>
 		</s:layout>
 
 		<s:HGroup id="constantsGroup"
 
 			<definitions:CreateElementButton id="trueButton"
 											 factory="{ConstantFactory.TRUE}"/>
+		</s:HGroup>
 
-			<definitions:CreateElementButton id="falseButton"
-											 factory="{ConstantFactory.FALSE}"/>
+		<definitions:CreateElementButton id="falseButton"
+										 factory="{ConstantFactory.FALSE}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="emptySetButton"
-											 factory="{ConstantFactory.EMPTY_SET}"/>
+		<definitions:CreateElementButton id="emptySetButton"
+										 factory="{ConstantFactory.EMPTY_SET}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="phylogeneticGraphButton"
-											 factory="{CommonFactories.instance.phylogeneticGraphFactory}"/>
+		<definitions:CreateElementButton id="phylogeneticGraphButton"
+										 factory="{CommonFactories.instance.phylogeneticGraphFactory}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="universalTaxonButton"
-											 factory="{CommonFactories.instance.universalTaxonFactory}"/>
-		</s:HGroup>
+		<definitions:CreateElementButton id="universalTaxonButton"
+										 factory="{CommonFactories.instance.universalTaxonFactory}"
+										 includeIn="maximal"/>
 
 		<s:HGroup id="collectionsGroup"
 				  includeIn="maximal"
 
 			<definitions:CreateElementButton id="setButton"
 											 factory="{new ClassFactory(SetElement)}"/>
+		</s:HGroup>
 
-			<definitions:CreateElementButton id="listButton"
-											 factory="{new ClassFactory(ListElement)}"/>
-		</s:HGroup>
+		<definitions:CreateElementButton id="listButton"
+										 factory="{new ClassFactory(ListElement)}"
+										 includeIn="maximal"/>
 
 		<s:HGroup id="numbersGroup"
 				  includeIn="maximal"
 
 			<definitions:CreateElementButton id="setPiecewiseButton"
 											 factory="{CommonFactories.instance.setPiecewiseFactory}"/>
+		</s:HGroup>
 
-			<definitions:CreateElementButton id="setPieceButton"
-											 factory="{CommonFactories.instance.setPieceFactory}"/>
-		</s:HGroup>
+		<definitions:CreateElementButton id="setPieceButton"
+										 factory="{CommonFactories.instance.setPieceFactory}"
+										 includeIn="maximal"/>
 
 		<s:HGroup id="operationsGroup"
 				  verticalAlign="middle"
 
 			<definitions:CreateElementButton id="eqButton"
 											 factory="{CommonFactories.instance.eqFactory}"/>
+		</s:HGroup>
 
-			<definitions:CreateElementButton id="neqButton"
-											 factory="{CommonFactories.instance.neqFactory}"/>
+		<definitions:CreateElementButton id="neqButton"
+										 factory="{CommonFactories.instance.neqFactory}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="composeButton"
-											 factory="{CommonFactories.instance.composeFactory}"/>
+		<definitions:CreateElementButton id="composeButton"
+										 factory="{CommonFactories.instance.composeFactory}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="selectorButton"
-											 factory="{CommonFactories.instance.selectorFactory}"/>
-		</s:HGroup>
+		<definitions:CreateElementButton id="selectorButton"
+										 factory="{CommonFactories.instance.selectorFactory}"
+										 includeIn="maximal"/>
 
 		<s:HGroup id="booleanOperationsGroup"
 				  verticalAlign="middle"
 
 			<definitions:CreateElementButton id="notButton"
 											 factory="{CommonFactories.instance.notFactory}"/>
+		</s:HGroup>
 
-			<definitions:CreateElementButton id="andButton"
-											 factory="{CommonFactories.instance.andFactory}"/>
+		<definitions:CreateElementButton id="andButton"
+										 factory="{CommonFactories.instance.andFactory}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="orButton"
-											 factory="{CommonFactories.instance.orFactory}"/>
+		<definitions:CreateElementButton id="orButton"
+										 factory="{CommonFactories.instance.orFactory}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="xorButton"
-											 factory="{CommonFactories.instance.xorFactory}"/>
+		<definitions:CreateElementButton id="xorButton"
+										 factory="{CommonFactories.instance.xorFactory}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="impliesButton"
-											 factory="{CommonFactories.instance.impliesFactory}"/>
-		</s:HGroup>
+		<definitions:CreateElementButton id="impliesButton"
+										 factory="{CommonFactories.instance.impliesFactory}"
+										 includeIn="maximal"/>
 
 		<s:HGroup id="setOperationsGroup"
 				  verticalAlign="middle">
 
 			<definitions:CreateElementButton id="unionButton"
 											 factory="{CommonFactories.instance.unionFactory}"/>
+		</s:HGroup>
 
-			<definitions:CreateElementButton id="intersectButton"
-											 factory="{CommonFactories.instance.intersectFactory}"/>
+		<definitions:CreateElementButton id="intersectButton"
+										 factory="{CommonFactories.instance.intersectFactory}"/>
 
-			<definitions:CreateElementButton id="setDiffButton"
-											 factory="{CommonFactories.instance.setDiffFactory}"/>
+		<definitions:CreateElementButton id="setDiffButton"
+										 factory="{CommonFactories.instance.setDiffFactory}"/>
 
-			<definitions:CreateElementButton id="subsetButton"
-											 factory="{CommonFactories.instance.subsetFactory}"
-											 includeIn="maximal"/>
+		<definitions:CreateElementButton id="subsetButton"
+										 factory="{CommonFactories.instance.subsetFactory}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="prSubsetButton"
-											 factory="{CommonFactories.instance.prSubsetFactory}"
-											 includeIn="maximal"/>
+		<definitions:CreateElementButton id="prSubsetButton"
+										 factory="{CommonFactories.instance.prSubsetFactory}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="notSubsetButton"
-											 factory="{CommonFactories.instance.notSubsetFactory}"
-											 includeIn="maximal"/>
+		<definitions:CreateElementButton id="notSubsetButton"
+										 factory="{CommonFactories.instance.notSubsetFactory}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="notPrSubsetButton"
-											 factory="{CommonFactories.instance.notPrSubsetFactory}"
-											 includeIn="maximal"/>
-		</s:HGroup>
+		<definitions:CreateElementButton id="notPrSubsetButton"
+										 factory="{CommonFactories.instance.notPrSubsetFactory}"
+										 includeIn="maximal"/>
 
 		<s:HGroup id="characterStatesGroup"
 				  verticalAlign="middle"
 
 			<definitions:CreateElementButton id="maximalButton"
 											 factory="{CommonFactories.instance.maximalFactory}"/>
+		</s:HGroup>
 
-			<definitions:CreateElementButton id="minimalButton"
-											 factory="{CommonFactories.instance.minimalFactory}"/>
+		<definitions:CreateElementButton id="minimalButton"
+										 factory="{CommonFactories.instance.minimalFactory}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="prcUnionButton"
-											 factory="{CommonFactories.instance.predecessorUnionFactory}"/>
+		<definitions:CreateElementButton id="prcUnionButton"
+										 factory="{CommonFactories.instance.predecessorUnionFactory}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="sucUnionButton"
-											 factory="{CommonFactories.instance.successorUnionFactory}"/>
+		<definitions:CreateElementButton id="sucUnionButton"
+										 factory="{CommonFactories.instance.successorUnionFactory}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="prcIntersectButton"
-											 factory="{CommonFactories.instance.predecessorIntersectionFactory}"/>
+		<definitions:CreateElementButton id="prcIntersectButton"
+										 factory="{CommonFactories.instance.predecessorIntersectionFactory}"
+										 includeIn="maximal"/>
 
-			<definitions:CreateElementButton id="sucIntersectButton"
-											 factory="{CommonFactories.instance.successorIntersectionFactory}"/>
-		</s:HGroup>
+		<definitions:CreateElementButton id="sucIntersectButton"
+										 factory="{CommonFactories.instance.successorIntersectionFactory}"
+										 includeIn="maximal"/>
 
 		<s:HGroup id="cladeAncestorOperationsGroup"
 				  verticalAlign="middle">
 
 			<definitions:CreateElementButton id="exclusivePrcButton"
 											 factory="{CommonFactories.instance.exclusivePredecessorsFactory}"/>
+		</s:HGroup>
 
-			<definitions:CreateElementButton id="synapomorphicPrcButton"
-											 factory="{CommonFactories.instance.synapomorphicPredecessorsFactory}"/>
-		</s:HGroup>
+		<definitions:CreateElementButton id="synapomorphicPrcButton"
+										 factory="{CommonFactories.instance.synapomorphicPredecessorsFactory}"/>
 
 		<s:HGroup id="cladeOperationsGroup"
 				  verticalAlign="middle">
 
 			<definitions:CreateElementButton id="cladeButton"
 											 factory="{CommonFactories.instance.cladeFactory}"/>
+		</s:HGroup>
 
-			<definitions:CreateElementButton id="crownCladeButton"
-											 factory="{CommonFactories.instance.crownCladeFactory}"/>
+		<definitions:CreateElementButton id="crownCladeButton"
+										 factory="{CommonFactories.instance.crownCladeFactory}"/>
 
-			<definitions:CreateElementButton id="totalCladeButton"
-											 factory="{CommonFactories.instance.totalCladeFactory}"/>
-		</s:HGroup>
+		<definitions:CreateElementButton id="totalCladeButton"
+										 factory="{CommonFactories.instance.totalCladeFactory}"/>
 	</s:SkinnableContainer>
 </s:Group>

src/org/namesonnodes/ui/editing/EditPane.mxml

 						  width="100%"
 						  styleName="bar">
 
-		<s:Label text="Edit"
-				 text.mathDefinition="Edit Definition"
-				 text.presentations="Edit Name"
-				 text.uris="Edit URL List"
-				 fontWeight="bold">
+		<s:layout>
 
-			<s:filters>
+			<s:VerticalLayout horizontalAlign="left"
+							  gap="0"/>
+		</s:layout>
 
-				<s:GlowFilter color="#000066"
-							  blurX="4"
-							  blurY="4"
-							  quality="4"/>
-			</s:filters>
-		</s:Label>
+		<s:Group width="100%">
 
-		<s:Group>
+			<s:layout>
 
-			<components:DragTarget id="presentationListTarget"
-								   label="Edit Name"
-								   left="0"
-								   right="0"
-								   toolTip="Drag a name here to edit it."
-								   visible="{context.names.entries.length != 0}"
-								   buttonMode.presentations="true"
-								   mouseDown.presentations="presentationListTarget_mouseDownHandler(event)">
+				<s:HorizontalLayout verticalAlign="middle"
+									gap="12"
+									paddingLeft="8"
+									paddingTop="8"
+									paddingRight="8"
+									paddingBottom="8"/>
+			</s:layout>
 
-				<components:dataHandlers>
+			<s:Label text="Edit"
+					 text.mathDefinition="Edit Definition"
+					 text.presentations="Edit Name"
+					 text.uris="Edit URL List"
+					 fontWeight="bold">
 
-					<components:DragDataHandler target="{this}"
-												feedback="copy"
-												format="org.namesonnodes.models::NameEntry"
-												handler="{handleNameEntry_presentationList}"/>
-				</components:dataHandlers>
-			</components:DragTarget>
+				<s:filters>
 
-			<names:NameRenderer id="presentationsNameRenderer"
-								includeIn="presentations"
-								data="{context.editInfo.nameEntry}"
-								top="-2"
-								left="-3"
-								right="-2"
-								bottom="1"
-								mouseEnabled="false"
-								creationComplete="updateSelection()"/>
-		</s:Group>
+					<s:GlowFilter color="#000066"
+								  blurX="4"
+								  blurY="4"
+								  quality="4"/>
+				</s:filters>
+			</s:Label>
 
-		<s:Group>
+			<s:Group>
 
-			<components:DragTarget id="uriListTarget"
-								   label="Edit URL List"
-								   left="0"
-								   right="0"
-								   toolTip="Drag a name here to edit its associated URI(s)."
-								   visible="{context.names.entries.length != 0}"
-								   buttonMode.uris="true"
-								   mouseDown.uris="uriListTarget_mouseDownHandler(event)">
+				<components:DragTarget id="presentationListTarget"
+									   label="Edit Name"
+									   left="0"
+									   right="0"
+									   toolTip="Drag a name here to edit it."
+									   visible="{context.names.entries.length != 0}"
+									   buttonMode.presentations="true"
+									   mouseDown.presentations="presentationListTarget_mouseDownHandler(event)">
 
-				<components:dataHandlers>
+					<components:dataHandlers>
 
-					<components:DragDataHandler target="{this}"
-												feedback="copy"
-												format="org.namesonnodes.models::NameEntry"
-												handler="{handleNameEntry_uriList}"/>
-				</components:dataHandlers>
-			</components:DragTarget>
+						<components:DragDataHandler target="{this}"
+													feedback="copy"
+													format="org.namesonnodes.models::NameEntry"
+													handler="{handleNameEntry_presentationList}"/>
+					</components:dataHandlers>
+				</components:DragTarget>
 
-			<names:NameRenderer id="urisNameRenderer"
-								includeIn="uris"
-								data="{context.editInfo.nameEntry}"
-								top="-2"
-								left="-3"
-								right="-2"
-								bottom="1"
-								mouseEnabled="false"
-								creationComplete="updateSelection()"/>
-		</s:Group>
+				<names:NameRenderer id="presentationsNameRenderer"
+									includeIn="presentations"
+									data="{context.editInfo.nameEntry}"
+									top="-2"
+									left="-3"
+									right="-2"
+									bottom="1"
+									mouseEnabled="false"
+									creationComplete="updateSelection()"/>
+			</s:Group>
 
-		<s:Group>
+			<s:Group>
 
-			<components:DragTarget id="mathDefinitionTarget"
-								   label="Edit Definitional Formula"
-								   left="0"
-								   right="0"
-								   toolTip="Drag a name here to edit its mathematical definition."
-								   visible="{context.names.entries.length != 0}"
-								   buttonMode.mathDefinition="true"
-								   mouseDown.mathDefinition="mathDefinitionTarget_mouseDownHandler(event)">
+				<components:DragTarget id="uriListTarget"
+									   label="Edit URL List"
+									   left="0"
+									   right="0"
+									   toolTip="Drag a name here to edit its associated URI(s)."
+									   visible="{context.names.entries.length != 0}"
+									   buttonMode.uris="true"
+									   mouseDown.uris="uriListTarget_mouseDownHandler(event)">
 
-				<components:dataHandlers>
+					<components:dataHandlers>
 
-					<components:DragDataHandler target="{this}"
-												feedback="copy"
-												format="org.namesonnodes.models::NameEntry.definition is MathElement"
-												handler="{handleNameEntry_mathDefinition}"/>
-				</components:dataHandlers>
-			</components:DragTarget>
+						<components:DragDataHandler target="{this}"
+													feedback="copy"
+													format="org.namesonnodes.models::NameEntry"
+													handler="{handleNameEntry_uriList}"/>
+					</components:dataHandlers>
+				</components:DragTarget>
 
-			<names:NameRenderer id="mathDefinitionNameRenderer"
-								includeIn="mathDefinition"
-								data="{context.editInfo.nameEntry}"
-								top="-2"
-								left="-3"
-								right="-2"
-								bottom="1"
-								mouseEnabled="false"
-								creationComplete="updateSelection()"/>
+				<names:NameRenderer id="urisNameRenderer"
+									includeIn="uris"
+									data="{context.editInfo.nameEntry}"
+									top="-2"
+									left="-3"
+									right="-2"
+									bottom="1"
+									mouseEnabled="false"
+									creationComplete="updateSelection()"/>
+			</s:Group>
+
+			<s:Group>
+
+				<components:DragTarget id="mathDefinitionTarget"
+									   label="Edit Definitional Formula"
+									   left="0"
+									   right="0"
+									   toolTip="Drag a name here to edit its mathematical definition."
+									   visible="{context.names.entries.length != 0}"
+									   buttonMode.mathDefinition="true"
+									   mouseDown.mathDefinition="mathDefinitionTarget_mouseDownHandler(event)">
+
+					<components:dataHandlers>
+
+						<components:DragDataHandler target="{this}"
+													feedback="copy"
+													format="org.namesonnodes.models::NameEntry.definition is MathElement"
+													handler="{handleNameEntry_mathDefinition}"/>
+					</components:dataHandlers>
+				</components:DragTarget>
+
+				<names:NameRenderer id="mathDefinitionNameRenderer"
+									includeIn="mathDefinition"
+									data="{context.editInfo.nameEntry}"
+									top="-2"
+									left="-3"
+									right="-2"
+									bottom="1"
+									mouseEnabled="false"
+									creationComplete="updateSelection()"/>
+			</s:Group>
+
+			<s:Group includeIn="mathDefinition">
+
+				<s:layout>
+
+					<s:HorizontalLayout verticalAlign="bottom"
+										paddingLeft="48"/>
+				</s:layout>
+
+				<s:RadioButton value="visual"
+							   group="{mathEditorStateGroup}"
+							   label="Visual Editor"/>
+
+				<s:RadioButton value="textual"
+							   group="{mathEditorStateGroup}"
+							   label="MathML Editor"/>
+
+				<s:Rect width="100"/>
+			</s:Group>
+
+			<s:Rect width="100%"/>
+
+			<s:Button id="clearButton"
+					  click="clearButton_clickHandler(event)"
+					  buttonMode="true"
+					  includeIn="active"
+					  label="×"
+					  toolTip="Click here to close this pane."/>
 		</s:Group>
 
 		<s:Group includeIn="presentations">
 
 			<s:layout>
 
-				<s:HorizontalLayout paddingLeft="48"/>
+				<s:HorizontalLayout verticalAlign="middle"
+									gap="12"
+									paddingLeft="8"
+									paddingTop="8"
+									paddingRight="8"
+									paddingBottom="8"/>
 			</s:layout>
 
 			<names:PresentationEditorControls id="presentationEditorControls"
 
 			<s:layout>
 
-				<s:HorizontalLayout gap="12"
-									verticalAlign="bottom"
-									paddingLeft="48"/>
+				<s:HorizontalLayout verticalAlign="middle"
+									gap="12"
+									paddingLeft="8"
+									paddingTop="8"
+									paddingRight="8"
+									paddingBottom="8"/>
 			</s:layout>
 
 			<s:Button id="addURIButton"
 				</components:dataHandlers>
 			</components:DragTarget>
 		</s:Group>
-
-		<s:Group includeIn="mathDefinition">
-
-			<s:layout>
-
-				<s:HorizontalLayout verticalAlign="bottom"
-									paddingLeft="48"/>
-			</s:layout>
-
-			<s:RadioButton value="visual"
-						   group="{mathEditorStateGroup}"
-						   label="Visual Editor"/>
-
-			<s:RadioButton value="textual"
-						   group="{mathEditorStateGroup}"
-						   label="MathML Editor"/>
-
-			<s:Rect width="100"/>
-		</s:Group>
-
-		<s:Rect width="100%"/>
-
-		<s:Button id="clearButton"
-				  click="clearButton_clickHandler(event)"
-				  buttonMode="true"
-				  includeIn="active"
-				  label="×"
-				  toolTip="Click here to close this pane."/>
 	</s:SkinnableContainer>
 
 	<s:Group id="contentGroup"

src/org/namesonnodes/ui/names/NamesPane.mxml

 			{
 				if (entry.presentationList.length == 0)
 					return false;
-				return entry is MathElement;
+				return entry.definition is MathElement;
 			}
 			[Bindable]
 			public var context:Context;