public class DisplayWidget extends MapWidget2
Modifier and Type | Class and Description |
---|---|
static interface |
DisplayWidget.OnDisplayColorChangedListener |
static interface |
DisplayWidget.OnDisplayHasBackgroundChangedListener |
static interface |
DisplayWidget.OnDisplayTextChangedListener |
static interface |
DisplayWidget.OnHasIconChangedListener |
MapWidget2.OnWidgetSizeChangedListener
MapWidget.Factory, MapWidget.OnClickListener, MapWidget.OnLongPressListener, MapWidget.OnMoveListener, MapWidget.OnPressListener, MapWidget.OnUnpressListener, MapWidget.OnVisibleChangedListener, MapWidget.OnWidgetPointChangedListener
Modifier and Type | Field and Description |
---|---|
protected MapTextFormat |
_textFormat |
protected int |
background |
static int |
TRANSLUCENT |
Constructor and Description |
---|
DisplayWidget(java.lang.String text,
MapTextFormat textFormat,
int icon,
int background,
MapView mapView) |
Modifier and Type | Method and Description |
---|---|
void |
addOnDisplayChangedListener(DisplayWidget.OnDisplayTextChangedListener l) |
void |
addOnDisplayColorChangedListener(DisplayWidget.OnDisplayColorChangedListener l) |
void |
addOnDisplayHasBackgroundChangedListener(DisplayWidget.OnDisplayHasBackgroundChangedListener l) |
int |
getBackground() |
int |
getColor()
Get the first color in the color array or white if the color is not set.
|
int |
getColor(int lineNumber)
Returns the color of a line.
|
int[] |
getColors() |
Icon |
getIcon() |
int |
getLineCount() |
java.lang.String |
getText()
Get the text for the DisplayWidget.
|
MapTextFormat |
getTextFormat() |
protected void |
onDisplayTextChanged() |
void |
orientationChanged()
Subclass to allow for a new x,y,height,width to be computed when the orientation
has changed.
|
protected void |
recalcSize() |
void |
removeOnDisplayChangedListener(DisplayWidget.OnDisplayTextChangedListener l) |
void |
removeOnDisplayColorChangedListener(DisplayWidget.OnDisplayColorChangedListener l) |
void |
removeOnDisplayHasBackgroundChangedListener(DisplayWidget.OnDisplayHasBackgroundChangedListener l) |
void |
setBackground(int background)
Should be set to true if the DisplayWidget needs to render a background.
|
void |
setColor(int color) |
void |
setColors(int[] colors)
An array of the colors with each postition in the array corresponding to a line in the text.
|
void |
setIcon(int icon) |
void |
setText(java.lang.String text)
Set the test for the widget.
|
void |
setTextFormat(MapTextFormat textFormat) |
addOnWidgetSizeChangedListener, getSize, onSizeChanged, removeOnWidgetSizeChangedListener, seekHit, seekHit, seekWidgetHit, testHit
addOnClickListener, addOnHoverListener, addOnLongPressListener, addOnMoveListener, addOnPressListener, addOnUnpressListener, addOnVisibleChangedListener, addOnWidgetPointChangedListener, equals, getAbsolutePath, getAbsolutePosition, getAbsoluteWidgetPosition, getHeight, getMargins, getName, getPadding, getParent, getPointX, getPointY, getPropertyValue, getSize, getWidth, getZOrder, hashCode, isEnterable, isTouchable, isVisible, onClick, onClick, onHover, onLongPress, onMove, onMove, onPointChanged, onPress, onPress, onUnpress, onUnpress, onVisibleChanged, registerForwardedListener, removeOnClickListener, removeOnHoverListener, removeOnLongPressListener, removeOnMoveListener, removeOnPressListener, removeOnUnpressListener, removeOnVisibleChangedListener, removeOnWidgetPointChangedListener, setHeight, setMargins, setName, setPadding, setPadding, setParent, setPoint, setSize, setTouchable, setVisible, setWidth, setZOrder, unregisterForwardedListener, visitPropertyInfos
protected MapTextFormat _textFormat
protected int background
public static final int TRANSLUCENT
public DisplayWidget(java.lang.String text, MapTextFormat textFormat, int icon, int background, MapView mapView)
public void addOnDisplayChangedListener(DisplayWidget.OnDisplayTextChangedListener l)
public void removeOnDisplayChangedListener(DisplayWidget.OnDisplayTextChangedListener l)
public void addOnDisplayColorChangedListener(DisplayWidget.OnDisplayColorChangedListener l)
public void removeOnDisplayColorChangedListener(DisplayWidget.OnDisplayColorChangedListener l)
public void addOnDisplayHasBackgroundChangedListener(DisplayWidget.OnDisplayHasBackgroundChangedListener l)
public void removeOnDisplayHasBackgroundChangedListener(DisplayWidget.OnDisplayHasBackgroundChangedListener l)
public int getLineCount()
public void setText(java.lang.String text)
text
- The text to be contained in the Widget.public void setColor(int color)
public void setColors(int[] colors)
colors
- an integer array that contains the int color values for each line.public int getColor()
public int getColor(int lineNumber)
lineNumber
- A zero based index for the linepublic int[] getColors()
public void setIcon(int icon)
public void setBackground(int background)
background
- the background to be used for rendering the widget.public int getBackground()
public java.lang.String getText()
public Icon getIcon()
public void setTextFormat(MapTextFormat textFormat)
public MapTextFormat getTextFormat()
protected void onDisplayTextChanged()
protected void recalcSize()
public void orientationChanged()
MapWidget
orientationChanged
in class MapWidget