java.lang.Object | ||||
↳ | android.view.View | |||
↳ | android.view.ViewGroup | |||
↳ | android.widget.RelativeLayout | |||
↳ | com.htc.painting.engine.HtcPaintingView |
This class is an implementation of IStrokeNotifyPaintingView
. It
implements all functionalities of the IPaintingView
and
IStrokeNotifyPaintingView
.
Besides the features defined in IPaintingView
and
IStrokeNotifyPaintingView
, HtcPaintingView also provides basic
mechanism to save/load stroke information.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
HtcPaintingView.OnCacheListener | Interface definition for a callback to be invoked when an Cache events occur. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | NO_SEPARATOR |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
mEnableEditMode | |||||||||||
mPaintingViewListener |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
same as FrameLayout's constructor
| |||||||||||
same as FrameLayout's constructor
| |||||||||||
same as FrameLayout's constructor
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Indicates whether redo operation can be performed on this HtcPaintingView.
| |||||||||||
Indicates whether undo operation can be performed on this HtcPaintingView.
| |||||||||||
Clear all strokes from this HtcPaitingView.
| |||||||||||
clear all strokes in a stroke group
| |||||||||||
clear all strokes in the specified StrokeGroups
| |||||||||||
clear undo/redo history.
| |||||||||||
Delete aStrokeGroup from this HtcPaintingView
| |||||||||||
This function release all resources within the HtcPainting.
| |||||||||||
Draws a specific Stroke and Viewport of a specific StrokeGroup on the input bitmap.
| |||||||||||
Draws a specific Stroke of a specific StrokeGroup on the input bitmap.
| |||||||||||
Draw a specific StrokeGroups onto a bitmap with respect to the given viewport
| |||||||||||
Draw a specific StrokeGroups onto a bitmap
| |||||||||||
Draw requested groups on targes canvas
| |||||||||||
This function will draw a specific segment of a stroke on the input canvas
The startPoint and endPoint together specify the segment in the Stroke to be drawn.
| |||||||||||
This function will draw a specific segment of a stroke on the input canvas
The startPoint and endPoint together specify the segment in the Stroke to be drawn.
| |||||||||||
Enable/disable erase mode
| |||||||||||
enable/disable HtcPainting
This function is originally designed to show/hide strokes and is no longer needed
| |||||||||||
Enable/disable painting strokes by touch event.
| |||||||||||
Returns the minimal rectangle that contains all strokes of a StrokeGroup.
| |||||||||||
Get alpha value apply on PaintingView
| |||||||||||
This function returns the number of requested StrokeGroups.
| |||||||||||
returns the StrokeGroup Id of current requested StrokeGroups
| |||||||||||
Get a specific
Stroke instance | |||||||||||
Get the memory footprint from specified stroke group
| |||||||||||
Get current StrokeProperties
| |||||||||||
Get Strokes from Requested Stroke Group.
| |||||||||||
Get Strokes from Requested Stroke Group.
| |||||||||||
This method returns the ViewPort of a StrokeGroup.
| |||||||||||
This init() must called before using the HtcPaintingView.
| |||||||||||
This method can be used to configure whether the HtcPainting should consume
the PenEvent.
| |||||||||||
Inidicates whether erase mode is on
| |||||||||||
Indicates whether this HtcPaintingView has been initialized.
| |||||||||||
Indicates whether we are in the process of creating a stroke
Ex.
| |||||||||||
true if HtcPainting is enabled
| |||||||||||
Indicates whether this stroke group has stroke or not
| |||||||||||
redo previous undo action
| |||||||||||
removes a registered OnPaintingViewListener from further event callbacks.
| |||||||||||
removes a registered OnStrokeListener from further event callbacks.
| |||||||||||
requests the HtcPaitingView to save a specified StrokeGroup.
| |||||||||||
requests the HtcPaitingView to save a specified StrokeGroup.
| |||||||||||
requests the HtcPaitingView to save some specified StrokeGroups.
| |||||||||||
requests the HtcPaitingView to save some specified StrokeGroups.
| |||||||||||
requests the HtcPaitingView to save a specified StrokeGroup.
| |||||||||||
requests the HtcPaitingView to save a specified StrokeGroup.
| |||||||||||
This method will change current stroke groups.
| |||||||||||
Apply alpha value on all strokes drawing in PaintingView
This could be used to temporarily adjust the display transparency of strokes
| |||||||||||
Used by Notes
| |||||||||||
Enable/disable partial invalidate dirty rectangle when drawing stroke
| |||||||||||
sets the ink drawing cache ratio of this HtcPaintingView.
| |||||||||||
Register a callback to be invoked when an PaintingView event occurs.
| |||||||||||
Register a callback to be invoked when an Stroke event occurs.
| |||||||||||
Set whether this HtcPaintingView should show processing indicator to user.
| |||||||||||
Set as current HtcPainting StrokeProperties.
| |||||||||||
Sets a ViewPort to a StrokeGroup
| |||||||||||
undo previous drawing action
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
same as FrameLayout's constructor
same as FrameLayout's constructor
Indicates whether redo operation can be performed on this HtcPaintingView.
Indicates whether undo operation can be performed on this HtcPaintingView.
clear all strokes in a stroke group
groupId | which stroke group |
---|
clear all strokes in the specified StrokeGroups
groupIds | which stroke groups to clear |
---|
clear undo/redo history. This should be called in onDestroy() but before destroyHtcPainting() is called
Delete aStrokeGroup from this HtcPaintingView
groupId | which stroke group |
---|
This function release all resources within the HtcPainting. This should be call in onDestroy()
Draws a specific Stroke and Viewport of a specific StrokeGroup on the input bitmap.
bitmap | bitmap to be drawn |
---|---|
groupId | the StrokeGroup id of the stroke to be drawn |
strokeId | the Stroke Id of the stroke to be drawn |
viewport | the view port of the stroke to be drawn |
Draws a specific Stroke of a specific StrokeGroup on the input bitmap.
bitmap | bitmap to be drawn |
---|---|
groupId | the StrokeGroup id of the stroke to be drawn |
strokeId | the Stroke Id of the stroke to be drawn |
Draw a specific StrokeGroups onto a bitmap with respect to the given viewport
bitmap | the bitmap to be drawn |
---|---|
groupId | which stroke group to draw |
viewport | the viewport to be applied to the strokes |
Draw a specific StrokeGroups onto a bitmap
bitmap | the bitmap to be drawn |
---|---|
groupIds | which stroke groups to draw |
Draw requested groups on targes canvas
canvas | target canvas |
---|
This function will draw a specific segment of a stroke on the input canvas The startPoint and endPoint together specify the segment in the Stroke to be drawn.
canvas | the canvas to draw on |
---|---|
groupId | the StrokeGroup id of the stroke to be drawn |
strokeId | the stroke id of the stroke to be drawn |
startPoint | starting point of the segment |
endPoint | end point of the segment. |
viewport | the viewport to be applied to the strokes |
This function will draw a specific segment of a stroke on the input canvas The startPoint and endPoint together specify the segment in the Stroke to be drawn.
canvas | the canvas to draw on |
---|---|
groupId | the StrokeGroup id of the stroke to be drawn |
strokeId | the stroke id of the stroke to be drawn |
startPoint | starting point of the segment |
endPoint | end point of the segment. |
Enable/disable erase mode
enable | If true, next stroke will be an eraser. If false, next stroke will be a pen |
---|
enable/disable HtcPainting This function is originally designed to show/hide strokes and is no longer needed
Enable/disable painting strokes by touch event.
enable | true to enable painting by touch event, false to disable. |
---|
Returns the minimal rectangle that contains all strokes of a StrokeGroup.
groupId | which stroke group |
---|
Get alpha value apply on PaintingView
This function returns the number of requested StrokeGroups.
returns the StrokeGroup Id of current requested StrokeGroups
Get a specific Stroke
instance
groupId | the group Id of the desired Stroke |
---|---|
strokeID | the Stroke Id of the desired Stroke |
Get the memory footprint from specified stroke group
Get current StrokeProperties
Get Strokes from Requested Stroke Group. Only effective stroke will be included.
Get Strokes from Requested Stroke Group.
containIneffectiveStroke | true: Include Ineffective strokes |
---|
This method returns the ViewPort of a StrokeGroup.
groupId | which stroke group |
---|
This init() must called before using the HtcPaintingView. It will create HtcPainting and set up HtcPainting default settings.
serializeDAO | The DAO callback used load/save/delete strokes |
---|
This method can be used to configure whether the HtcPainting should consume the PenEvent.
intercept | the HtcPaintingView will consume the PenEvent if this value is set to true and will not consume the PenEvent if the value is set to false. |
---|
Inidicates whether erase mode is on
Indicates whether this HtcPaintingView has been initialized.
Indicates whether we are in the process of creating a stroke Ex. between pen down and up
true if HtcPainting is enabled
Indicates whether this stroke group has stroke or not
groupId | which stroke group |
---|
removes a registered OnPaintingViewListener from further event callbacks.
listener | the callback to be removed |
---|
removes a registered OnStrokeListener from further event callbacks.
listener | the callback to be removed |
---|
requests the HtcPaitingView to save a specified StrokeGroup. When upon saving the StrokeGroup, the designated AbsSerializeDAO.save will be called to perform the actual saving.
id | the StrokeGroup id of that StrokeGroup that is to be saved |
---|
requests the HtcPaitingView to save a specified StrokeGroup. When upon saving the StrokeGroup, the designated AbsSerializeDAO.save will be called to perform the actual saving.
id | the StrokeGroup id of that StrokeGroup that is to be saved |
---|
requests the HtcPaitingView to save some specified StrokeGroups. When upon saving the StrokeGroup, the designated AbsSerializeDAO.save will be called to perform the actual saving.
ids | the StrokeGroup id of that StrokeGroups that are to be saved |
---|---|
saveIneffectiveStrokes | StrokeEventArg.StrokeStatus
|
requests the HtcPaitingView to save some specified StrokeGroups. When upon saving the StrokeGroup, the designated AbsSerializeDAO.save will be called to perform the actual saving.
ids | the StrokeGroup id of that StrokeGroups that are to be saved |
---|
requests the HtcPaitingView to save a specified StrokeGroup. When upon saving the StrokeGroup, the designated AbsSerializeDAO.save will be called to perform the actual saving.
requests the HtcPaitingView to save a specified StrokeGroup. When upon saving the StrokeGroup, the designated AbsSerializeDAO.save will be called to perform the actual saving.
This method will change current stroke groups. If the specified stroke groups are not in memory, painting framework will request them by serializeDAO. If serializeDAO returns null, it will create empty new stroke groups with specified stroke group ids.
groupIds | which stroke groups |
---|
groupIds | which stroke group |
---|---|
key | action key |
callback | callback when operation completed |
Apply alpha value on all strokes drawing in PaintingView This could be used to temporarily adjust the display transparency of strokes
Enable/disable partial invalidate dirty rectangle when drawing stroke
value | if true, only invalidate the rectangle that stroke do partial render. if false, invalidate stroke's bounding rectangle. |
---|
sets the ink drawing cache ratio of this HtcPaintingView. Note that the ratio must be greater or equal to 1.0f
xRatio | ink cache size to display size ratio in x-axis |
---|---|
yRatio | ink cache size to display size ratio in y-axis |
Register a callback to be invoked when an PaintingView event occurs.
listener | the callback to be run on |
---|
Register a callback to be invoked when an Stroke event occurs.
listener | the callback to be run on |
---|
Set whether this HtcPaintingView should show processing indicator to user. If set to true, the HtcPaintingView will show indicator when performing loading process. The default value is set to true.
show | true to show indicator |
---|
Set as current HtcPainting StrokeProperties. These properties will determine how the pen stroke is drawn.
p | the StrokeProperties to be used when drawing a stroke |
---|
Sets a ViewPort to a StrokeGroup
groupId | which stroke group |
---|---|
viewPort | the view port assigned to the stroke group |