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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Georg Graßnick
BraillePlot
Commits
00242d5f
Commit
00242d5f
authored
5 years ago
by
Leonard Kupper
Browse files
Options
Downloads
Patches
Plain Diff
JavaDoc for Rectangle.IntWrapper
parent
dac0b889
No related branches found
No related tags found
1 merge request
!8
Feat/rasterizer 10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/tudresden/inf/mci/brailleplot/rendering/Rectangle.java
+37
-0
37 additions, 0 deletions
...de/tudresden/inf/mci/brailleplot/rendering/Rectangle.java
with
37 additions
and
0 deletions
src/main/java/de/tudresden/inf/mci/brailleplot/rendering/Rectangle.java
+
37
−
0
View file @
00242d5f
...
...
@@ -306,6 +306,10 @@ public class Rectangle {
private
Rectangle
mRectangle
;
/**
* Constructor. Creates a wrapper as proxy object for an integer coordinate representation of the given rectangle.
* @param rectangle The rectangle to be wrapped.
*/
public
IntWrapper
(
final
Rectangle
rectangle
)
{
this
.
mRectangle
=
Objects
.
requireNonNull
(
rectangle
);
}
...
...
@@ -315,29 +319,62 @@ public class Rectangle {
return
Math
.
toIntExact
(
round
(
value
));
}
/**
* Gets the rectangles x position.
* @return The x coordinate of the upper left corner.
*/
public
int
getX
()
{
return
wrapInt
(
mRectangle
.
getX
());
}
/**
* Gets the rectangles y position.
* @return The y coordinate of the upper left corner.
*/
public
int
getY
()
{
return
wrapInt
(
mRectangle
.
getY
());
}
/**
* Gets the rectangles width.
* @return The distance between the rectangles left and right edge.
*/
public
int
getWidth
()
{
return
wrapInt
(
mRectangle
.
getWidth
());
}
/**
* Gets the rectangles height.
* @return The distance between the rectangles top and bottom edge.
*/
public
int
getHeight
()
{
return
wrapInt
(
mRectangle
.
getHeight
());
}
/**
* Gets the rectangles right edges position (<b>Important:</b> The IntWrapper treats the rectangle as
* representation of a 'whole' area composed of single countable units (e.g. dots or cells) so this method will
* return the position of the rightmost contained coordinate, which is x+width-1)
* @return The x coordinate of the inner contained right edge.
*/
public
int
getRight
()
{
return
wrapInt
(
mRectangle
.
getRight
())
-
1
;
}
/**
* Gets the rectangles bottom edges position (<b>Important:</b> The IntWrapper treats the rectangle as
* representation of a 'whole' area composed of single countable units (e.g. dots or cells) so this method will
* return the position of the bottommost contained coordinate, which is y+height-1)
* @return The y coordinate of the inner contained bottom edge.
*/
public
int
getBottom
()
{
return
wrapInt
(
mRectangle
.
getBottom
())
-
1
;
}
/**
* Get the original rectangle, wrapped by this IntWrapper.
* @return The wrapped instance of {@link Rectangle}.
*/
public
Rectangle
getRectangle
()
{
return
mRectangle
;
}
...
...
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
register
or
sign in
to comment