Back to index

wims  3.65+svn20090927
Package Functions | Static Package Functions | Private Member Functions | Private Attributes | Static Private Attributes
ScaleableAtom Class Reference
Collaboration diagram for ScaleableAtom:
Collaboration graph

List of all members.

Package Functions

 ScaleableAtom (int Rl, int Gl, int Bl, double Sf)
boolean Exist ()
void paint (Graphics gc, int x, int y, int r)

Static Package Functions

 [static initializer]
static void setApplet (Applet app)

Private Member Functions

final int blend (int fg, int bg, float fgfactor)
void Setup (int nBalls)

Private Attributes

int Rl
int Gl
int Bl
double Sf
Image balls []

Static Private Attributes

static Applet applet
static byte[] data
static final int R = 40
static final int hx = 15
static final int hy = 15
static final int bgGrey = 192
static int maxr

Detailed Description

Definition at line 610 of file

Constructor & Destructor Documentation

ScaleableAtom.ScaleableAtom ( int  Rl,
int  Gl,
int  Bl,
double  Sf 
) [inline, package]

Definition at line 646 of file

       this.Rl = Rl;
       this.Gl = Gl;
       this.Bl = Bl;
        this.Sf = Sf;

Member Function Documentation

ScaleableAtom.[static initializer] ( ) [inline, static, package]
final int ScaleableAtom.blend ( int  fg,
int  bg,
float  fgfactor 
) [inline, private]

Definition at line 658 of file

       return (int) (bg + (fg - bg) * fgfactor);

Here is the caller graph for this function:

boolean ScaleableAtom.Exist ( ) [inline, package]

Definition at line 652 of file

       if (Sf==0.0)
            return false;
            return true;

Here is the caller graph for this function:

void ScaleableAtom.paint ( Graphics  gc,
int  x,
int  y,
int  r 
) [inline, package]

Definition at line 683 of file

       Image ba[] = balls;
       if (ba == null) {
           ba = balls;
       Image i = ba[r];
       int size = 10 + r;
       gc.drawImage(i, x - (size >> 1), y - (size >> 1), size, size, applet);

Here is the call graph for this function:

Here is the caller graph for this function:

static void ScaleableAtom.setApplet ( Applet  app) [inline, static, package]

Definition at line 643 of file

       applet = app;

Here is the caller graph for this function:

void ScaleableAtom.Setup ( int  nBalls) [inline, private]

Definition at line 661 of file

       balls = new Image[nBalls];
       byte red[] = new byte[256];
       red[0] = (byte) bgGrey;
       byte green[] = new byte[256];
       green[0] = (byte) bgGrey;
       byte blue[] = new byte[256];
       blue[0] = (byte) bgGrey;
       for (int r = 0; r < nBalls; r++) {
           float b = (float) (r+1) / nBalls;
           for (int i = maxr; i >= 1; --i) {
              float d = (float) i / maxr;
              red[i] = (byte) blend(blend(Rl, 255, d), bgGrey, b);
              green[i] = (byte) blend(blend(Gl, 255, d), bgGrey, b);
              blue[i] = (byte) blend(blend(Bl, 255, d), bgGrey, b);
           IndexColorModel model = new IndexColorModel(8, maxr + 1,
                                                 red, green, blue, 0);
           balls[r] = applet.createImage(
              new MemoryImageSource(R*2, R*2, model, data, 0, R*2));

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Applet ScaleableAtom.applet [static, private]

Definition at line 611 of file

Image ScaleableAtom.balls[] [private]

Definition at line 624 of file

final int ScaleableAtom.bgGrey = 192 [static, private]

Definition at line 616 of file

int ScaleableAtom.Bl [private]

Definition at line 621 of file

byte [] [static, private]

Definition at line 612 of file

int ScaleableAtom.Gl [private]

Definition at line 620 of file

final int ScaleableAtom.hx = 15 [static, private]

Definition at line 614 of file

final int ScaleableAtom.hy = 15 [static, private]

Definition at line 615 of file

int ScaleableAtom.maxr [static, private]

Definition at line 617 of file

final int ScaleableAtom.R = 40 [static, private]

Definition at line 613 of file

int ScaleableAtom.Rl [private]

Definition at line 619 of file

double ScaleableAtom.Sf [private]

Definition at line 622 of file

The documentation for this class was generated from the following file: