Packages

com.appaapps

Classes in package: com.appaapps

ClassDescription
Svg Structured Vector Graphics. Svg elements occupy fractions of the canvas which is assumed to have the approximate aspect ratio specified when creating the Svg. The elements then try to fit themselves into their fractional areas as best they can.
Svg.AFewChars Draw a path - typically to show a few chars for an alphabetic or numbers game
Svg.AngleTracker Track angles
Svg.CenterToCenter Animation which expands an element its center is over the centre of the canvas
Svg.Element Common features
Svg.Image Draw a bitmap image - move it around to show it all within the space available
Svg.LengthTracker Track length
Svg.LowPassFilter Low pass filter
Svg.OpacityTracker Track opacity
Svg.RandomStep Random step function (x=time, y=position) with each step chosen at random between -1 and 1, each step duration chosen at random between 0 and timeScale
Svg.Rectangle Rectangle
Svg.Text Text
Svg.Tracker Generates random but smoothly varying numbers between -1 and +1 by filtering random shocks.

Methods in class: Svg, package: com.appaapps

Structured Vector Graphics. Svg elements occupy fractions of the canvas which is assumed to have the approximate aspect ratio specified when creating the Svg. The elements then try to fit themselves into their fractional areas as best they can.
ReturnsMethodSignatureAttributesDescription
Svg void public A default square Svg
Svg float, float public Create an Svg with the specified aspect ratio.
float getWidth void public The width of the Svg
float getHeight void public The height of the Svg
float aspectRatio void public Aspect ratio
void push Element public Add an element to the stack of elements to be displayed
void onShow void public Called when this Svg is shown or reshown after some other Svg has been shown
void draw Canvas public Draw the Svg to cover an entire canvas
void draw Canvas, float, float, float, float private Draw the Svg on a canvas at a specified location
boolean chooseDoubleMode void Choose either a single or a double gradient
float chooseStartAngle void Choose a start angle between 0 and 180 degrees
PorterDuffXfermode choosePorterDuffMode void Choose Porter=Duff blending method
Rectangle Rectangle float, float, float, float Create and push a rectangle
Text Text String, float, float, float, float, int, int public Create and push a new text element

Svg :

A default square Svg

Svg :

Create an Svg with the specified aspect ratio.

Parameters:
NameTypeAttributesDescription
widthfloatfinalThe width of the Svg
heightfloatfinalThe height of the Svg

getWidth : float

The width of the Svg

getHeight : float

The height of the Svg

aspectRatio : float

Aspect ratio

push : void

Add an element to the stack of elements to be displayed

Parameters:
NameTypeAttributesDescription
eElementthe element to add

onShow : void

Called when this Svg is shown or reshown after some other Svg has been shown

draw : void

Draw the Svg to cover an entire canvas

Parameters:
NameTypeAttributesDescription
canvasCanvasfinalCanvas to draw on

draw : void

Draw the Svg on a canvas at a specified location

Parameters:
NameTypeAttributesDescription
canvasCanvasfinalCanvas to draw svg on
xfloatfinalLeft edge
yfloatfinalUpper edge
wfloatfinalWidth
hfloatfinalHeight

chooseDoubleMode : boolean

Choose either a single or a double gradient

chooseStartAngle : float

Choose a start angle between 0 and 180 degrees

choosePorterDuffMode : PorterDuffXfermode

Choose Porter=Duff blending method

Rectangle : Rectangle

Create and push a rectangle

Parameters:
NameTypeAttributesDescription
xfloatfinalFractional position - left
yfloatfinalFractional position - upper
𝘅floatfinalFractional position - right
𝘆floatfinalFractional position - lower

Text : Text

Create and push a new text element

Parameters:
NameTypeAttributesDescription
textStringfinalThe text to display
xfloatfinalFractional area in which to display the text - left
yfloatfinalFractional area in which to display the text - upper
𝘅floatfinalFractional area in which to display the text - right
𝘆floatfinalFractional area in which to display the text - lower
justifyXintfinalJustification in x per: com.appaapps.LayoutText
justifyYintfinalJustification in y per: com.appaapps.LayoutText

Methods in class: Svg.AFewChars, package: com.appaapps

Draw a path - typically to show a few chars for an alphabetic or numbers game
ReturnsMethodSignatureAttributesDescription

Methods in class: Svg.AngleTracker, package: com.appaapps

Track angles
ReturnsMethodSignatureAttributesDescription
float angle void Current value in degrees

angle : float

Current value in degrees

Methods in class: Svg.CenterToCenter, package: com.appaapps

Animation which expands an element its center is over the centre of the canvas
ReturnsMethodSignatureAttributesDescription
CenterToCenter CenterToCenter double, double, double public constructor Create a center to center animation
CenterToCenter CenterToCenter CenterToCenter public constructor Clone a prior animation
Float active void public Get fraction of animation
void scaleCanvas Canvas, RectF public Apply scale to the canvas if scaling is active for this element
void scaleRectangle Canvas, RectF public Apply scale to the canvas if the element scale effect is active
void onActivate void public Called when this animation becomes active

CenterToCenter : CenterToCenter

Create a center to center animation

Parameters:
NameTypeAttributesDescription
delaydoubleDelay before animation starts
durationdoubleDuration of animation
startAgaindoubleRestart after animation after this time

CenterToCenter : CenterToCenter

Clone a prior animation

Parameters:
NameTypeAttributesDescription
cloneCenterToCenterAnimation to clone

active : Float

Get fraction of animation

scaleCanvas : void

Apply scale to the canvas if scaling is active for this element

Parameters:
NameTypeAttributesDescription
canvasCanvasCanvas to which s calling is to be applied
drawAreaRectFDrawing area

scaleRectangle : void

Apply scale to the canvas if the element scale effect is active

Parameters:
NameTypeAttributesDescription
canvasCanvasCanvas to be scaled
drawAreaRectFApply scale to the canvas if active

onActivate : void

Called when this animation becomes active

Methods in class: Svg.Element, package: com.appaapps

Common features
ReturnsMethodSignatureAttributesDescription
Element Element void constructor Add the new element to the stack of elements - which means that elements must be created in draw order and that element grouping within an Svg is unavailable, we could of course have an Svg.Sub that references a sub svg.
Paint getGradientPaint float, float, int, int, float, AngleTracker, LengthTracker, OpacityTracker private Return a paint for a gradient
Paint getHorizontalPaint float private Return a paint for the horizontal gradient
Paint getVerticalPaint float private Return a paint for the vertical gradient
void draw Canvas, Paint abstract The element draws itself on the supplied canvas using the supplied paint
void draw Canvas Draw the SVG on a canvas
boolean contains float, float public Does this element contain the point (x, y)?
void setCenterToCenter CenterToCenter public Set Center To Center animation for this element

Element : Element

Add the new element to the stack of elements - which means that elements must be created in draw order and that element grouping within an Svg is unavailable, we could of course have an Svg.Sub that references a sub svg.

getGradientPaint : Paint

Return a paint for a gradient

Parameters:
NameTypeAttributesDescription
sizeXfloatSize in X of gradient
sizeYfloatSize in Y of gradient
c1intFirst colour
c2intOpposing second colour
startAnglefloatStart angle
angleAngleTrackerAngle of gradient as time goes by
lengthLengthTrackerLength of gradient as time goes by
opacityOpacityTrackerOpacity of gradient as time goes by

getHorizontalPaint : Paint

Return a paint for the horizontal gradient

Parameters:
NameTypeAttributesDescription
sizefloatSize of gradient

getVerticalPaint : Paint

Return a paint for the vertical gradient

Parameters:
NameTypeAttributesDescription
sizefloatSize of gradient

draw : void

