com.jmex.bui.text
Class BText

java.lang.Object
  extended by com.jmex.bui.text.BText

public abstract class BText
extends Object

Contains a "run" of text. Specializations of this class render text in different ways, for example using JME's internal bitmapped font support or by using the AWT to render the run of text to an image and texturing a quad with that entire image.


Constructor Summary
BText()
           
 
Method Summary
abstract  int getCursorPos(int index)
          Returns the x position for the cursor at the specified character index.
abstract  int getHitPos(int x, int y)
          Returns the character position to which the cursor should be moved given that the user clicked the specified coordinate (relative to the text's bounds).
abstract  int getLength()
          Returns the length in characters of this text.
abstract  Dimension getSize()
          Returns the screen dimensions of this text.
abstract  void render(Renderer render, int x, int y, float alpha)
          Renders this text to the display.
 void render(Renderer render, int x, int y, int w, int h, float alpha)
          Optional rendering this text scaled to a certain height/width.
abstract  void wasAdded()
          Called when the component that contains this text is was added to the interface hierarchy.
abstract  void wasRemoved()
          Called when the component that contains this text is no longer part of a user interface hierarchy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BText

public BText()
Method Detail

getLength

public abstract int getLength()
Returns the length in characters of this text.


getSize

public abstract Dimension getSize()
Returns the screen dimensions of this text.


getHitPos

public abstract int getHitPos(int x,
                              int y)
Returns the character position to which the cursor should be moved given that the user clicked the specified coordinate (relative to the text's bounds).


getCursorPos

public abstract int getCursorPos(int index)
Returns the x position for the cursor at the specified character index. Note that the position should be "before" that character.


render

public abstract void render(Renderer render,
                            int x,
                            int y,
                            float alpha)
Renders this text to the display.


render

public void render(Renderer render,
                   int x,
                   int y,
                   int w,
                   int h,
                   float alpha)
Optional rendering this text scaled to a certain height/width.


wasAdded

public abstract void wasAdded()
Called when the component that contains this text is was added to the interface hierarchy.


wasRemoved

public abstract void wasRemoved()
Called when the component that contains this text is no longer part of a user interface hierarchy.



Copyright © 2008 Michael Bayne. All Rights Reserved.