|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.app.Listener
danger.ui.View
danger.ui.Container
danger.ui.Control
danger.ui.IconPicker
public class IconPicker
An IconPicker is a control that provides a way for the user to select from a set of icons. It is used, for example, in the address book application to allow the user to assign an icon to a contact.
| Field Summary | |
|---|---|
protected static int |
ARROW_HEIGHT
Deprecated. |
protected static int |
ARROW_WIDTH
Deprecated. |
protected static int |
DEFAULT_ICONS_COUNT
Deprecated. |
protected static int |
LARGE_ICON_CELL_SIZE
Deprecated. Unused. |
protected static int |
MAX_COLUMNS
Deprecated. |
protected static int |
MAX_ROWS
Deprecated. |
protected int |
mCurrentSelection
Deprecated. Use getCurrentSelection() instead. |
protected Object |
mEventArg
Deprecated. Use Control.setEvent(danger.app.Event) instead. |
protected int |
mEventData
Deprecated. Use Control.setEvent(danger.app.Event) instead. |
protected Listener |
mEventListener
Deprecated. Use Control.setEvent(danger.app.Event) instead. |
protected int |
mEventType
Deprecated. Use Control.setEvent(danger.app.Event) instead. |
protected int |
mIconCellHeight
Deprecated. Use setIconCellSize(int) and getIconCellHeight()
instead. |
protected int |
mIconCellWidth
Deprecated. Use setIconCellSize(int) and getIconCellWidth()
instead. |
protected Vector |
mItems
Deprecated. Use addIcon(danger.ui.Bitmap), removeIcon(int),
and getIconAt(int) instead. |
protected int |
mMaxColumns
Deprecated. Use setMaxColumns(int) and getMaxColumns()
instead. |
protected int |
mMaxRows
Deprecated. Use setMaxRows(int) and getMaxRows()
instead. |
protected IconPickerWindow |
mOpenWindow
Deprecated. |
protected Bitmap |
mPhotoPickerIcon
Deprecated. Use setPhotoPickerIconAndTitle(danger.ui.Bitmap, java.lang.String) instead. |
protected boolean |
mPhotoPickerSelected
Deprecated. Use getPhotoPickerSelected() instead. |
protected String |
mPhotoPickerTitle
Deprecated. Use setPhotoPickerIconAndTitle(danger.ui.Bitmap, java.lang.String) instead. |
protected PhotoRecord |
mPhotoRecord
Deprecated. Use getPhotoRecord() instead. |
protected static int |
SMALL_ICON_CELL_SIZE
Deprecated. Unused. |
| Fields inherited from class danger.ui.Control |
|---|
mValue |
| Constructor Summary | |
|---|---|
IconPicker()
Create an IconPicker with default number of columns and icon size. |
|
IconPicker(int maxColumns)
Create an IconPicker with the specifed number of columns and icon size. |
|
IconPicker(int maxColumns,
int iconCellSize)
Create an IconPicker with the specifed number of columns and icon size. |
|
| Method Summary | |
|---|---|
boolean |
addDefaultIcon(Bitmap inIcon)
Add a default icon to the picker. |
boolean |
addIcon(Bitmap inIcon)
Add an icon to the picker. |
boolean |
addIcon(Bitmap inIcon,
int inIconType)
Add an icon to the picker with a specified type. |
boolean |
addPhotoIcon(Bitmap inIcon)
Add a photo icon to the picker. |
boolean |
addPhotoPickerIcon()
Add a photo picker icon to the picker. |
boolean |
addPhotoPickerIcon(Bitmap inIcon)
Add a photo picker icon to the picker. |
void |
drawClosedIconPicker(Pen p)
|
void |
enterPicker()
|
boolean |
eventKeyUp(char inChar,
Event event)
Processes key releases directed at this container. |
boolean |
eventWidgetUp(int inWhichWidget,
Event event)
Handle the release of a device widget |
boolean |
getAllowDuplicates()
|
Bitmap |
getClippedPhoto()
Get the selected photo clipped to be square. |
int |
getCurrentSelection()
Get the index of the currently selected icon. |
int |
getDefaultIconIndex()
Get the index of the default icon. |
Listener |
getEventListener()
|
int |
getFirstNormalIconIndex()
Get the index of the first normal icon. |
Bitmap |
getIconAt(int inIndex)
Get the icon at the specified index. |
int |
getIconCellHeight()
Get the icon height for the picker icons. |
int |
getIconCellWidth()
Get the icon width for the picker icons. |
int |
getIconCount()
Get the number of icons currently in the picker. |
int |
getIconIndex(int inIconType)
Get the index of the icon of specified type. |
int |
getIconTypeAt(int inIndex)
Get the type of the icon at the specified index. |
int |
getMaxColumns()
Get the maximum number of columns per row for the picker. |
int |
getMaxRows()
Get the maximum number of rows before scrolling. |
int |
getNormalIconIndex()
Get the normal icon index. |
Bitmap |
getPhoto()
Get the selected photo. |
int |
getPhotoIconIndex()
Get the index of the photo icon. |
int |
getPhotoPickerIconIndex()
Get the index of the photo picker icon. |
protected boolean |
getPhotoPickerSelected()
Determine whether the photo picker was selected. |
PhotoRecord |
getPhotoRecord()
Get the selected photo record. |
Bitmap |
getScaledPhoto(int width,
int height)
Get selected photo scaled to specified width and height. |
protected void |
handlePhotoSelect(PhotoRecordIPCPayload records)
|
int |
iconCount()
Deprecated. use getIconCount() |
void |
insertIcon(Bitmap inIcon,
int inIndex)
Insert an icon before icon at index. |
void |
insertIcon(Bitmap inIcon,
int inIndex,
int inIconType)
Insert an icon of specified type before icon at index. |
protected void |
onHandleSelect()
|
void |
paint(Pen p)
Draw the contents of this View. |
boolean |
photoChanged()
Get the state of the photo icon. |
boolean |
receiveEvent(Event e)
Entry point for event processing. |
void |
removeAllItems()
Remove all icons from the picker. |
void |
removeIcon(Bitmap inIcon)
Remove specified icon. |
void |
removeIcon(int index)
Remove icon at index. |
void |
setAllowDuplicates(boolean allow)
|
void |
setIcon(Bitmap inIcon,
int inIndex)
Replace the icon at index. |
void |
setIcon(Bitmap inIcon,
int inIndex,
int inIconType)
Replace the icon and type at index. |
void |
setIconCellSize(int iconCellSize)
Set the icon size for the picker icons. |
void |
setIconCellSize(int cellWidth,
int cellHeight)
Set the icon height and width for the picker icons. |
void |
setMaxColumns(int maxColumns)
Set the maximum number of columns per row for the picker. |
void |
setMaxRows(int maxRows)
Set the maximum number of rows before scrolling. |
void |
setPhotoPickerIconAndTitle(Bitmap inIcon,
String inTitle)
Set photo picker icon and title. |
void |
showPhotoPicker(Bitmap inIcon,
String inTitle)
Show the photo picker. |
| Methods inherited from class danger.ui.Control |
|---|
drawFocusBox, drawIdleBox, drawIdleBox, getBaseline, getEvent, getEventType, getHasBorder, getMaxToolTipLines, getTitle, getTitleSequence, getToolTip, getValue, hasToolTip, loseFocus, onSetHasBorder, onSetTitle, sendEvent, setEvent, setEvent, setEvent, setEvent, setEvent, setEventArg, setEventListener, setHasBorder, setMaxToolTipLines, setTitle, setTitle, setToolTip, setValue, showToolTip, takeFocus |
| Methods inherited from class danger.app.Listener |
|---|
cancelEvents, childEventPump, childEventPumpDone, eventProblem, isDispatchingThread, sendEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendLowPriorityEvent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected IconPickerWindow mOpenWindow
protected Vector mItems
addIcon(danger.ui.Bitmap), removeIcon(int),
and getIconAt(int) instead.protected int mCurrentSelection
getCurrentSelection() instead.protected int mMaxColumns
setMaxColumns(int) and getMaxColumns()
instead.protected int mMaxRows
setMaxRows(int) and getMaxRows()
instead.protected int mIconCellWidth
setIconCellSize(int) and getIconCellWidth()
instead.protected int mIconCellHeight
setIconCellSize(int) and getIconCellHeight()
instead.protected PhotoRecord mPhotoRecord
getPhotoRecord() instead.protected Bitmap mPhotoPickerIcon
setPhotoPickerIconAndTitle(danger.ui.Bitmap, java.lang.String) instead.protected String mPhotoPickerTitle
setPhotoPickerIconAndTitle(danger.ui.Bitmap, java.lang.String) instead.protected boolean mPhotoPickerSelected
getPhotoPickerSelected() instead.protected int mEventType
Control.setEvent(danger.app.Event) instead.protected int mEventData
Control.setEvent(danger.app.Event) instead.protected Object mEventArg
Control.setEvent(danger.app.Event) instead.protected Listener mEventListener
Control.setEvent(danger.app.Event) instead.protected static final int LARGE_ICON_CELL_SIZE
protected static final int SMALL_ICON_CELL_SIZE
protected static final int DEFAULT_ICONS_COUNT
protected static final int MAX_COLUMNS
protected static final int MAX_ROWS
protected static final int ARROW_WIDTH
protected static final int ARROW_HEIGHT
| Constructor Detail |
|---|
public IconPicker()
public IconPicker(int maxColumns)
maxColumns - Maximum number of columns per row.
public IconPicker(int maxColumns,
int iconCellSize)
maxColumns - Maximum number of columns per row.iconCellSize - Height and width (in pixels) of icons in picker.| Method Detail |
|---|
public void setMaxColumns(int maxColumns)
Set the maximum number of columns per row for the picker.
The default number of columns is 4.
maxColumns - Maximum number of columns per row.public void setMaxRows(int maxRows)
Set the maximum number of rows before scrolling.
The default number of rows is 4.
maxRows - Maximum number of rows before scrolling.public final int getMaxRows()
setMaxRows(int)public final int getMaxColumns()
setMaxColumns(int)public void setIconCellSize(int iconCellSize)
iconCellSize - Height and width of icons in pixels.
public void setIconCellSize(int cellWidth,
int cellHeight)
cellWidth - Width of icons in pixels.cellHeight - Height of icon in pixels.public int getIconCellWidth()
public int getIconCellHeight()
public void setAllowDuplicates(boolean allow)
public boolean getAllowDuplicates()
public int getIconCount()
public int iconCount()
public final boolean addIcon(Bitmap inIcon)
inIcon - Icon to be added.
public final boolean addIcon(Bitmap inIcon,
int inIconType)
inIcon - Icon to be added.inIconType - Type of icon to be added.
public final boolean addPhotoIcon(Bitmap inIcon)
inIcon - Icon to be added.
public final boolean addPhotoPickerIcon()
public final boolean addPhotoPickerIcon(Bitmap inIcon)
inIcon - The icon to be used.
public final boolean addDefaultIcon(Bitmap inIcon)
inIcon - The icon to be used.
public final void setIcon(Bitmap inIcon,
int inIndex)
inIcon - New icon to use.inIndex - Index of icon to replace.
public final void setIcon(Bitmap inIcon,
int inIndex,
int inIconType)
inIcon - New icon to use.inIndex - Index of icon to replace.inIconType - Type of icon.
public final void insertIcon(Bitmap inIcon,
int inIndex)
inIcon - Icon to insert.inIndex - Index of icon to insert before.
public final void insertIcon(Bitmap inIcon,
int inIndex,
int inIconType)
inIcon - Icon to insert.inIndex - Index of icon to insert before.inIconType - Type of icon to be inserted.public final void removeIcon(int index)
index - Index of icon to be removed.public final void removeIcon(Bitmap inIcon)
inIcon - Icon to be removed.public final void removeAllItems()
public final Bitmap getIconAt(int inIndex)
inIndex - Index of icon.
public final int getIconTypeAt(int inIndex)
inIndex - Index of icon.
public final int getIconIndex(int inIconType)
inIconType - Type of icon.
public int getDefaultIconIndex()
public int getPhotoIconIndex()
public int getPhotoPickerIconIndex()
public int getNormalIconIndex()
public int getFirstNormalIconIndex()
protected void onHandleSelect()
protected final boolean getPhotoPickerSelected()
Determine whether the photo picker was selected.
You can call this method from within onHandleSelect()
to determine if the user has selected the photo picker.
protected void handlePhotoSelect(PhotoRecordIPCPayload records)
public boolean photoChanged()
public PhotoRecord getPhotoRecord()
public Bitmap getPhoto()
public Bitmap getClippedPhoto()
public Bitmap getScaledPhoto(int width,
int height)
width - Width in pixels of returned photo.height - Height in pixels of returned photo.
public void paint(Pen p)
ViewThe implementation of this method in this class will merely call
clear() pen, if this View is opaque (not transparent),
and will do nothing otherwise. If you don't need this behavior, then
there is no point in calling super.paint() in an
overriding method.
paint in class Containerp - non-null; the pen to use for drawing operationspublic boolean receiveEvent(Event e)
ListenerDispatcher when it reads an Event in its queue
that is targetted at this instance. The default behavior is to
do nothing and return false. Subclasses are expected
to override this method to do something more useful.
receiveEvent in class Containere - non-null; the event to process
true) or not (false) this
method actually handled the event to completionpublic void drawClosedIconPicker(Pen p)
public boolean eventWidgetUp(int inWhichWidget,
Event event)
Container
eventWidgetUp in class ContainerinWhichWidget - the widget that went down
public boolean eventKeyUp(char inChar,
Event event)
Container
eventKeyUp in class ContainerinChar - the character being released.public final void enterPicker()
public final int getCurrentSelection()
public Listener getEventListener()
getEventListener in class Control
public void setPhotoPickerIconAndTitle(Bitmap inIcon,
String inTitle)
inIcon - Icon to be displayed (default is application icon).inTitle - Title to be displayed.
public void showPhotoPicker(Bitmap inIcon,
String inTitle)
inIcon - Icon to be displayed (default is application icon).inTitle - Title to be displayed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||