All Packages Class Hierarchy This Package Previous Next Index
Class picture.FadeIn
java.lang.Object
|
+----picture.FadeIn
- public class FadeIn
- extends Object
- implements Runnable, Watchable
Make a picture fade in by drawing big squares, then smaller ones.
Pass this to a new Thread(this) to start a new thread that will
do the drawing jobs. Jobs are started and interrupted with startJob() and
stopJob(). A copy of the screen is kept in memory so that the screen can
be redrawn quickly by calling paint(). Also, an
additional copy is kept as a byte array, so that the 24-bit
image can be examined for antialiasing.
Two PicPipeSources are given to startJob(). The first is used to
color every pixel, then the second, if not null, is used to color
only those pixels that differ greatly from at least one of the 8 neighbors
in at least one of the 3 color components. This allows adaptive
antialiasing if the first pass does just jitter, and the second
averages multiple rays per pixel.
This code is (c) 1996, 1998 Leemon Baird
<leemon@cs.cmu.edu>,
http://www.cs.cmu.edu/~baird
The source and object code may be redistributed freely.
If the code is modified, please state so in the comments.
- Version:
- 1.01, 18 June 98
- Author:
- Leemon Baird
-
FadeIn()
-
-
getName()
- Return the variable "name" that was passed into setWatchManager
-
getWatchManager()
- Return the WatchManager set by setWatchManager().
-
paint(Graphics, ImageObserver)
- Instantly paint the screen from an offscreen buffer
-
run()
- Passing FadeIn to a new thread calls run() automatically.
-
setWatchManager(WatchManager, String)
- Register all variables with this WatchManager.
-
startJob(Component, double, double, double, double, int, int, int, int, int, PicPipeList, PicPipeList)
- Start a new job that causes the picture to fade in on the screen.
-
stopJob()
- Interrupt the current drawing job, and force a wait for start().
FadeIn
public FadeIn()
stopJob
public synchronized void stopJob()
- Interrupt the current drawing job, and force a wait for start().
This does not kill the thread, it just makes it wait for another
job.
startJob
public synchronized void startJob(Component c,
double minX,
double maxX,
double minY,
double maxY,
int x,
int y,
int gWidth,
int gHeight,
int barHeight,
PicPipeList sourcePass1,
PicPipeList sourcePass2)
- Start a new job that causes the picture to fade in on the screen.
Each pixel is drawn first, then a second pass does antialiasing.
Stops the previously-running thread, if any. The component is
the component that will be drawn to with paint().
paint
public synchronized void paint(Graphics g,
ImageObserver c)
- Instantly paint the screen from an offscreen buffer
run
public synchronized void run()
- Passing FadeIn to a new thread calls run() automatically.
An infinite loop then handles drawing jobs. Particular
drawing jobs are then started with start() and stopped with stop(),
but the thread just keeps going. It will wait() between drawing jobs.
setWatchManager
public void setWatchManager(WatchManager wm,
String name)
- Register all variables with this WatchManager.
This will be called after all parsing is done.
getWatchManager
public WatchManager getWatchManager()
- Return the WatchManager set by setWatchManager().
getName
public String getName()
- Return the variable "name" that was passed into setWatchManager
All Packages Class Hierarchy This Package Previous Next Index