org.arakhne.afc.ui.android.colorpicker
public class ColorPickerDialog extends android.app.AlertDialog
The original source code was copied from "http://code.google.com/p/android-color-picker/". Comments were added, and source code patched for AFC compliance.
| Modifier and Type | Class and Description |
|---|---|
static interface |
ColorPickerDialog.OnColorPickerListener
Listener on color picking in a color picked
dialog.
|
android.app.AlertDialog.Builderandroid.content.DialogInterface.OnCancelListener, android.content.DialogInterface.OnClickListener, android.content.DialogInterface.OnDismissListener, android.content.DialogInterface.OnKeyListener, android.content.DialogInterface.OnMultiChoiceClickListener, android.content.DialogInterface.OnShowListener| Constructor and Description |
|---|
ColorPickerDialog(android.content.Context context,
boolean enableDefaultColorButton,
ColorPickerDialog.OnColorPickerListener listener)
Create a ColorPickerDialog with black color.
|
ColorPickerDialog(android.content.Context context,
int color,
boolean enableDefaultColorButton,
ColorPickerDialog.OnColorPickerListener listener)
Create a ColorPickerDialog.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
fireColorPicked()
Notifies the listeners about the selection of the color.
|
protected void |
fireColorPickingCanceled()
Notifies the listeners about the cancelation of the color picking.
|
protected void |
fireDefaultColorPicked()
Notifies the listeners about the selection of the default color.
|
float[] |
getHSV()
Replies the HSV representation of the current selected color.
|
float |
getHue()
Replies the hue of the current color, according
to the HSV representation.
|
int |
getRGB()
Replies the RGB representation of the current selected color.
|
float |
getSaturation()
Replies the saturation of the current color, according
to the HSV representation.
|
float |
getValue()
Replies the value of the current color, according
to the HSV representation.
|
void |
setHSV(float[] hsv)
Set the HSV representation of the current selected color.
|
void |
setHSV(float hue,
float saturation,
float value)
Set the HSV representation of the current selected color.
|
void |
setHue(float hue)
Set the hue of the current color, according
to the HSV representation.
|
void |
setRGB(int rgb)
Set the RGB representation of the current selected color.
|
void |
setSaturation(float sat)
Set the saturation of the current color, according
to the HSV representation.
|
protected void |
setSaturationAndValue(float sat,
float val)
Set the saturation and the value of the current color, according
to the HSV representation.
|
void |
setValue(float val)
Set the value of the current color, according
to the HSV representation.
|
getButton, getListView, onCreate, onKeyDown, onKeyUp, setButton, setButton, setButton, setButton, setButton2, setButton2, setButton3, setButton3, setCustomTitle, setIcon, setIcon, setIconAttribute, setInverseBackgroundForced, setMessage, setTitle, setView, setViewaddContentView, cancel, closeOptionsMenu, dismiss, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, findViewById, getActionBar, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getVolumeControlStream, getWindow, hide, invalidateOptionsMenu, isShowing, onActionModeFinished, onActionModeStarted, onAttachedToWindow, onBackPressed, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onDetachedFromWindow, onGenericMotionEvent, onKeyLongPress, onKeyMultiple, onKeyShortcut, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareOptionsMenu, onPreparePanel, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onStart, onStop, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setContentView, setContentView, setContentView, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setOwnerActivity, setTitle, setVolumeControlStream, show, takeKeyEvents, unregisterForContextMenupublic ColorPickerDialog(android.content.Context context,
boolean enableDefaultColorButton,
ColorPickerDialog.OnColorPickerListener listener)
OnCreateDialog() or from a background thread.context - enableDefaultColorButton - indicates if the button to select a default color
is displayed or not.listener - is a listener on the picking events.public ColorPickerDialog(android.content.Context context,
int color,
boolean enableDefaultColorButton,
ColorPickerDialog.OnColorPickerListener listener)
OnCreateDialog() or from a background thread.context - color - is the RGB colorenableDefaultColorButton - indicates if the button to select a default color
is displayed or not.listener - is a listener on the picking events.protected void fireColorPickingCanceled()
protected void fireColorPicked()
protected void fireDefaultColorPicked()
public int getRGB()
public void setRGB(int rgb)
rgb - public float[] getHSV()
public final void setHSV(float[] hsv)
hsv - public void setHSV(float hue,
float saturation,
float value)
hue - saturation - value - public float getHue()
public void setHue(float hue)
hue - the hue of the color.public float getSaturation()
public void setSaturation(float sat)
sat - is the saturation of the color.public float getValue()
public void setValue(float val)
val - is the value of the color.protected void setSaturationAndValue(float sat,
float val)
sat - is the saturation of the color.val - is the value of the color.Copyright © 2001-2013 NetEditor Developers. 
NetEditor API Documentation by NetEditor Developers is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Based on a work at www.arakhne.org/neteditor