All Packages Class Hierarchy This Package Previous Next Index
Class ChaosDemos.boxCalculate
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----ChaosDemos.boxCalculate
- public class boxCalculate
- extends Panel
- implements Runnable
Calculates dimesion of 2D maps by box counting algorithm, uisng a fast
sort algorithm to arrange array of finest boxes and then successively
coarsening and weeding the array.
Stores number of boxes to cover points in divIndex[nDiv+1]
- Version:
- 2 August 1997
- Author:
- Michael Cross
-
boxCount
- Array contining number of points in boxes:
- 0 to divIndex[0]-1 for finest subdivision
- divIndex[0] to divIndex[1]-1 for next etc.
-
completed
- True if calculation of box coverage is complete
-
divIndex
- Array of size nDiv+1 containing number of boxes covering attractor at each division scale
-
output
- Array contining box locations:
- 0 to divIndex[0]-1 for finest subdivision
- divIndex[0] to divIndex[1]-1 for next etc.
-
total
- Total nuber of points
-
boxCalculate()
- Default constructor
lays out button and textBox controls
-
getNDiv()
- returns value of number of subdivisions
-
getQ()
- returns value of dimension order
-
handleEvent(Event)
- Handles button event to stop calculation
-
parseTextField(TextField, int)
- Parses text field known to be integer.
-
parseTextField(TextField, int, boolean)
- Parses text field known to be integer of known sign.
-
run()
- Thread to perform calculation
-
setNDiv(int)
- sets value of number of subdivisions
-
setQ(int)
- sets value of dimension order
-
setText(String)
- Sets textBox contents
-
setup(int[])
- Sets up calculation.
-
stopRequest()
- stops calculation
-
textBoxDisable()
- disables TextFields
-
textBoxEnable()
- enables TextFields
divIndex
public int divIndex[]
- Array of size nDiv+1 containing number of boxes covering attractor at each division scale
total
public int total
- Total nuber of points
output
public int output[]
- Array contining box locations:
- 0 to divIndex[0]-1 for finest subdivision
- divIndex[0] to divIndex[1]-1 for next etc.
Position (i,j) is stored as i+j*N where there are N boxes across one direction of map at
this scale, and i and j run from 0 to N-1.
boxCount
public int boxCount[]
- Array contining number of points in boxes:
- 0 to divIndex[0]-1 for finest subdivision
- divIndex[0] to divIndex[1]-1 for next etc.
stored as in output.
completed
public boolean completed
- True if calculation of box coverage is complete
boxCalculate
public boxCalculate()
- Default constructor
lays out button and textBox controls
setup
public void setup(int in_x[])
- Sets up calculation. Must be called before calculation thread is started.
- Parameters:
- in_x - Array of data in x,y pairs of ints given by box number on finest (2^nDiv)
scale
- in_nDiv - Number of subdivisions to make (from 0 to nDiv)
run
public void run()
- Thread to perform calculation
stopRequest
public void stopRequest()
- stops calculation
handleEvent
public boolean handleEvent(Event evt)
- Handles button event to stop calculation
- Overrides:
- handleEvent in class Component
setText
public void setText(String text)
- Sets textBox contents
- Parameters:
- text - contents
parseTextField
public int parseTextField(TextField t,
int i,
boolean positive)
- Parses text field known to be integer of known sign.
Resets old value of corresponding variable if input format
is incorrect or wrong sign and brings up alertDialog warning box.
- Parameters:
- t - field to be parsed
- i - old value of variable
- positive - true if value should be positive, false if should be negative
- Returns:
- new value of parameter if textbox format is correct,
and value of correct sign, otherwise old value.
- See Also:
- alertDialog
parseTextField
public int parseTextField(TextField t,
int i)
- Parses text field known to be integer.
Resets old value of corresponding variable if input format
is incorrect and brings up alertDialog warning box.
- Parameters:
- t - field to be parsed
- i - old value of variable
- Returns:
- new value of parameter if textbox format is correct,
otherwise old value.
- See Also:
- alertDialog
getQ
public int getQ()
- returns value of dimension order
- Returns:
- dimension order q
setQ
public void setQ(int in_q)
- sets value of dimension order
- Parameters:
- in_q - dimension order q
getNDiv
public int getNDiv()
- returns value of number of subdivisions
- Returns:
- number of subdivisions
setNDiv
public void setNDiv(int in_nDiv)
- sets value of number of subdivisions
- Parameters:
- in_nDiv - number of subdivisions
textBoxEnable
public void textBoxEnable()
- enables TextFields
textBoxDisable
public void textBoxDisable()
- disables TextFields
All Packages Class Hierarchy This Package Previous Next Index