|
Babylon Java Chat | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.lang.Thread
BabylonImageTransfer
public class BabylonImageTransfer
A class for transferring canvas images by the client or server as a separate thread. The benefit here being that the data can be sent in atomic blocks instead of one large command. This is also necessary for large images because as of protocol 2.2, connections will terminate if new commands are not received for a few seconds, and a large image from the 2.1 protocol can monopolize the stream for a considerable time.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected static int |
DEFAULT_BLOCKSIZE
|
protected int |
fromId
|
protected boolean |
gotAll
|
protected java.lang.String |
imageName
|
protected boolean |
priv
|
protected boolean |
stop
|
protected short |
xCoord
|
protected short |
yCoord
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
BabylonImageTransfer(int f,
java.lang.String n,
short x,
short y,
int ts,
int tb,
int bs,
java.util.Vector tc,
int[] r,
BabylonPanel p,
BabylonProgressDialog pd)
|
|
| Method Summary | |
|---|---|
protected byte[] |
getImageAll()
Get the whole image as a single byte array. |
protected void |
putImageAll(byte[] data)
Store the whole image, broken up into blocks. |
protected void |
putImageBlock(int blockNumber,
byte[] data)
Store the requested block. |
void |
run()
Sends image data out to any recipients when it has all been collected, and if we are a client receiving the image, paste it onto the canvas. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final int DEFAULT_BLOCKSIZE
protected int fromId
protected java.lang.String imageName
protected short xCoord
protected short yCoord
protected boolean stop
protected boolean gotAll
protected boolean priv
| Constructor Detail |
|---|
public BabylonImageTransfer(int f,
java.lang.String n,
short x,
short y,
int ts,
int tb,
int bs,
java.util.Vector tc,
int[] r,
BabylonPanel p,
BabylonProgressDialog pd)
| Method Detail |
|---|
public void run()
run in interface java.lang.Runnablerun in class java.lang.Thread
protected void putImageBlock(int blockNumber,
byte[] data)
throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsExceptionprotected void putImageAll(byte[] data)
protected byte[] getImageAll()
throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
|
Babylon Java Chat | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||