# Packages

com.appaapps

## Package: com.appaapps

Class | Description
--- | ---
AppState | Thread which constructs the current state of an app
AppState.Fact | Fact details
AppState.FactComparator | Sort facts by swing. If it is an ordered app, sort equal entries by fact.index so that we work through the facts in the order they are listed in the App Definition file written in the App Definition Language
AppState.FactComparator.PhotoFact | PhotoFact
AppState.FactComparator.Possibility | Question possibilities
AppState.FactComparator.PossibilityComparator | Sort possibilities by swing. If it is an ordered app, sort equal entries by photo.index so that we work through the photos in the order they are listed in the App Definition file written in the App Definition Language
AppState.FactComparator.Question | Question a user with either a photo and its title or a photofact (but not both)
AppState.FactComparator.Question.Response | Rate the user response
AppState.FactComparator.SvgPhoto | The Svg Image element currently being used to display a photo
AppState.Filter | Filter for a specified type of object
AppState.Photo | Photo details
AppState.ShowAndTell | Speech and title for a fact or a photo
AppState.Speaker | Speaker details
AppState.Tracker | Track the score of the user of the app: Right/wrong/heard/swing in a saveable manner
Choices | Choices
ColoursTransformed | Transformations of a colour
Fourier | Fourier stream
Fourier.Impulse | A sine wave
Gradients | Gradients in various patterns
Gradients.Pattern | Each gradient pattern should be derived from this class
Gradients.Tartan | Create a tartan paint gradient
LayoutText | Draw text to fill a fractional area of a canvas, justifying remaining space
Log | Logging
Maths | Various mathematical methods
Midi | Midi sound player
RandomChoice | Random choices
Sound | Sounds
Speech | Speech played from mp3 files
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 | A Few chars is just like text except that the gradient is across each character not the entire drawing area
Svg.Element | Common features of a drawn element
Svg.Element.CenterToCenter | Animation which expands an element its center is over the centre of the canvas
Svg.Element2 | Common features of an element drawn with two paints - this is in effect a replacement for ComposeShader which does not seem to work - it always produces a white screen
Svg.Image | Draw a bitmap image - move it around to show it all within the space available
Svg.Rectangle | Draw a rectangle
Svg.Text | Draw text
Unzip | A thread to unzip a file

### Class: AppState, package: com.appaapps

Thread which constructs the current state of an app

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
AppState | AppState | void | public constructor | 67 | Create the app state from the details unpacked from the zip file - the real work is done by run() when we start this thread
void | run | void | public | 75 | Construct the current state of the app by unpacking its description
void | finished | void | public | 115 | Override called at end of construction thread
void | save | void | public | 118 | Save app state to a known file
void | restore | void | public | 138 | Restore app state from a known file

#### AppState() returns AppState in class AppState

Create the app state from the details unpacked from the zip file - the real work is done by run() when we start this thread

#### run() returns void in class AppState

Construct the current state of the app by unpacking its description

#### finished() returns void in class AppState

Override called at end of construction thread

#### save() returns void in class AppState

Save app state to a known file

#### restore() returns void in class AppState

Restore app state from a known file

### Class: AppState.Fact, package: com.appaapps

Fact details

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Fact | Fact | Unpackappdescription.FactCmd | constructor | 326 | Describe a fact

#### Fact(Unpackappdescription.FactCmd) returns Fact in class AppState.Fact

Describe a fact

Name | Type | Line | Description
--- | --- | --- | ---
f | Unpackappdescription.FactCmd | 327 | Unpacked fact description from zip file

### Class: AppState.FactComparator, package: com.appaapps

Sort facts by swing. If it is an ordered app, sort equal entries by fact.index so that we work through the facts in the order they are listed in the App Definition file written in the App Definition Language

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
int | compare | Fact, Fact | public | 337 | Compare the ordering of two facts
void | changeLevel | void | public | 365 | Change level when we max out the swing level of each item
int | adjustNumberOfImagesToShow | boolean | public | 380 | Adjust number of images to show within limits up or down
int | incNumberOfImagesToShow | void | public | 391 | Increase number of images to show
int | decNumberOfImagesToShow | void | public | 394 | Decrease number of images to show

#### compare(Fact, Fact) returns int in class AppState.FactComparator

Compare the ordering of two facts

Name | Type | Line | Description
--- | --- | --- | ---
f1 | Fact | 338 | First fact
f2 | Fact | 339 | Second fact

#### changeLevel() returns void in class AppState.FactComparator

Change level when we max out the swing level of each item

#### adjustNumberOfImagesToShow(boolean) returns int in class AppState.FactComparator

Adjust number of images to show within limits up or down

Name | Type | Line | Description
--- | --- | --- | ---
up | boolean | 381 | True: up, false: down

#### incNumberOfImagesToShow() returns int in class AppState.FactComparator

Increase number of images to show

#### decNumberOfImagesToShow() returns int in class AppState.FactComparator

Decrease number of images to show

### Class: AppState.FactComparator.PhotoFact, package: com.appaapps

PhotoFact

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
PhotoFact | PhotoFact | Unpackappdescription.PhotoFact | constructor | 355 | Describe a photo fact
String | toString | void | public | 360 | Short description of photo fact

#### PhotoFact(Unpackappdescription.PhotoFact) returns PhotoFact in class AppState.FactComparator.PhotoFact

Describe a photo fact

Name | Type | Line | Description
--- | --- | --- | ---
pf | Unpackappdescription.PhotoFact | 356 | Photo fact details from unpacked zip file

#### toString() returns String in class AppState.FactComparator.PhotoFact

