Saros
Distributed Collaborative Editing and Distributed Party Programming
|
Public Member Functions | |
ChangeColorManager (ISarosSession sarosSession, EditorManager editorManager, ColorIDSetStorage colorIDSetStorage) | |
synchronized void | start () |
synchronized void | stop () |
synchronized Set< Integer > | getUsedColorIDs () |
void | changeColorID (int colorID) |
This manager is responsible for handling color changes and managing the currently available colors. It both produces and consumes activities.
de.fu_berlin.inf.dpp.project.internal.ChangeColorManager.ChangeColorManager | ( | ISarosSession | sarosSession, |
EditorManager | editorManager, | ||
ColorIDSetStorage | colorIDSetStorage | ||
) |
void de.fu_berlin.inf.dpp.project.internal.ChangeColorManager.changeColorID | ( | int | colorID | ) |
Changes the color id for the current local user. The change is done asynchronously and may not be available immediately. Negative color id values will result in the next available color id.
colorID | the new color ID for the current session |
6, Creating a new Activity type, Create activity instances of your new type:
Now you are prepared to make use of your new activity type: Find a place in the business logic where to react on the events you want to send as an Activity to the other session participants. However, it is not unusual to create that piece of business logic anew.
Anyway, once you found a place where to wait for certain things to happen, you can create new activity instances of your type there and hand them over to fireActivity() -- assuming your business logic class extends DefaultActivityProducer, of course. That's all for the sender's side.
synchronized Set<Integer> de.fu_berlin.inf.dpp.project.internal.ChangeColorManager.getUsedColorIDs | ( | ) |
Returns a snapshot of the currently in use color IDs.
synchronized void de.fu_berlin.inf.dpp.project.internal.ChangeColorManager.start | ( | ) |
8, Creating a new Activity type, Arming your consumer:
To ensure your newly created consumer actually receives incoming activities, you need to register it on the session. That's it :)
synchronized void de.fu_berlin.inf.dpp.project.internal.ChangeColorManager.stop | ( | ) |