Action Package

The Kalileo components are architecturally managed to let a set of classes (implementing IAction interface) deal with user interactions. Theses classes as explained, in the previous sections, deals with a given user interaction by responding to mouse, keyboard or Kalileo events. They can be activated or deactivated, enabled or not and even patched to meet some custom functional specifications needed by the developer. From this functional point of view, Kalileo have been equipped to manage action packages.

In fact, an Action Package in Kalileo, is a class implementing the IActionPackage interface that provides a set of actions to be deployed on a given Visualizer/Diagrammer instance via registerActionPackage. Such a packaging paradigm will be usefull for developping domain specific Kalileo versions that integrate a given actions suitable for a diagramming need (multi touch diagramming, mind mapping, bpmn....).

The action packages can be distributed in swc files and the main package class can be directly taken into account in the Kalileo component (by replacing current actions or deploying specifc action sets). In Kalileo, a default action package instance is used for the Visualizer who's class is VisualizerActionPackage and a default one is used in the diagrammer to subsitute Visualizer actions by diagramming specific actions (DiagrammerActionPackage class). A MultiTouch action package is provided in an swc file with the component to let developers take advantage of Kalileo components on multi-touch devices.

In the following code, an example of action package integration is provided.

<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" 
		 xmlns:s="library://ns.adobe.com/flex/spark" 
		 xmlns:mx="library://ns.adobe.com/flex/mx"
		 xmlns:visualizer="fr.kapit.visualizer.*"
		 implements="fr.kapit.tests.views.ITestUnit"
		 width="100%" height="100%">
	<fx:Script>
		<![CDATA[
			import fr.kapit.multitouch.actions.packages.VisualizerMultitouchActionPackage;
			import fr.kapit.tests.views.ITestUnit;
			import fr.kapit.visualizer.actions.MultiSelectionAction;
			import fr.kapit.visualizer.actions.PanAction;
			import fr.kapit.visualizer.actions.data.SelectionActionData;
			
			import mx.events.FlexEvent;
			public function get visualizer():Visualizer
			{
				return viz;
			}
			protected function viz_creationCompleteHandler(event:FlexEvent):void
			{
				viz.registerActionPackage(new VisualizerMultitouchActionPackage());
			}
		]]>
	</fx:Script>
	
	<fx:Declarations>
		<fx:XML id="dp">
			<graphml>
				<node id='1' label='A'/> 
				<node id='2' label='B'/> 
				<node id='3' label='C'/> 
				<node id='4' label='D'/>
				<node id='5' label='E'/>
				<node id='6' label='E'/>
				<node id='7' label='E'/>
				<node id='8' label='E'/>
				<node id='9' label='E'/>
				<node id='10' label='E'/>
				<edge source='1' target='2'/> 
				<edge source='1' target='3'/>
				<edge source='2' target='4'/>
				<edge source='2' target='5'/>
				<edge source='2' target='6'/>
				<edge source='6' target='7'/>
				<edge source='7' target='8'/>
				<edge source='8' target='9'/>
				<edge source='8' target='10'/>
			</graphml>
		</fx:XML>
	</fx:Declarations>
	
	<visualizer:Visualizer
		id="viz"
		width="100%"
		height="100%"
		layout="balloon"
		nodeLabelFields="label"
		dataProvider="{dp}"
		creationComplete="viz_creationCompleteHandler(event)"
		/>
</s:Group>