com.triomotor.views

Information

extends: AbstractView
implements: OrderReceivedListener

This class is the view of the first tab in the TabView class. Shows the video, the car animation and the charts of oil, charge and inverter

Property Summary

private GraphBarchargeBar
private GraphBarinverterBar
private GraphBaroilBar
private ButtoncontrolBtn
private MovieClipcarAnimation
private MovieClipvideo
private Booleanplaying = false

Constructor Summary

Information()

Method Summary

public onOrderReceived(item:Object)
public click()
private init()

Property Details

chargeBar

private chargeBar:GraphBar

A GraphBar instance that has been initialized on the stage with instance name chargeBar

inverterBar

private inverterBar:GraphBar

A GraphBar instance that has been initialized on the stage with instance name inverterBar

oilBar

private oilBar:GraphBar

A GraphBar instance that has been initialized on the stage with instance name oilBar

controlBtn

private controlBtn:Button

A Button instance that has been initialized on the stage with instance name controlBtn

carAnimation

private carAnimation:MovieClip

A Movie Clip where the car animation will be loaded

video

private video:MovieClip

A Movie Clip where the external video will be loaded

playing

private playing:Boolean = false

A boolean indicating if the video is playing (true) or not (false)

Constructor Details

Information

Information()

Method Details

onOrderReceived

public onOrderReceived(item:Object):Void

Description: sets the value of the three GraphBar with the data received
This function is an implementation of the method onOrderReceived of the interface OrderReceivedListener
Assumptions: - chargeBar, inverterBar and oilBar are instantiated
- ALPHA, GAMA, HYDRO are members of the item received from the server
Globals: uses the following globals:
chargeBar, inverterBar and oilBar
Calls: none
Is Called by: This function is called by broadcastOrderReceived() in the application(TrioMotor class)

Parameters
item (Object) -
Returns
Void
See Also
OrderReceivedListener.onOrderReceived

click

public click():Void

Description: Stops or Plays the video depending of its state. Sets the variable playing to reflect the video state
Assumptions: ControlBtn and video are instantiated
Globals: uses the following globals: playing, controlBtn and video
Calls: stop() or play() of the video Object
Is Called by: This function is called when the user click the controlBtn

Returns
Void

init

private init():Void

Description: Registers this object as listener of OrderReceived event in the application
Registers this object as listener of click event in the controlBtn
Loads the car animation and the video in its respective MovieClips
Assumptions: application, controlBtn, video are instantiated Globals: uses application Calls: addOrderReceivedListener() in the application Is Called by: setApplication() in its super class AbstractView

Returns
Void