This class is the main class in the project. A reference to an instance
of this class will be set as application in all the AbstractViews.
This class creates the different Connectors for communication
between components and provides a global path for establishing a connection with
the components (CFC) in the server.
| public | Connector | totalLabor | |
| public | Connector | bayChange | |
| public | Connector | newPart | |
| public | Connector | orderSelected | |
| public | Connector | updateOrder | |
| private | AbstractView | workOrder | |
| private | AbstractView | detail | |
| private | AbstractView | customerInfo | |
| private | AbstractView | tabs | |
| private | String | alternativePath = "http://192.168.1.102/flashservices/gateway" | |
| private | Array | orderReceivedListeners | |
| private | Service | serviceWorkOrder | |
| public | Void | path |
TrioMotor() |
| public | orderSelectedEvent(id:String) | ||
| public | broadcastOrderReceived(r:ResultEvent) | ||
| public | addOrderReceivedListener(lis:OrderReceivedListener) | ||
| public | removeOrderReceivedListener(lis:OrderReceivedListener) | ||
| private | init() | ||
| private | onLoad() |
public totalLabor:Connector
DetailView sends totalLaborEvent BaySchedule receives totalLaborEvent in setSelectionSize
public bayChange:Connector
BaySchedule sends and receives bayChangeEvent DetailView receives bayChangeEvent
public newPart:Connector
Parts send newPartEvent DetailView receives newPartEvent
public orderSelected:Connector
WorkOrderView sends orderSelectedEvent TrioMotor receives newPartEvent
public updateOrder:Connector
DetailView sends updateOrderEvent WorkOrderDisplay receives updateOrderEvent
private workOrder:AbstractView
A workOrderDisplay instance that has been initialized on the stage (TrioMotor Clip) with the name workOrder as its instance name
private detail:AbstractView
A DetailView instance that has been initialized on the stage (TrioMotor Clip) with the name detail as its instance name
private customerInfo:AbstractView
A CustomeInformation instance that has been initialized on the stage (TrioMotor Clip) with the name customerInfo as its instance name
private tabs:AbstractView
A TabView instance that has been initialized on the stage (TrioMotor Clip) with the name tabs as its instance name
private alternativePath:String = "http://192.168.1.102/flashservices/gateway"
This is an alternativePath that can be used if you are testing the Movie inside the flash IDE. By default we use the flashvars parameter in the HTML but if we want to test it outside the browser we need an alternative path
private orderReceivedListeners:Array
This Array will hold all the listeners that register for the result of the remote call to the service (CFC) getWorkOrderDetail. All the elements in this Array must implements the interface OrderReceivedListener
- See Also
- OrderReceivedListener
private serviceWorkOrder:Service
A Service object that will connect to mx.services.workOrder to request the getWorkOrderDetail method
public path:Void
Description: Sets the path variable
Globals: sets alternativePath
Calls: none
Is Called by: none
TrioMotor()
Description: A simple constructor that calls the init method
Calls: init()
public orderSelectedEvent(id:String):Void
Description: Calls server to request the method getWorkOrderDetail and set a relayResponder to broadcastOrderReceived
Assumptions: the serviceWorkOrder are already instantiated
Globals: uses serviceWorkOrder
Calls: getWorkOrderDetail() in the server (CFC)
Is Called by: The Connector orderSelected
- Parameters
id (String)-- Returns
- Void
public broadcastOrderReceived(r:ResultEvent):Void
Description: Broadcasts the result from the server (getWorkOrderDetail()) to all the listeners inside the Array orderReceivedListeners and pass the first item of the query
Assumptions: - We expect a query as a parameter with only one row. If it contains more, they will be discarded.
- The orderReceivedListeners are already instantiated
Data structures:RecordSet
Globals: Uses orderReceivedListeners
Calls: onOrderReceived() in all the register listeners
Is Called by: This function is called by the server via RelayResponder in response to the getWorkOrderDetail() call
- Parameters
r (ResultEvent)-- Returns
- void
public addOrderReceivedListener(lis:OrderReceivedListener):Void
Description: Adds the listener to the Array orderReceivedListeners
Assumptions: - The lis object has implemented the OrderReceivedListener interface
- The orderReceivedListeners are already instantiated Data structures:Array
Globals: adds an item to orderReceivedListeners
Calls: none
Is Called by: Listeners such as: DetailView, CustomerInformation, Information
- Parameters
lis (OrderReceivedListener)-- Returns
- Void
public removeOrderReceivedListener(lis:OrderReceivedListener):Void
Description: removes the listener from the Array orderReceivedListeners
Assumptions: - The lis object has implemented the OrderReceivedListener interface
- The orderReceivedListeners are already instantiated
Data structures:Array
Globals: removes an item from orderReceivedListeners
Calls: none
Is Called by: none
- Parameters
lis (OrderReceivedListener)-- Returns
- void
private init():Void
Description: Creates a new array to hold the listeners and creates a server connection to the CFC mx.services.workOrder via new Service()
Sets the global styles for the entire application
Globals: instantiates orderReceivedListeners, uses path and _global.style
Data structures:Array
Calls: none
Is Called by: The TrioMotor constructor
- Returns
- Void
private onLoad():Void
Description: Instantiates the five Connectors. It's register as a listener of the orderSelected Connector.
Set the application on workOrder, customerInfo, detail, and tabs
Assumptions: The views have already been instantiated on the stage
Globals: Instantiates the following globals:
totalLabor, bayChange, newPart, orderSelected, updateOrder
Calls: setApplication() in the following Views: workOrder, customerInfo, detail, tabs
Is Called by: This function is called automatically by the player when this object is completely loaded. This is possible because this class extends from the MovieClip Class
- Returns
- Void