public class SpenMultiView extends View implements SpenSettingViewInterface, SpenSettingViewPenInterface, SpenSettingViewEraserInterface
SpenSettingViewPenInterface.SpenBackgroundColorChangeListener| Modifier and Type | Field and Description |
|---|---|
static int |
PAGE_TRANSITION_EFFECT_LEFT
Page transition to the left.
|
static int |
PAGE_TRANSITION_EFFECT_RIGHT
Page transition to the right.
|
static int |
PAGE_TRANSITION_EFFECT_TYPE_SHADOW
Shadow transition for page.
|
static int |
PAGE_TRANSITION_EFFECT_TYPE_SLIDE
Slide transition for page.
|
ACTION_COLOR_PICKER, ACTION_ERASER, ACTION_GESTURE, ACTION_NONE, ACTION_RECOGNITION, ACTION_SELECTION, ACTION_STROKE, ACTION_STROKE_REMOVER, ACTION_TEXT, TOOL_ERASER, TOOL_FINGER, TOOL_MOUSE, TOOL_MULTI_TOUCH, TOOL_PEN_BUTTON, TOOL_SPEN, TOOL_UNKNOWN| Constructor and Description |
|---|
SpenMultiView(Context context)
Creates an SpenMultiView instance.
|
SpenMultiView(Context context,
AttributeSet attrs)
Creates an SpenMultiView instance with attributes from the specified XML structure.
|
SpenMultiView(Context context,
AttributeSet attrs,
int defStyle)
Creates an SpenMultiView instance with attributes from the specified XML attributes
and the specified class-specific default style.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addUser(int userId)
Add the specified user to multiview.
|
Bitmap |
captureCurrentView(boolean includeBlank)
Get the bitmap of the current view.
|
Bitmap |
capturePage(float ratio)
Get the bitmap of the current page.
|
void |
close()
Close the canvas view.
|
void |
closeControl()
Close the base control.
|
int |
getBlankColor()
Get the blank color.
|
int |
getCanvasHeight()
Get the current canvas height.
|
int |
getCanvasWidth()
Get the current canvas width.
|
SpenSettingEraserInfo |
getEraserSettingInfo()
Get the eraser settings information.
|
SpenSettingEraserInfo |
getEraserSettingInfo(int userId)
Get the eraser settings information for the specified user.
|
int |
getLocalUserId()
Get the current user ID.
|
float |
getMaxZoomRatio()
Get the maximum ratio for the view.
|
float |
getMinZoomRatio()
Get the minimum zoom ratio for the view.
|
PointF |
getPan()
Get the current pan position.
|
SpenSettingPenInfo |
getPenSettingInfo()
Get the Pen settings information.
|
SpenSettingPenInfo |
getPenSettingInfo(int userId)
Get the Pen settings information for the specified user.
|
int |
getToolTypeAction(int toolType)
Get the action for the specified tool type.
|
int |
getToolTypeAction(int userId,
int toolType)
Get the action for the specified tool type and user.
|
float |
getZoomRatio()
Get the zoom ratio of the view.
|
boolean |
onHoverEvent(MotionEvent event)
Called when a hover event occurs in the view.
|
boolean |
onTouchEvent(int userId,
MotionEvent event)
Called when a touch event occurs in the view for the specified user.
|
boolean |
onTouchEvent(MotionEvent event)
Called when a touch event occurs in the view.
|
boolean |
removeUser(int userId)
Remove the specified user from multiview.
|
void |
setBackgroundColorChangeListener(Object object,
SpenSettingViewPenInterface.SpenBackgroundColorChangeListener listener)
Sets the background color changed event listener.
|
void |
setBlankColor(int color)
Set the specified blank color.
|
void |
setColorPickerListener(SpenColorPickerListener listener)
Set the specified SpenColorPickerListener instance to receive color picker events.
|
void |
setEraserChangeListener(SpenEraserChangeListener listener)
Set the specified SpenEraserChangeListener instance to receive eraser change events.
|
void |
setEraserSettingInfo(int userId,
SpenSettingEraserInfo info)
Set the specified eraser settings information for the specified user.
|
void |
setEraserSettingInfo(SpenSettingEraserInfo info)
Set the specified eraser settings information.
|
void |
setFlickListener(SpenFlickListener listener)
Set the specified SpenFlickListener instance to receive flick events.
|
void |
setHoverListener(SpenHoverListener listener)
Set the specified SpenHoverListener instance to receive hover events.
|
void |
setLocalUserId(int userId)
Set the specified user.
|
boolean |
setMaxZoomRatio(float ratio)
Set the specified maximum zoom ratio for the view.
|
boolean |
setMinZoomRatio(float ratio)
Set the specified minimum zoom ratio for the view.
|
boolean |
setPageDoc(SpenPageDoc pageDoc,
boolean isUpdate)
Set the specified page document instance to the current view.
|
boolean |
setPageDoc(SpenPageDoc pageDoc,
int direction,
int type,
float centerY)
Set the specified page document instance to the current view.
|
void |
setPageEffectListener(SpenPageEffectListener listener)
Set the specified SpenPageEffectListener instance to receive page effect events.
|
void |
setPan(PointF position)
Move to the specified pan position in the view.
|
void |
setPenChangeListener(SpenPenChangeListener listener)
Set the specified SpenPenChangeListener instance to receive pen change events.
|
void |
setPenSettingInfo(int userId,
SpenSettingPenInfo info)
Set the specified Pen settings information for the specified user.
|
void |
setPenSettingInfo(SpenSettingPenInfo info)
Set the specified Pen settings information.
|
void |
setPreTouchListener(SpenTouchListener listener)
Set the specified SpenTouchListener instance to receive pre-touch events.
|
void |
setToolTypeAction(int toolType,
int action)
Set the specified action for the specified tool type.
|
void |
setToolTypeAction(int userId,
int toolType,
int action)
Set the specified action for the specified tool type and user.
|
void |
setTouchListener(SpenTouchListener listener)
Set the specified SpenTouchListener instance to receive touch events.
|
void |
setZoom(float centerX,
float centerY,
float ratio)
Set the specified zoom ratio for the view.
|
void |
setZoomListener(SpenZoomListener listener)
Set the specified SpenZoomListener instance to receive zoom events.
|
void |
update()
Update the canvas.
|
void |
updateRedo(SpenPageDoc.HistoryUpdateInfo[] userDataList,
int userId)
Redo the stroke undone by the specified user.
|
void |
updateUndo(SpenPageDoc.HistoryUpdateInfo[] userDataList,
int userId)
Undo the last stroke by the specified user.
|
public static final int PAGE_TRANSITION_EFFECT_LEFT
setPageDoc(SpenPageDoc, int, int, float),
Constant Field Valuespublic static final int PAGE_TRANSITION_EFFECT_RIGHT
setPageDoc(SpenPageDoc, int, int, float),
Constant Field Valuespublic static final int PAGE_TRANSITION_EFFECT_TYPE_SHADOW
setPageDoc(SpenPageDoc, int, int, float),
Constant Field Valuespublic static final int PAGE_TRANSITION_EFFECT_TYPE_SLIDE
setPageDoc(SpenPageDoc, int, int, float),
Constant Field Valuespublic SpenMultiView(Context context)
context - The Context for your application.NullPointerException - If the Context is set nullSpenMultiView(Context, AttributeSet),
SpenMultiView(Context, AttributeSet, int)public SpenMultiView(Context context, AttributeSet attrs)
context - The Context for your application.attrs - The XML attributes.NullPointerException - If the Context is set nullSpenMultiView(Context),
SpenMultiView(Context, AttributeSet, int)public SpenMultiView(Context context, AttributeSet attrs, int defStyle)
close() function.
If you don't call the close() close() function, memory leak should be occured.context - The Context for your application.attrs - The XML attributes.defStyle - The default style to apply to this view.
Set this to 0 to apply no style beyond what is included in the theme.
This can be an attribute resource, which is retrieved from the current theme, or an explicit style
resource.SpenMultiView(Context),
SpenMultiView(Context, AttributeSet)public void close()
public boolean onTouchEvent(MotionEvent event)
onTouchEvent in class Viewevent - The MotionEvent object that contains the event information.public boolean onTouchEvent(int userId,
MotionEvent event)
userId - The user ID.event - The MotionEvent object that contains the event information.public boolean onHoverEvent(MotionEvent event)
onHoverEvent in class Viewevent - MotionEvent object that contains the event information.public void setPenSettingInfo(SpenSettingPenInfo info)
setPenSettingInfo in interface SpenSettingViewPenInterfaceinfo - The Pen settings information object.SpenSettingPenInfopublic void setPenSettingInfo(int userId,
SpenSettingPenInfo info)
userId - The user ID.info - The Pen settings information object.SpenSettingPenInfopublic SpenSettingPenInfo getPenSettingInfo()
getPenSettingInfo in interface SpenSettingViewPenInterfaceSpenSettingPenInfopublic SpenSettingPenInfo getPenSettingInfo(int userId)
userId - The user ID.SpenSettingPenInfopublic void setEraserSettingInfo(SpenSettingEraserInfo info)
setEraserSettingInfo in interface SpenSettingViewEraserInterfaceinfo - The eraser settings information object.
The max size of eraser is limited by canvas dimensions.RuntimeException - When does not setLocalUserId()SpenSettingEraserInfopublic void setEraserSettingInfo(int userId,
SpenSettingEraserInfo info)
userId - The user ID.info - The eraser settings information object.
The max size of eraser is limited by canvas dimensions.SpenSettingEraserInfopublic SpenSettingEraserInfo getEraserSettingInfo()
getEraserSettingInfo in interface SpenSettingViewEraserInterfaceSpenSettingEraserInfopublic SpenSettingEraserInfo getEraserSettingInfo(int userId)
userId - The user ID.SpenSettingEraserInfopublic void setToolTypeAction(int toolType,
int action)
setToolTypeAction in interface SpenSettingViewInterfacetoolType - The tool type.
The valid values are SpenSettingViewInterface. SpenSettingViewInterface.TOOL_UNKNOWN,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_FINGER,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_SPEN,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_MOUSE,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_ERASER.
For more information, see Field Detail in the SpenSettingViewInterface class reference.action - The action for the tool
The valid values are SpenSettingViewInterface. SpenSettingViewInterface.ACTION_NONE,
SpenSettingViewInterface. SpenSettingViewInterface.ACTION_GESTURE,
SpenSettingViewInterface. SpenSettingViewInterface.ACTION_STROKE,
SpenSettingViewInterface. SpenSettingViewInterface.ACTION_ERASER,
SpenSettingViewInterface. SpenSettingViewInterface.ACTION_COLOR_PICKER.
For more information, see Field Detail in the SpenSettingViewInterface class reference.RuntimeException - Thrown if UserId is not set beforepublic void setToolTypeAction(int userId,
int toolType,
int action)
userId - The user ID.toolType - The valid values are SpenSettingViewInterface. SpenSettingViewInterface.TOOL_UNKNOWN,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_FINGER,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_SPEN,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_MOUSE,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_ERASER.
For more information, see Field Detail in the SpenSettingViewInterface class reference.action - The valid values are SpenSettingViewInterface. SpenSettingViewInterface.ACTION_NONE,
SpenSettingViewInterface. SpenSettingViewInterface.ACTION_GESTURE,
SpenSettingViewInterface. SpenSettingViewInterface.ACTION_STROKE,
SpenSettingViewInterface. SpenSettingViewInterface.ACTION_ERASER,
SpenSettingViewInterface. SpenSettingViewInterface.ACTION_COLOR_PICKER.
For more information, see Field Detail in the SpenSettingViewInterface class reference.public int getToolTypeAction(int toolType)
getToolTypeAction in interface SpenSettingViewInterfacetoolType - The valid values are SpenSettingViewInterface. SpenSettingViewInterface.TOOL_UNKNOWN,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_FINGER,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_SPEN,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_MOUSE,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_ERASER.
For more information, see Field Detail in the SpenSettingViewInterface class reference.SpenSettingViewInterface.ACTION_NONE,
SpenSettingViewInterface. SpenSettingViewInterface.ACTION_GESTURE,
SpenSettingViewInterface. SpenSettingViewInterface.ACTION_STROKE,
SpenSettingViewInterface. SpenSettingViewInterface.ACTION_ERASER,
SpenSettingViewInterface. SpenSettingViewInterface.ACTION_COLOR_PICKER.
For more information, see Field Detail in the SpenSettingViewInterface class reference.public int getToolTypeAction(int userId,
int toolType)
userId - The user ID.toolType - The valid values are SpenSettingViewInterface. SpenSettingViewInterface.TOOL_UNKNOWN,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_FINGER,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_SPEN,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_MOUSE,
SpenSettingViewInterface. SpenSettingViewInterface.TOOL_ERASER.
For more information, see Field Detail in the SpenSettingViewInterface class reference.SpenSettingViewInterface.ACTION_NONE,
SpenSettingViewInterface. SpenSettingViewInterface.ACTION_STROKE,
SpenSettingViewInterface. SpenSettingViewInterface.ACTION_ERASER.
For more information, see Field Detail in the SpenSettingViewInterface class reference.public int getCanvasWidth()
getCanvasWidth in interface SpenSettingViewInterfacepublic int getCanvasHeight()
getCanvasHeight in interface SpenSettingViewInterfacepublic void setBackgroundColorChangeListener(Object object, SpenSettingViewPenInterface.SpenBackgroundColorChangeListener listener)
setBackgroundColorChangeListener in interface SpenSettingViewPenInterfaceobject - Object layout which changed background color.listener - The callback listener for Changed BackgroundColorpublic void setLocalUserId(int userId)
userId - The user ID.public int getLocalUserId()
public boolean addUser(int userId)
userId - The user ID.public boolean removeUser(int userId)
userId - The user ID.public void setZoom(float centerX,
float centerY,
float ratio)
centerX - The x coordinate for center.centerY - The y coordinate for center.ratio - The zoom ratio.
if (mEraserChangeListener != null) { mEraserChangeListener.onChanged(mEraserSettingInfo); }public float getZoomRatio()
public boolean setMaxZoomRatio(float ratio)
ratio - Max zoom of canvaspublic float getMaxZoomRatio()
public boolean setMinZoomRatio(float ratio)
ratio - Minimum zoom of canvaspublic float getMinZoomRatio()
public void setPan(PointF position)
position - The pan position.public PointF getPan()
public void setBlankColor(int color)
color - The blank color.public int getBlankColor()
public boolean setPageDoc(SpenPageDoc pageDoc, boolean isUpdate)
pageDoc - The page document instance.isUpdate - Set to true to update the screen, set to false to not update the screen.OutOfMemoryError - Thrown if there is insufficient memory available.hpublic boolean setPageDoc(SpenPageDoc pageDoc, int direction, int type, float centerY)
pageDoc - The PageDoc instance.direction - The page transition direction.
The valid values are PAGE_TRANSITION_EFFECT_LEFT, PAGE_TRANSITION_EFFECT_RIGHT.
For more information, see Field Detail in this class.type - type of pageDoccenterY - The centerY position to move to after setting the page document.OutOfMemoryError - Thrown if there is insufficient memory available.public void update()
public void updateUndo(SpenPageDoc.HistoryUpdateInfo[] userDataList, int userId)
userDataList - The action history data list object.userId - The user ID.public void updateRedo(SpenPageDoc.HistoryUpdateInfo[] userDataList, int userId)
userDataList - The action history data list object.userId - The user ID.public void setPreTouchListener(SpenTouchListener listener)
listener - The SpenTouchListener instance to receive pre-touch events.public void setTouchListener(SpenTouchListener listener)
listener - The SpenTouchListener instance to receive touch events.public void setFlickListener(SpenFlickListener listener)
listener - The SpenFlickListener instance to receive flick events.public void setHoverListener(SpenHoverListener listener)
listener - The SpenHoverListener instance to receive hover events.public void setColorPickerListener(SpenColorPickerListener listener)
listener - The SpenColorPickerListener instance to receive color picker events.public void setZoomListener(SpenZoomListener listener)
listener - The SpenZoomListener instance to receive zoom events.public void setPageEffectListener(SpenPageEffectListener listener)
listener - The SpenPageEffectListener instance to receive page effect events.public void setPenChangeListener(SpenPenChangeListener listener)
listener - SpenPenChangeListener instance to receive pen change events.public void setEraserChangeListener(SpenEraserChangeListener listener)
listener - The SpenEraserChangeListener instance to receive eraser change events.public Bitmap captureCurrentView(boolean includeBlank)
includeBlank - Set to true to include a blank in the captured bitmap, set to false to capture the screen without a
blank.OutOfMemoryError - Thrown if there is insufficient memory available.public Bitmap capturePage(float ratio)
ratio - The ratio to apply to the captured image.OutOfMemoryError - thrown if not enough memory to create captured bitmap.IllegalArgumentException - if create bitmap with size exceeds 32bits with 32bits OSNegativeArraySizeException - if create bitmap with size exceeds 32bits with 64bits OSpublic void closeControl()
closeControl in interface SpenSettingViewInterface