com.triomotor

Graphics

This class is in charge of painting graphics in various components. It is a wrapper of the Draw API that creates some basic figures

See Also
BaySchedule, GraphBar

Property Summary

private MovieCliphandleClip
private MovieClipclip
public NumberbackgroundRGB
public NumberborderRGB
public NumberhightLightRGB
private Numberrgb
private Numberthickness = 1
private NumberhightLightThickness = 1
private Numberalpha = 100
private NumberlineThickness = undefined
private NumberlineRgb

Constructor Summary

Graphics(hClip:MovieClip, l:Number)

Method Summary

public draw3DRect(x:Number, y:Number, w:Number, h:Number)
public drawRect(x:Number, y:Number, w:Number, h:Number)
public fillRect(x:Number, y:Number, w:Number, h:Number)
public setColor(c:Number)
public clearAll()
public setLocation(xPos:Number, yPos:Number)
public getClip()

Property Details

handleClip

private handleClip:MovieClip

A parent Movie clip that holds this clip

clip

private clip:MovieClip

A Movie clip where this will be painted

backgroundRGB

public backgroundRGB:Number

background color of this graphic

borderRGB

public borderRGB:Number

border color of this graphic

hightLightRGB

public hightLightRGB:Number

highlight color of this graphic

rgb

private rgb:Number

color of this graphic

thickness

private thickness:Number = 1

thickness of this graphic, defaults to 1

hightLightThickness

private hightLightThickness:Number = 1

highlight thickness of this graphic, default to 1

alpha

private alpha:Number = 100

alpha value of this graphic, defaults to 100 (opaque)

lineThickness

private lineThickness:Number = undefined

line thickness of this graphic

lineRgb

private lineRgb:Number

line color of this graphic

Constructor Details

Graphics

Graphics(hClip:MovieClip,
         l:Number)

Description: Contructor that instantiates handleClip and clip
Globals: instantiates the following globals: handleClip and clip
Calls: createEmptyMovieClip() in the handleClip
Is Called by: GraphBar, BayScheduling

Parameters
hClip (MovieClip) -
l (Number) - The level where the clip will be created

Method Details

draw3DRect

public draw3DRect(x:Number,
                  y:Number,
                  w:Number,
                  h:Number):Void

Description: Draws a 3D Rectangle with the data received
Assumptions: clip has already been instantiated
Globals: uses the following globals:
rgb, backgroundRGB, borderRGB, hightLightRGB, thickness, hightLightThickness
Calls: fillRect() drawRect()
Is Called by: drawRecommended() and drawSelected() in the BaySchedule class

Parameters
x (Number) - position
y (Number) - position
w (Number) - width
h (Number) - height
Returns
Void

drawRect

public drawRect(x:Number,
                y:Number,
                w:Number,
                h:Number):Void

Description: Draws a 2D Rectangle without fill with the data received
Assumptions: clip has already been instantiated
Globals: uses thickness
Calls: fillRect()
Is Called by: draw3DRect()

Parameters
x (Number) - position
y (Number) - position
w (Number) - width
h (Number) - height
Returns
Void

fillRect

public fillRect(x:Number,
                y:Number,
                w:Number,
                h:Number):Void

Description: Draws a 2D Rectangle filled with the data received
Assumptions: clip has already been instantiated
Globals: use the following globals:
rgb, alpha, lineRgb, lineThickness
Calls: beginFill(), lineStyle(), moveTo(), lineTo(), endFill() on the clip Object
Is Called by: draw3DRect(), drawRect()

Parameters
x (Number) - position
y (Number) - position
w (Number) - width
h (Number) - height
Returns
Void

setColor

public setColor(c:Number):Void

Description: sets the RGB Color
Globals: uses global rgb
Calls: none
Is Called by: draw3DRect(), drawRect() in this object
onLoad() in GraphBar
setBarsStyle(), drawRecommended(), drawSelected() in BaySchedule

Parameters
c (Number) - color
Returns
Void

clearAll

public clearAll():Void

Description: clears all the graphics in this Object
Assumptions: clip has already been instantiated
Globals: uses the global clip
Calls: clear() in the clip property
Is Called by: set value() in GraphBar
bayChangeEvent(), drawRecommendedSpaces(), setData(), and setSelectedDate() in BaySchedule

Returns
Void

setLocation

public setLocation(xPos:Number,
                   yPos:Number):Void

Description: sets the X and Y positions Assumptions: clip has already been instantiated Globals: uses the global clip Calls: none Is Called by: onLoad() in GraphBar
setBarsStyle() in BaySchedule

Parameters
xPos (Number) - x Position
yPos (Number) - y Position
Returns
Void

getClip

public getClip():MovieClip

Description: returns a reference of this clip
Assumptions: clip has already been instantiated
Globals: uses the global clip
Calls: none
Is Called by: onLoad() in BaySchedule

Returns
MovieClip