ks.client.gamefactory.skin
Class Psychadelic

java.lang.Object
  |
  +--ks.client.gamefactory.skin.Psychadelic
All Implemented Interfaces:
java.lang.Runnable

public class Psychadelic
extends java.lang.Object
implements java.lang.Runnable

Manages the responsibility of filling rectangles that need refreshing into a specific graphics context object using a particular color.

Default Skin for a container; simply copies a known color everywhere.


Field Summary
protected  Container container
          Target container.
protected  int delay
          Delay between color changing.
protected  java.awt.Color myColor
          My color to show.
protected  java.awt.Graphics myGraphics
          Target graphics object.
protected  java.lang.Thread thread
          The thread to oversee the scrolling.
protected  boolean visible
          Are we visible (assume we are initially visible).
 
Constructor Summary
Psychadelic(Container cont, java.awt.Color c)
          Psychadelic constructor comment.
 
Method Summary
 boolean isVisible()
          Detect if we are visible.
protected  int randomOffset(int width)
          Returns a number from (-width/2) ..
 void run()
          Thread will operate by pausing n milliseconds and then checking if container is in a drag.
 void setDelay(int newDelay)
          Set the time delay between image scrolling.
 void setVisible(boolean visible)
          Visitor's chance to release resources once done.
 void visit(RectangleHierarchy node)
          Copy the appropriate image as based by this node's value.
 void visit(RectangleHierarchy node, java.awt.Rectangle clip)
          Copy the appropriate image as based by this node's value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myColor

protected java.awt.Color myColor
My color to show.


thread

protected java.lang.Thread thread
The thread to oversee the scrolling.


delay

protected int delay
Delay between color changing.


visible

protected boolean visible
Are we visible (assume we are initially visible).


myGraphics

protected java.awt.Graphics myGraphics
Target graphics object.


container

protected Container container
Target container.

Constructor Detail

Psychadelic

public Psychadelic(Container cont,
                   java.awt.Color c)
Psychadelic constructor comment.

Parameters:
c - java.awt.Color
Method Detail

isVisible

public boolean isVisible()
Detect if we are visible. Creation date: (1/5/02 12:49:03 PM)

Returns:
boolean

randomOffset

protected int randomOffset(int width)
Returns a number from (-width/2) .. 0 .. (width/2)


run

public void run()
Thread will operate by pausing n milliseconds and then checking if container is in a drag. Once it is verified that we can scroll, we do so, and the entire container background is redrawn.

Specified by:
run in interface java.lang.Runnable

setDelay

public void setDelay(int newDelay)
Set the time delay between image scrolling.

Parameters:
newDelay - int

setVisible

public void setVisible(boolean visible)
Visitor's chance to release resources once done.

Parameters:
visible - boolean

visit

public void visit(RectangleHierarchy node)
Copy the appropriate image as based by this node's value.


visit

public void visit(RectangleHierarchy node,
                  java.awt.Rectangle clip)
Copy the appropriate image as based by this node's value. Use clip as a truncating clipping region.

clip is unaffected by this method.