Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dr. Michael Petter
TTTAndroidClient
Commits
ffc94b88
Commit
ffc94b88
authored
Mar 04, 2014
by
Thomas Krex
Browse files
-highlightAnnotations hinzugefügt + paint methode angepasst
parent
358443b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
TTTCLient/.settings/org.eclipse.core.resources.prefs
View file @
ffc94b88
eclipse.preferences.version=1
encoding//src/tttclient/connections/TTTConnection.java=UTF-8
encoding//src/tttclient/messages/HighlightAnnotation.java=UTF-8
encoding//src/tttclient/ttt/Constants.java=ISO-8859-1
TTTCLient/src/tttclient/messages/HighlightAnnotation.java
View file @
ffc94b88
...
...
@@ -50,11 +50,6 @@ public class HighlightAnnotation extends SimpleAnnotation {
.
readUnsignedShort
());
}
// MODMSG
/**
* creates HighlightAnnotation from corresponding XML Element. (used by
* messaging)
*/
public
HighlightAnnotation
(
org
.
w3c
.
dom
.
Element
xmlNode
)
{
super
(
xmlNode
);
}
...
...
@@ -64,6 +59,7 @@ public class HighlightAnnotation extends SimpleAnnotation {
return
Constants
.
AnnotationHighlight
;
}
// TODO benötigt?
@Override
void
computeShape
()
{
// calculate x,y,width,height from startx/y and endx/y
...
...
@@ -95,14 +91,14 @@ public class HighlightAnnotation extends SimpleAnnotation {
height
=
starty
-
endy
;
}
}
shape
=
thumbshape
=
new
Rect
(
x
,
y
,
x
+
width
,
y
+
height
);
// TODO shape gibts nicht, überhaupt benötigt?
// shape = thumbshape = new Rect(x, y, x + width, y + height);
}
public
void
paintToThumbnail
(
Bitmap
bitmap
)
{
// TODO: fix color - don't use table for new protocol
// TODO: due to some java bug fill and draw use different coordinates if
// scaled
int
highlightColor
=
annotationColors
[
color
];
// create canvas to draw on Bitmap thumbnail
Canvas
canvas
=
new
Canvas
(
bitmap
);
...
...
@@ -111,13 +107,16 @@ public class HighlightAnnotation extends SimpleAnnotation {
highlightPaint
.
setColor
(
highlightColor
);
highlightPaint
.
setStrokeWidth
(
1
);
highlightPaint
.
setStyle
(
Paint
.
Style
.
FILL
);
Rect
highlightRect
=
getBounds
();
Rect
scaledHighlightRect
=
new
Rect
((
int
)(
highlightRect
.
left
*
Index
.
THUMBNAIL_SCALE_FACTOR
),
(
int
)(
highlightRect
.
top
*
Index
.
THUMBNAIL_SCALE_FACTOR
),
(
int
)(
highlightRect
.
right
*
Index
.
THUMBNAIL_SCALE_FACTOR
),
(
int
)(
highlightRect
.
left
*
Index
.
THUMBNAIL_SCALE_FACTOR
);
Rect
bounds
=
getBounds
();
canvas
.
drawRect
(
getBounds
(),
highlightPaint
);
// scale Rect for thumbnail
Rect
scaledBounds
=
new
Rect
(
(
int
)
(
bounds
.
left
*
Index
.
THUMBNAIL_SCALE_FACTOR
),
(
int
)
(
bounds
.
top
*
Index
.
THUMBNAIL_SCALE_FACTOR
),
(
int
)
(
bounds
.
right
*
Index
.
THUMBNAIL_SCALE_FACTOR
),
(
int
)
(
bounds
.
left
*
Index
.
THUMBNAIL_SCALE_FACTOR
));
canvas
.
drawRect
(
scaledBounds
,
highlightPaint
);
// border highlighted area
...
...
@@ -132,9 +131,7 @@ public class HighlightAnnotation extends SimpleAnnotation {
@Override
public
void
paint
(
Canvas
canvas
)
{
// TODO: fix color - don't use table for new protocol
// TODO: due to some java bug fill and draw use different coordinates if
// scaled
int
highlightColor
=
annotationColors
[
color
];
// highlight area
...
...
Write
Preview
Supports
Markdown
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