|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.tribe.demos.draw.WhiteBoard
Shared whiteboard, each new instance joins the same group. Each instance chooses a random color, mouse moves are broadcast to all group members, which then apply them to their canvas
Nested Class Summary | |
private class |
WhiteBoard.DrawPanel
This class defines a DrawPanel used for handling mouse events and display. |
Field Summary | |
private java.awt.Color |
backgroundColor
|
private ReliableGroupChannelWithGms |
channel
|
private javax.swing.JButton |
clearButton
|
(package private) boolean |
cummulative
|
private java.awt.Font |
defaultFont
|
private java.awt.Color |
drawColor
|
(package private) boolean |
first
|
private static java.lang.String |
GROUP_NAME
|
private javax.swing.JButton |
leaveButton
|
private javax.swing.JFrame |
mainFrame
|
private int |
memberSize
|
private WhiteBoard.DrawPanel |
panel
|
private java.util.Random |
random
|
private javax.swing.JPanel |
subPanel
|
Constructor Summary | |
WhiteBoard()
Creates a new WhiteBoard object |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
clearPanel()
Clear the panel |
void |
go()
Join the group, create the frame and listen for events. |
static void |
main(java.lang.String[] args)
Starts the WhiteBoard application. |
void |
mainLoop()
Main loop handling incoming messages. |
private java.awt.Color |
selectColor()
Randomly chooses a color. |
void |
sendClearPanelMsg()
Send the clear panel order to other members. |
(package private) void |
setTitle()
Set the windows title |
(package private) void |
setTitle(java.lang.String title)
Set the windows title. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String GROUP_NAME
private ReliableGroupChannelWithGms channel
private int memberSize
boolean first
boolean cummulative
private javax.swing.JFrame mainFrame
private javax.swing.JPanel subPanel
private WhiteBoard.DrawPanel panel
private javax.swing.JButton clearButton
private javax.swing.JButton leaveButton
private java.util.Random random
private final java.awt.Font defaultFont
private java.awt.Color drawColor
private java.awt.Color backgroundColor
Constructor Detail |
public WhiteBoard() throws java.lang.Exception
WhiteBoard
object
java.lang.Exception
- if an error occursMethod Detail |
public static void main(java.lang.String[] args)
args
- not usedprivate java.awt.Color selectColor()
public void go() throws java.lang.Exception
java.lang.Exception
- if an error occursvoid setTitle(java.lang.String title)
title
- title to set.void setTitle()
public void mainLoop()
public void clearPanel()
public void sendClearPanelMsg()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
ActionListener.actionPerformed(java.awt.event.ActionEvent)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |