DrawForm

User interface for the drawing area and related controls.

Summary
DrawFormUser interface for the drawing area and related controls.
Functions and Properties
InitializeComponentInitializes the user interface components on the form.
resizeHandles a resize event by repositioning the UI widgets and recreating the drawing area at the same display list position.
updateStatusTextUpdates the status text fields with information about mouse position and dragging action.
updateBackgroundColorChange the drawing area background color.
updateControlViewUpdate the two eye icons showing the control view state of control points and indicator to reflect the selected stroke’s state.
updateFromStrokeUpdates the UI widgets, shown stroke and coordinate system view from the properties in the Stroke and index.
updateStrokeNameRefresh the shown stroke asset name.
updateFromModelSizeUpdate the maximum value that the selectLayerField spin button will increment to.
applyMaskApply a mask matching the drawing area size to a Stroke.
activeSets the state of the DrawForm to active or inactive.
activateActivates the DrawForm, adds its event listeners
disactivateDisactivates the DrawForm, removes its event listeners

Functions and Properties

InitializeComponent

public function InitializeComponent(app: Sprite,
page: Sprite,
tooltips: Tooltips,
defaultColor: uint,
tabColor: uint):void

Initializes the user interface components on the form.

resize

public function resize():void

Handles a resize event by repositioning the UI widgets and recreating the drawing area at the same display list position.

updateStatusText

public function updateStatusText(frameNumber: uint = ):void

Updates the status text fields with information about mouse position and dragging action.  Refreshes the selectedPointButton with the selected stroke index and maximum.

updateBackgroundColor

public function updateBackgroundColor(color: uint):void

Change the drawing area background color.

Parameters

coloran RGB color value

updateControlView

public function updateControlView():void

Update the two eye icons showing the control view state of control points and indicator to reflect the selected stroke’s state.

updateFromStroke

public function updateFromStroke(newStroke: Stroke,
selectedLayerIndex: int):void

Updates the UI widgets, shown stroke and coordinate system view from the properties in the Stroke and index.

Parameters

newStrokean updated stroke
selectedLayerIndexindex of stroke in the scene graph

updateStrokeName

public function updateStrokeName():void

Refresh the shown stroke asset name.

updateFromModelSize

public function updateFromModelSize(size: uint):void

Update the maximum value that the selectLayerField spin button will increment to.

Parameters

sizenumber of strokes in the scene graph

applyMask

public function applyMask(aStroke: Stroke):void

Apply a mask matching the drawing area size to a Stroke.  This is to ensure that parts of a stroke is not shown outside the drawing area even when resizing or in trace view.

Parameters

aStrokethe stroke to mask

active

public function set active(state: Boolean):void

Sets the state of the DrawForm to active or inactive.  Modelled after WidgetInterface.

Parameters

stateTrue to activate, false otherwise.

activate

private function activate():void

Activates the DrawForm, adds its event listeners

disactivate

private function disactivate():void

Disactivates the DrawForm, removes its event listeners

public function InitializeComponent(app: Sprite,
page: Sprite,
tooltips: Tooltips,
defaultColor: uint,
tabColor: uint):void
Initializes the user interface components on the form.
public function resize():void
Handles a resize event by repositioning the UI widgets and recreating the drawing area at the same display list position.
public function updateStatusText(frameNumber: uint = ):void
Updates the status text fields with information about mouse position and dragging action.
public function updateBackgroundColor(color: uint):void
Change the drawing area background color.
public function updateControlView():void
Update the two eye icons showing the control view state of control points and indicator to reflect the selected stroke’s state.
public function updateFromStroke(newStroke: Stroke,
selectedLayerIndex: int):void
Updates the UI widgets, shown stroke and coordinate system view from the properties in the Stroke and index.
Defines a stroke object consisting of curves, line segments and primitive graphics objects.
public function updateStrokeName():void
Refresh the shown stroke asset name.
public function updateFromModelSize(size: uint):void
Update the maximum value that the selectLayerField spin button will increment to.
public function applyMask(aStroke: Stroke):void
Apply a mask matching the drawing area size to a Stroke.
public function set active(state: Boolean):void
Sets the state of the DrawForm to active or inactive.
private function activate():void
Activates the DrawForm, adds its event listeners
private function disactivate():void
Disactivates the DrawForm, removes its event listeners
Widgets are required to implement this interface.
Close