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 f11bfb49ed feat(Map): add a first template of Map portrayer
f11bfb49ed is described below

commit f11bfb49ed2b0757eec07db73f4d35d2919ad00d
Author: jsorel <[email protected]>
AuthorDate: Thu Jan 25 17:13:44 2024 +0100

    feat(Map): add a first template of Map portrayer
---
 .../sis/map/service/LineSymbolizerPainter.java     |  39 ++++++
 .../org/apache/sis/map/service/MapPortrayer.java   | 148 +++++++++++++++++++++
 .../sis/map/service/PointSymbolizerPainter.java    |  39 ++++++
 .../sis/map/service/PolygonSymbolizerPainter.java  |  39 ++++++
 .../apache/sis/map/service/PortrayalException.java |  25 ++++
 .../sis/map/service/RasterSymbolizerPainter.java   |  39 ++++++
 .../main/org/apache/sis/map/service/SEPainter.java | 113 ++++++++++++++++
 .../org/apache/sis/map/service/StylePainter.java   |  35 +++++
 .../apache/sis/map/service/SymbolizerPainter.java  |  38 ++++++
 .../map/service/SymbolizerPainterDescription.java  |  43 ++++++
 .../sis/map/service/TextSymbolizerPainter.java     |  39 ++++++
 11 files changed, 597 insertions(+)

diff --git 
a/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/LineSymbolizerPainter.java
 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/LineSymbolizerPainter.java
new file mode 100644
index 0000000000..d5aa93c596
--- /dev/null
+++ 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/LineSymbolizerPainter.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.map.service;
+
+import java.awt.Graphics2D;
+import org.apache.sis.coverage.grid.GridGeometry;
+import org.apache.sis.map.MapLayer;
+import org.apache.sis.style.se1.Symbolizer;
+
+/**
+ *
+ * @author Johann Sorel (Geomatys)
+ */
+final class LineSymbolizerPainter extends SymbolizerPainter {
+
+    public LineSymbolizerPainter(Symbolizer<?> symbolizer) {
+        super(symbolizer);
+    }
+
+    @Override
+    public void paint(Graphics2D g, GridGeometry gridGeometry, MapLayer layer) 
{
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+}
diff --git 
a/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/MapPortrayer.java
 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/MapPortrayer.java
new file mode 100644
index 0000000000..9555b133e4
--- /dev/null
+++ 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/MapPortrayer.java
@@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.map.service;
+
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.image.BufferedImage;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ServiceLoader;
+import org.apache.sis.coverage.grid.GridExtent;
+import org.apache.sis.coverage.grid.GridGeometry;
+import org.apache.sis.coverage.grid.GridOrientation;
+import org.apache.sis.map.MapItem;
+import org.apache.sis.map.MapLayer;
+import org.apache.sis.map.MapLayers;
+import org.apache.sis.referencing.CRS;
+import org.apache.sis.referencing.CommonCRS;
+import org.apache.sis.style.Style;
+import org.apache.sis.util.ArgumentChecks;
+
+/**
+ * Draft.
+ * Class used to render a map using Java2D API.
+ *
+ * @author Johann Sorel (Geomatys)
+ */
+public final class MapPortrayer {
+
+    /**
+     * Reference all painters.
+     */
+    private static final Map<Class<? extends Style>,StylePainter> PAINTERS = 
new HashMap<>();
+
+    private GridGeometry grid = new GridGeometry(new GridExtent(360, 180), 
CRS.getDomainOfValidity(CommonCRS.WGS84.normalizedGeographic()), 
GridOrientation.REFLECTION_Y);
+    private BufferedImage image = new 
BufferedImage((int)grid.getExtent().getSize(0), 
(int)grid.getExtent().getSize(0), BufferedImage.TYPE_INT_ARGB);
+    private Graphics2D graphics = image.createGraphics();
+    private boolean valid = false;
+
+    static {
+        final ServiceLoader<StylePainter> loader = 
ServiceLoader.load(StylePainter.class, StylePainter.class.getClassLoader());
+        for (StylePainter painter : loader) {
+            PAINTERS.put(painter.getStyleClass(), painter);
+        }
+    }
+
+    public MapPortrayer() {
+    }
+
+    /**
+     * Update canvas.
+     *
+     * @param image image to write into, if null the graphics must be defined
+     * @param graphics graphics to paint into, if null the image must be 
defined
+     */
+    public synchronized void setCanvas(BufferedImage image, Graphics2D 
graphics) {
+        this.image = image;
+        if (graphics == null) {
+            graphics = image.createGraphics();
+            graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 
RenderingHints.VALUE_ANTIALIAS_ON);
+        }
+        this.graphics = graphics;
+        valid = false;
+    }
+
+    /**
+     * Update canvas area.
+     *
+     * @param grid GridGeometry of the rendered area
+     */
+    public synchronized void setGridGeometry(GridGeometry grid) {
+        ArgumentChecks.ensureNonNull("grid", grid);
+        this.grid = grid;
+        valid = false;
+    }
+
+    /**
+     * @return currently used Graphics2D, can be null
+     */
+    public synchronized Graphics2D getGraphics() {
+        return graphics;
+    }
+
+    /**
+     * @return currently used Image, can be null
+     */
+    public BufferedImage getImage() {
+        return image;
+    }
+
+    /**
+     * Paint given map.
+     *
+     * An image is created if not defined.
+     *
+     * @param map to paint, not null
+     * @throws PortrayalException
+     * @throws IllegalArgumentException if canvas is not property configured
+     */
+    public synchronized void portray(MapItem map) throws PortrayalException {
+
+        if (!valid) {
+            //check canvas configuration
+            if (grid == null) {
+                throw new IllegalArgumentException("Grid geometry has not been 
initialize");
+            }
+            if (graphics == null) {
+
+            }
+            valid = true;
+        }
+
+        //render given map
+        if (map == null || !map.isVisible()) return;
+        if (map instanceof MapLayer) {
+            portray((MapLayer) map);
+        } else if (map instanceof MapLayers) {
+            final MapLayers layers = (MapLayers) map;
+            for (MapItem item : layers.getComponents()) {
+                portray(item);
+            }
+        }
+    }
+
+    private void portray(MapLayer layer) throws PortrayalException {
+        final Style style = layer.getStyle();
+        if (style == null) return;
+        final StylePainter painter = PAINTERS.get(style.getClass());
+        if (painter == null) return;
+        painter.paint(graphics, image, grid, layer);
+    }
+
+
+}
diff --git 
a/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/PointSymbolizerPainter.java
 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/PointSymbolizerPainter.java
new file mode 100644
index 0000000000..081913a433
--- /dev/null
+++ 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/PointSymbolizerPainter.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.map.service;
+
+import java.awt.Graphics2D;
+import org.apache.sis.coverage.grid.GridGeometry;
+import org.apache.sis.map.MapLayer;
+import org.apache.sis.style.se1.Symbolizer;
+
+/**
+ *
+ * @author Johann Sorel (Geomatys)
+ */
+final class PointSymbolizerPainter extends SymbolizerPainter {
+
+    public PointSymbolizerPainter(Symbolizer<?> symbolizer) {
+        super(symbolizer);
+    }
+
+    @Override
+    public void paint(Graphics2D g, GridGeometry gridGeometry, MapLayer layer) 
{
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+}
diff --git 
a/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/PolygonSymbolizerPainter.java
 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/PolygonSymbolizerPainter.java
new file mode 100644
index 0000000000..4e22be7cba
--- /dev/null
+++ 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/PolygonSymbolizerPainter.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.map.service;
+
+import java.awt.Graphics2D;
+import org.apache.sis.coverage.grid.GridGeometry;
+import org.apache.sis.map.MapLayer;
+import org.apache.sis.style.se1.Symbolizer;
+
+/**
+ *
+ * @author Johann Sorel (Geomatys)
+ */
+final class PolygonSymbolizerPainter extends SymbolizerPainter {
+
+    public PolygonSymbolizerPainter(Symbolizer<?> symbolizer) {
+        super(symbolizer);
+    }
+
+    @Override
+    public void paint(Graphics2D g, GridGeometry gridGeometry, MapLayer layer) 
{
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+}
diff --git 
a/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/PortrayalException.java
 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/PortrayalException.java
new file mode 100644
index 0000000000..ca6ecd581b
--- /dev/null
+++ 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/PortrayalException.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.map.service;
+
+/**
+ *
+ * @author Johann Sorel (Geomatys)
+ */
+public class PortrayalException extends Exception {
+
+}
diff --git 
a/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/RasterSymbolizerPainter.java
 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/RasterSymbolizerPainter.java
new file mode 100644
index 0000000000..28778a405c
--- /dev/null
+++ 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/RasterSymbolizerPainter.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.map.service;
+
+import java.awt.Graphics2D;
+import org.apache.sis.coverage.grid.GridGeometry;
+import org.apache.sis.map.MapLayer;
+import org.apache.sis.style.se1.Symbolizer;
+
+/**
+ *
+ * @author Johann Sorel (Geomatys)
+ */
+final class RasterSymbolizerPainter extends SymbolizerPainter {
+
+    public RasterSymbolizerPainter(Symbolizer<?> symbolizer) {
+        super(symbolizer);
+    }
+
+    @Override
+    public void paint(Graphics2D g, GridGeometry gridGeometry, MapLayer layer) 
{
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+}
diff --git 
a/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/SEPainter.java
 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/SEPainter.java
new file mode 100644
index 0000000000..f93f9e23a0
--- /dev/null
+++ 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/SEPainter.java
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.map.service;
+
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.ServiceLoader;
+import java.util.stream.Stream;
+import org.apache.sis.coverage.grid.GridGeometry;
+import org.apache.sis.map.ExceptionPresentation;
+import org.apache.sis.map.MapLayer;
+import org.apache.sis.map.Presentation;
+import org.apache.sis.map.SEPortrayer;
+import org.apache.sis.map.SEPresentation;
+import org.apache.sis.style.Style;
+import org.apache.sis.style.se1.Symbolizer;
+import org.apache.sis.style.se1.Symbology;
+
+/**
+ *
+ * @author Johann Sorel (Geomatys)
+ */
+public final class SEPainter implements StylePainter {
+
+    /**
+     * Reference all painters.
+     */
+    private static final List<SymbolizerPainterDescription<?>> PAINTERS = new 
ArrayList<>();
+
+    static {
+        final ServiceLoader<SymbolizerPainterDescription> loader = 
ServiceLoader.load(SymbolizerPainterDescription.class, 
SymbolizerPainterDescription.class.getClassLoader());
+        for (SymbolizerPainterDescription painter : loader) {
+            PAINTERS.add(painter);
+        }
+    }
+
+    private static final SymbolizerPainter NONE = new SymbolizerPainter(null) {
+        @Override
+        public void paint(Graphics2D g, GridGeometry gridGeometry, MapLayer 
layer) {
+        }
+    };
+
+    @Override
+    public Class<? extends Style> getStyleClass() {
+        return Symbology.class;
+    }
+
+    @Override
+    public void paint(Graphics2D g, BufferedImage image, GridGeometry 
gridGeometry, MapLayer layer) {
+
+        final Map<Symbolizer, SymbolizerPainter> subPainters = new HashMap<>();
+
+        final SEPortrayer p = new SEPortrayer();
+        try (Stream<Presentation> presentations = p.present(gridGeometry, 
layer)) {
+
+            //process presentations in order
+            final Iterator<Presentation> ite = presentations.iterator();
+            while (ite.hasNext()) {
+                final Presentation presentation = ite.next();
+                if (presentation instanceof SEPresentation) {
+                    final SEPresentation sepre = (SEPresentation) presentation;
+                    final Symbolizer<?> symbolizer = sepre.getSymbolizer();
+                    SymbolizerPainter subPainter = subPainters.get(symbolizer);
+
+                    creation:
+                    if (subPainter == null) {
+                        subPainter = NONE;
+                        for (SymbolizerPainterDescription s : PAINTERS) {
+                            if (s.getSymbolizerClass().isInstance(symbolizer)) 
{
+                                subPainter = s.createRenderer(symbolizer);
+                                break;
+                            }
+                        }
+                        subPainters.put(symbolizer, subPainter);
+                    }
+
+                    if (subPainter == NONE) {
+                        continue;
+                    }
+
+                    subPainter.paint(g, gridGeometry, layer);
+
+                } else if (presentation instanceof ExceptionPresentation) {
+                    //todo
+                } else {
+                    //todo
+                }
+            }
+
+        }
+
+    }
+
+}
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
new file mode 100644
index 0000000000..699a110d85
--- /dev/null
+++ 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/StylePainter.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.map.service;
+
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import org.apache.sis.coverage.grid.GridGeometry;
+import org.apache.sis.map.MapLayer;
+import org.apache.sis.style.Style;
+
+/**
+ *
+ * @author Johann Sorel (Geomatys)
+ */
+public interface StylePainter {
+
+    Class<? extends Style> getStyleClass();
+
+    void paint(Graphics2D g, BufferedImage image, GridGeometry gridGeometry, 
MapLayer layer);
+
+}
diff --git 
a/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/SymbolizerPainter.java
 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/SymbolizerPainter.java
new file mode 100644
index 0000000000..c954bca315
--- /dev/null
+++ 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/SymbolizerPainter.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.map.service;
+
+import java.awt.Graphics2D;
+import org.apache.sis.coverage.grid.GridGeometry;
+import org.apache.sis.map.MapLayer;
+import org.apache.sis.style.se1.Symbolizer;
+
+/**
+ *
+ * @author Johann Sorel (Geomatys)
+ */
+public abstract class SymbolizerPainter {
+
+    protected final Symbolizer<?> symbolizer;
+
+    public SymbolizerPainter(Symbolizer<?> symbolizer) {
+        this.symbolizer = symbolizer;
+    }
+
+    public abstract void paint(Graphics2D g, GridGeometry gridGeometry, 
MapLayer layer);
+
+}
diff --git 
a/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/SymbolizerPainterDescription.java
 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/SymbolizerPainterDescription.java
new file mode 100644
index 0000000000..3022c94347
--- /dev/null
+++ 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/SymbolizerPainterDescription.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.map.service;
+
+import org.apache.sis.style.se1.Symbolizer;
+
+/**
+ *
+ * @author Johann Sorel (Geomatys)
+ */
+public interface SymbolizerPainterDescription<T extends Symbolizer> {
+
+    /**
+     * @return The symbolizer class handle by this renderer.
+     */
+    Class<T> getSymbolizerClass();
+
+    /**
+     * Create a renderer fixed for a symbol and a context.
+     *
+     * @param symbol : cached symbolizer
+     * @param context : rendering context
+     * @return SymbolizerRenderer or null if symbol is never visible.
+     */
+    SymbolizerPainter createRenderer(T symbol);
+
+    //TODO Glyph methods for legend
+
+}
diff --git 
a/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/TextSymbolizerPainter.java
 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/TextSymbolizerPainter.java
new file mode 100644
index 0000000000..f6aff9a3cd
--- /dev/null
+++ 
b/incubator/src/org.apache.sis.portrayal.map/main/org/apache/sis/map/service/TextSymbolizerPainter.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.map.service;
+
+import java.awt.Graphics2D;
+import org.apache.sis.coverage.grid.GridGeometry;
+import org.apache.sis.map.MapLayer;
+import org.apache.sis.style.se1.Symbolizer;
+
+/**
+ *
+ * @author Johann Sorel (Geomatys)
+ */
+final class TextSymbolizerPainter extends SymbolizerPainter {
+
+    public TextSymbolizerPainter(Symbolizer<?> symbolizer) {
+        super(symbolizer);
+    }
+
+    @Override
+    public void paint(Graphics2D g, GridGeometry gridGeometry, MapLayer layer) 
{
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+}

Reply via email to