org.jrabbit.standard.profiler.entities.base
Class TextProfilerEntity

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.base.TextProfilerEntity
All Implemented Interfaces:
Renderable, Referenced, Dimensioned, Visible, ProfilerEntity
Direct Known Subclasses:
ProfilerMessages, SystemInfo

public class TextProfilerEntity
extends FontBasedProfilerEntity

A TextProfilerEntity extends FontBasedProfilerEntity to create a ProfilerEntity that renders lines of text.

Author:
Chris Molini

Field Summary
protected  java.lang.String[] text
          The lines of text.
protected  float[] widths
          The recorded width of all lines of text.
 
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
TextProfilerEntity(java.lang.String reference, java.lang.String... text)
          Creates a TextProfilerEntity with the indicated text.
 
Method Summary
 java.lang.String getText(int place)
          Accesses one of the lines of text.
 void render()
          Renders the text.
 void setText(int place, java.lang.String line)
          Changes one line of text.
 void setText(java.lang.String... text)
          Redefines all of the text.
protected  void updateDimensions()
          Recalculates the width and height of the whole 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

text

protected java.lang.String[] text
The lines of text.


widths

protected float[] widths
The recorded width of all lines of text.

Constructor Detail

TextProfilerEntity

public TextProfilerEntity(java.lang.String reference,
                          java.lang.String... text)
Creates a TextProfilerEntity with the indicated text.

Parameters:
reference - The identifier of this ProfilerEntity.
text - The text to display.
Method Detail

getText

public java.lang.String getText(int place)
Accesses one of the lines of text.

Parameters:
place - The number of the line of text to access.
Returns:
The String that represents the indicated line of text.

setText

public void setText(int place,
                    java.lang.String line)
Changes one line of text. This does not affect any other lines.

Parameters:
place - The number of the line of text to change.
line - The new line to display.

setText

public void setText(java.lang.String... text)
Redefines all of the text.

Parameters:
text - The new text to display.

updateDimensions

protected void updateDimensions()
Recalculates the width and height of the whole ProfilerEntity.


render

public void render()
Renders the text.