-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix javadoc #144
Fix javadoc #144
Conversation
WalkthroughThis pull request includes modifications to three classes: Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (6)
src/main/java/com/flowingcode/vaadin/addons/googlemaps/Icon.java (1)
37-39
: LGTM: Removed redundantthis
referencesThe changes improve code readability while maintaining the same functionality.
Consider changing the
fillOpacity
parameter type fromint
todouble
to avoid the explicit conversion toDouble
. This would better represent the opacity value and make the API more intuitive:- public Icon(String path, String strokeColor, String fillColor, int fillOpacity, int repeat) { + public Icon(String path, String strokeColor, String fillColor, double fillOpacity, int repeat) { super(path); setStrokeColor(strokeColor); setFillColor(fillColor); - setFillOpacity(Double.valueOf(fillOpacity)); + setFillOpacity(fillOpacity); this.repeat = repeat; }src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java (3)
185-187
: Enhance deprecation notice with migration details.The
@deprecated
javadoc should provide more context about why the method is deprecated and how to migrate to the new method./** - * @deprecated Use {@link #setIcons(IconSequence...)} instead. + * @deprecated This method is deprecated as it uses the older {@link Icon} class. + * Please migrate to {@link #setIcons(IconSequence...)} which provides enhanced + * icon sequencing capabilities. + * @see #setIcons(IconSequence...) */
Line range hint
63-173
: Add javadoc for public methods.Several public methods are missing javadoc. Please add documentation for the following methods:
- setFillOpacity/getFillOpacity
- setStrokeOpacity/getStrokeOpacity
- setStrokePosition/getStrokePosition
- setStrokeWeight/getStrokeWeight
- setZIndex/getZIndex
- setFillColor/getFillColor
- setStrokeColor/getStrokeColor
- setClosed/isClosed
- setGeodesic/isGeodesic
Example format:
/** * Sets the fill opacity of the polygon. * @param opacity the opacity value between 0.0 and 1.0 */ public void setFillOpacity(double opacity)
197-207
: Enhance javadoc for setIcons method.The current javadoc is minimal. Consider adding more details about the purpose and usage of icons in the polygon/polyline.
/** * Set icons to the polygon/polyline. * + * Icons can be used to create patterns along the polygon/polyline path. + * Each icon sequence defines the icon's appearance and positioning along the path. * - * @param icons the icons to set + * @param icons the icon sequences to apply to the path + * @see IconSequence */src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java (2)
254-256
: Consider extracting marker update logic to a private method.The pattern of checking parent existence and updating markers is repeated in multiple places. Consider extracting this to a private method to improve maintainability.
+ private void updateMarkers() { + if (getElement().getParent() != null) { + getElement().executeJs("this._updateMarkers()"); + } + } public void addMarker(GoogleMapMarker marker) { getElement().appendChild(marker.getElement()); - if (getElement().getParent() != null) { - getElement().executeJs("this._updateMarkers()"); - } + updateMarkers(); } public void removeMarker(GoogleMapMarker marker) { getElement().removeChild(marker.getElement()); - getElement().executeJs("this._updateMarkers()"); + updateMarkers(); }Also applies to: 262-264
833-841
: Consider using template literals for multi-line JavaScript.The current string concatenation with
\r\n
could be simplified using JavaScript template literals.- "var isFullScreen = document.fullScreen ||\r\n" - + " document.mozFullScreen ||\r\n" - + " document.webkitIsFullScreen;\r\n" - + " return isFullScreen != null ? isFullScreen : false;") + `var isFullScreen = document.fullScreen || + document.mozFullScreen || + document.webkitIsFullScreen; + return isFullScreen != null ? isFullScreen : false;`)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java
(32 hunks)src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java
(3 hunks)src/main/java/com/flowingcode/vaadin/addons/googlemaps/Icon.java
(3 hunks)
🔇 Additional comments (6)
src/main/java/com/flowingcode/vaadin/addons/googlemaps/Icon.java (2)
10-10
: LGTM: Minor formatting changes in license header
Also applies to: 12-12
28-28
: LGTM: Improved Javadoc formatting
The removal of the comma and capitalization follows standard Javadoc conventions, making the deprecation notice clearer.
src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java (4)
58-58
: LGTM! Clean field declarations.
The field declarations are well-organized and use appropriate initialization patterns.
Also applies to: 60-60
82-87
: LGTM! Consistent cleanup of redundant 'this' references.
The removal of redundant 'this' references improves code readability while maintaining the same functionality.
Also applies to: 107-108, 129-129, 139-139, 273-273, 282-282, 291-291, 300-300
Line range hint 628-638
: LGTM! Robust location tracking implementation.
The location tracking implementation properly:
- Checks for existing tracking sessions
- Handles state management
- Provides proper cleanup
Also applies to: 674-676
783-793
: LGTM! Well-structured custom controls management.
The implementation properly handles:
- DOM manipulation
- Cleanup of existing controls
- State management
Also applies to: 894-895
Summary by CodeRabbit
Bug Fixes
Icon
class for clarity.Refactor
this
references across multiple classes (GoogleMap
,GoogleMapPoly
,Icon
).Style