Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TTTAndroidClient
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ttt
TTTAndroidClient
Commits
ffc94b88
Commit
ffc94b88
authored
Mar 04, 2014
by
Thomas Krex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-highlightAnnotations hinzugefügt + paint methode angepasst
parent
358443b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
18 deletions
+16
-18
TTTCLient/.settings/org.eclipse.core.resources.prefs
TTTCLient/.settings/org.eclipse.core.resources.prefs
+1
-0
TTTCLient/src/tttclient/messages/HighlightAnnotation.java
TTTCLient/src/tttclient/messages/HighlightAnnotation.java
+15
-18
No files found.
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
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