public final class SpenPageDoc extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SpenPageDoc.BackgroundEffect
BackgroundEffect
|
static interface |
SpenPageDoc.HistoryListener
This listener interface provides callback methods for receiving history events.
The interface receives notifications when a new history event is committed by commitHistory(HistoryUpdateInfo) |
static class |
SpenPageDoc.HistoryUpdateInfo
This class contains the update history information.
|
static interface |
SpenPageDoc.LayerListener
This listener interface is called when the state of a layer is changed.
|
static interface |
SpenPageDoc.ObjectIndexMovedListener
This listener interface provides callback methods for receiving object index change events.
Use the following method to register the listener: |
static interface |
SpenPageDoc.ObjectListener
This listener interface is called when the state of an object is changed.
|
static interface |
SpenPageDoc.ObjectSelectedListener
This listener interface provides callback methods for receiving object selection events.
Use the following method to register the listener: |
| Modifier and Type | Field and Description |
|---|---|
static int |
BACKGROUND_IMAGE_MODE_CENTER
Background image in the center.
|
static int |
BACKGROUND_IMAGE_MODE_FIT
Background image fits to page.
|
static int |
BACKGROUND_IMAGE_MODE_STRETCH
Background image stretched to fit the page.
|
static int |
BACKGROUND_IMAGE_MODE_TILE
Background image is tiled.
|
static int |
FIND_TYPE_ALL
Find objects of all types.
|
static int |
FIND_TYPE_STROKE
Find SpenObjectStroke objects.
|
static int |
GEO_TAG_STATE_DEFAULT
Geo tag default state.
|
static int |
GEO_TAG_STATE_REMOVED
Geo tag state when removing geo tag.
|
static int |
GEO_TAG_STATE_SET
Geo tag state when setting values.
|
static int |
HISTORY_MANAGER_MODE_MULTIPLE_VIEW
One of the type of historyManagr.
|
static int |
HISTORY_MANAGER_MODE_SINGLE_VIEW
One of the type of historyManagr.
|
static int |
ORIENTATION_LANDSCAPE
Landscape orientation mode.
|
static int |
ORIENTATION_PORTRAIT
Portrait orientation mode.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTag(String tag)
Add the specified tag.
|
void |
appendObject(SpenObjectBase object)
Add the specified object to the current layer of the page document.
The add object action is recorded in the history stack. |
void |
appendObjectList(ArrayList<SpenObjectBase> objectList)
Append a list of object.
|
void |
clearHistory()
Clear all the undo/redo history.
Even if undoable or redoable is cleared by this API, history listener is not called. |
void |
clearHistoryTag()
Clear the history tag.
|
void |
clearRedoHistory()
Clear all the redo commands.
|
void |
commitHistory(SpenPageDoc.HistoryUpdateInfo userData)
Save the command history for undo and redo.
To execute undo and redo commands properly and to update the viewport, use this method with SpenView. It is recommended that you call SpenView.updata() to create undo and redo data because SpenSurfaceView.updata() calls commitHistory internally. |
void |
copy(SpenPageDoc sourcePage)
Copy the objects from the specified page document.
After copy, the history stack is cleared. The objects on the pasted page are resized on the target page. |
SpenObjectBase |
createObject(int type)
Create a new instance of the specified object type.
|
SpenObjectBase |
createObject(int type,
boolean isTemplateObject)
Create a new instance of the specified object type with the template status.
|
boolean |
equals(Object o)
Compares the instance with the specified object and returns whether both is same or not.
|
ArrayList<SpenObjectBase> |
findObjectAtPosition(int typeFilter,
float x,
float y)
Find the list of objects of the specified type at the specified location.
Objects within object containers cannot be found. |
ArrayList<SpenObjectBase> |
findObjectAtPosition(int typeFilter,
float x,
float y,
float threshold)
Find the list of objects of the specified type in the range.
The range is the rectangle of ( x-threshold, y-threshold) to
(x+threshold, y+threshold). |
ArrayList<SpenObjectBase> |
findObjectInClosedCurve(int typeFilter,
PointF[] points)
Find the objects of the specified type contained in the closed curves defined by the specified points.
The points connect the curve in order. If the curve does not intersect, this method connects the first point and the last point. If two points overlap, one of them is ignored and the next point is connected. Objects within object containers cannot be found. |
ArrayList<SpenObjectBase> |
findObjectInRect(int typeFilter,
RectF rectf,
boolean allAreas)
Find the objects of the specified type contained in the rectangle with the specified points.
Objects within object containers cannot be found. |
SpenObjectBase |
findTopObjectAtPosition(int typeFilter,
float x,
float y)
Find the topmost object at the specified position with the specified type.
Objects within object containers cannot be found. |
SpenObjectBase |
findTopObjectAtPosition(int typeFilter,
float x,
float y,
float threshold)
Find the topmost object in the range with the specified type.
The range is the rectangle of ( x-threshold, y-threshold) to
(x+threshold, y+threshold). |
int |
getBackgroundColor()
Get the background color.
|
Bitmap |
getBackgroundImage()
Get the background image.
|
int |
getBackgroundImageMode()
Get the background image mode.
|
String |
getBackgroundImagePath()
Get the background image file path.
|
RectF |
getDrawnRectOfAllObject()
Get the total drawn rect of all the objects that fill the page.
If there are too many objects on the page, this method becomes slow. But if there is no change in the page, this method returns the result quickly because no recalculation is required. |
byte[] |
getExtraDataByteArray(String key)
Get the extra byte array data for the specified key.
|
int |
getExtraDataInt(String key)
Get the extra integer data for the specified key.
|
String |
getExtraDataString(String key)
Get the extra string data for the specified key.
|
String[] |
getExtraDataStringArray(String key)
Get the extra string array data for the specified key.
|
double |
getGeoTagLatitude()
Get the geotagged latitude.
|
double |
getGeoTagLongitude()
Get the geotagged longitude.
|
int |
getGeoTagState()
Get the geo tag state.
|
int |
getHeight()
Get the page height.
|
int |
getHistoryManagerMode()
Get the history manager mode.
|
ArrayList<RectF> |
getHistoryUpdateRect()
Get the updated rectangles when pageDoc is changed.
(Updated rectangles means the regions of canvas contain all changed objects, not the regions of each object) If commitHistory is called, UpdateRect is reset. |
String |
getId()
Get the page ID.
|
long |
getLastEditedTime()
Gets the time the PageDoc instance or its objects were last edited.
If nothing has changed, this method gets the time when the page was created. |
SpenObjectBase |
getObject(int index)
Get the object at the specified index in the current layer of the page document.
|
SpenObjectBase |
getObjectByRuntimeHandle(int runtimeHandle)
Get the object with the specified runtime handle in the current layer of the page document.
|
int |
getObjectCount(boolean includeInvisible)
Get the number of objects in the current layer of the page document.
|
int |
getObjectIndex(SpenObjectBase object)
Get the index of the specified object in the current layer of the page document.
|
ArrayList<SpenObjectBase> |
getObjectList()
Get the list of all objects in the current layer of the page document.
|
ArrayList<SpenObjectBase> |
getObjectList(int typeFilter)
Get the list of objects of the specified type in the current layer of the page document.
|
ArrayList<SpenObjectBase> |
getObjectList(int typeFilter,
String extraKey,
int extraValue)
Get the list of objects of the specified type with the specified integer value and key.
|
ArrayList<SpenObjectBase> |
getObjectList(int typeFilter,
String extraKey,
String extraValue)
Get the list of objects of the specified type with the specified string value and key.
|
ArrayList<RectF> |
getObjectRectList(int type)
Get the objects's rect list of the specified type contained in page.
Objects within object containers cannot be found. |
int |
getOrientation()
Get the page orientation.
|
ArrayList<SpenObjectBase> |
getSelectedObject()
Get the list of selected objects.
|
int |
getSelectedObjectCount()
Get the number of selected objects in the list.
|
ArrayList<String> |
getTag()
Get the list of tags.
|
ArrayList<SpenObjectBase> |
getTemplateObjectList()
Get the template objects in the current layer of the page document.
|
String |
getTemplateUri()
Get the template URI.
|
int |
getUndoLimit()
Get the limit for the undo commands.
|
int |
getWidth()
Get the page width.
|
boolean |
hasExtraDataByteArray(String key)
Check if extra byte array data exists with the specified key.
|
boolean |
hasExtraDataInt(String key)
Check if extra integer data exists with the specified key.
|
boolean |
hasExtraDataString(String key)
Check if extra string data exists with the specified key.
|
boolean |
hasExtraDataStringArray(String key)
Check if extra string array data exists with the specified key.
|
int |
hashCode()
Gets an integer hash code for this object.
|
void |
insertObject(SpenObjectBase object,
int index)
Insert the specified object at the specified index in the current layer of the page document.
The insert object action is recorded in the history stack. |
boolean |
isChanged()
Check if the page, layers or objects have changed.
|
boolean |
isLayerChanged()
Check if there is a change in the layer.
|
boolean |
isObjectContained(SpenObjectBase object)
Check if the specified object is contained in the current layer of the page document.
|
boolean |
isObjectLoaded()
Check if the objects are loaded.
|
boolean |
isRedoable()
Check if the action is redoable.
Check if the redo stack in the history manager is empty. If it is empty, there is no command to redo, and the method returns false. If it is not empty, it returns true. Always use this method before calling page.redo(). |
boolean |
isRedoable(int userId)
Check if the action is redoable for the specified user.
Check if the redo stack in the history manager for this user is empty. If it is empty, there is no command to redo, and the method returns false. If it is not empty, it returns true. Always use this method before calling page.redo(). |
boolean |
isUndoable()
Check if the action is undoable.
Check if the undo stack in the history manager is empty. If it is empty, there is no command to undo, and this method returns false. If it is not empty, it returns true. Always call this method before calling page.undo(). |
boolean |
isUndoable(int userId)
Check if the action is undoable for the specified user.
Check if the undo stack in the history manager for this user is empty. If it is empty, there is no command to undo, and the method returns false. If it is not empty, it returns true. Always use this method before calling page.undo(). |
boolean |
isValid()
Check if the page is valid.
|
void |
loadObject()
Load all objects.
When a page is first created, the isObjectLoaded() method returns true, but if you create a NoteDoc with
an SPD file and get a page, the isObjectLoaded() method returns false. |
void |
moveObjectIndex(SpenObjectBase object,
int step,
boolean ignoreInvisible)
Moves the index of the specified object by the specified step.
|
SpenPageDoc.HistoryUpdateInfo[] |
redo()
Redo the command and return the changed state information for updating the canvas.
After redo, the canvas view needs to be updated. |
SpenPageDoc.HistoryUpdateInfo[] |
redo(int userId)
Redo the command for the specified user and return the changed state information for updating the canvas.
After redo, the canvas view needs to be updated. |
SpenPageDoc.HistoryUpdateInfo[] |
redoAll()
Redo all the commands in the redo stack of the history manager and return the changed state information for
updating the canvas.
After redoAll, the canvas view needs to be updated. |
SpenPageDoc.HistoryUpdateInfo[] |
redoAll(int userId)
Redo all the commands for the specified user in the redo stack of the history manager and return the changed
state information for updating the canvas.
After redoAll, the canvas view needs to be updated. This method is used for HISTORY_MANAGER_MODE_MULTIPLE_VIEW |
void |
removeAllObject()
Remove all the objects from the current layer and the selected object list of the page document.
The remove all objects action is not recorded in the history stack. |
void |
removeExtraDataByteArray(String key)
Remove the extra byte array data with the specified key.
|
void |
removeExtraDataInt(String key)
Remove the extra integer data with the specified key.
|
void |
removeExtraDataString(String key)
Remove the extra string data with the specified key.
|
void |
removeExtraDataStringArray(String key)
Remove the extra string array data with the specified key.
|
void |
removeGeoTag()
Change geo tag state to 'Removed' and reset latitude and longitude value.
|
void |
removeObject(SpenObjectBase object)
Remove the specified object from the current layer of the page document.
If the object is on the selected object list, this method removes it from that list. The remove object's action is not recorded in the history stack. |
void |
removeTag(String tag)
Remove the specified tag.
|
void |
save()
Save the page in the cache directory.
|
void |
setBackgroundColor(int color)
Set the specified background color.
|
void |
setBackgroundImage(String filePath)
Set the image from the specified file.
This method copies the original image file into the SPD file. |
void |
setBackgroundImageMode(int mode)
Set the specified background image mode.
|
static void |
setDefaultSaveOption(boolean compatibleMode)
Set the default save option for all page in the note
S Pen SDK 4.0 has a big change. |
void |
setExtraDataByteArray(String key,
byte[] value)
Set the extra byte array data with the specified key.
|
void |
setExtraDataInt(String key,
int value)
Set the extra integer data with the specified key.
|
void |
setExtraDataString(String key,
String value)
Set the extra string data with the specified key.
|
void |
setExtraDataStringArray(String key,
String[] value)
Set the extra string array data with the specified key.
|
void |
setGeoTag(double latitude,
double longitude)
Set the specified geotagging data.
|
void |
setHistoryListener(SpenPageDoc.HistoryListener listener)
Set the specified HistoryListener instance to receive history events.
|
void |
setHistoryManagerMode(int mode)
Set the specified mode for the history manager.
SpenPageDoc supports multi mode ( SpenMultiView) and single
mode (SpenView, SpenSurfaceView).In the multiple view mode, Not supported full API set of PageDoc. |
void |
setHistoryTag()
Set a tag for the history manager.
To remove the tag, call clearTag or undoToTag. |
void |
setObjectIndexMovedListener(SpenPageDoc.ObjectIndexMovedListener listener)
Set the specified ObjectIndexMovedListener instance to receive object index change events on the page.
|
void |
setObjectListener(SpenPageDoc.ObjectListener listener)
Set the specified ObjectListener instance to receive object events on the page.
|
void |
setObjectSelectedListener(SpenPageDoc.ObjectSelectedListener listener)
Set the specified ObjectSelectedListener to receive object selection events on the page.
|
void |
setTemplateUri(String uri)
Set the specified template URI.
|
void |
setUndoLimit(int undoLimit)
Set the limit for the number of undo commands in the undo stack.
|
void |
setUserIdForHistoryListener(int userId)
Set the specific user id for receiving History Listener on multi-view mode.
|
void |
setVolatileBackgroundImage(Bitmap bitmap)
Set the specified image as the volatile background image.
This means the background image is not saved in the SPD file. |
void |
startHistoryGroup()
Create a history group.
A number of histories belong to a single history group, not merge into a single history. |
void |
stopHistoryGroup()
Close the history group.
|
SpenPageDoc.HistoryUpdateInfo[] |
undo()
Undo the command and return the previous state information for updating the canvas.
After undo, the canvas view needs to be updated. |
SpenPageDoc.HistoryUpdateInfo[] |
undo(int userId)
Undo the command for the specified user and return the previous state information for updating the canvas.
After undo, the canvas view needs to be updated. |
SpenPageDoc.HistoryUpdateInfo[] |
undoAll()
Undo all the commands in the undo stack of the history manager and return the previous state information for
updating the canvas.
After undoAll, the canvas view needs to be updated. |
SpenPageDoc.HistoryUpdateInfo[] |
undoAll(int userId)
Undo all the commands for the specified user in the undo stack of the history manager and return the previous
state information for updating the canvas.
After undoAll, the canvas view needs to be updated. |
SpenPageDoc.HistoryUpdateInfo[] |
undoToTag()
Undo the command to the tag and return the previous state information for updating the canvas.
After undoToTag, the redo stack is cleared and the canvas view needs to be updated. Note: If history tag out of the undo stack, it will be removed. |
void |
unloadObject()
Unload the objects in the page which is not being attached to view.
This method saves the objects and layers on the page in the cache directory and unloads them from memory. The unloaded objects cannot be used any more. When objects are unloaded, the methods for the objects trigger the loadObject method internally. You cannot use methods that receive an unloaded object instance as their parameter. The command history stack for the unloaded objects is cleared. |
public static final int FIND_TYPE_STROKE
public static final int FIND_TYPE_ALL
public static final int ORIENTATION_PORTRAIT
getOrientation(),
Constant Field Valuespublic static final int ORIENTATION_LANDSCAPE
getOrientation(),
Constant Field Valuespublic static final int HISTORY_MANAGER_MODE_SINGLE_VIEW
SpenView, SpenSurfaceView)setHistoryManagerMode(int),
Constant Field Valuespublic static final int HISTORY_MANAGER_MODE_MULTIPLE_VIEW
SpenMultiView)setHistoryManagerMode(int),
Constant Field Valuespublic static final int BACKGROUND_IMAGE_MODE_CENTER
setBackgroundImageMode(int),
getBackgroundImageMode(),
Constant Field Valuespublic static final int BACKGROUND_IMAGE_MODE_STRETCH
setBackgroundImageMode(int),
getBackgroundImageMode(),
Constant Field Valuespublic static final int BACKGROUND_IMAGE_MODE_FIT
setBackgroundImageMode(int),
getBackgroundImageMode(),
Constant Field Valuespublic static final int BACKGROUND_IMAGE_MODE_TILE
setBackgroundImageMode(int),
getBackgroundImageMode(),
Constant Field Valuespublic static final int GEO_TAG_STATE_DEFAULT
public static final int GEO_TAG_STATE_SET
setGeoTag(double, double),
Constant Field Valuespublic static final int GEO_TAG_STATE_REMOVED
removeGeoTag(),
Constant Field Valuespublic int getWidth()
public int getHeight()
public long getLastEditedTime()
public void appendObject(SpenObjectBase object)
object - The object that you want to add.IllegalStateException - Thrown if the object has already been added.IllegalArgumentException - Thrown if the object passed is null.public void insertObject(SpenObjectBase object, int index)
object - The object that you want to insert.index - The index where the object is inserted.IndexOutOfBoundsException - Thrown if the index is larger than the number of objects or smaller than 0.IllegalStateException - Thrown if the object has already been added.IllegalArgumentException - Thrown if the object passed is null.public void removeObject(SpenObjectBase object)
object - The object that you want to remove.IllegalStateException - Thrown if the page document is not loaded.IllegalArgumentException - Thrown if the object passed is null.SpenAlreadyClosedException - Thrown if the page document removes object which is unloaded.selectObject(ArrayList),
getSelectedObject()public void removeAllObject()
selectObject(ArrayList),
getSelectedObject()public SpenObjectBase getObject(int index)
index - - The index of the object.IndexOutOfBoundsException - Thrown If the index passed is out of range.public ArrayList<SpenObjectBase> getObjectList()
public ArrayList<SpenObjectBase> getObjectList(int typeFilter)
typeFilter - The object type.getObjectList(PageDoc.FIND_TYPE_STROKE) FIND_TYPE_STROKEFIND_TYPE_ALL.IllegalArgumentException - If the typeFilter is invalid.public ArrayList<SpenObjectBase> getObjectList(int typeFilter, String extraKey, int extraValue)
typeFilter - The object type.getObjectList(PageDoc.FIND_TYPE_STROKE, "SPECIFIED_KEY", 1)FIND_TYPE_STROKEFIND_TYPE_ALL.extraKey - The key for the data.extraValue - The integer value.IllegalArgumentException - Thrown if extraKey is null or typeFilter is invalid.public ArrayList<SpenObjectBase> getObjectList(int typeFilter, String extraKey, String extraValue)
typeFilter - The object type.getObjectList(PageDoc.FIND_TYPE_STROKE, "SPECIFIED_KEY", "VALUE") FIND_TYPE_STROKEFIND_TYPE_ALL.extraKey - The extra key string.extraValue - The extra data to match.IllegalArgumentException - If extraKey is null or typeFilter is invalid.public ArrayList<SpenObjectBase> getTemplateObjectList()
public int getObjectCount(boolean includeInvisible)
includeInvisible - Set to true to include invisible objects, set to false to not include invisible objects.public SpenObjectBase getObjectByRuntimeHandle(int runtimeHandle)
runtimeHandle - The runtime handle of the object.IllegalArgumentException - Thrown if the runtimeHandle passed cannot be found.public int getObjectIndex(SpenObjectBase object)
object - The object.IllegalStateException - Thrown if the page document is not loaded.IllegalArgumentException - Thrown if the object passed is invalid.public boolean isObjectContained(SpenObjectBase object)
object - The object that you want to check.public SpenObjectBase findTopObjectAtPosition(int typeFilter, float x, float y)
typeFilter - The object filter.findTopObjectAtPosition(PageDoc.FIND_TYPE_STROKE, x, y) FIND_TYPE_STROKEFIND_TYPE_ALLx - The x-coordinate value.y - The y-coordinate valueIllegalArgumentException - Thrown if the arguments passed are invalid.public SpenObjectBase findTopObjectAtPosition(int typeFilter, float x, float y, float threshold)
x-threshold, y-threshold) to
(x+threshold, y+threshold). typeFilter - The object filter.findTopObjectAtPosition(PageDoc.FIND_TYPE_STROKE, x, y, threshold)FIND_TYPE_STROKEFIND_TYPE_ALLx - The x-coordinate value.y - The y-coordinate valuethreshold - The threshold of position.IllegalArgumentException - Thrown if the arguments passed are invalid.public ArrayList<SpenObjectBase> findObjectAtPosition(int typeFilter, float x, float y)
typeFilter - The object filter.findObjectAtPosition(PageDoc.FIND_TYPE_STROKE, x, y) FIND_TYPE_STROKEFIND_TYPE_ALLx - The specified x-coordinate.y - The specified y-coordinate.IllegalArgumentException - Thrown if the arguments passed are invalid.public ArrayList<SpenObjectBase> findObjectAtPosition(int typeFilter, float x, float y, float threshold)
x-threshold, y-threshold) to
(x+threshold, y+threshold). typeFilter - The object filter.findObjectAtPosition(PageDoc.FIND_TYPE_STROKE, x, y, threshold) FIND_TYPE_STROKEFIND_TYPE_ALLx - The specified x-coordinate.y - The specified y-coordinate.threshold - The threshold of position.IllegalArgumentException - Thrown if the arguments passed are invalid.public ArrayList<SpenObjectBase> findObjectInClosedCurve(int typeFilter, PointF[] points)
typeFilter - The object filter.findObjectInClosedCurve(PageDoc.FIND_TYPE_STROKE, points) FIND_TYPE_STROKEFIND_TYPE_ALLpoints - The point array that defines the curves.IllegalArgumentException - Thrown if the arguments passed are invalid.public ArrayList<SpenObjectBase> findObjectInRect(int typeFilter, RectF rectf, boolean allAreas)
typeFilter - The object filter.findObjectInRect(PageDoc.FIND_TYPE_STROKE, rectf, true) FIND_TYPE_STROKEFIND_TYPE_ALLrectf - The rect to find the objects.allAreas - Set to true to find the objects that only are within the rectf, set to false to include the objects
that partially overlap with the rectf.IllegalArgumentException - If you set value except FIND_TYPE_STROKE & FIND_TYPE_ALL ,
occur exception.public void moveObjectIndex(SpenObjectBase object, int step, boolean ignoreInvisible)
object - The object.step - The number of steps to move the object within the list.ignoreInvisible - Set to true to ignore invisible objects from the step, set to false to include invisible objects in
the step.IllegalStateException - Thrown if the page document is not loaded.IllegalArgumentException - Thrown if the arguments passed are invalid.public ArrayList<SpenObjectBase> getSelectedObject()
IllegalStateException - Thrown if page document is not loaded.public int getSelectedObjectCount()
public void addTag(String tag)
tag - The tag.IllegalArgumentException - If tag is null.public void removeTag(String tag)
tag - The tag.IllegalArgumentException - If tag is null.public int getOrientation()
ORIENTATION_LANDSCAPE,
ORIENTATION_PORTRAITpublic void setVolatileBackgroundImage(Bitmap bitmap)
bitmap - The image bitmap.IllegalArgumentException - Thrown if the bitmap passed is a recycled image.public void setBackgroundImage(String filePath)
filePath - The image file path.IllegalArgumentException - Thrown if the file path passed is invalid or if the file does not exist.public Bitmap getBackgroundImage()
public String getBackgroundImagePath()
public void setBackgroundImageMode(int mode)
mode - The image mode.IllegalArgumentException - Thrown if the mode type is invalid.BACKGROUND_IMAGE_MODE_CENTER,
BACKGROUND_IMAGE_MODE_FIT,
BACKGROUND_IMAGE_MODE_STRETCH,
BACKGROUND_IMAGE_MODE_TILEpublic int getBackgroundImageMode()
BACKGROUND_IMAGE_MODE_CENTER,
BACKGROUND_IMAGE_MODE_FIT,
BACKGROUND_IMAGE_MODE_STRETCH,
BACKGROUND_IMAGE_MODE_TILEpublic void setBackgroundColor(int color)
color - The color in ARGB8888 format.public int getBackgroundColor()
public void setTemplateUri(String uri)
uri - The template URI.public String getTemplateUri()
public String getId()
public RectF getDrawnRectOfAllObject()
public boolean isChanged()
public void setGeoTag(double latitude,
double longitude)
latitude - The latitude in degrees between -90 and 90.longitude - The longitude in degrees between -180 and 180.IllegalArgumentException - Thrown if the latitude is not in the range of -90 to 90 Or if the longitude range is not in the
range of -180 to 180.getGeoTagLatitude(),
getGeoTagLongitude()public double getGeoTagLatitude()
setGeoTag(double, double)public double getGeoTagLongitude()
setGeoTag(double, double)public int getGeoTagState()
setGeoTag(double, double),
removeGeoTag()public void removeGeoTag()
IllegalStateException - Thrown if current state of geo tag is default or removed.public void setExtraDataString(String key, String value)
key - The key for the data.value - The extra string data.IllegalArgumentException - Thrown if the key passed is null.public void setExtraDataStringArray(String key, String[] value)
key - The key for the data.value - The extra string array data.IllegalArgumentException - Thrown if the key passed is null.public void setExtraDataByteArray(String key, byte[] value)
key - The key for the data.value - The extra byte array data.IllegalArgumentException - Thrown if the key passed is null.public void setExtraDataInt(String key, int value)
key - The key for the data.value - The extra integer data.IllegalArgumentException - Thrown if the key passed is null.public String getExtraDataString(String key)
key - The key for the data.public int getExtraDataInt(String key)
key - The key for the data.public String[] getExtraDataStringArray(String key)
key - The key for the data.public byte[] getExtraDataByteArray(String key)
key - The key for the data.public boolean hasExtraDataString(String key)
key - The key for the data.public boolean hasExtraDataInt(String key)
key - The key for the datapublic boolean hasExtraDataStringArray(String key)
key - The key for the datapublic boolean hasExtraDataByteArray(String key)
key - The key for the datapublic void removeExtraDataString(String key)
key - The key for the data.public void removeExtraDataInt(String key)
key - The key for the data.public void removeExtraDataStringArray(String key)
key - The key for the data.public void removeExtraDataByteArray(String key)
key - The key for the data.public void save()
throws IOException
SpenNoteDoc.save(String).IOException - Thrown if having error with saving SPD file.IllegalStateException - Thrown if the page is not attached to a note.public void loadObject()
throws IOException
isObjectLoaded() method returns true, but if you create a NoteDoc with
an SPD file and get a page, the isObjectLoaded() method returns false.IllegalStateException - Thrown if the page is not attached to a note or if the isObjectLoaded() returns true
exception is thrown.IOException - Thrown if the page file is not found.isObjectLoaded(),
unloadObject()public void unloadObject()
throws IOException
IllegalStateException - Thrown if the page is not attached to a note.IllegalStateException - Thrown if the isObjectLoaded() method returns false.IOException - Thrown if the page file is not found.isObjectLoaded(),
loadObject()public boolean isObjectLoaded()
public boolean isLayerChanged()
public void setObjectListener(SpenPageDoc.ObjectListener listener)
listener - The ObjectListener instance to receive object events on the page. Set to null to unregister the
current listener.SpenPageDoc.ObjectListenerpublic void setObjectSelectedListener(SpenPageDoc.ObjectSelectedListener listener)
listener - The ObjectSelectedListener instance to receive object selection events. Set to null to unregister the
current listener.SpenPageDoc.ObjectSelectedListenerpublic void setObjectIndexMovedListener(SpenPageDoc.ObjectIndexMovedListener listener)
listener - The ObjectIndexMovedListener instance to receive object index change events on the page. Set to null
to unregister the current listener.SpenPageDoc.ObjectIndexMovedListenerpublic void copy(SpenPageDoc sourcePage)
sourcePage - The source page.IllegalArgumentException - Thrown if the orientation of the source page is not the same as the orientation of the target
page.public boolean isUndoable()
if (page.isUndoable() == true) {
spenSurfaceView.updateUndo(page.undo());
}
undo()public boolean isRedoable()
if (page.isRedoable() == true) {
spenSurfaceView.updateRedo(page.redo());
}
redo()public boolean isUndoable(int userId)
if (page.isUndoable(userId) == true) {
spenMultiView.updateUndo(page.undo(userId),userId);
}
userId - Id of user.undo(int)public boolean isRedoable(int userId)
if (page.isRedoable(userId) == true) {
spenMultiView.updateRedo(page.undo(userId),userId);
}
userId - Id of user.redo(int)public SpenPageDoc.HistoryUpdateInfo[] undo()
if (page.isUodoable() == true) {
spenSurfaceView.updateUndo(page.undo());
}
isUndoable()public SpenPageDoc.HistoryUpdateInfo[] redo()
if (page.isRedoable() == true) {
spenSurfaceView.updateRedo(page.redo());
}
isRedoable()public SpenPageDoc.HistoryUpdateInfo[] undo(int userId)
if (page.isUndoable(userId) == true) {
spenMultiView.updateUndo(page.undo(userId),userId);
}
userId - Id of user.isUndoable()public SpenPageDoc.HistoryUpdateInfo[] redo(int userId)
if (page.isRedoable(userId) == true) {
spenMultiView.updateRedo(page.undo(userId),userId);
}
userId - Id of user.isRedoable()public SpenPageDoc.HistoryUpdateInfo[] undoAll()
onClickbutton(State state, Button button) {
if(state == LONG_PRESS && button = undoButton) {
spenSurfaceView.updateUndo(page.undoAll());
}
}
undo()public SpenPageDoc.HistoryUpdateInfo[] redoAll()
onClickbutton(State state, Button button) {
if(state == LONG_PRESS && button = redoButton) {
spenSurfaceView.updateRedo(page.redoAll());
}
}
redo()public SpenPageDoc.HistoryUpdateInfo[] undoAll(int userId)
onClickbutton(State state, Button button) {
if(state == LONG_PRESS && button = undoButton) {
spenMultiView.updateUndo(page.undoAll(userId),userId);
}
}
userId - Id of user.undo()public SpenPageDoc.HistoryUpdateInfo[] redoAll(int userId)
HISTORY_MANAGER_MODE_MULTIPLE_VIEW
onClickbutton(State state, Button button) {
if(state == LONG_PRESS && button = redoButton) {
spenMultiView.updateRedo(page.redoAll(userId),userId);
}
}
userId - Id of user.redo()public void setUndoLimit(int undoLimit)
page.setUndoLimit(100);
undoLimit - The undo command limit.getUndoLimit()public int getUndoLimit()
if (page.getLimit() == 0) {
page.setUndoLimit(100);
}
setUndoLimit(int)public void clearHistory()
setHistoryListener(HistoryListener)public void clearRedoHistory()
public void commitHistory(SpenPageDoc.HistoryUpdateInfo userData)
userData - The canvas update data for undo or redo commands.IllegalArgumentException - Throw if parameter userData is null.public void setHistoryListener(SpenPageDoc.HistoryListener listener)
listener - The HistoryListener instance to receive history events.SpenPageDoc.HistoryListenerpublic ArrayList<RectF> getHistoryUpdateRect()
public void setHistoryTag()
undoToTag(),
clearHistoryTag()public void clearHistoryTag()
setHistoryTag()public SpenPageDoc.HistoryUpdateInfo[] undoToTag()
IllegalStateException - Thrown if there is no history tag or history tag out of the undo stack.setHistoryTag()public void startHistoryGroup()
stopHistoryGroup()public void stopHistoryGroup()
IllegalStateException - Thrown if the page document stops history group without start.startHistoryGroup()public void setHistoryManagerMode(int mode)
SpenMultiView) and single
mode (SpenView, SpenSurfaceView).mode - The history manager mode.HISTORY_MANAGER_MODE_SINGLE_VIEWHISTORY_MANAGER_MODE_MULTIPLE_VIEWgetHistoryManagerMode()public int getHistoryManagerMode()
setHistoryManagerMode(int)public void setUserIdForHistoryListener(int userId)
setHistoryManagerMode(int) with HISTORY_MANAGER_MODE_MULTIPLE_VIEWuserId - the specific user id for filtering.setHistoryManagerMode(int)public SpenObjectBase createObject(int type)
type - The object type.SpenObjectBase.TYPE_STROKEpublic SpenObjectBase createObject(int type, boolean isTemplateObject)
type - The object type.SpenObjectBase.TYPE_STROKEisTemplateObject - Set to true to create a template object, set to false to create a non-template object.public boolean isValid()
public void appendObjectList(ArrayList<SpenObjectBase> objectList)
objectList - List of object that will be added to PageDocIllegalStateException - Thrown if one of the objects in objectList has already been added.IllegalArgumentException - Thrown if one of the objects in objectList passed is null.public ArrayList<RectF> getObjectRectList(int type)
type - The object filter.GetObjectRectList(PageDoc.FIND_TYPE_STROKE, points) FIND_TYPE_STROKEFIND_TYPE_ALLIllegalArgumentException - Thrown if the arguments passed are invalid.public static void setDefaultSaveOption(boolean compatibleMode)
compatibleMode - Set to true to save this page for which is compatible with S Pen SDK 3.x, set to false to save this
page for which is used for S Pen SDK 4.0 or later.public boolean equals(Object o)