Short description of photo fact

### Class: AppState.FactComparator.Possibility, package: com.appaapps

Question possibilities

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Possibility | Possibility | Photo | public constructor | 412 | A question possibility is either a photo and its title
Possibility | Possibility | PhotoFact | public constructor | 418 | Or, a question possibility is a photo fact
String | toString | void | public | 424 | Describe a possibility

#### Possibility(Photo) returns Possibility in class AppState.FactComparator.Possibility

A question possibility is either a photo and its title

Name | Type | Line | Description
--- | --- | --- | ---
photo | Photo | 413 | A photo we could show the user at this point

#### Possibility(PhotoFact) returns Possibility in class AppState.FactComparator.Possibility

Or, a question possibility is a photo fact

Name | Type | Line | Description
--- | --- | --- | ---
photoFact | PhotoFact | 419 | The fact and associated photo we could show the user

#### toString() returns String in class AppState.FactComparator.Possibility

Describe a possibility

### Class: AppState.FactComparator.PossibilityComparator, package: com.appaapps

Sort possibilities by swing. If it is an ordered app, sort equal entries by photo.index so that we work through the photos in the order they are listed in the App Definition file written in the App Definition Language

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
int | compare | void | public | 436 | Compare two possibilities and order by the one most important to show to the user. Overrides: java.util.Comparator

#### compare() returns int in class AppState.FactComparator.PossibilityComparator

Compare two possibilities and order by the one most important to show to the user. Overrides: java.util.Comparator

### Class: AppState.FactComparator.Question, package: com.appaapps

Question a user with either a photo and its title or a photofact (but not both)

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Question | Question | void | public constructor | 495 | new Question - Choose the next question, new Question(), "see how well that fits together"? - Jim Rockford!
Fact | bestFact | void |  | 596 | Choose the best next fact
Possibility | bestPossibility | void |  | 557 | Choose the best possibility for next question when not in race mode
void | enterRaceModeIfReady | void |  | 607 | Enter race mode
PhotoFact | findPhotoFact | Photo, Fact |  | 726 | Photo fact associated with this photo and fact
Photo | findSelectedPhoto | float, float | public | 715 | Find the details of the photo the user selected at point(x, y)
void | leaveRaceMode | void |  | 640 | Leave race mode
void | playMidi | void | public | 708 | Play a randomly chosen midi
void | playQuestionSound | void | public | 704 | Play question for sound
boolean | raceCompleted | void |  | 647 | Check whether race has been completed
Response | response | Photo | public | 735 | The user responded by choosing this photo - which normally produces a Response, but in race mode it does not unless the response was wrong
boolean | rightAnswer | Photo | public | 749 | Whether the user chose the right answer
Svg | svg | int, int | public | 651 | Construct an Svg to show the question

#### Question() returns Question in class AppState.FactComparator.Question

new Question - Choose the next question, new Question(), "see how well that fits together"? - Jim Rockford!

#### bestFact() returns Fact in class AppState.FactComparator.Question

Choose the best next fact

#### bestPossibility() returns Possibility in class AppState.FactComparator.Question

Choose the best possibility for next question when not in race mode

#### enterRaceModeIfReady() returns void in class AppState.FactComparator.Question

Enter race mode

#### findPhotoFact(Photo, Fact) returns PhotoFact in class AppState.FactComparator.Question

Photo fact associated with this photo and fact

Name | Type | Line | Description
--- | --- | --- | ---
p | Photo | 727 | Photo
f | Fact | 728 | Fact

#### findSelectedPhoto(float, float) returns Photo in class AppState.FactComparator.Question

Find the details of the photo the user selected at point(x, y)

Name | Type | Line | Description
--- | --- | --- | ---
x | float | 716 | X coordinate of touch point
y | float | 717 | Y coordinate of touch point

#### leaveRaceMode() returns void in class AppState.FactComparator.Question

Leave race mode

#### playMidi() returns void in class AppState.FactComparator.Question

Play a randomly chosen midi

#### playQuestionSound() returns void in class AppState.FactComparator.Question

Play question for sound

#### raceCompleted() returns boolean in class AppState.FactComparator.Question

Check whether race has been completed

#### response(Photo) returns Response in class AppState.FactComparator.Question

The user responded by choosing this photo - which normally produces a Response, but in race mode it does not unless the response was wrong

Name | Type | Line | Description
--- | --- | --- | ---
chosenPhoto | Photo | 736 | Chosen photo

#### rightAnswer(Photo) returns boolean in class AppState.FactComparator.Question

Whether the user chose the right answer

Name | Type | Line | Description
--- | --- | --- | ---
chosenPhoto | Photo | 750 | Photo the user chose

#### svg(int, int) returns Svg in class AppState.FactComparator.Question

Construct an Svg to show the question

Name | Type | Line | Description
--- | --- | --- | ---
width | int | 652 | Approximate width - used only to compute the aspect ratio of the drawing area
height | int | 653 | Approximate width - used only to compute the aspect ratio of the drawing area

### Class: AppState.FactComparator.Question.Response, package: com.appaapps

Rate the user response

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Response | Response | Photo | public constructor | 760 | Create the response to the user's choice
Svg | svg | int, int | public | 812 | Construct an Svg to show the response

#### Response(Photo) returns Response in class AppState.FactComparator.Question.Response

Create the response to the user's choice

Name | Type | Line | Description
--- | --- | --- | ---
chosenPhoto | Photo | 761 | The user responded by choosing this photo

#### svg(int, int) returns Svg in class AppState.FactComparator.Question.Response

Construct an Svg to show the response

Name | Type | Line | Description
--- | --- | --- | ---
width | int | 813 | Approximate width of drawing area - used only to compute aspect ratio
height | int | 814 | Approximate width of drawing area - used only to compute aspect ratio

### Class: AppState.FactComparator.SvgPhoto, package: com.appaapps

The Svg Image element currently being used to display a photo

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
SvgPhoto | SvgPhoto | Photo | constructor | 401 | Connect a Photo to the Svg Image Element being used to display it

#### SvgPhoto(Photo) returns SvgPhoto in class AppState.FactComparator.SvgPhoto

Connect a Photo to the Svg Image Element being used to display it

Name | Type | Line | Description
--- | --- | --- | ---
photo | Photo | 402 | Photo

### Class: AppState.Filter, package: com.appaapps

Filter for a specified type of object

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Filter | Filter | int | public constructor | 213 | Filter of specified width
void | add | E | public final | 217 | Add an element to the filter
boolean | contains | E | public final | 227 | Check whether an element is in the filter

#### Filter(int) returns Filter in class AppState.Filter

Filter of specified width

Name | Type | Line | Description
--- | --- | --- | ---
width | int | 214 | The width of the filter

#### add(E) returns void in class AppState.Filter

Add an element to the filter

Name | Type | Line | Description
--- | --- | --- | ---
element | E | 218 | Element to add to the filter

#### contains(E) returns boolean in class AppState.Filter

Check whether an element is in the filter

Name | Type | Line | Description
--- | --- | --- | ---
element | E | 228 | Element to check for

### Class: AppState.Photo, package: com.appaapps

Photo details

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Photo | Photo | Unpackappdescription.PhotoCmd | constructor | 283 | Describe a photo
float | aspectRatio | void | public | 313 | Aspect ratio for a photo
String | toString | void | public | 317 | Some details of the photo

#### Photo(Unpackappdescription.PhotoCmd) returns Photo in class AppState.Photo

Describe a photo

Name | Type | Line | Description
--- | --- | --- | ---
photoCmd | Unpackappdescription.PhotoCmd | 284 | Photo details from unpacked zip file

#### aspectRatio() returns float in class AppState.Photo

Aspect ratio for a photo

#### toString() returns String in class AppState.Photo

Some details of the photo

### Class: AppState.ShowAndTell, package: com.appaapps

Speech and title for a fact or a photo

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
ShowAndTell | ShowAndTell | TreeMap, String | public constructor | 245 | Create a new Show and Tell
byte[] | createMediaDataSource | Speaker | public | 266 | Create a ready to play media player to tell the fact or the title of the photo as spoken by a specified speaker

#### ShowAndTell(TreeMap, String) returns ShowAndTell in class AppState.ShowAndTell

Create a new Show and Tell

Name | Type | Line | Description
--- | --- | --- | ---
soundBytes | TreeMap | 246 | Speech by speaker name
title | String | 247 | Title

#### createMediaDataSource(Speaker) returns byte[] in class AppState.ShowAndTell

Create a ready to play media player to tell the fact or the title of the photo as spoken by a specified speaker

Name | Type | Line | Description
--- | --- | --- | ---
speaker | Speaker | 267 | Speaker

### Class: AppState.Speaker, package: com.appaapps

Speaker details

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Speaker | Speaker | String | constructor | 236 | Create a speaker

#### Speaker(String) returns Speaker in class AppState.Speaker

Create a speaker

Name | Type | Line | Description
--- | --- | --- | ---
name | String | 237 | Amazon Polly Name of the speaker

### Class: AppState.Tracker, package: com.appaapps

Track the score of the user of the app: Right/wrong/heard/swing in a saveable manner

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
void | decSwing | void | public | 174 | Decrement swing
void | incPresented | void | public | 183 | Increment number of times seen or heard
void | incRight | void | public | 177 | Increment right answers
void | incSwing | void | public | 171 | Increment swing
void | incWrong | void | public | 180 | Increment wrong answers

#### decSwing() returns void in class AppState.Tracker

Decrement swing

#### incPresented() returns void in class AppState.Tracker

Increment number of times seen or heard

#### incRight() returns void in class AppState.Tracker

Increment right answers

#### incSwing() returns void in class AppState.Tracker

Increment swing

#### incWrong() returns void in class AppState.Tracker

Increment wrong answers

### Class: Choices, package: com.appaapps

Choices

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Choices | Choices | int, int, float, float | public constructor | 41 | Find best layout for just two tiles - the wrong resposne display
Choices | Choices | int, int, int, float[] | public constructor | 21 | Find best layout for two or more tiles
void | bestLayout | void | public | 86 | Test all possible layouts and return the layout with the lowest average extension vector
double | testLayout | int, int |  | 61 | Test a proposed layout by calculating its extension vector

#### Choices(int, int, float, float) returns Choices in class Choices

Find best layout for just two tiles - the wrong resposne display

Name | Type | Line | Description
--- | --- | --- | ---
width | int | 42 | Width of viewing area
height | int | 43 | Height of viewing area
aspectRatio1 | float | 44 | Aspect ratio of first image
aspectRatio2 | float | 45 | Aspect ratio of second image

#### Choices(int, int, int, float[]) returns Choices in class Choices

Find best layout for two or more tiles

Name | Type | Line | Description
--- | --- | --- | ---
width | int | 22 | Width of viewing area
height | int | 23 | Height of viewing area
requested | int | 24 | Number of tiles requested
aspectRatios | float[] | 25 | Aspect ratio of each question choice with the best answer first

#### bestLayout() returns void in class Choices

