All Packages  Class Hierarchy  This Package  Previous  Next  Index
  Class crw.device.CarrierMover
java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----crw.device.CarrierMover
  -  public class CarrierMover
  -  extends Canvas
  -  implements Runnable
This class implements the CarrierInPipe class in a canvas,
 which finally fulfills the "moving carriers in a pipe".
 It implements Runnable. The thread should be started manually.
  -  Version:
  
-  0.2  3/29/1999
  
-  Author:
  
-  Hongyu Lu
    
-  See Also:
    
-  CarrierInPipe
   
  -   CarrierMover() CarrierMover()
-  
 Creates a Pipe with default values.
 width=80, height=30, densityLevel=4 Orientation='East'.
-   CarrierMover(int, int, int, char) CarrierMover(int, int, int, char)
-  
 Creates a Pipe with some of the default values.
 
-   CarrierMover(int, int, int, int, int, char, boolean, Color, boolean) CarrierMover(int, int, int, int, int, char, boolean, Color, boolean)
-  
 Creates a Pipe.
 
   
  -   paint(Graphics) paint(Graphics)
-  
 Draws pipe of carriers in the canvas.
 
-   run() run()
-  
  
-   setDotsNumber(int) setDotsNumber(int)
-  
 Sets the carrier densityLevel in the pipe.
 
-   setHeight(int) setHeight(int)
-  
 Sets the height of the pipe.
 
-   setOrientation(char) setOrientation(char)
-  
 Sets the orientation of the pipe.
 
-   setType(boolean) setType(boolean)
-  
 Sets the carrier type in the pipe,
 
-   setXInit(int) setXInit(int)
-  
 Sets x of the pipe.
 
-   setYInit(int) setYInit(int)
-  
 Sets y of the pipe.
 
-   start() start()
-  
 Starts the animation, which should be called manually.
 
-   stop() stop()
-  
 Stops the animation, which should be called manually.
 
-   update(Graphics) update(Graphics)
-  
   
 CarrierMover
CarrierMover
 public CarrierMover()
  -  Creates a Pipe with default values.
 width=80, height=30, densityLevel=4 Orientation='East'.
 
 CarrierMover
CarrierMover
 public CarrierMover(int width,
                     int height,
                     int dotsNumber,
                     char orientation)
  -  Creates a Pipe with some of the default values.
 
   
- 
    -  Parameters:
    
-  width - pipe width
    -  height - pipe height
    -  dotsNumber - densityLevel max=1, min=50
    -  orientation - pipe orientation
  
 
 CarrierMover
CarrierMover
 public CarrierMover(int xInit,
                     int yInit,
                     int width,
                     int height,
                     int dotsNumber,
                     char orientation,
                     boolean isElectron,
                     Color background,
                     boolean withBorder)
  -  Creates a Pipe.
 
   
- 
    -  Parameters:
    
-  xInit - x of pipe
    -  yInit - y of pipe
    -  width - pipe width
    -  height - pipe height
    -  dotsNumber - densityLevel max=1, min=50
    -  orientation - pipe orientation
    -  isElectron - carrier type
    -  background - background color
    -  withBorder - if drawing pipe with borders
  
 
   
 update
update
 public void update(Graphics g)
  - 
    -  Overrides:
    
-  update in class Component
  
 
 paint
paint
 public void paint(Graphics g)
  -  Draws pipe of carriers in the canvas.
 
   
- 
    -  Parameters:
    
-  g - the graphics context
    
-  Overrides:
    
-  paint in class Canvas
  
 
 start
start
 public void start()
  -  Starts the animation, which should be called manually.
 
 
 stop
stop
 public void stop()
  -  Stops the animation, which should be called manually.
 
 
 run
run
 public void run()
 setHeight
setHeight
 public void setHeight(int height)
  -  Sets the height of the pipe.
 
   
- 
    -  Parameters:
    
-  height - new pipe height
  
 
 setXInit
setXInit
 public void setXInit(int xInit)
  -  Sets x of the pipe.
 
   
- 
    -  Parameters:
    
-  xInit - new x of the pipe
  
 
 setYInit
setYInit
 public void setYInit(int yInit)
  -  Sets y of the pipe.
 
   
- 
    -  Parameters:
    
-  yInit - new y of the pipe
  
 
 setType
setType
 public void setType(boolean isElectron)
  -  Sets the carrier type in the pipe,
 
   
- 
    -  Parameters:
    
-  isElectron - new carrier type
  
 
 setDotsNumber
setDotsNumber
 public void setDotsNumber(int dotsNumber)
  -  Sets the carrier densityLevel in the pipe.
 
   
- 
    -  Parameters:
    
-  dotsNumber - new carrier densityLevel
  
 
 setOrientation
setOrientation
 public void setOrientation(char orientation)
  -  Sets the orientation of the pipe.
 
   
- 
    -  Parameters:
    
-  orientation - new orientation of the pipe
  
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index