org.arakhne.afc.ui.android.zoom
public abstract class ZoomableView extends android.view.View implements ZoomableContext
The implementation of the ZoomableView handles the pointer and key events as following:
| Event | Status | Callback | Note |
|---|---|---|---|
| POINTER_PRESSED | supported | onPointerPressed(PointerEvent) | Allways called |
| POINTER_DRAGGED | supported | onPointerDragged(PointerEvent) | Called only when the scale and move gestures are not in progress |
| POINTER_RELEASED | supported | onPointerReleased(PointerEvent) | Called only when the scale and move gestures are not in progress |
| POINTER_MOVED | not supported | Pointer move on a touch screen cannot be detected? | |
| POINTER_CLICK | not supported | See View.setOnClickListener(OnClickListener) | |
| POINTER_LONG_CLICK | not supported | See View.setOnLongClickListener(OnLongClickListener) | |
| KEY_PRESSED | not supported | See View.onKeyDown(int, android.view.KeyEvent) | |
| KEY_RELEASED | not supported | See View.onKeyUp(int, android.view.KeyEvent) | |
| KEY_TYPED | not supported | See View.onKeyUp(int, android.view.KeyEvent) |
The function onDrawView(Canvas, float, CenteringTransform)} may
use an instance of the graphical context DroidZoomableGraphics2D to draw
the elements according to the zooming attributes.
DroidZoomableGraphics2Dandroid.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnAttachStateChangeListener, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListenerALPHA, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_RESOLVED_DEFAULT, TRANSLATION_X, TRANSLATION_Y, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y| Constructor and Description |
|---|
ZoomableView(android.content.Context context) |
ZoomableView(android.content.Context context,
android.util.AttributeSet attrs) |
ZoomableView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract DocumentWrapper |
createDocumentWrapper()
Invoked by the constructor to create a wrapper to the
data of the viewed document.
|
boolean |
fitView()
Reset the view so that the document is fitting the
drawing area.
|
float |
getFocusX() |
float |
getFocusY() |
float |
getMaxScalingFactor() |
float |
getMinScalingFactor() |
protected abstract float |
getPreferredFocusX()
Replies the preferred position of the focus point.
|
protected abstract float |
getPreferredFocusY()
Replies the preferred position of the focus point.
|
float |
getScalingFactor() |
float |
getScalingFactorToFit()
Replies the scaling factor that may be used
to fit the content of the document to the
drawing area.
|
float |
getScalingSensitivity() |
float |
getViewportCenterX()
Replies the X coordinate of the center of the viewport (in screen coordinate).
|
float |
getViewportCenterY()
Replies the Y coordinate of the center of the viewport (in screen coordinate).
|
boolean |
isIgnoreRepaint()
Replies if the repaint requests are ignored or not.
|
boolean |
isMoveDirectionInverted()
Replies if the direction of moving is inverted.
|
boolean |
isXAxisInverted() |
boolean |
isYAxisInverted() |
float |
logical2pixel_size(float l) |
float |
logical2pixel_x(float l) |
float |
logical2pixel_y(float l) |
void |
logical2pixel(Circle2f r) |
void |
logical2pixel(Ellipse2f e) |
PathIterator2f |
logical2pixel(PathIterator2f p) |
void |
logical2pixel(Point2f p) |
void |
logical2pixel(Rectangle2f r) |
void |
logical2pixel(RoundRectangle2f r) |
void |
logical2pixel(Segment2f s) |
Shape2f |
logical2pixel(Shape2f s) |
protected void |
onClick(PointerEvent e)
Invoked when a short-click is detected.
|
void |
onDraw(android.graphics.Canvas canvas) |
protected abstract void |
onDrawView(android.graphics.Canvas canvas,
float scaleFactor,
CenteringTransform centeringTransform)
Invoked to paint the view after it is translated and scaled.
|
protected void |
onLongClick(PointerEvent e)
Invoked when a long-click is detected.
|
protected void |
onPointerDragged(PointerEvent e)
Invoked when the pointer is moved with a button down.
|
protected void |
onPointerPressed(PointerEvent e)
Invoked when the a touch-down event is detected.
|
protected void |
onPointerReleased(PointerEvent e)
Invoked when the a touch-up event is detected.
|
boolean |
onScale(float focusX,
float focusY,
float requestedScaleFactor)
Invoked when the view must be scaled.
|
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh) |
boolean |
onTouchEvent(android.view.MotionEvent ev) |
protected void |
onUpdateViewParameters()
Update any viewing parameter according to the
current value of the focus point and the scaling factor.
|
float |
pixel2logical_size(float l) |
float |
pixel2logical_x(float l) |
float |
pixel2logical_y(float l) |
void |
pixel2logical(Circle2f r) |
void |
pixel2logical(Ellipse2f e) |
PathIterator2f |
pixel2logical(PathIterator2f p) |
void |
pixel2logical(Point2f p) |
void |
pixel2logical(Rectangle2f r) |
void |
pixel2logical(RoundRectangle2f r) |
void |
pixel2logical(Segment2f s) |
Shape2f |
pixel2logical(Shape2f s) |
void |
repaint()
Invalidate this view wherever this function is invoked.
|
void |
repaint(float x,
float y,
float width,
float height)
Invalidate this view wherever this function is invoked.
|
void |
repaint(android.graphics.Rect r)
Invalidate this view wherever this function is invoked.
|
void |
repaint(Rectangle2f r)
Invalidate this view wherever this function is invoked.
|
void |
repaint(android.graphics.RectF r)
Invalidate this view wherever this function is invoked.
|
boolean |
resetView()
Reset the view to the default configuration.
|
void |
setFocusPoint(float x,
float y)
Set the position of the focus point.
|
void |
setIgnoreRepaint(boolean ignore)
Set if the repaint requests are ignored or not.
|
void |
setMaxScalingFactor(float factor)
Set the maximal scaling factor allowing in the view
|
void |
setMinScalingFactor(float factor)
Set the minimal scaling factor allowing in the view
|
void |
setMoveDirectionInverted(boolean invert)
Set if the direction of moving is inverted.
|
void |
setOnClickListener(android.view.View.OnClickListener l) |
void |
setOnLongClickListener(android.view.View.OnLongClickListener l) |
boolean |
setScalingFactor(float factor)
Set the scaling factor.
|
protected boolean |
setScalingFactorAndFocus(float scalingX,
float scalingY,
float factor)
Set the scaling factor.
|
void |
setScalingFactorForPixelRatio(float ratio)
Change the scaling factor to have the specified
ratio between 1 pixel and 1 unit in the document.
|
void |
setScalingSensitivity(float sensivility)
Replies the sensivility of the
zoomIn()
and zoomOut() actions. |
void |
setXAxisInverted(boolean invert)
Invert or not the X axis.
|
void |
setYAxisInverted(boolean invert)
Invert or not the Y axis.
|
void |
toast(int message,
boolean isLong)
Show a toast message.
|
void |
toast(String message,
boolean isLong)
Show a toast message.
|
void |
translateFocusPoint(float dx,
float dy)
Translate the position of the focus point.
|
void |
zoomIn()
Zoom the view in.
|
void |
zoomOut()
Zoom the view out.
|
addChildrenForAccessibility, addFocusables, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addTouchables, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, clearFocus, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchGenericFocusedEvent, dispatchGenericMotionEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, draw, drawableStateChanged, findFocus, findViewById, findViewsWithText, findViewWithTag, fitSystemWindows, focusSearch, forceLayout, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLayerType, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hasFocus, hasFocusable, hasOnClickListeners, hasOverlappingRendering, hasTransientState, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isActivated, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPaddingOffsetRequired, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, jumpDrawablesToCurrentState, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onAttachedToWindow, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateDrawableState, onCreateInputConnection, onDetachedFromWindow, onDisplayHint, onDragEvent, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onLayout, onMeasure, onOverScrolled, onPopulateAccessibilityEvent, onRestoreInstanceState, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onStartTemporaryDetach, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestFitSystemWindows, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLayerType, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOverScrollMode, setPadding, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDrawpublic ZoomableView(android.content.Context context)
context - is the droid context of the view.public ZoomableView(android.content.Context context,
android.util.AttributeSet attrs)
context - is the droid context of the view.attrs - are the attributes of the view.public ZoomableView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
context - is the droid context of the view.attrs - are the attributes of the view.defStyle - is the style of the view.protected abstract DocumentWrapper createDocumentWrapper()
null.public final boolean isXAxisInverted()
isXAxisInverted in interface ZoomableContextpublic final boolean isYAxisInverted()
isYAxisInverted in interface ZoomableContextpublic final void setXAxisInverted(boolean invert)
If the X axis is inverted, the positives are to the left; otherwise they are to the right (default UI standard).
invert - public final void setYAxisInverted(boolean invert)
If the Y axis is inverted, the positives are to the left; otherwise they are to the right (default UI standard).
invert - public final void setOnLongClickListener(android.view.View.OnLongClickListener l)
setOnLongClickListener in class android.view.Viewpublic final void setOnClickListener(android.view.View.OnClickListener l)
setOnClickListener in class android.view.Viewpublic final void setIgnoreRepaint(boolean ignore)
ignore - public final boolean isIgnoreRepaint()
true if the repaint requests are ignored;
false if not.public final void repaint()
View.invalidate()
is invoked. If not, View.postInvalidate() is invoked.
If isIgnoreRepaint() replies false, this
function does nothing.
isIgnoreRepaint()public final void repaint(float x,
float y,
float width,
float height)
View.invalidate()
is invoked. If not, View.postInvalidate() is invoked.
If isIgnoreRepaint() replies false, this
function does nothing.
x - y - width - height - isIgnoreRepaint()public final void repaint(Rectangle2f r)
View.invalidate()
is invoked. If not, View.postInvalidate() is invoked.
If isIgnoreRepaint() replies false, this
function does nothing.
r - isIgnoreRepaint()public final void repaint(android.graphics.Rect r)
View.invalidate()
is invoked. If not, View.postInvalidate() is invoked.
If isIgnoreRepaint() replies false, this
function does nothing.
r - isIgnoreRepaint()public final void repaint(android.graphics.RectF r)
View.invalidate()
is invoked. If not, View.postInvalidate() is invoked.
If isIgnoreRepaint() replies false, this
function does nothing.
r - isIgnoreRepaint()public final boolean isMoveDirectionInverted()
true if the direction of moving
is inverted; otherwise false.public final void setMoveDirectionInverted(boolean invert)
invert - is true if the direction of moving
is inverted; otherwise false.public final float logical2pixel_size(float l)
logical2pixel_size in interface ZoomableContextpublic final float logical2pixel_x(float l)
logical2pixel_x in interface ZoomableContextpublic final float logical2pixel_y(float l)
logical2pixel_y in interface ZoomableContextpublic final float pixel2logical_size(float l)
pixel2logical_size in interface ZoomableContextpublic final float pixel2logical_x(float l)
pixel2logical_x in interface ZoomableContextpublic final float pixel2logical_y(float l)
pixel2logical_y in interface ZoomableContextpublic PathIterator2f logical2pixel(PathIterator2f p)
logical2pixel in interface ZoomableContextpublic PathIterator2f pixel2logical(PathIterator2f p)
pixel2logical in interface ZoomableContextpublic void logical2pixel(Segment2f s)
logical2pixel in interface ZoomableContextpublic void pixel2logical(Segment2f s)
pixel2logical in interface ZoomableContextpublic void logical2pixel(RoundRectangle2f r)
logical2pixel in interface ZoomableContextpublic void pixel2logical(RoundRectangle2f r)
pixel2logical in interface ZoomableContextpublic void logical2pixel(Point2f p)
logical2pixel in interface ZoomableContextpublic void pixel2logical(Point2f p)
pixel2logical in interface ZoomableContextpublic void logical2pixel(Ellipse2f e)
logical2pixel in interface ZoomableContextpublic void pixel2logical(Ellipse2f e)
pixel2logical in interface ZoomableContextpublic void logical2pixel(Circle2f r)
logical2pixel in interface ZoomableContextpublic void pixel2logical(Circle2f r)
pixel2logical in interface ZoomableContextpublic void logical2pixel(Rectangle2f r)
logical2pixel in interface ZoomableContextpublic void pixel2logical(Rectangle2f r)
pixel2logical in interface ZoomableContextpublic Shape2f logical2pixel(Shape2f s)
logical2pixel in interface ZoomableContextpublic Shape2f pixel2logical(Shape2f s)
pixel2logical in interface ZoomableContextpublic final float getScalingSensitivity()
getScalingSensitivity in interface ZoomableContextpublic final void setScalingSensitivity(float sensivility)
zoomIn()
and zoomOut() actions.sensivility - public final float getViewportCenterX()
public final float getViewportCenterY()
public final float getFocusX()
getFocusX in interface ZoomableContextpublic final float getFocusY()
getFocusY in interface ZoomableContextpublic final float getScalingFactor()
getScalingFactor in interface ZoomableContextpublic final boolean setScalingFactor(float factor)
factor - is the scaling factor.true if the scaling factor has changed;
otherwise false.public void setScalingFactorForPixelRatio(float ratio)
Each unit from the displayed document will have the same graphical size as the amount of pixels specified by the ratio.
ratio - protected final boolean setScalingFactorAndFocus(float scalingX,
float scalingY,
float factor)
scalingX - is the coordinate of the point (on the screen) where the focus occurs.scalingY - is the coordinate of the point (on the screen) where the focus occurs.factor - is the scaling factor.true if the scaling factor or the focus point has changed;
otherwise false.public final void zoomIn()
public final void zoomOut()
public final float getMaxScalingFactor()
getMaxScalingFactor in interface ZoomableContextpublic final void setMaxScalingFactor(float factor)
factor - is the maximal scaling factor.public final float getMinScalingFactor()
getMinScalingFactor in interface ZoomableContextpublic final void setMinScalingFactor(float factor)
factor - is the minimal scaling factor.public final void setFocusPoint(float x,
float y)
x - y - public final void translateFocusPoint(float dx,
float dy)
dx - dy - protected void onUpdateViewParameters()
This function is invoked when the coordinates of the focus point or the scaling factor has been changed to ensure that all the drawing attributes are properly set.
protected abstract float getPreferredFocusX()
protected abstract float getPreferredFocusY()
public final boolean resetView()
true if the view has changed; false otherwise.public float getScalingFactorToFit()
If there is no wrapper replied by createDocumentWrapper(),
this function replies 1.
public final boolean fitView()
If there is no wrapper replied by createDocumentWrapper(),
this function does the same as resetView().
true if the view has changed; false otherwise.protected void onSizeChanged(int w,
int h,
int oldw,
int oldh)
onSizeChanged in class android.view.Viewpublic final void onDraw(android.graphics.Canvas canvas)
onDraw in class android.view.Viewprotected abstract void onDrawView(android.graphics.Canvas canvas,
float scaleFactor,
CenteringTransform centeringTransform)
canvas - is the canvas in which the view must be painted.scaleFactor - is the scaling factor to use for drawing.centeringTransform - is the transform to use to put the draws at the center of the view.public final boolean onTouchEvent(android.view.MotionEvent ev)
onTouchEvent in class android.view.Viewprotected void onPointerPressed(PointerEvent e)
e - protected void onPointerReleased(PointerEvent e)
e - protected void onPointerDragged(PointerEvent e)
e - protected void onLongClick(PointerEvent e)
e - protected void onClick(PointerEvent e)
e - public boolean onScale(float focusX,
float focusY,
float requestedScaleFactor)
One of the border effect if this function replies true
is that the view will be repaint.
The default implementation of this function invokes
setScalingFactorAndFocus(float, float, float).
focusX - is the position of the focal point on the screen.focusY - is the position of the focal point on the screen.requestedScaleFactor - is the new scale factor.setScalingFactorAndFocus(float, float, float)public final void toast(String message, boolean isLong)
message - is the message to displayisLong - indicates if it is a long-time (true)
or a short-time (false) message.public final void toast(int message,
boolean isLong)
message - is the message to displayisLong - indicates if it is a long-time (true)
or a short-time (false) message.Copyright © 2001-2013 NetEditor Developers. 
NetEditor API Documentation by NetEditor Developers is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Based on a work at www.arakhne.org/neteditor