Back to index

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

List of all members.

Package Functions

 Atom (int Rl, int Gl, int Bl)
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 ()

Private Attributes

int Rl
int Gl
int Bl
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 final int nBalls = 16
static int maxr

Detailed Description

Definition at line 372 of file

Constructor & Destructor Documentation

Atom.Atom ( int  Rl,
int  Gl,
int  Bl 
) [inline, package]

Definition at line 407 of file

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

Member Function Documentation

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

Definition at line 412 of file

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

Here is the caller graph for this function:

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

Definition at line 437 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 Atom.setApplet ( Applet  app) [inline, static, package]

Definition at line 404 of file

       applet = app;

Here is the caller graph for this function:

void Atom.Setup ( ) [inline, private]

Definition at line 415 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 Atom.applet [static, private]

Definition at line 373 of file

Image Atom.balls[] [private]

Definition at line 385 of file

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

Definition at line 378 of file

int Atom.Bl [private]

Definition at line 384 of file

byte [] [static, private]

Definition at line 374 of file

int Atom.Gl [private]

Definition at line 383 of file

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

Definition at line 376 of file

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

Definition at line 377 of file

int Atom.maxr [static, private]

Definition at line 380 of file

final int Atom.nBalls = 16 [static, private]

Definition at line 379 of file

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

Definition at line 375 of file

int Atom.Rl [private]

Definition at line 382 of file

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