public abstract class SpenControlBase extends View
getObjectList() methods, return a list
of objects (which are defined as SpenObjectBase).| Modifier and Type | Field and Description |
|---|---|
static int |
STYLE_BORDER_NONE
Define the style of object border.
|
static int |
STYLE_BORDER_NONE_ACTION_NONE
Define the style of object border.
|
static int |
STYLE_BORDER_OBJECT
Define the style of object border.
|
static int |
STYLE_BORDER_STATIC
Define the style of object border.
|
| Constructor and Description |
|---|
SpenControlBase(Context context,
SpenPageDoc pageDoc)
ControlBase constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the SpenControlBase instance.
|
void |
fit()
Fit control region according to object's size in list.
|
ArrayList<SpenContextMenuItemInfo> |
getContextMenu()
Get the current context menu.
|
RectF |
getMinResizeRect()
Get the minimum resize area.
|
ArrayList<SpenObjectBase> |
getObjectList()
Get the list of selected objects.
|
int |
getPixel(int x,
int y)
Get the color at the specified location.
|
RectF |
getRect()
Get the current area.
|
int |
getStyle()
Get the object border style.
|
boolean |
isClosed()
Check if the context menu is closed.
|
boolean |
isContextMenuItemEnabled(int id)
Check if the specified context menu item is enabled.
|
boolean |
isContextMenuVisible()
Check if the context menu is visible.
|
boolean |
isDimEnabled()
Check if dimming is enabled for the control.
|
boolean |
isObjectOutlineEnabled()
Check if object outline is enabled
|
boolean |
isTouchEnabled()
Check if touch event handling is enabled.
|
void |
onDraw(Canvas canvas)
This is called when requested to be drawn.
|
boolean |
onHoverEvent(MotionEvent event)
Called when hover events occur.
|
boolean |
onTouchEvent(MotionEvent event)
This function is called when touch event is occurred.
|
void |
onWindowFocusChanged(boolean hasWindowFocus)
Called when the window containing this view gains or loses focus.
|
void |
setContextMenu(ArrayList<SpenContextMenuItemInfo> menuItem)
Set the specified list of items for the context menu.
|
void |
setContextMenuItemEnabled(int id,
boolean enable)
Enable or disable the specified context menu item.
|
void |
setContextMenuVisible(boolean visible)
Enable or disable the visibility of the context menu.
|
void |
setDimEnabled(boolean enable)
Enable or disable dimming for the control.
|
void |
setMinResizeRect(RectF rect)
Set the specified area as the minimum resize area.
|
void |
setObjectOutlineEnabled(boolean enable)
Enable or disable object outline.
|
void |
setStyle(int style)
Set the specified style for the object border.
|
void |
setTouchEnabled(boolean enable)
Enable or disable touch event handling.
|
public static final int STYLE_BORDER_OBJECT
public static final int STYLE_BORDER_NONE
public static final int STYLE_BORDER_STATIC
public static final int STYLE_BORDER_NONE_ACTION_NONE
public SpenControlBase(Context context, SpenPageDoc pageDoc)
context - The context for the application.pageDoc - The current page document.public boolean onHoverEvent(MotionEvent event)
onHoverEvent in class Viewevent - The MotionEvent instancepublic boolean onTouchEvent(MotionEvent event)
onTouchEvent in class Viewpublic void onDraw(Canvas canvas)
public void onWindowFocusChanged(boolean hasWindowFocus)
onWindowFocusChanged in class ViewhasWindowFocus - Set to true when window has focus, set to false when window loses focus.public boolean isClosed()
public boolean isContextMenuVisible()
setContextMenuVisible(boolean)public boolean isContextMenuItemEnabled(int id)
id - The context menu item ID.public boolean isDimEnabled()
setDimEnabled(boolean)public boolean isTouchEnabled()
setTouchEnabled(boolean)public boolean isObjectOutlineEnabled()
public void close()
public void fit()
public void setStyle(int style)
style - The border style to set. See Field Detail in this class, STYLE_BORDER_OBJECT,
STYLE_BORDER_NONE, STYLE_BORDER_STATIC.IllegalArgumentException - Thrown when the specified style does not exist.getStyle()public void setContextMenu(ArrayList<SpenContextMenuItemInfo> menuItem)
menuItem - Context Menu Item ListgetContextMenu()public void setContextMenuItemEnabled(int id,
boolean enable)
id - The ID of the context menu item that you want to enable.enable - Set to true to enable the context menu item, set to false to disable the context menu item.public void setContextMenuVisible(boolean visible)
visible - Context visible attribute.
Set to true to make the context menu visible,
set to false to make it invisible.isContextMenuVisible()public void setTouchEnabled(boolean enable)
enable - Set to true to handle the touch event,
set to false to ignore and pass the touch event to the
behind window.isTouchEnabled()public void setMinResizeRect(RectF rect)
rect - The minimum resize area.IllegalArgumentException - Thrown if rect is null.public void setDimEnabled(boolean enable)
enable - Set to true to dim everything behind this control,
set to false to ensure that the screen does not change anything.isDimEnabled()public void setObjectOutlineEnabled(boolean enable)
enable - Set to true to enable object outline, set to false to disable object outline.public RectF getRect()
public int getStyle()
STYLE_BORDER_OBJECT, STYLE_BORDER_NONE,
or STYLE_BORDER_STATIC setStyle(int)public ArrayList<SpenContextMenuItemInfo> getContextMenu()
public RectF getMinResizeRect()
public ArrayList<SpenObjectBase> getObjectList()
public int getPixel(int x,
int y)
x - The original raw X coordinate.y - The original raw Y coordinate.