org.jrabbit.standard.profiler.entities.standard
Class ProfilerMessage

java.lang.Object
  extended by org.jrabbit.standard.profiler.entities.base.BaseProfilerEntity
      extended by org.jrabbit.standard.profiler.entities.base.FontBasedProfilerEntity
          extended by org.jrabbit.standard.profiler.entities.standard.ProfilerMessage
All Implemented Interfaces:
Renderable, ChangeListener, Referenced, Dimensioned, Visible, ProfilerEntity

public class ProfilerMessage
extends FontBasedProfilerEntity
implements ChangeListener

A ProfilerMessage is a ProfilerEntity that display the contents of ONE Message. It is synced to the Message automatically, so that whenever its message changes, it is updated appropriately. Keep in mind that to show the combined info of multiple Messages, the class ProfilerMessages (plural) should be used instead.

Author:
Chris Molini

Field Summary
protected  Message controller
          The Message being represented.
 
Fields inherited from class org.jrabbit.standard.profiler.entities.base.FontBasedProfilerEntity
fontPointer
 
Fields inherited from class org.jrabbit.standard.profiler.entities.base.BaseProfilerEntity
height, reference, visible, width
 
Constructor Summary
ProfilerMessage(Message controller)
          Creates a ProfilerMessage that displays the text of the supplied Message.
 
Method Summary
 void alertChange()
          Alerts the ProfilerMessage that the message has changed and it needs to recalculate its dimensions.
 Message controller()
          Accesses the Message currently being rendered.
 void render()
          Renders the Message.
 void setController(Message controller)
          Redefines the current Message.
protected  void updateDimensions()
          Recalculates the dimensions of this ProfilerEntity.
 
Methods inherited from class org.jrabbit.standard.profiler.entities.base.FontBasedProfilerEntity
fontPointer
 
Methods inherited from class org.jrabbit.standard.profiler.entities.base.BaseProfilerEntity
height, reference, setVisible, visible, width
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controller

protected Message controller
The Message being represented.

Constructor Detail

ProfilerMessage

public ProfilerMessage(Message controller)
Creates a ProfilerMessage that displays the text of the supplied Message. NOTE: The reference of the created ProfilerMessage is the same as the reference of the supplied Message.

Parameters:
controller - The Message to render.
Method Detail

controller

public Message controller()
Accesses the Message currently being rendered.

Returns:
The current Message.

setController

public void setController(Message controller)
Redefines the current Message.

Parameters:
controller - The new Message to render.

updateDimensions

protected void updateDimensions()
Recalculates the dimensions of this ProfilerEntity.


alertChange

public void alertChange()
Alerts the ProfilerMessage that the message has changed and it needs to recalculate its dimensions.

Specified by:
alertChange in interface ChangeListener

render

public void render()
Renders the Message.

Specified by:
render in interface Renderable