public class SpenObjectBase extends Object
| Modifier and Type | Field and Description |
|---|---|
static float |
OBJECT_MINIMUM_SIZE
The minimum size of object
|
static int |
RESIZE_OPTION_DISABLE
Resizing disabled.
|
static int |
RESIZE_OPTION_FREE
Free resizing without maintaining the ratio.
|
static int |
RESIZE_OPTION_KEEP_RATIO
Resizing while keeping the ratio.
|
static float |
SPEN_INFINITY_FLOAT
Infinity value of float type.
|
static int |
SPEN_INFINITY_INT
Infinity value of integer type.
|
static int |
TYPE_CONTAINER
ObjectContainer object.
|
static int |
TYPE_IMAGE
ObjectImage object.
|
static int |
TYPE_LINE |
static int |
TYPE_NONE
Invalid object.
|
static int |
TYPE_SHAPE |
static int |
TYPE_STROKE
ObjectStroke object.
|
static int |
TYPE_TEXT_BOX
ObjectTextBox object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
attachFile(String filePath)
Attach the specified file to the object.
|
void |
clearChangedFlag()
Clear the set changed flag.
The changed flag is set when object data is changed using the API. If this object is saved by SpenPageDoc, clear the flag. |
void |
copy(SpenObjectBase source)
Copy data from the specified object.
|
void |
detachFile()
Detach the file from the Object.
|
boolean |
equals(Object o)
Check if the specified object is the same as the current object.
|
String |
getAttachedFile()
Get the attached file.
|
RectF |
getDrawnRect()
Get the region that the rectangle takes up in the viewport.
|
byte[] |
getExtraDataByteArray(String key)
Get the extra byte array data for the specified key.
|
int |
getExtraDataInt(String key)
Get the extra integer data.
|
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.
|
float |
getMaxHeight()
Get the maximum height.
Default value is undefined big number. Object cannot be bigger than maximum height set by user. |
float |
getMaxWidth()
Get the maximum width.
Default value is undefined big number. Object cannot be bigger than maximum width set by user. And if maximum width is set by setMaxSize(float, float) over to page width, it should return 2 times the
width of the current page. |
float |
getMinHeight()
Get the minimum height.
Object cannot be smaller than minimum height set by user. |
float |
getMinWidth()
Get the minimum width.
The Object cannot be smaller than the minimum width set by user. |
RectF |
getRect()
Get the rectangle of the region.
|
int |
getResizeOption()
Get the resize option.
|
float |
getRotation()
Get the rotation angle by degree.
|
int |
getRuntimeHandle()
Get the runtime handle of the object.
|
int |
getSorDataInt(String key)
Get the SOR (S -Pen Object Runtime) integer data.
|
String |
getSorDataString(String key)
Get the SOR (S -Pen Object Runtime) string data.
|
String |
getSorInfo()
Get the SOR(S-Pen Object Runtime) information..
|
String |
getSorPackageLink()
Get the link to the SOR installation.
|
boolean |
getTemplateProperty()
Check if the object belongs to a template.
|
int |
getType()
Get the object type.
|
int |
getUserId()
Get the user ID for the object.
|
boolean |
hasExtraDataByteArray(String key)
Check if extra byte array data for the specified key exists.
|
boolean |
hasExtraDataInt(String key)
Check if extra integer data for the specified key exists.
|
boolean |
hasExtraDataString(String key)
Check if extra string data for the specified key exists.
|
boolean |
hasExtraDataStringArray(String key)
Check if extra string array data for the specified key exists.
|
int |
hashCode()
Get the hash code for this object.
|
boolean |
hasSorDataInt(String key)
Check if SOR (S -Pen Object Runtime) integer data for the specified key exists.
|
boolean |
hasSorDataString(String key)
Check if SOR (S -Pen Object Runtime) string data exists for the specified key.
|
boolean |
isChanged()
Check if the object is changed.
The changed flag is set when object data is changed using the API. If this object is saved by SpenPageDoc, clear the flag. |
boolean |
isFlipEnabled()
Check if flip is enabled for the object.
|
boolean |
isMovable()
Check if the object is movable.
|
boolean |
isOutOfViewEnabled()
Check if moving the object outside SpenView is enabled.
|
boolean |
isRecorded()
Check if the object is recorded.
|
boolean |
isRotatable()
Check if the object can be rotated.
|
boolean |
isSelectable()
Check if the object is selectable.
|
boolean |
isVisible()
Check if the object is visible.
|
void |
removeExtraDataByteArray(String key)
Remove the extra byte array data for the specified key.
|
void |
removeExtraDataInt(String key)
Remove the extra integer data for the specified key.
|
void |
removeExtraDataString(String key)
Remove the extra string data for the specified key.
|
void |
removeExtraDataStringArray(String key)
Remove the extra string array data for the specified key.
|
void |
removeSorDataInt(String key)
Remove the specified SOR (S -Pen Object Runtime) integer data for the specified key.
If SOR data is not found by key, this function does not throw exception. |
void |
removeSorDataString(String key)
Remove the specified SOR (S -Pen Object Runtime) string data for the specified key.
If SOR data is not found by key, this function does not throw exception. |
void |
setExtraDataByteArray(String key,
byte[] value)
Set the extra byte array data for the specified key.
If you modify the extra data, it is not saved in the command history. |
void |
setExtraDataInt(String key,
int value)
Set the extra integer data for the specified key.
If you modify the extra data, it is not saved in the command history. |
void |
setExtraDataString(String key,
String value)
Set the extra string data for the specified key.
If you modify the extra data, it is not saved in the command history. You cannot restore it by calling SpenPageDoc.undo(). |
void |
setExtraDataStringArray(String key,
String[] value)
Set the extra string array data for the specified key.
If you modify the extra data, it is not saved in the command history. |
void |
setFlipEnabled(boolean enable)
Enable or disable the flip attribute of the object.
|
void |
setMaxSize(float width,
float height)
Set the specified maximum size.
|
void |
setMinSize(float width,
float height)
Set the specified minimum size.
|
void |
setMovable(boolean enable)
Enable of disable the movability of the object.
|
void |
setOutOfViewEnabled(boolean enable)
Enable or disable moving the object outside SpenView.
|
void |
setRecorded(boolean record)
Enable or disable object insertion while recording.
|
void |
setRect(RectF rect,
boolean regionOnly)
Set the specified rectangle for the region.
Use this method to resize and move the region. |
void |
setResizeOption(int option)
Set the specified resize option.
|
void |
setRotatable(boolean enable)
Enable or disable object rotation.
|
void |
setRotation(float degree)
Set the specified rotation angle.
|
void |
setSelectable(boolean enable)
Enable or disable the selectability of the object.
|
void |
setSorDataInt(String key,
int value)
Set the SOR (S -Pen Object Runtime) integer data.
SOR integer data is similar to extra data. |
void |
setSorDataString(String key,
String value)
Set the SOR (S -Pen Object Runtime) string data.
SOR string data is similar to extra data. |
void |
setSorInfo(String info)
Set the SOR(S-Pen Object Runtime) information(SOR package name) related this object.
|
void |
setSorPackageLink(String link)
Set the specified package link for the SOR installation.
|
boolean |
setUserId(int userId)
Set the specified user for the object.
|
void |
setVisibility(boolean visible)
Show or hide the object.
|
public static final int TYPE_NONE
public static final int TYPE_STROKE
SpenObjectStroke,
Constant Field Valuespublic static final int TYPE_TEXT_BOX
SpenObjectTextBox,
Constant Field Valuespublic static final int TYPE_IMAGE
SpenObjectImage,
Constant Field Valuespublic static final int TYPE_CONTAINER
SpenObjectContainer,
Constant Field Valuespublic static final int TYPE_SHAPE
public static final int TYPE_LINE
public static final int RESIZE_OPTION_FREE
setResizeOption(int),
Constant Field Valuespublic static final int RESIZE_OPTION_KEEP_RATIO
setResizeOption(int),
Constant Field Valuespublic static final int RESIZE_OPTION_DISABLE
setResizeOption(int),
Constant Field Valuespublic static final int SPEN_INFINITY_INT
public static final float SPEN_INFINITY_FLOAT
public static final float OBJECT_MINIMUM_SIZE
public int getType()
TYPE_STROKE, TYPE_TEXT_BOX, TYPE_IMAGE and TYPE_CONTAINER.public void setRect(RectF rect, boolean regionOnly)
rect - The rectangle of region.regionOnly - Set to true to not allow the internal data to be changed, set to false to let rectangle change the
internal data.public RectF getRect()
public void setRecorded(boolean record)
record - Set to true to insert objects during recording, set to false to not insert objects during the
recording.public boolean isRecorded()
true, the object is recored.public void setVisibility(boolean visible)
visible - Set to true to show the object, set to false to hide the object.public boolean isVisible()
true, the object is visible.setVisibility(boolean)public void setResizeOption(int option)
RESIZE_OPTION_DISABLE, the setRect(android.graphics.RectF, boolean) method
works.option - The resize option.RESIZE_OPTION_DISABLEpublic int getResizeOption()
RESIZE_OPTION_FREE and RESIZE_OPTION_KEEP_RATIO.public void setMinSize(float width,
float height)
setRect(android.graphics.RectF, boolean) method works.width or height is less than OBJECT_MINIMUM_SIZE, the minimum width or height
of Object will be OBJECT_MINIMUM_SIZE.width - The width.height - The height.IllegalArgumentException - Thrown if width or height is less than 0.
If max size is set, thrown if width or height is greater than maximum of width or
height.OBJECT_MINIMUM_SIZEpublic float getMinWidth()
public float getMinHeight()
public void setMaxSize(float width,
float height)
setRect(android.graphics.RectF, boolean) method works.width - The widthheight - The heightIllegalArgumentException - Thrown if width is less than the minWidth or height is less than the minHeight.getMaxHeight(),
getMaxWidth()public float getMaxWidth()
setMaxSize(float, float) over to page width, it should return 2 times the
width of the current page. setMaxSize(float, float)public float getMaxHeight()
setMaxSize(float, float) over to page height, it should return 2 times
the height of current page.setMaxSize(float, float)public void setRotation(float degree)
degree - The angle to rotate.public float getRotation()
public void setRotatable(boolean enable)
truetrue, this object can be rotated by user input on SpenView.
But, even if this is set to false, setRotation(float) should work. It just has an
influence on authoring of SpenView.enable - Set to true to enable object rotation.public boolean isRotatable()
true, the object can be rotated.public void setOutOfViewEnabled(boolean enable)
truetrue, a part of object can be moved from SpenView area
when user move that after select.enable - Set to true to enable moving the object outside SpenViewpublic boolean isOutOfViewEnabled()
true, the part of object can move to SpenView outside.setOutOfViewEnabled(boolean)public void setSelectable(boolean enable)
truetrue, this object can be selected by user input.
But, even if false, this object can be selected by SpenPageDoc.selectObject(com.samsung.android.sdk.pen.document.SpenObjectBase).
It just influence on authoring of SpenView.enable - Set to true to enable the selectability of the object.public boolean isSelectable()
true, the object is selectable.setSelectable(boolean)public void setMovable(boolean enable)
true true, this object can be moved by user input.
But, even if false, this object can be moved by setRect(android.graphics.RectF, boolean) It just influence on
authoring of SpenView.enable - Set to true to enable the object to be moved.public boolean isMovable()
true, the object is movable.setMovable(boolean)public void setFlipEnabled(boolean enable)
true false, the object can be flipped by setRect(android.graphics.RectF, boolean)enable - Set to true to enable the flip attribute.isFlipEnabled()public boolean isFlipEnabled()
true, the filp is enabled.setFlipEnabled(boolean)public void setSorInfo(String info)
info - The SOR Information. This can be interpreted by Object Runtime Manager.public String getSorInfo()
public void setSorPackageLink(String link)
link - The link for SOR installation.public String getSorPackageLink()
setSorPackageLink(java.lang.String)public boolean getTemplateProperty()
true, the object belongs to a template.public boolean setUserId(int userId)
userId - The user for the object.true, the object is set successfully.public int getUserId()
public void setSorDataString(String key, String value)
key - The key for SOR data.value - The SOR (S -Pen Object Runtime) string data.IllegalArgumentException - Thrown if the key passed is null.public String getSorDataString(String key)
key - The key for the data.public void setSorDataInt(String key, int value)
key - The key for the data.value - The SOR integer data.IllegalArgumentException - Thrown if the key passed is null.public int getSorDataInt(String key)
key - The key for the data.public boolean hasSorDataString(String key)
key - The key for the data.true, the SOR string data for the specified key exists.public boolean hasSorDataInt(String key)
key - The key for the data.true, the SOR integer data for the specified key exists.public void removeSorDataString(String key)
key, this function does not throw exception.key - The key for the data.public void removeSorDataInt(String key)
key, this function does not throw exception.key - The key for the data.public void setExtraDataString(String key, String value)
key - The key for the data.value - The string data.IllegalArgumentException - Thrown if key passed is null.public String getExtraDataString(String key)
key - The key for the data.public boolean hasExtraDataString(String key)
key - The key for the data.true, the extra string data for the key exists.public void removeExtraDataString(String key)
key, this function does not throw exception.key - The key for the data.public void setExtraDataInt(String key, int value)
key - The key for the data.value - The extra integer data.IllegalArgumentException - Thrown if the keypassed is null.public int getExtraDataInt(String key)
key - The key for the data,public boolean hasExtraDataInt(String key)
key - The key for the data.true, the extra integer data for the specified key exists.public void removeExtraDataInt(String key)
key, this function does not throw exception.key - The key for the data.public void setExtraDataStringArray(String key, String[] value)
key - The key for the data.value - The extra string array data.IllegalArgumentException - Thrown if key passed is null.public String[] getExtraDataStringArray(String key)
key - The key for the data.public boolean hasExtraDataStringArray(String key)
key - The key for the data.true, the extra string array data for the specified key exists.public void removeExtraDataStringArray(String key)
key, this function does not throw exception.key - The key for the data.public void setExtraDataByteArray(String key, byte[] value)
key - The key for the data.value - The byte array data.IllegalArgumentException - Thrown if key passed is null.public byte[] getExtraDataByteArray(String key)
key - The key for the data.public boolean hasExtraDataByteArray(String key)
key - The key for the data.true, the extra byte array data for the specified key exists.public void removeExtraDataByteArray(String key)
key, this function does not throw exception.key - The key for the data.public void clearChangedFlag()
public boolean isChanged()
true if object data is changed or created. Otherwise false.public void attachFile(String filePath)
filePath - The absolute path of the file.IllegalArgumentException - Thrown if filepath is null.public void detachFile()
attachFile(String)public String getAttachedFile()
public int getRuntimeHandle()
public RectF getDrawnRect()
getRect()public void copy(SpenObjectBase source)
source - The source object.IllegalArgumentException - Thrown if class type is different.
Or if source is null.SpenAlreadyClosedException - Thrown if this object or the source object has TYPE_NONE.public boolean equals(Object o)