The element draws itself on the supplied canvas using the supplied paint

Parameters:
NameTypeAttributesDescription
canvasCanvasfinalCanvas on which the element would be drawn
paintPaintPaint to draw the element

draw : void

Draw the SVG on a canvas

Parameters:
NameTypeAttributesDescription
canvasCanvasfinalCanvas to draw on

contains : boolean

Does this element contain the point (x, y)?

Parameters:
NameTypeAttributesDescription
xfloatPoint.X
yfloatPoint.Y

setCenterToCenter : void

Set Center To Center animation for this element

Parameters:
NameTypeAttributesDescription
cCenterToCenterAnimation to use

Methods in class: Svg.Image, package: com.appaapps

Draw a bitmap image - move it around to show it all within the space available
ReturnsMethodSignatureAttributesDescription
Image Image Bitmap, float, float, float, float public constructor Fraction coordinates of corners of drawing area

Image : Image

Fraction coordinates of corners of drawing area

Parameters:
NameTypeAttributesDescription
bitmapBitmapBitmap containing image
xfloatFraction coordinates of left edge
yfloatFraction coordinates of upper edge
𝘅floatFraction coordinates of right edge
𝘆floatFraction coordinates of lower edge

Methods in class: Svg.LengthTracker, package: com.appaapps

Track length
ReturnsMethodSignatureAttributesDescription
float length void Current value in pixels

length : float

Current value in pixels

Methods in class: Svg.LowPassFilter, package: com.appaapps

Low pass filter
ReturnsMethodSignatureAttributesDescription
LowPassFilter LowPassFilter double constructor Create a low pass filter
double value double public Value of applied value after passing through low pass filter

LowPassFilter : LowPassFilter

Create a low pass filter

Parameters:
NameTypeAttributesDescription
timeScaledoubleTimescale of filter

value : double

Value of applied value after passing through low pass filter

Parameters:
NameTypeAttributesDescription
applieddoubleApplied signal

Methods in class: Svg.OpacityTracker, package: com.appaapps

Track opacity
ReturnsMethodSignatureAttributesDescription
int opacity void public Current value as opacity

opacity : int

Current value as opacity

Methods in class: Svg.RandomStep, package: com.appaapps

Random step function (x=time, y=position) with each step chosen at random between -1 and 1, each step duration chosen at random between 0 and timeScale
ReturnsMethodSignatureAttributesDescription
double value void public Value of random step

value : double

Value of random step

Methods in class: Svg.Rectangle, package: com.appaapps

Rectangle
ReturnsMethodSignatureAttributesDescription
Rectangle Rectangle float, float, float, float public constructor Create a rectangle
void draw void See Draw the rectangle

Rectangle : Rectangle

Create a rectangle

Parameters:
NameTypeAttributesDescription
xfloatfinalFractional position - left
yfloatfinalFractional position - upper
𝘅floatfinalFractional position - right
𝘆floatfinalFractional position - lower

draw : void

See Draw the rectangle

Methods in class: Svg.Text, package: com.appaapps

Text
ReturnsMethodSignatureAttributesDescription
Text Text String, float, float, float, float, int, int public constructor Create a text area
void draw void See Draw the text

Text : Text

Create a text area

Parameters:
NameTypeAttributesDescription
textStringfinalThe text to display
xfloatfinalFractional area in which to display the text - left
yfloatfinalFractional area in which to display the text - upper
𝘅floatfinalFractional area in which to display the text - right
𝘆floatfinalFractional area in which to display the text - lower
justifyXintfinalJustification in x per: com.appaapps.LayoutText
justifyYintfinalJustification in y per: com.appaapps.LayoutText

draw : void

See Draw the text

Methods in class: Svg.Tracker, package: com.appaapps

Generates random but smoothly varying numbers between -1 and +1 by filtering random shocks.
ReturnsMethodSignatureAttributesDescription
double value void Value of tracker

value : double

Value of tracker