Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
16d8839c
Kaydet (Commit)
16d8839c
authored
Mar 26, 2015
tarafından
Tomaž Vajngerl
Kaydeden (comit)
Miklos Vajna
Mar 30, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: rename graphic selection and handle
Change-Id: I7bf89b92190ba37535fa89118269d706d6bf05d9
üst
b1def00a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
23 deletions
+22
-23
GraphicSelection.java
...id3/src/java/org/libreoffice/canvas/GraphicSelection.java
+17
-17
GraphicSelectionHandle.java
...c/java/org/libreoffice/canvas/GraphicSelectionHandle.java
+2
-2
TextCursorView.java
...oid3/src/java/org/libreoffice/overlay/TextCursorView.java
+3
-4
No files found.
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection
CanvasElement
.java
→
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
Dosyayı görüntüle @
16d8839c
...
@@ -17,13 +17,13 @@ import android.graphics.RectF;
...
@@ -17,13 +17,13 @@ import android.graphics.RectF;
import
org.libreoffice.LOKitShell
;
import
org.libreoffice.LOKitShell
;
import
org.mozilla.gecko.gfx.LayerView
;
import
org.mozilla.gecko.gfx.LayerView
;
import
static
org
.
libreoffice
.
canvas
.
GraphicSelectionHandle
CanvasElement
.
HandlePosition
;
import
static
org
.
libreoffice
.
canvas
.
GraphicSelectionHandle
.
HandlePosition
;
/**
/**
* This class is responsible to draw and reposition the selection
* This class is responsible to draw and reposition the selection
* rectangle.
* rectangle.
*/
*/
public
class
GraphicSelection
CanvasElement
implements
CanvasElement
{
public
class
GraphicSelection
implements
CanvasElement
{
private
final
Paint
mPaint
;
private
final
Paint
mPaint
;
public
RectF
mRectangle
=
new
RectF
();
public
RectF
mRectangle
=
new
RectF
();
public
RectF
mScaledRectangle
=
new
RectF
();
public
RectF
mScaledRectangle
=
new
RectF
();
...
@@ -31,23 +31,23 @@ public class GraphicSelectionCanvasElement implements CanvasElement {
...
@@ -31,23 +31,23 @@ public class GraphicSelectionCanvasElement implements CanvasElement {
private
DragType
mType
=
DragType
.
NONE
;
private
DragType
mType
=
DragType
.
NONE
;
private
PointF
mStartDragPosition
;
private
PointF
mStartDragPosition
;
private
GraphicSelectionHandle
CanvasElement
mHandles
[]
=
new
GraphicSelectionHandleCanvasElement
[
8
];
private
GraphicSelectionHandle
mHandles
[]
=
new
GraphicSelectionHandle
[
8
];
private
GraphicSelectionHandle
CanvasElement
mDragHandle
=
null
;
private
GraphicSelectionHandle
mDragHandle
=
null
;
public
GraphicSelection
CanvasElement
()
{
public
GraphicSelection
()
{
mPaint
=
new
Paint
();
mPaint
=
new
Paint
();
mPaint
.
setStyle
(
Paint
.
Style
.
STROKE
);
mPaint
.
setStyle
(
Paint
.
Style
.
STROKE
);
mPaint
.
setColor
(
Color
.
BLACK
);
mPaint
.
setColor
(
Color
.
BLACK
);
mPaint
.
setStrokeWidth
(
2
);
mPaint
.
setStrokeWidth
(
2
);
mHandles
[
0
]
=
new
GraphicSelectionHandle
CanvasElement
(
HandlePosition
.
TOP_LEFT
);
mHandles
[
0
]
=
new
GraphicSelectionHandle
(
HandlePosition
.
TOP_LEFT
);
mHandles
[
1
]
=
new
GraphicSelectionHandle
CanvasElement
(
HandlePosition
.
TOP
);
mHandles
[
1
]
=
new
GraphicSelectionHandle
(
HandlePosition
.
TOP
);
mHandles
[
2
]
=
new
GraphicSelectionHandle
CanvasElement
(
HandlePosition
.
TOP_RIGHT
);
mHandles
[
2
]
=
new
GraphicSelectionHandle
(
HandlePosition
.
TOP_RIGHT
);
mHandles
[
3
]
=
new
GraphicSelectionHandle
CanvasElement
(
HandlePosition
.
LEFT
);
mHandles
[
3
]
=
new
GraphicSelectionHandle
(
HandlePosition
.
LEFT
);
mHandles
[
4
]
=
new
GraphicSelectionHandle
CanvasElement
(
HandlePosition
.
RIGHT
);
mHandles
[
4
]
=
new
GraphicSelectionHandle
(
HandlePosition
.
RIGHT
);
mHandles
[
5
]
=
new
GraphicSelectionHandle
CanvasElement
(
HandlePosition
.
BOTTOM_LEFT
);
mHandles
[
5
]
=
new
GraphicSelectionHandle
(
HandlePosition
.
BOTTOM_LEFT
);
mHandles
[
6
]
=
new
GraphicSelectionHandle
CanvasElement
(
HandlePosition
.
BOTTOM
);
mHandles
[
6
]
=
new
GraphicSelectionHandle
(
HandlePosition
.
BOTTOM
);
mHandles
[
7
]
=
new
GraphicSelectionHandle
CanvasElement
(
HandlePosition
.
BOTTOM_RIGHT
);
mHandles
[
7
]
=
new
GraphicSelectionHandle
(
HandlePosition
.
BOTTOM_RIGHT
);
}
}
public
void
reposition
(
RectF
scaledRectangle
)
{
public
void
reposition
(
RectF
scaledRectangle
)
{
...
@@ -66,7 +66,7 @@ public class GraphicSelectionCanvasElement implements CanvasElement {
...
@@ -66,7 +66,7 @@ public class GraphicSelectionCanvasElement implements CanvasElement {
public
boolean
contains
(
float
x
,
float
y
)
{
public
boolean
contains
(
float
x
,
float
y
)
{
// Check if handle was hit
// Check if handle was hit
for
(
GraphicSelectionHandle
CanvasElement
handle
:
mHandles
)
{
for
(
GraphicSelectionHandle
handle
:
mHandles
)
{
if
(
handle
.
contains
(
x
,
y
))
{
if
(
handle
.
contains
(
x
,
y
))
{
return
true
;
return
true
;
}
}
...
@@ -80,7 +80,7 @@ public class GraphicSelectionCanvasElement implements CanvasElement {
...
@@ -80,7 +80,7 @@ public class GraphicSelectionCanvasElement implements CanvasElement {
@Override
@Override
public
void
draw
(
Canvas
canvas
)
{
public
void
draw
(
Canvas
canvas
)
{
canvas
.
drawRect
(
mDrawRectangle
,
mPaint
);
canvas
.
drawRect
(
mDrawRectangle
,
mPaint
);
for
(
GraphicSelectionHandle
CanvasElement
handle
:
mHandles
)
{
for
(
GraphicSelectionHandle
handle
:
mHandles
)
{
handle
.
draw
(
canvas
);
handle
.
draw
(
canvas
);
}
}
}
}
...
@@ -88,7 +88,7 @@ public class GraphicSelectionCanvasElement implements CanvasElement {
...
@@ -88,7 +88,7 @@ public class GraphicSelectionCanvasElement implements CanvasElement {
public
void
dragStart
(
PointF
position
)
{
public
void
dragStart
(
PointF
position
)
{
mDragHandle
=
null
;
mDragHandle
=
null
;
mType
=
DragType
.
NONE
;
mType
=
DragType
.
NONE
;
for
(
GraphicSelectionHandle
CanvasElement
handle
:
mHandles
)
{
for
(
GraphicSelectionHandle
handle
:
mHandles
)
{
if
(
handle
.
contains
(
position
.
x
,
position
.
y
))
{
if
(
handle
.
contains
(
position
.
x
,
position
.
y
))
{
mDragHandle
=
handle
;
mDragHandle
=
handle
;
mDragHandle
.
select
();
mDragHandle
.
select
();
...
@@ -189,7 +189,7 @@ public class GraphicSelectionCanvasElement implements CanvasElement {
...
@@ -189,7 +189,7 @@ public class GraphicSelectionCanvasElement implements CanvasElement {
public
void
reset
()
{
public
void
reset
()
{
mDragHandle
=
null
;
mDragHandle
=
null
;
for
(
GraphicSelectionHandle
CanvasElement
handle
:
mHandles
)
{
for
(
GraphicSelectionHandle
handle
:
mHandles
)
{
handle
.
reset
();
handle
.
reset
();
}
}
}
}
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle
CanvasElement
.java
→
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
Dosyayı görüntüle @
16d8839c
...
@@ -19,7 +19,7 @@ import android.graphics.RectF;
...
@@ -19,7 +19,7 @@ import android.graphics.RectF;
* position and perform a hit test to determine if the selection handle was
* position and perform a hit test to determine if the selection handle was
* touched.
* touched.
*/
*/
public
class
GraphicSelectionHandle
CanvasElement
implements
CanvasElement
{
public
class
GraphicSelectionHandle
implements
CanvasElement
{
private
final
HandlePosition
mHandlePosition
;
private
final
HandlePosition
mHandlePosition
;
public
PointF
mPosition
=
new
PointF
();
public
PointF
mPosition
=
new
PointF
();
private
float
mRadius
=
20.0f
;
private
float
mRadius
=
20.0f
;
...
@@ -29,7 +29,7 @@ public class GraphicSelectionHandleCanvasElement implements CanvasElement {
...
@@ -29,7 +29,7 @@ public class GraphicSelectionHandleCanvasElement implements CanvasElement {
private
RectF
mHitRect
=
new
RectF
();
private
RectF
mHitRect
=
new
RectF
();
private
boolean
mSelected
=
false
;
private
boolean
mSelected
=
false
;
public
GraphicSelectionHandle
CanvasElement
(
HandlePosition
position
)
{
public
GraphicSelectionHandle
(
HandlePosition
position
)
{
mHandlePosition
=
position
;
mHandlePosition
=
position
;
mStrokePaint
.
setStyle
(
Paint
.
Style
.
STROKE
);
mStrokePaint
.
setStyle
(
Paint
.
Style
.
STROKE
);
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorView.java
Dosyayı görüntüle @
16d8839c
...
@@ -20,8 +20,7 @@ import android.view.MotionEvent;
...
@@ -20,8 +20,7 @@ import android.view.MotionEvent;
import
android.view.View
;
import
android.view.View
;
import
org.libreoffice.LOKitShell
;
import
org.libreoffice.LOKitShell
;
import
org.libreoffice.canvas.GraphicSelectionCanvasElement
;
import
org.libreoffice.canvas.GraphicSelection
;
import
org.libreoffice.canvas.GraphicSelectionHandleCanvasElement
;
import
org.mozilla.gecko.gfx.ImmutableViewportMetrics
;
import
org.mozilla.gecko.gfx.ImmutableViewportMetrics
;
import
org.mozilla.gecko.gfx.LayerView
;
import
org.mozilla.gecko.gfx.LayerView
;
import
org.mozilla.gecko.gfx.RectUtils
;
import
org.mozilla.gecko.gfx.RectUtils
;
...
@@ -49,7 +48,7 @@ public class TextCursorView extends View implements View.OnTouchListener {
...
@@ -49,7 +48,7 @@ public class TextCursorView extends View implements View.OnTouchListener {
private
Paint
mSelectionPaint
=
new
Paint
();
private
Paint
mSelectionPaint
=
new
Paint
();
private
boolean
mSelectionsVisible
;
private
boolean
mSelectionsVisible
;
private
GraphicSelection
CanvasElement
mGraphicSelection
;
private
GraphicSelection
mGraphicSelection
;
private
boolean
mGraphicSelectionVisible
;
private
boolean
mGraphicSelectionVisible
;
private
boolean
mGraphicSelectionMove
=
false
;
private
boolean
mGraphicSelectionMove
=
false
;
...
@@ -86,7 +85,7 @@ public class TextCursorView extends View implements View.OnTouchListener {
...
@@ -86,7 +85,7 @@ public class TextCursorView extends View implements View.OnTouchListener {
mSelectionPaint
.
setAlpha
(
50
);
mSelectionPaint
.
setAlpha
(
50
);
mSelectionsVisible
=
false
;
mSelectionsVisible
=
false
;
mGraphicSelection
=
new
GraphicSelection
CanvasElement
();
mGraphicSelection
=
new
GraphicSelection
();
mGraphicSelectionVisible
=
false
;
mGraphicSelectionVisible
=
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment