com.jmex.bui
Class BTextComponent

java.lang.Object
  extended by com.jmex.bui.BComponent
      extended by com.jmex.bui.BTextComponent
Direct Known Subclasses:
BLabel, BTextField

public abstract class BTextComponent
extends BComponent

Defines methods and mechanisms common to components that render a string of text.


Field Summary
protected  ColorRGBA[] _effcols
           
protected  int[] _effsizes
           
protected  int[] _haligns
           
protected  int[] _lineSpacings
           
protected  int[] _teffects
           
protected  BTextFactory[] _textfacts
           
protected  int[] _valigns
           
 
Fields inherited from class com.jmex.bui.BComponent
_alpha, _backgrounds, _bbuf, _borders, _colors, _cursor, _enabled, _height, _hover, _insets, _listeners, _parent, _preferredSize, _properties, _styleClass, _tipmouse, _tipStyle, _tiptext, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES
 
Constructor Summary
BTextComponent()
           
 
Method Summary
protected  int[] checkNonDefault(int[] styles, int defval)
           
protected  int[] checkNonDefaultInt(int[] styles, int defval)
           
protected  int[] checkNonDefaultVal(int[] styles, int defval1, int defval2)
           
protected  void configureStyle(BStyleSheet style)
          Instructs this component to fetch its style configuration from the supplied style sheet.
 ColorRGBA getEffectColor()
          Returns the color to use for our text effect.
 int getEffectSize()
          Returns the effect size for this component's text.
 int getHorizontalAlignment()
          Returns the horizontal alignment for this component's text.
protected  Label.Config getLabelConfig(Label forLabel, int twidth)
          Creates a text configuration for the supplied label (for which we are by definition acting as container).
 int getLineSpacing()
          Returns the line spacing for our text.
abstract  String getText()
          Returns the text currently being displayed by this component.
 int getTextEffect()
          Returns the effect for this component's text.
 BTextFactory getTextFactory()
          Returns a text factory suitable for creating text in the style defined by the component's current state.
protected  BTextFactory getTextFactory(Label forLabel)
          Returns the text factory that should be used by the supplied label (for which we are by definition acting as container) to generate its text.
 int getVerticalAlignment()
          Returns the vertical alignment for this component's text.
abstract  void setText(String text)
          Updates the text displayed by this component.
 
Methods inherited from class com.jmex.bui.BComponent
acceptsFocus, addListener, applyDefaultStates, boundsToString, changeCursor, computePreferredSize, createTooltipComponent, dispatchEvent, emitEvent, getAbsoluteX, getAbsoluteY, getAlpha, getBackground, getBorder, getBounds, getColor, getCursor, getDefaultStyleClass, getFocusTarget, getHeight, getHitComponent, getInsets, getNextFocus, getParent, getPreferredSize, getPreviousFocus, getProperty, getState, getStateCount, getStatePseudoClass, getStyleClass, getTooltipText, getWidth, getWindow, getX, getY, hasFocus, intersectScissorBox, invalidate, isAdded, isEnabled, isShowing, isTooltipRelativeToMouse, isValid, isVisible, layout, removeAllListeners, removeListener, render, renderBackground, renderBorder, renderComponent, requestFocus, restoreScissorState, setAlpha, setBackground, setBounds, setCursor, setEnabled, setLocation, setParent, setPreferredSize, setPreferredSize, setProperty, setSize, setStyleClass, setTooltipRelativeToMouse, setTooltipText, setVisible, stateDidChange, updateCursor, validate, wasAdded, wasRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_haligns

protected int[] _haligns

_valigns

protected int[] _valigns

_teffects

protected int[] _teffects

_effsizes

protected int[] _effsizes

_lineSpacings

protected int[] _lineSpacings

_effcols

protected ColorRGBA[] _effcols

_textfacts

protected BTextFactory[] _textfacts
Constructor Detail

BTextComponent

public BTextComponent()
Method Detail

setText

public abstract void setText(String text)
Updates the text displayed by this component.


getText

public abstract String getText()
Returns the text currently being displayed by this component.


getTextFactory

public BTextFactory getTextFactory()
Returns a text factory suitable for creating text in the style defined by the component's current state.


getHorizontalAlignment

public int getHorizontalAlignment()
Returns the horizontal alignment for this component's text.


getVerticalAlignment

public int getVerticalAlignment()
Returns the vertical alignment for this component's text.


getTextEffect

public int getTextEffect()
Returns the effect for this component's text.


getEffectSize

public int getEffectSize()
Returns the effect size for this component's text.


getEffectColor

public ColorRGBA getEffectColor()
Returns the color to use for our text effect.


getLineSpacing

public int getLineSpacing()
Returns the line spacing for our text.


configureStyle

protected void configureStyle(BStyleSheet style)
Description copied from class: BComponent
Instructs this component to fetch its style configuration from the supplied style sheet. This method is called when a component is added to the interface hierarchy.

Overrides:
configureStyle in class BComponent

getTextFactory

protected BTextFactory getTextFactory(Label forLabel)
Returns the text factory that should be used by the supplied label (for which we are by definition acting as container) to generate its text.


getLabelConfig

protected Label.Config getLabelConfig(Label forLabel,
                                      int twidth)
Creates a text configuration for the supplied label (for which we are by definition acting as container).


checkNonDefault

protected int[] checkNonDefault(int[] styles,
                                int defval)

checkNonDefaultInt

protected int[] checkNonDefaultInt(int[] styles,
                                   int defval)

checkNonDefaultVal

protected int[] checkNonDefaultVal(int[] styles,
                                   int defval1,
                                   int defval2)


Copyright © 2008 Michael Bayne. All Rights Reserved.