jMobileCore toolkit

com.jmobilecore.ui
Class PropertyLabel

java.lang.Object
  extended by com.jmobilecore.ui.core.Component
      extended by com.jmobilecore.ui.core.Label
          extended by com.jmobilecore.ui.PropertyLabel

public class PropertyLabel
extends Label

Provides a component for displaying pair key-value on the screen. The key is displayed left-justified, the value is right-justified.

Author:
Greg Gridin

Field Summary
 java.lang.String key
          The key of this PropertyLabel.
 java.lang.String value
          The value of this PropertyLabel.
 
Fields inherited from class com.jmobilecore.ui.core.Label
text
 
Fields inherited from class com.jmobilecore.ui.core.Component
alignment, background, CENTER, focusable, focusedBackground, focusedForeground, font, foreground, height, isCompletelyVisible, isFocused, isVisible, LEFT, parentScreen, RIGHT, screenY, valid, width
 
Constructor Summary
PropertyLabel(java.lang.String key, java.lang.String value)
          Constructs a new PropertyLabel that presents the specified key and it's value displayed by default font
PropertyLabel(java.lang.String key, java.lang.String value, javax.microedition.lcdui.Font font)
          Constructs a new PropertyLabel that presents the specified key and it's value displayed by specified font
 
Method Summary
 void destructor()
          Default destructor.
 void paint(javax.microedition.lcdui.Graphics g)
          Paints the PropertyLabel to the screen.
 void setKey(java.lang.String key)
          Sets the key for this PropertyLabel to the specified string.
 void setLabel(java.lang.String key, java.lang.String value)
          Sets the key and the value for this PropertyLabel.
 void setValue(java.lang.String value)
          Sets the value for this PropertyLabel to the specified string.
 
Methods inherited from class com.jmobilecore.ui.core.Label
createTitleLabel, getText, setText
 
Methods inherited from class com.jmobilecore.ui.core.Component
getBackground, getFont, getForeground, getHeight, getWidth, invalidate, isFocusOwner, keyPressed, keyReleased, keyRepeated, paintBackground, pointerDragged, pointerPressed, pointerReleased, prepareForeground, releaseFocus, requestFocus, setFont, setHeight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

public java.lang.String key
The key of this PropertyLabel. The key is displayed on the left part of the screen

See Also:
setKey(String)

value

public java.lang.String value
The value of this PropertyLabel. The key is displayed on the right part of the screen

See Also:
setValue(String)
Constructor Detail

PropertyLabel

public PropertyLabel(java.lang.String key,
                     java.lang.String value)
Constructs a new PropertyLabel that presents the specified key and it's value displayed by default font

Parameters:
key - the key for this PropertyLabel. A null value will be accepted without causing a NullPointerException to be thrown. The text can be single line only. If text contains \n characters (used to indicate line breaks) then PropertyLabel will be displayed incorrectly
value - the value for this PropertyLabel. A null value will be accepted without causing a NullPointerException to be thrown. The text can be single line only. If text contains \n characters (used to indicate line breaks) then PropertyLabel will be displayed incorrectly

PropertyLabel

public PropertyLabel(java.lang.String key,
                     java.lang.String value,
                     javax.microedition.lcdui.Font font)
Constructs a new PropertyLabel that presents the specified key and it's value displayed by specified font

Parameters:
key - the key for this PropertyLabel. A null value will be accepted without causing a NullPointerException to be thrown. The text can be single line only. If text contains \n characters (used to indicate line breaks) then PropertyLabel will be displayed incorrectly
value - the value for this PropertyLabel. A null value will be accepted without causing a NullPointerException to be thrown. The text can be single line only. If text contains \n characters (used to indicate line breaks) then PropertyLabel will be displayed incorrectly
font - the PropertyLabel font
Method Detail

destructor

public void destructor()
Default destructor. Helps VM to perform garbage collection

Overrides:
destructor in class Component

paint

public void paint(javax.microedition.lcdui.Graphics g)
Paints the PropertyLabel to the screen.

Overrides:
paint in class Label
Parameters:
g - The Graphics object to render to.

setKey

public void setKey(java.lang.String key)
Sets the key for this PropertyLabel to the specified string.

Parameters:
key - the key for the PropertyLabel.

setLabel

public void setLabel(java.lang.String key,
                     java.lang.String value)
Sets the key and the value for this PropertyLabel.

Parameters:
key - the key for the PropertyLabel.
value - the value for the PropertyLabel.

setValue

public void setValue(java.lang.String value)
Sets the value for this PropertyLabel to the specified string.

Parameters:
value - the value for the PropertyLabel.

jMobileCore toolkit