Packagecom.kapit.diagram.ui
Classpublic class DiagramLinkUI
InheritanceDiagramLinkUI Inheritance DiagramObjectUI Inheritance mx.core.UIComponent
ImplementsIDiagramObjectUI
SubclassesDiagramLinkOrthogonalUI



Public Properties
 PropertyDefined by
 Inheritedinnerheight : Number
The inner height of this component.
DiagramObjectUI
 Inheritedinnerleft : Number
The inner left position (X coordinate).
DiagramObjectUI
 Inheritedinnertop : Number
The inner top position (Y coordinate).
DiagramObjectUI
 Inheritedinnerwidth : Number
The inner width of this component.
DiagramObjectUI
 Inheritedlocked : Boolean
Locked property that defines if the UI is locked, meaning it can't be inactivated.
DiagramObjectUI
 Inheritedouterheight : Number
The outer height of this component.
DiagramObjectUI
 Inheritedouterwidth : Number
The outer width of this component.
DiagramObjectUI
 Inheritedsource : DiagramObject
Source property that defines the Diagram Object to which this DiagramObjectUI is linked.
DiagramObjectUI
Protected Properties
 PropertyDefined by
 Inherited_activated : Boolean = false
Activation status of the DiagramObjectUI.
DiagramObjectUI
  _annotatebutton : AnnotateButton = null
DiagramLinkUI
  _cssinitialized : Boolean
[static]
DiagramLinkUI
  _curpointidx : int = -1
Current point index.
DiagramLinkUI
  _curuihandler : Function = null
Used UI Handler (dependant to cursor selection).
DiagramLinkUI
  _dlink : DiagramLink = null
Diagram Link to which this DiagramLinkUI is linked.
DiagramLinkUI
  _knobfill : Number
[static] Knob fill style property (color number).
DiagramLinkUI
  _knobfillopacity : Number
[static] Knob fill opacity style property (color number).
DiagramLinkUI
  _knoblinecolor : Number
[static] Knob line color style property (color number).
DiagramLinkUI
  _knoblineopacity : Number
[static] Knob line opacity style property (percentage number).
DiagramLinkUI
  _knoblinewidth : Number
[static] Knob line width style property.
DiagramLinkUI
  _selectedstyleselector : String = "null"
[static] Selected style selector String representation.
DiagramLinkUI
  selectedstyleselector : String
[static] The selected style selector.
DiagramLinkUI
  _selidx : int = -1
Selected point index.
DiagramLinkUI
  _selknobfill : Number
[static] Selected Knob fill style property (color number).
DiagramLinkUI
  _selknobfillopacity : Number
[static] Selected Knob fill opacity style property (color number).
DiagramLinkUI
  _selknoblinecolor : Number
[static] Selected Knob line color style property (color number).
DiagramLinkUI
  _selknoblineopacity : Number
[static] Selected Knob line opacity style property (percentage number).
DiagramLinkUI
  _selknoblinewidth : Number
[static] Selected Knob line width style property.
DiagramLinkUI
 Inherited_source : DiagramObject = null
The Diagram Object to which this DiagramObjectUI is linked.
DiagramObjectUI
  _styleselector : String = "null"
[static] "Not Selected Knob" style selector String representation.
DiagramLinkUI
  styleselector : String
[static] The style sector used in this DiagramLinkUI.
DiagramLinkUI
Public Methods
 MethodDefined by
  
Creates a DiagramLinkUI instance given a DiagramLink to which it is linked (defining CSS styling, cursor, used style selectors...).
DiagramLinkUI
 Inherited
activate(a:Boolean):void
Activates or deactivates this DiagramObjectUI by adding or removing action and mouse listeners to the source Diagram Object View.
DiagramObjectUI
  
clear():void
DiagramLinkUI
  
Clears selection by updating the selection index (no selection).
DiagramLinkUI
  
draw():void
Draws this DiagramLinkUI elements respecting the control points and line styling.
DiagramLinkUI
  
execute(k:int, event:MouseEvent = null):void
Executes a link modification/transformation (inserting and moving knobs (articulations) and anchors) operation given a mouse event and an index telling selected point, link modification type and required UI handlers.
DiagramLinkUI
  
fitToObject(dlink:DiagramObject = null):void
Updates this DiagramLinkUI position in order to fit its container or its correspondant DiagramLink.
DiagramLinkUI
  
hitTest(m:Point):int
Determines the Diagram hit type given a point (cursor hit position) meaning determining what the cursor hits.
DiagramLinkUI
 Inherited
Redraws this DiagramObjectUI and its children when library styles and assets change given a SVGAssetLibraryEvent.
DiagramObjectUI
 Inherited
unlink():void
Unlinks and removes the Diagram Object UI from its parent (usually used when deleting Diagram Objects).
DiagramObjectUI
 Inherited
update():void
DiagramObjectUI
Protected Methods
 MethodDefined by
 Inherited
Defining Diagram Object UI behaviour and children status while a given action is running (after detecting an ActionManagerEvent).
DiagramObjectUI
 Inherited
Defining Diagram Object UI behaviour and children status when a given action stops running (after detecting an ActionManagerEvent).
DiagramObjectUI
  
annotateHandler(event:MouseEvent):void
DiagramLinkUI
  
DiagramLinkUI
  
DiagramLinkUI
  
cssInitialize():Boolean
[static] Initialises SVG libraries (icons and graphics) and sets new style properties (CSS).
DiagramLinkUI
  
insertKnobs(event:MouseEvent):void
Inserts new knobs in this Diagram link UI for more user customization abilities and easier manipulation.
DiagramLinkUI
  
keyUpHandler(event:KeyboardEvent):void
DiagramLinkUI
  
knobHandler(event:MouseEvent):void
Handles any knob (except knob linked to source or target Diagram UIs) manipulation and updates user modifications in the correspondant DiagramLink (knob position update in the diagram drawing).
DiagramLinkUI
 Inherited
mouseDownHandler(event:MouseEvent):void
Detects a mouse down event and executes a defined action set in the execute method according to hitTest result.
DiagramObjectUI
  
mouseMoveHandler(event:MouseEvent):void
Applies link modification/transformation operations while moving the cursor according to selected UI handler (defined by the execute method).
DiagramLinkUI
  
mouseUpHandler(event:MouseEvent):void
Finalizes the link modification or transformation operation after a mouse up event and removes all listeners.
DiagramLinkUI
  
DiagramLinkUI
  
sourceAnchorHandler(event:MouseEvent):void
Handles source anchor manipulation and updates user modifications in the correspondant DiagramLink (master anchor point update).
DiagramLinkUI
  
[static] Changes the currently used CSS style when an SVGAssetLibraryEvent is triggered.
DiagramLinkUI
  
targetAnchorHandler(event:MouseEvent):void
Handles target anchor (linked to a target Diagram UI) manipulation and updates user modifications in the correspondant DiagramLink (target anchors updates).
DiagramLinkUI
Public Constants
 ConstantDefined by
  KNOBSIZE : Number = 8
[static] Square side of the Knob.
DiagramLinkUI
Property detail
_annotatebuttonproperty
protected var _annotatebutton:AnnotateButton = null
_cssinitializedproperty 
protected static var _cssinitialized:Boolean
_curpointidxproperty 
protected var _curpointidx:int = -1

Current point index.

_curuihandlerproperty 
protected var _curuihandler:Function = null

Used UI Handler (dependant to cursor selection).

_dlinkproperty 
protected var _dlink:DiagramLink = null

Diagram Link to which this DiagramLinkUI is linked.

_knobfillproperty 
protected static var _knobfill:Number

Knob fill style property (color number).

_knobfillopacityproperty 
protected static var _knobfillopacity:Number

Knob fill opacity style property (color number).

_knoblinecolorproperty 
protected static var _knoblinecolor:Number

Knob line color style property (color number).

_knoblineopacityproperty 
protected static var _knoblineopacity:Number

Knob line opacity style property (percentage number).

_knoblinewidthproperty 
protected static var _knoblinewidth:Number

Knob line width style property.

_selectedstyleselectorproperty 
protected static var _selectedstyleselector:String = "null"

Selected style selector String representation.

selectedstyleselectorproperty 
selectedstyleselector:String  [read-write]

The selected style selector.

Implementation
    protected static function get selectedstyleselector():String
    protected function set selectedstyleselector(value:String):void
_selidxproperty 
protected var _selidx:int = -1

Selected point index.

_selknobfillproperty 
protected static var _selknobfill:Number

Selected Knob fill style property (color number).

_selknobfillopacityproperty 
protected static var _selknobfillopacity:Number

Selected Knob fill opacity style property (color number).

_selknoblinecolorproperty 
protected static var _selknoblinecolor:Number

Selected Knob line color style property (color number).

_selknoblineopacityproperty 
protected static var _selknoblineopacity:Number

Selected Knob line opacity style property (percentage number).

_selknoblinewidthproperty 
protected static var _selknoblinewidth:Number

Selected Knob line width style property.

_styleselectorproperty 
protected static var _styleselector:String = "null"

