Module: objectdraw GraceDocs

Types

Type name
Application
A standalone window which contains other components.
Audio
Button
Choice
ChoiceFactory
Color
Component
The super-type of all components in a GUI.
ComponentFactory<T>
where T <: Component
Container
The type of components that contain other components.
DrawableImageFactory
at(location : Point) size(width : Number, height : Number) file(fileName : String) on (canvas : DrawingCanvas) -> Graphic2D
DrawingCanvas
DrawingCanvas holding graphic objects
Event
ExceptionKind
FieldFactory
Foreign
Function<T, R>
Function2<T, U, R>
Graphic
Objects that can be drawn on a canvas and moved around.
Graphic2D
Two-dimensional objects that can also be resized
GraphicApplication
Type of object that run a graphical application that draws objects on a screen and responds to mouse actions
Input
KeyEvent
KeyResponse
Labeled
Line
One-dimensional objects
LineFactory
MatchResult
MouseEvent
MouseResponse
NumberField
Procedure<T>
Response
Text
Text that can be drawn on a canvas.
TextBox
TextField

Classes

Class name & constructor
application. title( initialTitle: String) size( initialWidth: Number, initialHeight: Number) -> Application
audio. url( source': String) -> Audio
button. labeled( label': String) -> Button
color. r( r': Number) g( g': Number) b( b': Number) -> Color
Simple color class
drawable. at( location': Point) on( canvas': DrawingCanvas) -> Graphic
abstract superclass for drawable objects
drawable2D. at( location': Point) size( width': Number, height': Number) on( canvas': DrawingCanvas) -> Graphic2D
abstract class for two-dimensional objects
drawingCanvas. size( width': Number, height': Number) -> DrawingCanvas
class representing objects that manage graphics on screen
event. source( source': Component) -> Event
eventLog. kind( kind': String) response( response': Procedure)
field. ofType( inputType: String) labeled( label': String) -> Input
filledArc. at( location': Point) size( width': Number, height': Number) from( startAngle: Number) to( endAngle: Number) on( canvas': DrawingCanvas) -> Graphic2D
class to generate filled arc at (x',y') with size width' x height' from startAngle degrees to endAngle degrees created on canvas' Note that angle 0 is in direction of positive x axis and increases in angles go clockwise.
filledOval. at( location': Point) size( width': Number, height': Number) on( canvas': DrawingCanvas) -> Graphic2D
class to generate filled oval at (x',y') with size width' x height' created on canvas'
filledRect. at( location': Point) size( width': Number, height': Number) on( canvas': DrawingCanvas) -> Graphic2D
class to generate filled rectangle at (x',y') with size width' x height' created on canvas'
framedArc. at( location': Point) size( width': Number, height': Number) from( startAngle: Number) to( endAngle: Number) on( canvas': DrawingCanvas) -> Graphic2D
class to generate framed arc at (x',y') with size width' x height' from startAngle radians to endAngle radians created on canvas' Note that angle 0 is in direction of positive x axis and increases in angles go clockwise.
framedOval. at( location': Point) size( width': Number, height': Number) on( canvas': DrawingCanvas) -> Graphic2D
class to generate framed oval at (x',y') with size width' x height' created on canvas'
framedRect. at( location': Point) size( width': Number, height': Number) on( canvas': DrawingCanvas) -> Graphic2D
class to generate framed rectangle at (x',y') with size width' x height' created on canvas'
graphicApplication. size( theWidth': Number, theHeight': Number) -> GraphicApplication
abstract class to be extended to create graphic application using mouse actions
keyEvent. source( source': Component) event( event': Foreign) -> KeyEvent
mouseEvent. source( source': Component) event( event': Foreign) -> MouseEvent
resizable2D. at( location': Point) size( width': Number, height': Number) on( canvas': DrawingCanvas) -> Graphic2D
abstract class to be extended for 2 dimensional objects that can be resized.
text. at( location': Point) with( contents': String) on( canvas': DrawingCanvas) -> Text
class to generate text at location' on canvas' initially showing contents'
textBox. with( contents': String) -> TextBox

Methods

Method signature Return type
ColorOutOfRange ExceptionKind
black Color
blue Color
container ComponentFactory< Container>
cyan Color
gray Color
green Color
magenta Color
neutral Color
numberField FieldFactory
passwordField FieldFactory
pi Number
A rough approximation of the value of pi.
randomColor Color
Produce a random color.
randomIntFrom( m: Number) to( n: Number) Number
A random integer from m to n, inclusive.
randomNumberFrom( m: Number) to( n: Number) Number
A random number from m to n, inclusive.
red Color
selectBox ChoiceFactory
textField FieldFactory
white Color
predefined colors in objectdraw
yellow Color