This is an automated email from the ASF dual-hosted git repository.

jsorel pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new 106873efb3 Add javadoc on Scene2D and StylePainter
106873efb3 is described below

commit 106873efb3843fd72581258790cb79c39201f7ac
Author: jsorel <johann.so...@geomatys.com>
AuthorDate: Fri Mar 8 11:05:25 2024 +0100

    Add javadoc on Scene2D and StylePainter
---
 .../main/org/apache/sis/map/service/Scene2D.java   | 12 +++++++++-
 .../org/apache/sis/map/service/StylePainter.java   | 28 +++++++++++++++++++++-
 2 files changed, 38 insertions(+), 2 deletions(-)

diff --git 
a/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/Scene2D.java
 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/Scene2D.java
index 95060330c8..98ff1e4107 100644
--- 
a/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/Scene2D.java
+++ 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/Scene2D.java
@@ -55,18 +55,28 @@ public final class Scene2D {
      */
     private double dpi = 96;
 
+    /**
+     * @param grid scene domain
+     * @param graphics to paint with
+     */
     public Scene2D(GridGeometry grid, Graphics2D graphics) {
         this.grid = Objects.requireNonNull(grid);
         this.graphics = Objects.requireNonNull(graphics);
     }
 
+    /**
+     * Graphics2D to use for painting data.
+     * This instance should be left untouched.
+     *
+     * @return Graphics2D
+     */
     public Graphics2D getGraphics() {
         return graphics;
     }
 
     /**
      * Set current rendering DPI.
-     * Default is 99.
+     * Default is 96.
      *
      * @param dpi new DPI
      */
diff --git 
a/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/StylePainter.java
 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/StylePainter.java
index e7e0532c5d..4a41426485 100644
--- 
a/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/StylePainter.java
+++ 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/StylePainter.java
@@ -24,15 +24,41 @@ import org.apache.sis.style.Style;
 
 
 /**
+ * A Painter is responsible for portraying and querying resource on a scene.
+ *
+ * Currently the API only support stateless rendering.
  *
  * @author Johann Sorel (Geomatys)
  */
 public interface StylePainter {
 
+    /**
+     * Get the supported style implementation this painter can portray.
+     *
+     * @return supported style class.
+     */
     Class<? extends Style> getStyleClass();
 
-    void paint(Scene2D scene, MapLayer layer);
+    /**
+     * Stateless portraying og the given map layer.
+     *
+     * @param scene parameters for rendering
+     * @param layer having supported style class.
+     * @throws RenderingException if an error occured while rendering
+     */
+    void paint(Scene2D scene, MapLayer layer) throws RenderingException;
 
+    /**
+     * Search for elements in the scene which intersect the given area.
+     *
+     * Any exception should be returned in the stream as 
ExceptionPresentations, this allows
+     * to still have some results even if a data caused an error.
+     *
+     * @param scene parameters of the scene
+     * @param layer to seach in
+     * @param mask to search for intersection
+     * @return a stream of presentation instances that intersect the searched 
area.
+     */
     Stream<Presentation> intersects(Scene2D scene, MapLayer layer, Shape mask);
 
 }

Reply via email to