Class EditPolygonImageView
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback
,android.view.KeyEvent.Callback
,android.view.ViewManager
,android.view.ViewParent
,android.view.accessibility.AccessibilityEventSource
public final class EditPolygonImageView extends FrameLayout
Shows image of document and polygon, which contains document coordinates with ability to change polygon corners and edges.
Magnifier is shown when polygon corners are moved.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
EditPolygonImageView.EditPolygonAnimationEndListener
Callback to track polygon animation during rotations.
public interface
EditPolygonImageView.EditPolygonDragListener
Callback to track the changing of the state of the polygon selection.
public interface
EditPolygonImageView.EditPolygonDragStateListener
Callback to track the change of the state of dragging.
-
Field Summary
Fields Modifier and Type Field Description private final Drawable
drawable
private Boolean
isPointsDraggable
private List<PointF>
polygon
private Boolean
fullPolygonSelected
-
Constructor Summary
Constructors Constructor Description EditPolygonImageView(Context context, AttributeSet attrs)
-
Method Summary
Modifier and Type Method Description final Drawable
getDrawable()
final Boolean
isPointsDraggable()
Control whether view is in editMode eg. final Unit
setPointsDraggable(Boolean isPointsDraggable)
Control whether view is in editMode eg. final List<PointF>
getPolygon()
final Unit
setPolygon(List<PointF> polygon)
Set polygon containing document coordinates. final Boolean
getFullPolygonSelected()
final Unit
setFullPolygonSelected(Boolean fullPolygonSelected)
Unit
setRotation(Float rotation)
final Unit
setRotationAnimated(Float rotation)
final Unit
setLines(List<Line2D> horizontalLines, List<Line2D> verticalLines)
Sets detected horizontal and vertical lines. final Unit
setEdgeColor(Integer color)
Sets edge color. final Unit
setAnchorPointsColor(Integer color)
Sets anchor points color. final Unit
setEdgeColorOnLine(Integer color)
Sets edge color on line. final Unit
setEdgeWidth(Float width)
Sets edge width in pixels. final Unit
rotateClockwise()
Rotates view clockwise. final Unit
rotateCounterClockwise()
Rotates view counterclockwise. Boolean
onTouchEvent(MotionEvent event)
final Unit
setImageBitmap(Bitmap bitmap)
Set bitmap to the image view. final Unit
setMagnifier(MagnifierView magnifier)
final Unit
setEditPolygonAnimationEndListener(EditPolygonImageView.EditPolygonAnimationEndListener editPolygonAnimationEndListener)
Sets listener which will be invoked when animation will be finished. final Unit
setEditPolygonDragListener(EditPolygonImageView.EditPolygonDragListener editPolygonDragListener)
Sets listener which will be invoked when the state of the polygon selection changes. final Unit
setEditPolygonDragStateListener(EditPolygonImageView.EditPolygonDragStateListener editPolygonDragStateListener)
Sets the listener which helps to track the change of the state of dragging. -
-
Constructor Detail
-
EditPolygonImageView
EditPolygonImageView(Context context, AttributeSet attrs)
-
-
Method Detail
-
getDrawable
final Drawable getDrawable()
-
isPointsDraggable
final Boolean isPointsDraggable()
Control whether view is in editMode eg. points draggable.
-
setPointsDraggable
final Unit setPointsDraggable(Boolean isPointsDraggable)
Control whether view is in editMode eg. points draggable.
-
getPolygon
final List<PointF> getPolygon()
-
setPolygon
final Unit setPolygon(List<PointF> polygon)
Set polygon containing document coordinates.
-
getFullPolygonSelected
final Boolean getFullPolygonSelected()
-
setFullPolygonSelected
final Unit setFullPolygonSelected(Boolean fullPolygonSelected)
-
setRotation
Unit setRotation(Float rotation)
-
setRotationAnimated
final Unit setRotationAnimated(Float rotation)
-
setLines
final Unit setLines(List<Line2D> horizontalLines, List<Line2D> verticalLines)
Sets detected horizontal and vertical lines.
-
setEdgeColor
final Unit setEdgeColor(Integer color)
Sets edge color.
- Parameters:
color
- The new color (including alpha) to set in the paint.
-
setAnchorPointsColor
final Unit setAnchorPointsColor(Integer color)
Sets anchor points color.
- Parameters:
color
- The new color (including alpha) to set in the paint.
-
setEdgeColorOnLine
final Unit setEdgeColorOnLine(Integer color)
Sets edge color on line.
- Parameters:
color
- The new color (including alpha) to set in the paint.
-
setEdgeWidth
final Unit setEdgeWidth(Float width)
Sets edge width in pixels.
- Parameters:
width
- set the paint's stroke width.
-
rotateClockwise
final Unit rotateClockwise()
Rotates view clockwise.
-
rotateCounterClockwise
final Unit rotateCounterClockwise()
Rotates view counterclockwise.
-
onTouchEvent
Boolean onTouchEvent(MotionEvent event)
-
setImageBitmap
final Unit setImageBitmap(Bitmap bitmap)
Set bitmap to the image view.
-
setMagnifier
final Unit setMagnifier(MagnifierView magnifier)
- Parameters:
magnifier
- which will be notified when image should be "magnified".
-
setEditPolygonAnimationEndListener
final Unit setEditPolygonAnimationEndListener(EditPolygonImageView.EditPolygonAnimationEndListener editPolygonAnimationEndListener)
Sets listener which will be invoked when animation will be finished.
-
setEditPolygonDragListener
final Unit setEditPolygonDragListener(EditPolygonImageView.EditPolygonDragListener editPolygonDragListener)
Sets listener which will be invoked when the state of the polygon selection changes.
-
setEditPolygonDragStateListener
final Unit setEditPolygonDragStateListener(EditPolygonImageView.EditPolygonDragStateListener editPolygonDragStateListener)
Sets the listener which helps to track the change of the state of dragging.
-
-
-
-