CanvasPlatform

An abstract Canvas interface implemented and to be implemented on various platforms. A concrete implementation will utilise canvas like an HTML canvas or a Scalafx canvas. This concrete implementation class must (can?) be mixed in with a a particular use trait like CanvSimple or CanvMulti. The default methods take the origin as the centre of the canvas. Note the Canvas Platform merely passes bare pointer event data to delegate functions. It does not process them in relation to objects painted on the Canvas.

It is really not a good idea to use this trait, use a sub class of this trait directly in your applications. You do not want to be thinking in terms of the imperative methods of this application. Use one of the provided classes like CanvasNoPanels or Canvas Panelled or create your own if the provided classes don't fulfill your needs.

class Object
trait Matchable
class Any

Value members

Abstract methods

def bezierDraw(bd: BezierDraw): Unit
def cArcDraw(cad: CArcDraw): Unit

Draws a circular arc on the canvas.

Draws a circular arc on the canvas.

def circleDraw(cd: CircleDraw): Unit

Side effecting procedure that draws a circle on the screen. Implemented by the target platform.

Side effecting procedure that draws a circle on the screen. Implemented by the target platform.

def circleFill(cf: CircleFill): Unit

Side effecting procedure that fills a circle. Implemented by the target platform.

Side effecting procedure that fills a circle. Implemented by the target platform.

def circleFillRadial(circle: Circle, fill: FillRadial): Unit
def clear(colour: Colour): Unit
def clip(pts: Polygon): Unit

To be removed from CanvasPlatform.

To be removed from CanvasPlatform.

def eArcDraw(ead: EArcDraw): Unit

Draws an elliptical arc on the canvas.

Draws an elliptical arc on the canvas.

def ellipseDraw(ed: EllipseDraw): Unit

Side effecting procedure that draws an ellipse on the screen. Implemented by the target platform.

Side effecting procedure that draws an ellipse on the screen. Implemented by the target platform.

def ellipseFill(ef: EllipseFill): Unit

Side effecting procedure that fills an ellipse on the screen. Implemented by the target platform.

Side effecting procedure that fills an ellipse on the screen. Implemented by the target platform.

def gcRestore(): Unit
def gcSave(): Unit
def getTime: Long

Returns the system (Unix) time in milliseconds.

Returns the system (Unix) time in milliseconds.

def lineSegDraw(ld: LineSegDraw): Unit
def lineSegsDraw(lsd: LinesDraw): Unit
def loadFile(fileName: String): EMon[String]
protected
def pLinePathDraw(pod: LinePathDraw): Unit
protected
def pPolyDraw(pd: PolygonDraw): Unit
protected
def pPolyFill(pf: PolygonFill): Unit
protected
protected
def saveFile(fileName: String, output: String): Unit
def textGraphic(tg: TextGraphic): Unit
def textOutline(to: TextOutline): Unit
def timeOut(f: () => Unit, millis: Integer): Unit

A call back timer. Takes the delay in milliseconds

A call back timer. Takes the delay in milliseconds

Concrete methods

def animSeq(anims: Seq[DispPhase]): Unit
def frame(f: (Integer, Integer) => Unit, startTime: Integer, frameLength: Integer): Unit