Test all possible layouts and return the layout with the lowest average extension vector

#### testLayout(int, int) returns double in class Choices

Test a proposed layout by calculating its extension vector

Name | Type | Line | Description
--- | --- | --- | ---
x | int | 62 | Number of tiles in x
y | int | 63 | Number of tiles in y

### Class: ColoursTransformed, package: com.appaapps

Transformations of a colour

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
int | colour | int, int, int, int | public static | 21 | Create a new colour as an int
int | colour | int, int, int | public static | 12 | Create a new colour as an int with full opacity
int | metal | void | public | 129 | Generate a random metallic colour
int[] | metalOrVivid | int | public | 133 | Generate an array of all metal or all vivid colours at random with fractional opacity
int | mix | int | public | 143 | Mix a colour at random
int | opposite | int | public static | 76 | Create the opposite colour by reflecting in 0x00888888
int | random | void | public | 121 | Generate a random colour
int | setBlue | int, int | public static | 51 | Set blue while leaving the other components alone
int | setGreen | int, int | public static | 46 | Set green while leaving the other components alone
int | setOpacity | int, float | public static | 36 | Set opacity fractionally while leaving the other components alone
int | setOpacity | int, int | public static | 31 | Set opacity while leaving the other components alone
int | setRed | int, int | public static | 41 | Set red while leaving the other components alone
int | t1 | int | public static | 56 | Transform 1 of 5 transformations of a colour excluding the identity transform
int | t2 | int | public static | 60 | Transform 2 of 5 transformations of a colour excluding the identity transform
int | t3 | int | public static | 64 | Transform 3 of 5 transformations of a colour excluding the identity transform
int | t4 | int | public static | 68 | Transform 4 of 5 transformations of a colour excluding the identity transform
int | t5 | int | public static | 72 | Transform 5 of 5 transformations of a colour excluding the identity transform
int | vivid | void | public | 125 | Generate a random vivid colour

#### colour(int, int, int, int) returns int in class ColoursTransformed

Create a new colour as an int

Name | Type | Line | Description
--- | --- | --- | ---
o | int | 22 | Opacity
r | int | 23 | Red
g | int | 24 | Green
b | int | 25 | Blue

#### colour(int, int, int) returns int in class ColoursTransformed

Create a new colour as an int with full opacity

Name | Type | Line | Description
--- | --- | --- | ---
r | int | 13 | Red
g | int | 14 | Green
b | int | 15 | Blue

#### metal() returns int in class ColoursTransformed

Generate a random metallic colour

#### metalOrVivid(int) returns int[] in class ColoursTransformed

Generate an array of all metal or all vivid colours at random with fractional opacity

Name | Type | Line | Description
--- | --- | --- | ---
n | int | 134 | Number of colours required

#### mix(int) returns int in class ColoursTransformed

Mix a colour at random

Name | Type | Line | Description
--- | --- | --- | ---
c | int | 144 | Colour to transform

#### opposite(int) returns int in class ColoursTransformed

Create the opposite colour by reflecting in 0x00888888

Name | Type | Line | Description
--- | --- | --- | ---
c | int | 77 | Colour to transform

#### random() returns int in class ColoursTransformed

Generate a random colour

#### setBlue(int, int) returns int in class ColoursTransformed

Set blue while leaving the other components alone

Name | Type | Line | Description
--- | --- | --- | ---
c | int | 52 | Colour being constructed
b | int | 53 | Blue

#### setGreen(int, int) returns int in class ColoursTransformed

Set green while leaving the other components alone

Name | Type | Line | Description
--- | --- | --- | ---
c | int | 47 | Colour being constructed
g | int | 48 | Green

#### setOpacity(int, float) returns int in class ColoursTransformed

Set opacity fractionally while leaving the other components alone

Name | Type | Line | Description
--- | --- | --- | ---
c | int | 37 | Colour being constructed
o | float | 38 | Opacity between 0 and 1

#### setOpacity(int, int) returns int in class ColoursTransformed

Set opacity while leaving the other components alone

Name | Type | Line | Description
--- | --- | --- | ---
c | int | 32 | Colour being constructed
o | int | 33 | Opacity

#### setRed(int, int) returns int in class ColoursTransformed

Set red while leaving the other components alone

Name | Type | Line | Description
--- | --- | --- | ---
c | int | 42 | Colour being constructed
r | int | 43 | Red

#### t1(int) returns int in class ColoursTransformed

Transform 1 of 5 transformations of a colour excluding the identity transform

Name | Type | Line | Description
--- | --- | --- | ---
c | int | 57 | Colour to transform

#### t2(int) returns int in class ColoursTransformed

Transform 2 of 5 transformations of a colour excluding the identity transform

Name | Type | Line | Description
--- | --- | --- | ---
c | int | 61 | Colour to transform

#### t3(int) returns int in class ColoursTransformed

Transform 3 of 5 transformations of a colour excluding the identity transform

Name | Type | Line | Description
--- | --- | --- | ---
c | int | 65 | Colour to transform

#### t4(int) returns int in class ColoursTransformed

Transform 4 of 5 transformations of a colour excluding the identity transform

Name | Type | Line | Description
--- | --- | --- | ---
c | int | 69 | Colour to transform

#### t5(int) returns int in class ColoursTransformed

Transform 5 of 5 transformations of a colour excluding the identity transform

Name | Type | Line | Description
--- | --- | --- | ---
c | int | 73 | Colour to transform

#### vivid() returns int in class ColoursTransformed

Generate a random vivid colour

### Class: Fourier, package: com.appaapps

