| Package | com.kapit.diagram.proxies |
| Class | public class KDLProxy |
| Inheritance | KDLProxy DiagramProxy |
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:diagctl="com.kapit.diagram.controls.
xmlns:diagview="com.kapit.diagram.view.
layout="absolute" preinitialize="init();" xmlns:proxies="com.kapit.diagram.proxies.>
<mx:XML xmlns="" id="svglib">
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns:k="http://schemas.kapit.fr/svg/2007/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.0" width="1024" height="800" id="sgvlib">
<defs id="defs1">
<style type="text/css">
<![CDATA[
.basic {
action-accept:annotation;
}
.bg {
action-click:link;
action-accept:link;
}
]]>
</style>
</defs>
<g
k:spriteid="rounded-rectangle"
k:groupid="Basic"
id="grrectangle"
class="basic" transform="translate(116.20044,0)">
<rect
style="fill:#e1eaf5;fill-opacity:0.8;stroke:#6996cf;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect3157"
y="18.47105" x="137.22656"
rx="10" ry="10"
height="60.609154" width="98.994949" />
<path
class="bg"
id="rect31552"
style="fill:none;fill-opacity:0;stroke:#6996cf;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0"
d="M 137.22656,18.47105 L 236.22151,18.47105 L 236.22151,79.080204 L 137.22656,79.080204 L 137.22656,18.47105 z" />
</g>
</svg>
</mx:XML>
<mx:Script>
<![CDATA[
import com.kapit.diagram.library.SVGAssetLibrary;
import com.kapit.diagram.proxies.KDLProxy;
import com.kapit.diagram.layouts.utils.Constants;
private var proxy:KDLProxy;
[Bindable]
public var LAYOUT_ARRAY:Array = [
{label:"Circular", data:Constants.CIRCULAR_LAYOUT},
{label:"Hierarchical Tree", data:Constants.HIERARCHICAL_LAYOUT},
{label:"Radial", data:Constants.RADIAL_LAYOUT},
{label:"Balloon", data:Constants.BALLOON_LAYOUT},
{label:"Hierarchical-Cyclic", data:Constants.SUGIYAMA_LAYOUT},
{label:"Static Organic", data:Constants.STATIC_GEM_LAYOUT},
{label:"Animated Organic", data:Constants.ANIMATED_FORCEDIRECTED_LAYOUT},
{label:"Orthogonal", data:Constants.ORTHOGONAL_LAYOUT}
];
public function init():void
{
var lib:SVGAssetLibrary=new SVGAssetLibrary(svglib);
}
public function initDiagram():void
{
diagram.multipanel=false;
diagram.selectionenabled=true;
diagram.keyboardenabled=true;
diagram.dragenabled=true;
diagram.dropenabled=true;
proxy = new KDLProxy(diagram);
proxy.importGraph();
proxy.exportGraph(LAYOUT_ARRAY[0].data);
params.diagramProxy = proxy;
}
private function closeHandler(event:Event):void {
proxy.exportGraph(ComboBox(event.target).selectedItem.data);
params.diagramProxy = proxy;
}
]]>
</mx:Script>
<mx:ApplicationControlBar width="100%" height="50" horizontalAlign="right">
<diagctl:SVGAssetLibraryGroupButton width="150" groupid="Basic"
cornerRadius="10" paddingLeft="8" paddingBottom="0" paddingTop="0"
useHandCursor="true" toolTip="Drag & drop" labelPlacement="right" textAlign="left"/>
</mx:ApplicationControlBar>
<mx:HBox left="10" top="60" bottom="10" right="10" horizontalGap="10">
<mx:VBox>
<mx:ComboBox dataProvider="{LAYOUT_ARRAY}" width="150" color="0x000000"
close="closeHandler(event);"/>
<proxies:GenericDialog id="params" autoLayout="true">
</proxies:GenericDialog>
</mx:VBox>
<diagview:DiagramView width="100%" height="100%" id="diagram" creationComplete="initDiagram();">
</diagview:DiagramView>
</mx:HBox>
</mx:Application>
| Method | Defined by | ||
|---|---|---|---|
|
KDLProxy(view:DiagramView)
Builds a DiagramProxy instance that is used as an interface between a graph (Structure Model) and DiagramView (Renderer and Data Source)
| KDLProxy | ||
![]() |
addDiagramGroupAsMetaNode(group:DiagramGroup, withExternalLinks:Boolean = true):IGraph
Adds a metanode as a graph to the general graph description of this DiagramProxy from a DiagramGroup instance and returns it.
| DiagramProxy | |
![]() |
addDiagramLinkAsEdge(link:DiagramLink, customGraph:IGraph = null, customEdgeLinkMap:Dictionary = null, customLinkEdgeMap:Dictionary = null, customSpriteNodeMap:Dictionary = null):IEdge
Adds a edge to the graph description of this DiagramProxy from a DiagramEdge instance and returns it.
| DiagramProxy | |
![]() |
addDiagramSpriteAsNode(sprite:DiagramSprite, customGraph:IGraph = null, customNodeSpriteMap:Dictionary = null, customSpriteNodeMap:Dictionary = null, customConstraintManager:ConstraintManager = null, customConstraintNodes:Dictionary = null):INode
Adds a node to the graph description of this DiagramProxy from a DiagramSprite instance and returns it.
| DiagramProxy | |
![]() |
addItem(dob:DiagramObject):void
Adds an item (a DiagramObject) to this DiagramProxy (graph and renderer references)
| DiagramProxy | |
![]() |
affilateItem(dob:DiagramObject):void
| DiagramProxy | |
![]() |
animateGroupLinks(edges:Array, customTweeners:Array = null, withAnimation:Boolean = true):void
Animates Group In/Out Links
| DiagramProxy | |
![]() |
doAnimatedTransition(outEdges:Array = null, customGraph:IGraph = null, customNodeSpriteMap:Dictionary = null, customEdgeLinkMap:Dictionary = null, customTweeners:Array = null, withAnimation:Boolean = true, doTransition:Boolean = true):void
Performs an animated transition from old sprites position to new positions grabbed from the graph (usually after layout)
| DiagramProxy | |
|
exportGraph(layoutType:int):void
| KDLProxy | ||
![]() |
getLayoutFromType(layoutType:int, customGraph:IGraph = null):Layout
Returns a Layout subclass instance according to a layoutType from the Constants class.
| DiagramProxy | |
![]() | DiagramProxy | ||
|
handleAddItem(addEvent:DiagramEvent):void
Detects any item add in the DiagramView by catching DiagramEvent.ELEMENT_ADDED event and updates the DiagramProxy elements according to that changes
(maps and graph)
| KDLProxy | ||
|
handleAffilateItem(affilateItem:DiagramEvent):void
| KDLProxy | ||
|
handleDragFinished(event:DiagramDragEvent):void
Finalizes a drag operation of a progressive layout (sprites are supposed to be in the Sprite Layer)
| KDLProxy | ||
|
handleDragging(event:DiagramDragEvent):void
Handles the dragging process of nodes for progressive layouts, by updating the position of dragged nodes.
| KDLProxy | ||
|
handleDragStarted(event:DiagramDragEvent):void
andles the start of drag operation for progressive layouts.
| KDLProxy | ||
|
handleGroupCreated(groupEvent:DiagramEvent):void
| KDLProxy | ||
|
handleGroupUngrouped(groupEvent:DiagramEvent):void
| KDLProxy | ||
|
handlePropertyChanged(propertyEvent:DiagramEvent):void
| KDLProxy | ||
|
handleRemoveItem(removeEvent:DiagramEvent):void
Detects any item removal in the DiagramView by catching the DiagramEvent.ELEMENT_REMOVED event and updates the DiagramProxy elements according to that changes
(maps and graph)
| KDLProxy | ||
|
handleSelectionRemoved(removeEvent:DiagramEvent):void
| KDLProxy | ||
|
handleStopAnimation(event:TweenEngineEvent):void
| KDLProxy | ||
|
importGraph():IGraph
| KDLProxy | ||
|
initMaps():void
| KDLProxy | ||
|
layoutSelection(layoutType:uint, sprites:Array, customOutEdges:Array = null, withAnimation:Boolean = true, doTransition:Boolean = true, tweeners:Array = null, minX:Number = 0, minY:Number = 0):IGraph
| KDLProxy | ||
![]() |
removeGroupElementReferences(group:DiagramGroup):void
Removes a DiagramGroup references from this DiagramProxy
| DiagramProxy | |
![]() |
removeItem(dob:DiagramObject):void
Removes an item (a DiagramObject) to this DiagramProxy (graph and renderer references)
| DiagramProxy | |
![]() |
removeLinkElementReferences(link:DiagramLink):void
Removes a DiagramLink references from this DiagramProxy
| DiagramProxy | |
![]() |
removeSpriteElementReferences(sprite:DiagramSprite):void
Removes a DiagramSprite references from this DiagramProxy
| DiagramProxy | |
|
selectProxy(event:MouseEvent):void
Selects a DiagramProxy of a selected Group and updates the layout options
| KDLProxy | ||
![]() |
ungroupGroupElement(group:DiagramGroup):void
Inflicts an ungroup operation in the Diagram to the graph structure and Renderer-GraphLayout maps.
| DiagramProxy | |
![]() |
updateReferences(dob:DiagramObject):void
| DiagramProxy | |
![]() |
updateRendererFromGraph(element:IGraphItem, withAnimation:Boolean = true, update:Boolean = false):void
inheritDoc
| DiagramProxy | |
| Method | Defined by | ||
|---|---|---|---|
![]() |
getEdgeTypeFromLinkType(linkType:DiagramLinkType):int
Returns an Edge type given a DiagramLinkType
| DiagramProxy | |
![]() |
getIntermediatePoint(point1:Point, point2:Point, isHorizontal:Boolean):Point
Determines the intermediate point that links two points in an orthogonal fashion
| DiagramProxy | |
![]() |
getLinkTypeFromEdge(edgeType:int):DiagramLinkType
Returns a DiagramLinkType according to an edgeType int (from the Constants class)
| DiagramProxy | |
![]() |
initLayouts():void
| DiagramProxy | |
|
switchToStraightLineType(nonStraightEdgesArray:Array, tweeners:Array = null):void
| KDLProxy | ||
![]() |
updateDiagramLinkFromEdge(edge:IEdge, customGraph:IGraph = null, customEdgeLinkMap:Dictionary = null, customTweeners:Array = null, withAnimation:Boolean = true):void
Updates the DiagramLink referenced by a edge (via the map _edgeLinkMap) by applying the edge properties on it (path).
| DiagramProxy | |
![]() |
updateDiagramSpriteFromNode(node:INode, customGraph:IGraph = null, customNodeSpriteMap:Dictionary = null, customTweeners:Array = null, withAnimation:Boolean = true, update:Boolean = false):void
Updates the DiagramSprite referenced by a node (via the map _nodeSpriteMap) by applying the node properties on it (placement and size).
| DiagramProxy | |
![]() |
updateEdgeExtremities(edge:IEdge, customGraph:IGraph = null, customEdgeLinkMap:Dictionary = null):void
Updates Edge Extremities given its extremity nodes position.
| DiagramProxy | |
![]() |
updateEdgePointsFromLink(edge:IEdge, link:DiagramLink):void
Updates edge points from a DiagramLink
| DiagramProxy | |
![]() |
updateEdgesFromLinks(customGraph:IGraph = null, customedgeLinkMap:Dictionary = null, customNodeSpriteMap:Dictionary = null, customGroupProxies:Dictionary = null):void
Updates graph nodes from their respective sprites
| DiagramProxy | |
![]() |
updateNodePropertiesFromSprite(node:INode, sprite:DiagramObject):void
Updates node properties (size and position) from a given DiagramSprite
| DiagramProxy | |
![]() |
updateNodesFromSprites(customGraph:IGraph = null, customNodeSpriteMap:Dictionary = null, customGroupProxies:Dictionary = null):void
Updates graph nodes from their respective sprites
| DiagramProxy | |
| layoutOptions | property |
layoutOptions:GenericDialog [read-write]The "layout Options" panel that controls layouts' parameters
Implementation public function get layoutOptions():GenericDialog
public function set layoutOptions(value:GenericDialog):void
| moveRootToCenter | property |
moveRootToCenter:Boolean [read-write]Implementation
public function get moveRootToCenter():Boolean
public function set moveRootToCenter(value:Boolean):void
| renderer | property |
renderer:Object [read-write]Implementation
public function get renderer():Object
public function set renderer(value:Object):void
| rootNode | property |
rootNode:INode [read-write]Implementation
public function get rootNode():INode
public function set rootNode(value:INode):void
| source | property |
source:Object [read-write]Implementation
public function get source():Object
public function set source(value:Object):void
| withAnimation | property |
withAnimation:Boolean [read-write]Implementation
public function get withAnimation():Boolean
public function set withAnimation(value:Boolean):void
| KDLProxy | () | constructor |
public function KDLProxy(view:DiagramView)Builds a DiagramProxy instance that is used as an interface between a graph (Structure Model) and DiagramView (Renderer and Data Source)
Parametersview:DiagramView — DiagramView from which the DiagramProxy is initialised and updated
|
| exportGraph | () | method |
public override function exportGraph(layoutType:int):voidParameters
layoutType:int |
| handleAddItem | () | method |
public function handleAddItem(addEvent:DiagramEvent):voidDetects any item add in the DiagramView by catching DiagramEvent.ELEMENT_ADDED event and updates the DiagramProxy elements according to that changes (maps and graph)
ParametersaddEvent:DiagramEvent — Event notifying that an item has been added to the DiagramView and that the DiagramProxy must be updated.
|
| handleAffilateItem | () | method |
public function handleAffilateItem(affilateItem:DiagramEvent):voidParameters
affilateItem:DiagramEvent |
| handleDragFinished | () | method |
public override function handleDragFinished(event:DiagramDragEvent):voidFinalizes a drag operation of a progressive layout (sprites are supposed to be in the Sprite Layer)
Parametersevent:DiagramDragEvent — DiagramDragEvent
|
| handleDragging | () | method |
public override function handleDragging(event:DiagramDragEvent):voidHandles the dragging process of nodes for progressive layouts, by updating the position of dragged nodes.
Parametersevent:DiagramDragEvent — Detected Drag Event
|
| handleDragStarted | () | method |
public override function handleDragStarted(event:DiagramDragEvent):void
andles the start of drag operation for progressive layouts.
This method can be extended to handle more operations
event:DiagramDragEvent — DiagramDragEvent
|
| handleGroupCreated | () | method |
| handleGroupUngrouped | () | method |
public function handleGroupUngrouped(groupEvent:DiagramEvent):voidParameters
groupEvent:DiagramEvent |
| handlePropertyChanged | () | method |
public function handlePropertyChanged(propertyEvent:DiagramEvent):voidParameters
propertyEvent:DiagramEvent |
| handleRemoveItem | () | method |
public function handleRemoveItem(removeEvent:DiagramEvent):voidDetects any item removal in the DiagramView by catching the DiagramEvent.ELEMENT_REMOVED event and updates the DiagramProxy elements according to that changes (maps and graph)
ParametersremoveEvent:DiagramEvent — Event notifying that an item has been removed from the DiagramView and that the DiagramProxy must be updated.
|
| handleSelectionRemoved | () | method |
public function handleSelectionRemoved(removeEvent:DiagramEvent):voidParameters
removeEvent:DiagramEvent |
| handleStopAnimation | () | method |
| importGraph | () | method |
public override function importGraph():IGraphReturns
IGraph |
| initMaps | () | method |
public function initMaps():void
| layoutSelection | () | method |
public override function layoutSelection(layoutType:uint, sprites:Array, customOutEdges:Array = null, withAnimation:Boolean = true, doTransition:Boolean = true, tweeners:Array = null, minX:Number = 0, minY:Number = 0):IGraphParameters
layoutType:uint |
|
sprites:Array |
|
customOutEdges:Array (default = null) |
|
withAnimation:Boolean (default = true) |
|
doTransition:Boolean (default = true) |
|
tweeners:Array (default = null) |
|
minX:Number (default = 0) |
|
minY:Number (default = 0) |
IGraph |
| selectProxy | () | method |
public function selectProxy(event:MouseEvent):voidSelects a DiagramProxy of a selected Group and updates the layout options
Parametersevent:MouseEvent — MouseEvent
|
| switchToStraightLineType | () | method |
protected function switchToStraightLineType(nonStraightEdgesArray:Array, tweeners:Array = null):voidParameters
nonStraightEdgesArray:Array |
|
tweeners:Array (default = null) |