|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ks.client.gamefactory.skin.ImageScroller
Class for presenting a scrolling image on the back of a solitaire game.
While an object is being dragged by the container, no scrolling will occur
This could be made more generic (to allow scrolling up/down/left/right/random)...
Creation date: (10/11/01 5:00:49 PM)
Field Summary | |
protected Container |
container
Container over which we are operating; we need to have dragging. |
protected int |
delay
Delay between scrolling. |
protected int |
edge
The distance between the left edge and position of leading scrolled edge. |
protected java.awt.Image |
myImage
Image being scrolled. |
protected int |
scrollDistance
Distance to scroll horizontally with each clock tick. |
protected java.lang.Thread |
thread
The thread to oversee the scrolling. |
protected boolean |
visible
Assume we are originally visible. |
Constructor Summary | |
ImageScroller(java.awt.Image img,
Container container)
ImageScroller constructor. |
Method Summary | |
int |
getDelay()
Return delay between image scrolling. |
int |
getScrollDistance()
Return distance to scroll image. |
boolean |
isVisible()
Determine whether image is visible. |
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 |
setScrollDistance(int newScrollDistance)
Set the distance to scroll each time. |
void |
setVisible(boolean newVisible)
Setting to invisible will cause this thread to stop. |
void |
visit(RectangleHierarchy node)
Copy the appropriate image onto Graphics g at (x,y,width,height) taking into account the scrolling image. |
void |
visit(RectangleHierarchy node,
java.awt.Rectangle clip)
Copy the appropriate image onto Graphics g at (x,y,width,height) taking into account the scrolling image. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.awt.Image myImage
protected int delay
protected Container container
protected int edge
protected int scrollDistance
protected java.lang.Thread thread
protected boolean visible
Constructor Detail |
public ImageScroller(java.awt.Image img, Container container)
Method Detail |
public int getDelay()
public int getScrollDistance()
public boolean isVisible()
public void run()
run
in interface java.lang.Runnable
public void setDelay(int newDelay)
newDelay
- intpublic void setScrollDistance(int newScrollDistance)
newScrollDistance
- intpublic void setVisible(boolean newVisible)
newVisible
- booleanpublic void visit(RectangleHierarchy node)
public void visit(RectangleHierarchy node, java.awt.Rectangle clip)
Note: only Leaf nodes are drawn.
Note: In V2.1 fixed defect in missing clip argument to recursive calls!
Clip to the given Rectangle clip area. [clip is unaffected by this invocation.]
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |