github-advanced-security[bot] commented on code in PR #884: URL: https://github.com/apache/incubator-baremaps/pull/884#discussion_r1688106305
########## baremaps-raster/src/test/java/org/apache/baremaps/raster/hillshade/HillShadeRenderer.java: ########## @@ -0,0 +1,160 @@ +/* + * 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.baremaps.raster.hillshade; + +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.nio.file.Path; +import javax.imageio.ImageIO; +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import org.apache.baremaps.raster.ImageUtils; + +public class HillShadeRenderer extends JFrame { + + private BufferedImage originalImage; + private double[] grid; + private JSlider altitudeSlider; + private JSlider azimuthSlider; + private JSlider scaleSlider; + private JCheckBox isSimpleCheckbox; + private JLabel imageLabel; + private JLabel altitudeLabel; + private JLabel azimuthLabel; + private JLabel scaleLabel; + + public HillShadeRenderer() throws IOException { + super("Hillshade Display"); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + // Load the image + originalImage = ImageIO.read( + Path.of("") + .toAbsolutePath() + .resolveSibling("baremaps/baremaps-raster/src/test/resources/fuji.png") + .toAbsolutePath().toFile()); + grid = ImageUtils.grid(originalImage); + + // Create UI components + altitudeSlider = new JSlider(JSlider.VERTICAL, 0, 90, 45); + azimuthSlider = new JSlider(JSlider.VERTICAL, 0, 360, 315); + scaleSlider = new JSlider(JSlider.HORIZONTAL, 1, 100, 10); // Scale from 0.1 to 10.0 + isSimpleCheckbox = new JCheckBox("Simple Algorithm", true); + imageLabel = new JLabel(); + altitudeLabel = new JLabel("Sun Altitude: 45°"); + azimuthLabel = new JLabel("Sun Azimuth: 315°"); + scaleLabel = new JLabel("Scale: 1.0"); + + // Set up sliders + altitudeSlider.setMajorTickSpacing(15); + altitudeSlider.setPaintTicks(true); + altitudeSlider.setPaintLabels(true); + + azimuthSlider.setMajorTickSpacing(45); + azimuthSlider.setPaintTicks(true); + azimuthSlider.setPaintLabels(true); + + scaleSlider.setMajorTickSpacing(10); + scaleSlider.setPaintTicks(true); + scaleSlider.setPaintLabels(true); + + // Add listeners + ChangeListener listener = new ChangeListener() { + public void stateChanged(ChangeEvent e) { Review Comment: ## Missing Override annotation This method overrides [ChangeListener.stateChanged](1); it is advisable to add an Override annotation. [Show more details](https://github.com/apache/incubator-baremaps/security/code-scanning/1518) ########## baremaps-raster/src/test/java/org/apache/baremaps/raster/contour/IsoLinesTest.java: ########## @@ -0,0 +1,52 @@ +/* + * 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.baremaps.raster.contour; + +import java.io.IOException; +import java.nio.file.Path; +import javax.imageio.ImageIO; +import org.apache.baremaps.raster.ImageUtils; +import org.junit.jupiter.api.Test; + +class IsoLinesTest { Review Comment: ## Unused classes and interfaces Unused class: IsoLinesTest is not referenced within this codebase. If not used as an external API it should be removed. [Show more details](https://github.com/apache/incubator-baremaps/security/code-scanning/1517) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
