diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-03-26 19:55:18 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-30 09:23:51 +0200 |
commit | 16d8839c24be1a9539f3d6e0157c5279e92cd37e (patch) | |
tree | 2471cbe5e74fd5c160964b05cefd5ba2ce82f2a3 | |
parent | b1def00ac3ba1cb4eeafab9c5791382222da1d0a (diff) |
android: rename graphic selection and handle
Change-Id: I7bf89b92190ba37535fa89118269d706d6bf05d9
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java (renamed from android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionCanvasElement.java) | 34 | ||||
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java (renamed from android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandleCanvasElement.java) | 4 | ||||
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorView.java | 7 |
3 files changed, 22 insertions, 23 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionCanvasElement.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java index a205c678e575..8251495911b0 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionCanvasElement.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java @@ -17,13 +17,13 @@ import android.graphics.RectF; import org.libreoffice.LOKitShell; import org.mozilla.gecko.gfx.LayerView; -import static org.libreoffice.canvas.GraphicSelectionHandleCanvasElement.HandlePosition; +import static org.libreoffice.canvas.GraphicSelectionHandle.HandlePosition; /** * This class is responsible to draw and reposition the selection * rectangle. */ -public class GraphicSelectionCanvasElement implements CanvasElement { +public class GraphicSelection implements CanvasElement { private final Paint mPaint; public RectF mRectangle = new RectF(); public RectF mScaledRectangle = new RectF(); @@ -31,23 +31,23 @@ public class GraphicSelectionCanvasElement implements CanvasElement { private DragType mType = DragType.NONE; private PointF mStartDragPosition; - private GraphicSelectionHandleCanvasElement mHandles[] = new GraphicSelectionHandleCanvasElement[8]; - private GraphicSelectionHandleCanvasElement mDragHandle = null; + private GraphicSelectionHandle mHandles[] = new GraphicSelectionHandle[8]; + private GraphicSelectionHandle mDragHandle = null; - public GraphicSelectionCanvasElement() { + public GraphicSelection() { mPaint = new Paint(); mPaint.setStyle(Paint.Style.STROKE); mPaint.setColor(Color.BLACK); mPaint.setStrokeWidth(2); - mHandles[0] = new GraphicSelectionHandleCanvasElement(HandlePosition.TOP_LEFT); - mHandles[1] = new GraphicSelectionHandleCanvasElement(HandlePosition.TOP); - mHandles[2] = new GraphicSelectionHandleCanvasElement(HandlePosition.TOP_RIGHT); - mHandles[3] = new GraphicSelectionHandleCanvasElement(HandlePosition.LEFT); - mHandles[4] = new GraphicSelectionHandleCanvasElement(HandlePosition.RIGHT); - mHandles[5] = new GraphicSelectionHandleCanvasElement(HandlePosition.BOTTOM_LEFT); - mHandles[6] = new GraphicSelectionHandleCanvasElement(HandlePosition.BOTTOM); - mHandles[7] = new GraphicSelectionHandleCanvasElement(HandlePosition.BOTTOM_RIGHT); + mHandles[0] = new GraphicSelectionHandle(HandlePosition.TOP_LEFT); + mHandles[1] = new GraphicSelectionHandle(HandlePosition.TOP); + mHandles[2] = new GraphicSelectionHandle(HandlePosition.TOP_RIGHT); + mHandles[3] = new GraphicSelectionHandle(HandlePosition.LEFT); + mHandles[4] = new GraphicSelectionHandle(HandlePosition.RIGHT); + mHandles[5] = new GraphicSelectionHandle(HandlePosition.BOTTOM_LEFT); + mHandles[6] = new GraphicSelectionHandle(HandlePosition.BOTTOM); + mHandles[7] = new GraphicSelectionHandle(HandlePosition.BOTTOM_RIGHT); } public void reposition(RectF scaledRectangle) { @@ -66,7 +66,7 @@ public class GraphicSelectionCanvasElement implements CanvasElement { public boolean contains(float x, float y) { // Check if handle was hit - for (GraphicSelectionHandleCanvasElement handle : mHandles) { + for (GraphicSelectionHandle handle : mHandles) { if (handle.contains(x, y)) { return true; } @@ -80,7 +80,7 @@ public class GraphicSelectionCanvasElement implements CanvasElement { @Override public void draw(Canvas canvas) { canvas.drawRect(mDrawRectangle, mPaint); - for (GraphicSelectionHandleCanvasElement handle : mHandles) { + for (GraphicSelectionHandle handle : mHandles) { handle.draw(canvas); } } @@ -88,7 +88,7 @@ public class GraphicSelectionCanvasElement implements CanvasElement { public void dragStart(PointF position) { mDragHandle = null; mType = DragType.NONE; - for (GraphicSelectionHandleCanvasElement handle : mHandles) { + for (GraphicSelectionHandle handle : mHandles) { if (handle.contains(position.x, position.y)) { mDragHandle = handle; mDragHandle.select(); @@ -189,7 +189,7 @@ public class GraphicSelectionCanvasElement implements CanvasElement { public void reset() { mDragHandle = null; - for (GraphicSelectionHandleCanvasElement handle : mHandles) { + for (GraphicSelectionHandle handle : mHandles) { handle.reset(); } } diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandleCanvasElement.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java index 5bf544c15d24..109592e2163c 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandleCanvasElement.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java @@ -19,7 +19,7 @@ import android.graphics.RectF; * position and perform a hit test to determine if the selection handle was * touched. */ -public class GraphicSelectionHandleCanvasElement implements CanvasElement { +public class GraphicSelectionHandle implements CanvasElement { private final HandlePosition mHandlePosition; public PointF mPosition = new PointF(); private float mRadius = 20.0f; @@ -29,7 +29,7 @@ public class GraphicSelectionHandleCanvasElement implements CanvasElement { private RectF mHitRect = new RectF(); private boolean mSelected = false; - public GraphicSelectionHandleCanvasElement(HandlePosition position) { + public GraphicSelectionHandle(HandlePosition position) { mHandlePosition = position; mStrokePaint.setStyle(Paint.Style.STROKE); diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorView.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorView.java index 97230cf2487a..818dbc478131 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorView.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorView.java @@ -20,8 +20,7 @@ import android.view.MotionEvent; import android.view.View; import org.libreoffice.LOKitShell; -import org.libreoffice.canvas.GraphicSelectionCanvasElement; -import org.libreoffice.canvas.GraphicSelectionHandleCanvasElement; +import org.libreoffice.canvas.GraphicSelection; import org.mozilla.gecko.gfx.ImmutableViewportMetrics; import org.mozilla.gecko.gfx.LayerView; import org.mozilla.gecko.gfx.RectUtils; @@ -49,7 +48,7 @@ public class TextCursorView extends View implements View.OnTouchListener { private Paint mSelectionPaint = new Paint(); private boolean mSelectionsVisible; - private GraphicSelectionCanvasElement mGraphicSelection; + private GraphicSelection mGraphicSelection; private boolean mGraphicSelectionVisible; private boolean mGraphicSelectionMove = false; @@ -86,7 +85,7 @@ public class TextCursorView extends View implements View.OnTouchListener { mSelectionPaint.setAlpha(50); mSelectionsVisible = false; - mGraphicSelection = new GraphicSelectionCanvasElement(); + mGraphicSelection = new GraphicSelection(); mGraphicSelectionVisible = false; |