"Not Selected Knob" style selector String representation.

styleselectorproperty 
styleselector:String  [read-write]

The style sector used in this DiagramLinkUI.

Implementation
    protected static function get styleselector():String
    protected function set styleselector(value:String):void
Constructor detail
DiagramLinkUI()constructor
public function DiagramLinkUI(dlink:DiagramLink)

Creates a DiagramLinkUI instance given a DiagramLink to which it is linked (defining CSS styling, cursor, used style selectors...).

Parameters
dlink:DiagramLink — DiagramLink to which this DiagramLinkUI is linked.
Method detail
annotateHandler()method
protected function annotateHandler(event:MouseEvent):voidParameters
event:MouseEvent
clear()method 
public override function clear():void
clearSelection()method 
public override function clearSelection():void

Clears selection by updating the selection index (no selection).

createAnnotateButton()method 
protected function createAnnotateButton():AnnotateButton

Returns
AnnotateButton
createChildren()method 
protected override function createChildren():void
cssInitialize()method 
protected static function cssInitialize():Boolean

Initialises SVG libraries (icons and graphics) and sets new style properties (CSS).

Returns
Boolean — CSS Properties loading status (success/failure).
draw()method 
public override function draw():void

Draws this DiagramLinkUI elements respecting the control points and line styling.

execute()method 
public override function execute(k:int, event:MouseEvent = null):void

Executes a link modification/transformation (inserting and moving knobs (articulations) and anchors) operation given a mouse event and an index telling selected point, link modification type and required UI handlers. Handlers are listed as follows (index in _uihandlers array):

Parameters
k:int — Index (Handler and Control point).
 
event:MouseEvent (default = null) — Detected Mouse Event.
fitToObject()method 
public override function fitToObject(dlink:DiagramObject = null):void

Updates this DiagramLinkUI position in order to fit its container or its correspondant DiagramLink. It takes into consideration the DiagramLink position.

Parameters
dlink:DiagramObject (default = null) — DiagramObject to fit with (not used in this class).
hitTest()method 
public override function hitTest(m:Point):int

Determines the Diagram hit type given a point (cursor hit position) meaning determining what the cursor hits. If the cursor hits a control point, the hitTest function returns an index extracted from the points array (even if horizontal position, odd else). This index if divided (integer division) returns the selected control point.

Parameters
m:Point — Hit point (cursor hit position).

Returns
int — Diagram Hit Type index (Index).
insertKnobs()method 
protected function insertKnobs(event:MouseEvent):void

Inserts new knobs in this Diagram link UI for more user customization abilities and easier manipulation. It updates also control points array.

Parameters
event:MouseEvent — Detected Mouse Event.
keyUpHandler()method 
protected override function keyUpHandler(event:KeyboardEvent):voidParameters
event:KeyboardEvent
knobHandler()method 
protected function knobHandler(event:MouseEvent):void

Handles any knob (except knob linked to source or target Diagram UIs) manipulation and updates user modifications in the correspondant DiagramLink (knob position update in the diagram drawing).

Parameters
event:MouseEvent — Detected Mouse Event.
mouseMoveHandler()method 
protected function mouseMoveHandler(event:MouseEvent):void

Applies link modification/transformation operations while moving the cursor according to selected UI handler (defined by the execute method).

Parameters
event:MouseEvent — Detected Mouse Event.
mouseUpHandler()method 
protected function mouseUpHandler(event:MouseEvent):void

Finalizes the link modification or transformation operation after a mouse up event and removes all listeners.

Parameters
event:MouseEvent — Detected Mouse Event.
showAnnotateButton()method 
protected function showAnnotateButton():void
sourceAnchorHandler()method 
protected function sourceAnchorHandler(event:MouseEvent):void

Handles source anchor manipulation and updates user modifications in the correspondant DiagramLink (master anchor point update).

Parameters
event:MouseEvent — Detected Mouse Event.
styleChanged()method 
protected static function styleChanged(event:SVGAssetLibraryEvent):void

Changes the currently used CSS style when an SVGAssetLibraryEvent is triggered.

Parameters
event:SVGAssetLibraryEvent — An SVGAssetLibraryEvent indicating that the new style poroperties were loaded.
targetAnchorHandler()method 
protected function targetAnchorHandler(event:MouseEvent):void

Handles target anchor (linked to a target Diagram UI) manipulation and updates user modifications in the correspondant DiagramLink (target anchors updates).

Parameters
event:MouseEvent — Detected Mouse Event.
Constant detail
KNOBSIZEconstant
public static const KNOBSIZE:Number = 8

Square side of the Knob.