Fourier stream

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Fourier | Fourier | void | constructor | 33 | Create a new Fourier stream
Fourier | Fourier | void | constructor | 45 | Create a new Fourier stream at the default speed
float | get | void |  | 49 | Get the next value

#### Fourier() returns Fourier in class Fourier

Create a new Fourier stream

#### Fourier() returns Fourier in class Fourier

Create a new Fourier stream at the default speed

#### get() returns float in class Fourier

Get the next value

### Class: Fourier.Impulse, package: com.appaapps

A sine wave

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Impulse | Impulse | void | constructor | 23 | A sine wave

#### Impulse() returns Impulse in class Fourier.Impulse

A sine wave

### Class: Gradients, package: com.appaapps

Gradients in various patterns

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Tartan | tartan | void | public | 15 | A new tartan paint
Tartan | tartan | float | public | 19 | A new tartan paint

#### tartan() returns Tartan in class Gradients

A new tartan paint

#### tartan(float) returns Tartan in class Gradients

A new tartan paint

Name | Type | Line | Description
--- | --- | --- | ---
speed | float | 20 | Speed relative to 1

### Class: Gradients.Pattern, package: com.appaapps

Each gradient pattern should be derived from this class

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---

### Class: Gradients.Tartan, package: com.appaapps

Create a tartan paint gradient

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
void | set | void | public | 54 | Set the two paints needed to draw the tartan gradient. Overrides: com.appaapps.Gradients.set

#### set() returns void in class Gradients.Tartan

Set the two paints needed to draw the tartan gradient. Overrides: com.appaapps.Gradients.set

### Class: LayoutText, package: com.appaapps

Draw text to fill a fractional area of a canvas, justifying remaining space

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
void | draw | Canvas, String, float, float, float, float, int, int, Paint, Paint | public static | 12 | Draw text to fill a fractional area of a canvas, justifying remaining space

#### draw(Canvas, String, float, float, float, float, int, int, Paint, Paint) returns void in class LayoutText

Draw text to fill a fractional area of a canvas, justifying remaining space

Name | Type | Line | Description
--- | --- | --- | ---
canvas | Canvas | 13 | Canvas to draw on
text | String | 14 | Text to draw
x | float | 15 | Area to draw text in expressed as fractions of the canvas: left x
y | float | 16 | Area to draw text in expressed as fractions of the canvas: top y
X | float | 17 | Area to draw text in expressed as fractions of the canvas: right x
Y | float | 18 | Area to draw text in expressed as fractions of the canvas: bottom y
justX | int | 19 | Justification in x: -1=left, 0=center, +1=right
justY | int | 20 | Justification in y: +1=bottom, 0=center, -1=top
paintF | Paint | 21 | Character paint for foreground - setTextSize(128) or some other reasonable size that Android is capable of drawing text at in a hardware layer. The text will be scaled independently before it is drawn to get an optimal fit in the drawing area
paintB | Paint | 22 | Optional character paint for background or null. Both foreground and background text paints must have the same textSize. The foreground is painted last over the background which is painted first.

### Class: Log, package: com.appaapps

Logging

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
void | say | void | public static | 12 | Say some things
void | showLog | Canvas | public static | 21 | Show log

#### say() returns void in class Log

Say some things

#### showLog(Canvas) returns void in class Log

Show log

Name | Type | Line | Description
--- | --- | --- | ---
c | Canvas | 22 | Canvas to draw log upon

### Class: Maths, package: com.appaapps

Various mathematical methods

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
int | isqrt | int | public static | 8 | Integer square root - slow but rarely used for numbers above 24
int | isqrt2 | int | public static | 16 | Integer fourth root - slow but rarely used for numbers above 24
float | max | float, float | private static | 21 | Maximum of two floats
float | min | float a, float | private static | 28 | Minimum of two floats

#### isqrt(int) returns int in class Maths

Integer square root - slow but rarely used for numbers above 24

Name | Type | Line | Description
--- | --- | --- | ---
n | int | 9 | Integer whose integer square root is required

#### isqrt2(int) returns int in class Maths

Integer fourth root - slow but rarely used for numbers above 24

Name | Type | Line | Description
--- | --- | --- | ---
n | int | 17 | Integer whose integer fourth root is required

#### max(float, float) returns float in class Maths

Maximum of two floats

Name | Type | Line | Description
--- | --- | --- | ---
a | float | 22 | First float
b | float | 23 | Second float

#### min(float a, float) returns float in class Maths

Minimum of two floats

Name | Type | Line | Description
--- | --- | --- | ---
b | float a, float | 29 | First float

### Class: Midi, package: com.appaapps

Midi sound player

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Midi | Midi | File | public constructor | 14 | Create a looping Midi player
void | playSound | byte[] | public | 25 | Play a midi byte stream on Android < 23
void | change | int | public | 74 | Override to observe changes of media player

#### Midi(File) returns Midi in class Midi

Create a looping Midi player

Name | Type | Line | Description
--- | --- | --- | ---
cacheDir | File | 15 | Folder holding midi files

#### playSound(byte[]) returns void in class Midi

Play a midi byte stream on Android < 23

Name | Type | Line | Description
--- | --- | --- | ---
mds | byte[] | 26 | Byte stream containing midi instructions

#### change(int) returns void in class Midi

Override to observe changes of media player

Name | Type | Line | Description
--- | --- | --- | ---
i | int | 75 | ?

### Class: RandomChoice, package: com.appaapps

Random choices

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
T | chooseFromStack | Stack | public | 15 | Choose one element at random from a stack
T | chooseFromArray | T[] | public | 23 | Choose one element at random from an array
T | chooseFromSet | Set | public | 31 | Choose one element at random from a set
void | shuffle | Stack | public | 39 | Shuffle a stack
Stack | choose2 | Stack | public | 52 | Choose two elements, ideally different ones, at random

#### chooseFromStack(Stack) returns T in class RandomChoice

Choose one element at random from a stack

Name | Type | Line | Description
--- | --- | --- | ---
s | Stack | 16 | Stack to choose from

#### chooseFromArray(T[]) returns T in class RandomChoice

Choose one element at random from an array

Name | Type | Line | Description
--- | --- | --- | ---
s | T[] | 24 | Array to choose from

#### chooseFromSet(Set) returns T in class RandomChoice

Choose one element at random from a set

Name | Type | Line | Description
--- | --- | --- | ---
s | Set | 32 | Set tro choose from

#### shuffle(Stack) returns void in class RandomChoice

Shuffle a stack

Name | Type | Line | Description
--- | --- | --- | ---
s | Stack | 40 | Stack to shuffle

#### choose2(Stack) returns Stack in class RandomChoice

Choose two elements, ideally different ones, at random

Name | Type | Line | Description
--- | --- | --- | ---
s | Stack | 53 | Stack to choose from

### Class: Sound, package: com.appaapps

Sounds

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---

### Class: Speech, package: com.appaapps

Speech played from mp3 files

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Speech | Speech | File | public constructor | 11 | Create Speech player

#### Speech(File) returns Speech in class Speech

Create Speech player

Name | Type | Line | Description
--- | --- | --- | ---
cacheDir | File | 12 | Folder containing files to play

### 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.

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Svg | Svg | void | public constructor | 21 | Create an Svg
AFewChars | AFewChars | String, float, float, float, float, int, int | protected | 331 | Create and push a new AFewChars element
Image | Image | Bitmap, float, float, float, float | public | 385 | Create and push a new image
Rectangle | Rectangle | float, float, float, float | protected | 223 | Create and push a rectangle
Text | Text | String, float, float, float, float, int, int | protected | 296 | Create and push a new text element
void | draw | Canvas | public | 32 | Draw the Svg on the canvas
float | maxScale | RectF, RectF | private static | 396 | Maximum scale factor from first specified rectangle to the second
void | onShow | void | protected | 29 | Called when this Svg is shown or reshown after some other Svg has been shown
void | push | Element | private | 24 | Add an element to the stack of elements to be displayed
Bitmap | testImage | void | static | 408 | Create a test image

#### Svg() returns Svg in class Svg

Create an Svg

#### AFewChars(String, float, float, float, float, int, int) returns AFewChars in class Svg

Create and push a new AFewChars element

Name | Type | Line | Description
--- | --- | --- | ---
text | String | 332 | The small amount of text to display
x | float | 333 | Fractional area in which to display the text - left
y | float | 334 | Fractional area in which to display the text - upper
𝘅 | float | 335 | Fractional area in which to display the text - right
𝘆 | float | 336 | Fractional area in which to display the text - lower
justifyX | int | 337 | Justification in x per: com.appaapps.LayoutText
justifyY | int | 338 | Justification in y per: com.appaapps.LayoutText

#### Image(Bitmap, float, float, float, float) returns Image in class Svg

Create and push a new image

Name | Type | Line | Description
--- | --- | --- | ---
bitmap | Bitmap | 386 | Bitmap containing image
x | float | 387 | Fraction coordinates of left edge
y | float | 388 | Fraction coordinates of upper edge
𝘅 | float | 389 | Fraction coordinates of right edge
𝘆 | float | 390 | Fraction coordinates of lower edge

#### Rectangle(float, float, float, float) returns Rectangle in class Svg

Create and push a rectangle

Name | Type | Line | Description
--- | --- | --- | ---
x | float | 224 | Fractional position - left
y | float | 225 | Fractional position - upper
𝘅 | float | 226 | Fractional position - right
𝘆 | float | 227 | Fractional position - lower

#### Text(String, float, float, float, float, int, int) returns Text in class Svg

Create and push a new text element

Name | Type | Line | Description
--- | --- | --- | ---
text | String | 297 | The text to display
x | float | 298 | Fractional area in which to display the text - left
y | float | 299 | Fractional area in which to display the text - upper
𝘅 | float | 300 | Fractional area in which to display the text - right
𝘆 | float | 301 | Fractional area in which to display the text - lower
justifyX | int | 302 | Justification in x per: com.appaapps.LayoutText
justifyY | int | 303 | Justification in y per: com.appaapps.LayoutText

#### draw(Canvas) returns void in class Svg

Draw the Svg on the canvas

Name | Type | Line | Description
--- | --- | --- | ---
canvas | Canvas | 33 | Canvas to draw on

#### maxScale(RectF, RectF) returns float in class Svg

Maximum scale factor from first specified rectangle to the second

Name | Type | Line | Description
--- | --- | --- | ---
source | RectF | 397 | Source rectangle
target | RectF | 398 | Target rectangle

#### onShow() returns void in class Svg

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

#### push(Element) returns void in class Svg

Add an element to the stack of elements to be displayed

Name | Type | Line | Description
--- | --- | --- | ---
e | Element | 25 | the element to add

#### testImage() returns Bitmap in class Svg

Create a test image

### Class: Svg.AFewChars, package: com.appaapps

A Few chars is just like text except that the gradient is across each character not the entire drawing area

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
AFewChars | AFewChars | String, float, float, float, float, int, int | private constructor | 311 | Create a text area
float | width | void | protected | 321 | Approximate width of object before scaling is the drawn length of the string. Overrides: com.appaapps.Svg.Element2.width
float | height | void | protected | 325 | Approximate width of object before scaling is one character. Overrides: com.appaapps.Svg.Element2.height

#### AFewChars(String, float, float, float, float, int, int) returns AFewChars in class Svg.AFewChars

Create a text area

Name | Type | Line | Description
--- | --- | --- | ---
text | String | 312 | The text to display
x | float | 313 | Fractional area in which to display the text - left
y | float | 314 | Fractional area in which to display the text - upper
𝘅 | float | 315 | Fractional area in which to display the text - right
𝘆 | float | 316 | Fractional area in which to display the text - lower
justifyX | int | 317 | Justification in x per: com.appaapps.LayoutText
justifyY | int | 318 | Justification in y per: com.appaapps.LayoutText

#### width() returns float in class Svg.AFewChars

Approximate width of object before scaling is the drawn length of the string. Overrides: com.appaapps.Svg.Element2.width

#### height() returns float in class Svg.AFewChars

Approximate width of object before scaling is one character. Overrides: com.appaapps.Svg.Element2.height

### Class: Svg.Element, package: com.appaapps

Common features of a drawn element

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Element | Element | float, float, float, float | private constructor | 56 | Create en element by specifying its fractional area on the canvas
void | clearCenterToCenter | void | protected | 108 | Clear animation for this element
boolean | contains | float, float | protected | 84 | Does this element contain the point (x, y)?
void | draw | Canvas | protected | 80 | Overriden by each element to draw itself
void | drawElement | Canvas | protected | 64 | Draw the SVG on a canvas
CenterToCenter | setCenterToCenter | double, double, double, float, float, float, float | private | 91 | Create set Center To Center animation for this element
CenterToCenter | setCenterToCenter | CenterToCenter | protected | 103 | Set Center To Center animation for this element

#### Element(float, float, float, float) returns Element in class Svg.Element

Create en element by specifying its fractional area on the canvas

Name | Type | Line | Description
--- | --- | --- | ---
x | float | 57 | Fractional area in which to display the element - left
y | float | 58 | Fractional area in which to display the element - upper
𝘅 | float | 59 | Fractional area in which to display the element - right
𝘆 | float | 60 | Fractional area in which to display the element - lower

#### clearCenterToCenter() returns void in class Svg.Element

Clear animation for this element

#### contains(float, float) returns boolean in class Svg.Element

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

Name | Type | Line | Description
--- | --- | --- | ---
x | float | 85 | Point.X
y | float | 86 | Point.Y

#### draw(Canvas) returns void in class Svg.Element

Overriden by each element to draw itself

Name | Type | Line | Description
--- | --- | --- | ---
canvas | Canvas | 81 | Canvas on which the element would be drawn

#### drawElement(Canvas) returns void in class Svg.Element

Draw the SVG on a canvas

Name | Type | Line | Description
--- | --- | --- | ---
canvas | Canvas | 65 | Canvas to draw on

#### setCenterToCenter(double, double, double, float, float, float, float) returns CenterToCenter in class Svg.Element

Create set Center To Center animation for this element

Name | Type | Line | Description
--- | --- | --- | ---
delay | double | 92 | Delay before animation starts
duration | double | 93 | Duration of expansion and contraction
startAgain | double | 94 | Restart again after this time
x | float | 95 | Fractional position to expand to - left
y | float | 96 | Fractional position to expand to - upper
𝘅 | float | 97 | Fractional position to expand to - right
𝘆 | float | 98 | Fractional position to expand to - lower

#### setCenterToCenter(CenterToCenter) returns CenterToCenter in class Svg.Element

Set Center To Center animation for this element

Name | Type | Line | Description
--- | --- | --- | ---
animation | CenterToCenter | 104 | Animation

### Class: Svg.Element.CenterToCenter, package: com.appaapps

Animation which expands an element its center is over the centre of the canvas

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
CenterToCenter | CenterToCenter | CenterToCenter | protected constructor | 132 | Clone a center to center animation
CenterToCenter | CenterToCenter | double, double, double, float, float, float, float | protected constructor | 117 | Create a center to center animation
float | active | void | protected | 141 | Get fraction of animation
void | onActivate | void | protected | 173 | Called when this animation becomes active
void | scaleDrawArea | Canvas | protected | 162 | Apply scale to the drawing area

#### CenterToCenter(CenterToCenter) returns CenterToCenter in class Svg.Element.CenterToCenter

Clone a center to center animation

Name | Type | Line | Description
--- | --- | --- | ---
clone | CenterToCenter | 133 | Animation to clone

#### CenterToCenter(double, double, double, float, float, float, float) returns CenterToCenter in class Svg.Element.CenterToCenter

Create a center to center animation

Name | Type | Line | Description
--- | --- | --- | ---
delay | double | 118 | Delay before animation starts in seconds
duration | double | 119 | Duration of animation in seconds
startAgain | double | 120 | Restart after animation after this time
x | float | 121 | Fractional position to expand to - left
y | float | 122 | Fractional position to expand to - upper
𝘅 | float | 123 | Fractional position to expand to - right
𝘆 | float | 124 | Fractional position to expand to - lower

#### active() returns float in class Svg.Element.CenterToCenter

Get fraction of animation

#### onActivate() returns void in class Svg.Element.CenterToCenter

Called when this animation becomes active

#### scaleDrawArea(Canvas) returns void in class Svg.Element.CenterToCenter

Apply scale to the drawing area

Name | Type | Line | Description
--- | --- | --- | ---
canvas | Canvas | 163 | Canvas to which scaling is to be applied

### Class: Svg.Element2, package: com.appaapps

Common features of an element drawn with two paints - this is in effect a replacement for ComposeShader which does not seem to work - it always produces a white screen

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Element2 | Element2 | float, float, float, float | private constructor | 183 | Create en element by specifying its fractional area on the canvas
void | drawElement | Canvas | protected | 191 | Draw the Svg on the canvas
float | height | Canvas | protected | 200 | Approximate height of object before scaling
float | width | Canvas | protected | 196 | Approximate width of object before scaling

#### Element2(float, float, float, float) returns Element2 in class Svg.Element2

Create en element by specifying its fractional area on the canvas

Name | Type | Line | Description
--- | --- | --- | ---
x | float | 184 | Fractional area in which to display the element - left
y | float | 185 | Fractional area in which to display the element - upper
𝘅 | float | 186 | Fractional area in which to display the element - right
𝘆 | float | 187 | Fractional area in which to display the element - lower

#### drawElement(Canvas) returns void in class Svg.Element2

Draw the Svg on the canvas

Name | Type | Line | Description
--- | --- | --- | ---
canvas | Canvas | 192 | Canvas to draw on

#### height(Canvas) returns float in class Svg.Element2

Approximate height of object before scaling

Name | Type | Line | Description
--- | --- | --- | ---
canvas | Canvas | 201 | Canvas to draw on

#### width(Canvas) returns float in class Svg.Element2

Approximate width of object before scaling

Name | Type | Line | Description
--- | --- | --- | ---
canvas | Canvas | 197 | Canvas to draw on

### Class: Svg.Image, package: com.appaapps

Draw a bitmap image - move it around to show it all within the space available

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Image | Image | Bitmap, float, float, float, float | private constructor | 351 | Fraction coordinates of corners of drawing area
void | draw | void | protected | 366 | Draw a bitmap. Overrides: com.appaapps.Svg.Element2.draw

#### Image(Bitmap, float, float, float, float) returns Image in class Svg.Image

Fraction coordinates of corners of drawing area

Name | Type | Line | Description
--- | --- | --- | ---
bitmap | Bitmap | 352 | Bitmap containing image
x | float | 353 | Fraction coordinates of left edge
y | float | 354 | Fraction coordinates of upper edge
𝘅 | float | 355 | Fraction coordinates of right edge
𝘆 | float | 356 | Fraction coordinates of lower edge

#### draw() returns void in class Svg.Image

Draw a bitmap. Overrides: com.appaapps.Svg.Element2.draw

### Class: Svg.Rectangle, package: com.appaapps

Draw a rectangle

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Rectangle | Rectangle | float, float, float, float | private constructor | 208 | Create a rectangle
void | draw | void | protected | 216 | Draw the rectangle. Overrides: com.appaapps.Svg.Element2.draw

#### Rectangle(float, float, float, float) returns Rectangle in class Svg.Rectangle

Create a rectangle

Name | Type | Line | Description
--- | --- | --- | ---
x | float | 209 | Fractional position - left
y | float | 210 | Fractional position - upper
𝘅 | float | 211 | Fractional position - right
𝘆 | float | 212 | Fractional position - lower

#### draw() returns void in class Svg.Rectangle

Draw the rectangle. Overrides: com.appaapps.Svg.Element2.draw

### Class: Svg.Text, package: com.appaapps

Draw text

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
Text | Text | String, float, float, float, float, int, int | private constructor | 241 | Create a text area
void | draw | void | protected | 258 | Draw the text. Overrides: com.appaapps.Svg.Element2.draw

#### Text(String, float, float, float, float, int, int) returns Text in class Svg.Text

Create a text area

Name | Type | Line | Description
--- | --- | --- | ---
text | String | 242 | The text to display
x | float | 243 | Fractional area in which to display the text - left
y | float | 244 | Fractional area in which to display the text - upper
𝘅 | float | 245 | Fractional area in which to display the text - right
𝘆 | float | 246 | Fractional area in which to display the text - lower
justifyX | int | 247 | Justification in x per: com.appaapps.LayoutText
justifyY | int | 248 | Justification in y per: com.appaapps.LayoutText

#### draw() returns void in class Svg.Text

Draw the text. Overrides: com.appaapps.Svg.Element2.draw

### Class: Unzip, package: com.appaapps

A thread to unzip a file

Returns | Method | Signature | Attributes | Line | Description
--- | --- | --- | --- | --- | ---
ZipFile | createZipFile | File | private | 15 | Create a file unzipper
Unzip | Unzip | String | public constructor | 24 | Unzip the named file
void | run | void | public | 29 | Unzip the named file
void | failed | void | public | 55 | Report a failure during the unzip
void | finished | void | public | 57 | Report the unzip as finished
void | zipEntry | String | public abstract | 59 | Override to process the content of each zip entry

#### createZipFile(File) returns ZipFile in class Unzip

Create a file unzipper

Name | Type | Line | Description
--- | --- | --- | ---
file | File | 16 | File to unzip

#### Unzip(String) returns Unzip in class Unzip

Unzip the named file

Name | Type | Line | Description
--- | --- | --- | ---
File | String | 25 | File to unzip

#### run() returns void in class Unzip

Unzip the named file

#### failed() returns void in class Unzip

Report a failure during the unzip

#### finished() returns void in class Unzip

Report the unzip as finished

#### zipEntry(String) returns void in class Unzip

Override to process the content of each zip entry

Name | Type | Line | Description
--- | --- | --- | ---
name | String | 60 | Name of zip file entry == file name