A callback timer with an elapsed time from a given start point. Although are in a general purpose form, the most common usage is for animations where things move dependent on how much time has passed. The function is of form: (elapsedTime(in milliseconds), Startime (in milliseconds) => Unit. The startTime is to be used to call the next frame at then end of the function, if another frame is needed.

A callback timer with an elapsed time from a given start point. Although are in a general purpose form, the most common usage is for animations where things move dependent on how much time has passed. The function is of form: (elapsedTime(in milliseconds), Startime (in milliseconds) => Unit. The startTime is to be used to call the next frame at then end of the function, if another frame is needed.

def fromFileFind[A](fileName: String)(implicit ev: Persist[A]): EMon[A]
def fromFileFindElse[A](fileName: String, elseValue: => A)(implicit ev: Persist[A]): A
def fromFileFindForeach[A](fileName: String, f: A => Unit)(implicit ev: Persist[A]): Unit

Attempts to find find and load file, attempts to parse the file, attempts to find object of type A. If all stages successful, calls procedure (Unit returning function) with that object of type A

Attempts to find find and load file, attempts to parse the file, attempts to find object of type A. If all stages successful, calls procedure (Unit returning function) with that object of type A

def fromFileFindSetting[A](settingStr: String, fileName: String)(implicit ev: Persist[A]): EMon[A]
def fromFileFindSettingElse[A](settingStr: String, fileName: String, elseValue: => A)(implicit ev: Persist[A]): A
def linePathDraw(pod: LinePathDraw): Unit
final
def polygonDraw(pd: PolygonDraw): Unit
final
def polygonFill(pf: PolygonFill): Unit
def rendElems(elems: Arr[GraphicElem]): Unit
final
final
def startFrame(f: (Integer, Integer) => Unit, frameLength: Integer): Unit

The initial frame although are in a general purpose form, the most common usage is for animations where things move dependent on how much time has passed.

The initial frame although are in a general purpose form, the most common usage is for animations where things move dependent on how much time has passed.

def startFramePermanent(f: Integer => Unit, millis: Integer): Unit
def toBL(input: Pt2): Pt2

Inherited methods

Inherited from
OrdinalEdgePoints
def bottom: Double
Inherited from
RectCenlign
@inline
final
Inherited from
Rectangularlign
@inline
final
Inherited from
Rectangularlign
Inherited from
OrdinalEdgePoints
override
def cen: Pt2
Definition Classes
Inherited from
RectCenlign
Inherited from
RectCenlign
def cenX: Double
Inherited from
RectCenlign
def cenY: Double
Inherited from
RectCenlign
def crossHairs(lineWidth: Double, lineColour: Colour): LinesDraw
Inherited from
RectCenlign
def gridLines(spacing: Double, colour: Colour, lineWidth: Double): LinesDraw

Not sure why spacing has got a minus sign

Not sure why spacing has got a minus sign

Inherited from
RectCenlign
def gridLines2Colours(spacing: Double, cenColour: Colour, otherColour: Colour, lineWidth: Double): Arr[LinesDraw]

Badly named I think, not sure why spacing has got a minus sign

Badly named I think, not sure why spacing has got a minus sign

Inherited from
RectCenlign
def height: Double
Inherited from
Rectangularlign
def left: Double
Inherited from
RectCenlign
Inherited from
RectCenlign
def right: Double
Inherited from
RectCenlign
Inherited from
OrdinalEdgePoints
def top: Double
Inherited from
RectCenlign
@inline
final
Inherited from
Rectangularlign
@inline
final
Inherited from
Rectangularlign

Top right offset from centre.

Top right offset from centre.

Inherited from
OrdinalEdgePoints
def width: Double
Inherited from
Rectangularlign
@inline
final
def xBottomLeft: Double
Inherited from
Rectangularlign
@inline
final
def xBottomRight: Double
Inherited from
Rectangularlign
@inline
final
def xTopLeft: Double
Inherited from
Rectangularlign
@inline
final
def xTopRight: Double
Inherited from
Rectangularlign
@inline
final
def yBottomLeft: Double
Inherited from
Rectangularlign
@inline
final
def yBottomRight: Double
Inherited from
Rectangularlign
@inline
final
def yTopLeft: Double
Inherited from
Rectangularlign
@inline
final
def yTopRight: Double
Inherited from
Rectangularlign

Concrete fields

var keyDown: String => Unit
var keyUp: String => Unit
var mouseDown: (Pt2, MouseButton) => Unit

The canvas implementation will call this function when the mouse button is depressed. Named after Javascript command

The canvas implementation will call this function when the mouse button is depressed. Named after Javascript command

var mouseDragged: (Pt2, MouseButton) => Unit
var mouseMoved: (Pt2, MouseButton) => Unit
var mouseUp: (Pt2, MouseButton) => Unit

The canvas implementation will call this function when a mouse button is released. Named after Javascript command

The canvas implementation will call this function when a mouse button is released. Named after Javascript command

var onScroll: Boolean => Unit
var resize: () => Unit