This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch visual-test in repository https://gitbox.apache.org/repos/asf/sis.git
The following commit(s) were added to refs/heads/visual-test by this push: new 2213df437c Documentation fixes. 2213df437c is described below commit 2213df437c9de671d7973bf5c699f756b7910dea Author: Martin Desruisseaux <martin.desruisse...@geomatys.com> AuthorDate: Wed Dec 28 16:36:09 2022 +0100 Documentation fixes. --- .../org/apache/sis/swing/DeformableViewer.java | 2 +- src/main/java/org/apache/sis/swing/ImagePane.java | 1 - .../apache/sis/swing/InternalWindowListener.java | 2 +- .../org/apache/sis/swing/MouseReshapeTracker.java | 4 +-- .../apache/sis/swing/MouseSelectionTracker.java | 6 ++-- .../java/org/apache/sis/swing/SwingUtilities.java | 2 +- src/main/java/org/apache/sis/swing/Window.java | 2 +- .../java/org/apache/sis/swing/WindowCreator.java | 10 +++--- .../java/org/apache/sis/swing/ZoomChangeEvent.java | 8 ++--- src/main/java/org/apache/sis/swing/ZoomPane.java | 40 +++++++++++----------- .../org/apache/sis/swing/internal/Resources.java | 2 +- .../org/apache/sis/test/visual/IsolinesView.java | 3 +- 12 files changed, 40 insertions(+), 42 deletions(-) diff --git a/src/main/java/org/apache/sis/swing/DeformableViewer.java b/src/main/java/org/apache/sis/swing/DeformableViewer.java index d2cc0d22bd..3ca1197f60 100644 --- a/src/main/java/org/apache/sis/swing/DeformableViewer.java +++ b/src/main/java/org/apache/sis/swing/DeformableViewer.java @@ -20,7 +20,7 @@ import java.awt.geom.Point2D; /** - * An interface for viewers that may be deformed by some artefacts. For example the {@link ZoomPane} + * An interface for viewers that may be deformed by some artefacts. For example, the {@link ZoomPane} * viewer is capable to show a {@linkplain ZoomPane#setMagnifierVisible magnifying glass} on top of * the usual content. The presence of a magnifying glass deforms the viewer in that the apparent * position of pixels within the glass are moved. This interface allows for corrections of apparent diff --git a/src/main/java/org/apache/sis/swing/ImagePane.java b/src/main/java/org/apache/sis/swing/ImagePane.java index afa0f47f23..ee0642fcbb 100644 --- a/src/main/java/org/apache/sis/swing/ImagePane.java +++ b/src/main/java/org/apache/sis/swing/ImagePane.java @@ -43,7 +43,6 @@ import org.apache.sis.referencing.operation.matrix.AffineTransforms2D; * @author Martin Desruisseaux (Geomatys) * @version 1.3 * @since 1.1 - * @module */ @SuppressWarnings("serial") public class ImagePane extends ZoomPane { diff --git a/src/main/java/org/apache/sis/swing/InternalWindowListener.java b/src/main/java/org/apache/sis/swing/InternalWindowListener.java index b7715d3528..c0835b9ede 100644 --- a/src/main/java/org/apache/sis/swing/InternalWindowListener.java +++ b/src/main/java/org/apache/sis/swing/InternalWindowListener.java @@ -81,7 +81,7 @@ final class InternalWindowListener implements InternalFrameListener { } c = c.getParent(); } - return null; // We can't create a WindowEvent with a null source. + return null; // We cannot create a WindowEvent with a null source. } /** diff --git a/src/main/java/org/apache/sis/swing/MouseReshapeTracker.java b/src/main/java/org/apache/sis/swing/MouseReshapeTracker.java index 1f24646ebf..fad82753b6 100644 --- a/src/main/java/org/apache/sis/swing/MouseReshapeTracker.java +++ b/src/main/java/org/apache/sis/swing/MouseReshapeTracker.java @@ -58,7 +58,7 @@ import org.apache.sis.referencing.operation.matrix.AffineTransforms2D; * Controls the position and size of a rectangle which the user can move * with their mouse. For example, this class can be used as follows: * - * {@preformat java + * {@snippet lang="java" : * public class MyClass extends JPanel { * private final MouseReshapeTracker slider = new MouseReshapeTracker() { * protected void clipChangeRequested(double xmin, double xmax, double ymin, double ymax) { @@ -92,7 +92,7 @@ import org.apache.sis.referencing.operation.matrix.AffineTransforms2D; * g.fill(slider); * } * } - * } + * } * * @author Martin Desruisseaux (IRD, Geomatys) * @version 1.1 diff --git a/src/main/java/org/apache/sis/swing/MouseSelectionTracker.java b/src/main/java/org/apache/sis/swing/MouseSelectionTracker.java index b3716a7b88..3f2377a54c 100644 --- a/src/main/java/org/apache/sis/swing/MouseSelectionTracker.java +++ b/src/main/java/org/apache/sis/swing/MouseSelectionTracker.java @@ -47,11 +47,11 @@ import javax.swing.event.MouseInputAdapter; * * This controller should then be registered with one, and only one, component using the following syntax: * - * {@preformat java + * {@snippet lang="java" : * Component component = ... * MouseSelectionTracker control = ... * component.addMouseListener(control); - * } + * } * * @author Martin Desruisseaux (MPO, IRD, Geomatys) * @version 1.1 @@ -175,7 +175,7 @@ public abstract class MouseSelectionTracker extends MouseInputAdapter { * This is usually the same transform than the one used for drawing in a {@link java.awt.Graphics2D} object. * @return a geometric shape enclosing the last region to be selected by the user, * or {@code null} if no selection has yet been made. - * @throws NoninvertibleTransformException if the affine transform can not be inverted. + * @throws NoninvertibleTransformException if the affine transform cannot be inverted. */ public Shape getSelectedArea(final AffineTransform transform) throws NoninvertibleTransformException { if (ox == px && oy == py) { diff --git a/src/main/java/org/apache/sis/swing/SwingUtilities.java b/src/main/java/org/apache/sis/swing/SwingUtilities.java index 1d7d5604a5..232b09aebb 100644 --- a/src/main/java/org/apache/sis/swing/SwingUtilities.java +++ b/src/main/java/org/apache/sis/swing/SwingUtilities.java @@ -130,7 +130,7 @@ final class SwingUtilities extends Static { */ public static boolean showOptionDialog(final Component owner, final Object dialog, final String title, final ActionListener reset) { /* - * Delegates to Swing thread if this method is invoked from an other thread. + * Delegates to Swing thread if this method is invoked from another thread. */ if (!EventQueue.isDispatchThread()) { final boolean[] result = new boolean[1]; diff --git a/src/main/java/org/apache/sis/swing/Window.java b/src/main/java/org/apache/sis/swing/Window.java index 3079718c5a..2d9f8e7fe1 100644 --- a/src/main/java/org/apache/sis/swing/Window.java +++ b/src/main/java/org/apache/sis/swing/Window.java @@ -27,7 +27,7 @@ import javax.swing.WindowConstants; /** * Interfaces for windows created by {@link WindowCreator}. This interface is typically implemented * by {@link JDialog}, {@link JFrame} or {@link JInternalFrame} subclasses, but users can provide other - * implementation. For example an application developed on top of the <cite>NetBeans platform</cite> + * implementation. For example, an application developed on top of the <cite>NetBeans platform</cite> * may need to provide their own implementation for better integration with their platform. * * <p>Instances of {@code Window} are created by diff --git a/src/main/java/org/apache/sis/swing/WindowCreator.java b/src/main/java/org/apache/sis/swing/WindowCreator.java index d80adcf05e..0303fd9846 100644 --- a/src/main/java/org/apache/sis/swing/WindowCreator.java +++ b/src/main/java/org/apache/sis/swing/WindowCreator.java @@ -37,7 +37,7 @@ import org.apache.sis.swing.internal.Resources; * * <p>By default the new windows are instances of either {@link JDialog}, {@link JFrame} or * {@link JInternalFrame} - the latter case occurs if and only if this {@code WindowCreator} - * has a {@link JDesktopPane} ancestor. However this class provides a + * has a {@link JDesktopPane} ancestor. However, this class provides a * {@link #setWindowHandler(Handler)} method allowing users to plugin their own mechanism, * for example in order to integrate the widget in the NetBeans platform.</p> * @@ -128,7 +128,7 @@ public abstract class WindowCreator extends JComponent { * Creates new {@linkplain Window Windows} for the purpose of widgets extending {@link WindowCreator}. * The widget will typically use this handler as below: * - * {@preformat java + * {@snippet lang="java" : * public class Widget extends WindowCreator { * private JPanel accessoryContent = ...; * private Window accessoryWindow; @@ -142,10 +142,10 @@ public abstract class WindowCreator extends JComponent { * accessoryWindow.setVisible(true); * } * } - * } + * } * * The {@linkplain #DEFAULT default handler} will create new windows of kind - * {@link JDialog}, {@link JFrame} or {@link JInternalFrame}. However users can provide + * {@link JDialog}, {@link JFrame} or {@link JInternalFrame}. However, users can provide * a different handler to {@link WindowCreator}, for example in order to integrate the * windows with the NetBeans platform. */ @@ -252,7 +252,7 @@ public abstract class WindowCreator extends JComponent { public boolean showDialog(Component owner, final Component content, final String title) { /* * Workaround for the Mac L&F, where the internal dialog box has no border - * and can not be moved. We will use a native dialog window instead. + * and cannot be moved. We will use a native dialog window instead. */ if (UIManager.getLookAndFeel().getName().equalsIgnoreCase("Mac OS X")) { if (!(owner instanceof java.awt.Window)) { diff --git a/src/main/java/org/apache/sis/swing/ZoomChangeEvent.java b/src/main/java/org/apache/sis/swing/ZoomChangeEvent.java index 54d91c451e..9fb91648ad 100644 --- a/src/main/java/org/apache/sis/swing/ZoomChangeEvent.java +++ b/src/main/java/org/apache/sis/swing/ZoomChangeEvent.java @@ -39,9 +39,9 @@ public class ZoomChangeEvent extends EventObject { * are the affine transforms before and after the change respectively, then the following * relation must hold (within the limits of rounding error): * - * {@preformat java + * {@snippet lang="java" : * newZoom = oldZoom.concatenate(change) - * } + * } */ private final AffineTransform change; @@ -50,9 +50,9 @@ public class ZoomChangeEvent extends EventObject { * before and after the change respectively, then the following relation must hold (within * the limits of rounding error): * - * {@preformat java + * {@snippet lang="java" : * newZoom = oldZoom.concatenate(change) - * } + * } * * @param source the event source. * @param change an affine transform indicating the zoom change. diff --git a/src/main/java/org/apache/sis/swing/ZoomPane.java b/src/main/java/org/apache/sis/swing/ZoomPane.java index 896dc8f45a..0355670668 100644 --- a/src/main/java/org/apache/sis/swing/ZoomPane.java +++ b/src/main/java/org/apache/sis/swing/ZoomPane.java @@ -93,7 +93,7 @@ import static java.lang.Math.rint; * a geographic map with a content ranging from 10° to 15°E and 40° to 45°N should override * this method as follows: * - * {@preformat java + * {@snippet lang="java" : * public Rectangle2D getArea() { * return new Rectangle2D.Double(10, 40, 15-10, 45-40); * } @@ -108,7 +108,7 @@ import static java.lang.Math.rint; * text should use the default transform (the one provided by {@link Graphics2D}) for that purpose. * Example: * - * {@preformat java + * {@snippet lang="java" : * protected void paintComponent(final Graphics2D graphics) { * graphics.clip(getZoomableBounds(null)); * final AffineTransform textTr = graphics.getTransform(); @@ -132,9 +132,9 @@ import static java.lang.Math.rint; * The user can specify a different preferred area with {@link #setPreferredArea(Rectangle2D)}. * The user can also reduce zoomable bounds by inserting an empty border around the widget, e.g.: * - * {@preformat java + * {@snippet lang="java" : * setBorder(BorderFactory.createEmptyBorder(top, left, bottom, right)); - * } + * } * * <h2>Zoom actions</h2> * Whatever action is performed by the user, all zoom commands are translated as calls to @@ -158,7 +158,7 @@ import static java.lang.Math.rint; * </table> * * In above table, the last column gives the {@link String}s that identify the different actions - * which manage the zooms. For example to get action for zoom in, we can write + * which manage the zooms. For example, to get action for zoom in, we can write * <code>{@linkplain #getActionMap() getActionMap()}.get("ZoomIn")</code>. * * <h2>Scroll pane</h2> @@ -344,11 +344,11 @@ public abstract class ZoomPane extends JComponent implements DeformableViewer { * (CTRL or SHIFT). To obtain the {@link KeyStroke} object for action <var>i</var>, * we can use the following code: * - * {@preformat java + * {@snippet lang="java" : * final int key = DEFAULT_KEYBOARD[(i << 1)+0]; * final int mdf = DEFAULT_KEYBOARD[(i << 1)+1]; * KeyStroke stroke = KeyStroke.getKeyStroke(key, mdf); - * } + * } */ private static final int[] ACTION_KEY = { /*[0] Left */ KeyEvent.VK_LEFT, 0, @@ -799,7 +799,7 @@ public abstract class ZoomPane extends JComponent implements DeformableViewer { /** * Returns a bounding box that contains the logical coordinates of all data that may be displayed - * in this {@code ZoomPane}. For example, if this {@code ZoomPane} is to display a geographic map, + * in this {@code ZoomPane}. For example if this {@code ZoomPane} is to display a geographic map, * then this method should return the map's bounds in degrees of latitude and longitude (if the * underlying CRS is {@linkplain org.opengis.referencing.crs.GeographicCRS geographic}), in metres * (if the underlying CRS is {@linkplain org.opengis.referencing.crs.ProjectedCRS projected}) or @@ -999,10 +999,10 @@ public abstract class ZoomPane extends JComponent implements DeformableViewer { * Subclasses should also set the clip area to this bounding box in their {@link #paintComponent(Graphics2D)} * method <em>before</em> setting the graphics transform. For example:</p> * - * {@preformat java + * {@snippet lang="java" : * graphics.clip(getZoomableBounds(null)); * graphics.transform(zoom); - * } + * } * * @param bounds an optional pre-allocated rectangle, or {@code null} to create a new one. * @return the bounding box of the zoomable area, in pixel coordinates relative to this {@code ZoomPane} widget. @@ -1052,7 +1052,7 @@ public abstract class ZoomPane extends JComponent implements DeformableViewer { } /** - * Returns the current {@link #zoom} scale factor. For example a value of 1/100 means that 100 metres are + * Returns the current {@link #zoom} scale factor. For example, a value of 1/100 means that 100 metres are * displayed as 1 pixel (assuming that the logical coordinates of {@link #getArea()} are expressed in metres). * * <p>This method combines scale along both axes, which is correct if this {@code ZoomPane} has @@ -1088,7 +1088,7 @@ public abstract class ZoomPane extends JComponent implements DeformableViewer { } catch (NoninvertibleTransformException exception) { /* * Invoke the static method because we will not be able to invoke fireZoomChanged(…). - * This is because we can not compute the change. + * This is because we cannot compute the change. */ unexpectedException("setTransform", (Exception) exception); zoom.setTransform(tr); @@ -1104,11 +1104,11 @@ public abstract class ZoomPane extends JComponent implements DeformableViewer { * must express a change in logical units, for example, a translation in metres. * This method is conceptually similar to the following code: * - * {@preformat java + * {@snippet lang="java" : * zoom.concatenate(change); * fireZoomChanged(change); * repaint(getZoomableBounds(null)); - * } + * } * * If {@code change} is the identity transform, then this method does nothing and listeners are not notified. * @@ -1131,7 +1131,7 @@ public abstract class ZoomPane extends JComponent implements DeformableViewer { * must express a change in pixel units, for example a scrolling of 6 pixels toward right. * This method is conceptually similar to the following code: * - * {@preformat java + * {@snippet lang="java" : * zoom.preConcatenate(change); * // Converts the change from pixel to logical units * AffineTransform logical = zoom.createInverse(); @@ -1139,7 +1139,7 @@ public abstract class ZoomPane extends JComponent implements DeformableViewer { * logical.concatenate(zoom); * fireZoomChanged(logical); * repaint(getZoomableBounds(null)); - * } + * } * * If {@code change} is the identity transform, then this method does nothing and listeners are not notified. * @@ -1326,9 +1326,9 @@ public abstract class ZoomPane extends JComponent implements DeformableViewer { * If {@code oldZoom} and {@code newZoom} are the affine transforms of the old and new zoom respectively, * the change can be computed in such a way that the following relation hold within rounding errors: * - * {@preformat java + * {@snippet lang="java" : * newZoom = oldZoom.concatenate(change) - * } + * } * * <strong>Note: This method may modify the given {@code change} transform</strong> to combine several * consecutive {@code fireZoomChanged(…)} calls in a single transformation. @@ -2297,7 +2297,7 @@ public abstract class ZoomPane extends JComponent implements DeformableViewer { } /** - * Invoked when an affine transform can not be inverted. + * Invoked when an affine transform cannot be inverted. * Current implementation logs the stack trace and resets the zoom. * * @param methodName the caller method name. @@ -2367,7 +2367,7 @@ public abstract class ZoomPane extends JComponent implements DeformableViewer { abs((m10 = rint(r=tr.getShearY())) - r) <= EPS) { /* - * At this point the scale and shear coefficients can been rounded to integers. + * At this point the scale and shear coefficients can be rounded to integers. * Continue only if this rounding does not make the transform non-invertible. */ if ((m00!=0 || m01!=0) && (m10!=0 || m11!=0)) { diff --git a/src/main/java/org/apache/sis/swing/internal/Resources.java b/src/main/java/org/apache/sis/swing/internal/Resources.java index c056c73ad4..ef1678b91b 100644 --- a/src/main/java/org/apache/sis/swing/internal/Resources.java +++ b/src/main/java/org/apache/sis/swing/internal/Resources.java @@ -175,7 +175,7 @@ public final class Resources extends IndexedResourceBundle { * * @param locale the locale, or {@code null} for the default locale. * @return resources in the given locale. - * @throws MissingResourceException if resources can not be found. + * @throws MissingResourceException if resources cannot be found. */ public static Resources forLocale(final Locale locale) throws MissingResourceException { return getBundle(Resources.class, locale); diff --git a/src/main/java/org/apache/sis/test/visual/IsolinesView.java b/src/main/java/org/apache/sis/test/visual/IsolinesView.java index 9261764417..e778d69ed2 100644 --- a/src/main/java/org/apache/sis/test/visual/IsolinesView.java +++ b/src/main/java/org/apache/sis/test/visual/IsolinesView.java @@ -35,7 +35,7 @@ import java.awt.image.DataBuffer; import javax.swing.JComponent; import org.apache.sis.referencing.operation.matrix.AffineTransforms2D; import org.apache.sis.internal.coverage.j2d.RasterFactory; -import org.apache.sis.internal.processing.image.Isolines; +import org.apache.sis.internal.processing.isoline.Isolines; import org.apache.sis.swing.ZoomPane; import org.apache.sis.util.Classes; @@ -51,7 +51,6 @@ import org.apache.sis.util.Classes; * @author Martin Desruisseaux (Geomatys) * @version 1.1 * @since 1.1 - * @module */ public final class IsolinesView extends Visualization { /**