public final class SpenObjectContainer extends SpenObjectBase
OBJECT_MINIMUM_SIZE, RESIZE_OPTION_DISABLE, RESIZE_OPTION_FREE, RESIZE_OPTION_KEEP_RATIO, SPEN_INFINITY_FLOAT, SPEN_INFINITY_INT, TYPE_CONTAINER, TYPE_IMAGE, TYPE_LINE, TYPE_NONE, TYPE_SHAPE, TYPE_STROKE, TYPE_TEXT_BOX| Constructor and Description |
|---|
SpenObjectContainer()
Creates an SpenObjectContainer instance.
|
SpenObjectContainer(ArrayList<SpenObjectBase> objectList)
Creates an SpenObjectContainer instance with the specified object list.
|
SpenObjectContainer(ArrayList<SpenObjectBase> objectList,
boolean isTemplateObject)
Creates an SpenObjectContainer instance with the specified object list and the specified template status.
|
SpenObjectContainer(boolean isTemplateObject)
Creates an SpenObjectContainer instance with the specified template status.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendObject(ArrayList<SpenObjectBase> objectList)
Add the specified list of objects to the container.
|
void |
appendObject(SpenObjectBase object)
Add the specified object to the container.
|
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 Container object.
|
SpenObjectBase |
createObject(int type)
Create a new object instance for the specific type.
|
SpenObjectBase |
getObject(int index)
Get the object for the specified index.
|
ArrayList<SpenObjectBase> |
getObjectList()
Get the list of all objects in the object container.
|
RectF |
getRect()
Get the rectangle of the region.
|
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 |
isInvisibleChildResizeEnabled()
Check if invisible children objects can resize when container object is resized.
|
boolean |
isUngroupEnabled()
Check if the objects can be ungrouped.
|
void |
removeObject(ArrayList<SpenObjectBase> objectList)
Remove the specified object list.
|
void |
removeObject(SpenObjectBase object)
Remove the specified object.
|
boolean |
setInvisibleChildResizeEnabled(boolean enable)
Enable or disable the resizing attribute of invisible children objects.
|
void |
setRect(RectF rect,
boolean regionOnly)
Set the specified rectangle of the region.
|
void |
setRotation(float degree)
Set the specified rotation angle.
|
void |
setUngroupEnabled(boolean enable)
Enable or disable the ungroupability of the objects.
|
attachFile, detachFile, equals, getAttachedFile, getDrawnRect, getExtraDataByteArray, getExtraDataInt, getExtraDataString, getExtraDataStringArray, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getResizeOption, getRotation, getRuntimeHandle, getSorDataInt, getSorDataString, getSorInfo, getSorPackageLink, getTemplateProperty, getType, getUserId, hasExtraDataByteArray, hasExtraDataInt, hasExtraDataString, hasExtraDataStringArray, hashCode, hasSorDataInt, hasSorDataString, isFlipEnabled, isMovable, isOutOfViewEnabled, isRecorded, isRotatable, isSelectable, isVisible, removeExtraDataByteArray, removeExtraDataInt, removeExtraDataString, removeExtraDataStringArray, removeSorDataInt, removeSorDataString, setExtraDataByteArray, setExtraDataInt, setExtraDataString, setExtraDataStringArray, setFlipEnabled, setMaxSize, setMinSize, setMovable, setOutOfViewEnabled, setRecorded, setResizeOption, setRotatable, setSelectable, setSorDataInt, setSorDataString, setSorInfo, setSorPackageLink, setUserId, setVisibilitypublic SpenObjectContainer()
public SpenObjectContainer(boolean isTemplateObject)
isTemplateObject - If you set as true, create a template object,public SpenObjectContainer(ArrayList<SpenObjectBase> objectList)
objectList - The list object.SpenAlreadyClosedException - Thrown if objectList is list objects that have ObjectBase with TYPE_NONE.appendObject(ArrayList)public SpenObjectContainer(ArrayList<SpenObjectBase> objectList, boolean isTemplateObject)
objectList - The list object.isTemplateObject - If you set as true, create a template objectappendObject(ArrayList)public SpenObjectBase createObject(int type)
type - The valid values are SpenObjectBase.TYPE_STROKE, SpenObjectBase.TYPE_TEXT_BOX,
SpenObjectBase.TYPE_IMAGE, SpenObjectBase.TYPE_CONTAINER.type passed is invalid.public void appendObject(SpenObjectBase object)
object - The object to be added to the container.IllegalStateException - Thrown if the object has already been added on the page.
exception.IllegalArgumentException - Thrown if the object passed is null.
Thrown if the object passed is itself.public void appendObject(ArrayList<SpenObjectBase> objectList)
objectList - The object list to be added to the container.IllegalStateException - Thrown if the object list has already been added on the page.IllegalArgumentException - Thrown if the object list passed is null.IllegalArgumentException - Thrown if there are duplicate objects in the object list.
Thrown if there is itself in the object list.public void setRect(RectF rect, boolean regionOnly)
regionOnly parameter if it is true.
because the region of ObjectContainer is determined by the union rectangle of the contained objects.regionOnly parameter is false, all of contained objects should be moved or resized.setRect in class SpenObjectBaserect - The rectangle of the region.regionOnly - Set to true to not change the internal data.IllegalArgumentException - Thrown if rect is null.public void removeObject(SpenObjectBase object)
object - The object.IllegalArgumentException - Thrown if the object passed is null.public void removeObject(ArrayList<SpenObjectBase> objectList)
objectList - The list object.IllegalArgumentException - Thrown if objectList is null.public SpenObjectBase getObject(int index)
index - The object index.IndexOutOfBoundsException - Thrown if the index passed is a negative value or if it is greater than the number of objects.public ArrayList<SpenObjectBase> getObjectList()
public void setUngroupEnabled(boolean enable)
true false, you can ungroup the container by calling the
SpenPageDoc.ungroupObject(SpenObjectContainer, boolean).enable - Set to true to enable the ungroupability of the objects.public boolean isUngroupEnabled()
true, the object can be ungrouped.setUngroupEnabled(boolean)public boolean setInvisibleChildResizeEnabled(boolean enable)
true enable - Set to true to enable resizing invisible children objects.isInvisibleChildResizeEnabled()public boolean isInvisibleChildResizeEnabled()
true, this container resize invisible childsetInvisibleChildResizeEnabled(boolean)public void clearChangedFlag()
SpenObjectBaseclearChangedFlag in class SpenObjectBasepublic boolean isChanged()
SpenObjectBaseisChanged in class SpenObjectBasetrue if object data is changed or created. Otherwise false.public void setRotation(float degree)
SpenObjectBasesetRotation in class SpenObjectBasedegree - The angle to rotate.public void copy(SpenObjectBase source)
copy in class SpenObjectBasesource - The source object.IllegalArgumentException - Thrown if class type is different.
Or if source is null.public RectF getRect()
SpenObjectBasegetRect in class SpenObjectBase