|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jogre.client.awt.JogrePanel
org.jogre.client.awt.ChatGameComponent
Little message component which can be used in several ways. These include boardcast message (all clients recieve messages), room messages (only users at a room/table) will recieve it and private message between 2 people.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
protected JTextField |
messageInput
Small message input box. |
protected JTextArea |
messageOutput
Main message ouput box. |
protected String |
usernameFrom
Sending username. |
protected String |
usernameTo
Receiving username. |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
ChatGameComponent(ClientConnectionThread conn,
int height)
Constructor for a message component. |
Method Summary | |
void |
receiveMessage(String messageFrom,
String message)
Receives a message from the server. |
protected void |
sendMessage()
Send a message. |
void |
setEnabled(boolean enabled)
Sets the enabled status of component and message input box. |
void |
setUsernameTo(String usernameTo)
Set the username to of this component (not required if the component is in broadcast mode). |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected JTextArea messageOutput
protected JTextField messageInput
protected String usernameFrom
protected String usernameTo
Constructor Detail |
public ChatGameComponent(ClientConnectionThread conn, int height)
height
- Hieght of the message component in rows.Method Detail |
public void setEnabled(boolean enabled)
Component.setEnabled(boolean)
public void setUsernameTo(String usernameTo)
usernameTo
- Username to send message to.protected void sendMessage()
public void receiveMessage(String messageFrom, String message)
messageFrom
- Who the message is from.message
- Text of the message.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |