|
Internet Chess ToolKit v0.2.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectictk.boardgame.chess.net.ics.ICSEventRouter
Routes ICSEvent messages to ICSEventListeners. It is possible to use one router for many live connections to different servers. At least that's an intended goal.
Constructor Summary | |
ICSEventRouter()
|
Method Summary | |
void |
addBoardListener(ICSEventListener eh,
int boardNumber,
int type)
adding this type of listener will subscribe the listener to the following types of events for this board number: type 1: board updates, moves forward and back, resignations type 2: takeback requests, draw offers, adjourn and pause requests type 3: kibitzes, whispers, and board says NOTE: all types must be registered independently |
void |
addChannelListener(int channelType,
int channelNumber,
ICSEventListener eh)
adds a listener to a particular channel. |
void |
addEventListener(int icsEventNumber,
ICSEventListener eh)
tells the router that this listener would like to hear a particular type of event. |
void |
dispatch(ICSEvent evt)
an event sent to this method will be relayed to all the listeners who are interested in it. |
ICSEventListener |
getDefaultListener()
This listener receives all message that are not exclusively processed by some other listener. |
boolean |
isChannelExclusive(int channelType,
int channelNumber)
are channel events for this channel only routed to this channel's listener(s), or are they also send to the CHANNEL_EVENT listener. |
boolean |
isExclusive(int eventType)
|
void |
removeChannelListener(int channelType,
int channelNumber,
ICSEventListener eh)
removes a listener to a particular channel. |
void |
setChannelExclusive(int channelType,
int channelNumber,
boolean t)
are channel events for this channel only routed to this channel's listener(s), or are they also send to the CHANNEL_EVENT listener. |
void |
setDefaultListener(ICSEventListener eh)
This listener receives all message that are not exclusively processed by some other listener. |
void |
setExclusive(int eventType,
boolean t)
should the event be routed only to listeners subscribed to this event, or also to the default listener. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ICSEventRouter()
Method Detail |
public void setDefaultListener(ICSEventListener eh)
public ICSEventListener getDefaultListener()
public void dispatch(ICSEvent evt)
public void addEventListener(int icsEventNumber, ICSEventListener eh)
icsEventNumber
- an ICSEvent.public void setExclusive(int eventType, boolean t)
t
- if true then the default listener will not receive the
event even if there are no listeners for this event.public boolean isExclusive(int eventType)
public void addBoardListener(ICSEventListener eh, int boardNumber, int type)
public void addChannelListener(int channelType, int channelNumber, ICSEventListener eh)
channelType
- is the EventType for this sort of channel. For
example: ICSEvent.CHANNEL_EVENT is for normal
channel tells, ICSEvent.SHOUT_EVENT is for
shouts.channelNumber
- is number of the channel, or in the case of
shouts is the type of shout.public void removeChannelListener(int channelType, int channelNumber, ICSEventListener eh)
channelType
- is the EventType for this sort of channel. For
example: ICSEvent.CHANNEL_EVENT is for normal
channel tells, ICSEvent.SHOUT_EVENT is for
shouts.channelNumber
- is number of the channel, or in the case of
shouts is the type of shout.public void setChannelExclusive(int channelType, int channelNumber, boolean t)
public boolean isChannelExclusive(int channelType, int channelNumber)
|
Submit a bug or feature Visit the Website Internet Chess ToolKit is licensed under the GPL v2 . |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |