|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.gui.Component
com.threerings.opengl.gui.Container
com.threerings.opengl.gui.ChatOverlay
public class ChatOverlay
A chat display for use as a HUD element.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.opengl.gui.Container |
|---|
Container.ChildOp |
| Field Summary | |
|---|---|
protected TextArea |
_area
The chat entry text area. |
protected Button |
_end
The less, more, and end buttons. |
protected Button |
_less
The less, more, and end buttons. |
protected Button |
_more
The less, more, and end buttons. |
protected MessageBundle |
_msgs
The bundle we use to translate messages. |
protected Color4f[] |
_systemColors
The colors to use for each system message level. |
| Fields inherited from class com.threerings.opengl.gui.Container |
|---|
_children, _layout |
| Fields inherited from class com.threerings.opengl.gui.Component |
|---|
_alpha, _backgrounds, _borders, _colors, _ctx, _cursor, _enabled, _height, _hover, _hoverable, _insets, _listeners, _parent, _preferredSize, _properties, _rect, _styleConfigs, _tipmouse, _tiptext, _tooltipStyle, _transferHandler, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES |
| Constructor Summary | |
|---|---|
ChatOverlay(GlContext ctx)
Creates a new chat overlay. |
|
| Method Summary | |
|---|---|
protected void |
appendMessage(ChatMessage msg,
String text,
Color4f color)
Appends a message to the text area. |
void |
clear()
|
boolean |
displayMessage(ChatMessage msg,
boolean alreadyDisplayed)
|
protected Color4f |
getColor(ChatMessage msg)
Returns the color to use for the supplied message, or null for the default. |
Component |
getHitComponent(int mx,
int my)
Returns the component "hit" by the specified mouse coordinates which might be this component or any of its children. |
void |
setBundle(String bundle)
Sets the bundle to use to translate chat messsages. |
void |
setEnabled(boolean enabled)
Sets this components enabled state. |
void |
setPreferredWidth(int width)
Sets the preferred width for the text area. |
void |
setSystemColors(Color4f info,
Color4f feedback,
Color4f attention)
Sets the colors to use for system chat messages. |
protected void |
updateButtons()
Updates the enabled status of the buttons. |
void |
validate()
Instructs this component to lay itself out and then mark itself as valid. |
protected void |
wasAdded()
This method is called when we are added to a hierarchy that is connected to a top-level window (at which point we can rely on having a look and feel and can set ourselves up). |
| Methods inherited from class com.threerings.opengl.gui.Container |
|---|
add, add, add, add, applyOperation, computePreferredSize, getComponent, getComponentCount, getComponentIndex, getDefaultStyleConfig, getFirstDescendantFocus, getLastDescendantFocus, getLayoutManager, getNextFocus, getPreviousFocus, layout, remove, remove, removeAll, renderComponent, replace, setAlpha, setHoverable, setLayoutManager, wasRemoved |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected MessageBundle _msgs
protected Color4f[] _systemColors
protected Button _less
protected Button _more
protected Button _end
protected TextArea _area
| Constructor Detail |
|---|
public ChatOverlay(GlContext ctx)
| Method Detail |
|---|
public void setBundle(String bundle)
public void setPreferredWidth(int width)
public void setSystemColors(Color4f info,
Color4f feedback,
Color4f attention)
public void clear()
clear in interface ChatDisplay
public boolean displayMessage(ChatMessage msg,
boolean alreadyDisplayed)
displayMessage in interface ChatDisplaypublic void setEnabled(boolean enabled)
Component
setEnabled in class Container
public Component getHitComponent(int mx,
int my)
Component
getHitComponent in class Containerpublic void validate()
Component
validate in class Containerprotected Color4f getColor(ChatMessage msg)
null for the default.
protected void appendMessage(ChatMessage msg,
String text,
Color4f color)
text - the formatted, newline-terminated text of the message.color - the color to use for the message, or null for the default.protected void updateButtons()
protected void wasAdded()
Component
wasAdded in class Container
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||