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

Variable Index

 o boxCount
Array contining number of points in boxes:

Constructor Index

 o boxCalculate()
Default constructor lays out button and textBox controls

Method Index

 o getNDiv()
returns value of number of subdivisions
 o getQ()
returns value of dimension order
 o handleEvent(Event)
Handles button event to stop calculation
 o parseTextField(TextField, int)
Parses text field known to be integer.
 o parseTextField(TextField, int, boolean)
Parses text field known to be integer of known sign.
 o run()
Thread to perform calculation
 o setNDiv(int)
sets value of number of subdivisions
 o setQ(int)
sets value of dimension order
 o setText(String)
Sets textBox contents
 o setup(int[])
Sets up calculation.
 o stopRequest()
stops calculation
 o textBoxDisable()
disables TextFields
 o textBoxEnable()
enables TextFields

Variables

 o divIndex
 public int divIndex[]
Array of size nDiv+1 containing number of boxes covering attractor at each division scale

 o total
 public int total
Total nuber of points

 o output
 public int output[]
Array contining box locations: 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.

 o boxCount
 public int boxCount[]
Array contining number of points in boxes: stored as in output.

 o completed
 public boolean completed
True if calculation of box coverage is complete

Constructors

 o boxCalculate
 public boxCalculate()
Default constructor lays out button and textBox controls

Methods

 o 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)
 o run
 public void run()
Thread to perform calculation

 o stopRequest
 public void stopRequest()
stops calculation

 o handleEvent
 public boolean handleEvent(Event evt)
Handles button event to stop calculation

Overrides:
handleEvent in class Component
 o setText
 public void setText(String text)
Sets textBox contents

Parameters:
text - contents
 o 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
 o 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
 o getQ
 public int getQ()
returns value of dimension order

Returns:
dimension order q
 o setQ
 public void setQ(int in_q)
sets value of dimension order

Parameters:
in_q - dimension order q
 o getNDiv
 public int getNDiv()
returns value of number of subdivisions

Returns:
number of subdivisions
 o setNDiv
 public void setNDiv(int in_nDiv)
sets value of number of subdivisions

Parameters:
in_nDiv - number of subdivisions
 o textBoxEnable
 public void textBoxEnable()
enables TextFields

 o textBoxDisable
 public void textBoxDisable()
disables TextFields


All Packages  Class Hierarchy  This Package  Previous  Next  Index