Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BraillePlot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Georg Graßnick
BraillePlot
Commits
7c29a52a
Commit
7c29a52a
authored
Sep 3, 2019
by
Andrey Ruzhanskiy
Browse files
Options
Downloads
Patches
Plain Diff
Added right Exception
parent
0fbb2c33
No related branches found
No related tags found
1 merge request
!24
Feat/brailletextrasterizer 38
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/tudresden/inf/mci/brailleplot/rendering/LiblouisBrailleTextRasterizer.java
+11
-9
11 additions, 9 deletions
.../brailleplot/rendering/LiblouisBrailleTextRasterizer.java
with
11 additions
and
9 deletions
src/main/java/de/tudresden/inf/mci/brailleplot/rendering/LiblouisBrailleTextRasterizer.java
+
11
−
9
View file @
7c29a52a
...
@@ -45,7 +45,7 @@ public class LiblouisBrailleTextRasterizer implements Rasterizer<BrailleText> {
...
@@ -45,7 +45,7 @@ public class LiblouisBrailleTextRasterizer implements Rasterizer<BrailleText> {
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
try
{
try
{
mTranslator
=
new
Translator
(
"src\\main\\resources\\mapping\\liblouis\\de-g
1
.ctb"
);
mTranslator
=
new
Translator
(
"src\\main\\resources\\mapping\\liblouis\\de-g
2
.ctb"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
.
getCause
());
throw
new
RuntimeException
(
e
.
getCause
());
}
}
...
@@ -84,16 +84,21 @@ public class LiblouisBrailleTextRasterizer implements Rasterizer<BrailleText> {
...
@@ -84,16 +84,21 @@ public class LiblouisBrailleTextRasterizer implements Rasterizer<BrailleText> {
}
}
private
void
writeToCanvas
(
final
String
[]
braille
,
final
int
offsetX
,
final
int
offsetY
,
final
RasterCanvas
canvas
)
{
private
void
writeToCanvas
(
final
String
[]
braille
,
final
int
offsetX
,
final
int
offsetY
,
final
RasterCanvas
canvas
)
throws
InsufficientRenderingAreaException
{
Objects
.
requireNonNull
(
braille
,
"The string array given to writeToCanvas in liblouisBraileTextRasterizer was null!"
);
Objects
.
requireNonNull
(
braille
,
"The string array given to writeToCanvas in liblouisBraileTextRasterizer was null!"
);
Objects
.
requireNonNull
(
canvas
,
"The can
c
as given to writeToCanvas was null"
);
Objects
.
requireNonNull
(
canvas
,
"The can
v
as given to writeToCanvas was null"
);
int
temp
=
0
;
int
temp
=
0
;
for
(
int
j
=
0
;
j
<
canvas
.
getCellWidth
();
j
++)
{
for
(
int
j
=
0
;
j
<
canvas
.
getCellWidth
();
j
++)
{
for
(
int
k
=
0
;
k
<
canvas
.
getCellHeight
();
k
++)
{
for
(
int
k
=
0
;
k
<
canvas
.
getCellHeight
();
k
++)
{
// If it is 1, returns 1, if not return false
// If it is 1, returns 1, if not return false
try
{
canvas
.
getCurrentPage
().
setValue
(
k
+
offsetY
,
j
+
offsetX
,
braille
[
temp
].
equals
(
"1"
));
canvas
.
getCurrentPage
().
setValue
(
k
+
offsetY
,
j
+
offsetX
,
braille
[
temp
].
equals
(
"1"
));
boolean
a
=
canvas
.
getCurrentPage
().
getValue
(
k
,
j
);
boolean
a
=
canvas
.
getCurrentPage
().
getValue
(
k
,
j
);
temp
++;
temp
++;
}
catch
(
IndexOutOfBoundsException
e
)
{
throw
new
InsufficientRenderingAreaException
(
"The area given to the brailletextrasterizer was too small!"
);
}
}
}
}
}
}
}
...
@@ -114,9 +119,6 @@ public class LiblouisBrailleTextRasterizer implements Rasterizer<BrailleText> {
...
@@ -114,9 +119,6 @@ public class LiblouisBrailleTextRasterizer implements Rasterizer<BrailleText> {
// Reset x
// Reset x
x
=
origX
;
x
=
origX
;
}
}
if
(
x
>=
mCanvas
.
getCellRectangle
().
getWidth
()
*
mCanvas
.
getCellWidth
()
||
y
>=
mCanvas
.
getCellRectangle
().
getHeight
()
*
mCanvas
.
getCellHeight
())
{
throw
new
InsufficientRenderingAreaException
(
"The Area for the Brailletext was not big enough for the braille!"
);
}
}
}
/**
/**
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment